Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ Claude Code function-hook UI and extensibility rules live in
| Path | Responsibility |
| --- | --- |
| `plugins/multi-<name>/provider.json` | A provider's manifest: name, label, kind (`direct` or `harness`), order, and usage text. Core reads these and names no provider. |
| `plugins/multi-<name>/src/adapter.ts` | A provider's adapter: sign-in, models, runtime, launcher flags, and account verb, loaded by core through `gateway/provider-adapter.ts`. |
| `plugins/multi-core/src/launcher.ts`, `serve.ts`, `launch/` | Launches the gateway and Claude Code (`launcher.ts`), or the gateway alone for a desktop app session the mod serves (`serve.ts`). `launch/` holds the shared gateway start (`gateway.ts`), the provider connection (`providers.ts`), the `/model` picker (`picker.ts`), worker types (`workers.ts`), the Claude executable probes (`claude.ts`), the session environment (`environment.ts`), the desktop handshake and picker rows (`desktop.ts`), and the installed front-door certificate (`certificate.ts`). |
| `plugins/multi-core/src/gateway/server.ts`, `request.ts`, `reply.ts`, `anthropic.ts` | Routes requests and manages sessions; request admission and identity; replies and failures; Anthropic passthrough headers and paths. |
| `plugins/multi-core/src/gateway/messages.ts`, `fetch.ts`, `tools.ts`, `responses.ts`, `bounded.ts`, `record.ts` | Shared protocol, outbound fetch, tool aliases, Responses translation and SSE reader, bounded maps, and the `isRecord` guard. |
| `plugins/multi-core/src/gateway/provider.ts`, `provider-adapter.ts`, `provider-request.ts` | The provider table read from the manifests, `providerOf`, `nativeSpelling`; the adapter contract and loader; the contract through which direct providers build their own requests. |
| `plugins/multi-core/src/gateway/front-door.ts`, `self-signed.ts`, `launch/front-door.ts` | The gateway as Claude Code's HTTPS proxy, so Remote Control stays on: CONNECT handling, the per-session certificate, and when a launch uses it. |
| `plugins/multi-core/src/gateway/executable.ts`, `process-tree.ts` | Resolves executables and manages child processes. |
| `plugins/multi-core/src/gateway/atomic-write.ts`, `state-lock.ts` | Protects files and serializes native state. |
| `plugins/multi-core/src/gateway/harness-settings.ts`, `mode-hook.ts`, `agent-definitions.ts`, `worker-catalog.ts` | Reads what a native run takes from Claude's settings (`readHarnessSettings`, `mergePermissions`, `nativeMode`, `nativeRules`), keeps one permission record per session, and resolves the Agent tool's `model` against each provider's worker catalog. |
| `plugins/multi-core/src/gateway/verdicts.ts`, `provider.ts` | Core verdict contract (Plan checks, no model calls) and the provider table. `server.ts` alone finalises served replies and terminal events. |
| `plugins/multi-core/src/gateway/mod-*.ts`, `display-rows.ts`, `nested-env.ts` | Claude Mods control-plane routes, per-session mod key (`mod-keys.ts`), compaction, policy, native action display rows, and the nested-`claude` environment restore. |
| `plugins/multi-<name>/src/adapter.ts` | A provider's adapter: sign-in, models, runtime, launcher flags, and account verb, loaded by core through `gateway/providers/adapter.ts`. |
| `plugins/multi-core/src/kit/` | The only files provider folders import core through: `adapter.ts` (adapter contract, request types, permission readers; kept light for Antigravity's per-tool-call hook), `util.ts` (Node-only helpers), `direct.ts` (direct-provider translation), `harness.ts` (shared harness runtime). |
| `plugins/multi-core/src/launcher.ts`, `serve.ts`, `launch/` | Launches the gateway and Claude Code (`launcher.ts`), or the gateway alone for a desktop app session the mod serves (`serve.ts`). `launch/` holds the shared gateway start (`gateway.ts`), the provider connection (`providers.ts`), the `/model` picker (`picker.ts`), worker types (`workers.ts`), the Claude executable probes (`claude.ts`), the session environment (`environment.ts`), the desktop handshake and picker rows (`desktop.ts`), the installed front-door certificate (`certificate.ts`), and the nested-`claude` environment restore (`nested-env.ts`). |
| `plugins/multi-core/src/gateway/server/` | Routes requests and manages sessions (`server.ts`, which alone finalises served replies and terminal events); request admission and identity (`request.ts`); replies and failures (`reply.ts`); Anthropic passthrough (`anthropic.ts`); the front door as Claude Code's HTTPS proxy, so Remote Control stays on (`front-door.ts`, `self-signed.ts`, with `launch/front-door.ts`); shared protocol types (`messages.ts`); and the core verdict contract (`verdicts.ts`: Plan checks, no model calls). |
| `plugins/multi-core/src/gateway/mod/` | Claude Mods control-plane routes (`routes.ts`, `bridge.ts`), the per-session mod key (`keys.ts`), native action display rows (`display-rows.ts`), receipts, and usage (`usage.ts`, `provider-usage.ts`). |
| `plugins/multi-core/src/gateway/providers/` | The provider table read from the manifests (`provider.ts`: `providerOf`, worker types); `nativeSpelling` (`spelling.ts`); the adapter contract and loader (`adapter.ts`); the Agent tool's worker types and models (`agent-definitions.ts`, `worker-catalog.ts`, `worker-models.ts`); one permission record per session (`mode-hook.ts`); and what a native run takes from Claude's settings (`harness-settings.ts`: `readHarnessSettings`, `mergePermissions`, `nativeMode`, `nativeRules`). |
| `plugins/multi-core/src/gateway/direct/` | The contract through which direct providers build their own requests (`request.ts`), Responses translation and SSE reader (`responses.ts`), conversation normalization, tool aliases, and token estimates. |
| `plugins/multi-core/src/gateway/harness/` | Shared by Cursor, Antigravity and Grok: the harness contract (`native-harness.ts`), session store, exchange registry, response builder, completion, notices, hand-back, and failure classifier; and, for Antigravity and Grok, the CLI harness base (`cli.ts`), process runner (`process.ts`), and text prompt preparation. |
| `plugins/multi-core/src/gateway/util/` | No Multi logic: executables and child processes, atomic writes, the state lock, bounded maps, outbound fetch, `settleOrAbort`, and the `isRecord` guard. `install/` copies `executable.ts` and `process-tree.ts` beside the installed bootstrap. |
| `plugins/multi-core/hooks/` | Claude Mods function hooks; `gateway.ts` is the single gateway client, state lives in `$.state`, timing in `$.clock`. `provider.ts` is the hooks' own provider table, checked against the manifests by `npm run check:providers`. `desktop.ts` reads the handshake of the gateway the mod starts in a desktop app session. |
| `plugins/multi-core/src/gateway/harness-*.ts` | Session store, exchange registry, response builder, completion, notices, and failure classifier (`harness-failure.ts`) shared by Cursor, Antigravity, and Grok; the CLI harness base (`harness-cli.ts`), process runner, and text prompt preparation shared by Antigravity and Grok. |
| `plugins/multi-core/src/account.ts`, `setup.ts`, `install/` | Accounts, bootstrap, plugin discovery, and installation. |
| `plugins/multi-openai/src/` | Codex authentication, models, request construction (`gateway-request.ts`), and instructions. |
| `plugins/multi-cursor/src/` | Cursor SDK harness, permissions, progress, requests, models, and workspaces. |
Expand All @@ -44,8 +41,9 @@ Claude Code function-hook UI and extensibility rules live in
Keep everything about one provider in its folder: core imports no provider code and
names no provider, so adding or removing a provider touches its folder and the hooks'
table in `plugins/multi-core/hooks/provider.ts`. Keep shared protocol
types and cross-provider helpers in `plugins/multi-core/src/gateway/`. Prefer
direct module imports, the existing repository convention. Platform-dependent code
types and cross-provider helpers in `plugins/multi-core/src/gateway/`. A provider
imports core only through `plugins/multi-core/src/kit/`; add an export there when a
provider needs one. Inside core, prefer direct module imports. Platform-dependent code
accepts an explicit `platform` option so every branch is unit-testable on Linux.

## Current execution contracts
Expand Down
Loading
Loading