Skip to content

Plugin system: host, SDK, capabilities, web host, and marketplace - #3993

Closed
ccdwyer wants to merge 112 commits into
pingdotgg:mainfrom
ccdwyer:wb/plugin-system
Closed

ccdwyer wants to merge 112 commits into
pingdotgg:mainfrom
ccdwyer:wb/plugin-system

Conversation

@ccdwyer

@ccdwyer ccdwyer commented Jul 15, 2026 •

Copy link
Copy Markdown

Adds a runtime plugin system: an in-process host, server + web plugin SDKs, capability
façades, an RPC/HTTP transport with plugin-aware auth scopes, a web UI host with
extension points, and a marketplace + install lifecycle. Supersedes the previous 8-PR
stack (#3725–#3732), consolidated here for review.

Authorship

Authored primarily by Claude Fable 5.0, with code reviews from Grok 4.5, GPT-5.6 Sol, GLM-5.2, and Kimi K3.

What a plugin can do

Surface How
Add tools the agent can call tools (served over MCP, per-client filtered)
Declare settings, host renders the form settings (schema-driven; validated + rendered by the host)
React to system events events (filtered stream, sliding backpressure)
Add instructions to the agent every turn context (host-composed, per-plugin + global byte budgets)
Veto agent approval requests policy (deny/defer only — a hook can never approve)
Ship an AI provider providers (4-method SPI; the host shim owns the other 9 adapter members)
Extend the chat UI message actions, routes, sidebar sections, commands, project actions
Storage, files, HTTP, VCS, secrets, … database, filesystem, httpClient, vcs, sourceControl, secrets, projections.read, environments.read, terminals, agents, textGeneration

Trust model

Plugins are in-process and full-trust, gated by manifest-declared capabilities with
install-time user consent — so the consent copy is written to say what each grant
actually means (e.g. events states plainly that it includes the full text of every
message). Where a capability could steer the agent, the design is asymmetric on
purpose: a policy hook can only make the system more restrictive, never less, so the
worst a broken plugin can do is block work — visible and recoverable — rather than
approve something the user never saw.

Hardening includes DNS-pinned SSRF egress validation (including NAT64 embeddings),
credential-stripping on cross-origin redirects, realpath filesystem containment,
per-plugin secret namespacing, a migration-time schema-namespace gate with
anchored-object validation, and tarball extraction limits. Blast-radius discipline is
uniform: plugin callbacks are timed out, failures are contained per event/turn/request,
and a hung or crashed plugin cannot stall a user's turn or take the host down.

Example plugins

Built outside this repo, against the SDKs as a third party would consume them:

  • workflow-boards-plugin — a
    board-as-state-machine workflow engine (46 RPC methods) built entirely on the plugin
    capability APIs; the largest real-world exercise of the surface.

  • t3code-plugins — three focused
    samples, each demonstrating a pairing:

    • guardrails (policy + context + settings) — teach the agent your rules
      AND enforce them
    • ollama (providers + httpClient) — a local model as a first-class provider
      via the 4-method SPI
    • worklog (events + database + web route) — react to the system, store it,
      show it

    Writing these from a foreign repo is also what drove the plugin-sdk-web split
    (portable . vs monorepo-only ./ui): its README documents the remaining
    integration gaps found along the way.

Review notes

  • All 15 Macroscope findings on this PR are fixed, each with a regression test where
    one could reach the behavior, and each replied to inline with its fixing commit.
  • Rebased onto current main. Typecheck green across all packages; full suites green
    (server 1769, web 1333, shared 305, contracts 230).

Note

Add plugin system with host, SDK, capabilities, web host, and marketplace

  • Introduces a full plugin lifecycle on the server: manifest schema, lockfile store, installer, marketplace fetcher, migrator, RPC dispatcher, runtime registry, and a PluginHost service that boots plugins during server startup.
  • Adds plugin capabilities exposed to server-side plugin code: agents, database (with namespace-enforced migrations), filesystem, HTTP client (with SSRF guards), secrets, source control, terminals, text generation, VCS, environments, and projections read.
  • Adds a web plugin SDK (@t3tools/plugin-sdk-web) and host singleton publication so plugin web bundles can share React, Effect, and contracts with the host via ESM import maps injected into every index.html response.
  • Adds PluginUiHost to the root route, which dynamically loads plugin web entries and registers routes (/_chat/$environmentId/p/$pluginId/$), sidebar sections, settings pages (/settings/$), command palette entries, and per-project actions.
  • Extends auth scopes to include plugin:<id>:(read|operate) and plugins:manage; standard-client grants implicitly satisfy plugin scopes without verbatim listing.
  • Adds thread owner field (user or plugin:<id>) throughout the orchestration stack: contracts, decider, projector, projection queries, client state, and relay; user-facing thread lists exclude plugin-owned threads.
  • Extends GitHubCli with draft PR creation, PR merge strategies, and fetching PR detail, checks, reviews, and review comments.
  • Adds generateBoardProposal to all text generation providers (Codex, Claude, OpenCode) running in a no-tool posture from a throwaway temp directory; Cursor and Grok providers return a structured unsupported error.
  • Includes a hello-board fixture plugin with server migrations, listNotes/addNote/exerciseCapabilities RPC methods, and a React notes UI with sidebar and route registration.
  • Risk: server startup now boots the plugin host and registers an ESM loader hook process-wide for host singleton resolution; any startup failure in plugin activation will surface as a lifecycle error.
📊 Macroscope summarized 26ae126. 109 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

>

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants