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:callCalling a route of the plugin's backend that the widget declares, with the command core:backend:call.
core:clipboard:writeCopying text to the clipboard, with the command core:clipboard:write.
core:config:writeWriting 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:contextLetting the host call the module's copilotContext() and copilotRows() functions.
core:dashboard:add-widgetAdding 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:querySending the widget's own request with more keys in its JSON body and receiving the answer, with the command core:data:query.
core:data:readReading the data trait.
core:data:streamReceiving the messages of the widget's stream, which the host opens as a WebSocket through the FINOS Workspace API, at the
data.streamEndpointof the widget.core:defaultThe lifecycle, error reporting and logs. Every widget always has it.
core:download:saveSaving a file for the user, with the command core:download:save.
core:export:provideLetting the Export entry call the module's exportOptions() and exportData() functions.
core:params:writeWriting 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:presetsListing, 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:callCalling a proxy that the widget declares, with the command core:proxy:call.
core:state:writeWriting to state.
core:ui:buttonPutting 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:menuPutting 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:notifyShowing the user a notice, with the command core:ui:notify.
core:ui:open-linkOpening 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.
| Command | Permission | Message | Behavior and limits |
|---|---|---|---|
core:asset:read | core: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:notify | core:ui:notify | { level, text }, where level is one of info, success, warning or error | The 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-link | core:ui:open-link | { url } | The host opens only links with the schemes https: and mailto:, and only after the user confirms. |
core:dashboard:add-widget | core: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 optional | The 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:write | core: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:save | core:download:save | { filename, mime }, with the file as the first buffer | The file may be at most 25 MiB, and the host cleans the file name. |
core:proxy:call | core: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:call | core: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:query | core:data:query | { body }, where body is a JSON object of at most 256 KiB | The 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:list | core: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:apply | core: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:save | core:presets | { name, isDefault }, where isDefault is optional | The 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 charactersThe 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.