Guides

Add a platform#

Adding a platform is one registry entry + one adapter — the framework's core design guarantee.

  • Registry (src/adapters/registry.ts): one { id, load: () => import(...) } entry, lazily loaded. Order is load-bearing for runtime host detection.
  • Adapter (src/adapters/<id>/index.ts): a class (typically extending BaseAdapter) declaring id, name, readonly paradigm, a capabilities literal, detectInstalled, the MCP installServer/uninstallServer, hook install per paradigm (or inherit the mcp-only skip), optional content-surface writers, and doctor health checks.
adapter
ts
// 1. src/adapters/registry.ts — one lazily-loaded entry
{ id: "myhost", load: () => import("./myhost/index.js").then((m) => m.default) },

// 2. src/adapters/myhost/index.ts — one adapter
export class MyHostAdapter extends BaseAdapter {
  id = "myhost";
  name = "My Host";
  readonly paradigm = "json-stdio";   // or "ts-plugin" | "mcp-only"
  capabilities = { /* per-event booleans, transports, … */ };
  detectInstalled(projectDir) { /* config-dir + marker files */ }
  installServer() { /* render ServerDef into the native dialect */ }
  // hook install per paradigm (or inherit the mcp-only skip),
  // optional content-surface writers, and doctor() health checks.
}

The escape hatch keeps the core thin: platform-exclusive MCP-server fields go through platforms.<id>.server (shallow-merged into the ServerDef), and per-surface verbatim fields go through extra on a CommandDef / SkillDef / SubagentDef (merged into the rendered frontmatter) — a thin universal core with a fat per-adapter tail.