Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

feat: v0.7.0 plug-in SDKs for TypeScript and Rust, templates, and the creator template - #2

Merged
philbert440 merged 11 commits into
mainfrom
feat/creator-template
Oct 30, 2026
Merged

philbert440 merged 11 commits into
mainfrom
feat/creator-template

Conversation

@rivetphilbot

@rivetphilbot rivetphilbot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

The plug-in SDKs and templates for v0.7.0, paired with rivethub-runtime #108. The contract is pinned to rh 5d5cc274 on its release line. npm run check passes: lint, typecheck, tests, the contract check, the privacy scan and the Rust crates.

  • @rivethub/plugin-sdk (TypeScript): serve() answers health, views, actions, the canvas, tools, events and jobs on the plug-in socket. connect() gives the runtime client. A thrown Refusal becomes a 422 naming the bad field. Events are handled once per seq, and settings changes go to the settings handler.
  • rivethub-plugin (Rust): the same surface through a Plugin builder and a RivetHub client, with its types generated from the vendored schema.
  • Templates:
    • a checklist plug-in in TypeScript (with a canvas board) and in Rust;
    • a JavaScript template for rh's plug-in creator. npm run templates:install writes it to ~/.rivethub/plugin-templates/ on a node.
  • rivethub-plugin-dev runs any plug-in from stdin commands.

Proven end to end on a throwaway node: the plug-in ran under Landlock and was approved with a device certificate. Its page, actions and canvas went through the validating proxy, its tool went through rh mcp, and events and settings were delivered. An agent in creator mode built and fixed a plug-in from the logs.

Version 0.7.0: the SDK packages and the Rust crate. Templates start new plug-ins at 0.1.0.

The runtime's integration/next branch adds the plug-in host (CONTRACT row
B17, notes 50 to 60): the manifest, views, canvas, events, jobs, tools,
settings and the plug-in API. Vendor its schemas and regenerate
@rivethub/contract so the SDKs can build on those types.
serve() answers what rh asks on RIVETHUB_PLUGIN_SOCKET: GET /health, views,
actions (a thrown Refusal answers 422 naming its fields), canvas events,
tools (a thrown error answers isError), events and jobs. It drops an event
delivery it has already handled by seq, and gives the settings handler the
starting settings from GET /api/plugin/self and every settings.changed.

connect() calls rh on RIVETHUB_API_SOCKET with the per-start token: self(),
viewsChanged(), notify() and request() for any route the plug-in's
permissions name, with rh's refusals as RivetHubError. The manifest, view,
canvas and event types are the @rivethub/contract ones under their contract
names, Accepted for what a plug-in answers and Sent for what it receives.

rivethub-plugin-dev starts any plug-in the way rh does, standing in for its
own /api/plugin routes, and reads view, action, canvas, tool, event and job
commands from stdin.
npm run contract now also writes rust/rivethub-plugin/src/contract.rs: the
plug-in types reachable from the manifest, the plug-in socket and API
bodies and GatewayError, generated from the vendored accepted schema, so
the crate has no hand-written DTOs and contract:check keeps it fresh. For
these types the two schema directions differ only in what is required, so
one set of types reads what rh sends and writes what it accepts. Flags
default to false, lists and maps to empty, and ViewValue is an untagged
enum (Bool, Number, Text, List, Files) as in the runtime.

Plugin::new(state) registers view, action, canvas, tool, job, events and
settings handlers and serve() answers on RIVETHUB_PLUGIN_SOCKET with the
same behaviour as the TypeScript SDK: a ViewActionRefusal error answers
422, a failing tool answers isError, a repeated delivery is acknowledged
once and a failed one is retried. RivetHub calls the plug-in API socket
with the per-start token: own(), views_changed(), notify(), get(), post()
and request().

npm run rust runs rustfmt, Clippy with warnings as errors and the crate's
tests, and npm run check now includes it.
Each template is a plug-in to start from: a page whose view has a form
and a list (add, toggle and remove are actions, and a missing title is
refused beside the field), an add_item agent tool that also tells open
clients the page changed, and a session.placed subscription that lists
the sessions filed lately. The TypeScript one adds a canvas board: items
are nodes, a drag keeps their place, a double-click marks one done with
an upsert, and Delete removes it with a remove op. Both keep their state
in the plug-in's data folder and ask only for sessions.read.

Under Landlock a plug-in reads only its own directory and the program it
runs, so the TypeScript template runs dist/plugin.js, bundled with
esbuild by npm run build, and the Rust one its release binary. Icons are
names the desktop bundles. npm run rust now checks the Rust template too.
The README now names the repository rivethub-plugins and says what a
plug-in is, where the SDKs and templates live, what npm run contract
generates for each language, how a plug-in is written, confined, tried
with rivethub-plugin-dev and installed on a node, and that npm run check
covers the Rust code.
…or rh's plug-in creator

templates/javascript is the checklist with its canvas board in JavaScript
that Node runs as it is, plus a GUIDE.md that teaches an agent the build
loop and what plug-ins can draw and do. npm run templates:install copies
it into the node's <state>/plugin-templates/ with the SDK's TypeScript
sources in sdk/, which Node 22.18 and later runs without a build, so the
runtime's creator tools scaffold from it without fetching anything.
rh now offers a plug-in's tools to agents as <id>-<tool> and the creator's
as plugins-install, plugins-status and the rest, because Grok skips any
tool whose name holds a double underscore.
@philbert440
philbert440 merged commit 26a4f71 into main Oct 30, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants