This repository was archived by the owner on Nov 19, 2026. It is now read-only.
Repository navigation
feat: v0.7.0 plug-in SDKs for TypeScript and Rust, templates, and the creator template - #2
Merged
Merged
Conversation
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
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 checkpasses: 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 thrownRefusalbecomes a 422 naming the bad field. Events are handled once perseq, and settings changes go to the settings handler.rivethub-plugin(Rust): the same surface through aPluginbuilder and aRivetHubclient, with its types generated from the vendored schema.npm run templates:installwrites it to~/.rivethub/plugin-templates/on a node.rivethub-plugin-devruns 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.