Plugin package and manifest
A plugin is a package of files that adds widget types to FINOS Workspace. This page describes how a package is laid out and what each part of its manifest means. The JSON Schema of the manifest is on plugin.json.
The package
Every package lives in a directory that is named after the plugin and its version:
<plugin-id>/<version>/
plugin.json the manifest
entry.js the module, one bundled file
entry.css optional styles
assets/ optional: the icon, and files that the module reads with core:asset:read
skills/ optional: one markdown file for each skill that the plugin gives the agent
backend/ optional server-side code, which is never served to browsers
The names and sizes follow these rules:
- The plugin id consists of lowercase letters, digits and hyphens, and it starts with a letter. It matches
^[a-z][a-z0-9-]{1,47}$. - The version has the form
major.minor.patchand contains only numbers. It matches^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$. An approved version is immutable, so a change of any kind requires a new version directory. On a local stack, the app starts that directory for you, as Plugin lifecycle and administration describes. - A file name may contain letters, digits,
.,_and-. A package may not contain symbolic links. - A version may hold at most 200 files and 64 MiB by default. The deployment can lower or raise both limits.
- The file
plugin.jsonmay be at most 256 KiB.
The frame receives entry.js and the style sheets. It receives a file from assets/ only when the module asks for it with the core:asset:read command, which is described on Plugin permissions and commands. Nothing else in the package reaches the frame, which means that neither plugin.json nor backend/ is ever sent to a browser.
The manifest
The manifest describes the plugin, the permissions that it asks for and the widgets that it contributes. This example shows every top-level key with placeholder values:
{
"manifestVersion": 1,
"id": "<plugin-id>",
"version": "1.0.0",
"name": "<name shown to admins and users>",
"description": "<one or two sentences>",
"publisher": { "name": "<who publishes it>", "url": "https://<publisher site>" },
"icon": "assets/icon.svg",
"host": { "api": 1, "afm": "0.11" },
"checksum": "sha256-<printed by plugin_check --digest>",
"entry": { "module": "entry.js", "styles": ["entry.css"] },
"csp": { "img-src": ["https://<tile host>"] },
"cspNotes": { "img-src": "<why the frame loads images from that host>" },
"secrets": [{ "name": "<secret_name>", "purpose": "<what the key is for>" }],
"server": { "network": ["https://<api host>"], "proxies": [] },
"adminSettings": { "schema": {}, "defaults": {} },
"contributes": { "widgets": [], "skills": [] }
}
The manifest is closed, so an unknown key blocks the version. Every string and every list has a bound. The table is generated from the model that the backend validates the manifest with, so its limits are the ones that the backend enforces. A property whose type is a link has a table of its own on plugin.json.
A settings form that an organization's admin fills in. It must not hold secrets.
checksumstringrequiredpattern ^sha256-[A-Za-z0-9_-]{43}$The text sha256- followed by the base64url SHA-256 of the sorted lines that each hold a file's path, a zero byte, the file's SHA-256 in hexadecimal and a newline, for every file except plugin.json. The command plugin_check --digest prints it.
The widgets that the plugin contributes.
cspmap<string, string[]> | nulldefaultnullThe sources that the frame itself may reach, by directive.
cspNotesmap<string, string> | nulldefaultnullOne sentence for each directive in csp that explains why the frame needs it.
The data that the backend reads for the user.
2 nested properties
idstringrequiredpattern ^[a-z][a-z0-9_-]{0,63}$The data source's id, unique within the plugin.
purposestringrequiredmaxLength 300What the backend reads from the data source. Admins read this text in the review.
descriptionstringdefault""maxLength 300A short description of the plugin.
The module and the style sheets that the frame receives.
The host API version and the AFM version that the package is built against. A host that implements other versions blocks the package.
iconstring | nulldefaultnullA file under assets/ that serves as the plugin's icon.
idstringrequiredpattern ^[a-z][a-z0-9-]{1,47}$The plugin's id. It equals the name of the directory that holds the plugin's versions.
identity"none" | "pseudonymous"default"none"Whether the backend learns a pseudonymous id of the user.
manifestVersion1requiredThe version of the manifest format.
namestringrequiredminLength 1maxLength 80The name that admins and users see.
Who publishes the plugin. Admins see the values as the package states them, and Workspace does not verify them.
The secrets that proxies and backend routes send. A manifest never contains a value.
2 nested properties
namestringrequiredpattern ^[a-z][a-z0-9_]{0,63}$The secret's name, in lowercase letters, digits and underscores.
purposestringrequiredmaxLength 300What the secret is for. Admins read this text in the review.
What the server does for the plugin: the hosts that it calls, its proxies and its backend.
signaturesnulldefaultnullReserved. A manifest that sets it is blocked, because this host verifies no signatures.
versionstringrequiredpattern ^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$The version, in the form major.minor.patch with numbers only. It equals the name of the version's directory.
The host blocks a manifest that contains signatures, because this host does not implement them.
Widgets
The contributes.widgets list holds one entry for each widget type that the plugin offers.
{
"id": "<widget-id>",
"name": "<name in Add widget>",
"description": "<what it shows>",
"category": "<category in Add widget>",
"handles": [
{
"type": "<viz type>",
"definition": { "type": "object", "additionalProperties": false, "properties": {} },
"response": { "accepts": "json", "description": "<what the backend returns>" }
}
],
"standalone": false,
"artifact": { "description": "<when the agent shows it>", "data": { "type": "object", "additionalProperties": false, "properties": {} } },
"permissions": ["core:data:read"],
"server": { "proxies": [] },
"model": { "traits": {} },
"params": [],
"settings": { "schema": {}, "defaults": {} },
"grid": { "w": 20, "h": 12 },
"actions": [{ "id": "freeze", "label": "Create static widget", "icon": "table", "placement": "navbar" }]
}
Buttons in the card's header and items in its options menu. The host draws them, and sends the module an action event when the user picks one.
5 nested properties
iconstringrequiredOne of the icons that the host offers, by name, or an SVG file of the package under assets/. The host draws only the SVG elements and attributes that it allows.
idstringrequiredpattern ^[a-z][a-z0-9_-]{0,31}$The action's id, unique within the widget. The module receives it when the user picks the action.
labelstringrequiredminLength 1maxLength 40The text of the menu item, or the tooltip of the button.
placement"navbar" | "menu"requirednavbar puts a button in the card's header, menu puts an item in the card's options menu.
togglesstring | nulldefaultnullA boolean setting of the widget that the button switches on and off. The button shows as pressed while the setting is on. Only a navbar button toggles.
What the widget gives the agent when the user asks for it in the chat: when it is useful, and the data the agent may fill in.
categorystring | nulldefaultnullThe category in Add widget.
descriptionstringdefault""maxLength 300What the widget shows.
gridGridThe widget's size on the dashboard grid.
The viz types that the widget renders for backend widgets.
3 nested properties
definitionobject | nulldefaultnullThe JSON Schema of the data.<type> object that a backend writes for the type. It is closed and bounded.
responseResponseThe JSON that the backend's endpoint returns for the type.
typestringrequiredpattern ^[a-z][a-z0-9_-]{1,31}$The viz type that the widget renders. It is the "type" value in a backend's widgets.json, and it cannot be a built-in type.
idstringrequiredpattern ^[a-z][a-z0-9_-]{0,47}$The widget's id, unique within the plugin.
The module's own traits and what they are bound to.
namestringrequiredminLength 1maxLength 80The name that Add widget shows.
paramsobject[]maxItems 32The parameters of a standalone widget, written as in widgets.json. Every parameter has a paramName, and the names are unique.
permissionsstring[]maxItems 32The host permissions that the widget asks for.
The proxies and backend routes that the widget may call.
A form that the user edits for each widget instance.
standalonebooleandefaultfalseWhether the widget appears in Add widget on its own and needs no backend. A widget handles at least one type or is standalone.
subCategorystring | nulldefaultnullThe sub-category in Add widget.
An entry of handles has these properties:
definitionobject | nulldefaultnullThe JSON Schema of the data.<type> object that a backend writes for the type. It is closed and bounded.
responseResponseThe JSON that the backend's endpoint returns for the type.
typestringrequiredpattern ^[a-z][a-z0-9_-]{1,31}$The viz type that the widget renders. It is the "type" value in a backend's widgets.json, and it cannot be a built-in type.
Actions
A widget can put buttons in its card's header and items in the card's options menu. It declares each of them in actions:
iconstringrequiredOne of the icons that the host offers, by name, or an SVG file of the package under assets/. The host draws only the SVG elements and attributes that it allows.
idstringrequiredpattern ^[a-z][a-z0-9_-]{0,31}$The action's id, unique within the widget. The module receives it when the user picks the action.
labelstringrequiredminLength 1maxLength 40The text of the menu item, or the tooltip of the button.
placement"navbar" | "menu"requirednavbar puts a button in the card's header, menu puts an item in the card's options menu.
togglesstring | nulldefaultnullA boolean setting of the widget that the button switches on and off. The button shows as pressed while the setting is on. Only a navbar button toggles.
The host draws every action with its own button or menu item, so the plugin chooses only the text and the icon. The icon is one of the host's icons bell, calendar, chart, check, clock, code, columns, copy, database, download, edit, eye, filter, globe, grid, info, link, lock, maximize, pie-chart, play, refresh, search, settings, sliders, sparkles, star, table, upload, zap, zoom-in or zoom-out, or an SVG file of the package directly under assets/, such as assets/autosize.svg. An SVG icon is at most 16 KiB and holds only the elements circle, desc, ellipse, g, line, path, polygon, polyline, rect, svg and title with the attributes clip-rule, cx, cy, d, fill, fill-opacity, fill-rule, height, opacity, points, r, rx, ry, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, viewBox, width, x, x1, x2, xmlns, y, y1 and y2. Each attribute's value must fit a fixed pattern (numbers, path data, none, currentColor, a color name or a hex color, and transform functions), so an icon has no ids, no references and no CSS. It has no DOCTYPE or entity. A version whose icon breaks these rules is blocked when it is scanned. The host checks the file against the approved version, sanitizes it again before it draws it inline in the card, and drops anything outside these rules, so an icon cannot run a script, load a resource or style the page. Draw the icon with currentColor so that it follows the site's light or dark mode. A widget with navbar buttons has the permission core:ui:button, and a widget with menu items has core:ui:menu, and only then. A widget has at most 3 buttons and 8 menu items. When an admin removes one of the permissions, its actions leave the card.
When the user picks an action, the module receives { kind: "workspace-event", name: "action", id } on msg:custom. A button that toggles a boolean setting works like the card's raw-data button: the host switches the setting, saves it with the dashboard and shows the button as pressed while the setting is on, and the event carries pressed. The module reads the setting through its config trait, so it needs no write permission for it. On a shared dashboard the toggle is disabled, and every other action still reaches the module.
An action can turn the widget's current state into a widget of its own. With the permission core:dashboard:add-widget, right after the user picks an action, the module may add one of its plugin's widgets that declares an artifact, holding data that satisfies the artifact's schema. The new widget is standalone and has no parameters, like an artifact that the user adds from the chat. A widget with this permission also has an action that toggles nothing, since a toggle never lets it add a widget, and its plugin has a widget with an artifact. Plugin permissions and commands describes the command.
The id of a widget matches ^[a-z][a-z0-9_-]{0,47}$, and a viz type matches ^[a-z][a-z0-9_-]{1,31}$. A viz type cannot be one of the built-in types html, iframe, markdown, newsfeed and pdf. One plugin cannot handle the same type twice. When two plugins handle a type, the organization's admin chooses which of them renders it.
A type that a plugin handles works with any backend whose widgets.json declares a widget of that type and whose endpoint returns what response describes. The field response.accepts is json, the default, or file, which hands the module the answer's bytes as File answers describes. FINOS Workspace adds theme=dark or theme=light to the endpoint's query, which carries the site's mode, and it asks again when the user switches the mode, exactly as it does for markdown and html widgets. The backend's author decides what each mode looks like. The names theme and raw are reserved, so a backend's widgets cannot use them as query parameters of their own. Widget requests and Widget rows explain both names.
The permissions that a widget asks for are listed on Plugin permissions and commands, and the traits that model.traits binds are described on Plugin module contract.
Skills
A plugin can give the agent skills: instructions it follows for one kind of task, such as how to ask for the data a widget needs. Each skill is a markdown file under skills/ and an entry in contributes.skills:
"contributes": {
"widgets": [],
"skills": [
{ "slug": "forecast-charts", "description": "How to draw a forecast", "file": "skills/forecast.md" }
]
}
| Key | What it is |
|---|---|
slug | 2 to 50 characters: lowercase letters, digits and single -. Unique in the plugin. The user starts the skill with /skill:<slug>, and the agent can pick it up from its description. |
description | One line, at most 300 characters, which tells the agent when to use the skill. |
file | skills/<name>.md, UTF-8 text that is not empty and is at most 32 KiB. Unique in the plugin. |
The skills of a plugin that is approved and enabled for an organization appear in the Skills tab of every user of that organization, with the plugin's name and without edit or delete. They need no role grant. They go when the plugin is disabled or a later version drops them. A skill the user made with the same slug wins, and when two plugins use one slug the one whose id comes first in the alphabet wins. A skill file is part of the package: the version's checksum covers it, the reviewer sees each skill in the review and acknowledges it, and a file that differs from the approved one is not given out. A skill is text for the model, so it cannot run code or call tools by itself.
Artifacts
A widget with artifact is a component the agent can use in the chat: it shows the widget under its answer, filled with data it has from the conversation or from the tables it loaded. The user can add the card to a dashboard as a widget of the plugin, which keeps that data.
"artifact": {
"description": "Bars of x labels and y values, for a comparison across a few categories",
"data": {
"type": "object",
"additionalProperties": false,
"required": ["rows"],
"properties": {
"title": { "type": "string", "maxLength": 80 },
"rows": {
"type": "array",
"maxItems": 200,
"items": { "type": "object", "additionalProperties": false, "required": ["x", "y"], "properties": { "x": { "type": "string", "maxLength": 40 }, "y": { "type": "number" } } }
}
}
}
}
| Key | What it is |
|---|---|
description | At most 300 characters. Tells the agent when the component fits the question. |
data | The JSON Schema of the data the agent gives, in the form of a definition (below): an object, closed and bounded. The agent reads it to build the data, the agent drops what it does not name, and data over 256 KiB is refused. |
Nobody who wrote the data themed it: the widget follows the theme trait for what the data leaves open. The widget reads the data through its data trait, so it needs the permission core:data:read and, when it declares model.traits, a trait bound to data, as Plugin module contract describes. Its settings are the agent's config. In the chat the widget runs with core:data:read, core:ui:notify, core:clipboard:write, core:backend:call, core:state:write and core:asset:read, with its state kept in the card; a proxy, a write to params or config, a link or a download work once the widget is on a dashboard. A widget on a dashboard made from an artifact has no endpoint, so its data trait is the data it was made with.
The artifact is part of the version the reviewer approves: the review lists it, and a change to its description or its data schema is asked for again. Only users whose roles grant the widget are offered it, and the agent is told of the components of the plugins that are approved and enabled for the user's organization. The artifact travels to the browser as an artifact of the plugin type, as Agent query protocol describes.
Schemas
The definition of a handled type describes the data.<type> object that a backend writes for that type. It is a closed and bounded JSON Schema of at most 64 KiB and 8 levels of nesting. Every object has additionalProperties: false, or a value schema when the object is a map. Every array has maxItems and items, and every string has maxLength, enum, const or pattern. An enum has at most 100 values, and a pattern has at most 256 characters and no backreferences. The allowed keywords are $defs, $ref, additionalProperties, anyOf, const, default, description, enum, examples, exclusiveMaximum, exclusiveMinimum, items, maxItems, maxLength, maximum, minItems, minLength, minimum, oneOf, pattern, properties, required, title, type and uniqueItems. FINOS Workspace checks backends' widgets against the definition, and the AI agent reads it when it builds widgets of the type.
The settings and adminSettings entries describe forms that the host renders. A form is a flat object of at most 64 properties, and each property name consists of letters, digits and underscores. Each property has one of the types boolean, integer, number and string, and it may use the keywords default, description, enum, examples, maxLength, maximum, minimum, title and type. The host labels the control of a property with its title, or with the property name when there is no title, and shows its description in a hint beside the label. The form can mark properties as required. The defaults must satisfy the schema, and the settings of one instance may not exceed 32 KiB.
Checking a package
Before a package is placed on a server, its author can check it with the server's own validator. The commands run offline from the backend-api/backend directory:
python -m scripts.plugin_check <plugins dir>/<plugin-id>/<version>
python -m scripts.plugin_check --digest <plugins dir>/<plugin-id>/<version>
The first command runs discovery exactly as the server does. It checks the files, the links, the caps, the manifest, the policy, the proxies and the checksum. When the version would be blocked, it prints the reasons and exits with status 1. Warnings, such as a remote import or eval without 'unsafe-eval', do not block a version. The second command prints the checksum that belongs in plugin.json and the version digest that a deployer can pin.