Skip to main content

Plugin permissions and commands

A permission is something that a widget's manifest asks for and an admin approves. A command is the call that the module makes with experimental.invoke to use a permission. The host checks every command against the widget's effective permissions before it carries the command out.

A widget should ask only for the permissions that it uses. An organization can remove permissions for its users, so the module reads the capabilities trait before it calls a command and degrades gracefully when a permission is missing.

Permissions​

The list is generated from the permissions that the backend accepts in a manifest.

  • core:backend:call

    Calling a route of the plugin's backend that the widget declares, with the command core:backend:call.

  • core:clipboard:write

    Copying text to the clipboard, with the command core:clipboard:write.

  • core:config:write

    Writing to config and to config:<key>. Only the settings that the widget declares can be written, and each value must satisfy its setting.

  • core:copilot:context

    Letting the host call the module's copilotContext() and copilotRows() functions.

  • core:dashboard:add-widget

    Adding one of the plugin's own widgets that declares an artifact to the dashboard, with data that satisfies the artifact's schema, with the command core:dashboard:add-widget. The host takes it only right after the user picks one of the widget's actions that toggles nothing, and never on a shared dashboard.

  • core:data:query

    Sending the widget's own request with more keys in its JSON body and receiving the answer, with the command core:data:query.

  • core:data:read

    Reading the data trait.

  • core:data:stream

    Receiving the messages of the widget's stream, which the host opens as a WebSocket through the FINOS Workspace API, at the data.streamEndpoint of the widget.

  • core:default

    The lifecycle, error reporting and logs. Every widget always has it.

  • core:download:save

    Saving a file for the user, with the command core:download:save.

  • core:export:provide

    Letting the Export entry call the module's exportOptions() and exportData() functions.

  • core:params:write

    Writing to params and to param:<name>. Only declared names can be written, and the host coerces each value to the type of its parameter.

  • core:presets

    Listing, applying and saving the user's presets of the widget, with the commands core:presets:list, core:presets:apply and core:presets:save.

  • core:proxy:call

    Calling a proxy that the widget declares, with the command core:proxy:call.

  • core:state:write

    Writing to state.

  • core:ui:button

    Putting the navbar buttons that the widget declares in its actions in the card's header, and receiving an action event when the user clicks one.

  • core:ui:menu

    Putting the menu items that the widget declares in its actions in the card's options menu, and receiving an action event when the user picks one.

  • core:ui:notify

    Showing the user a notice, with the command core:ui:notify.

  • core:ui:open-link

    Opening a link after the user confirms, with the command core:ui:open-link.

Commands​

The call experimental.invoke(name, msg, { buffers, signal, timeout }) returns a promise that resolves to [value, DataView[]]. The call times out after 10 seconds unless the module passes a timeout or a signal. Buffers are ArrayBuffer objects or typed arrays.

