| Status | Draft, open for comment |
| Started | 2026-11-12 |
| Apps | SolidCraft |
| Extends | RFC 0002 (plugins) |
| Related | #15100 (design forms), #15184 (shared panel host), #15112 (plugin runtime, phase 1), #4980 (streaming) |
Plugins should be able to add declarative panels, whole workspaces, and enough viewport and file support to hold a full custom manufacturing workflow. This RFC says how, without breaking the rules RFC 0002 already set.
One idea runs through every section: data in, commands out. A plugin sends the host data (a panel layout, rows, polylines). The host draws it with its own widgets and theme. When the user acts on it, the host calls one of the plugin's entries as an ordinary command. So everything a person can do in a plugin panel, an agent can do over MCP. Nothing the plugin sends is code, pixels or egui, with one exception added by amendment 1: a view background may be a WGSL fragment shader that the host checks, wraps and limits.
- The non-goal "CAM stays in-tree (#1153)" becomes "a full manufacturing workflow, CAM included, can ship as a plugin". Decided.
- Decision 2 relaxes to "WebAssembly first; Monty or Rhai may come later on the same command surface". Decided.
- The WIT package is
craft:plugin@0.1.0, replacingsolidcraft:plugin@1.0.0from #15112. Decided. - Network stays off. When it comes, it is a per-plugin permission the user grants, made by the host.
- Open question 2 of RFC 0002 (overlays and workspaces) gets the answer below.
- The host draws everything. Theme tokens only (a background shader, amendment 1, reads the theme's colours as uniforms and draws only behind the model). Plugins pick colour roles (
accent,ok,warn,series-1..8, a scalar ramp), never RGB. Every widget must exist in the web build before it can be declared. - The widget set is what gets reviewed. Each widget kind, slot and overlay type the host adds goes to the owner or Nate with 1280x720 pictures, once. Third-party plugins can only combine reviewed parts.
- Plugin UI stays in plugin places. It lives in its own panels, its own workspace, its own ribbon group or a menu slot. It never adds rows to built-in dialogs or toolbars. Each panel header carries the plugin's name and a plugin badge, so it can't pass as host UI. It can't open approval or permission dialogs, and text in it is never a clickable link.
- Declarations are versioned WIT records (
declarations.ui-version). If a declaration names a widget kind this build doesn't know, the host shows a "needs a newer SolidCraft" placeholder. It never refuses to load the plugin. - Bulk data uses buffers, not JSON. Millions of toolpath points are too much for JSON. The
buffersinterface has abufferresource the plugin fills once and hands toviewport,formatsorstoragecalls. Over MCP the same field takes base64 or a granted file.
The contract is one WIT package, craft:plugin@0.1.0, in 0015-plugin-ui/craft-plugin.wit. The file parses with wasm-tools component wit. Each interface is quoted in the section that explains it. JSON stays in two places only: the manifest plugin.json, and command arguments and results, which are data per RFC 0002 so one WIT serves every Craft app.
| Interface | Role |
|---|---|
types |
plugin-error variant, value, datum, colour roles, log levels |
buffers |
buffer and buffer-builder resources for bulk geometry and file bytes |
commands |
Host imports: execute, log, progress, cancelled, now-ms |
entries |
The plugin export that runs a manifest entry |
ui, ui-provider |
Panels and workspaces: records, host calls, and the plugin's declarations and event handler |
viewport, viewport-provider |
Overlay layers, timeline, picks |
formats, formats-provider |
Import and export slots |
storage, storage-provider |
Per-design data and blobs, migration |
Two worlds a plugin can target:
/// A plugin that only runs commands. Phase 1.
world command-plugin {
import commands;
import buffers;
export entries;
}
/// A plugin with panels, workspaces, overlays, file formats and design data.
/// Which parts the host wires up follows the manifest's `capabilities`.
world workbench-plugin {
include command-plugin;
import ui;
import viewport;
import formats;
import storage;
export ui-provider;
export viewport-provider;
export formats-provider;
export storage-provider;
}plugin.json is the only JSON a plugin ships. Its capabilities list says which optional interfaces the plugin uses. The host wires up only those, shows them on the approval screen, and refuses a component that imports an interface its manifest doesn't list.
{
"name": "manufacture",
"version": "1.4.0",
"world": "craft:plugin/workbench-plugin@0.1.0",
"capabilities": ["ui@0.1", "viewport@0.1", "formats@0.1", "storage@0.1"],
"permissions": ["clock"],
"entries": [
{"name": "pocket", "effect": "edit", "job": true},
{"name": "tool_edit", "effect": "edit"},
{"name": "ws_enter", "effect": "read", "deadline_ms": 1000}
]
}ui@0.1 covers ui and ui-provider, viewport@0.1 covers viewport and viewport-provider, and so on. A plugin with no capabilities targets command-plugin.
A panel is a static layout the plugin returns from ui-provider.describe at install time, plus data it sets at run time. Widgets bind to slash paths in that data. Forms reuse the #15100 design-forms field types, so plugin forms, design forms and feature dialogs all look the same.
/// Panels and workspaces. Host-drawn; a plugin ships no UI code.
interface ui {
use types.{value, datum, color-role, plugin-error};
enum dock-zone { left, right, bottom }
/// Layouts are flat: nodes refer to children by index. WIT has no
/// recursive types, and the flat form is easy to validate and limit.
record layout {
/// Index of the root node.
root: u32,
nodes: list<node>,
}
record node {
widget: widget,
}
enum field-kind { number, length, angle, text, toggle, choice, selection }
record field {
key: string,
label: string,
kind: field-kind,
/// For choice fields.
choices: list<string>,
/// Entry called when the value changes. Absent: read-only.
on-change: option<string>,
}
record column {
key: string,
label: string,
/// "length", "angle" and so on; shown in the user's units.
unit: option<string>,
}
enum selection-mode { none, single, multi }
record table-spec {
/// Data path of the rows, for example "/tools".
bind: string,
row-id: string,
columns: list<column>,
select: selection-mode,
on-select: option<string>,
on-edit: option<string>,
}
record button-spec {
label: string,
icon: option<string>,
entry: string,
}
record chart-series {
label: string,
role: color-role,
/// Data path of the x and y lists.
x: string,
y: string,
}
enum chart-kind { line, bar, scatter }
variant widget {
/// Children are indexes into layout.nodes.
group(list<u32>),
tabs(list<tab>),
split(split-spec),
toolbar(list<button-spec>),
button(button-spec),
form(form-spec),
item-list(list-spec),
item-tree(tree-spec),
table(table-spec),
chart(chart-spec),
text(string),
progress(string),
empty-state(string),
}
record tab { label: string, child: u32 }
record split-spec { vertical: bool, first: u32, second: u32 }
record form-spec { bind: string, fields: list<field> }
record list-spec { bind: string, on-select: option<string> }
record tree-spec { bind: string, on-select: option<string> }
record chart-spec { kind: chart-kind, series: list<chart-series> }
record panel-spec {
id: string,
title: string,
zones: list<dock-zone>,
layout: layout,
}
record ribbon-group { name: string, entries: list<string> }
record ribbon-tab { name: string, groups: list<ribbon-group> }
enum design-kind { part, assembly, sketch, drawing }
record workspace-spec {
id: string,
name: string,
/// Name from the app icon registry.
icon: string,
applies-to: list<design-kind>,
ribbon: list<ribbon-tab>,
/// Panel ids per zone.
panels: list<tuple<dock-zone, list<string>>>,
/// Host panels kept, for example "browser".
builtin-panels: list<string>,
/// Read-only entries with a 1 s deadline.
on-enter: option<string>,
on-exit: option<string>,
}
record declarations {
/// Bump when widget kinds are added; unknown kinds draw a placeholder.
ui-version: u32,
panels: list<panel-spec>,
workspaces: list<workspace-spec>,
}
enum event-kind { press, select, edit, change, enter, exit }
record ui-event {
panel: string,
event: event-kind,
path: string,
row: option<string>,
value: option<value>,
}
/// Host calls, available to a plugin that declares the "ui" capability.
/// Replace some or all of a panel's data. Merged once per frame.
set-data: func(panel: string, updates: list<datum>) -> result<_, plugin-error>;
clear-data: func(panel: string) -> result<_, plugin-error>;
/// Show or hide a panel in the current workspace.
show-panel: func(panel: string, visible: bool) -> result<_, plugin-error>;
}
/// What a UI plugin exports. Static declarations are read at install time,
/// so the approval screen can list them without running any entry.
interface ui-provider {
use types.{plugin-error};
use ui.{declarations, ui-event};
describe: func() -> declarations;
/// The host turns user actions into events. They run as ordinary commands.
on-event: func(event: ui-event) -> result<_, plugin-error>;
/// Called when a plugin workspace is entered or left, if declared.
on-enter: func(workspace: string) -> result<_, plugin-error>;
on-exit: func(workspace: string) -> result<_, plugin-error>;
}| Widgets | Form fields (from #15100), button, toolbar, list, tree, table, chart (line, bar, scatter), text, progress bar, empty state. Layout uses group, tabs and split. |
| Data | ui.set-data(panel, list<datum>) sets values at slash paths such as /tools/3/dia. The host merges updates once per frame. Units are shown in the user's units, and stored values are always mm or deg. |
| Events | entry, on-select, on-edit and on-change each name a manifest entry. The host delivers a ui-event to ui-provider.on-event, and entries run as <plugin>.<entry>. Ordinary commands: they're journaled and undoable, and the read or edit effect applies. |
| Docking | Through the shared panel host (#15184, panel_runtime), as a registered kind. Its allowed zones come from the manifest. It can't use PinOuter or Fill height, and placement memory is saved per workspace like built-in panels. |
| Permissions | None beyond the plugin being enabled. Declaring a panel is listed on the approval screen. |
| Limits | 8 panels per plugin. 512 widgets per layout. 1 MiB of data per panel. Tables and trees scroll virtually, up to 100,000 rows. Charts: 8 series, 20,000 points. |
| Design-changed listeners (phase 3) | A panel can name entries that re-run when the design changes, so a read-only check refreshes its list as the user works. Declared in the manifest, for example "listeners": [{"entry": "refresh", "on": ["design.changed"]}], and listed on the approval screen. Read-only: a listener entry may call only read commands and update its own panel with ui.set-data; it never edits the design or writes files. It runs only while the plugin's panel or workspace is open, never in the background. Debounced: one call per finished batch of changes, at most the rate of control.subscribe's design.changed (about 10 a second), and changes that finish while a call is still running are folded together, not queued: when that call returns, the host makes one more call if anything changed meanwhile, so the panel always ends on the latest design. A failing listener never fails the edit that triggered it; its error shows in its own panel. The first version carries a plain "the design changed" signal and no hooks on other user actions; typed events can come later from comparing document snapshots. Asked for in #1221 (2026-10-19), a parameter change re-running a slice, and #1221 (2026-11-17), a release check whose list shrinks as problems are fixed. |
An opt-in background role is specified in RFC 0002 section 6d. It can receive the same phase 3 design-changed signal with panels closed, under separate idle and call budgets. Ordinary panel listeners keep the open-panel lifetime above; neither kind may edit from an event callback.
Section 1 fixes a panel's layout at install time and changes only its data. That covers a table of tools or a list of operations, but not a workspace whose editors depend on what is selected: an operation list where a pocket row opens one set of fields and a drilling row another, or a setup that gains a fixture section. Asked for in #1221 (2026-11-20).
Two additions cover it, both still host-drawn from reviewed widget kinds, so a plugin never paints and never ships UI code:
repeat, for layouts that follow data. Arepeatnode names a data path holding a list and a template subtree. The host draws the template once per list item, with the template's paths relative to that item. Adding, removing or reordering items is then an ordinaryset-data, with no layout call. A row's kind can choose between templates (templateskeyed by a field of the item, for example/ops/3/kind), so a pocket row and a drilling row each get their own fields.update-layout, for structural changes data can't express. Nodes may carry akey, unique within the panel's layout (a template's keys are unique within that template); a layout or an update that would give two nodes the same key is refused with a typed error. An operation names its node with anode-ref: the node'skey, and for a node inside repeated rows the chain of rows it lies in, outermost first, each as the key of itsrepeatnode and the row's index in that list. So nested repeats, two repeats bound to the same data path, and the same template key in two rows are never ambiguous; anode-refwhose rows don't lead to exactly one node is refused with a typed error. A plugin sends a list of operations on keyed nodes: insert a subtree under a parent at an index, remove a node, move it, or replace one node's widget. The host applies one call's operations together: an invalid operation (unknown key, a cycle, an unreviewed widget kind, a limit exceeded) refuses the whole call with a typed error and leaves the layout as it was.
interface ui {
// Additions to section 1. `node` gains an optional key:
// record node { key: option<string>, widget: widget }
// and `widget` gains:
// repeat(repeat-spec),
record repeat-spec {
/// Data path of the list, for example "/ops".
bind: string,
/// Field of each item that picks its template; absent: one template.
kind-field: option<string>,
/// Template subtrees by kind ("" for the only one), as node indexes.
templates: list<tuple<string, u32>>,
}
/// A node to act on: `key` alone for a node of the static layout; for a node inside
/// repeated rows, `rows` from the outermost in: each its `repeat` node's key and the row's
/// index in that list.
record node-ref { key: string, rows: list<tuple<string, u32>> }
variant layout-op {
/// Insert the subtree `nodes` (its first node is its root) under `parent` at `index`.
insert(insert-spec),
remove(node-ref),
move(move-spec),
replace(replace-spec),
}
record insert-spec { parent: node-ref, index: u32, nodes: list<node> }
record move-spec { node: node-ref, parent: node-ref, index: u32 }
record replace-spec { node: node-ref, widget: widget }
/// Change a panel's layout. Applied with its data, at most once per frame.
update-layout: func(panel: string, ops: list<layout-op>) -> result<_, plugin-error>;
}| Updates | update-layout and set-data from one entry are merged together and drawn in the same frame, in the order they were sent. They belong to the entry's command transaction: if the entry fails or is cancelled, both are rolled back, as panel data is today. |
| Events | ui-event gains key: option<string>, the key of the node the user acted on, and for a widget inside a repeat, path names the item (/ops/3/depth). The plugin never needs to track node indexes. |
| Rate | Changes are sent when something changes, never per frame. At most 10 layout updates per second per panel are applied. An update over that rate is not refused: it waits, merged with any later updates and with the set-data sent after it, until the panel may take one again, so the order in which layout and data were sent is kept and the panel always ends on the latest of both. No plugin code runs while the host draws. |
| Limits | The section 1 limits apply to the layout after each update: 512 widgets per layout, counting every repeated row as drawn (virtual scrolling still applies to tables and trees), and a nesting depth of 16. At most 64 operations per call. A set-data that would make a repeat draw more than the widget limit is refused with the same typed error as an oversized layout, and the panel keeps its earlier data and layout; it is checked when the data is merged, so a list that grows past the limit fails there, not later while drawing. |
| Review | Only widget kinds already reviewed can appear, in a static layout, a template or an inserted subtree. repeat and keyed updates are host behaviour, reviewed once with 1280x720 pictures like any other widget. |
| Versions | ui-version goes to 2. A plugin that uses neither addition keeps working unchanged, and a host that predates them refuses the plugin with "update SolidCraft" when it declares ui@0.2. |
| Web | The same declarations and updates draw in the web build, like the rest of section 1. |
Today the app has two workspaces, Design and Render (ui.workspace, and the WorkspaceId in the panel layout). A plugin workspace adds a third kind, plugin:<id>/<workspace>. It uses the same switcher, the same layout memory and the same ui.workspace command.
A workspace is a workspace-spec in the declarations returned by ui-provider.describe, shown above: ribbon tabs and groups name entries, panels places panel ids per zone, and on-enter and on-exit name read-only entries.
| Host draws | The switcher item, the ribbon tabs with buttons sized by the host, and the starting panel layout (the user can rearrange it, and it's remembered). The viewport and the built-in panels named in builtin_panels stay host-owned. |
| Hooks | on-enter and on-exit are read entries with a short deadline (1 s). They can only update panels and overlays, never the design, so switching workspaces never edits or blocks anything. If a hook fails, the error shows in the workspace and the switch still happens. |
| Design tabs | applies_to works like Render. The workspace shows only for design kinds it lists, and the rest gray it out with a reason. |
| Icons | From the app's icon registry for now (see open question 3). |
| Limits | 2 workspaces per plugin. 6 ribbon tabs and 60 ribbon entries per workspace. Ribbon accents come from the theme's plugin accent. |
A plugin fills named overlay layers with data, and the host draws them in the 3D view with depth, picking and the theme. Playback runs on the host's own timeline scrubber. No plugin code runs per frame.
/// Overlay layers in the 3D view. Data only; nothing runs per frame.
interface viewport {
use types.{color-role, plugin-error};
use buffers.{buffer};
type point3 = tuple<f32, f32, f32>;
enum line-style { solid, dashed, dotted }
enum frame { world-mm, design-local }
/// How an item is coloured: a role, or a scalar per vertex mapped through
/// the theme ramp.
variant paint {
role(color-role),
ramp(buffer),
}
record polyline {
id: string,
/// vec3f buffer.
points: buffer,
/// Optional scalar32 buffer: time of each vertex, for the scrubber.
times: option<buffer>,
paint: paint,
style: line-style,
}
record point-set {
id: string,
points: list<point3>,
role: color-role,
}
record label {
id: string,
at: point3,
text: string,
}
/// A mesh that can move with the scrubber.
record mesh {
id: string,
/// vec3f and index32 buffers.
positions: buffer,
triangles: buffer,
ghosted: bool,
track: option<track>,
}
record track {
t-start: f32,
t-end: f32,
/// vec3f buffer: one translation per time step.
translate: buffer,
}
record face-tint {
id: string,
faces: list<string>,
role: color-role,
}
variant item {
polyline(polyline),
points(point-set),
label(label),
mesh(mesh),
face-tint(face-tint),
}
record layer {
name: string,
frame: frame,
pickable: bool,
items: list<item>,
}
record marker { t: f32, label: string }
record timeline { duration: f32, unit: string, markers: list<marker> }
/// What the host sends back when a pickable layer is clicked.
record pick {
layer: string,
item: string,
/// Segment or vertex index.
index: u32,
point: point3,
t: option<f32>,
}
/// Replace a layer. Over the limit: limit-exceeded, nothing drawn.
set-layer: func(layer: layer) -> result<_, plugin-error>;
remove-layer: func(name: string) -> result<_, plugin-error>;
set-timeline: func(timeline: timeline) -> result<_, plugin-error>;
}
interface viewport-provider {
use types.{plugin-error};
use viewport.{pick};
on-pick: func(hit: pick) -> result<_, plugin-error>;
}| Host draws | Polylines, points, triangle meshes (shaded or ghosted), screen-facing labels and face tints on real model faces. Each layer gets a row in the Browser with an eye toggle. Items with t or track follow the scrubber: play, pause, speed and step. The scrubber shows while a layer has time data. |
| Picking | When a pickable layer is clicked, the host calls viewport-provider.on-pick with a typed pick record. The index is the segment or vertex. Hover shows the plugin's label with no plugin call. Model picking is unchanged. Overlays never take selection from real geometry unless the user clicks the overlay itself. |
| Lifetime | Overlays are view state, not design state. They're cleared when the design closes or the plugin is turned off. A plugin that wants them back on reopen stores its source data (section 5) and rebuilds them in on-enter. |
| Limits | 4 million vertices and 16 layers per plugin. 256 MiB of buffers per plugin. 2,000 labels. When a limit is hit, the plugin gets a typed limit-exceeded error and nothing is drawn halfway. |
/// Import and export slots, shown in the app's Import and Export menus.
interface formats {
use types.{plugin-error};
use ui.{field};
enum slot-kind { import-slot, export-slot }
record format-slot {
id: string,
kind: slot-kind,
extensions: list<string>,
label: string,
/// Option fields drawn as a form before an export.
options: list<field>,
/// Export only: also reads the design's plugin data.
needs-plugin-data: bool,
}
record loss-item { what: string, detail: string }
/// An import becomes a new unsaved design, with a loss report.
record import-result {
commands: list<string>,
losses: list<loss-item>,
}
}
interface formats-provider {
use types.{datum, plugin-error};
use buffers.{buffer};
use formats.{format-slot, import-result};
slots: func() -> list<format-slot>;
/// Bytes of the one file the user picked, plus its name.
import-file: func(slot: string, name: string, data: buffer) -> result<import-result, plugin-error>;
/// Returns bytes; the host writes them to the path the user picked.
export-file: func(slot: string, options: list<datum>) -> result<buffer, plugin-error>;
}- Formats show up in Import and Export as file types, labelled with the plugin's name. The host opens the file picker. An import entry gets the bytes of the one file the user picked, plus its name. An export entry returns bytes, and the host writes them to the path the user picked. A plugin can't open other files unless a folder grant allows it (assemblies).
- A post-processor is just an export entry with an options form. It can read the design through commands and its own plugin data (section 5). Output goes only to a local file. There are no network or machine targets.
- An import becomes a new unsaved design with a loss report, as RFC 0002 already says. A backplot import may also set overlays.
- Limits: 1 GiB input, read in chunks (the #4980 streaming design), and 256 MiB output.
.sc container
plugins/manufacture/meta.json {"plugin": "manufacture", "plugin_version": "1.4.0", "format": 3}
plugins/manufacture/data.json setups, operations, tool numbers, refs to faces and edges
plugins/manufacture/blobs/... optional binary (cached toolpaths), may be dropped and rebuilt
The plugin reaches it through the storage interface:
/// Per-design plugin data, stored in the .sc container under the plugin's
/// own namespace. A plugin cannot reach another plugin's data.
interface storage {
use types.{json, plugin-error};
use buffers.{buffer};
/// The data's own format number, so the plugin can migrate.
format-version: func() -> u32;
/// The main document. `set` and `patch` are edits: one undo step.
get: func() -> result<option<json>, plugin-error>;
set: func(document: json) -> result<_, plugin-error>;
/// RFC 7396 merge patch.
patch: func(merge-patch: json) -> result<_, plugin-error>;
record blob-options {
/// Cache blobs may be dropped by "save without caches" and rebuilt.
cache: bool,
}
put-blob: func(name: string, data: buffer, options: blob-options) -> result<_, plugin-error>;
get-blob: func(name: string) -> result<option<buffer>, plugin-error>;
delete-blob: func(name: string) -> result<_, plugin-error>;
list-blobs: func() -> result<list<string>, plugin-error>;
}
interface storage-provider {
use types.{plugin-error};
/// First call after an update, told the previous format. One undoable edit.
migrate: func(from-format: u32) -> result<_, plugin-error>;
}- The command
storage.get,setandpatchonly reaches the calling plugin's own namespace.setis an edit: one undo step, and it's in the journal. Agents can read it over MCP like anything else in the design. - References to geometry use the engine's stable face and edge refs. A ref that breaks after an edit is reported in the plugin's panel, never silently retargeted.
- Plugin missing, off or older: the design opens normally. A quiet banner says "Contains Manufacture data (plugin 1.4). Install it to edit." The data is kept byte for byte and saved back unchanged. If the data's
formatis newer than the installed plugin, that plugin's part opens read-only with a warning. The rest of the design is unaffected. Nothing is ever downloaded or run on open. - After an update, the plugin's first call is told the previous
formatso it can migrate. The migration is saved as one undoable edit. - Limits: 16 MiB document and 256 MiB blobs per plugin per design. A plugin can mark blobs
cache, so "save without caches" can drop them.
- An entry can declare
"job": true. It then runs on a worker and gets a row in the existing operations panel (bottom right, red X to cancel) with the plugin's name and the entry's label.ui.operationslists it like any other operation. - It uses the
progress(fraction, message)andcancelled()calls #15112 already has. Cancel, or a changed design, means the result isn't adopted. That's the same rule the runtime uses today. - A job can push overlay and panel updates while it runs (a toolpath growing on screen), merged to at most 10 per second.
- Jobs get a separate budget: a 10 minute deadline by default, and a Preferences ceiling like the current fuel and memory fields. Ordinary command entries retain the 5 s guest compute default and 30 s default host ceiling; users can raise that ceiling for an approved request.
An independent plugin, manufacture, built outside the repo. It asks only for clock: no files, no network.
| Step | What happens |
|---|---|
| Install | The approval screen lists 1 workspace, 4 panels, 2 export formats and 1 import format, the commands it reads (model.faces, model.edges, model.mesh, inspect.measure), and that it stores data in designs. |
| Enter | The user picks Manufacture in the workspace switcher. ws_enter reads storage.get, fills the Setups tree and the Tool library table, and redraws the saved toolpaths as overlays. |
| Setup | Setup > New opens a form (stock size, work origin, which body). The user picks the origin corner in the viewport. That's a normal selection field from #15100. OK calls setup_new, which writes plugin data: one undo step. |
| Tools | The Tool library panel is a table plus a form. Editing a diameter calls tool_edit, which writes plugin data. A library shared across designs needs a granted folder (files) and is optional. |
| Toolpath | Pocket opens an operation form (faces, tool, stepover, depth). OK starts the pocket job. It shows in the operations panel, reads the faces through model.faces and model.mesh, and streams the path into layer toolpath:op3. When it finishes, it writes the operation and a cached path blob. |
| Inspect | Clicking a segment of the path calls on-pick with a pick record for layer toolpath:op3, item cut, index 1042, t 41.2. The plugin selects that operation in Setups and shows the feed rate at that point. |
| Simulate | The simulate job computes tool motion and a few stock meshes, then sends a mesh with a track plus a timeline. The user scrubs, plays and steps with the host scrubber. A chart panel shows load against time. |
| Post | Export > G-code: Haas mill shows the post options form and the host's file picker. post_haas reads the plugin data and returns text. The host writes the file. |
| Share | A colleague without the plugin opens the .sc file. The part is fine, the banner names the plugin, and the toolpath data survives their save. |
| Agent | An agent can do all of this over MCP: ui.workspace, manufacture.pocket {...}, storage.get, ui.operations. It can test it headless with plugin test, and overlay layers can be checked as data. |
| When | What |
|---|---|
| Phase 2 (with importers and exporters) | File format slots (section 4). Per-design plugin data with the missing-plugin fallback (section 5). Long jobs in the operations panel (section 6). Panels with forms, buttons, lists and tables, docked in the shared host (section 1). The craft:plugin rename and buffers. Web: the same declarations drawn by the web build. |
| Phase 3 | Workspaces (section 2). Viewport overlays with picking, timeline and scrubber (section 3). Trees and charts. Design-changed listeners for open panels (section 1). Layouts that change at run time (section 1a). A reference Manufacturing plugin outside the repo, used as the end-to-end test. |
| Later | Plugin icons (if agreed), Monty or Rhai on the same surface, and a per-plugin network permission. Parametric plugin features stay in their own phase, as in RFC 0002. |
Phase 1 (#15112, led by @raykholo) targets command-plugin and is unchanged apart from the package name.
- Security. Panels that pass as host UI: handled by badges, plugin places only, and no dialogs or links. Plugin text steering agents: labels and panel text reach agents marked as plugin text, the "result annotations" question from RFC 0002. Plugin data in a shared file is data only and never triggers an install.
- Performance. Millions of overlay vertices and fast panel updates: handled by buffers, frame merging, hard limits and virtual tables. The host's frame time must not depend on any plugin.
- Web build. Every widget and overlay type has to ship in the web build at the same time. Job workers need web workers. On the web, plugin data and file picks go through the browser's file handling, and jco has to carry buffers without copying them twice.
- ABI stability. The WIT stays small and is split into interfaces so a plugin imports only what it uses. UI declarations are versioned WIT records that only grow by addition, and new WIT versions keep the
craft:pluginpackage name. Unknown kinds get placeholders, never refusal. A plugin built forui: 1must keep working.
- CAM may ship as a plugin, and our own Manufacturing plugin is the phase 3 proof.
- The WIT package is
craft:plugin@0.1.0. - Monty or Rhai may come later, on the same command surface.
- Switcher placement. Should plugin workspaces sit beside Design and Render in the switcher, or under a "More" list until the user pins them? Open.
- Icons. Registry icons only, or also a plugin-supplied single-colour SVG that the host tints and checks? Open.
- Long jobs. Is a 10 minute default with a Preferences ceiling right for toolpath and simulation jobs? Open.
- Version after phase 3.
craft:plugin@0.1.0is the starting point. When does it move to 1.0.0? Open.
| Status | Draft, open for comment |
| Started | 2026-11-14 |
| Implements | shaders@0.1 |
A plugin cannot change how the view looks: everything it sends is data the host draws with its
own widgets. Look and theme authors ask for backgrounds the host does not have (a sky, a picture
that turns with the camera, a pattern that moves). This amendment adds them as a new versioned
capability, shaders@0.1. Nothing that loads today changes. A plugin built for commands@0.1
with today's manifest installs and runs exactly as before. The new manifest fields are optional.
A host that does not know a capability refuses it with the existing plain message ("needs shaders
0.1, which this version of SolidCraft does not have; update SolidCraft or the plugin").
A plugin may ship WGSL fragment shaders as text, listed in its manifest:
"capabilities": ["shaders@0.1"],
"shaders": [
{"id": "dusk", "name": "Dusk", "kind": "background", "source": "dusk.wgsl", "animated": true,
"textures": [{"name": "sky", "file": "sky.jpg"}]}
]The plugin writes one function, fn background(px: ScPixel) -> vec4<f32>. The host owns
everything else: the vertex and fragment entry points, one uniform block sc (view size, time,
display scale, camera axes, the theme's view, accent and text colours, dark or light), two samplers
and the declared textures. docs/plugin-shaders.md is the author guide.
| What it draws | Kind background only: behind the model in the 3D view, over the theme's background and under every other layer, like the Background picture preference. The user turns one on with a switch under its plugin's card in Preferences › Plugins, one at a time (background_shader, "<plugin>/<shader>", default none). A plugin's own settings sit under its card, not on other pages. A plugin never turns itself on. |
| Checks | At install and again at load, on the CPU, with naga (already a dependency): source at most 64 KiB, parses and validates with no WGSL extensions; no entry points, bindings, uniform, storage or workgroup variables, or overrides of its own; a background function. Errors name the file and the line. Install refuses a package whose shader would never draw. |
| GPU time | The host rewrites the module so every loop iteration and every call of the plugin's own functions spends one shared per-pixel budget of 1024: a private counter checked and decremented at the top of each loop body and each function, which breaks the loop or returns zero at 0. Nesting and call fan-out do not multiply it. WGSL has no recursion, so the work per pixel is bounded by the budget times the source size (64 KiB). This bounds the work; it cannot promise that a slow card never resets. If the device is lost while a plugin background is drawn, the app turns the background off before it restarts, and the restarted app says so. |
| Resources | 8 shaders per plugin, 4 textures per shader, 16 MiB per picture, scaled to 8192 px on a side and mipmapped by the host. One texture the size of the view. An animated shader redraws about 30 times a second while the window has the focus and 10 behind another window; a still one only when the view changes. |
| Fallback | Anything that fails (the plugin removed or turned off, a pipeline this graphics card refuses, a picture that does not decode) leaves the theme's background and puts one line in the status bar. Pipeline creation runs under wgpu error scopes, so a refusal is an error, never a crash. A failed choice is not retried every frame. |
| Redraws | A still background is drawn again only when its uniforms change (the view turns or resizes, the theme changes). |
| Colour | Linear: theme colours and texture samples are linear light, and so is the result. The host converts for the screen and premultiplies alpha on the screen's values, as egui blends. |
| Not in 0.1 | Panels, overlays or anything over the model; reading the model's depth or colour; state between frames; compute shaders; the web build (plugins are desktop only today). |
Why WGSL text and not data: a background is pixels by nature. The alternative, a fixed menu of host effects with parameters, would need a host change for every new look. The risk that "no code" guards against is a plugin passing as host UI or taking over the app. A background shader cannot: it draws only behind the model, reads only what the host binds, sees no design data beyond the camera's direction, has its work per pixel bounded, and runs only when the user picks it in Preferences. Agents see a chosen background only as the preference's value.
Next, each as its own version and review: panel materials (glass panels that bend what is behind
them, drawn from a backdrop the host provides), and a previous-frame texture for effects with
memory (a trail that stays where it was drawn).
- Additive only. A new capability adds optional manifest fields and new interfaces. It never changes or removes one that an existing capability uses.
commands@0.1keeps loading. A test installs acommands@0.1plugin from its.zipand runs it, on its own and beside a shader.- A host refuses a capability it does not have, or a newer minor version of a 0.x one, before any plugin code runs, with the existing message.
- Each capability a plugin asks for is shown on the install confirmation.
A plugin's own ribbon tab (tools@0.1), the groundwork for CAM, PCB, manufacturing and simulation
workspaces, is a separate amendment that builds on the entry slots added by
#15609.
Section 1's hand-written widget list is replaced by a vocabulary generated from the UI kit: a
plugin names a kit control and its props, and the host draws that exact control. The design, the
authoring forms (JSON, with a generated panel! macro and types), versioning and the migration of ui_version 1 panels are in
docs/design/plugin-ui.md. Data binding, keys, repeat,
update-layout, docking and the data limits above are unchanged; the note gives the caps for version 2 trees.
| Status | Asked for by the owner, 2026-11-30 |
| Started | 2026-12-01 |
| Implements | screen@0.1 |
Everything above is "data in, commands out": the host draws what a plugin describes. Some plugins
need to draw pictures themselves, frame by frame: a game on the screen of a modelled arcade
cabinet, a live gauge on a control panel, a simulation's output on the face it belongs to. This
amendment adds that as one new capability, screen@0.1. Like amendment 1 it is additive: nothing
that loads today changes, and a host without it refuses it with the existing message.
A screen plugin targets its own small world. It ships no UI and calls no app command:
interface screen-provider {
use types.{plugin-error};
use source.{file-info};
record frame { width: u32, height: u32, rgba: list<u8> }
record pointer-motion { x: f32, y: f32, dx: f32, dy: f32 }
variant input {
key-down(string), key-up(string),
pointer-move(pointer-motion), pointer-down(u8), pointer-up(u8),
focus(bool),
}
start: func(file: option<file-info>) -> result<_, plugin-error>;
tick: func(now-ms: u64, input: list<input>) -> result<option<frame>, plugin-error>;
}
world screen-plugin {
import log;
import source;
export screen-provider;
}The manifest declares the screen, with no entries and no commands:
"capabilities": ["screen@0.1"],
"runtime": {
"module": "arcade.wasm", "entries": [], "commands": [],
"screen": {"title": "Play Arcade", "width": 320, "height": 200, "aspect": [4, 3], "rate_hz": 35,
"file": {"label": "Level file", "extensions": ["lvl"]}}
}| Frames | RGBA bytes, rows top to bottom, at most the declared size (1024 a side): WIT list<u8>, never text or base64. The host checks the size of every frame. |
| Instance | Unlike an entry, which gets a fresh instance per run, a screen keeps one instance while it runs. start once, then tick at the declared rate, 60 a second at most. |
| Thread | The instance runs on a worker thread of its own. The window shows the last frame the worker finished and never waits for a tick. |
| Pause | A screen ticks only while its face is drawn and it has the keys. Time it spends paused does not count in now-ms. |
| Input | Keys are named as the web's KeyboardEvent.code names them, so the vocabulary is data and grows without a WIT change. Escape is the host's and is never sent: it takes the keys back. |
| File | The one file the user picks for the screen, read through the existing source interface (path "" only). No folders, no writes, no other paths. |
| Budgets | The manifest's fuel per call, its deadline for start, at most 250 ms per tick, its memory for the whole run. A screen that traps or runs out stops and the status bar says why; it is not called again. Its component may be as large as an importer's (64 MiB), so it can carry its own data. |
| Not in 0.1 | Sound, network, the clock beyond now-ms, app commands, panels. |
The user selects a face and chooses title on Face from the Plugins menu. The face is part of the
design, kept by its persistent name like a face's look (plugin.screen, one undo step, and a new
plugin_screens field in the design file), so it is found again after edits and when the design
opens. plugin.screens says whether each screen's face is still there, and the app says so when
it is gone instead of guessing another face. The picture is drawn upright and letterboxed in its
own shape on the face's bounds, a hair in front of it, in the 3D view and the Render workspace.
Flat faces come first; curved faces, mapped over the face's own parameters, are the next step.
Why pixels and not data: a game or a gauge is pixels by nature, and the alternative (a host widget per kind of picture) would need a host change for every one. A screen cannot pass as host UI or take over the app: it draws only on the face the user chose, sees nothing of the design, gets keys only after the user starts it, and always gives them back on Escape.
A docked panel showing a screen (the same frames in a plugin panel, with the pointer) builds on the same worker and contract, as its own small step.