clikcode 0.0.0-stage → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1998 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/runtime/catalog.ts
21
+ var catalog_exports = {};
22
+ __export(catalog_exports, {
23
+ AI_LOCAL_HARNESSES: () => AI_LOCAL_HARNESSES,
24
+ AI_LOCAL_HARNESS_ADAPTER_VERSION: () => AI_LOCAL_HARNESS_ADAPTER_VERSION,
25
+ AI_LOCAL_HARNESS_CAPABILITIES: () => AI_LOCAL_HARNESS_CAPABILITIES,
26
+ HOME_REDIRECT_ENV_DEFAULTS: () => HOME_REDIRECT_ENV_DEFAULTS,
27
+ KEY_PROVIDERS: () => KEY_PROVIDERS,
28
+ allLocalHarnesses: () => allLocalHarnesses,
29
+ customAcpHarness: () => customAcpHarness,
30
+ getAiProvider: () => getAiProvider,
31
+ guardedPromptArgv: () => guardedPromptArgv,
32
+ harnessAcpLaunch: () => harnessAcpLaunch,
33
+ harnessCanRunTurns: () => harnessCanRunTurns,
34
+ harnessCarriesProvider: () => harnessCarriesProvider,
35
+ harnessIntegrationLevel: () => harnessIntegrationLevel,
36
+ harnessLoginArgvForModel: () => harnessLoginArgvForModel,
37
+ harnessModelAcceptsEffort: () => harnessModelAcceptsEffort,
38
+ harnessReplyError: () => harnessReplyError,
39
+ harnessSupportsEffort: () => harnessSupportsEffort,
40
+ harnessSupportsImages: () => harnessSupportsImages,
41
+ harnessSupportsModelSelection: () => harnessSupportsModelSelection,
42
+ harnessSupportsPermissionMode: () => harnessSupportsPermissionMode,
43
+ harnessTierRank: () => harnessTierRank,
44
+ harnessTurnTransport: () => harnessTurnTransport,
45
+ localHarnessCapabilityManifest: () => localHarnessCapabilityManifest,
46
+ localHarnessForCommand: () => localHarnessForCommand,
47
+ localHarnessForProvider: () => localHarnessForProvider,
48
+ maxPromptArgvBytes: () => maxPromptArgvBytes,
49
+ modelDisplayId: () => modelDisplayId,
50
+ modelIdFromDisplay: () => modelIdFromDisplay,
51
+ modelProvider: () => modelProvider,
52
+ modelSelectorArgv: () => modelSelectorArgv,
53
+ nativeHarnessTurnArgv: () => nativeHarnessTurnArgv,
54
+ permissionModeRefusedHere: () => permissionModeRefusedHere,
55
+ promptExceedsArgvLimit: () => promptExceedsArgvLimit,
56
+ registerCustomHarnesses: () => registerCustomHarnesses,
57
+ splitHarnessModel: () => splitHarnessModel,
58
+ splitProviderModel: () => splitProviderModel
59
+ });
60
+ module.exports = __toCommonJS(catalog_exports);
61
+
62
+ // packages/clikrouter/src/ai-local-harness.ts
63
+ var AI_LOCAL_HARNESS_ADAPTER_VERSION = 7;
64
+ var maxPromptArgvBytes = 96 * 1024;
65
+ var HOME_REDIRECT_ENV_DEFAULTS = {
66
+ GIT_CONFIG_GLOBAL: "~/.gitconfig",
67
+ NPM_CONFIG_USERCONFIG: "~/.npmrc",
68
+ // npx keeps every MCP server it runs here; one per profile was 2.5 GB.
69
+ NPM_CONFIG_CACHE: "~/.npm",
70
+ // pnpm's own cache and store, the same duplication for pnpm installs.
71
+ NPM_CONFIG_CACHE_DIR: "~/.cache/pnpm",
72
+ NPM_CONFIG_STORE_DIR: "~/.local/share/pnpm/store",
73
+ GH_CONFIG_DIR: "~/.config/gh",
74
+ DOCKER_CONFIG: "~/.docker",
75
+ GNUPGHOME: "~/.gnupg",
76
+ CARGO_HOME: "~/.cargo",
77
+ RUSTUP_HOME: "~/.rustup",
78
+ // The `junie` launcher reads its installed builds from ${JUNIE_DATA:-$HOME/.local/share/junie}/versions,
79
+ // empty under a private HOME ("[Junie] Error: No version found"); sign-in lives in ~/.junie, so it stays isolated.
80
+ JUNIE_DATA: "~/.local/share/junie",
81
+ SSH_AUTH_SOCK: null,
82
+ GIT_SSH_COMMAND: null
83
+ };
84
+ var HOME_REDIRECT_ENV_PASSTHROUGH = Object.keys(HOME_REDIRECT_ENV_DEFAULTS);
85
+ var SHARED_PROVIDER_MENU_LABELS = {
86
+ anthropic: "Anthropic",
87
+ openrouter: "OpenRouter",
88
+ openai: "OpenAI",
89
+ google: "Google Gemini",
90
+ xai: "xAI",
91
+ groq: "Groq",
92
+ cerebras: "Cerebras",
93
+ huggingface: "Hugging Face",
94
+ fireworks: "Fireworks AI",
95
+ mistral: "Mistral",
96
+ deepseek: "DeepSeek",
97
+ moonshot: "Moonshot AI",
98
+ "moonshot-cn": "Moonshot AI (China)",
99
+ zai: "Z.AI",
100
+ minimax: "MiniMax (minimax.io)",
101
+ together: "Together AI"
102
+ };
103
+ var OPENCODE_FAMILY = {
104
+ modelListFormat: "opencode-verbose",
105
+ transport: "acp",
106
+ integration: "structured",
107
+ parser: "opencode-json",
108
+ memoryFile: "AGENTS.md",
109
+ nativeSlashPassthrough: false,
110
+ customCommandDirs: [".opencode/command", "~/.config/opencode/command"],
111
+ // session/new configOptions `mode` (category mode): opencode build|plan (1.x), kilo code|ask|debug|orchestrator|plan.
112
+ acp: { argv: ["acp"], inheritCliOptions: false, sharedSessions: true, planModeId: "plan" },
113
+ localAuth: ["api-key", "oauth", "vendor-cli"],
114
+ loginArgv: ["auth", "login"],
115
+ providerLoginArgv: ["auth", "login", "--provider", "{provider}"],
116
+ // Kilo's list (a fork) names them the same; both checked signed out.
117
+ loginKeyRoutes: providerKeyRoutes([], { ...SHARED_PROVIDER_MENU_LABELS, openai: ["OpenAI", "Manually enter API Key"], google: "Google", xai: ["xAI", "Manually enter API Key"] }),
118
+ authFiles: [{ path: "${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json", contains: '"type"' }],
119
+ modelProviderSeparator: "/",
120
+ modelArgvPrefix: ["--model"],
121
+ modelDiscoveryArgv: ["models", "--verbose"],
122
+ workspaceArgvPrefix: ["--dir"],
123
+ effortArgvPrefix: ["--variant"],
124
+ effortValues: ["minimal", "low", "medium", "high", "max"],
125
+ // `ask` is the vendor's own `permission` config set by OPENCODE_PERMISSION (Kilo: KILO_PERMISSION): left unset, opencode/kilo write files and run
126
+ // shell without asking (live 1.18.32 / 7.7.6: hello.txt created). With edit+bash "ask" the same prompt was refused at the permission request
127
+ // ("permission requested: edit ...; auto-rejecting"); over ACP the request reaches ClikCode as session/request_permission.
128
+ permissionModes: ["ask", "bypass"],
129
+ permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--auto"] } },
130
+ permissionEnv: { ask: { OPENCODE_PERMISSION: '{"edit":"ask","bash":"ask"}' } },
131
+ normalizedPermissionOptionIds: ["auto-approve"],
132
+ imageArgvPrefix: ["--file"],
133
+ turn: { promptGuard: "double-dash", startArgv: ["run", "--format", "json", "--thinking"], resumeIdPrefix: ["--session"], output: "json-lines", responseFields: ["text", "content"] },
134
+ session: { resumeIdPrefix: ["--session"], discoverArgv: ["session", "list", "--format", "json"], discoverFormat: "json" }
135
+ };
136
+ var { customCommandDirs: _openCodeCommandDirs, normalizedPermissionOptionIds: _openCodePermissionAliases, ...OPENCODE_FORK_BASE } = OPENCODE_FAMILY;
137
+ var COMMAND_CODE_ACP = {
138
+ argv: ["acp"],
139
+ inheritCliOptions: false,
140
+ liveModelList: true,
141
+ effortConfigId: "effort",
142
+ planModeId: "plan"
143
+ };
144
+ var HERMES_REPLY_ERRORS = [
145
+ { pattern: "^(?:API call failed after \\d+ retries: )?HTTP (\\d{3})\\b" },
146
+ { pattern: "^No access token found for .+ login", status: 401 }
147
+ ];
148
+ var COPILOT_REPLY_ERRORS = [
149
+ { pattern: "^Error: .+ \\(Request ID: [0-9A-Fa-f:]+\\)$" }
150
+ ];
151
+ var GOOSE_REPLY_ERRORS = [
152
+ { pattern: "^Ran into this error: [\\s\\S]*Please retry if you think this is a transient or recoverable error\\.$" }
153
+ ];
154
+ var AUGGIE_REPLY_ERRORS = [
155
+ { pattern: "^\\s*(?:\u26A0\uFE0F\\s*)?\\*{0,2}You have run out of usage for\\b", status: 402 }
156
+ ];
157
+ var CURSOR_REPLY_ERRORS = [
158
+ { pattern: "(?:^|\\n\\n)Upgrade your (?:plan|account) to continue\\.?\\s*$", status: 402 },
159
+ { pattern: "(?:^|\\n\\n)Add a payment method to continue\\.?\\s*$", status: 402 },
160
+ { pattern: "(?:^|\\n\\n)Please sign in to continue\\.?\\s*$", status: 401 }
161
+ ];
162
+ var HERMES_AUTH_FILES = [
163
+ { path: "${HERMES_HOME:-~/.hermes}/auth.json", contains: '"access_token"' },
164
+ { path: "${HERMES_HOME:-~/.hermes}/.env", contains: "_API_KEY=" },
165
+ // A credential alone is not a usable setup: with auth.json and .env but no model block here, `hermes acp` ends "No LLM provider configured".
166
+ { path: "${HERMES_HOME:-~/.hermes}/config.yaml", contains: "model:\n default:" }
167
+ ];
168
+ var KEY_PROVIDERS = {
169
+ anthropic: { probe: "https://api.anthropic.com/v1/models", header: "x-api-key", headers: { "anthropic-version": "2023-06-01" }, prefixes: ["sk-ant-"] },
170
+ openrouter: { probe: "https://openrouter.ai/api/v1/key", prefixes: ["sk-or-"] },
171
+ openai: { probe: "https://api.openai.com/v1/models", prefixes: ["sk-proj-", "sk-svcacct-", "sk-admin-"], unprefixed: true },
172
+ google: { probe: "https://generativelanguage.googleapis.com/v1beta/models", header: "x-goog-api-key", prefixes: ["AIza"] },
173
+ xai: { probe: "https://api.x.ai/v1/models", prefixes: ["xai-"] },
174
+ groq: { probe: "https://api.groq.com/openai/v1/models", prefixes: ["gsk_"] },
175
+ cerebras: { probe: "https://api.cerebras.ai/v1/models", prefixes: ["csk-"] },
176
+ huggingface: { probe: "https://huggingface.co/api/whoami-v2", prefixes: ["hf_"] },
177
+ fireworks: { probe: "https://api.fireworks.ai/inference/v1/models", prefixes: ["fw_"], unprefixed: true },
178
+ mistral: { probe: "https://api.mistral.ai/v1/models" },
179
+ deepseek: { probe: "https://api.deepseek.com/models" },
180
+ moonshot: { probe: "https://api.moonshot.ai/v1/models" },
181
+ "moonshot-cn": { probe: "https://api.moonshot.cn/v1/models" },
182
+ zai: { probe: "https://api.z.ai/api/paas/v4/models" },
183
+ minimax: { probe: "https://api.minimax.io/v1/models" },
184
+ together: { probe: "https://api.together.xyz/v1/models" }
185
+ };
186
+ function providerKeyRoutes(first, labels) {
187
+ return Object.entries(labels).map(([provider, label]) => ({ provider, choose: [...first, ...typeof label === "string" ? [label] : label] }));
188
+ }
189
+ var LOCAL_BIN = "~/.local/bin";
190
+ var HARNESS_INSTALLERS = {
191
+ // Symlinks `cursor-agent` (and `agent`) into ~/.local/bin; on Windows it
192
+ // copies cursor-agent.cmd into %LOCALAPPDATA%\cursor-agent.
193
+ cursor: {
194
+ posix: { kind: "script", url: "https://cursor.com/install", binDirs: [LOCAL_BIN] },
195
+ windows: { kind: "script", url: "https://cursor.com/install?win32=true", binDirs: ["${LOCALAPPDATA}/cursor-agent"] },
196
+ docs: "https://cursor.com/docs/cli/installation"
197
+ },
198
+ // aider.chat's scripts install uv, then `uv tool install aider-chat`.
199
+ aider: {
200
+ posix: { kind: "script", url: "https://aider.chat/install.sh", binDirs: [LOCAL_BIN] },
201
+ windows: { kind: "script", url: "https://aider.chat/install.ps1", binDirs: [LOCAL_BIN] },
202
+ docs: "https://aider.chat/docs/install.html"
203
+ },
204
+ // block/goose now redirects to aaif-goose/goose: the project moved, it was
205
+ // not forked (same repository, homepage goose-docs.ai). CONFIGURE=false is
206
+ // the scripts' documented switch for not starting `goose configure`.
207
+ goose: {
208
+ posix: { kind: "script", url: "https://github.com/aaif-goose/goose/releases/download/stable/download_cli.sh", env: { CONFIGURE: "false" }, binDirs: [LOCAL_BIN] },
209
+ windows: { kind: "script", url: "https://raw.githubusercontent.com/aaif-goose/goose/main/download_cli.ps1", env: { CONFIGURE: "false" }, binDirs: [LOCAL_BIN] },
210
+ docs: "https://goose-docs.ai/docs/getting-started/installation"
211
+ },
212
+ // A single binary: /usr/local/bin when writable (already on every PATH, so
213
+ // not listed), else ~/.local/bin. There is no Windows script; the
214
+ // documented install there is uv's.
215
+ openhands: {
216
+ posix: { kind: "script", url: "https://install.openhands.dev/install.sh", binDirs: [LOCAL_BIN] },
217
+ windows: { kind: "uv-tool", package: "openhands", python: "3.12", binDirs: [LOCAL_BIN] },
218
+ docs: "https://docs.openhands.dev/openhands/usage/cli/installation"
219
+ },
220
+ // Installs uv if needed, then mistral-vibe (which ships `vibe` and `vibe-acp`).
221
+ vibe: {
222
+ posix: { kind: "script", url: "https://mistral.ai/vibe/install.sh", binDirs: [LOCAL_BIN] },
223
+ windows: { kind: "uv-tool", package: "mistral-vibe", binDirs: [LOCAL_BIN] },
224
+ docs: "https://docs.mistral.ai/vibe/code/cli/install-setup"
225
+ },
226
+ // --non-interactive / -NonInteractive: the scripts' own switch for skipping
227
+ // the stages that ask (API keys, settings) -- ClikCode signs in separately.
228
+ hermes: {
229
+ posix: { kind: "script", url: "https://hermes-agent.nousresearch.com/install.sh", args: ["--non-interactive"], binDirs: [LOCAL_BIN] },
230
+ windows: { kind: "script", url: "https://hermes-agent.nousresearch.com/install.ps1", args: ["-NonInteractive"], binDirs: ["${LOCALAPPDATA}/hermes/bin"] },
231
+ docs: "https://hermes-agent.nousresearch.com/docs/getting-started/installation"
232
+ },
233
+ // `kiro-cli` into ~/.local/bin on Linux. On macOS the script installs the
234
+ // Kiro CLI app into /Applications, whose bundle carries the binary; on
235
+ // Windows an MSI into Program Files.
236
+ kiro: {
237
+ posix: { kind: "script", url: "https://cli.kiro.dev/install", binDirs: [LOCAL_BIN, "/Applications/Kiro CLI.app/Contents/MacOS"] },
238
+ windows: { kind: "script", url: "https://cli.kiro.dev/install.ps1", binDirs: ["${ProgramFiles}/Kiro-Cli", "${ProgramFiles}/Kiro-Cli/bin"] },
239
+ docs: "https://kiro.dev/docs/cli/installation/"
240
+ },
241
+ // A native Go binary -- no Node, no npm -- at ~/.local/bin/agy.
242
+ antigravity: {
243
+ posix: { kind: "script", url: "https://antigravity.google/cli/install.sh", binDirs: [LOCAL_BIN] },
244
+ windows: { kind: "script", url: "https://antigravity.google/cli/install.ps1", binDirs: ["${LOCALAPPDATA}/agy/bin"] },
245
+ docs: "https://antigravity.google/docs/cli/install/"
246
+ },
247
+ // The ACP adapter is a separate Python extra, so installing only
248
+ // deepagents-code would leave `dcode --acp` unusable.
249
+ dcode: {
250
+ posix: { kind: "uv-tool", package: "deepagents-code", with: ["deepagents-acp"], binDirs: [LOCAL_BIN] },
251
+ windows: { kind: "uv-tool", package: "deepagents-code", with: ["deepagents-acp"], binDirs: [LOCAL_BIN] },
252
+ docs: "https://github.com/langchain-ai/deepagents/blob/main/libs/acp/README.md"
253
+ },
254
+ devin: {
255
+ posix: { kind: "script", url: "https://cli.devin.ai/install.sh", binDirs: [LOCAL_BIN] },
256
+ windows: { kind: "script", url: "https://static.devin.ai/cli/setup.ps1", binDirs: ["${LOCALAPPDATA}/devin/cli/bin"] },
257
+ docs: "https://docs.devin.ai/cli"
258
+ },
259
+ junie: {
260
+ posix: { kind: "script", url: "https://junie.jetbrains.com/install.sh", binDirs: [LOCAL_BIN] },
261
+ windows: { kind: "script", url: "https://junie.jetbrains.com/install.ps1", binDirs: [LOCAL_BIN] },
262
+ docs: "https://junie.jetbrains.com/docs/junie-cli.html"
263
+ },
264
+ mcode: {
265
+ posix: { kind: "script", url: "https://filecdn.minimax.chat/public/install.sh", binDirs: ["~/.minimax-code/bin"] },
266
+ windows: { kind: "script", url: "https://filecdn.minimax.chat/public/install.ps1", binDirs: ["~/.minimax-code"] },
267
+ docs: "https://github.com/MiniMax-AI/minimax-code"
268
+ }
269
+ };
270
+ var CATALOG_HARNESSES = [
271
+ { command: "claude", modelStrategy: "claude-table", quotaProbe: true, nativeStateDir: ".claude", modelCatalogFiles: ["settings.json"], subagents: { read: "transcript", steer: "relay" }, capabilities: { childActivity: true, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: true, backgroundTerminals: true, workflows: true }, provider: "anthropic", displayName: "Claude Code", titleSource: "vendor", defaultModel: "opus", tier: "primary", transport: "acp", acp: { binary: "claude-agent-acp", npmPackage: "@agentclientprotocol/claude-agent-acp@0.84.0", argv: [], inheritCliOptions: false, listsModels: false, effortConfigId: "effort", planModeId: "plan", sharedSessions: true }, integration: "structured", parser: "claude-stream-json", memoryFile: "CLAUDE.md", nativeSlashPassthrough: true, customCommandDirs: [".claude/commands", "~/.claude/commands"], effortValues: ["low", "medium", "high", "xhigh", "max"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "claude", authFiles: [{ path: "${CLAUDE_CONFIG_DIR:-~/.claude}/.credentials.json" }], authEnv: ["ANTHROPIC_API_KEY"], npmPackage: "@anthropic-ai/claude-code", loginArgv: ["auth", "login"], loginSteps: [{ when: "Login successful. Press Enter to continue", send: "{enter}" }], statusArgv: ["auth", "status"], logoutArgv: ["auth", "logout"], modelArgvPrefix: ["--model"], effortArgvPrefix: ["--effort"], bypassRefusedAsRoot: true, permissionModes: ["ask", "bypass", "auto"], permissions: { ask: { argv: ["--permission-mode", "manual", "--permission-prompts", "none"], acpModeId: "default" }, bypass: { argv: ["--permission-mode", "bypassPermissions", "--permission-prompts", "none", "--allow-dangerously-skip-permissions"], acpModeId: "bypassPermissions" }, auto: { argv: ["--permission-mode", "auto", "--permission-prompts", "none"], acpModeId: "auto" } }, turnEnv: { CLAUDE_CODE_ENABLE_TODO_TOOLS: "1" }, profileEnv: "CLAUDE_CONFIG_DIR", turn: { startArgv: ["-p", "--verbose", "--input-format", "stream-json", "--output-format", "stream-json", "--include-partial-messages"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"], promptInput: "stdin", stdinFormat: "stream-json", stdinArgv: [], output: "json-lines", responseFields: ["result"] }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"] } },
272
+ // Grok Build speaks Claude Code's stream-json shape exactly -- verified live
273
+ // against `grok -p --output-format streaming-messages-json`, whose first
274
+ // line is {"type":"system","subtype":"init","session_id":…} and whose last
275
+ // is {"type":"result",…,"usage":{…}} -- so it reuses that parser rather
276
+ // than getting a near-identical one of its own. Its ACP server publishes
277
+ // session-wide token usage, which ClikCode turns into a per-turn reading.
278
+ // It publishes no quota window (errors are balance-based: HTTP 402).
279
+ // grok 1.0.50 --reasoning-effort accepts none|minimal|low|medium|high|xhigh|max (its own parse error); the session's
280
+ // reasoning_effort configOption narrows this static fallback per model.
281
+ { command: "grok", claudeImports: { file: ".grok/config.toml", section: "compat.claude" }, quitsOnDeadMcpServer: true, quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { listed: true }, provider: "xai", displayName: "Grok Build", tier: "primary", transport: "acp", acp: { argv: ["agent", "stdio"], inheritCliOptions: false, effortConfigId: "reasoning_effort", sharedSessions: true, promptImages: false }, integration: "structured", parser: "claude-stream-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, effortValues: ["minimal", "low", "medium", "high", "xhigh", "max"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "grok", npmPackage: "@xai-official/grok", authFiles: [{ path: "~/.grok/auth.json" }], authEnv: ["XAI_API_KEY"], loginArgv: ["login"], logoutArgv: ["logout"], modelArgvPrefix: ["--model"], modelDiscoveryArgv: ["models"], workspaceArgvPrefix: ["--cwd"], effortArgvPrefix: ["--reasoning-effort"], permissionModes: ["ask", "bypass", "auto"], permissionArgv: { ask: { argv: ["--permission-mode", "default"] }, bypass: { argv: ["--permission-mode", "bypassPermissions"] }, auto: { argv: ["--permission-mode", "auto"] } }, turn: { startArgv: ["--output-format", "streaming-messages-json", "--include-partial-messages"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"], promptArgvPrefix: ["-p"], output: "json-lines", responseFields: ["result"] }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"] } },
282
+ // Restored and re-checked against gemini 0.60.0 on a real install, not the
283
+ // entry this replaces. What changed: --acp is the flag now (the old
284
+ // --experimental-acp is deprecated), -r/--resume takes "latest" or an index
285
+ // rather than an id, --session-id starts a NEW session with a given uuid,
286
+ // and -o/--output-format offers text|json|stream-json (confirmed by the
287
+ // rejection of anything else). Its approval modes are default / auto_edit /
288
+ // yolo / plan.
289
+ //
290
+ // No loginArgv: Gemini's auth lives behind /auth inside its own interactive
291
+ // session, with nothing scriptable. An empty argv is still meaningful --
292
+ // ClikCode's login flow gates on the field being present at all, and
293
+ // without it a fresh install never gets handed a real terminal to sign in.
294
+ // Sign-in (2026-10-03, real gemini 0.62 signed out): --skip-trust skips the
295
+ // folder-trust dialog; its method menu, Google link + authorization code and
296
+ // key box are read on ClikCode's screen. Signed in, it restarts into its chat,
297
+ // which the step quits.
298
+ // CLI turns (0.62.0, 2026-10-04): `--resume <id>` continues a thread by id
299
+ // (without turn.resumeIdPrefix every resumed CLI turn silently started a
300
+ // new thread); headless, a folder not yet trusted exits 55 unless
301
+ // `--skip-trust`. ACP `session/load` reopens only threads ACP started: a
302
+ // CLI-born or written thread loads as "No previous sessions found for this
303
+ // project" AND is reset to its first message on disk -- which is why
304
+ // those stay on the CLI (session nativeTransport) and the thread writer pins
305
+ // its threads there.
306
+ { command: "gemini", quotaProbe: { none: "quota shows only in the interactive /stats screen; `gemini --help` has no non-interactive usage command" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, loginAccountChoose: ["Sign in with Google", "Yes"], provider: "google", displayName: "Gemini CLI", tier: "primary", transport: "acp", integration: "structured", parser: "claude-stream-json", memoryFile: "GEMINI.md", nativeSlashPassthrough: false, customCommandDirs: [".gemini/commands", "~/.gemini/commands"], acp: { argv: ["--acp"], listsModels: true }, normalizedPermissionOptionIds: ["approval-mode"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "gemini", npmPackage: "@google/gemini-cli", authFiles: [{ path: "${GEMINI_CLI_HOME:-~}/.gemini/oauth_creds.json" }], authEnv: ["GEMINI_API_KEY"], loginArgv: ["--skip-trust"], loginSteps: [{ when: "Type your message", send: "/quit{enter}" }], loginKeyRoutes: providerKeyRoutes([], { google: "Use Gemini API Key" }), modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--include-directories"], permissionModes: ["ask", "bypass", "auto"], permissionArgv: { ask: { argv: ["--approval-mode", "default"] }, bypass: { argv: ["--approval-mode", "yolo"] }, auto: { argv: ["--approval-mode", "auto_edit"] } }, profileEnv: "GEMINI_CLI_HOME", turn: { startArgv: ["--skip-trust", "--output-format", "stream-json"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"], promptArgvPrefix: ["--prompt"], output: "json-lines", responseFields: ["response", "result", "text", "content"] }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"] } },
307
+ { command: "codex", modelStrategy: "codex-cache", quotaProbe: true, nativeStateDir: ".codex", modelCatalogFiles: ["config.toml", "models_cache.json"], subagents: { read: "thread", steer: "none" }, capabilities: { childActivity: true, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: true, workflows: false }, freePlan: { listed: true }, loginKeyStdinArgv: ["login", "--with-api-key"], provider: "openai", displayName: "Codex", tier: "primary", transport: "codex-app-server", integration: "native", parser: "codex-items", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, nativeOperations: ["compact", "turn-policy", "model-list", "thread-list"], customCommandDirs: ["~/.codex/prompts"], effortValues: ["low", "medium", "high", "xhigh", "max", "ultra"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "codex", authFiles: [{ path: "${CODEX_HOME:-~/.codex}/auth.json" }], authEnv: ["OPENAI_API_KEY"], npmPackage: "@openai/codex", loginRemoteArgv: ["login", "--device-auth"], loginArgv: ["login"], statusArgv: ["login", "status"], logoutArgv: ["logout"], modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--cd"], effortArgvPrefix: ["--config"], effortConfigKey: "model_reasoning_effort", permissionModes: ["ask", "bypass", "auto"], permissionArgv: { ask: { argv: ["--sandbox", "workspace-write", "--ask-for-approval", "on-request"], placement: "root" }, bypass: { argv: ["--sandbox", "danger-full-access", "--ask-for-approval", "never"], placement: "root" }, auto: { argv: ["--approve-for-me"], placement: "root" } }, imageArgvPrefix: ["--image"], profileEnv: "CODEX_HOME", turn: { startArgv: ["exec", "--json", "--skip-git-repo-check"], resumeArgv: ["exec", "resume"], resumeIdSuffix: ["--json", "--skip-git-repo-check"], promptInput: "stdin", output: "json-lines", responseFields: ["text"], resumeSupportsWorkspaceSelector: false }, session: { resumeIdPrefix: ["resume"] } },
308
+ { ...OPENCODE_FAMILY, command: "opencode", quotaProbe: { none: "`opencode stats` is local token/cost history, not an allowance; no account quota read" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "opencode", displayName: "OpenCode", tier: "primary", binary: "opencode", npmPackage: "opencode-ai", signInOptional: true },
309
+ // No logoutArgv: Copilot signs out only with /logout inside its own chat
310
+ // (1.0.91: `copilot logout` exits 1, "Invalid command format"), and its
311
+ // token is in the system credential store, so ClikCode can remove the
312
+ // account but cannot sign it out.
313
+ // Effort goes over ACP only (`--effort`); the levels are read from
314
+ // `copilot --help` (effort-choices.ts), effortValues is the fallback.
315
+ // Shared sessions (1.0.91, 2026-10-05): a `-p --session-id` thread loads
316
+ // over ACP with its history, and `--session-id` on an ACP thread continues
317
+ // it; each recalled a word the other was told.
318
+ { command: "copilot", modelStrategy: "copilot-server", quotaProbe: true, modelsDevCatalog: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { listed: true }, provider: "github-copilot", displayName: "GitHub Copilot", planMode: { option: "plan", value: true }, tier: "primary", transport: "acp", integration: "structured", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["--acp", "--stdio"], effortArgvPrefix: ["--effort"], sharedSessions: true, probeDisableMcpPrefix: ["--disable-mcp-server"] }, effortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"], retiredOptionIds: ["allow-all"], replyErrorPatterns: COPILOT_REPLY_ERRORS, localAuth: ["oauth", "vendor-cli"], binary: "copilot", npmPackage: "@github/copilot", loginRemoteArgv: ["login", "--device-code"], loginArgv: ["login", "--device-code"], authFiles: [{ path: "${COPILOT_HOME:-~/.copilot}/config.json", contains: '"loggedInUsers": [\n' }], modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["-C"], permissionModes: ["ask", "bypass"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--allow-all"] } }, imageArgvPrefix: ["--attachment"], profileEnv: "COPILOT_HOME", turn: { startArgv: ["-s"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session-id"], promptArgvPrefix: ["-p"], output: "text" }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session-id"] } },
319
+ { command: "aider", modelStrategy: "aider-providers", quotaProbe: { none: "no account or quota concept; it only sends requests to whatever provider key is set" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: false, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { suffix: ":free" }, loginAccountChoose: ["Yes"], provider: "aider", displayName: "Aider", tier: "more", transport: "text-cli", integration: "compatibility", parser: "aider", memoryFile: "CONVENTIONS.md", nativeSlashPassthrough: false, localAuth: ["api-key", "vendor-cli"], binary: "aider", installer: HARNESS_INSTALLERS.aider, loginArgv: ["--no-git", "--exit"], authFiles: [{ path: "~/.aider/oauth-keys.env" }], authEnv: ["OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "DEEPSEEK_API_KEY", "OPENAI_API_KEY", "GEMINI_API_KEY", "VERTEXAI_PROJECT"], modelArgvPrefix: ["--model"], permissionModes: ["bypass"], permissionArgv: { bypass: { argv: ["--yes-always"] } }, imageArgvPrefix: ["--file"], turn: { startArgv: ["--no-show-model-warnings", "--no-check-update", "--no-show-release-notes", "--no-analytics", "--no-pretty", "--no-fancy-input", "--no-detect-urls"], createIdPrefix: ["--chat-history-file"], resumeIdPrefix: ["--chat-history-file"], resumeIdSuffix: ["--restore-chat-history"], promptArgvPrefix: ["--message"], output: "text", outsideRepoArgv: ["--no-git"] }, session: { idKind: "history-file", createIdPrefix: ["--chat-history-file"], resumeIdPrefix: ["--chat-history-file"] } },
320
+ // Goose effort is the ACP session option `thinking_effort`; its values are
321
+ // read from the session (effort-choices.ts). effortValues, the fallback, are
322
+ // the levels its own `goose configure` prompt offers (off/low/medium/high/max).
323
+ {
324
+ command: "goose",
325
+ modelStrategy: "goose-providers",
326
+ quotaProbe: { none: "`goose --help` has no usage, account or quota subcommand" },
327
+ modelsDevCatalog: true,
328
+ modelCatalogHomeFiles: [".config/goose/config.yaml", ".config/goose/secrets.yaml"],
329
+ subagents: { read: "none", steer: "none" },
330
+ capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false },
331
+ freePlan: { suffix: ":free" },
332
+ provider: "goose",
333
+ displayName: "Goose",
334
+ replyErrorPatterns: GOOSE_REPLY_ERRORS,
335
+ tier: "more",
336
+ transport: "acp",
337
+ integration: "structured",
338
+ parser: "goose",
339
+ memoryFile: "AGENTS.md",
340
+ nativeSlashPassthrough: false,
341
+ acp: { argv: ["acp"], inheritCliOptions: false, providerConfigId: "provider", effortConfigId: "thinking_effort", modelEnv: { GOOSE_PROVIDER: "{provider}", GOOSE_MODEL: "{model}" }, permissionModeIds: { ask: "approve", auto: "smart_approve", bypass: "auto" }, sharedSessions: true },
342
+ effortValues: ["off", "low", "medium", "high", "max"],
343
+ localAuth: ["api-key", "oauth", "vendor-cli"],
344
+ binary: "goose",
345
+ installer: HARNESS_INSTALLERS.goose,
346
+ loginArgv: ["configure"],
347
+ loginSteps: [{ when: "Share anonymous usage data", send: "{right}{enter}" }],
348
+ loginKeyRoutes: providerKeyRoutes(["Manual Configuration"], {
349
+ anthropic: "Anthropic",
350
+ openrouter: "OpenRouter",
351
+ openai: ["OpenAI", "Yes"],
352
+ google: "Google Gemini (API Key)",
353
+ xai: "xAI",
354
+ groq: "Groq",
355
+ cerebras: "Cerebras",
356
+ huggingface: "Hugging Face",
357
+ fireworks: "Fireworks AI",
358
+ mistral: "Mistral AI",
359
+ deepseek: "DeepSeek",
360
+ moonshot: "Moonshot",
361
+ zai: "Z.AI",
362
+ minimax: "MiniMax",
363
+ together: "Together AI"
364
+ }),
365
+ providerLoginArgv: ["configure"],
366
+ modelProviderSeparator: "/",
367
+ modelProviderArgvPrefix: ["--provider"],
368
+ modelArgvPrefix: ["--model"],
369
+ permissionModes: ["ask", "bypass", "auto"],
370
+ permissionEnv: { ask: { GOOSE_MODE: "approve" }, bypass: { GOOSE_MODE: "auto" }, auto: { GOOSE_MODE: "smart_approve" } },
371
+ turn: { startArgv: ["run", "--output-format", "stream-json"], createIdPrefix: ["--name"], resumeIdPrefix: ["--resume", "--session-id"], promptArgvPrefix: ["--text"], output: "json-lines", responseFields: ["text", "content", "response"], statelessProviders: ["claude-code"] },
372
+ session: { idKind: "uuid", idByName: true, createIdPrefix: ["--name"], resumeIdPrefix: ["session", "--resume", "--session-id"], discoverArgv: ["session", "list", "--format", "json"], discoverFormat: "json", discoverAllFolders: true }
373
+ },
374
+ // Amp's native JSON stdin and safe steering passed a live turn on 2026-10-25.
375
+ // Input closes after the main reply and background agents settle; the final
376
+ // result follows EOF. It shares Claude-shaped output, not Claude's lifecycle.
377
+ { command: "amp", keyIdentityArgv: ["usage"], quotaProbe: true, subagents: { read: "frames", steer: "none" }, capabilities: { childActivity: true, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: true, backgroundTerminals: false, workflows: false }, provider: "amp", displayName: "Amp", tier: "more", transport: "structured-cli", integration: "structured", parser: "claude-stream-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "amp", npmPackage: "@ampcode/cli", authFiles: [{ path: "${XDG_DATA_HOME:-~/.local/share}/amp/secrets.json", contains: "apiKey@" }], authEnv: ["AMP_API_KEY"], loginArgv: ["login"], versionArgv: ["version"], turn: { startArgv: ["--execute", "--stream-json", "--stream-json-input", "--no-archive-after-execute"], resumeArgv: ["threads", "continue"], resumeIdSuffix: ["--execute", "--stream-json", "--stream-json-input", "--no-archive-after-execute"], promptInput: "stdin", stdinFormat: "amp-json", stdinArgv: [], output: "json-lines", responseFields: ["result"], mcpConfigArgv: ["--mcp-config"] }, session: { resumeIdPrefix: ["threads", "continue"] } },
378
+ // agy 1.4.12 exposes ACP through `agy acp`. Its subcommand accepts
379
+ // permission flags but not the print-mode --model/--mode switches; model
380
+ // and mode selection use the session protocol. Keep the native parser
381
+ // for image fallback. Both directions of scripts/verify-shared-sessions.mjs
382
+ // passed on 1.4.12: ACP resumes CLI history and CLI resumes ACP history.
383
+ // Bare agy remains the interactive OAuth login;
384
+ // print mode can answer signed out and cannot establish authentication.
385
+ // Each account redirects HOME and disables keyring reuse. ACP publishes
386
+ // its own model IDs and thought_level options; CLI IDs encode effort.
387
+ // No independent CLI --effort flag is sent.
388
+ { command: "antigravity", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { listed: true }, provider: "antigravity", displayName: "Antigravity CLI", tier: "primary", transport: "acp", acp: { argv: ["acp"], inheritCliOptions: false, listsModels: true, liveModelList: false, sharedSessions: true, pinCliFallback: true, effortConfigId: "thought_level", permissionArgv: { bypass: ["--dangerously-skip-permissions"] } }, integration: "structured", parser: "antigravity", effortValues: ["low", "medium", "high"], memoryFile: "AGENTS.md", nativeSlashPassthrough: false, profileEnvPassthrough: HOME_REDIRECT_ENV_PASSTHROUGH, profileExtraEnv: { DBUS_SESSION_BUS_ADDRESS: "unix:path=/nonexistent", XDG_RUNTIME_DIR: "{profile}/runtime" }, apiKeySettings: { path: "~/.gemini/antigravity-cli/settings.json", set: { modelProvider: "gemini" } }, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "agy", installer: HARNESS_INSTALLERS.antigravity, loginArgv: [], loginSteps: [{ when: "Choose your color scheme", send: "{enter}" }, { when: "Terms of Service & Data Use", send: "{enter}{down}{right}{enter}" }, { when: "Do you trust the contents of this project", send: "{enter}" }, { when: "Select login method", send: "{enter}" }, { when: "paste the authorization code below", ask: { prompt: "Paste the code from the Google page" } }], authFiles: [{ path: "~/.gemini/antigravity-cli/antigravity-oauth-token", jsonFields: ["token.access_token", "token.refresh_token"] }], modelDiscoveryArgv: ["models"], modelArgvPrefix: ["--model"], permissionModes: ["ask", "bypass"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--dangerously-skip-permissions"] } }, profileEnv: "HOME", turn: { startArgv: ["--output-format", "stream-json"], promptArgvPrefix: ["-p"], resumeIdPrefix: ["--conversation"], output: "json-lines", responseFields: ["text", "result", "response"] }, session: { resumeIdPrefix: ["--conversation"] } },
389
+ // Pi signs in only inside its own session (`/login`); `pi auth` just prints
390
+ // or checks credentials. The steps type /login, its method/provider menus
391
+ // and key field are read on ClikCode's screen, and Ctrl+D leaves once it
392
+ // says the credentials are saved (verified 2026-10-03, pi 0.87 signed out).
393
+ { command: "pi", modelListFormat: "pi-table", quotaProbe: { none: "`pi auth` only prints or checks credentials; no usage read" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { suffix: ":free" }, provider: "pi", displayName: "Pi Coding Agent", tier: "more", transport: "structured-cli", integration: "structured", parser: "pi-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, effortValues: ["off", "minimal", "low", "medium", "high", "xhigh", "max"], localAuth: ["api-key", "oauth", "vendor-cli"], loginArgv: [], binary: "pi", npmPackage: "@earendil-works/pi-coding-agent", loginSteps: [{ when: "/login to log into a provider", send: "/login{enter}" }, { when: "Credentials saved to", send: "{ctrl-d}" }], loginKeyRoutes: providerKeyRoutes(["Sign in with an API key"], { ...SHARED_PROVIDER_MENU_LABELS, google: "Google", fireworks: "Fireworks", "moonshot-cn": "Moonshot AI CN", minimax: "MiniMax", together: "Together" }), authFiles: [{ path: "${PI_CODING_AGENT_DIR:-~/.pi/agent}/auth.json", contains: '"type"' }], modelDiscoveryArgv: ["--list-models"], modelProviderSeparator: "/", modelArgvPrefix: ["--model"], effortArgvPrefix: ["--thinking"], imageArgvPrefix: ["@"], imageArgvStyle: "concatenated", profileEnv: "PI_CODING_AGENT_DIR", turn: { startArgv: ["--mode", "rpc"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session"], promptInput: "stdin", stdinFormat: "pi-rpc", stdinArgv: [], output: "json-lines", responseFields: ["text", "content"], extensionArgv: ["-e"] }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session"] } },
394
+ // Checked against droid 0.223.0: `droid exec` takes -m/--model,
395
+ // -r/--reasoning-effort, --cwd, -s/--session-id, --auto low|medium|high and
396
+ // --skip-permissions-unsafe, all as declared here. Two things were missing:
397
+ // it ships on npm as plain `droid` (so ClikCode can install it), and its
398
+ // --output-format accepts stream-json, which `zzz` does not -- the reject
399
+ // is how the accepted set was confirmed, since --help swallows the flag
400
+ // before it is validated.
401
+ // Droid 0.223.0: `droid exec --help` says "CLI flags do not configure JSON-RPC sessions: -m, --auto, -r ... are still validated, but session settings come
402
+ // from JSON-RPC requests", so ACP is launched bare. Run signed in under vendor-sandbox 2026-10-10, session/new gave modes normal|spec|auto-low|auto-medium|
403
+ // auto-high (= ask, plan, `--auto low|medium|high`) and config options autonomy_level and reasoning_effort ("options depend on the selected model"; this
404
+ // model: none..max). effortValues is that union; the session's own list narrows it per model once the picker reads it (see report, effort-choices.ts).
405
+ { command: "droid", quotaProbe: { none: "`droid --help` and `droid exec --help` list no usage or quota command" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "factory", displayName: "Factory Droid", planMode: { option: "spec-mode", value: true }, tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["exec", "--output-format", "acp"], inheritCliOptions: false, listsModels: true, effortConfigId: "reasoning_effort", planModeId: "spec" }, effortValues: ["none", "low", "medium", "high", "xhigh", "max"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "droid", npmPackage: "droid", loginArgv: [], loginSteps: [{ when: "Please login with your Factory account", send: "{enter}" }], authFiles: [{ path: "${FACTORY_HOME_OVERRIDE:-~/.factory}/auth.v2.file" }, { path: "${FACTORY_HOME_OVERRIDE:-~/.factory}/auth.v2.key" }, { path: "${FACTORY_HOME_OVERRIDE:-~/.factory}/auth.v2.keyring" }, { path: "${FACTORY_HOME_OVERRIDE:-~/.factory}/auth.encrypted" }], authEnv: ["FACTORY_API_KEY"], modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--cwd"], effortArgvPrefix: ["--reasoning-effort"], permissionModes: ["ask", "bypass", "auto"], permissions: { ask: { argv: [], acpModeId: "normal" }, bypass: { argv: ["--skip-permissions-unsafe"], acpModeId: "auto-high" }, auto: { argv: ["--auto", "low"], acpModeId: "auto-low" } }, turn: { startArgv: ["exec", "--output-format", "stream-json"], resumeIdPrefix: ["--session-id"], output: "json-lines", responseFields: ["result", "response", "text"] }, session: { resumeIdPrefix: ["--session-id"] } },
406
+ // Checked against a real install (`curl -fsSL https://cli.kiro.dev/install`):
407
+ // chat takes --model, --effort, -r/--resume, --resume-id, -a/--trust-all-tools
408
+ // and --output-format stream-json ("JSON Lines on stdout", which implies
409
+ // --no-interactive). Everything here was already right except --model,
410
+ // which the CLI has and this entry did not.
411
+ { command: "kiro", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { listed: true }, provider: "kiro", displayName: "Kiro CLI", tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["acp"], optionPlacement: "after" }, effortValues: ["low", "medium", "high", "xhigh", "max"], localAuth: ["api-key", "oauth", "vendor-cli"], loginRemoteArgv: ["login", "--license", "free", "--use-device-flow"], loginArgv: ["login"], logoutArgv: ["logout"], statusArgv: ["whoami"], binary: "kiro-cli", authFiles: [{ path: "~/.local/share/kiro-cli/data.sqlite3", contains: "kirocli:social:token" }, { path: "~/.local/share/kiro-cli/data.sqlite3", contains: "kirocli:odic:token" }], installer: HARNESS_INSTALLERS.kiro, modelArgvPrefix: ["--model"], effortArgvPrefix: ["--effort"], permissionModes: ["ask", "bypass"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--trust-all-tools"] } }, turn: { promptGuard: "double-dash", startArgv: ["chat", "--no-interactive", "--agent-engine", "v3", "--output-format", "stream-json"], resumeIdPrefix: ["--resume-id"], output: "json-lines", responseFields: ["text", "content", "result"] }, session: { resumeIdPrefix: ["chat", "--resume-id"], discoverArgv: ["chat", "--list-sessions", "--format", "json"], discoverFormat: "json" } },
412
+ // Sign-in (2026-10-03, real qwen 0.24 signed out): its provider menus and
413
+ // key/model boxes are read on ClikCode's screen; once configured it sits in
414
+ // its chat, which the step quits.
415
+ // Qwen signs in only through its own /auth screen (0.25: Qwen OAuth is
416
+ // discontinued, `qwen auth` removed). /auth asks plan, region -- US
417
+ // (Virginia) included -- key and models, and saves them in settings.json
418
+ // with security.auth.selectedType, so that is the one sign-in file. A bare
419
+ // DASHSCOPE_API_KEY is not a sign-in to Qwen: it needs the region and
420
+ // method from settings too, so there is no ClikCode API-key path here.
421
+ // Its menus are answered from the key: every endpoint /auth offers, in its
422
+ // own words, and the first that accepts the key picks plan and region. A
423
+ // QwenCloud key (sk-ws-, home.qwencloud.com) lands on Singapore; US
424
+ // (Virginia) refuses it, which is how a hand-picked region failed.
425
+ // /auth's last step, Model IDs, is answered here, never asked: Enter applies
426
+ // the models it pre-checks -- the plan's own list, which Coding Plan and
427
+ // Token Plan read from the endpoint -- and the session lists what it saved.
428
+ // Qwen 0.25.0 ACP, read from chunks/acpAgent (buildModesData/buildConfigOptions) and run signed in under vendor-sandbox 2026-10-10: session/new
429
+ // config options are mode (plan|default|auto-edit|auto|yolo = --approval-mode), model, and reasoning_effort (category thought_level; per-model: this
430
+ // account's model offered only none/default). ClikCode's ask/auto/bypass are default/auto/yolo; plan is the session mode `plan`.
431
+ { command: "qwen", quotaProbe: { none: "`qwen --help` has no usage or quota command (Qwen OAuth is discontinued)" }, subagents: { read: "frames", steer: "none" }, capabilities: { childActivity: true, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "qwen", displayName: "Qwen Code", tier: "more", npmPackage: "@qwen-code/qwen-code", transport: "acp", integration: "structured", parser: "claude-stream-json", memoryFile: "QWEN.md", nativeSlashPassthrough: false, customCommandDirs: [".qwen/commands", "~/.qwen/commands"], acp: { argv: ["--acp"], probeArgv: ["--allowed-mcp-server-names", "clikcode-probe-none"], effortConfigId: "reasoning_effort", planModeId: "plan" }, effortValues: ["none", "low", "medium", "high", "xhigh", "max"], normalizedPermissionOptionIds: ["approval-mode"], localAuth: ["vendor-cli"], binary: "qwen", loginArgv: [], loginKeyRoutes: [{ url: "https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Standard API Key", "US (Virginia)"] }, { url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Standard API Key", "Singapore"] }, { url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Standard API Key", "China (Beijing)"] }, { url: "https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Standard API Key", "China (Hong Kong)"] }, { url: "https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions", choose: ["Alibaba ModelStudio", "Coding Plan", "Singapore"] }, { url: "https://coding.dashscope.aliyuncs.com/v1/chat/completions", choose: ["Alibaba ModelStudio", "Coding Plan", "China (Beijing)"] }, { url: "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Token Plan", "Singapore"] }, { url: "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions", choose: ["Alibaba ModelStudio", "Token Plan", "China (Beijing)"] }], loginSteps: [{ when: "Enter model IDs directly", send: "{enter}" }, { when: "Type your message", send: "/quit{enter}" }], authFiles: [{ path: "${QWEN_HOME:-~/.qwen}/settings.json", contains: '"selectedType"' }], modelArgvPrefix: ["--model"], permissionModes: ["ask", "bypass", "auto"], permissions: { ask: { argv: ["--approval-mode", "default"], acpModeId: "default" }, bypass: { argv: ["--approval-mode", "yolo"], acpModeId: "yolo" }, auto: { argv: ["--approval-mode", "auto"], acpModeId: "auto" } }, profileEnv: "QWEN_HOME", turn: { startArgv: ["-p", "--output-format", "stream-json", "--include-partial-messages"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"], output: "json-lines", responseFields: ["result", "response", "text"] }, session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--resume"], discoverArgv: ["sessions", "list", "--json"], discoverFormat: "json-lines" } },
432
+ // CLINE_SESSION_BACKEND_MODE=local runs the session inside the ACP child.
433
+ // Left on `auto`, the first prompt starts a `--cline-hub-daemon` (~200 MB,
434
+ // its own process group) that outlives the chat, and ClikCode's sandboxed
435
+ // runs too. Measured on 3.0.68: same session files, session/load resumes,
436
+ // and no daemon.
437
+ // Cline 3.0.70 ACP, run signed in under vendor-sandbox 2026-10-10: session/new `modes` are plan|act (act is the default; plan = no file changes, set
438
+ // with session/set_mode -> {} and mirrored in config option `mode`), plus boolean config option `auto_approve`. Its modes are NOT permission levels,
439
+ // so ask and bypass both map to `act` (which also leaves plan when Plan mode turns off); bypass is `--auto-approve true` at launch. It publishes no effort option.
440
+ { command: "cline", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { suffix: ":free" }, provider: "cline", displayName: "Cline CLI", planMode: { option: "plan", value: true }, tier: "more", transport: "acp", integration: "structured", parser: "cline-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["--acp"], listsModels: true, planModeId: "plan", usageFile: { path: "~/.cline/data/sessions/{id}/{id}.json", field: ["metadata", "usage"] } }, effortValues: ["none", "low", "medium", "high", "xhigh"], normalizedPermissionOptionIds: ["auto-approve"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "cline", npmPackage: "cline", authFiles: [{ path: "~/.cline/data/settings/providers.json", contains: '"auth"' }, { path: "~/.cline/data/settings/providers.json", contains: '"apiKey"' }], loginArgv: ["auth"], loginAccountChoose: ["Sign in with Cline"], loginKeyRoutes: providerKeyRoutes(["Bring your own provider"], SHARED_PROVIDER_MENU_LABELS), modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--cwd"], effortArgvPrefix: ["--thinking"], permissionModes: ["ask", "bypass"], permissions: { ask: { argv: ["--auto-approve", "false"], acpModeId: "act" }, bypass: { argv: ["--auto-approve", "true"], acpModeId: "act" } }, turn: { startArgv: ["--json"], resumeIdPrefix: ["--id"], output: "json-lines", responseFields: ["text", "content", "result"] }, turnEnv: { CLINE_SESSION_BACKEND_MODE: "local" }, session: { resumeIdPrefix: ["--id"] } },
441
+ { ...OPENCODE_FORK_BASE, command: "kilo", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { suffix: ":free" }, loginAccountChoose: ["Kilo Gateway"], provider: "kilo", displayName: "Kilo Code CLI", tier: "more", binary: "kilo", authFiles: [{ path: "${XDG_DATA_HOME:-~/.local/share}/kilo/auth.json", contains: '"type"' }], npmPackage: "@kilocode/cli", permissionModes: ["ask", "auto"], permissionArgv: { ask: { argv: [] }, auto: { argv: ["--auto"] } }, permissionEnv: { ask: { KILO_PERMISSION: '{"edit":"ask","bash":"ask"}' } } },
442
+ { command: "cursor", quotaProbe: true, subagents: { read: "frames", steer: "none" }, capabilities: { childActivity: true, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "cursor", displayName: "Cursor Agent", planMode: { option: "mode", value: "plan" }, tier: "primary", transport: "acp", acp: { argv: ["acp"], inheritCliOptions: false, listsModels: true, planModeId: "plan" }, integration: "structured", parser: "cursor-stream-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, customCommandDirs: [".cursor/commands", "~/.cursor/commands"], normalizedPermissionOptionIds: ["auto-review", "force"], replyErrorPatterns: CURSOR_REPLY_ERRORS, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "cursor-agent", authFiles: [{ path: "~/.config/cursor/auth.json", contains: '"accessToken"' }], installer: HARNESS_INSTALLERS.cursor, loginArgv: ["login"], statusArgv: ["status", "--format", "json"], logoutArgv: ["logout"], modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--workspace"], permissionModes: ["ask", "bypass", "auto"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--force"] }, auto: { argv: ["--auto-review"] } }, turn: { promptGuard: "double-dash", startArgv: ["-p", "--output-format", "stream-json", "--stream-partial-output"], resumeIdPrefix: ["--resume"], output: "json-lines", responseFields: ["result", "response", "text"] }, session: { createSessionArgv: ["create-chat"], resumeIdPrefix: ["--resume"] } },
443
+ // Hermes 0.20.5, read from hermes_cli/main.py (cmd_acp) and acp_adapter/{server,session}.py: `hermes acp` takes only --accept-hooks/--check/--setup,
444
+ // and cmd_acp never reads the top-level --model/--provider/--reasoning, so they are not passed (inheritCliOptions false). The model is chosen with
445
+ // session/set_model over the `provider:model` list session/new publishes. ACP has NO effort control: _make_agent builds AIAgent with no
446
+ // reasoning_config and set_config_option stores any id it is given without effect, so a non-default effort fails the ACP turn
447
+ // (acpUnsupportedEffort) and runs it over `chat --quiet --reasoning`, which does apply it. Bypass is `--yolo` (sets HERMES_YOLO_MODE), the only flag
448
+ // honoured; its session modes (default|accept-edits|dont-ask) are edit-approval policies, not ClikCode's ask/bypass, so none is mapped.
449
+ // Checked against the installed CLI. `hermes model` is an interactive picker
450
+ // and there is no `models list`; the configured model is `hermes config get
451
+ // model --json` (`default`). ACP (`hermes acp`) is the turn that streams
452
+ // tool calls. `chat --quiet` is only the text fallback.
453
+ // Hermes is one ClikCode account over many inference providers. A model id
454
+ // is `provider:model`, so choosing a model chooses the provider, and the old
455
+ // separate provider option is retired. `hermes login` was removed upstream
456
+ // (it prints a notice and exits 0), so signing in is `hermes model`, and a
457
+ // single provider is `hermes auth add <provider>`, which picks OAuth or an
458
+ // API key for that provider itself.
459
+ { command: "hermes", modelStrategy: "hermes-inventory", quotaProbe: true, nativeStateDir: ".hermes", effortHelpArgv: ["chat", "--help"], modelCatalogFiles: ["config.yaml", "provider_models_cache.json", "auth.json", ".env"], subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { suffix: ":free" }, loginAccountChoose: ["Nous Portal"], provider: "nous", displayName: "Hermes", tier: "more", transport: "acp", integration: "structured", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["acp"], inheritCliOptions: false, permissionArgv: { bypass: ["--yolo"] }, listsModels: false, usageTotals: "session" }, effortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"], normalizedPermissionOptionIds: ["yolo"], localAuth: ["api-key", "oauth", "vendor-cli"], binary: "hermes", installer: HARNESS_INSTALLERS.hermes, loginArgv: ["model"], loginKeyRoutes: providerKeyRoutes([], {
460
+ anthropic: ["Anthropic", "Anthropic API key"],
461
+ openrouter: "OpenRouter",
462
+ openai: ["OpenAI", "OpenAI API"],
463
+ google: "Google AI Studio",
464
+ xai: ["xAI Grok", "xAI"],
465
+ huggingface: "Hugging Face Inference Providers",
466
+ fireworks: "Fireworks AI",
467
+ deepseek: "DeepSeek",
468
+ moonshot: ["Kimi / Moonshot", "Kimi / Kimi Coding Plan"],
469
+ "moonshot-cn": ["Kimi / Moonshot", "Kimi / Moonshot (China)"],
470
+ zai: ["Z.AI / GLM", "Global (https://api.z.ai/api/paas/v4)"],
471
+ minimax: ["MiniMax", "MiniMax"]
472
+ }), providerLoginArgv: ["auth", "add", "{provider}"], authFiles: HERMES_AUTH_FILES, logoutArgv: ["logout"], retiredOptionIds: ["provider"], replyErrorPatterns: HERMES_REPLY_ERRORS, modelArgvPrefix: ["--model"], modelProviderArgvPrefix: ["--provider"], workspaceArgvPrefix: ["--in"], effortArgvPrefix: ["--reasoning"], permissionModes: ["ask", "bypass"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--yolo"] } }, imageArgvPrefix: ["--image"], profileEnv: "HERMES_HOME", turn: { startArgv: ["chat", "--quiet"], resumeIdPrefix: ["--resume"], promptArgvPrefix: ["--query"], output: "text" }, session: { resumeIdPrefix: ["--resume"], discoverArgv: ["sessions", "list", "--limit", "50"], discoverFormat: "text", discoverAllFolders: true } },
473
+ // Same kind of product as Hermes, not a fork; checked against a real
474
+ // install (OpenClaw 2026.9.6). The one-shot turn is `agent --local --json`,
475
+ // whose answer is `meta.finalAssistantVisibleText` -- the generic fields
476
+ // also match `meta.executionTrace…result: "success"`, which used to become
477
+ // the reply. Without --session-id every turn joins the shared
478
+ // `agent:main:main` session, so each chat gets its own. A model is
479
+ // `provider/model` and --model takes it whole; one provider signs in with
480
+ // `models auth login --provider <id>`, the whole setup is `onboard`. The
481
+ // CLI back ends (a Claude Code login) keep no history between --local
482
+ // turns, so those turns carry ClikCode's transcript instead.
483
+ {
484
+ command: "openclaw",
485
+ modelStrategy: "openclaw-inventory",
486
+ quotaProbe: { none: "`openclaw status --usage` prints provider usage snapshots, but its JSON shape could not be observed signed out, so no parser is written against it" },
487
+ nativeStateDir: ".openclaw",
488
+ modelCatalogFiles: ["openclaw.json", "agents/main/agent/openclaw-agent.sqlite"],
489
+ subagents: { read: "none", steer: "none" },
490
+ capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: false, backgroundAgents: false, backgroundTerminals: false, workflows: false },
491
+ provider: "openclaw",
492
+ displayName: "OpenClaw",
493
+ tier: "more",
494
+ transport: "structured-cli",
495
+ integration: "structured",
496
+ parser: "generic-json",
497
+ memoryFile: "AGENTS.md",
498
+ nativeSlashPassthrough: false,
499
+ npmPackage: "openclaw",
500
+ localAuth: ["api-key", "oauth", "vendor-cli"],
501
+ binary: "openclaw",
502
+ loginArgv: ["onboard"],
503
+ loginSteps: [{ when: "How would you like to start?", send: "{enter}" }, { when: "What would you like to create?", send: "{enter}" }],
504
+ // After the key OpenClaw saves it and comes back to its provider list
505
+ // (its route check fails even for a key that works): Skip for now ends
506
+ // the onboarding. A provider's plugin is installed the first time only.
507
+ loginKeyRoutes: providerKeyRoutes([], {
508
+ openai: ["OpenAI", "OpenAI API Key"],
509
+ openrouter: ["OpenRouter", "OpenRouter API key"],
510
+ xai: ["xAI (Grok)", "xAI API key"],
511
+ google: "Google",
512
+ anthropic: ["Anthropic", "Anthropic API key"],
513
+ cerebras: ["More\u2026", "Cerebras"],
514
+ deepseek: ["More\u2026", "DeepSeek"],
515
+ fireworks: ["More\u2026", "Fireworks"],
516
+ groq: ["More\u2026", "Groq"],
517
+ huggingface: ["More\u2026", "Hugging Face"],
518
+ minimax: ["More\u2026", "MiniMax", "MiniMax API key (Global)"],
519
+ mistral: ["More\u2026", "Mistral AI"],
520
+ moonshot: ["More\u2026", "Moonshot AI", "Moonshot API key (.ai)"],
521
+ "moonshot-cn": ["More\u2026", "Moonshot AI", "Moonshot API key (.cn)"],
522
+ together: ["More\u2026", "Together AI"],
523
+ zai: ["More\u2026", "Z.AI", "Global"]
524
+ }).map((route) => ({ ...route, choose: [...route.choose, "?Download from npm", "Skip for now"] })),
525
+ providerLoginArgv: ["models", "auth", "login", "--provider", "{provider}"],
526
+ modelProviderSeparator: "/",
527
+ statusArgv: ["models", "status"],
528
+ modelArgvPrefix: ["--model"],
529
+ effortArgvPrefix: ["--thinking"],
530
+ effortValues: ["off", "minimal", "low", "medium", "high", "xhigh", "adaptive", "max", "ultra"],
531
+ profileEnv: "OPENCLAW_STATE_DIR",
532
+ turn: { startArgv: ["agent", "--local", "--json", "--agent", "main"], resumeArgv: ["agent", "--local", "--json", "--agent", "main"], createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session-id"], resumeKeyPrefix: ["--session-key"], promptArgvPrefix: ["--message"], output: "json", responseFields: ["finalAssistantVisibleText"], statelessRoute: { path: ["meta", "systemPromptReport", "provider"], values: ["claude-cli", "google-gemini-cli"] } },
533
+ session: { idKind: "uuid", createIdPrefix: ["--session-id"], resumeIdPrefix: ["--session-id"], resumeKeyPrefix: ["--session-key"], discoverArgv: ["sessions", "--json", "--limit", "50"], discoverFormat: "json", discoverAllFolders: true }
534
+ },
535
+ // Stays on its one-shot CLI, not `cmdc acp` (checked on 1.74.1, sandbox):
536
+ // the ACP agent initializes, opens, loads (a written thread replays) and
537
+ // shares the CLI's session files, but offers and accepts only Command
538
+ // Code's gateway models -- a BYOK model (`mock/mock-model` from
539
+ // providers.json) is "Unknown model" over ACP, while the CLI runs it.
540
+ { command: "command", eventDialect: "command-code", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "command-code", displayName: "Command Code", planMode: { option: "plan", value: true }, tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: COMMAND_CODE_ACP, effortValues: ["off", "low", "medium", "high", "xhigh", "max"], profileEnvPassthrough: HOME_REDIRECT_ENV_PASSTHROUGH, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "cmdc", authFiles: [{ path: "~/.commandcode/auth.json", contains: '"apiKey"' }], npmPackage: "command-code", loginArgv: ["login"], statusArgv: ["status"], logoutArgv: ["logout"], modelArgvPrefix: ["--model"], modelDiscoveryArgv: ["--list-models"], effortArgvPrefix: ["--effort"], permissionModes: ["ask", "bypass", "auto"], permissions: { ask: { argv: ["--permission-mode", "standard"], acpModeId: "default" }, bypass: { argv: ["--yolo"], acpModeId: "bypass" }, auto: { argv: ["--permission-mode", "auto-accept"], acpModeId: "auto-accept" } }, profileEnv: "HOME", turn: { startArgv: ["--print", "--output-format", "json", "--skip-onboarding", "--no-auto-update"], resumeIdPrefix: ["--resume"], output: "json-lines", responseFields: ["result", "response", "text"] }, session: { resumeIdPrefix: ["--resume"] } },
541
+ // ---- Added from vendor documentation; none of these binaries was available
542
+ // to run live, so every one-shot contract below is `experimental` and only
543
+ // flags the vendor documents are declared. No session selectors are claimed:
544
+ // an absent `session` means ClikCode launches but never pretends to resume.
545
+ // Kimi CLI (MoonshotAI): `kimi --acp` is the documented ACP entry point and
546
+ // the preferred transport. `--print` is its non-interactive mode and
547
+ // `--command` carries the prompt; stream-json output is left undeclared.
548
+ // Rewritten against the real CLI (Kimi Code 2.0.2, `@moonshot-ai/kimi-code`
549
+ // on npm -- pypi's `kimi-cli` is the wound-down Python predecessor and npm's
550
+ // bare `kimi-cli` is an unrelated front-end generator). The previous entry
551
+ // could not have run a turn: it passed --print and --command, and this CLI
552
+ // has neither; the flags are -p/--prompt and --output-format stream-json.
553
+ // ACP is a subcommand here, not a --acp flag.
554
+ //
555
+ // The permission names invert: -y/--yolo is "Ask When Needed" (routine edits
556
+ // run, risky ones still ask) and --auto is "Never Ask". So yolo maps to
557
+ // ClikCode's `auto` and --auto maps to `bypass`, which is the opposite of
558
+ // what the spellings suggest.
559
+ //
560
+ // Its sign-in is two files: `login` writes the provider (and where its OAuth
561
+ // token lives) into config.toml, and the token into credentials/. Either
562
+ // alone is not a sign-in -- "no provider configured" without the first.
563
+ { command: "kimi", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "kimi", displayName: "Kimi CLI", tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["acp"], inheritCliOptions: false, effortConfigId: "thinking", planModeId: "plan" }, planMode: { option: "plan", value: true }, effortValues: ["low", "high", "max"], experimental: true, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "kimi", npmPackage: "@moonshot-ai/kimi-code", authFiles: [{ path: "${KIMI_CODE_HOME:-~/.kimi-code}/credentials/" }, { path: "${KIMI_CODE_HOME:-~/.kimi-code}/config.toml", contains: "[providers." }], authEnv: ["KIMI_API_KEY"], loginArgv: ["login", "--region", "global"], modelArgvPrefix: ["--model"], permissionModes: ["ask", "bypass", "auto"], permissions: { ask: { argv: [], acpModeId: "default" }, bypass: { argv: ["--auto"], acpModeId: "auto" }, auto: { argv: ["--yolo"], acpModeId: "yolo" } }, turn: { startArgv: ["--output-format", "stream-json"], promptArgvPrefix: ["--prompt"], output: "json-lines", responseFields: ["text", "content", "response", "result"] }, session: { resumeIdPrefix: ["--session"] } },
564
+ // Augment Auggie: `--print` with `--output-format json` returns one JSON
565
+ // document; `--acp` is documented. The JSON field holding the answer is not
566
+ // confirmed, so responseFields is the usual best-effort list.
567
+ // Read from `auggie --help` on a real install: -w/--workspace-root,
568
+ // -c/--continue, -r/--resume [sessionId], --reasoning-effort <effort>.
569
+ // No effortValues: the flag is real but the levels it accepts are
570
+ // undocumented, and a picker offering invented ones is worse than a picker
571
+ // offering none. -a/--ask is deliberately NOT mapped to the `ask`
572
+ // permission mode -- it means "retrieval and non-editing tools only", which
573
+ // is read-only, not approval-prompting, so mapping it would quietly make
574
+ // the harness unable to edit whenever someone chose Ask.
575
+ // turn.resumeIdPrefix, live against auggie 0.36.0 (2026-10-05,
576
+ // vendor-sandbox): `--print --output-format json --resume <id>` reported the
577
+ // same session_id and appended its request to that `<id>.json` as the
578
+ // second exchange (one file, chatHistory 1 -> 2) -- the file is the history
579
+ // auggie sends. The account was out of usage, so the model's recall is unproved.
580
+ { command: "auggie", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: true, plan: true, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "augment", displayName: "Augment Auggie", replyErrorPatterns: AUGGIE_REPLY_ERRORS, planMode: { option: "ask", value: true }, tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, customCommandDirs: [".augment/commands", "~/.augment/commands"], acp: { argv: ["--acp"] }, experimental: true, localAuth: ["oauth", "vendor-cli"], binary: "auggie", npmPackage: "@augmentcode/auggie", statusArgv: ["account", "status"], loginArgv: ["login", "--headless"], logoutArgv: ["logout"], modelDiscoveryArgv: ["model", "list"], modelArgvPrefix: ["--model"], workspaceArgvPrefix: ["--workspace-root"], effortValues: ["low", "medium", "high"], effortArgvPrefix: ["--reasoning-effort"], effortUnsupportedModels: ["^haiku4\\.5$"], imageArgvPrefix: ["--image"], turn: { startArgv: ["--print", "--output-format", "json"], resumeIdPrefix: ["--resume"], output: "json", responseFields: ["result", "response", "text"], quotaSignals: ["You have run out of usage for", "run out of usage"] }, session: { resumeIdPrefix: ["--resume"] } },
581
+ // Mistral Vibe ships ACP as a SEPARATE executable, `vibe-acp`, with no argv.
582
+ // `vibe --prompt` is its documented programmatic mode (plain text).
583
+ // Read from mistral-vibe on a real install (pip/uv, not npm, so there is no
584
+ // npmPackage to declare). ACP stays the primary path -- `vibe-acp` is a
585
+ // binary it really ships -- and the CLI fallback below is no longer a
586
+ // text-only stub: --output streaming is documented as "newline-delimited
587
+ // JSON per message", and its agents (ask / smart-approve / auto-approve)
588
+ // map onto the three permission modes without inventing anything.
589
+ // Sign-in (2026-10-03, real vibe signed out): the steps pass its animated
590
+ // welcome and theme screens; its method cards, provider choice, browser link
591
+ // and titled key field are read on ClikCode's screen.
592
+ { command: "vibe", quotaProbe: true, nativeStateDir: ".vibe", modelCatalogFiles: ["config.toml"], subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, loginAccountChoose: ["Launch browser"], provider: "mistral-vibe", displayName: "Mistral Vibe", tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { binary: "vibe-acp", argv: [], listsModels: true, usageTotals: "session", cumulativeChunks: true }, experimental: true, localAuth: ["api-key", "vendor-cli"], binary: "vibe", installer: HARNESS_INSTALLERS.vibe, loginArgv: ["--setup"], loginKeyRoutes: providerKeyRoutes([], { mistral: "Use an API key" }), loginSteps: [{ when: "Where do you sign in?", send: "{enter}" }, { when: "Welcome to Mistral Vibe - Let", send: "{enter}" }, { when: "Select your preferred theme", send: "{enter}" }], authFiles: [{ path: "${VIBE_HOME:-~/.vibe}/.env", contains: "MISTRAL_API_KEY=", removeLine: true }], authEnv: ["MISTRAL_API_KEY"], profileEnv: "VIBE_HOME", modelArgvPrefix: [], workspaceArgvPrefix: ["--workdir"], permissionModes: ["ask", "bypass", "auto"], permissionArgv: { ask: { argv: ["--agent", "ask"] }, bypass: { argv: ["--auto-approve"] }, auto: { argv: ["--smart-approve"] } }, turn: { startArgv: ["--output", "streaming"], promptArgvPrefix: ["--prompt"], output: "json-lines", responseFields: ["text", "content", "response", "result"] }, session: { resumeIdPrefix: ["--resume"] } },
593
+ // OpenHands CLI: `openhands acp` is documented; headless is `--headless`
594
+ // with the task in `-t`. Its JSON event mode is left undeclared.
595
+ // Checked against the real CLI (OpenHands SDK v1.21.0, `uv tool install
596
+ // openhands`): --headless and the `acp` subcommand both exist, as declared.
597
+ // Worth recording why that needed checking twice: PyPI's `openhands-ai` is
598
+ // the OLD distribution, pinned below 1.0 on this machine's Python, and it
599
+ // has neither -- the package moved to plain `openhands`, and reading the
600
+ // stale one made a correct entry look broken.
601
+ //
602
+ // --json is documented as "Streams JSONL event outputs", so the turn reads
603
+ // as lines rather than text. Only bypass and auto are offered: --headless
604
+ // auto-approves by definition ("no UI output, auto-approve actions"), so an
605
+ // `ask` mode on this path would be a promise the CLI cannot keep. The ACP
606
+ // path above is the one that can actually prompt.
607
+ { command: "openhands", quotaProbe: { none: "`openhands --help` has no usage command; cloud billing is on the web only" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: true, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "openhands", displayName: "OpenHands CLI", tier: "more", transport: "acp", integration: "structured", parser: "generic-json", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["acp"] }, experimental: true, localAuth: ["api-key", "vendor-cli"], binary: "openhands", installer: HARNESS_INSTALLERS.openhands, authFiles: [{ path: "${OPENHANDS_PERSISTENCE_DIR:-~/.openhands}/cloud/api_key.txt" }, { path: "${OPENHANDS_PERSISTENCE_DIR:-~/.openhands}/agent_settings.json", contains: "api_key" }], authEnv: ["LLM_API_KEY"], loginArgv: ["login"], logoutArgv: ["logout"], permissionModes: ["bypass", "auto"], permissionArgv: { bypass: { argv: ["--always-approve"] }, auto: { argv: ["--llm-approve"] } }, turn: { startArgv: ["--headless", "--json"], promptArgvPrefix: ["-t"], output: "json-lines", responseFields: ["text", "content", "response", "result"] }, session: { resumeIdPrefix: ["--resume"] } },
608
+ // Continue CLI: `cn -p` is the documented headless mode and prints the final
609
+ // answer as text. No ACP mode is declared because none is documented.
610
+ // Flags read from `cn --help` on a real install: -p/--print for headless,
611
+ // --model <slug>, and a permission surface of --readonly (plan, read-only
612
+ // tools) / --auto (all tools allowed) / --allow / --exclude. `--format json`
613
+ // exists too but is left unwired: the flag is documented, the shape its
614
+ // output takes is not, and a parser declared against an unverified shape
615
+ // fails at the one moment it matters.
616
+ // cn 1.5.47 has no model selector: `--model <slug>` ADDS a hub model (owner/package), so a
617
+ // plain model id is not passed; the model comes from the assistant's config.yaml / --config.
618
+ { command: "cn", quotaProbe: { none: "`cn --help` has no usage, status or quota command" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: false, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "continue", displayName: "Continue", tier: "more", transport: "text-cli", integration: "compatibility", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, experimental: true, localAuth: ["api-key", "oauth", "vendor-cli"], binary: "cn", npmPackage: "@continuedev/cli", loginArgv: [], authFiles: [{ path: "${CONTINUE_GLOBAL_DIR:-~/.continue}/config.yaml", contains: "apiKey:" }], authEnv: ["ANTHROPIC_API_KEY"], planMode: { option: "readonly", value: true }, permissionModes: ["ask", "bypass"], permissionArgv: { ask: { argv: [] }, bypass: { argv: ["--auto"] } }, turn: { stateless: true, startArgv: [], promptArgvPrefix: ["-p"], output: "text" } },
619
+ // ACP entrypoints checked against each vendor's own source. Devin CLI and
620
+ // MiniMax Code also have session stores and native-thread writers, and
621
+ // their failover carry was verified live on 2026-10-05: Devin with signed-in
622
+ // ACP turns, MiniMax Code only against a local stub model (its sign-ins had
623
+ // expired). Deep Agents Code and Junie have run no turn. All four stay in
624
+ // the experimental picker tier until each has run signed-in turns on its
625
+ // own models through ClikCode's normal path.
626
+ // dcode 0.x `--help`: `-y, --auto-approve` = "classifier-backed Auto mode (TUI or ACP); ignored with a warning in headless mode", so only `auto` is
627
+ // mapped; Ask is its unflagged default (permission requests over ACP). It has no bypass switch (`-S all` is a shell allow-list, not file edits).
628
+ {
629
+ command: "dcode",
630
+ quotaProbe: { none: "`dcode --help` / `dcode auth` list provider keys only, no quota read" },
631
+ subagents: { read: "none", steer: "none" },
632
+ capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false },
633
+ provider: "deepagents-code",
634
+ displayName: "Deep Agents Code",
635
+ tier: "experimental",
636
+ transport: "acp",
637
+ integration: "structured",
638
+ parser: "text",
639
+ memoryFile: "AGENTS.md",
640
+ nativeSlashPassthrough: false,
641
+ experimental: true,
642
+ acp: { argv: ["--acp"], optionPlacement: "after" },
643
+ permissionModes: ["ask", "auto"],
644
+ permissionArgv: { ask: { argv: [] }, auto: { argv: ["-y"] } },
645
+ localAuth: ["api-key", "vendor-cli"],
646
+ binary: "dcode",
647
+ authFiles: [{ path: "~/.deepagents/.state/auth.json", contains: '"type":' }],
648
+ installer: HARNESS_INSTALLERS.dcode,
649
+ loginArgv: [],
650
+ loginKeyCommand: { providersArgv: ["auth", "list"], setArgv: ["auth", "set", "{provider}"] },
651
+ // Its provider names (`dcode auth list`), for the key's provider.
652
+ loginKeyRoutes: providerKeyRoutes([], { anthropic: "anthropic", openai: "openai", google: "google_genai" }),
653
+ authEnv: ["ANTHROPIC_API_KEY", "OPENAI_API_KEY", "GOOGLE_API_KEY"],
654
+ modelArgvPrefix: ["--model"]
655
+ },
656
+ // devin 3000.11.3 session/new: starts in `accept-edits` (workspace edits auto-approved) and offers
657
+ // modes accept-edits|smart|ask|plan|bypass (configOptions id `mode`, category `mode`). `ask` is its
658
+ // read-only Q&A mode, the strict end of ClikCode's ask.
659
+ { command: "devin", quotaProbe: true, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, freePlan: { listed: true }, loginAccountChoose: ["Log in with browser"], provider: "devin", displayName: "Devin CLI", tier: "more", transport: "acp", integration: "structured", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, acp: { argv: ["acp"], optionPlacement: "after", permissionModeIds: { ask: "ask", auto: "smart", bypass: "bypass" }, planModeId: "plan" }, permissionModes: ["ask", "auto", "bypass"], localAuth: ["oauth", "api-key", "vendor-cli"], binary: "devin", authFiles: [{ path: "${XDG_DATA_HOME:-~/.local/share}/devin/credentials.toml", contains: "api_key" }], installer: HARNESS_INSTALLERS.devin, loginArgv: ["auth", "login"], statusArgv: ["auth", "status"], logoutArgv: ["auth", "logout"], authEnv: ["WINDSURF_API_KEY"], modelArgvPrefix: ["--model"] },
660
+ // junie 26.9.22 initialize (vendor-sandbox, 2026-10-11): `_meta.steering.supported: true`. Checked 2026-10-12: it does NOT answer `_session/steering`
661
+ // as claude-agent-acp does (idle, with `promptRequired`, it answers `startedNewTurn`), so `acp.steering: false` keeps ClikCode from steering it. session/new (signed in): modes default|plan, config
662
+ // options mode, model, effort (low|medium|high), brave_mode (brave-auto|on|off) -- brave_mode is a config option, not a mode id, so no permission mapping.
663
+ { command: "junie", quotaProbe: { none: "`junie --help` has no usage or quota command" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "junie", displayName: "Junie CLI", tier: "experimental", transport: "acp", integration: "structured", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, experimental: true, acp: { argv: ["--acp", "true"], effortConfigId: "effort", planModeId: "plan", steering: false }, localAuth: ["oauth", "api-key", "vendor-cli"], binary: "junie", authFiles: [{ path: "~/.junie/secure_credentials.json", contains: "jb-account-stored" }], installer: HARNESS_INSTALLERS.junie, loginArgv: [], authEnv: ["JUNIE_API_KEY", "ANTHROPIC_API_KEY", "OPENAI_API_KEY"], modelArgvPrefix: ["--model"], effortArgvPrefix: ["--effort"], effortValues: ["low", "medium", "high"] },
664
+ // Sign-in evidence: the OAuth record `mcode login` writes under
665
+ // ~/.minimax/auth/prod/<region>/<client>/auth.json (vendor-identity.ts
666
+ // reads the same record for the account's email).
667
+ { command: "mcode", quotaProbe: { none: "`mcode --help` could not be run under the sandbox (it writes ~/.minimax-code); no usage command known" }, subagents: { read: "none", steer: "none" }, capabilities: { childActivity: false, thinking: false, plan: false, usage: false, toolOutput: true, backgroundAgents: false, backgroundTerminals: false, workflows: false }, provider: "minimax-code", displayName: "MiniMax Code", tier: "experimental", transport: "acp", integration: "structured", parser: "text", memoryFile: "AGENTS.md", nativeSlashPassthrough: false, experimental: true, acp: { argv: ["acp"] }, localAuth: ["oauth", "api-key", "vendor-cli"], binary: "mcode", installer: HARNESS_INSTALLERS.mcode, loginArgv: ["login", "--region", "global"], logoutArgv: ["logout"], authFiles: [{ path: "~/.minimax/auth/prod/*/*/auth.json", contains: '"accessToken"' }], authEnv: ["MCODE_PROVIDER_API_KEY"] }
668
+ ];
669
+ var SANDBOX_TURN = '`clikcode send --harness <h> "Reply with the single word PONG"` under scripts/vendor-sandbox.mjs --auth <h>';
670
+ var LIVE_CHECKS = {
671
+ devin: { at: "2026-10-12", verified: true, method: `${SANDBOX_TURN}: model swe-1-6-slow discovered over ACP, native session id captured, reply and token usage (input, output, cache) reported` },
672
+ junie: { at: "2026-10-12", verified: false, method: "raw ACP session under the sandbox, and one `clikcode send` turn", note: 'the sandbox cannot read the sign-in (prompt answers "Authentication is required" or stopReason cancelled); initialize, session/new with model, effort and mode options, and `_session/steering` were read live' },
673
+ amp: { at: "2026-10-12", verified: false, method: `${SANDBOX_TURN}, and \`amp usage\``, note: 'the account session has expired ("Session expired and could not be refreshed"); signing in again is an account change' },
674
+ aider: { at: "2026-10-12", verified: false, method: `${SANDBOX_TURN} with a free OpenRouter model`, note: "the turn ran and its error was reported cleanly (OpenRouter 404: the cached free model is gone); no PONG reached because a second turn was not allowed" },
675
+ cn: { at: "2026-10-12", verified: false, method: `${SANDBOX_TURN}`, note: "the account has no model or key in ~/.continue/config.yaml (models: []), so ClikCode refuses the turn as not signed in" },
676
+ dcode: { at: "2026-10-12", verified: false, method: `${SANDBOX_TURN}`, note: "no provider key stored (~/.deepagents/.state/auth.json absent), so ClikCode refuses the turn as not signed in" },
677
+ openclaw: { at: "2026-10-12", verified: false, method: "not run", note: "declares no sign-in file to link, and its configured models route through the claude-cli runtime, i.e. another harness account" },
678
+ mcode: { at: "2026-10-12", verified: false, method: "not run", note: "account is exhausted" },
679
+ kimi: { at: "2026-10-12", verified: false, method: "not run", note: "account needs login" },
680
+ openhands: { at: "2026-10-12", verified: false, method: "not run", note: "account needs login" },
681
+ auggie: { at: "2026-10-12", verified: false, method: "not run", note: "account is out of credits" },
682
+ vibe: { at: "2026-10-12", verified: false, method: "not run", note: "the plan allows no requests" }
683
+ };
684
+ function deriveModes(entry) {
685
+ const permissions = entry.permissions;
686
+ if (!permissions) return entry;
687
+ const modes = Object.entries(permissions);
688
+ const permissionArgv = Object.fromEntries(modes.map(([mode, { argv, placement }]) => [mode, { argv, ...placement ? { placement } : {} }]));
689
+ const ids = Object.fromEntries(modes.filter(([, { acpModeId }]) => acpModeId).map(([mode, { acpModeId }]) => [mode, acpModeId]));
690
+ return {
691
+ ...entry,
692
+ permissionArgv,
693
+ ...entry.acp && Object.keys(ids).length ? { acp: { ...entry.acp, permissionModeIds: ids } } : {}
694
+ };
695
+ }
696
+ var AI_LOCAL_HARNESSES = CATALOG_HARNESSES.map((entry) => {
697
+ const liveCheck = LIVE_CHECKS[entry.command];
698
+ const harness = deriveModes(liveCheck ? { ...entry, liveCheck } : entry);
699
+ if (harness.profileEnv) return harness;
700
+ return { ...harness, profileEnv: "HOME", profileEnvPassthrough: HOME_REDIRECT_ENV_PASSTHROUGH };
701
+ });
702
+ function harnessIntegrationLevel(harness) {
703
+ if (harness.integration) return harness.integration;
704
+ if (harness.transport === "codex-app-server") return "native";
705
+ if (harness.transport === "acp" && harness.acp) return "structured";
706
+ if (harness.transport === "text-cli") return "compatibility";
707
+ return harness.turn && harness.turn.output !== "text" ? "structured" : "compatibility";
708
+ }
709
+ var flag = (id, label, description, category, argv, extra = {}) => ({ id, label, description, category, kind: "boolean", argv, argvStyle: "flag", appliesTo: "both", ...extra });
710
+ var value = (id, label, description, category, argv, kind = "string", extra = {}) => ({ id, label, description, category, kind, argv, argvStyle: "value", appliesTo: "both", ...extra });
711
+ var AI_LOCAL_HARNESS_CAPABILITIES = {
712
+ claude: {
713
+ options: [
714
+ value("agent", "Agent", "Use a configured Claude agent", "mode", ["--agent"]),
715
+ value("tools", "Built-in tools", "Choose the built-in tools available to the session", "tools", ["--tools"], "string-list", { argvStyle: "csv" }),
716
+ value("allowed-tools", "Allowed tools", "Tool patterns allowed without prompting", "permissions", ["--allowed-tools"], "string-list", { argvStyle: "csv" }),
717
+ value("disallowed-tools", "Denied tools", "Tool patterns that must not run", "permissions", ["--disallowed-tools"], "string-list", { argvStyle: "csv" }),
718
+ value("add-dir", "Additional directories", "Additional directories Claude may access", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
719
+ value("fallback-model", "Fallback models", "Ordered models used when the primary is unavailable", "model", ["--fallback-model"]),
720
+ value("max-budget-usd", "Maximum budget (USD)", "Maximum API spend for a print-mode turn", "safety", ["--max-budget-usd"], "number"),
721
+ value("mcp-config", "MCP configuration", "JSON files or inline MCP configuration", "tools", ["--mcp-config"], "path-list", { argvStyle: "repeat" }),
722
+ value("plugin-dir", "Plugin directories", "Plugin folders or archives loaded for this session", "tools", ["--plugin-dir"], "path-list", { argvStyle: "repeat" }),
723
+ value("autocompact", "Auto compact", "Automatic context compaction threshold", "session", ["--autocompact"]),
724
+ flag("safe-mode", "Safe mode", "Disable customizations, plugins, skills, hooks, and MCP", "safety", ["--safe-mode"]),
725
+ flag("restricted", "Restricted mode", "Remove code-running tools and constrain file access", "safety", ["--restricted"]),
726
+ flag("bare", "Bare mode", "Skip hooks, plugins, memory, settings, and instruction discovery", "safety", ["--bare"]),
727
+ flag("disable-skills", "Disable skills", "Disable skill slash commands", "tools", ["--disable-slash-commands"]),
728
+ flag("chrome", "Chrome integration", "Enable Claude in Chrome integration", "tools", ["--chrome"])
729
+ ],
730
+ managers: {
731
+ // User scope: Claude's default is the current folder only. `--` keeps a
732
+ // local server's own dash arguments from being read as Claude's options.
733
+ mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".claude.json"], rootRelative: [".claude.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] },
734
+ plugins: { label: "Plugins", listArgv: ["plugin", "list"], manageArgv: ["plugin"] },
735
+ agents: { label: "Agents", listArgv: ["agents"], manageArgv: ["agents"] }
736
+ },
737
+ features: ["skills", "hooks", "custom commands", "settings layers"]
738
+ },
739
+ codex: {
740
+ options: [
741
+ value("profile", "Configuration profile", "Layer a named Codex profile over config.toml", "advanced", ["--profile"]),
742
+ value("add-dir", "Additional writable directories", "Writable roots in addition to the workspace", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
743
+ value("output-schema", "Output schema", "JSON Schema for the final response", "output", ["--output-schema"], "path"),
744
+ value("local-provider", "Local provider", "Local OSS runtime used with OSS mode", "model", ["--local-provider"], "enum", { values: ["lmstudio", "ollama"] }),
745
+ flag("oss", "Open-source model", "Use a configured local open-source provider", "model", ["--oss"]),
746
+ flag("search", "Web search", "Enable the native web-search tool", "tools", ["--search"], { argvPlacement: "root" }),
747
+ flag("network-access", "Network access", "Allow outbound network from Codex workspace-write commands (required for GitHub in Ask mode)", "safety", ["--config", "sandbox_workspace_write.network_access=true"], { argvPlacement: "root" }),
748
+ flag("worktree", "Managed worktree", "Run in a new managed Git worktree", "session", ["--worktree"], { requiresNewSession: true }),
749
+ flag("ephemeral", "Ephemeral session", "Do not persist native session files", "session", ["--ephemeral"], { requiresNewSession: true }),
750
+ flag("ignore-user-config", "Ignore user config", "Do not load CODEX_HOME/config.toml", "safety", ["--ignore-user-config"]),
751
+ flag("ignore-rules", "Ignore execution rules", "Do not load user or project execpolicy rules", "safety", ["--ignore-rules"]),
752
+ flag("strict-config", "Strict configuration", "Fail on unrecognized configuration keys", "safety", ["--strict-config"])
753
+ ],
754
+ managers: {
755
+ mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".codex", "config.toml"], rootRelative: ["config.toml"], format: "toml", key: ["mcp_servers"], dialect: "codex" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] },
756
+ plugins: { label: "Plugins", listArgv: ["plugin", "list"], manageArgv: ["plugin"] },
757
+ agents: { label: "Agents", listArgv: ["agents"], manageArgv: ["agents"] }
758
+ },
759
+ features: ["skills", "plugins", "approval policies", "feature flags", "configuration profiles"]
760
+ },
761
+ opencode: {
762
+ options: [
763
+ value("agent", "Agent", "Agent configuration used for the turn", "mode", ["--agent"]),
764
+ value("title", "Session title", "Title assigned to a new native session", "session", ["--title"], "string", { appliesTo: "start" }),
765
+ flag("pure", "Pure mode", "Run without external plugins", "safety", ["--pure"]),
766
+ flag("auto-approve", "Auto approve", "Auto-approve permissions not explicitly denied", "permissions", ["--auto"], { dangerous: true }),
767
+ flag("thinking-output", "Show thinking events", "Include provider thinking blocks in event output", "output", ["--thinking"]),
768
+ flag("fork-native-session", "Fork native session", "Fork before continuing the selected session", "session", ["--fork"], { appliesTo: "resume", requiresNewSession: true }),
769
+ flag("share", "Share session", "Publish the native session through OpenCode", "session", ["--share"])
770
+ ],
771
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".config", "opencode", "opencode.json"], format: "jsonc", key: ["mcp"], dialect: "opencode" }, { homeRelative: [".config", "opencode", "opencode.jsonc"], format: "jsonc", key: ["mcp"], dialect: "opencode" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, agents: { label: "Agents", manageArgv: ["agent"] } },
772
+ features: ["plugins", "commands", "remote server attachment"]
773
+ },
774
+ copilot: {
775
+ options: [
776
+ value("agent", "Agent", "Custom Copilot agent", "mode", ["--agent"]),
777
+ value("additional-mcp-config", "Additional MCP config", "Per-session MCP JSON or @file", "tools", ["--additional-mcp-config"]),
778
+ value("allow-tool", "Allowed tools", "Tool or MCP permission patterns", "permissions", ["--allow-tool"], "string-list", { argvStyle: "repeat" }),
779
+ value("deny-tool", "Denied tools", "Tool or MCP denial patterns", "permissions", ["--deny-tool"], "string-list", { argvStyle: "repeat" }),
780
+ value("context-tier", "Context tier", "Context-window tier for supported models", "model", ["--context"], "enum", { values: ["default", "long_context"] }),
781
+ value("max-autopilot-continues", "Autopilot continuation limit", "Maximum automatic continuation messages", "safety", ["--max-autopilot-continues"], "number"),
782
+ flag("plan", "Plan mode", "Start in read-only planning mode", "mode", ["--plan"]),
783
+ flag("no-ask-user", "Disable questions", "Prevent the agent from asking clarifying questions", "mode", ["--no-ask-user"]),
784
+ flag("sandbox", "Shell sandbox", "Enable Copilot\u2019s OS-level shell sandbox", "safety", ["--sandbox"]),
785
+ flag("no-custom-instructions", "Ignore custom instructions", "Do not load repository instruction files", "context", ["--no-custom-instructions"]),
786
+ flag("no-remote", "Disable remote access", "Disable remote control for this session", "safety", ["--no-remote"]),
787
+ flag("no-remote-export", "Disable remote export", "Do not export this session to GitHub remote clients", "safety", ["--no-remote-export"]),
788
+ flag("worktree", "Managed worktree", "Run in a separate managed Git worktree", "session", ["--worktree"], { requiresNewSession: true })
789
+ ],
790
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".copilot", "mcp-config.json"], rootRelative: ["mcp-config.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list", "--json"], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] }, skills: { label: "Skills", manageArgv: ["skill"] }, agents: { label: "Instructions and agents", manageArgv: ["instruction"] } },
791
+ features: ["skills", "custom agents", "hooks", "plugins", "built-in GitHub MCP"]
792
+ },
793
+ aider: {
794
+ options: [
795
+ value("edit-format", "Edit format", "Editing protocol used by the primary model", "mode", ["--edit-format"]),
796
+ value("weak-model", "Weak model", "Model used for commits and history summarization", "model", ["--weak-model"]),
797
+ value("editor-model", "Editor model", "Model used for editor tasks", "model", ["--editor-model"]),
798
+ value("file", "Editable files", "Files added to the editable chat context", "context", ["--file"], "path-list", { argvStyle: "repeat" }),
799
+ value("read", "Read-only files", "Files added as read-only context", "context", ["--read"], "path-list", { argvStyle: "repeat" }),
800
+ value("lint-command", "Lint command", "Command Aider runs to lint changes", "tools", ["--lint-cmd"]),
801
+ value("test-command", "Test command", "Command Aider runs for tests", "tools", ["--test-cmd"]),
802
+ value("map-tokens", "Repository map tokens", "Token budget for the repository map", "context", ["--map-tokens"], "number"),
803
+ value("map-refresh", "Repository map refresh", "When Aider refreshes its repository map", "context", ["--map-refresh"], "enum", { values: ["auto", "always", "files", "manual"] }),
804
+ value("max-history-tokens", "History token limit", "Soft limit before chat-history summarization", "session", ["--max-chat-history-tokens"], "number"),
805
+ flag("architect", "Architect mode", "Use architect/editor two-stage changes", "mode", ["--architect"]),
806
+ flag("dry-run", "Dry run", "Analyze without modifying files", "safety", ["--dry-run"]),
807
+ flag("no-git", "Disable Git integration", "Do not inspect or modify Git state", "safety", ["--no-git"]),
808
+ flag("no-auto-commits", "Disable auto commits", "Do not automatically commit agent changes", "safety", ["--no-auto-commits"]),
809
+ flag("cache-prompts", "Prompt caching", "Enable provider prompt caching", "advanced", ["--cache-prompts"])
810
+ ],
811
+ features: ["architect/ask/code modes", "lint and test commands", "repository map", "voice"]
812
+ },
813
+ goose: {
814
+ options: [
815
+ value("provider", "Inference provider", "Provider used for this run", "model", ["--provider"]),
816
+ value("system", "Additional instructions", "Additional system instructions for the agent", "context", ["--system"]),
817
+ value("max-tool-repetitions", "Tool repetition limit", "Maximum identical consecutive tool calls", "safety", ["--max-tool-repetitions"], "number"),
818
+ value("max-turns", "Maximum turns", "Maximum autonomous turns without user input", "safety", ["--max-turns"], "number"),
819
+ value("container", "Extension container", "Run extensions in the selected Docker container", "safety", ["--container"]),
820
+ value("with-extension", "Stdio extensions", "Additional stdio extension commands", "tools", ["--with-extension"], "string-list", { argvStyle: "repeat" }),
821
+ value("with-http-extension", "HTTP extensions", "Additional Streamable HTTP extension URLs", "tools", ["--with-streamable-http-extension"], "string-list", { argvStyle: "repeat" }),
822
+ value("with-builtin", "Built-in extensions", "Built-in extensions enabled for the run", "tools", ["--with-builtin"], "string-list"),
823
+ flag("ephemeral", "Ephemeral session", "Do not store the Goose session", "session", ["--no-session"], { requiresNewSession: true })
824
+ ],
825
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".config", "goose", "config.yaml"], format: "yaml", key: ["extensions"], dialect: "goose" }], manageArgv: ["configure"] }, skills: { label: "Skills", listArgv: ["skills", "list"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] } },
826
+ features: ["extensions", "recipes", "ACP", "scheduled recipes", "session export"]
827
+ },
828
+ // MCP surfaces read from each CLI's own --help on a real install. These
829
+ // three support MCP and had no capability entry at all, so ClikCode offered
830
+ // them no /mcp even though the harness has one.
831
+ //
832
+ // Options read from `grok --help`: --allow/--deny are permission RULES (the
833
+ // --allowedTools/--disallowedTools aliases sit beside them), while
834
+ // --disallowed-tools removes built-in tools outright. --always-approve is
835
+ // deliberately absent: it is a bypass-permission spelling the permission
836
+ // selector already owns, and a raw row beside it would disagree with Ask.
837
+ grok: {
838
+ options: [
839
+ value("agent", "Agent", "Agent name or definition file used for the session", "mode", ["--agent"]),
840
+ value("allow", "Allowed tools", "Permission allow rules for tools", "permissions", ["--allow"], "string-list", { argvStyle: "repeat" }),
841
+ value("deny", "Denied tools", "Permission deny rules for tools", "permissions", ["--deny"], "string-list", { argvStyle: "repeat" }),
842
+ value("disallowed-tools", "Removed built-in tools", "Built-in tools to remove, comma-separated", "tools", ["--disallowed-tools"], "string-list", { argvStyle: "csv" }),
843
+ flag("disable-web-search", "Disable web search", "Disable web search and web fetch tools", "tools", ["--disable-web-search"]),
844
+ flag("no-subagents", "Disable subagents", "Disable subagent spawning", "mode", ["--no-subagents"]),
845
+ flag("no-plan", "Disable plan mode", "Skip the plan phase before execution", "mode", ["--no-plan"]),
846
+ value("rules", "Rules", "Extra rules appended to the system prompt", "context", ["--rules"], "path"),
847
+ value("sandbox", "Sandbox", "Sandbox profile for filesystem and network access", "safety", ["--sandbox"]),
848
+ value("system-prompt", "System prompt", "Override the agent system prompt", "context", ["--system-prompt-override"]),
849
+ value("tools", "Built-in tools", "Built-in tools to allow, comma-separated", "tools", ["--tools"], "string-list", { argvStyle: "csv" }),
850
+ flag("verbatim", "Verbatim prompt", "Send the prompt exactly as given", "output", ["--verbatim"]),
851
+ value("json-schema", "Output schema", "JSON schema constraining the final response", "output", ["--json-schema"]),
852
+ value("max-turns", "Maximum turns", "Maximum number of agent turns", "safety", ["--max-turns"], "number"),
853
+ flag("worktree", "Managed worktree", "Start the session in a new Git worktree", "session", ["--worktree"], { requiresNewSession: true }),
854
+ flag("fork-session", "Fork on resume", "Create a new session id when resuming", "session", ["--fork-session"], { appliesTo: "resume", requiresNewSession: true })
855
+ ],
856
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".grok", "config.toml"], format: "toml", key: ["mcp_servers"], dialect: "codex" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] } },
857
+ features: ["skills", "plugins", "subagents", "plan mode", "memory"]
858
+ },
859
+ kimi: {
860
+ options: [
861
+ value("agent", "Agent", "Agent profile starting the new session", "mode", ["--agent"], "string", { appliesTo: "start", requiresNewSession: true }),
862
+ value("agent-file", "Agent definition file", "Markdown agent definition loaded for the session", "mode", ["--agent-file"], "path", { appliesTo: "start", requiresNewSession: true }),
863
+ value("skills-dir", "Skills directory", "Load skills from this directory instead of auto-discovery", "tools", ["--skills-dir"], "path-list", { argvStyle: "repeat" }),
864
+ value("add-dir", "Additional directories", "Additional workspace directories for the session", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
865
+ // `--plan` ("Start in plan mode", kimi 2.0.2 --help) is the Plan mode switch (`planMode`),
866
+ // no longer the argv sent for Ask: Ask is Kimi's unflagged default (ACP mode `default`).
867
+ flag("plan", "Plan mode", "Start in read-only plan mode", "mode", ["--plan"], { appliesTo: "start", requiresNewSession: true })
868
+ ],
869
+ // No MCP here: `kimi --help` lists export/fork/provider/session/acp/web/
870
+ // server/rc/login/doctor/vis/install-desktop and mentions mcp nowhere.
871
+ // An earlier entry claimed one on a misreading of that list.
872
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".kimi-code", "mcp.json"], rootRelative: ["mcp.json"], rootEnv: "KIMI_CODE_HOME", format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], manageArgv: ["mcp"] } },
873
+ features: ["skills", "agents", "ACP"]
874
+ },
875
+ openhands: {
876
+ options: [
877
+ value("file", "Seed file", "File whose contents seed the initial conversation", "context", ["--file"], "path"),
878
+ flag("exit-without-confirmation", "Exit without confirmation", "Exit even when an action would require confirmation", "safety", ["--exit-without-confirmation"]),
879
+ flag("override-with-envs", "Override env vars", "Read LLM_API_KEY, LLM_BASE_URL and LLM_MODEL from the environment", "advanced", ["--override-with-envs"])
880
+ ],
881
+ managers: { mcp: { label: "MCP servers", listArgv: ["mcp", "list"], manageArgv: ["mcp"] } },
882
+ features: ["ACP", "web UI"]
883
+ },
884
+ // Amp is the only harness of the 25 that reports a CREDIT BALANCE rather
885
+ // than spend: `amp usage` is documented as "Show your current Amp usage and
886
+ // credit balance", with --details for a credit/token/thread breakdown.
887
+ //
888
+ // Not wired, and deliberately so: it needs an Amp login to return anything
889
+ // ("Invalid or missing API key"), so its output shape is unverified here. A
890
+ // parser written against a guessed shape would put an invented money figure
891
+ // on screen, which is worse than showing nothing. Wire it from a real
892
+ // response, not from this comment.
893
+ amp: {
894
+ options: [
895
+ value("mcp-config", "MCP configuration", "Per-turn MCP server configuration", "tools", ["--mcp-config"]),
896
+ value("mode", "Agent mode", "Amp agent mode: low, medium, high or ultra. Picks the model, system prompt and tools -- a model tier, not a permission level", "model", ["--mode"], "enum", { values: ["low", "medium", "high", "ultra"] }),
897
+ flag("fast", "Fast mode", "Use Amp Fast mode for this invocation", "mode", ["--fast"]),
898
+ value("plugin-ready-timeout", "Plugin startup timeout", "Wait this many seconds for plugins before starting", "tools", ["--plugin-ready-timeout"], "number")
899
+ ],
900
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".config", "amp", "settings.json"], format: "json", key: ["amp.mcpServers"], dialect: "mcp-servers" }], manageArgv: ["mcp"] } },
901
+ features: ["skills", "plugins", "orbs", "settings layers"]
902
+ },
903
+ antigravity: {
904
+ options: [
905
+ value("agent", "Agent", "Agent used for the current session", "mode", ["--agent"]),
906
+ value("add-dir", "Additional directories", "Additional directories included in the workspace", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
907
+ value("json-schema", "Output schema", "JSON schema string or file for the final result", "output", ["--json-schema"]),
908
+ value("print-timeout", "Turn timeout", "Maximum print-mode duration, such as 15m", "safety", ["--print-timeout"]),
909
+ value("project", "Project", "Project id or name for this session", "context", ["--project"], "string", { requiresNewSession: true }),
910
+ value("mode", "Execution mode", "Use edit-accepting or read-only planning behavior", "mode", ["--mode"], "enum", { values: ["accept-edits", "plan"] }),
911
+ flag("sandbox", "Terminal sandbox", "Run terminal commands with sandbox restrictions", "safety", ["--sandbox"]),
912
+ flag("disable-skills", "Disable skills", "Disable slash-command and skill expansion", "tools", ["--disable-slash-commands"])
913
+ ],
914
+ managers: {
915
+ mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".gemini", "config", "mcp_config.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] },
916
+ plugins: { label: "Plugins", listArgv: ["plugin", "list"], manageArgv: ["plugin"] },
917
+ agents: { label: "Agents", listArgv: ["agents"], manageArgv: ["agents"] }
918
+ },
919
+ features: ["skills", "plugins", "custom agents", "remote control", "sandbox"]
920
+ },
921
+ pi: {
922
+ options: [
923
+ value("provider", "Inference provider", "Provider used for this turn", "model", ["--provider"]),
924
+ value("tools", "Allowed tools", "Allowlist built-in, extension, and custom tools", "tools", ["--tools"], "string-list", { argvStyle: "csv" }),
925
+ value("exclude-tools", "Excluded tools", "Disable matching tool names", "tools", ["--exclude-tools"], "string-list", { argvStyle: "csv" }),
926
+ value("models", "Model cycle", "Models available for in-session cycling", "model", ["--models"], "string-list", { argvStyle: "csv" }),
927
+ value("session-dir", "Session directory", "Custom directory for native session storage", "session", ["--session-dir"], "path", { requiresNewSession: true }),
928
+ value("session-name", "Session name", "Name assigned to a new native session", "session", ["--name"], "string", { appliesTo: "start" }),
929
+ flag("no-builtin-tools", "Disable built-in tools", "Keep extension tools but disable built-in tools", "tools", ["--no-builtin-tools"]),
930
+ flag("no-tools", "Disable all tools", "Start without any tools enabled", "tools", ["--no-tools"]),
931
+ flag("ephemeral", "Ephemeral session", "Do not save a native session", "session", ["--no-session"], { requiresNewSession: true })
932
+ ],
933
+ managers: { plugins: { label: "Packages and extensions", listArgv: ["list"], manageArgv: ["config"] } },
934
+ features: ["extensions", "skills", "prompt templates", "provider/model registry"]
935
+ },
936
+ droid: {
937
+ options: [
938
+ value("restrict-tools", "Restricted tools", "Allow only the selected tool ids", "tools", ["--restrict-tools"], "string-list"),
939
+ value("additional-tools", "Additional tools", "Enable tools beyond the defaults", "tools", ["--additional-tools"], "string-list"),
940
+ value("disabled-tools", "Disabled tools", "Disable selected tool ids", "tools", ["--disabled-tools"], "string-list"),
941
+ value("spec-model", "Specification model", "Model used during specification planning", "model", ["--spec-model"]),
942
+ value("spec-effort", "Specification effort", "Reasoning effort used during specification planning", "reasoning", ["--spec-reasoning-effort"]),
943
+ value("append-system-prompt", "Additional instructions", "Append text to Droid\u2019s system prompt", "context", ["--append-system-prompt"]),
944
+ value("append-system-prompt-file", "Instruction file", "Append a file to Droid\u2019s system prompt", "context", ["--append-system-prompt-file"], "path"),
945
+ flag("spec-mode", "Specification mode", "Plan in read-only specification mode before execution", "mode", ["--use-spec"]),
946
+ // `--disable-builtin-skills` is deliberately absent: droid 0.223.0 refuses it in ACP
947
+ // modes ("Invalid flags: --disable-builtin-skills is not supported in ACP modes"),
948
+ // which is how every droid turn runs, so the child died at launch.
949
+ flag("worktree", "Managed worktree", "Run in an isolated Droid worktree", "session", ["--worktree"], { requiresNewSession: true }),
950
+ flag("mission", "Mission mode", "Run multi-agent mission orchestration", "mode", ["--mission"])
951
+ ],
952
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".factory", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] } },
953
+ features: ["skills", "custom droids", "hooks", "missions", "auto/spec modes", "JSON-RPC permission transport"]
954
+ },
955
+ kiro: {
956
+ options: [
957
+ value("agent-engine", "Agent engine", "Headless engine version", "advanced", ["--agent-engine"], "enum", { values: ["v1", "v2", "v3"], requiresNewSession: true }),
958
+ value("trusted-tools", "Trusted tools", "Tool categories approved in advance", "permissions", ["--trust-tools"], "string-list", { argvStyle: "csv" }),
959
+ flag("require-mcp-startup", "Require MCP startup", "Fail the run if any MCP server cannot start", "tools", ["--require-mcp-startup"])
960
+ ],
961
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".kiro", "settings", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] } },
962
+ features: ["skills", "custom agents", "hooks", "steering", "powers", "plan mode"]
963
+ },
964
+ // Every flag here read from `gemini --help` on a real install. --safe-mode
965
+ // was in the entry this replaces and no longer exists in 0.60.0; --policy
966
+ // and --extensions are new and did not. --allowed-tools is documented as
967
+ // deprecated in favour of the policy engine but still accepted, so it stays
968
+ // until it actually stops working.
969
+ gemini: {
970
+ options: [
971
+ value("approval-mode", "Approval mode", "Tool-call approval policy", "permissions", ["--approval-mode"], "enum", { values: ["default", "auto_edit", "yolo", "plan"] }),
972
+ value("allowed-tools", "Allowed tools", "Tools that bypass confirmation", "permissions", ["--allowed-tools"], "string-list"),
973
+ value("policy", "Policy files", "Additional policy files or directories to load", "permissions", ["--policy"], "path-list"),
974
+ value("allowed-mcp-servers", "Allowed MCP servers", "MCP servers enabled for this session", "tools", ["--allowed-mcp-server-names"], "string-list"),
975
+ value("include-directories", "Additional directories", "Additional directories included in context", "context", ["--include-directories"], "path-list"),
976
+ value("extensions", "Extensions", "Extensions to load; all are used when unset", "tools", ["--extensions"], "string-list")
977
+ ],
978
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".gemini", "settings.json"], format: "json", key: ["mcpServers"], dialect: "gemini" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, plugins: { label: "Extensions", listArgv: ["extensions", "list"], manageArgv: ["extensions"] } },
979
+ features: ["skills", "agents", "extensions", "custom commands", "memory"]
980
+ },
981
+ qwen: {
982
+ options: [
983
+ value("approval-mode", "Approval mode", "Tool-call approval policy", "permissions", ["--approval-mode"], "enum", { values: ["plan", "default", "auto-edit", "auto", "yolo"] }),
984
+ value("include-directories", "Additional directories", "Additional roots included in context", "context", ["--include-directories"], "path-list"),
985
+ value("max-session-turns", "Maximum turns", "Limit model/tool turns in this run", "safety", ["--max-session-turns"], "number"),
986
+ value("max-wall-time", "Maximum wall time", "Wall-clock limit such as 10m", "safety", ["--max-wall-time"]),
987
+ value("max-tool-calls", "Maximum tool calls", "Cumulative tool-call limit", "safety", ["--max-tool-calls"], "number"),
988
+ flag("safe-mode", "Safe mode", "Disable context, hooks, extensions, skills, MCP, subagents, and memory", "safety", ["--safe-mode"])
989
+ ],
990
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".qwen", "settings.json"], format: "json", key: ["mcpServers"], dialect: "gemini" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, skills: { label: "Skills", manageArgv: ["skills"] } },
991
+ features: ["skills", "extensions", "subagents", "workflows", "memory", "plan mode"]
992
+ },
993
+ cline: {
994
+ options: [
995
+ value("provider", "Inference provider", "Cline inference provider id", "model", ["--provider"]),
996
+ value("system-prompt", "System prompt", "Override the default system prompt", "context", ["--system"]),
997
+ value("auto-approve", "Auto approve", "Whether Cline auto-approves tool use", "permissions", ["--auto-approve"], "enum", { values: ["true", "false"], dangerous: true }),
998
+ value("compaction", "Context compaction", "Context compaction strategy", "session", ["--compaction"], "enum", { values: ["agentic", "basic", "off"] }),
999
+ value("retries", "Retry limit", "Maximum consecutive mistakes before stopping", "safety", ["--retries"], "number"),
1000
+ value("timeout", "Turn timeout", "Maximum run time in seconds; zero disables the limit", "safety", ["--timeout"], "number"),
1001
+ value("data-dir", "Data directory", "Isolated Cline state directory", "session", ["--data-dir"], "path", { requiresNewSession: true }),
1002
+ value("hooks-dir", "Hooks directory", "Additional runtime hooks directory", "tools", ["--hooks-dir"], "path"),
1003
+ flag("plan", "Plan mode", "Run read-only planning behavior", "mode", ["--plan"]),
1004
+ flag("worktree", "Managed worktree", "Run in a detached managed worktree", "session", ["--worktree"], { requiresNewSession: true })
1005
+ ],
1006
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".cline", "data", "settings", "cline_mcp_settings.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] }, skills: { label: "Skills", manageArgv: ["skill"] }, hooks: { label: "Hooks", manageArgv: ["hook"] } },
1007
+ features: ["skills", "rules", "checkpoints", "plan/act modes", "schedules"]
1008
+ },
1009
+ kilo: {
1010
+ options: [
1011
+ value("agent", "Agent", "Agent configuration used for the turn", "mode", ["--agent"]),
1012
+ value("title", "Session title", "Title assigned to a new native session", "session", ["--title"], "string", { appliesTo: "start" }),
1013
+ flag("pure", "Pure mode", "Run without external plugins", "safety", ["--pure"]),
1014
+ flag("thinking-output", "Show thinking events", "Include provider thinking blocks in event output", "output", ["--thinking"]),
1015
+ flag("fork-native-session", "Fork native session", "Fork before continuing the selected session", "session", ["--fork"], { appliesTo: "resume", requiresNewSession: true }),
1016
+ flag("cloud-fork", "Fork cloud session", "Fetch and fork the selected cloud session locally", "session", ["--cloud-fork"], { appliesTo: "resume", requiresNewSession: true }),
1017
+ flag("share", "Share session", "Publish the native session through Kilo", "session", ["--share"])
1018
+ ],
1019
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".config", "kilo", "kilo.json"], format: "jsonc", key: ["mcp"], dialect: "opencode" }, { homeRelative: [".config", "kilo", "kilo.jsonc"], format: "jsonc", key: ["mcp"], dialect: "opencode" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] } },
1020
+ features: ["skills", "architect/ask/debug/orchestrator modes", "custom agents"]
1021
+ },
1022
+ cursor: {
1023
+ options: [
1024
+ value("mode", "Execution mode", "Read-only plan or question mode", "mode", ["--mode"], "enum", { values: ["plan", "ask"] }),
1025
+ value("sandbox", "Sandbox", "Explicitly enable or disable the Cursor sandbox", "safety", ["--sandbox"], "enum", { values: ["enabled", "disabled"] }),
1026
+ value("add-dir", "Additional directories", "Additional workspace roots", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
1027
+ value("plugin-dir", "Plugin directories", "Local plugins loaded for the session", "tools", ["--plugin-dir"], "path-list", { argvStyle: "repeat" }),
1028
+ flag("auto-review", "Auto review", "Automatically run safe tools and review the rest", "permissions", ["--auto-review"]),
1029
+ flag("approve-mcps", "Approve MCP servers", "Automatically approve configured MCP servers", "permissions", ["--approve-mcps"], { dangerous: true }),
1030
+ flag("trust", "Trust workspace", "Trust the current workspace without prompting", "permissions", ["--trust"], { dangerous: true }),
1031
+ flag("force", "Force commands", "Allow commands unless explicitly denied", "permissions", ["--force"], { dangerous: true }),
1032
+ flag("worktree", "Managed worktree", "Start in an isolated Cursor worktree", "session", ["--worktree"], { requiresNewSession: true })
1033
+ ],
1034
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".cursor", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, plugins: { label: "Plugins", manageArgv: ["plugin"] } },
1035
+ features: ["plugins", "rules", "worktrees", "plan/ask modes"]
1036
+ },
1037
+ // Hermes is deliberately absent from the `mcp add` grammars even though it
1038
+ // has one: `hermes mcp add --url ...` opens an interactive prompt ("Does
1039
+ // this server require authentication?") and waits on stdin, so driving it
1040
+ // headlessly hangs the fan-out rather than failing it. Checked live.
1041
+ auggie: {
1042
+ // Options read from `auggie --help`. `-a/--ask` stays a raw row, not a
1043
+ // permission mode: it means "retrieval and non-editing tools only" (the
1044
+ // read-only mode), which is orthogonal to ClikCode's ask/bypass/auto
1045
+ // approval modes. --add-workspace folds into the /add-dir control.
1046
+ options: [
1047
+ value("persona", "Persona", "Agent persona used for the session", "mode", ["--persona"]),
1048
+ value("add-dir", "Additional workspaces", "Additional workspace directories to index", "context", ["--add-workspace"], "path-list", { argvStyle: "repeat" }),
1049
+ value("rules", "Additional rules", "Additional rules file loaded for the session", "context", ["--rules"], "path-list", { argvStyle: "repeat" }),
1050
+ flag("ask", "Read-only ask mode", "Retrieval and non-editing tools only", "mode", ["--ask"]),
1051
+ value("max-turns", "Maximum turns", "Limit the number of agentic turns", "safety", ["--max-turns"], "number"),
1052
+ value("mcp-config", "MCP configuration", "MCP server configuration", "tools", ["--mcp-config"], "string-list", { argvStyle: "repeat" }),
1053
+ value("plugin-dir", "Plugin directories", "Local plugin marketplace directories", "tools", ["--plugin-dir"], "path-list", { argvStyle: "repeat" }),
1054
+ value("permission", "Tool permissions", "Tool permission rules in tool-name:policy form", "permissions", ["--permission"], "string-list", { argvStyle: "repeat" }),
1055
+ value("remove-tool", "Removed tools", "Remove a tool by name", "tools", ["--remove-tool"], "string-list", { argvStyle: "repeat" }),
1056
+ value("shell", "Shell", "Shell used for commands", "advanced", ["--shell"], "enum", { values: ["bash", "zsh", "fish", "sh", "powershell"] }),
1057
+ value("retry-timeout", "Retry timeout", "Timeout for rate-limit retries, in seconds", "safety", ["--retry-timeout"], "number"),
1058
+ value("startup-script", "Startup script", "Inline startup script run before each command", "session", ["--startup-script"]),
1059
+ value("startup-script-file", "Startup script file", "Load the startup script from a file", "session", ["--startup-script-file"], "path"),
1060
+ flag("enhance-prompt", "Enhance prompt", "Enhance the prompt before sending", "advanced", ["--enhance-prompt"]),
1061
+ flag("show-cost", "Show cost", "Show the billing cost summary at the end of the run", "output", ["--show-cost"]),
1062
+ flag("allow-indexing", "Allow indexing", "Skip the indexing confirmation screen", "context", ["--allow-indexing"]),
1063
+ flag("wait-for-indexing", "Wait for indexing", "Wait for workspace indexing before inference", "context", ["--wait-for-indexing"]),
1064
+ flag("ephemeral", "Do not save session", "Do not save conversation history", "session", ["--dont-save-session"], { requiresNewSession: true }),
1065
+ value("augment-cache-dir", "Cache directory", "Cache directory, defaults to ~/.augment", "advanced", ["--augment-cache-dir"], "path")
1066
+ ],
1067
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".augment", "settings.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] } }
1068
+ },
1069
+ vibe: {
1070
+ // Options read from `vibe --help`. --smart-approve and --auto-approve are
1071
+ // deliberately absent: they are the permission selector's own spellings,
1072
+ // and a raw row beside Ask/Bypass/Auto would disagree with the selector.
1073
+ options: [
1074
+ value("max-turns", "Maximum turns", "Maximum number of assistant turns", "safety", ["--max-turns"], "number"),
1075
+ value("max-price", "Maximum price", "Maximum cost in dollars for the session", "safety", ["--max-price"], "number"),
1076
+ value("max-tokens", "Maximum tokens", "Maximum total prompt plus completion tokens", "safety", ["--max-tokens"], "number"),
1077
+ value("enabled-tools", "Enabled tools", "Enable specific tools; disables all others", "tools", ["--enabled-tools"], "string-list", { argvStyle: "repeat" }),
1078
+ value("disabled-tools", "Disabled tools", "Disable tools after enabled-tools filtering", "tools", ["--disabled-tools"], "string-list", { argvStyle: "repeat" }),
1079
+ value("agent", "Agent", "Agent used for the session", "mode", ["--agent"]),
1080
+ flag("trust", "Trust workspace", "Trust the working directory for this invocation only", "permissions", ["--trust"], { dangerous: true }),
1081
+ value("add-dir", "Additional directories", "Additional working directories for file access", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
1082
+ flag("worktree", "Managed worktree", "Run inside a Git worktree under $VIBE_HOME/worktrees", "session", ["--worktree"], { requiresNewSession: true })
1083
+ ],
1084
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".vibe", "config.toml"], rootRelative: ["config.toml"], rootEnv: "VIBE_HOME", format: "toml", key: ["mcp_servers"], dialect: "mcp-servers" }], manageArgv: ["mcp"] } }
1085
+ },
1086
+ dcode: {
1087
+ options: [],
1088
+ managers: { mcp: { label: "MCP servers", serverFiles: [
1089
+ { homeRelative: [".deepagents", ".mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" },
1090
+ { projectRelative: [".deepagents", ".mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }
1091
+ ] } }
1092
+ },
1093
+ junie: {
1094
+ options: [],
1095
+ managers: { mcp: { label: "MCP servers", serverFiles: [
1096
+ { homeRelative: [".junie", "mcp", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" },
1097
+ { projectRelative: [".junie", "mcp", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }
1098
+ ] } }
1099
+ },
1100
+ devin: {
1101
+ options: [],
1102
+ managers: { mcp: { label: "MCP servers", serverFiles: [
1103
+ { homeRelative: [".config", "devin", "mcp_config.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" },
1104
+ { projectRelative: [".devin", "mcp_config.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" },
1105
+ { projectRelative: [".devin", "mcp_config.local.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }
1106
+ ] } }
1107
+ },
1108
+ mcode: {
1109
+ options: [],
1110
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ projectRelative: [".mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }] } }
1111
+ },
1112
+ // `openclaw agent` (2026.9.6). --agent, --session-id/--session-key,
1113
+ // --model, --thinking and --message are the turn itself; delivery flags
1114
+ // (--channel, --deliver, --reply-*) send the reply to a chat app, which is
1115
+ // not a coding turn.
1116
+ openclaw: {
1117
+ options: [
1118
+ value("timeout", "Turn timeout (seconds)", "Override the agent command timeout", "safety", ["--timeout"], "number"),
1119
+ value("verbose", "Verbose", "Persist the agent verbose level for the session", "output", ["--verbose"], "enum", { values: ["on", "off"] })
1120
+ ],
1121
+ managers: {
1122
+ mcp: {
1123
+ label: "MCP servers",
1124
+ listArgv: ["mcp", "list"],
1125
+ manageArgv: ["mcp"]
1126
+ },
1127
+ plugins: { label: "Plugins", manageArgv: ["plugins"] },
1128
+ skills: { label: "Skills", manageArgv: ["skills"] },
1129
+ hooks: { label: "Hooks", manageArgv: ["hooks"] }
1130
+ },
1131
+ features: ["plugins", "skills", "hooks", "memory", "chat channels", "model fallbacks"]
1132
+ },
1133
+ hermes: {
1134
+ options: [
1135
+ value("toolsets", "Toolsets", "Toolsets enabled for the turn, from hermes tools list", "tools", ["--toolsets"], "string-list", { argvStyle: "csv" }),
1136
+ value("skills", "Preloaded skills", "Skills loaded for this session", "tools", ["--skills"], "string-list", { argvStyle: "csv" }),
1137
+ value("max-turns", "Maximum turns", "Maximum tool-calling iterations in one turn", "safety", ["--max-turns"], "number"),
1138
+ value("run-budget", "Run budget (seconds)", "Wall-clock budget for one run", "safety", ["--run-budget"], "number"),
1139
+ flag("worktree", "Isolated worktree", "Run in an isolated Git worktree", "session", ["--worktree"], { requiresNewSession: true }),
1140
+ flag("checkpoints", "Checkpoints", "Snapshot files before destructive edits", "safety", ["--checkpoints"]),
1141
+ flag("accept-hooks", "Accept hooks", "Auto-approve unseen shell hooks", "safety", ["--accept-hooks"]),
1142
+ flag("pass-session-id", "Pass session id", "Include the session id in the system prompt", "session", ["--pass-session-id"]),
1143
+ flag("verbose", "Verbose", "Verbose output", "output", ["--verbose"]),
1144
+ flag("safe-mode", "Safe mode", "Disable user config, rules, plugins, and MCP", "safety", ["--safe-mode"]),
1145
+ flag("ignore-user-config", "Ignore user config", "Use built-in defaults while retaining credentials", "safety", ["--ignore-user-config"]),
1146
+ flag("ignore-rules", "Ignore rules", "Skip AGENTS.md, memory, and preloaded skills", "safety", ["--ignore-rules"]),
1147
+ flag("yolo", "Bypass approvals", "Bypass dangerous-command approvals", "permissions", ["--yolo"], { dangerous: true })
1148
+ ],
1149
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".hermes", "config.yaml"], format: "yaml", key: ["mcp_servers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, skills: { label: "Skills", manageArgv: ["skills"] }, plugins: { label: "Plugins", manageArgv: ["plugins"] }, tools: { label: "Tools", manageArgv: ["tools"] }, hooks: { label: "Hooks", manageArgv: ["hooks"] } },
1150
+ features: ["skills", "bundles", "plugins", "hooks", "memory", "fallback providers", "toolsets"]
1151
+ },
1152
+ command: {
1153
+ options: [
1154
+ value("max-turns", "Maximum turns", "Maximum turns in print mode", "safety", ["--max-turns"], "number"),
1155
+ value("add-dir", "Additional directories", "Additional directories in workspace context", "context", ["--add-dir"], "path-list", { argvStyle: "repeat" }),
1156
+ value("mod", "Mods", "Mod files or directories loaded for this session", "tools", ["--mod"], "path-list", { argvStyle: "repeat" }),
1157
+ value("mod-option", "Mod options", "Mod-declared name=value settings", "tools", ["--mod-option"], "string-list", { argvStyle: "repeat" }),
1158
+ value("skill", "Skill paths", "Additional skill directories", "tools", ["--skill"], "path-list", { argvStyle: "repeat" }),
1159
+ flag("plan", "Plan mode", "Start in read-only planning mode", "mode", ["--plan"]),
1160
+ flag("local-only", "Local-only inference", "Use BYOK providers without Command Code traffic", "safety", ["--local-only"]),
1161
+ flag("trust", "Trust project", "Skip the initial workspace trust prompt", "permissions", ["--trust"], { dangerous: true }),
1162
+ flag("tools-all", "Enable all tools", "Enable tools normally withheld in headless mode", "tools", ["--tools-all"], { dangerous: true }),
1163
+ flag("no-skills", "Disable skills", "Skip automatic skill discovery", "tools", ["--no-skills"]),
1164
+ flag("worktree", "Managed worktree", "Run in an isolated managed worktree", "session", ["--worktree"], { requiresNewSession: true }),
1165
+ flag("ephemeral", "Ephemeral session", "Do not persist the native session", "session", ["--no-session"], { requiresNewSession: true })
1166
+ ],
1167
+ managers: { mcp: { label: "MCP servers", serverFiles: [{ homeRelative: [".commandcode", "mcp.json"], format: "json", key: ["mcpServers"], dialect: "mcp-servers" }], listArgv: ["mcp", "list"], manageArgv: ["mcp"] }, skills: { label: "Skills", manageArgv: ["skills"] }, plugins: { label: "Mods", manageArgv: ["mods"] } },
1168
+ features: ["skills", "mods", "taste learning", "MCP", "managed worktrees", "plan mode"]
1169
+ },
1170
+ // Continue: these are the raw vendor rows for the flags `cn --help` really
1171
+ // lists. --model stays the model selector's own flag (the help's --model
1172
+ // hub-slug spelling is the same flag name) and --prompt is the turn's own
1173
+ // prompt, so neither becomes a row beside its owner. The permission surface
1174
+ // (--readonly / --auto / --allow / --ask / --exclude) overlaps the selector:
1175
+ // only the two tool-list spellings --allow and --ask sit here as rows, and
1176
+ // they are the pieces of that surface the selector does not drive.
1177
+ cn: {
1178
+ options: [
1179
+ value("agent", "Agent", "Agent file loaded from the hub", "mode", ["--agent"]),
1180
+ flag("readonly", "Plan mode", "Start in plan mode (read-only tools; `cn --help`: --readonly)", "mode", ["--readonly"]),
1181
+ value("config", "Config", "Configuration file path or hub slug", "advanced", ["--config"]),
1182
+ value("org", "Organization", "Organization slug used in headless mode", "advanced", ["--org"]),
1183
+ flag("verbose", "Verbose", "Verbose logging", "output", ["--verbose"]),
1184
+ flag("beta-status-tool", "Beta status tool", "Enable the beta status tool", "tools", ["--beta-status-tool"]),
1185
+ flag("beta-subagent-tool", "Beta subagent tool", "Enable the beta subagent tool", "tools", ["--beta-subagent-tool"]),
1186
+ value("rules", "Rules", "Rules added for the session", "context", ["--rule"], "string-list", { argvStyle: "repeat" }),
1187
+ value("mcp", "MCP servers", "MCP servers loaded from the hub as owner/package slugs", "tools", ["--mcp"], "string-list", { argvStyle: "repeat" }),
1188
+ value("allow", "Allowed tools", "Tools allowed, overriding default policies", "permissions", ["--allow"], "string-list", { argvStyle: "repeat" }),
1189
+ value("ask", "Ask about tools", "Tools that ask for permission before use", "permissions", ["--ask"], "string-list", { argvStyle: "repeat" }),
1190
+ value("exclude", "Excluded tools", "Tools excluded from use", "tools", ["--exclude"], "string-list", { argvStyle: "repeat" })
1191
+ ]
1192
+ }
1193
+ };
1194
+ function ignoredStoredOptionIds(harness) {
1195
+ return /* @__PURE__ */ new Set([...harness.normalizedPermissionOptionIds ?? [], ...harness.retiredOptionIds ?? []]);
1196
+ }
1197
+ function localHarnessCapabilityManifest(harness) {
1198
+ const declared = AI_LOCAL_HARNESS_CAPABILITIES[harness.command] ?? { options: [] };
1199
+ const normalizedPermissionIds = new Set(harness.normalizedPermissionOptionIds ?? []);
1200
+ const normalized = [];
1201
+ if (harness.modelArgvPrefix) normalized.push(value("model", "Model", "Provider model id or alias", "model", harness.modelArgvPrefix));
1202
+ if (harness.workspaceArgvPrefix) normalized.push(value("workspace", "Workspace", "Working directory for the native agent", "context", harness.workspaceArgvPrefix, "path", { requiresNewSession: true }));
1203
+ if (harnessSupportsEffort(harness)) {
1204
+ const effortArgv = harness.effortArgvPrefix ?? harness.acp?.effortArgvPrefix;
1205
+ const values = harness.effortValues ?? [];
1206
+ normalized.push(effortArgv ? value("effort", "Reasoning effort", "Provider-native reasoning level", "reasoning", effortArgv, "enum", { values }) : { id: "effort", label: "Reasoning effort", description: "Provider-native reasoning level", category: "reasoning", kind: "enum", values });
1207
+ }
1208
+ const effectivePermissionModes = (harness.permissionModes ?? []).filter((mode) => harnessSupportsPermissionMode(harness, mode));
1209
+ if (effectivePermissionModes.length) normalized.push({ id: "permissions", label: "Permissions", description: "Normalized ClikCode approval behavior", category: "permissions", kind: "enum", values: effectivePermissionModes });
1210
+ return { ...declared, options: [...normalized, ...declared.options.filter((option) => !normalizedPermissionIds.has(option.id))] };
1211
+ }
1212
+ function sessionSelector(id, idPrefix, keyPrefix) {
1213
+ if (keyPrefix && id.includes(":")) return keyPrefix;
1214
+ return idPrefix;
1215
+ }
1216
+ function splitProviderModel(model) {
1217
+ const match = /^(custom:[^:/]+|[a-z][a-z0-9_-]*):(.+)$/i.exec(model.trim());
1218
+ return match ? { provider: match[1], model: match[2] } : void 0;
1219
+ }
1220
+ function splitHarnessModel(harness, model) {
1221
+ if (harness.modelProviderSeparator === "/") {
1222
+ const slash = model.indexOf("/");
1223
+ return slash > 0 && slash < model.length - 1 ? { provider: model.slice(0, slash), model: model.slice(slash + 1) } : void 0;
1224
+ }
1225
+ return splitProviderModel(model);
1226
+ }
1227
+ function harnessCarriesProvider(harness) {
1228
+ return Boolean(harness.modelProviderSeparator || harness.modelProviderArgvPrefix);
1229
+ }
1230
+ function modelDisplayId(harness, model) {
1231
+ if (!harnessCarriesProvider(harness)) return model;
1232
+ const split = splitHarnessModel(harness, model);
1233
+ return split ? `${split.provider}:${split.model}` : model;
1234
+ }
1235
+ function modelIdFromDisplay(harness, typed) {
1236
+ const model = typed.trim();
1237
+ if (harness.modelProviderSeparator !== "/") return model;
1238
+ const colon = model.indexOf(":");
1239
+ const slash = model.indexOf("/");
1240
+ return colon > 0 && (slash < 0 || colon < slash) ? `${model.slice(0, colon)}/${model.slice(colon + 1)}` : model;
1241
+ }
1242
+ function modelProvider(harness, model) {
1243
+ if (harness.modelProviderSeparator === "/") {
1244
+ const slash = model.indexOf("/");
1245
+ return slash > 0 ? model.slice(0, slash) : void 0;
1246
+ }
1247
+ return splitProviderModel(model)?.provider;
1248
+ }
1249
+ function harnessModelAcceptsEffort(harness, model) {
1250
+ return !(model && harness.effortUnsupportedModels?.some((source) => new RegExp(source, "i").test(model)));
1251
+ }
1252
+ function modelSelectorArgv(harness, model) {
1253
+ if (!harness.modelArgvPrefix?.length) return [];
1254
+ const split = harness.modelProviderArgvPrefix ? splitHarnessModel(harness, model) : void 0;
1255
+ return split ? [...harness.modelProviderArgvPrefix, split.provider, ...harness.modelArgvPrefix, split.model] : [...harness.modelArgvPrefix, model];
1256
+ }
1257
+ function harnessReplyError(harness, text) {
1258
+ const reply = text.trim();
1259
+ for (const entry of harness.replyErrorPatterns ?? []) {
1260
+ const match = new RegExp(entry.pattern).exec(reply);
1261
+ if (!match) continue;
1262
+ const captured = match[1] ? Number(match[1]) : void 0;
1263
+ const statusCode = captured !== void 0 && Number.isFinite(captured) ? captured : entry.status;
1264
+ const withoutNotice = match.index > 0 ? reply.slice(0, match.index).trimEnd() : void 0;
1265
+ return {
1266
+ notice: reply.slice(match.index).trim(),
1267
+ ...statusCode !== void 0 ? { statusCode } : {},
1268
+ ...withoutNotice !== void 0 ? { withoutNotice } : {}
1269
+ };
1270
+ }
1271
+ return void 0;
1272
+ }
1273
+ function harnessLoginArgvForModel(harness, model) {
1274
+ const provider = model && harness.providerLoginArgv ? modelProvider(harness, model) : void 0;
1275
+ return provider ? harness.providerLoginArgv.map((part) => part === "{provider}" ? provider : part) : harness.loginArgv;
1276
+ }
1277
+ function appendDeclaredHarnessOptions(argv, harness, values, resumed) {
1278
+ if (!values) return;
1279
+ const options = new Map(localHarnessCapabilityManifest(harness).options.map((option) => [option.id, option]));
1280
+ const normalizedPermissionIds = ignoredStoredOptionIds(harness);
1281
+ for (const [id, raw] of Object.entries(values)) {
1282
+ const option = options.get(id);
1283
+ if (!option && normalizedPermissionIds.has(id)) continue;
1284
+ if (!option) throw new Error(`${harness.displayName} does not declare option "${id}"`);
1285
+ if (!option.argv || id === "model" || id === "workspace" || id === "effort" || id === "permissions") continue;
1286
+ if (option.appliesTo === "start" && resumed) continue;
1287
+ if (option.appliesTo === "resume" && !resumed) continue;
1288
+ const append = (...parts) => {
1289
+ if (option.argvPlacement === "root") argv.unshift(...parts);
1290
+ else argv.push(...parts);
1291
+ };
1292
+ if (option.kind === "boolean") {
1293
+ if (raw === true) append(...option.argv);
1294
+ else if (raw !== false && raw !== void 0) throw new Error(`${option.label} must be true or false`);
1295
+ continue;
1296
+ }
1297
+ const items = Array.isArray(raw) ? raw : [raw];
1298
+ const renderedItems = items.map((item) => String(item).trim()).filter(Boolean);
1299
+ for (const rendered of renderedItems) {
1300
+ if (option.values?.length && !option.values.includes(rendered)) throw new Error(`${option.label} must be one of ${option.values.join(", ")}`);
1301
+ }
1302
+ if (option.argvStyle === "csv") {
1303
+ if (renderedItems.length) append(...option.argv, renderedItems.join(","));
1304
+ continue;
1305
+ }
1306
+ for (const rendered of renderedItems) append(...option.argv, rendered);
1307
+ }
1308
+ }
1309
+ function nativeHarnessTurnArgv(harness, input) {
1310
+ if (!harness.turn) throw new Error(`${harness.displayName} has no centralized turn adapter`);
1311
+ const resumed = Boolean(input.nativeSessionId && !input.createdHere);
1312
+ let argv = [...resumed && harness.turn.resumeArgv ? harness.turn.resumeArgv : harness.turn.startArgv];
1313
+ if (input.nativeSessionId) {
1314
+ const prefix = input.createdHere ? harness.turn.createIdPrefix : sessionSelector(input.nativeSessionId, harness.turn.resumeIdPrefix, harness.turn.resumeKeyPrefix);
1315
+ if (prefix) argv.push(...prefix, input.nativeSessionId, ...input.createdHere ? [] : harness.turn.resumeIdSuffix ?? []);
1316
+ else if (resumed && harness.turn.resumeArgv) argv.push(input.nativeSessionId, ...harness.turn.resumeIdSuffix ?? []);
1317
+ }
1318
+ if (input.model) argv.push(...modelSelectorArgv(harness, input.model));
1319
+ if (input.workspace && harness.workspaceArgvPrefix && (!resumed || harness.turn.resumeSupportsWorkspaceSelector !== false)) argv.push(...harness.workspaceArgvPrefix, input.workspace);
1320
+ if (input.effort && harness.effortArgvPrefix && harnessModelAcceptsEffort(harness, input.model)) argv.push(...harness.effortArgvPrefix, harness.effortConfigKey ? `${harness.effortConfigKey}="${input.effort}"` : input.effort);
1321
+ if (input.permissionMode && harness.permissionModes?.includes(input.permissionMode)) {
1322
+ const mapping = harness.permissionArgv?.[input.permissionMode];
1323
+ if (!mapping && !harness.permissionEnv?.[input.permissionMode]) throw new Error(`${harness.displayName} has no argv mapping for ${input.permissionMode} permissions`);
1324
+ if (mapping?.placement === "root") argv.unshift(...mapping.argv);
1325
+ else if (mapping) argv.push(...mapping.argv);
1326
+ }
1327
+ const carriesProvider = Boolean(input.model && harness.modelProviderArgvPrefix && splitHarnessModel(harness, input.model));
1328
+ const { provider: _provider, ...withoutProvider } = input.options ?? {};
1329
+ appendDeclaredHarnessOptions(argv, harness, carriesProvider ? withoutProvider : input.options, resumed);
1330
+ if (harness.imageArgvPrefix && harness.turn.stdinFormat !== "pi-rpc") for (const image of input.images ?? []) {
1331
+ if (harness.imageArgvStyle === "concatenated") {
1332
+ const prefix = harness.imageArgvPrefix.join("");
1333
+ argv.push(`${prefix}${image}`);
1334
+ } else argv.push(...harness.imageArgvPrefix, image);
1335
+ }
1336
+ if (harness.turn.promptInput === "stdin") {
1337
+ const placeholder = harness.turn.stdinArgv ?? ["-"];
1338
+ if (placeholder.length && harness.turn.promptArgvPrefix) argv.push(...harness.turn.promptArgvPrefix);
1339
+ argv.push(...placeholder);
1340
+ return argv;
1341
+ }
1342
+ if (harness.turn.promptArgvPrefix) argv.push(...harness.turn.promptArgvPrefix);
1343
+ argv.push(...guardedPromptArgv(harness.turn, input.prompt));
1344
+ return argv;
1345
+ }
1346
+ function guardedPromptArgv(turn, prompt) {
1347
+ if (!prompt.startsWith("-")) return [prompt];
1348
+ if (turn.promptGuard === "double-dash" && !turn.promptArgvPrefix?.length) return ["--", prompt];
1349
+ return [` ${prompt}`];
1350
+ }
1351
+ function promptExceedsArgvLimit(harness, prompt) {
1352
+ if (harness.turn?.promptInput === "stdin") return false;
1353
+ return new TextEncoder().encode(prompt).length > maxPromptArgvBytes;
1354
+ }
1355
+ function acpModelEnv(harness, model) {
1356
+ const template = harness.acp?.modelEnv;
1357
+ const split = template && model ? splitHarnessModel(harness, model) : void 0;
1358
+ if (!template || !split) return {};
1359
+ return Object.fromEntries(Object.entries(template).map(([name, value2]) => [name, value2.replace("{provider}", split.provider).replace("{model}", split.model)]));
1360
+ }
1361
+ function harnessAcpLaunch(harness, input = {}) {
1362
+ const acp = harness.acp;
1363
+ if (!acp) return void 0;
1364
+ const options = [];
1365
+ const sameProgram = (!acp.binary || acp.binary === harness.binary) && acp.inheritCliOptions !== false;
1366
+ if (input.model && sameProgram) options.push(...modelSelectorArgv(harness, input.model));
1367
+ const effortPrefix = acp.effortArgvPrefix ?? (sameProgram ? harness.effortArgvPrefix : void 0);
1368
+ if (input.effort && effortPrefix && harnessModelAcceptsEffort(harness, input.model)) options.push(...effortPrefix, harness.effortConfigKey && !acp.effortArgvPrefix ? `${harness.effortConfigKey}="${input.effort}"` : input.effort);
1369
+ if (input.permissionMode === "bypass" || input.permissionMode === "auto") {
1370
+ options.push(...acp.permissionArgv?.[input.permissionMode] ?? (sameProgram && harness.permissionModes?.includes(input.permissionMode) ? harness.permissionArgv?.[input.permissionMode]?.argv : void 0) ?? []);
1371
+ }
1372
+ const optionPlacement = acp.optionPlacement ?? "before";
1373
+ return {
1374
+ binary: acp.binary ?? harness.binary,
1375
+ argv: optionPlacement === "after" ? [...acp.argv, ...options] : [...options, ...acp.argv],
1376
+ modeArgv: [...acp.argv],
1377
+ optionArgv: options,
1378
+ optionPlacement,
1379
+ env: acpModelEnv(harness, input.model)
1380
+ };
1381
+ }
1382
+ function harnessTurnTransport(harness) {
1383
+ if (harness.transport === "codex-app-server") return "codex-app-server";
1384
+ const cli = harness.turn?.output === "text" ? "text-cli" : "structured-cli";
1385
+ if (!harness.acp) return harness.turn ? cli : harness.transport;
1386
+ return "acp";
1387
+ }
1388
+ function harnessCanRunTurns(harness) {
1389
+ return Boolean(harness.turn || harness.acp);
1390
+ }
1391
+ var TIER_ORDER = { primary: 0, more: 1, experimental: 2 };
1392
+ function harnessTierRank(harness) {
1393
+ return TIER_ORDER[harness.tier] ?? TIER_ORDER.experimental;
1394
+ }
1395
+ function customAcpHarness(definition) {
1396
+ const command = definition.command.trim().replace(/^\//, "").toLowerCase();
1397
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(command)) throw new Error(`Custom ACP harness command "${definition.command}" must be a simple lowercase name`);
1398
+ if (!definition.binary.trim()) throw new Error(`Custom ACP harness "${command}" needs a binary`);
1399
+ return {
1400
+ command,
1401
+ provider: definition.provider?.trim().toLowerCase() || `acp:${command}`,
1402
+ displayName: definition.displayName?.trim() || command,
1403
+ tier: "more",
1404
+ transport: "acp",
1405
+ integration: "structured",
1406
+ parser: "text",
1407
+ memoryFile: definition.memoryFile ?? "AGENTS.md",
1408
+ nativeSlashPassthrough: false,
1409
+ localAuth: ["vendor-cli"],
1410
+ binary: definition.binary.trim(),
1411
+ acp: { argv: [...definition.argv] }
1412
+ };
1413
+ }
1414
+ var customHarnesses = [];
1415
+ function registerCustomHarnesses(definitions) {
1416
+ const accepted = [];
1417
+ for (const definition of definitions) {
1418
+ const shadowsBuiltIn = AI_LOCAL_HARNESSES.some((item) => item.command === definition.command || item.provider === definition.provider);
1419
+ const duplicate = accepted.some((item) => item.command === definition.command || item.provider === definition.provider);
1420
+ if (shadowsBuiltIn || duplicate || !harnessCanRunTurns(definition)) continue;
1421
+ accepted.push(definition);
1422
+ }
1423
+ customHarnesses = accepted;
1424
+ return customHarnesses;
1425
+ }
1426
+ function allLocalHarnesses() {
1427
+ return customHarnesses.length ? [...AI_LOCAL_HARNESSES, ...customHarnesses] : AI_LOCAL_HARNESSES;
1428
+ }
1429
+ function localHarnessForCommand(command) {
1430
+ const normalized = command.trim().replace(/^\//, "").toLowerCase();
1431
+ return allLocalHarnesses().find((item) => item.command === normalized);
1432
+ }
1433
+ function localHarnessForProvider(provider) {
1434
+ const normalized = provider.trim().toLowerCase();
1435
+ return allLocalHarnesses().find((item) => item.provider === normalized);
1436
+ }
1437
+ function harnessSupportsEffort(harness) {
1438
+ return Boolean(harness.effortArgvPrefix || harness.acp?.effortArgvPrefix || harness.acp?.effortConfigId);
1439
+ }
1440
+ function harnessSupportsModelSelection(harness) {
1441
+ return harness.modelArgvPrefix !== void 0 || Boolean(harness.acp && harness.acp.listsModels !== false);
1442
+ }
1443
+ function permissionModeRefusedHere(harness, mode) {
1444
+ if (mode !== "bypass" || !harness.bypassRefusedAsRoot || typeof process === "undefined") return false;
1445
+ return process.getuid?.() === 0 && !process.env.IS_SANDBOX;
1446
+ }
1447
+ function harnessSupportsPermissionMode(harness, mode) {
1448
+ if (!harness.permissionModes?.includes(mode)) return false;
1449
+ if (permissionModeRefusedHere(harness, mode)) return false;
1450
+ return Boolean(harness.permissionArgv?.[mode] ?? harness.permissionEnv?.[mode] ?? harness.acp?.permissionModeIds?.[mode]);
1451
+ }
1452
+ function harnessSupportsImages(harness) {
1453
+ return Boolean(harness.imageArgvPrefix) || harnessTurnTransport(harness) === "acp" && harness.acp?.promptImages !== false;
1454
+ }
1455
+
1456
+ // packages/clikrouter/src/ai-provider-registry/providers.ts
1457
+ var AI_PROVIDERS = [
1458
+ {
1459
+ id: "xai",
1460
+ // Automatic on every grok model per xAI's docs — no request parameter,
1461
+ // so again only prefix stability is ours to control.
1462
+ // (docs.x.ai/developers/advanced-api-usage/prompt-caching)
1463
+ //
1464
+ // NOTE, same shape as Fireworks below: xAI documents `x-grok-conv-id` as
1465
+ // the header that maximises hit rate by keeping one conversation on one
1466
+ // cache. Not sent today.
1467
+ promptCaching: "automatic",
1468
+ defaultModel: "grok-4-1-fast",
1469
+ label: "Grok (xAI)",
1470
+ envKey: "GROK_API_KEY",
1471
+ chatBaseUrl: "https://api.x.ai/v1",
1472
+ chatDialect: "openai-chat"
1473
+ },
1474
+ {
1475
+ id: "typesafe",
1476
+ defaultModel: "jev-latest",
1477
+ label: "TypeSafe (Jev)",
1478
+ envKey: "TYPESAFE_API_KEY",
1479
+ chatBaseUrl: "https://api.typesafe.ai/v1"
1480
+ },
1481
+ {
1482
+ id: "anthropic",
1483
+ // Caches NOTHING unless the request carries a cache_control breakpoint, and
1484
+ // charges 1.25x to write one — so it pays off only when the marked prefix is
1485
+ // reused inside the TTL, which is why this is agent-gated rather than always on.
1486
+ promptCaching: "explicit",
1487
+ defaultModel: "claude-sonnet-5",
1488
+ label: "Anthropic",
1489
+ envKey: "ANTHROPIC_API_KEY",
1490
+ // Native Messages API — not OpenAI-compatible. chatBaseUrl is the API origin
1491
+ // used by the anthropic-messages dialect (assistant + enrichment + triage).
1492
+ chatBaseUrl: "https://api.anthropic.com",
1493
+ chatDialect: "anthropic-messages"
1494
+ },
1495
+ {
1496
+ id: "openai",
1497
+ // Caches on its own for prompts over ~1024 tokens, matching the longest stable
1498
+ // PREFIX. No parameter exists to enable or disable it; the only lever is
1499
+ // prompt ordering, which is why no agent toggle is offered for it.
1500
+ promptCaching: "automatic",
1501
+ defaultModel: "gpt-5.1",
1502
+ label: "OpenAI",
1503
+ envKey: "OPENAI_API_KEY",
1504
+ chatBaseUrl: "https://api.openai.com/v1",
1505
+ chatDialect: "openai-chat"
1506
+ },
1507
+ {
1508
+ id: "google",
1509
+ defaultModel: "gemini-2.5-flash",
1510
+ label: "Google",
1511
+ // Gemini's OpenAI-compatible surface.
1512
+ // https://ai.google.dev/gemini-api/docs/openai
1513
+ envKey: "GOOGLE_API_KEY",
1514
+ chatBaseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
1515
+ chatDialect: "openai-chat"
1516
+ },
1517
+ {
1518
+ id: "nvidia",
1519
+ // No `defaultModel`: the previous pin (nvidia/llama-3.1-nemotron-70b-instruct)
1520
+ // 404'd on every routed attempt observed live 2026-08-09 (see
1521
+ // ai-provider-models.ts's capturedStreamError comment) — NVIDIA deprecated
1522
+ // it. The field is optional, so rather than inventing a replacement id
1523
+ // without vendor evidence (the same guess that broke this one), we omit it
1524
+ // and require the caller to name one.
1525
+ label: "NVIDIA",
1526
+ envKey: "NVIDIA_API_KEY",
1527
+ chatBaseUrl: "https://integrate.api.nvidia.com/v1"
1528
+ },
1529
+ {
1530
+ id: "groq",
1531
+ // Automatic, and not switchable: Groq's own docs state caching "works
1532
+ // automatically on all your API requests to supported models with no code
1533
+ // changes required and no additional fees", cannot be manually disabled,
1534
+ // and discounts cached input 50%. So there is nothing for this platform to
1535
+ // send and nothing for an operator to turn off — only prefix stability
1536
+ // decides whether it hits. (console.groq.com/docs/prompt-caching)
1537
+ promptCaching: "automatic",
1538
+ defaultModel: "llama-3.3-70b-versatile",
1539
+ label: "Groq",
1540
+ envKey: "GROQ_API_KEY",
1541
+ chatBaseUrl: "https://api.groq.com/openai/v1"
1542
+ },
1543
+ {
1544
+ id: "mistral",
1545
+ // Caches automatically. Evidence is our OWN production traffic rather than
1546
+ // a docs page: 3,658 invocations across ministral-3b/8b, codestral and
1547
+ // mistral-medium reported 22.2M cache-read input tokens against 41.3M
1548
+ // eligible — a 53.8% hit rate, with per-model rates of 70-90% — while
1549
+ // reporting exactly ZERO cache-write tokens. Reads with no writes is the
1550
+ // signature of vendor-side automatic caching: nothing here ever asked for
1551
+ // a breakpoint, and no write was ever billed.
1552
+ //
1553
+ // This entry previously carried no mechanism at all, which read as "no
1554
+ // caching we can reach" and was simply wrong about the provider serving
1555
+ // the majority of this platform's traffic.
1556
+ promptCaching: "automatic",
1557
+ defaultModel: "mistral-large-latest",
1558
+ label: "Mistral",
1559
+ envKey: "MISTRAL_API_KEY",
1560
+ chatBaseUrl: "https://api.mistral.ai/v1"
1561
+ },
1562
+ {
1563
+ id: "deepseek",
1564
+ // Context caching on disk, activated by the vendor with no request parameter —
1565
+ // its published cache-HIT price is the corroboration that it caches at all.
1566
+ promptCaching: "automatic",
1567
+ defaultModel: "deepseek-chat",
1568
+ label: "DeepSeek",
1569
+ envKey: "DEEPSEEK_API_KEY",
1570
+ chatBaseUrl: "https://api.deepseek.com"
1571
+ },
1572
+ {
1573
+ id: "together",
1574
+ label: "Together AI",
1575
+ envKey: "TOGETHER_API_KEY",
1576
+ chatBaseUrl: "https://api.together.xyz/v1"
1577
+ },
1578
+ {
1579
+ id: "fireworks",
1580
+ // Automatic: "enabled by default for all Fireworks models and
1581
+ // deployments", matching the longest cached prefix of the request and
1582
+ // processing only the remainder. Retention is stated as at least several
1583
+ // minutes and up to several hours depending on model and load.
1584
+ // (docs.fireworks.ai/guides/prompt-caching)
1585
+ //
1586
+ // NOTE for a future dispatch change: Fireworks routes across replicas, so
1587
+ // hit rate depends on landing on the replica holding the prefix — the
1588
+ // `x-session-affinity` header is what pins that. Not sent today, which is
1589
+ // a known and measurable cause of misses rather than a mystery.
1590
+ promptCaching: "automatic",
1591
+ label: "Fireworks AI",
1592
+ envKey: "FIREWORKS_API_KEY",
1593
+ chatBaseUrl: "https://api.fireworks.ai/inference/v1"
1594
+ },
1595
+ {
1596
+ id: "deepinfra",
1597
+ label: "Deep Infra",
1598
+ envKey: "DEEPINFRA_API_KEY",
1599
+ chatBaseUrl: "https://api.deepinfra.com/v1/openai"
1600
+ },
1601
+ {
1602
+ id: "baseten",
1603
+ label: "Baseten",
1604
+ envKey: "BASETEN_API_KEY",
1605
+ chatBaseUrl: "https://inference.baseten.co/v1"
1606
+ },
1607
+ {
1608
+ id: "cerebras",
1609
+ defaultModel: "llama-3.3-70b",
1610
+ label: "Cerebras",
1611
+ envKey: "CEREBRAS_API_KEY",
1612
+ chatBaseUrl: "https://api.cerebras.ai/v1"
1613
+ },
1614
+ {
1615
+ id: "openrouter",
1616
+ label: "OpenRouter",
1617
+ envKey: "OPENROUTER_API_KEY",
1618
+ chatBaseUrl: "https://openrouter.ai/api/v1",
1619
+ // EXACT COST, not an estimate. OpenRouter bills a per-request amount that
1620
+ // depends on which upstream provider it actually routed to, so a catalog
1621
+ // rate for the model id is a genuinely poor proxy for what was charged —
1622
+ // the same model can settle at different prices on consecutive calls. It
1623
+ // reports the real figure as `usage.cost` (USD), but ONLY when the request
1624
+ // opts in via `usage: { include: true }`, which is what the accounting
1625
+ // options below add to the body. The OpenAI-compatible adapter spreads
1626
+ // providerOptions.openrouter into the request and hands the untouched
1627
+ // usage object back as `usage.raw`, so both halves work without a
1628
+ // provider-specific branch anywhere in the dispatch path.
1629
+ usageAccountingOptions: { usage: { include: true } },
1630
+ usageCostUsdPath: ["cost"]
1631
+ },
1632
+ {
1633
+ id: "nous",
1634
+ label: "Nous Research",
1635
+ envKey: "NOUS_API_KEY",
1636
+ chatBaseUrl: "https://inference-api.nousresearch.com/v1"
1637
+ },
1638
+ {
1639
+ id: "cohere",
1640
+ defaultModel: "command-a-03-2025",
1641
+ label: "Cohere",
1642
+ envKey: "COHERE_API_KEY",
1643
+ // Cohere's documented OpenAI-compatibility host is api.cohere.ai (not
1644
+ // .com); live-verified /models 401s without a key (endpoint exists,
1645
+ // requires auth) — free trial keys work here too.
1646
+ chatBaseUrl: "https://api.cohere.ai/compatibility/v1"
1647
+ },
1648
+ {
1649
+ id: "huggingface",
1650
+ label: "Hugging Face",
1651
+ envKey: "HUGGINGFACE_API_KEY",
1652
+ // Unified Inference Providers router — free serverless tier per model.
1653
+ chatBaseUrl: "https://router.huggingface.co/v1"
1654
+ },
1655
+ {
1656
+ id: "sambanova",
1657
+ // Also automatic, on the same evidence standard as mistral above, and
1658
+ // recorded with its weaker number rather than rounded up to match: 698
1659
+ // reporting invocations, 491K cache-read tokens against 9.7M eligible — a
1660
+ // 5.0% hit rate, and again zero writes. Low, but consistently non-zero
1661
+ // across hundreds of calls, which is a mechanism operating rather than
1662
+ // noise. A low hit rate is a prompt-stability problem on our side, not
1663
+ // evidence that the vendor does not cache.
1664
+ promptCaching: "automatic",
1665
+ label: "SambaNova",
1666
+ envKey: "SAMBANOVA_API_KEY",
1667
+ chatBaseUrl: "https://api.sambanova.ai/v1"
1668
+ },
1669
+ {
1670
+ id: "moonshot",
1671
+ label: "Moonshot AI (Kimi)",
1672
+ envKey: "MOONSHOT_API_KEY",
1673
+ chatBaseUrl: "https://api.moonshot.ai/v1"
1674
+ },
1675
+ {
1676
+ id: "nebius",
1677
+ label: "Nebius AI Studio",
1678
+ envKey: "NEBIUS_API_KEY",
1679
+ chatBaseUrl: "https://api.studio.nebius.ai/v1"
1680
+ },
1681
+ {
1682
+ id: "hyperbolic",
1683
+ label: "Hyperbolic",
1684
+ envKey: "HYPERBOLIC_API_KEY",
1685
+ chatBaseUrl: "https://api.hyperbolic.xyz/v1"
1686
+ },
1687
+ {
1688
+ id: "novita",
1689
+ label: "Novita AI",
1690
+ envKey: "NOVITA_API_KEY",
1691
+ chatBaseUrl: "https://api.novita.ai/v3/openai"
1692
+ },
1693
+ {
1694
+ id: "alibaba",
1695
+ label: "Alibaba Cloud Model Studio",
1696
+ envKey: "DASHSCOPE_API_KEY",
1697
+ chatBaseUrl: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
1698
+ },
1699
+ {
1700
+ id: "zai",
1701
+ label: "Z.AI (GLM)",
1702
+ envKey: "ZAI_API_KEY",
1703
+ chatBaseUrl: "https://open.bigmodel.cn/api/paas/v4"
1704
+ },
1705
+ {
1706
+ id: "minimax",
1707
+ label: "MiniMax",
1708
+ envKey: "MINIMAX_API_KEY",
1709
+ chatBaseUrl: "https://api.minimax.io/v1"
1710
+ },
1711
+ {
1712
+ id: "ai21",
1713
+ defaultModel: "jamba-mini",
1714
+ label: "AI21 Labs",
1715
+ envKey: "AI21_API_KEY",
1716
+ chatBaseUrl: "https://api.ai21.com/studio/v1"
1717
+ },
1718
+ {
1719
+ id: "perplexity",
1720
+ defaultModel: "sonar",
1721
+ label: "Perplexity Sonar",
1722
+ envKey: "PERPLEXITY_API_KEY",
1723
+ chatBaseUrl: "https://api.perplexity.ai",
1724
+ sdkCostMetadataKey: "perplexity"
1725
+ },
1726
+ {
1727
+ // Bedrock's OpenAI-compatible "mantle" endpoint: OpenAI dialect under /v1,
1728
+ // one host per region (MEASURED 2026-08-13: 18 regions answer, the rest are
1729
+ // NXDOMAIN). Only the region varies, so the row templates the whole base and
1730
+ // `urlParamEnvKey` supplies it. No first-party factory: @ai-sdk/amazon-bedrock
1731
+ // builds Bedrock-native paths ({base}/model/{id}/converse) off the same base.
1732
+ id: "aws-bedrock",
1733
+ label: "Amazon Bedrock",
1734
+ envKey: "AWS_BEDROCK_API_KEY",
1735
+ chatBaseUrl: "https://bedrock-mantle.{urlParam}.api.aws/v1",
1736
+ urlParamEnvKey: "AWS_BEDROCK_REGION"
1737
+ },
1738
+ {
1739
+ id: "microsoft-foundry",
1740
+ label: "Microsoft Foundry",
1741
+ envKey: "AZURE_AI_API_KEY",
1742
+ baseUrlEnvKey: "AZURE_AI_BASE_URL",
1743
+ chatBaseUrl: "{baseUrl}"
1744
+ },
1745
+ {
1746
+ id: "cloudflare",
1747
+ label: "Cloudflare Workers AI",
1748
+ envKey: "CLOUDFLARE_AI_TOKEN",
1749
+ chatBaseUrl: "https://api.cloudflare.com/client/v4/accounts/{urlParam}/ai/v1",
1750
+ urlParamEnvKey: "CLOUDFLARE_AI_ACCOUNT_ID"
1751
+ },
1752
+ {
1753
+ id: "ollama",
1754
+ label: "Ollama",
1755
+ envKey: "OLLAMA_API_KEY",
1756
+ // Cloud accounts use the same Ollama API on ollama.com.
1757
+ chatBaseUrl: "https://ollama.com/v1"
1758
+ },
1759
+ {
1760
+ id: "byteplus",
1761
+ label: "BytePlus ModelArk",
1762
+ envKey: "BYTEPLUS_API_KEY",
1763
+ chatBaseUrl: "https://ark.ap-southeast.bytepluses.com/api/v3"
1764
+ },
1765
+ {
1766
+ id: "scaleway",
1767
+ label: "Scaleway Generative APIs",
1768
+ envKey: "SCALEWAY_API_KEY",
1769
+ // EU (Paris) inference. Keys are Scaleway IAM API keys, hence the IAM console.
1770
+ chatBaseUrl: "https://api.scaleway.ai/v1"
1771
+ },
1772
+ {
1773
+ id: "hetzner",
1774
+ label: "Hetzner Inference",
1775
+ envKey: "HETZNER_INFERENCE_API_KEY",
1776
+ chatBaseUrl: "https://inference.hetzner.com/api/v1"
1777
+ },
1778
+ {
1779
+ id: "ovhcloud",
1780
+ label: "OVHcloud AI Endpoints",
1781
+ envKey: "OVH_AI_ENDPOINTS_API_KEY",
1782
+ chatBaseUrl: "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1"
1783
+ },
1784
+ {
1785
+ id: "publicai",
1786
+ label: "Public AI",
1787
+ envKey: "PUBLICAI_API_KEY",
1788
+ chatBaseUrl: "https://api.publicai.co/v1"
1789
+ },
1790
+ {
1791
+ id: "opencode-zen",
1792
+ label: "OpenCode Zen",
1793
+ envKey: "OPENCODE_ZEN_API_KEY",
1794
+ chatBaseUrl: "https://opencode.ai/zen/v1"
1795
+ },
1796
+ {
1797
+ id: "tencent",
1798
+ label: "Tencent TokenHub",
1799
+ envKey: "TENCENT_TOKENHUB_API_KEY",
1800
+ // International endpoint (the mainland host is a different origin).
1801
+ chatBaseUrl: "https://tokenhub-intl.tencentcloudmaas.com/v1"
1802
+ },
1803
+ {
1804
+ id: "modelscope",
1805
+ label: "ModelScope",
1806
+ envKey: "MODELSCOPE_API_KEY",
1807
+ chatBaseUrl: "https://api-inference.modelscope.cn/v1"
1808
+ },
1809
+ {
1810
+ id: "upstage",
1811
+ label: "Upstage Solar",
1812
+ envKey: "UPSTAGE_API_KEY",
1813
+ chatBaseUrl: "https://api.upstage.ai/v1"
1814
+ },
1815
+ {
1816
+ id: "venice",
1817
+ label: "Venice AI",
1818
+ envKey: "VENICE_API_KEY",
1819
+ // The doubled `/api` is correct, not a typo: Venice's OpenAI-compatible
1820
+ // surface is served at /api/v1 (live-verified).
1821
+ chatBaseUrl: "https://api.venice.ai/api/v1"
1822
+ },
1823
+ {
1824
+ id: "featherless",
1825
+ label: "Featherless",
1826
+ envKey: "FEATHERLESS_API_KEY",
1827
+ chatBaseUrl: "https://api.featherless.ai/v1"
1828
+ },
1829
+ {
1830
+ id: "redpill",
1831
+ label: "RedPill",
1832
+ envKey: "REDPILL_API_KEY",
1833
+ chatBaseUrl: "https://api.redpill.ai/v1"
1834
+ },
1835
+ {
1836
+ id: "eigenai",
1837
+ label: "EigenAI",
1838
+ envKey: "EIGENAI_API_KEY",
1839
+ // docs.eigenai.com/products/model-api/api-reference/base-url (fetched
1840
+ // 2026-09-10) settles the base URL that was left open on 2026-07-31:
1841
+ // api-web.eigenai.com/api/v1, Bearer auth, OpenAI chat/completions shape.
1842
+ // The other host in EigenCloud's launch material (eigenai.eigencloud.xyz)
1843
+ // does not resolve.
1844
+ chatBaseUrl: "https://api-web.eigenai.com/api/v1"
1845
+ },
1846
+ {
1847
+ id: "ionet",
1848
+ label: "io.net Intelligence",
1849
+ // NOT `IONET_API_KEY` — that name is already taken, by io.net's COMPUTE
1850
+ // integration (packages/compute/src/providers/ionet-provider.ts, which reads
1851
+ // it for api.io.net/v1 GPU jobs and has a compute-gpu manifest row). These
1852
+ // are two different io.net products with two different API hosts and two
1853
+ // different key consoles (cloud.io.net for compute, ai.io.net for
1854
+ // Intelligence), so collapsing them onto one env var would assert that one
1855
+ // pasted secret authenticates both — an assumption nothing here can verify.
1856
+ // This is the Hugging Face situation (two credentials that look like one),
1857
+ // not the fal/Baseten one (one credential that grew two names): when the
1858
+ // vendor really does issue a single key for both surfaces, the fix is to
1859
+ // DELETE this row's key and read the shared one, not to keep both.
1860
+ envKey: "IONET_INTELLIGENCE_API_KEY",
1861
+ chatBaseUrl: "https://api.intelligence.io.solutions/api/v1"
1862
+ },
1863
+ {
1864
+ id: "akashml",
1865
+ label: "AkashML",
1866
+ envKey: "AKASHML_API_KEY",
1867
+ chatBaseUrl: "https://api.akashml.com/v1"
1868
+ },
1869
+ {
1870
+ id: "prime-intellect",
1871
+ label: "Prime Intellect",
1872
+ envKey: "PRIME_INTELLECT_API_KEY",
1873
+ chatBaseUrl: "https://api.pinference.ai/api/v1"
1874
+ },
1875
+ {
1876
+ id: "vercel-gateway",
1877
+ label: "Vercel AI Gateway",
1878
+ envKey: "VERCEL_AI_GATEWAY_API_KEY",
1879
+ chatBaseUrl: "https://ai-gateway.vercel.sh/v1"
1880
+ },
1881
+ {
1882
+ id: "cheaper-inference",
1883
+ label: "Cheaper Inference",
1884
+ envKey: "CHEAPER_INFERENCE_API_KEY",
1885
+ chatBaseUrl: "https://api.cheaperinference.com/v1",
1886
+ chatDialect: "openai-chat",
1887
+ // The successful response's billing envelope contains the settled charge
1888
+ // as a fixed-precision USD string. Preserve it so the caller's credit debit
1889
+ // uses the real marketplace bill instead of a catalog estimate.
1890
+ responseCostUsdPath: ["cheaper_inference", "billing", "billed_cost_usd"]
1891
+ },
1892
+ {
1893
+ id: "router",
1894
+ label: "Ramp Router",
1895
+ envKey: "ROUTER_API_KEY",
1896
+ chatBaseUrl: "https://api.router.com/v1",
1897
+ chatDialect: "openai-responses"
1898
+ },
1899
+ {
1900
+ id: "reka",
1901
+ label: "Reka",
1902
+ envKey: "REKA_API_KEY",
1903
+ chatBaseUrl: "https://api.reka.ai/v1"
1904
+ },
1905
+ {
1906
+ id: "custom-openai",
1907
+ label: "Custom / private OpenAI-compatible",
1908
+ envKey: "CUSTOM_OPENAI_API_KEY",
1909
+ baseUrlEnvKey: "CUSTOM_OPENAI_BASE_URL",
1910
+ chatBaseUrl: "{baseUrl}"
1911
+ },
1912
+ {
1913
+ // Platform model deployments (packages/clikmodels + the models domain):
1914
+ // a user's own vLLM/llama.cpp/Ollama runtime served on their server or a
1915
+ // platform GPU pod, exposed as an OpenAI-compatible endpoint. This row
1916
+ // exists so those deployments have a REGISTRY-KNOWN provider id — router
1917
+ // candidates and AiInvocation attribution both join this catalog instead
1918
+ // of the pseudo-ids ('gpu-pod') that used to join nothing.
1919
+ //
1920
+ // DELIBERATELY NEVER RESOLVED FROM ENV: there is no single endpoint or
1921
+ // key — each candidate is one live ModelDeployment, and its base URL is
1922
+ // attached per-candidate at the candidates layer
1923
+ // (the calling application's candidates layer) and dispatched via
1924
+ // streamAiChatTurn's per-call `baseUrl` override. The envKey below is a
1925
+ // naming placeholder that keeps this row invisible to the normal
1926
+ // credential walk (never set ⇒ hasApiKeyCredential is false ⇒ the
1927
+ // AI_PROVIDERS candidate walk never emits it on its own).
1928
+ id: "self-hosted",
1929
+ label: "Self-hosted models",
1930
+ envKey: "SELF_HOSTED_MODELS_API_KEY",
1931
+ chatBaseUrl: "{baseUrl}"
1932
+ },
1933
+ {
1934
+ id: "chutes",
1935
+ label: "Chutes",
1936
+ defaultModel: "deepseek-ai/DeepSeek-V3.2-TEE",
1937
+ envKey: "CHUTES_API_KEY",
1938
+ chatBaseUrl: "https://llm.chutes.ai/v1",
1939
+ chatDialect: "openai-chat"
1940
+ },
1941
+ {
1942
+ id: "opencode-go",
1943
+ label: "OpenCode Go",
1944
+ // From the live Go catalog (25 ids, read 2026-08-13). Chosen because it is
1945
+ // the id OpenCode's own Go docs lead with.
1946
+ defaultModel: "minimax-m3",
1947
+ // Distinct from any key the free/pay-as-you-go Zen row uses: Go is a
1948
+ // separate $10/mo plan on a separate base URL, and one env var cannot hold
1949
+ // two different subscriptions' keys.
1950
+ envKey: "OPENCODE_GO_API_KEY",
1951
+ chatBaseUrl: "https://opencode.ai/zen/go/v1",
1952
+ chatDialect: "openai-chat"
1953
+ }
1954
+ ];
1955
+
1956
+ // packages/clikrouter/src/ai-provider-registry/lookups.ts
1957
+ function getAiProvider(id) {
1958
+ return AI_PROVIDERS.find((p) => p.id === id);
1959
+ }
1960
+ // Annotate the CommonJS export names for ESM import in node:
1961
+ 0 && (module.exports = {
1962
+ AI_LOCAL_HARNESSES,
1963
+ AI_LOCAL_HARNESS_ADAPTER_VERSION,
1964
+ AI_LOCAL_HARNESS_CAPABILITIES,
1965
+ HOME_REDIRECT_ENV_DEFAULTS,
1966
+ KEY_PROVIDERS,
1967
+ allLocalHarnesses,
1968
+ customAcpHarness,
1969
+ getAiProvider,
1970
+ guardedPromptArgv,
1971
+ harnessAcpLaunch,
1972
+ harnessCanRunTurns,
1973
+ harnessCarriesProvider,
1974
+ harnessIntegrationLevel,
1975
+ harnessLoginArgvForModel,
1976
+ harnessModelAcceptsEffort,
1977
+ harnessReplyError,
1978
+ harnessSupportsEffort,
1979
+ harnessSupportsImages,
1980
+ harnessSupportsModelSelection,
1981
+ harnessSupportsPermissionMode,
1982
+ harnessTierRank,
1983
+ harnessTurnTransport,
1984
+ localHarnessCapabilityManifest,
1985
+ localHarnessForCommand,
1986
+ localHarnessForProvider,
1987
+ maxPromptArgvBytes,
1988
+ modelDisplayId,
1989
+ modelIdFromDisplay,
1990
+ modelProvider,
1991
+ modelSelectorArgv,
1992
+ nativeHarnessTurnArgv,
1993
+ permissionModeRefusedHere,
1994
+ promptExceedsArgvLimit,
1995
+ registerCustomHarnesses,
1996
+ splitHarnessModel,
1997
+ splitProviderModel
1998
+ });