CommandPermissionMessageBehavior and limits
core:asset:readcore:default, which every widget has{ path }, where the path names a file under assets/The call resolves to { path, size } and passes the file as the one buffer. The host checks the file against the approved version. Another path is an invalid_args error, and a file that the version does not contain is an out_of_scope error. A large file needs a longer timeout.
core:ui:notifycore:ui:notify{ level, text }, where level is one of info, success, warning or errorThe host shows the text as plain text of at most 500 characters, labelled with the plugin's name. It lets through 0.5 notices per second, with bursts of up to 5.
core:ui:open-linkcore:ui:open-link{ url }The host opens only links with the schemes https: and mailto:, and only after the user confirms.
core:dashboard:add-widgetcore:dashboard:add-widget{ widget, data, name }, where widget is the id of a widget of the same plugin that declares an artifact, and name is optionalThe host adds that widget to the dashboard, standalone and without parameters, holding data, as when the user adds an artifact from the chat. The data must satisfy the artifact's schema and may be at most 384 KiB. The host takes the call only within 10 seconds after the user picks one of the widget's actions, once for each pick, and otherwise it is an out_of_scope error. On a shared or locked dashboard, or when the dashboard does not take the widget, it is unavailable, and the pick is used up. The data is plain JSON: no NaN, infinite numbers, sparse arrays or objects other than plain objects. The call resolves to { instanceId }, the new widget's meta.instanceId. Without a name, the widget is named after the widget that added it, followed by "(static)". The new widget records which widget it was copied from and when, which the AI agent sees, and the user can rename it and change its description in its Settings.
core:clipboard:writecore:clipboard:write{ text }The text may be at most 1 MiB. The command rejects with unavailable when the browser refuses the write, for example when no action of the user in the widget came before it.
core:download:savecore:download:save{ filename, mime }, with the file as the first bufferThe file may be at most 25 MiB, and the host cleans the file name.
core:proxy:callcore:proxy:call{ id, args }The call runs a proxy that the widget declares, as Plugin proxies and secrets describes, and it resolves to the response body. It counts against the server call rate of 2 calls per second, with bursts of up to 10.
core:backend:callcore:backend:call{ route, args }The call runs a route of the plugin's backend that the widget declares, as Plugin backends describes, and it resolves to the route's JSON. It counts against the same server call rate as core:proxy:call.
core:data:querycore:data:query{ body }, where body is a JSON object of at most 256 KiBThe host builds the widget's own request, from its endpoint and the card's parameters, as for the data trait, adds the keys of body to the top of its JSON body, sends it through the widget's data connection and resolves to the answer's JSON, without the widget's dataKey. The endpoint's method must be POST, and otherwise the call is unavailable, as it is when the widget has no endpoint, a parameter has no valid value, the endpoint answers with an error or its answer is not JSON. A key that names a parameter of the widget placed in the body is an out_of_scope error, because the user sets it. The call counts against the same server call rate as core:proxy:call. A server-side grid, for example, sends each request for rows this way.
core:presets:listcore:presets{}The call resolves to { presets }, where each preset is { id, name, scope, isDefault } and scope is user or org. It lists the user's own presets of this widget first and then the organization's, as Presets describes.
core:presets:applycore:presets{ id }The host writes the preset's settings and state to this card, checked as a write to config and to state is, and the call resolves to {}. An id that is not one of the listed presets is an out_of_scope error.
core:presets:savecore:presets{ name, isDefault }, where isDefault is optionalThe host saves the card's current settings and state as a new preset of the user and resolves to { id }. The name is trimmed and has 1 to 80 characters, or the call is an invalid_args error. When the user already keeps as many presets of the widget as the organization allows, the call is a too_large error with the server's message. The host lets through 1 saves per second, with bursts of up to 3.

The preset commands are unavailable on a shared dashboard.

When the host refuses a call, the promise rejects with an Error whose name is one of not_granted, invalid_args, out_of_scope, rate_limited, too_large, unknown_command, timeout or unavailable. At most 32 calls may wait for an answer at the same time.

The messages that carry these calls between the frame and the host are on Plugin frame protocol.

Exports​

A module that returns exports from initialize offers the members exportOptions, exportData, copilotContext and copilotRows. The permissions core:export:provide and core:copilot:context allow the host to call them. The function exportOptions returns a list of export options, at most 16 of them, and each option has these fields:

  • idstringrequiredmatches ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$

    The id that the host passes to exportData. It is unique among the options.

  • labelstringrequired1 to 60 characters

    The text that the Export entry shows.

  • extensionstringrequiredmatches ^[A-Za-z0-9]{1,10}$

    The extension of the file, without a dot.

  • mimestringrequiredat most 192 characters, matches ^[a-z0-9][a-z0-9!#$&^_.+-]{0,63}\/[a-z0-9][a-z0-9!#$&^_.+-]{0,126}$

    The MIME type of the file, in the form type/subtype.

The host gives exportOptions 10 seconds, exportData 60 seconds, copilotContext 10 seconds and copilotRows 60 seconds. An export and the rows of copilotRows may each be at most 25 MiB, and the result of copilotContext may be at most 256 KiB.