Commit Graph
3 Commits
Author SHA1 Message Date
dotCooCoo 4431c965f4 Merge main into feat/plugin-api-javascript-runtime
JavaScript plug-in runtime errors preserve the jobs limit classification.
2026-11-26 10:19:52 -08:00
dotCooCoo 468b434c09 Plug-ins: a JavaScript plug-in's parameters keep their declaration order
Loading a JavaScript plug-in read its JSON into a map that sorts its keys and
wrote it out again before parsing the manifest, so `params` and each command's
`params` reached dialogs in alphabetical order. The manifest is now parsed from
the plug-in's own JSON (`Manifest::parse_text`), with its size still counted
without `script` and `source`, and a `.vcplugin` read from a folder has
`source` added to its own text instead of being written out again.
2026-11-24 23:52:00 -08:00
dotCooCoo e06015b295 Plug-ins: object filters written in JavaScript
An object filter may be a .vcplugin manifest with "runtime": "js" and the
.js file its script key names in the same folder. plugin.install {path},
plugin.inspect, plugin.reload and File > Open read the two together; the
host keeps them as one JSON object (the manifest with the script's text in
source), which plugin.install {dataBase64} also takes and which the grant's
SHA-256 covers.

Each run gets a new interpreter with no file, command or clock access, the
filter's instruction and time budgets, and a heap within the plug-in's
memory cap. run(input, params) returns the output a module returns, checked
the same way, and the document changes as one undo step. Syntax errors,
thrown errors, limits and a missing result name the plug-in and its script,
with the line and column when the interpreter reports them. A manifest
without script, an unsafe script name or a script over 8 MiB is refused
before the script is read.

Docs: docs/plugins.md (JavaScript filters), docs/mcp.md, progress line.
Part of #2193.
2026-11-22 08:26:24 -08:00