mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
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.