@smithers-orchestrator/agents 0.21.0 → 0.23.0
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.
- package/package.json +6 -5
- package/src/AmpAgent.js +26 -19
- package/src/AntigravityAgent.js +53 -18
- package/src/AntigravityAgentOptions.ts +45 -4
- package/src/BaseCliAgent/AgentGenerateOptions.ts +12 -0
- package/src/BaseCliAgent/BaseCliAgent.js +19 -1
- package/src/BaseCliAgent/runRpcCommandEffect.js +7 -3
- package/src/BaseCliAgent/taskContextEnv.js +31 -0
- package/src/BaseCliAgent/truncateToBytes.js +18 -1
- package/src/ClaudeCodeAgent.js +19 -1
- package/src/CodexAgent.js +15 -8
- package/src/ForgeAgent.js +26 -19
- package/src/HermesAgent.js +41 -0
- package/src/HermesAgentOptions.ts +41 -0
- package/src/VibeAgent.js +214 -0
- package/src/VibeAgentOptions.ts +11 -0
- package/src/agent-contract/createSmithersAgentContract.js +1 -0
- package/src/agent-contract/renderSmithersAgentPromptGuidance.js +4 -0
- package/src/capability-registry/AgentCapabilityRegistry.ts +1 -1
- package/src/cli-capabilities/CliAgentCapabilityAdapterId.ts +4 -1
- package/src/cli-capabilities/CliAgentCapabilityReportEntry.ts +2 -0
- package/src/cli-capabilities/getCliAgentCapabilityDoctorReport.js +48 -1
- package/src/cli-capabilities/getCliAgentCapabilityReport.js +24 -0
- package/src/cli-capabilities/index.js +5 -0
- package/src/cli-surface/CliAgentSurfaceTypes.ts +34 -0
- package/src/cli-surface/cliAgentSurfaceManifest.js +490 -0
- package/src/cli-surface/index.js +5 -0
- package/src/diagnostics/runDiagnostics.js +9 -1
- package/src/index.d.ts +715 -380
- package/src/index.js +27 -0
- package/src/mcp/McpServerConfig.ts +19 -0
- package/src/mcp/McpToolset.ts +17 -0
- package/src/mcp/createMcpToolset.js +94 -0
- package/src/sanitizeForOpenAI.js +20 -17
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
/** @typedef {import("./CliAgentSurfaceTypes.ts").CliAgentSurfaceManifestEntry} CliAgentSurfaceManifestEntry */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compatibility contract for CLI-backed agents. Keep this list focused on the
|
|
5
|
+
* command surface Smithers emits directly; user-supplied extraArgs remain an
|
|
6
|
+
* escape hatch and are intentionally not modeled here.
|
|
7
|
+
*
|
|
8
|
+
* @type {readonly CliAgentSurfaceManifestEntry[]}
|
|
9
|
+
*/
|
|
10
|
+
export const CLI_AGENT_SURFACE_MANIFEST = [
|
|
11
|
+
{
|
|
12
|
+
id: "claude",
|
|
13
|
+
displayName: "Claude Code",
|
|
14
|
+
binary: "claude",
|
|
15
|
+
packageExport: "ClaudeCodeAgent",
|
|
16
|
+
defaultOutputFormat: "stream-json",
|
|
17
|
+
docsUrls: ["https://docs.anthropic.com/en/docs/claude-code/cli-reference"],
|
|
18
|
+
emittedFlags: [
|
|
19
|
+
"--print",
|
|
20
|
+
"--add-dir",
|
|
21
|
+
"--agent",
|
|
22
|
+
"--agents",
|
|
23
|
+
"--allow-dangerously-skip-permissions",
|
|
24
|
+
"--dangerously-skip-permissions",
|
|
25
|
+
"--permission-mode",
|
|
26
|
+
"--allowed-tools",
|
|
27
|
+
"--append-system-prompt",
|
|
28
|
+
"--betas",
|
|
29
|
+
"--chrome",
|
|
30
|
+
"--no-chrome",
|
|
31
|
+
"--continue",
|
|
32
|
+
"--debug",
|
|
33
|
+
"--debug-file",
|
|
34
|
+
"--disable-slash-commands",
|
|
35
|
+
"--disallowed-tools",
|
|
36
|
+
"--fallback-model",
|
|
37
|
+
"--file",
|
|
38
|
+
"--fork-session",
|
|
39
|
+
"--from-pr",
|
|
40
|
+
"--ide",
|
|
41
|
+
"--include-partial-messages",
|
|
42
|
+
"--input-format",
|
|
43
|
+
"--json-schema",
|
|
44
|
+
"--max-budget-usd",
|
|
45
|
+
"--mcp-config",
|
|
46
|
+
"--mcp-debug",
|
|
47
|
+
"--model",
|
|
48
|
+
"--no-session-persistence",
|
|
49
|
+
"--output-format",
|
|
50
|
+
"--plugin-dir",
|
|
51
|
+
"--replay-user-messages",
|
|
52
|
+
"--resume",
|
|
53
|
+
"--session-id",
|
|
54
|
+
"--setting-sources",
|
|
55
|
+
"--settings",
|
|
56
|
+
"--strict-mcp-config",
|
|
57
|
+
"--system-prompt",
|
|
58
|
+
"--tools",
|
|
59
|
+
"--verbose",
|
|
60
|
+
],
|
|
61
|
+
supportedFlags: [],
|
|
62
|
+
unsupportedFlags: [],
|
|
63
|
+
optionMappings: [
|
|
64
|
+
{ option: "configDir", env: "CLAUDE_CONFIG_DIR" },
|
|
65
|
+
{ option: "apiKey", env: "ANTHROPIC_API_KEY" },
|
|
66
|
+
{ option: "resume", flag: "--resume" },
|
|
67
|
+
],
|
|
68
|
+
resume: {
|
|
69
|
+
kind: "flag",
|
|
70
|
+
emitted: ["--resume"],
|
|
71
|
+
notes: "Native Claude session id.",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "codex",
|
|
76
|
+
displayName: "Codex",
|
|
77
|
+
binary: "codex",
|
|
78
|
+
packageExport: "CodexAgent",
|
|
79
|
+
defaultOutputFormat: "stream-json",
|
|
80
|
+
docsUrls: ["https://developers.openai.com/codex/cli/reference"],
|
|
81
|
+
emittedFlags: [
|
|
82
|
+
"-c",
|
|
83
|
+
"--enable",
|
|
84
|
+
"--disable",
|
|
85
|
+
"--image",
|
|
86
|
+
"--model",
|
|
87
|
+
"--oss",
|
|
88
|
+
"--local-provider",
|
|
89
|
+
"--sandbox",
|
|
90
|
+
"--profile",
|
|
91
|
+
"--full-auto",
|
|
92
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
93
|
+
"--cd",
|
|
94
|
+
"--skip-git-repo-check",
|
|
95
|
+
"--add-dir",
|
|
96
|
+
"--output-schema",
|
|
97
|
+
"--color",
|
|
98
|
+
"--json",
|
|
99
|
+
"--output-last-message",
|
|
100
|
+
],
|
|
101
|
+
supportedFlags: [],
|
|
102
|
+
unsupportedFlags: [],
|
|
103
|
+
optionMappings: [
|
|
104
|
+
{ option: "configDir", env: "CODEX_HOME" },
|
|
105
|
+
{ option: "apiKey", env: "OPENAI_API_KEY" },
|
|
106
|
+
{ option: "resumeSession", notes: "Uses `codex exec resume <thread-id>`." },
|
|
107
|
+
],
|
|
108
|
+
resume: {
|
|
109
|
+
kind: "subcommand",
|
|
110
|
+
emitted: ["exec", "resume"],
|
|
111
|
+
notes: "Resume uses `codex exec resume <thread-id>` and omits output schema wiring.",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "antigravity",
|
|
116
|
+
displayName: "Antigravity",
|
|
117
|
+
binary: "agy",
|
|
118
|
+
packageExport: "AntigravityAgent",
|
|
119
|
+
defaultOutputFormat: "text",
|
|
120
|
+
docsUrls: [
|
|
121
|
+
"https://antigravity.google/docs/cli-best-practices",
|
|
122
|
+
"https://antigravity.google/docs/cli-conversations",
|
|
123
|
+
"https://antigravity.google/docs/cli-plugins",
|
|
124
|
+
],
|
|
125
|
+
emittedFlags: [
|
|
126
|
+
"-p",
|
|
127
|
+
"--cwd",
|
|
128
|
+
"--model",
|
|
129
|
+
"--sandbox",
|
|
130
|
+
"--dangerously-skip-permissions",
|
|
131
|
+
"--allowed-mcp-server-names",
|
|
132
|
+
"--allowed-tools",
|
|
133
|
+
"--add-dir",
|
|
134
|
+
"--continue",
|
|
135
|
+
"--conversation",
|
|
136
|
+
"--gemini_dir",
|
|
137
|
+
],
|
|
138
|
+
supportedFlags: [
|
|
139
|
+
"-p",
|
|
140
|
+
"--cwd",
|
|
141
|
+
"--model",
|
|
142
|
+
"--sandbox",
|
|
143
|
+
"--dangerously-skip-permissions",
|
|
144
|
+
"--allowed-mcp-server-names",
|
|
145
|
+
"--allowed-tools",
|
|
146
|
+
"--add-dir",
|
|
147
|
+
"--continue",
|
|
148
|
+
"--conversation",
|
|
149
|
+
"-c",
|
|
150
|
+
"--gemini_dir",
|
|
151
|
+
],
|
|
152
|
+
unsupportedFlags: [
|
|
153
|
+
{
|
|
154
|
+
flag: "--output-format",
|
|
155
|
+
reason: "Current agy builds do not expose an output-format flag; Smithers treats stdout as text.",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
flag: "--include-directories",
|
|
159
|
+
replacement: "--add-dir",
|
|
160
|
+
reason: "The directory allow-list flag was renamed.",
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
flag: "--resume",
|
|
164
|
+
replacement: "--conversation",
|
|
165
|
+
reason: "Conversation resume now uses --conversation or -c.",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
flag: "--list-sessions",
|
|
169
|
+
replacement: "/resume",
|
|
170
|
+
reason: "Conversation listing is an interactive slash command.",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
flag: "--screen-reader",
|
|
174
|
+
reason: "Current agy builds do not expose this flag.",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
flag: "--debug",
|
|
178
|
+
reason: "Current agy builds do not expose this flag.",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
flag: "--extensions",
|
|
182
|
+
replacement: "agy plugin",
|
|
183
|
+
reason: "Extensions were renamed to plugins and are managed by the plugin subcommand.",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
flag: "--list-extensions",
|
|
187
|
+
replacement: "agy plugin list",
|
|
188
|
+
reason: "Plugins are listed through the plugin subcommand.",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
flag: "--delete-session",
|
|
192
|
+
replacement: "/resume",
|
|
193
|
+
reason: "Conversation management is handled inside the CLI session.",
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
flag: "--prompt",
|
|
197
|
+
replacement: "-p",
|
|
198
|
+
reason: "Non-interactive prompts use -p.",
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
optionMappings: [
|
|
202
|
+
{ option: "includeDirectories", flag: "--add-dir" },
|
|
203
|
+
{ option: "resume", flag: "--conversation" },
|
|
204
|
+
{ option: "conversation", flag: "--conversation" },
|
|
205
|
+
{ option: "continue", flag: "--continue" },
|
|
206
|
+
{ option: "configDir", flag: "--gemini_dir", env: "GEMINI_DIR" },
|
|
207
|
+
{ option: "geminiDir", flag: "--gemini_dir", env: "GEMINI_DIR" },
|
|
208
|
+
{ option: "apiKey", env: "GEMINI_API_KEY" },
|
|
209
|
+
],
|
|
210
|
+
resume: {
|
|
211
|
+
kind: "flag",
|
|
212
|
+
emitted: ["--conversation"],
|
|
213
|
+
notes: "Smithers maps native session ids to `agy --conversation <id>`.",
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "gemini",
|
|
218
|
+
displayName: "Gemini",
|
|
219
|
+
binary: "gemini",
|
|
220
|
+
packageExport: "GeminiAgent",
|
|
221
|
+
defaultOutputFormat: "json",
|
|
222
|
+
docsUrls: ["https://github.com/google-gemini/gemini-cli"],
|
|
223
|
+
emittedFlags: [
|
|
224
|
+
"--debug",
|
|
225
|
+
"--model",
|
|
226
|
+
"--sandbox",
|
|
227
|
+
"--approval-mode",
|
|
228
|
+
"--yolo",
|
|
229
|
+
"--experimental-acp",
|
|
230
|
+
"--allowed-mcp-server-names",
|
|
231
|
+
"--allowed-tools",
|
|
232
|
+
"--extensions",
|
|
233
|
+
"--list-extensions",
|
|
234
|
+
"--resume",
|
|
235
|
+
"--list-sessions",
|
|
236
|
+
"--delete-session",
|
|
237
|
+
"--include-directories",
|
|
238
|
+
"--screen-reader",
|
|
239
|
+
"--output-format",
|
|
240
|
+
"--prompt",
|
|
241
|
+
],
|
|
242
|
+
supportedFlags: [],
|
|
243
|
+
unsupportedFlags: [],
|
|
244
|
+
optionMappings: [
|
|
245
|
+
{ option: "configDir", env: "GEMINI_DIR" },
|
|
246
|
+
{ option: "apiKey", env: "GEMINI_API_KEY" },
|
|
247
|
+
{ option: "resume", flag: "--resume" },
|
|
248
|
+
],
|
|
249
|
+
resume: {
|
|
250
|
+
kind: "flag",
|
|
251
|
+
emitted: ["--resume"],
|
|
252
|
+
notes: "Legacy Gemini CLI session id.",
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "pi",
|
|
257
|
+
displayName: "Pi",
|
|
258
|
+
binary: "pi",
|
|
259
|
+
packageExport: "PiAgent",
|
|
260
|
+
defaultOutputFormat: "text",
|
|
261
|
+
docsUrls: ["https://github.com/withpi/pi"],
|
|
262
|
+
emittedFlags: [
|
|
263
|
+
"--print",
|
|
264
|
+
"--mode",
|
|
265
|
+
"--provider",
|
|
266
|
+
"--model",
|
|
267
|
+
"--api-key",
|
|
268
|
+
"--system-prompt",
|
|
269
|
+
"--append-system-prompt",
|
|
270
|
+
"--continue",
|
|
271
|
+
"--resume",
|
|
272
|
+
"--session",
|
|
273
|
+
"--session-dir",
|
|
274
|
+
"--no-session",
|
|
275
|
+
"--models",
|
|
276
|
+
"--list-models",
|
|
277
|
+
"--export",
|
|
278
|
+
"--tools",
|
|
279
|
+
"--no-tools",
|
|
280
|
+
"--extension",
|
|
281
|
+
"--no-extensions",
|
|
282
|
+
"--skill",
|
|
283
|
+
"--no-skills",
|
|
284
|
+
"--prompt-template",
|
|
285
|
+
"--no-prompt-templates",
|
|
286
|
+
"--theme",
|
|
287
|
+
"--no-themes",
|
|
288
|
+
"--thinking",
|
|
289
|
+
"--verbose",
|
|
290
|
+
"--files",
|
|
291
|
+
],
|
|
292
|
+
supportedFlags: [],
|
|
293
|
+
unsupportedFlags: [],
|
|
294
|
+
optionMappings: [
|
|
295
|
+
{ option: "resumeSession", flag: "--session" },
|
|
296
|
+
{ option: "apiKey", flag: "--api-key" },
|
|
297
|
+
],
|
|
298
|
+
resume: {
|
|
299
|
+
kind: "flag",
|
|
300
|
+
emitted: ["--session"],
|
|
301
|
+
notes: "Per-call resumeSession maps to a Pi session id.",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "kimi",
|
|
306
|
+
displayName: "Kimi",
|
|
307
|
+
binary: "kimi",
|
|
308
|
+
packageExport: "KimiAgent",
|
|
309
|
+
defaultOutputFormat: "text",
|
|
310
|
+
docsUrls: ["https://github.com/MoonshotAI/kimi-cli"],
|
|
311
|
+
emittedFlags: [
|
|
312
|
+
"--print",
|
|
313
|
+
"--output-format",
|
|
314
|
+
"--final-message-only",
|
|
315
|
+
"--work-dir",
|
|
316
|
+
"--session",
|
|
317
|
+
"--continue",
|
|
318
|
+
"--model",
|
|
319
|
+
"--thinking",
|
|
320
|
+
"--no-thinking",
|
|
321
|
+
"--quiet",
|
|
322
|
+
"--agent",
|
|
323
|
+
"--agent-file",
|
|
324
|
+
"--mcp-config-file",
|
|
325
|
+
"--mcp-config",
|
|
326
|
+
"--skills-dir",
|
|
327
|
+
"--max-steps-per-turn",
|
|
328
|
+
"--max-retries-per-step",
|
|
329
|
+
"--max-ralph-iterations",
|
|
330
|
+
"--verbose",
|
|
331
|
+
"--debug",
|
|
332
|
+
"--prompt",
|
|
333
|
+
],
|
|
334
|
+
supportedFlags: [],
|
|
335
|
+
unsupportedFlags: [],
|
|
336
|
+
optionMappings: [
|
|
337
|
+
{ option: "configDir", env: "KIMI_SHARE_DIR" },
|
|
338
|
+
{ option: "resumeSession", flag: "--session" },
|
|
339
|
+
],
|
|
340
|
+
resume: {
|
|
341
|
+
kind: "flag",
|
|
342
|
+
emitted: ["--session"],
|
|
343
|
+
notes: "Smithers persists the Kimi session id and reuses it through --session.",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
id: "forge",
|
|
348
|
+
displayName: "Forge",
|
|
349
|
+
binary: "forge",
|
|
350
|
+
packageExport: "ForgeAgent",
|
|
351
|
+
defaultOutputFormat: "text",
|
|
352
|
+
docsUrls: ["https://forgecode.dev/docs/cli"],
|
|
353
|
+
emittedFlags: [
|
|
354
|
+
"--model",
|
|
355
|
+
"--provider",
|
|
356
|
+
"--agent",
|
|
357
|
+
"--conversation-id",
|
|
358
|
+
"--sandbox",
|
|
359
|
+
"--restricted",
|
|
360
|
+
"--verbose",
|
|
361
|
+
"--workflow",
|
|
362
|
+
"--event",
|
|
363
|
+
"--conversation",
|
|
364
|
+
"-C",
|
|
365
|
+
"--prompt",
|
|
366
|
+
],
|
|
367
|
+
supportedFlags: [],
|
|
368
|
+
unsupportedFlags: [],
|
|
369
|
+
optionMappings: [
|
|
370
|
+
{ option: "conversationId", flag: "--conversation-id" },
|
|
371
|
+
{ option: "resumeSession", flag: "--conversation-id" },
|
|
372
|
+
],
|
|
373
|
+
resume: {
|
|
374
|
+
kind: "flag",
|
|
375
|
+
emitted: ["--conversation-id"],
|
|
376
|
+
notes: "Smithers persists Forge conversation ids.",
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
id: "amp",
|
|
381
|
+
displayName: "Amp",
|
|
382
|
+
binary: "amp",
|
|
383
|
+
packageExport: "AmpAgent",
|
|
384
|
+
defaultOutputFormat: "text",
|
|
385
|
+
docsUrls: ["https://ampcode.com/manual"],
|
|
386
|
+
emittedFlags: [
|
|
387
|
+
"--dangerously-allow-all",
|
|
388
|
+
"--model",
|
|
389
|
+
"--visibility",
|
|
390
|
+
"--mcp-config",
|
|
391
|
+
"--settings-file",
|
|
392
|
+
"--log-level",
|
|
393
|
+
"--log-file",
|
|
394
|
+
"--no-ide",
|
|
395
|
+
"--no-jetbrains",
|
|
396
|
+
"--no-color",
|
|
397
|
+
"--archive",
|
|
398
|
+
"--execute",
|
|
399
|
+
"--stream-json",
|
|
400
|
+
],
|
|
401
|
+
supportedFlags: [],
|
|
402
|
+
unsupportedFlags: [],
|
|
403
|
+
optionMappings: [
|
|
404
|
+
{ option: "dangerouslyAllowAll", flag: "--dangerously-allow-all" },
|
|
405
|
+
],
|
|
406
|
+
resume: {
|
|
407
|
+
kind: "subcommand",
|
|
408
|
+
emitted: ["threads", "continue"],
|
|
409
|
+
notes: "Native hijack uses `amp threads continue`; headless generate starts a managed thread.",
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
id: "vibe",
|
|
414
|
+
displayName: "Vibe",
|
|
415
|
+
binary: "vibe",
|
|
416
|
+
packageExport: "VibeAgent",
|
|
417
|
+
defaultOutputFormat: "stream-json",
|
|
418
|
+
docsUrls: ["https://docs.mistral.ai/mistral-vibe/terminal"],
|
|
419
|
+
emittedFlags: [
|
|
420
|
+
"--agent",
|
|
421
|
+
"--max-turns",
|
|
422
|
+
"--max-price",
|
|
423
|
+
"--max-tokens",
|
|
424
|
+
"--enabled-tools",
|
|
425
|
+
"--trust",
|
|
426
|
+
"--output",
|
|
427
|
+
"--workdir",
|
|
428
|
+
"--prompt",
|
|
429
|
+
"--resume",
|
|
430
|
+
"-c",
|
|
431
|
+
],
|
|
432
|
+
supportedFlags: [],
|
|
433
|
+
unsupportedFlags: [],
|
|
434
|
+
optionMappings: [
|
|
435
|
+
{ option: "resumeSession", flag: "--resume" },
|
|
436
|
+
],
|
|
437
|
+
resume: {
|
|
438
|
+
kind: "flag",
|
|
439
|
+
emitted: ["--resume"],
|
|
440
|
+
notes: "Maps to vibe --resume <session-id> for headless continuation.",
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: "opencode",
|
|
445
|
+
displayName: "OpenCode",
|
|
446
|
+
binary: "opencode",
|
|
447
|
+
packageExport: "OpenCodeAgent",
|
|
448
|
+
defaultOutputFormat: "stream-json",
|
|
449
|
+
docsUrls: ["https://opencode.ai/docs/cli"],
|
|
450
|
+
emittedFlags: [
|
|
451
|
+
"run",
|
|
452
|
+
"-m",
|
|
453
|
+
"--dir",
|
|
454
|
+
"--format",
|
|
455
|
+
"--agent",
|
|
456
|
+
"-f",
|
|
457
|
+
"--continue",
|
|
458
|
+
"--session",
|
|
459
|
+
"--variant",
|
|
460
|
+
"--",
|
|
461
|
+
],
|
|
462
|
+
supportedFlags: [],
|
|
463
|
+
unsupportedFlags: [],
|
|
464
|
+
optionMappings: [
|
|
465
|
+
{ option: "sessionId", flag: "--session" },
|
|
466
|
+
{ option: "resumeSession", flag: "--session" },
|
|
467
|
+
{ option: "yolo", env: "OPENCODE_PERMISSION" },
|
|
468
|
+
],
|
|
469
|
+
resume: {
|
|
470
|
+
kind: "flag",
|
|
471
|
+
emitted: ["--session"],
|
|
472
|
+
notes: "OpenCode receives a session id through --session for headless continuation.",
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
];
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* @param {string} id
|
|
479
|
+
* @returns {CliAgentSurfaceManifestEntry | undefined}
|
|
480
|
+
*/
|
|
481
|
+
export function getCliAgentSurfaceManifestEntry(id) {
|
|
482
|
+
return CLI_AGENT_SURFACE_MANIFEST.find((entry) => entry.id === id);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @returns {CliAgentSurfaceManifestEntry[]}
|
|
487
|
+
*/
|
|
488
|
+
export function listCliAgentSurfaceManifests() {
|
|
489
|
+
return [...CLI_AGENT_SURFACE_MANIFEST];
|
|
490
|
+
}
|
|
@@ -19,10 +19,15 @@ const PER_CHECK_TIMEOUT_MS = 5_000;
|
|
|
19
19
|
*/
|
|
20
20
|
async function runCheck(check, ctx) {
|
|
21
21
|
const start = performance.now();
|
|
22
|
+
/** @type {ReturnType<typeof setTimeout> | undefined} */
|
|
23
|
+
let timeoutHandle;
|
|
22
24
|
try {
|
|
23
25
|
return await Promise.race([
|
|
24
26
|
check.run(ctx),
|
|
25
|
-
new Promise((_, reject) =>
|
|
27
|
+
new Promise((_, reject) => {
|
|
28
|
+
timeoutHandle = setTimeout(() => reject(new SmithersError("AGENT_DIAGNOSTIC_TIMEOUT", "diagnostic check timed out", { timeoutMs: PER_CHECK_TIMEOUT_MS })), PER_CHECK_TIMEOUT_MS);
|
|
29
|
+
timeoutHandle.unref?.();
|
|
30
|
+
}),
|
|
26
31
|
]);
|
|
27
32
|
}
|
|
28
33
|
catch (err) {
|
|
@@ -33,6 +38,9 @@ async function runCheck(check, ctx) {
|
|
|
33
38
|
durationMs: performance.now() - start,
|
|
34
39
|
};
|
|
35
40
|
}
|
|
41
|
+
finally {
|
|
42
|
+
clearTimeout(timeoutHandle);
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
/**
|
|
38
46
|
* @param {AgentDiagnosticStrategy} strategy
|