Skip to content

Adapter Architecture ​

Host adapters are the integration layer between a specific coding-agent host and TokenPilot.

Current Adapters ​

From HOSTS.md:

HostStatusIntegration ModeInstall Surface
OpenClawproductionbundled plugin + embedded runtimepnpm component:install:tokenpilot:openclaw or npm --prefix components/adapters/openclaw run install:release
Codex CLIavailablehooks + local Responses proxy + shared CLInpm --prefix components/adapters/codex run build then npm --prefix components/adapters/codex run install:codex
Claude Codeavailablegateway routing + observability hooks + shared CLInpm --prefix components/adapters/claude-code run build then npm --prefix components/adapters/claude-code run install:claude-code
DeepSeek HarnessavailableNative Cordis plugin + opt-in eviction + durable status projectionBuild and pack the adapter, then add the .tgz through the Harness profile plugin installer; installation commands
piavailablein-process extension + native recovery tool + shared CLInpm --prefix components/adapters/pi run build then npm --prefix components/adapters/pi run install:pi
OpenCodeavailablein-process v1 plugin + recovery MCP + shared CLInpm --prefix components/adapters/opencode run build then npm --prefix components/adapters/opencode run install:opencode

Adapter Responsibilities ​

From adapters/README.md:

Keep these inside the adapter:

  • Host install and uninstall flow
  • Host config mutation
  • Request / response hook wiring
  • Session and transcript bridging
  • Host-specific command registration
  • Runtime bootstrap and doctor checks
  • Host-owned path resolution

Shared Packages ​

Host-agnostic logic lives in shared packages under components/packages/:

PackageRole
components/packages/foundation/host-adapter/Host abstraction contracts and envelope bridge helpers
components/packages/foundation/kernel/Shared contracts, events, and runtime-facing types
components/packages/foundation/runtime-core/Host-agnostic reduction, recovery, and archive primitives
components/packages/{foundation,features}/**Policy, history, and memory logic
components/packages/foundation/product-surface/Shared command semantics for the standalone CLI

Released under the MIT License.