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 HarnessavailableCordis plugin + durable projection + compatibility smokepnpm --filter @lightrsi/deepseek-harness-adapter compatibility:smoke -- --dsh-checkout=/absolute/path/to/deepseek-harness

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.