SDK overview
The Plugin SDK is versioned with the Host. Worker protocol is 1.1. App protocol is 1.0. API version 1.0. Current matrix: Host 0.1.3, SDK 1.0.0.
Pick an implementation from the Worker runtime:
| Runtime | Language | Package | Source | Template | Host launch |
|---|---|---|---|---|---|
node |
TypeScript | @vibex/plugin-sdk |
packages/plugin-sdk |
ts-worker |
node --max-old-space-size=128 dist/worker.mjs |
node |
JavaScript | @vibex/plugin-sdk |
packages/plugin-sdk |
node-worker |
same |
python |
Python | vibex-plugin |
sdk/python |
python-worker |
Host-locked CPython 3.12.11 plus runtime/worker.py |
native |
Rust | vibex-plugin-sdk |
crates/plugin-sdk |
rust-worker |
spawn the binary at entrypoints.worker.path |
All four share the stdio JSON-line protocol, handler rules, generation semantics, and Host capability names. App surfaces ship definePluginApp in the TypeScript / JavaScript SDK. Python and Rust SDKs cover Worker.
Language chapters:
node packages/plugin-cli/dist/cli.js toolchainThe command prints local cli, contract, js, python, rust paths and templates. The contract file list is the required array from locate_toolchain.py; see Development workflow.
Transport
Each Worker has one stdio connection, one JSON object per line. Frame limit 1 MiB. Default request timeout 30 seconds. Cancellation is an explicit notification. stderr is scoped diagnostics.
Handshake:
- Host sends
initializewithprotocolRange: ["1.1"],hostVersion,pluginIdentity,packageDigest,generationId,declaredContributions,packageClass, andlimits(maxFrameBytes,requestTimeoutMs). - Worker replies
protocolVersion: "1.1",sdkVersion,registrations: [],requestedFeatures. - Host sends
activatewithpluginId,pluginVersion,generation,packageClass,grantedCapabilities. - Worker runs
setup, freezes the handler table, and replies with the registered handler list. - Later messages are
invoke/ping/dispose. Worker-to-Host useshost.callwithcapability,operation,input.
protocolVersion must be 1.1; otherwise the Host returns worker_protocol_unsupported.
Registration
Setup only registers handlers, then freezes. Duplicate ids, undeclared ids, or missing required handlers fail candidate activation. Handles from an old generation become stale after a new generation publishes. Further calls return a stable error. The Host starts a Runtime when a contribution needs it.
Handler regex: Contribution model.
Host capabilities
environment.host.call(capability, operation, input?) is the only Host RPC. Current Host behavior (crates/plugins/src/host_capability_broker.rs):
| capability.operation | Result |
|---|---|
runtime.execute plus any operation |
Spawn the locked Runtime, JSON on stdin, 120s timeout, 1 MiB input cap |
artifact.preview plus any operation |
Open preview. input needs a Host-issued artifactHandle (~30s, single use) and providerId |
artifact.readText / artifact.writeText |
artifact_not_found. Text I/O is on the artifact.editor App bridge |
storage.kv.get / put / delete / list |
In-process map isolated by plugin ID; cleared when the process exits |
storage.settings.get / put |
Echo current input. Persist settings in root config.json |
log.debug / info / warn / error |
Empty object; scoped diagnostics |
plugin.self.doctor |
{ pluginId, generation, diagnostics, recentCrashes } |
secrets.get / put / delete |
{ "present": false } |
network.fetch |
network_denied. Full Trust uses the language runtime |
files.read / write / stat / list |
files_root_denied |
conversation.read.get / conversation.append.enqueueInput |
conversation_scope_denied |
agent.invoke |
handler_not_visible |
events.subscribe / ack |
Placeholder success |
app.notify.toast |
Empty object |
| other | capability_unimplemented |
Isolated
Isolated execution is declared by a v5 manifest; see Plugin architecture. Author APIs match Full Trust. Python Isolated Workers import define_plugin_worker from vibex_plugin.isolated. Rust Isolated builds use --no-default-features --features isolated. The Host locks Isolated and managed interpreters to CPython 3.12.11 (python-build-standalone).

