clikcode 0.0.0-stage → 1.0.1

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