@tangle-network/sandbox 0.69.11 → 0.69.12

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.
Files changed (77) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +3 -3
  5. package/dist/{agent-run-outcome-B5CzWxw4.d.ts → agent-run-outcome-BuebRCWr.d.ts} +2 -2
  6. package/dist/{api-request-D1UVNo16.js → api-request-EseiF9B1.js} +1 -1
  7. package/dist/auth/index.d.ts +2 -2
  8. package/dist/auth/index.js +1 -1
  9. package/dist/browser-interactive-control-controller-Bt1vcu9c.js +4045 -0
  10. package/dist/{browser-interactive-control-controller-SI9hV6r5.d.ts → browser-interactive-control-controller-CVnME80O.d.ts} +5 -7
  11. package/dist/{chunked-upload-l6b9AWFA.js → chunked-upload-Df_5Q2x8.js} +1 -1
  12. package/dist/{chunked-upload-file-CLwAeLrM.js → chunked-upload-file-Dtm1GBkE.js} +2 -2
  13. package/dist/cli-auth-bundle-f2pt7sVA.js +2593 -0
  14. package/dist/{client-D6b3wBnI.js → client-BR_aABY2.js} +11 -11
  15. package/dist/{client-Ds3As2SY.d.ts → client-BWnbrifs.d.ts} +40 -42
  16. package/dist/collaboration/index.d.ts +1 -1
  17. package/dist/collaboration/index.js +1 -1
  18. package/dist/{collaboration-BwLNv6sy.js → collaboration-BTGTf3We.js} +1 -1
  19. package/dist/{core-BhSZIdRK.js → core-DeXa_YQ2.js} +5 -4
  20. package/dist/core.d.ts +6 -6
  21. package/dist/core.js +5 -5
  22. package/dist/{direct-http2-Pyj3Rvr1.js → direct-http2-B0ra_xhU.js} +1 -1
  23. package/dist/{errors-Bs5G7JdV.js → errors-ZmDrrk4f.js} +1 -1
  24. package/dist/harness-BD_OISom.js +201 -0
  25. package/dist/harness-DWL2MM4q.js +418 -0
  26. package/dist/{index-nXob5TkM.d.ts → index-DdcCRDq8.d.ts} +14 -16
  27. package/dist/index.d.ts +11 -11
  28. package/dist/index.js +11 -11
  29. package/dist/intelligence/index.js +2 -2
  30. package/dist/interactive-control.d.ts +1 -1
  31. package/dist/interactive-control.js +1 -1
  32. package/dist/{interactive-controller-DSDEfapN.js → interactive-controller-B4bQwRJL.js} +21 -8
  33. package/dist/{interactive-controller-FgmcS8_Y.d.ts → interactive-controller-DlFKGQqu.d.ts} +3 -4
  34. package/dist/lib/prepared-evidence.js +1 -1
  35. package/dist/lib/prepared-process.js +1 -1
  36. package/dist/{lines-D_HDAcVt.js → lines-BqZOl_io.js} +1 -1
  37. package/dist/{lines-BoVYnUCM.d.ts → lines-ptj8SyD4.d.ts} +1 -1
  38. package/dist/lines.d.ts +1 -1
  39. package/dist/lines.js +1 -1
  40. package/dist/{local-cli-auth-DaU64laN.js → local-cli-auth-Cpi3hT3j.js} +1 -1
  41. package/dist/{mcp-local-Gz1Uygqk.js → mcp-local-BcRLN_Ic.js} +1 -1
  42. package/dist/{prepared-evidence-DUmJSegi.js → prepared-evidence-CuUh_mz6.js} +1 -1
  43. package/dist/{preview-7EJ_80nL.d.ts → preview-ByTCKjiK.d.ts} +3 -3
  44. package/dist/profile-schema-CT3hB1mG.js +1135 -0
  45. package/dist/{public-templates-B6_uwnRZ.d.ts → public-templates-O2mxBX7J.d.ts} +2 -2
  46. package/dist/public-templates.d.ts +1 -1
  47. package/dist/public-templates.js +1 -1
  48. package/dist/{raw-evidence-archive-D60Yg1-5.js → raw-evidence-archive-CqarcYcp.js} +1 -1
  49. package/dist/runtime.d.ts +5 -5
  50. package/dist/runtime.js +5 -5
  51. package/dist/{sandbox-DVOrtcTK.js → sandbox-B1ROfJxe.js} +384 -46
  52. package/dist/{secp256k1-DxHlUI6v.js → secp256k1-CZWrpqxW.js} +1 -1
  53. package/dist/select-seat-command.d.ts +1 -1
  54. package/dist/select-seat-command.js +1 -1
  55. package/dist/session-gateway/index.js +3 -3
  56. package/dist/sha2-BUPMvGTk.js +694 -0
  57. package/dist/tangle/index.d.ts +1 -1
  58. package/dist/tangle/index.js +1 -1
  59. package/dist/{tangle-Br7yT7X8.js → tangle-q-3ualoW.js} +4 -4
  60. package/dist/terminal-stream-types-DwXQzUbH.d.ts +3328 -0
  61. package/dist/{types-CkLWX7i5.d.ts → types-B28t5Sq1.d.ts} +10 -12
  62. package/package.json +6 -6
  63. package/dist/browser-interactive-control-controller-CLHNi8rG.js +0 -292
  64. package/dist/cli-auth-bundle-B1Mpf18p.js +0 -1590
  65. package/dist/terminal-stream-types-DuzvL1ge.d.ts +0 -676
  66. /package/dist/{abort-signal-BKVZNJul.js → abort-signal-jU-SEjLT.js} +0 -0
  67. /package/dist/{cli-auth-bundle-CeNOYFje.d.ts → cli-auth-bundle-MskLEgtA.d.ts} +0 -0
  68. /package/dist/{index-C0RkLba5.d.ts → index-Dqcr9p97.d.ts} +0 -0
  69. /package/dist/{index-DaIF4c9p.d.ts → index-Dslyq85a.d.ts} +0 -0
  70. /package/dist/{keep-alive-fetch-Bi-zvHpN.js → keep-alive-fetch-C2DX2_rG.js} +0 -0
  71. /package/dist/{prepared-process-Dlk_9JVJ.js → prepared-process-LjBfQnZ5.js} +0 -0
  72. /package/dist/{preview-operations-eTUlPen5.js → preview-operations-BvgwYaoL.js} +0 -0
  73. /package/dist/{response-rewrap-BKkJ5hnn.js → response-rewrap-MBztoTLx.js} +0 -0
  74. /package/dist/{retry-after-header-U_L5Ml9Q.js → retry-after-header-BZbs5rig.js} +0 -0
  75. /package/dist/{sidecar-proxy-error-B2Hxt41g.js → sidecar-proxy-error-Dty4zmN7.js} +0 -0
  76. /package/dist/{sse-parser-CUfurwcm.js → sse-parser-DmO5gP6u.js} +0 -0
  77. /package/dist/{utils-DB8DnUCU.js → utils-vaFoyyiO.js} +0 -0
@@ -1,1590 +0,0 @@
1
- import { n as BACKEND_TYPE } from "./backend-types-CLvdSX8V.js";
2
- import { z } from "zod";
3
- import { agentProfileJsonSchema, agentProfileSchema as agentProfileSchema$1 } from "@tangle-network/agent-interface";
4
- import "@tangle-network/agent-interface/harness-capabilities";
5
- //#region ../../../packages/cli-agent-registry/dist/native-session-contracts-DjpjXEfd.mjs
6
- /** The CLI version infra/nix ships for each registered harness. */
7
- const HARNESS_CLI_VERSIONS = {
8
- "claude-code": "2.1.310",
9
- codex: "0.164.0",
10
- opencode: "1.19.4",
11
- pi: "1.4.0",
12
- "kimi-code": "1.49.0",
13
- "factory-droids": "0.249.0",
14
- amp: "0.0.1793025586-g9211b5",
15
- prime: "0.10.1",
16
- hermes: "0.22.5",
17
- forge: "2.14.0",
18
- openclaw: "2026.10.7",
19
- acp: "claude-agent-acp 0.97.0; codex-acp 0.16.0; gemini-cli 0.65.0"
20
- };
21
- const CLAUDE_PROJECTS = {
22
- root: ".claude/projects",
23
- files: ["*/{id}.jsonl", "*/{id}/subagents/**/*.jsonl"],
24
- write: "jsonl-append",
25
- shared: false,
26
- format: "claude-code.projects-jsonl"
27
- };
28
- const CODEX_ROLLOUTS = {
29
- root: ".codex/sessions",
30
- files: ["*/*/*/rollout-*-{id}.jsonl"],
31
- write: "jsonl-append",
32
- shared: false,
33
- format: "codex.rollout-jsonl"
34
- };
35
- /**
36
- * Rollouts codex moved out of `sessions/` when a thread was archived: the same
37
- * transcript, flat under `archived_sessions/`. Without it an archived
38
- * session is no store's, so no copy, capture or export carries it.
39
- */
40
- const CODEX_ARCHIVED_ROLLOUTS = {
41
- root: ".codex/archived_sessions",
42
- files: ["rollout-*-{id}.jsonl"],
43
- write: "jsonl-append",
44
- shared: false,
45
- format: "codex.rollout-jsonl"
46
- };
47
- const GEMINI_CHATS = {
48
- root: ".gemini/tmp",
49
- files: ["*/chats/session-*{id}*.json"],
50
- write: "json-rewrite",
51
- shared: false,
52
- format: "gemini.chat-json"
53
- };
54
- const KIMI_SESSIONS = {
55
- root: ".kimi/sessions",
56
- files: ["*/{id}/**", "*/{id}.jsonl"],
57
- write: "jsonl-append",
58
- shared: false,
59
- format: "kimi.session-dir"
60
- };
61
- const HERMES_STATE = {
62
- root: ".hermes",
63
- files: [
64
- "state.db",
65
- "state.db-wal",
66
- "state.db-shm"
67
- ],
68
- write: "sqlite-wal",
69
- shared: true,
70
- format: "hermes.state-sqlite"
71
- };
72
- var acp_default = {
73
- session: {
74
- kind: "native",
75
- processProbe: {
76
- versionCommand: `set -eu
77
- separator=''
78
- for entry in claude-agent-acp:claude-agent-acp codex-acp:codex-acp gemini-cli:gemini; do
79
- package=\${entry%%:*}
80
- binary=\${entry#*:}
81
- executable=$(readlink -f "$(command -v "$binary")")
82
- case "$executable" in /nix/store/*-"$package"-*/bin/"$binary") ;; *) exit 1 ;; esac
83
- store=\${executable#/nix/store/}
84
- derivation=\${store%%/*}
85
- version=\${derivation#*-"$package"-}
86
- test -n "$version"
87
- printf '%s%s %s' "$separator" "$package" "$version"
88
- separator='; '
89
- done
90
- printf '\\n'`,
91
- kill: ["-f", "[h]ermes.* acp( |$)"]
92
- },
93
- contract: {
94
- version: 1,
95
- stores: [
96
- CLAUDE_PROJECTS,
97
- CODEX_ROLLOUTS,
98
- GEMINI_CHATS,
99
- KIMI_SESSIONS,
100
- HERMES_STATE
101
- ],
102
- identity: {
103
- kind: "api-created",
104
- call: "acp session/new"
105
- },
106
- resume: { kind: "api" },
107
- forbiddenArgs: [],
108
- storeEnv: {},
109
- evidence: {
110
- servedModel: "session-record",
111
- usage: "per-response",
112
- endingError: "none"
113
- },
114
- cliVersion: HARNESS_CLI_VERSIONS.acp
115
- },
116
- defect: {
117
- issue: "#10096",
118
- reason: "contract is declared per sub-agent; gemini needs a mock dialect"
119
- }
120
- },
121
- config: {
122
- kind: "model",
123
- providerRequiresModel: true,
124
- keySources: [
125
- "managed",
126
- "api-key",
127
- "api-key-env",
128
- "cli-auth"
129
- ],
130
- baseUrl: "caller-or-managed",
131
- modelWire: "openai-compat",
132
- envVars: {
133
- apiKey: "OPENCODE_MODEL_API_KEY",
134
- model: "TANGLE_ROUTER_MODEL",
135
- baseUrl: "TANGLE_ROUTER_BASE_URL",
136
- authFiles: "ACP_AUTH_FILES_JSON"
137
- }
138
- },
139
- lifecycle: {
140
- runtime: void 0,
141
- coldCreate: { kind: "required" },
142
- warmClaim: { kind: "required" },
143
- parkResume: { kind: "required" },
144
- branchChild: { kind: "required" },
145
- killResume: { kind: "required" }
146
- }
147
- };
148
- var amp_default = {
149
- session: {
150
- kind: "native",
151
- processProbe: {
152
- versionCommand: "amp --version",
153
- kill: ["-x", "amp"]
154
- },
155
- contract: {
156
- version: 1,
157
- stores: [{
158
- root: ".local/share/amp/threads",
159
- files: ["{id}.json"],
160
- write: "json-rewrite",
161
- shared: false,
162
- format: "amp.thread-json"
163
- }],
164
- identity: {
165
- kind: "first-event",
166
- event: "thread",
167
- deadlineMs: 6e4
168
- },
169
- resume: {
170
- kind: "args",
171
- args: [
172
- "threads",
173
- "continue",
174
- "{id}"
175
- ]
176
- },
177
- forbiddenArgs: [],
178
- storeEnv: { XDG_DATA_HOME: ".local/share" },
179
- evidence: {
180
- servedModel: "session-record",
181
- usage: "per-response",
182
- endingError: "none"
183
- },
184
- cliVersion: HARNESS_CLI_VERSIONS.amp
185
- },
186
- defect: {
187
- issue: "#10096",
188
- reason: "threads live on ampcode.com; neither a local copy nor a mock-routable model is proven"
189
- }
190
- },
191
- config: {
192
- kind: "model",
193
- providerRequiresModel: true,
194
- keySources: [
195
- "api-key",
196
- "api-key-env",
197
- "cli-auth"
198
- ],
199
- baseUrl: "vendor-only",
200
- modelWire: "openai-compat",
201
- envVars: {
202
- apiKey: "AMP_API_KEY",
203
- model: "AMP_MODEL_NAME",
204
- authMode: "AMP_AUTH_MODE",
205
- authFiles: "AMP_AUTH_FILES_JSON"
206
- }
207
- },
208
- lifecycle: {
209
- runtime: void 0,
210
- coldCreate: { kind: "required" },
211
- warmClaim: { kind: "required" },
212
- parkResume: { kind: "required" },
213
- branchChild: { kind: "required" },
214
- killResume: { kind: "required" }
215
- }
216
- };
217
- var claude_code_default = {
218
- session: {
219
- kind: "native",
220
- processProbe: {
221
- versionCommand: "claude --version",
222
- kill: ["-x", "claude"]
223
- },
224
- contract: {
225
- version: 1,
226
- stores: [CLAUDE_PROJECTS],
227
- identity: {
228
- kind: "pre-minted",
229
- args: ["--session-id", "{id}"]
230
- },
231
- resume: {
232
- kind: "args",
233
- args: ["--resume", "{id}"]
234
- },
235
- forbiddenArgs: ["--no-session-persistence", "--fork-session"],
236
- storeEnv: { CLAUDE_CONFIG_DIR: ".claude" },
237
- evidence: {
238
- servedModel: "provider-response",
239
- usage: "per-response",
240
- endingError: "session-record"
241
- },
242
- cliVersion: HARNESS_CLI_VERSIONS["claude-code"]
243
- },
244
- defect: null
245
- },
246
- config: {
247
- kind: "model",
248
- providerRequiresModel: true,
249
- assertions: [
250
- "managed-full-ladder",
251
- "operator-model-first",
252
- "named-model-exact"
253
- ],
254
- keySources: [
255
- "managed",
256
- "api-key",
257
- "api-key-env",
258
- "cli-auth"
259
- ],
260
- baseUrl: "caller-or-managed",
261
- modelWire: "anthropic-messages",
262
- envVars: {
263
- apiKey: "ANTHROPIC_API_KEY",
264
- model: "CLAUDE_CODE_MODEL_NAME",
265
- authMode: "CLAUDE_CODE_AUTH_MODE",
266
- authFiles: "CLAUDE_CODE_AUTH_FILES_JSON",
267
- oauthToken: "CLAUDE_CODE_OAUTH_TOKEN",
268
- baseUrl: "ANTHROPIC_BASE_URL"
269
- }
270
- },
271
- lifecycle: {
272
- runtime: {},
273
- coldCreate: { kind: "required" },
274
- warmClaim: { kind: "required" },
275
- parkResume: { kind: "required" },
276
- branchChild: { kind: "required" },
277
- killResume: { kind: "required" }
278
- }
279
- };
280
- var cli_base_default = {
281
- session: {
282
- kind: "no-agent",
283
- reason: "This backend runs no agent process"
284
- },
285
- config: {
286
- kind: "no-agent",
287
- envVars: {},
288
- reason: "This backend accepts no model or provider"
289
- },
290
- lifecycle: {
291
- runtime: void 0,
292
- coldCreate: {
293
- kind: "unsupported",
294
- reason: "This backend runs no agent turn"
295
- },
296
- warmClaim: {
297
- kind: "unsupported",
298
- reason: "This backend runs no agent turn"
299
- },
300
- parkResume: {
301
- kind: "unsupported",
302
- reason: "This backend runs no agent turn"
303
- },
304
- branchChild: {
305
- kind: "unsupported",
306
- reason: "This backend runs no agent turn"
307
- },
308
- killResume: {
309
- kind: "unsupported",
310
- reason: "The backend exposes no resumable native session"
311
- }
312
- }
313
- };
314
- var codex_default = {
315
- session: {
316
- kind: "native",
317
- processProbe: {
318
- versionCommand: "codex --version",
319
- kill: ["-f", "bin/[c]odex( |$)"]
320
- },
321
- contract: {
322
- version: 1,
323
- stores: [CODEX_ROLLOUTS, CODEX_ARCHIVED_ROLLOUTS],
324
- identity: {
325
- kind: "first-event",
326
- event: "thread.started",
327
- deadlineMs: 3e4
328
- },
329
- resume: {
330
- kind: "args",
331
- args: [
332
- "exec",
333
- "resume",
334
- "{id}"
335
- ]
336
- },
337
- forbiddenArgs: ["--ephemeral"],
338
- storeEnv: { CODEX_HOME: ".codex" },
339
- evidence: {
340
- servedModel: "turn-context",
341
- usage: "cumulative",
342
- endingError: "session-record"
343
- },
344
- cliVersion: HARNESS_CLI_VERSIONS.codex
345
- },
346
- defect: null
347
- },
348
- config: {
349
- kind: "model",
350
- providerRequiresModel: true,
351
- assertions: [
352
- "managed-full-ladder",
353
- "operator-model-first",
354
- "named-model-exact",
355
- "responses-config-model-id"
356
- ],
357
- keySources: [
358
- "managed",
359
- "api-key",
360
- "api-key-env",
361
- "cli-auth"
362
- ],
363
- baseUrl: "caller-or-managed",
364
- modelWire: "openai-responses",
365
- envVars: {
366
- apiKey: "OPENAI_API_KEY",
367
- model: "CODEX_MODEL_NAME",
368
- authMode: "CODEX_AUTH_MODE",
369
- authFiles: "CODEX_AUTH_FILES_JSON",
370
- baseUrl: "OPENAI_BASE_URL"
371
- }
372
- },
373
- lifecycle: {
374
- runtime: void 0,
375
- coldCreate: { kind: "required" },
376
- warmClaim: { kind: "required" },
377
- parkResume: { kind: "required" },
378
- branchChild: { kind: "required" },
379
- killResume: { kind: "required" }
380
- }
381
- };
382
- var cursor_default = {
383
- session: {
384
- kind: "unsupported",
385
- defect: {
386
- issue: "#10096",
387
- reason: "runs the Cursor SDK in process; the cloud runtime stores the session remotely and model calls cannot be mocked"
388
- }
389
- },
390
- config: {
391
- kind: "model",
392
- providerRequiresModel: true,
393
- keySources: ["api-key", "api-key-env"],
394
- baseUrl: "vendor-only",
395
- modelWire: "openai-compat",
396
- envVars: {
397
- apiKey: "CURSOR_API_KEY",
398
- model: "CURSOR_MODEL_NAME"
399
- }
400
- },
401
- lifecycle: {
402
- runtime: void 0,
403
- coldCreate: { kind: "required" },
404
- warmClaim: { kind: "required" },
405
- parkResume: { kind: "required" },
406
- branchChild: { kind: "required" },
407
- killResume: {
408
- kind: "unsupported",
409
- reason: "The backend exposes no resumable native session"
410
- }
411
- }
412
- };
413
- var factory_droids_default = {
414
- session: {
415
- kind: "native",
416
- processProbe: {
417
- versionCommand: "droid --version",
418
- kill: ["-x", "droid"]
419
- },
420
- contract: {
421
- version: 1,
422
- stores: [{
423
- root: ".factory/sessions",
424
- files: ["*/{id}.jsonl"],
425
- write: "jsonl-append",
426
- shared: false,
427
- format: "factory.session-jsonl"
428
- }, {
429
- root: ".factory/sessions",
430
- files: ["*/{id}.settings.json"],
431
- write: "json-rewrite",
432
- shared: false,
433
- format: "factory.session-jsonl"
434
- }],
435
- identity: {
436
- kind: "first-event",
437
- event: "session_id",
438
- deadlineMs: 6e4
439
- },
440
- resume: {
441
- kind: "args",
442
- args: ["--session-id", "{id}"]
443
- },
444
- forbiddenArgs: [],
445
- storeEnv: {},
446
- evidence: {
447
- servedModel: "turn-context",
448
- usage: "session-total",
449
- endingError: "none"
450
- },
451
- cliVersion: HARNESS_CLI_VERSIONS["factory-droids"]
452
- },
453
- defect: {
454
- issue: "#10096",
455
- reason: "droid 0.232.0 resumes with --session-id only after it fetches the session from api.factory.ai, and the reader reads no usage, model or ending error from the session; the other checks pass (2026-10-05)"
456
- }
457
- },
458
- config: {
459
- kind: "model",
460
- providerRequiresModel: true,
461
- keySources: [
462
- "managed",
463
- "api-key",
464
- "api-key-env"
465
- ],
466
- baseUrl: "caller-or-managed",
467
- modelWire: "openai-compat",
468
- envVars: {
469
- apiKey: "FACTORY_API_KEY",
470
- model: "FACTORY_DROIDS_MODEL_NAME"
471
- }
472
- },
473
- lifecycle: {
474
- runtime: void 0,
475
- coldCreate: { kind: "required" },
476
- warmClaim: { kind: "required" },
477
- parkResume: { kind: "required" },
478
- branchChild: { kind: "required" },
479
- killResume: { kind: "required" }
480
- }
481
- };
482
- var forge_default = {
483
- session: {
484
- kind: "native",
485
- processProbe: {
486
- versionCommand: "forgecode --version",
487
- kill: ["-x", "forgecode"]
488
- },
489
- contract: {
490
- version: 1,
491
- stores: [{
492
- root: ".forge",
493
- files: [
494
- ".forge.db",
495
- ".forge.db-wal",
496
- ".forge.db-shm"
497
- ],
498
- write: "sqlite-wal",
499
- shared: true,
500
- format: "forge.sqlite"
501
- }],
502
- identity: {
503
- kind: "first-event",
504
- event: "conversation",
505
- deadlineMs: 6e4
506
- },
507
- resume: {
508
- kind: "args",
509
- args: ["--conversation-id", "{id}"]
510
- },
511
- forbiddenArgs: [],
512
- storeEnv: {},
513
- evidence: {
514
- servedModel: "session-record",
515
- usage: "per-response",
516
- endingError: "none"
517
- },
518
- cliVersion: HARNESS_CLI_VERSIONS.forge
519
- },
520
- defect: {
521
- issue: "#10096",
522
- reason: "needs a SQLite-consistent capture and a .forge.db reader"
523
- }
524
- },
525
- config: {
526
- kind: "model",
527
- providerRequiresModel: true,
528
- keySources: [
529
- "managed",
530
- "api-key",
531
- "api-key-env",
532
- "cli-auth"
533
- ],
534
- baseUrl: "caller-or-managed",
535
- modelWire: "openai-compat",
536
- envVars: {
537
- apiKey: "FORGE_API_KEY",
538
- model: "FORGE_MODEL_ID",
539
- authMode: "FORGE_AUTH_MODE",
540
- authFiles: "FORGE_AUTH_FILES_JSON",
541
- extras: {
542
- FORGE_SESSION__PROVIDER_ID: { parser: "string" },
543
- FORGE_SESSION__MODEL_ID: { parser: "string" },
544
- FORGE_AGENT_ID: { parser: "string" }
545
- }
546
- }
547
- },
548
- lifecycle: {
549
- runtime: void 0,
550
- coldCreate: { kind: "required" },
551
- warmClaim: { kind: "required" },
552
- parkResume: { kind: "required" },
553
- branchChild: { kind: "required" },
554
- killResume: { kind: "required" }
555
- }
556
- };
557
- var hermes_default = {
558
- session: {
559
- kind: "native",
560
- processProbe: {
561
- versionCommand: "hermes --version",
562
- kill: ["-f", "(^|/)[h]ermes( |$)"]
563
- },
564
- contract: {
565
- version: 1,
566
- stores: [HERMES_STATE],
567
- identity: {
568
- kind: "first-event",
569
- event: "session_id",
570
- deadlineMs: 6e4
571
- },
572
- resume: {
573
- kind: "args",
574
- args: ["--resume", "{id}"]
575
- },
576
- forbiddenArgs: [],
577
- storeEnv: { HERMES_HOME: ".hermes" },
578
- evidence: {
579
- servedModel: "session-record",
580
- usage: "session-total",
581
- endingError: "none"
582
- },
583
- cliVersion: HARNESS_CLI_VERSIONS.hermes
584
- },
585
- defect: {
586
- issue: "#10096",
587
- reason: "HERMES_HOME lives under the workspace, and the session id arrives on stderr after exit"
588
- }
589
- },
590
- config: {
591
- kind: "model",
592
- providerRequiresModel: true,
593
- keySources: [
594
- "managed",
595
- "api-key",
596
- "api-key-env",
597
- "cli-auth"
598
- ],
599
- baseUrl: "caller-or-managed",
600
- modelWire: "openai-compat",
601
- envVars: {
602
- apiKey: "HERMES_API_KEY",
603
- model: "HERMES_MODEL_NAME",
604
- authMode: "HERMES_AUTH_MODE",
605
- authFiles: "HERMES_AUTH_FILES_JSON",
606
- baseUrl: "HERMES_BASE_URL",
607
- extras: { HERMES_INFERENCE_PROVIDER: { parser: "string" } }
608
- }
609
- },
610
- lifecycle: {
611
- runtime: void 0,
612
- coldCreate: { kind: "required" },
613
- warmClaim: { kind: "required" },
614
- parkResume: { kind: "required" },
615
- branchChild: { kind: "required" },
616
- killResume: { kind: "required" }
617
- }
618
- };
619
- var kimi_code_default = {
620
- session: {
621
- kind: "native",
622
- processProbe: {
623
- versionCommand: "kimi --version",
624
- kill: ["-f", "^[K]imi Code"]
625
- },
626
- contract: {
627
- version: 1,
628
- stores: [KIMI_SESSIONS],
629
- identity: {
630
- kind: "pre-minted",
631
- args: ["--session", "{id}"]
632
- },
633
- resume: {
634
- kind: "args",
635
- args: ["--session", "{id}"]
636
- },
637
- forbiddenArgs: [],
638
- storeEnv: {},
639
- evidence: {
640
- servedModel: "session-record",
641
- usage: "per-response",
642
- endingError: "none"
643
- },
644
- cliVersion: HARNESS_CLI_VERSIONS["kimi-code"]
645
- },
646
- defect: {
647
- issue: "#10096",
648
- reason: "kimi-cli 1.49.0 records no model id, served or requested, in its session files, and the reader reads the ending HTTP 500 as aborted; the other checks pass (2026-10-05)"
649
- }
650
- },
651
- config: {
652
- kind: "model",
653
- providerRequiresModel: true,
654
- assertions: ["moonshot-provider-lock"],
655
- keySources: [
656
- "managed",
657
- "api-key",
658
- "api-key-env",
659
- "cli-auth"
660
- ],
661
- baseUrl: "caller-or-managed",
662
- modelWire: "openai-compat",
663
- envVars: {
664
- apiKey: "MOONSHOT_API_KEY",
665
- model: "KIMI_CODE_MODEL_NAME",
666
- authMode: "KIMI_CODE_AUTH_MODE",
667
- authFiles: "KIMI_CODE_AUTH_FILES_JSON",
668
- extras: { OPENAI_BASE_URL: { parser: "string" } }
669
- }
670
- },
671
- lifecycle: {
672
- runtime: { warmRetention: {
673
- envVar: "AGENT_INTERNAL_KIMI_WARM_SERVER",
674
- enabledByDefault: false
675
- } },
676
- coldCreate: { kind: "required" },
677
- warmClaim: { kind: "required" },
678
- parkResume: { kind: "required" },
679
- branchChild: { kind: "required" },
680
- killResume: { kind: "required" }
681
- }
682
- };
683
- var nanoclaw_default = {
684
- session: {
685
- kind: "unsupported",
686
- defect: {
687
- issue: "#10096",
688
- reason: "runs chat.ts against a NanoClaw daemon over a Unix socket: no session id, no resume, and the store belongs to the daemon"
689
- }
690
- },
691
- config: {
692
- kind: "model",
693
- providerRequiresModel: true,
694
- keySources: [
695
- "managed",
696
- "api-key",
697
- "api-key-env"
698
- ],
699
- baseUrl: "caller-or-managed",
700
- modelWire: "openai-compat",
701
- envVars: {
702
- apiKey: "OPENCODE_MODEL_API_KEY",
703
- model: "TANGLE_ROUTER_MODEL",
704
- authMode: "NANOCLAW_AUTH_MODE",
705
- baseUrl: "TANGLE_ROUTER_BASE_URL",
706
- extras: {
707
- NANOCLAW_PROJECT_ROOT: { parser: "string" },
708
- NANOCLAW_NATIVE_CREDENTIALS: { parser: "string" },
709
- OPENCODE_MODEL_PROVIDER: {
710
- parser: "string",
711
- role: "provider"
712
- }
713
- }
714
- }
715
- },
716
- lifecycle: {
717
- runtime: void 0,
718
- coldCreate: { kind: "required" },
719
- warmClaim: { kind: "required" },
720
- parkResume: { kind: "required" },
721
- branchChild: { kind: "required" },
722
- killResume: {
723
- kind: "unsupported",
724
- reason: "The backend exposes no resumable native session"
725
- }
726
- }
727
- };
728
- var openclaw_default = {
729
- session: {
730
- kind: "native",
731
- processProbe: {
732
- versionCommand: "openclaw --version",
733
- kill: ["-f", "[o]penclaw(\\.mjs)?( |$)"]
734
- },
735
- contract: {
736
- version: 1,
737
- stores: [{
738
- root: ".openclaw/agents",
739
- files: ["**/{id}.jsonl"],
740
- write: "jsonl-append",
741
- shared: false,
742
- format: "openclaw.session-jsonl"
743
- }],
744
- identity: {
745
- kind: "first-event",
746
- event: "session",
747
- deadlineMs: 6e4
748
- },
749
- resume: {
750
- kind: "args",
751
- args: ["--session-id", "{id}"]
752
- },
753
- forbiddenArgs: [],
754
- storeEnv: {},
755
- evidence: {
756
- servedModel: "session-record",
757
- usage: "per-response",
758
- endingError: "none"
759
- },
760
- cliVersion: HARNESS_CLI_VERSIONS.openclaw
761
- },
762
- defect: {
763
- issue: "#10096",
764
- reason: "config is pinned outside the runtime HOME; store layout unverified"
765
- }
766
- },
767
- config: {
768
- kind: "model",
769
- providerRequiresModel: true,
770
- keySources: [
771
- "managed",
772
- "api-key",
773
- "api-key-env",
774
- "cli-auth"
775
- ],
776
- baseUrl: "caller-or-managed",
777
- modelWire: "openai-compat",
778
- envVars: {
779
- apiKey: "OPENCODE_MODEL_API_KEY",
780
- model: "TANGLE_ROUTER_MODEL",
781
- baseUrl: "TANGLE_ROUTER_BASE_URL",
782
- authMode: "OPENCLAW_AUTH_MODE",
783
- authFiles: "OPENCLAW_AUTH_FILES_JSON"
784
- }
785
- },
786
- lifecycle: {
787
- runtime: void 0,
788
- coldCreate: { kind: "required" },
789
- warmClaim: { kind: "required" },
790
- parkResume: { kind: "required" },
791
- branchChild: { kind: "required" },
792
- killResume: { kind: "required" }
793
- }
794
- };
795
- const HARNESSES = {
796
- "claude-code": claude_code_default,
797
- codex: codex_default,
798
- opencode: {
799
- session: {
800
- kind: "native",
801
- processProbe: {
802
- versionCommand: "opencode --version",
803
- kill: ["-x", "opencode"]
804
- },
805
- contract: {
806
- version: 1,
807
- stores: [{
808
- root: ".local/share/opencode",
809
- files: [
810
- "opencode.db",
811
- "opencode.db-wal",
812
- "opencode.db-shm"
813
- ],
814
- write: "sqlite-wal",
815
- shared: true,
816
- format: "opencode.sqlite"
817
- }],
818
- identity: {
819
- kind: "first-event",
820
- event: "sessionID",
821
- deadlineMs: 3e5
822
- },
823
- resume: {
824
- kind: "args",
825
- args: ["--session", "{id}"]
826
- },
827
- forbiddenArgs: [],
828
- storeEnv: { XDG_DATA_HOME: ".local/share" },
829
- evidence: {
830
- servedModel: "turn-context",
831
- usage: "per-response",
832
- endingError: "session-record"
833
- },
834
- cliVersion: HARNESS_CLI_VERSIONS.opencode
835
- },
836
- defect: null
837
- },
838
- config: {
839
- kind: "model",
840
- providerRequiresModel: true,
841
- keySources: [
842
- "managed",
843
- "api-key",
844
- "api-key-env"
845
- ],
846
- baseUrl: "caller-or-managed",
847
- modelWire: "openai-compat",
848
- envVars: {
849
- apiKey: "OPENCODE_MODEL_API_KEY",
850
- model: "OPENCODE_MODEL_NAME",
851
- baseUrl: "OPENCODE_MODEL_BASE_URL",
852
- extras: {
853
- OPENCODE_MODEL_PROVIDER: {
854
- parser: "string",
855
- role: "provider"
856
- },
857
- OPENCODE_MODEL_MODE: {
858
- parser: "string",
859
- role: "mode"
860
- }
861
- }
862
- }
863
- },
864
- lifecycle: {
865
- runtime: {
866
- redactsHostEnv: true,
867
- supportsToolDisabledTurns: true
868
- },
869
- coldCreate: { kind: "required" },
870
- warmClaim: { kind: "required" },
871
- parkResume: { kind: "required" },
872
- branchChild: { kind: "required" },
873
- killResume: { kind: "required" }
874
- }
875
- },
876
- pi: {
877
- session: {
878
- kind: "native",
879
- processProbe: {
880
- versionCommand: "pi --version",
881
- kill: ["-x", "pi"]
882
- },
883
- contract: {
884
- version: 1,
885
- stores: [{
886
- root: ".pi/agent/sessions",
887
- files: ["**/*_{id}.jsonl"],
888
- write: "jsonl-append",
889
- shared: false,
890
- format: "pi.session-jsonl"
891
- }],
892
- identity: {
893
- kind: "pre-minted",
894
- args: ["--session-id", "{id}"]
895
- },
896
- resume: {
897
- kind: "args",
898
- args: ["--session", "{id}"]
899
- },
900
- forbiddenArgs: [
901
- "--no-session",
902
- "--fork",
903
- "--continue"
904
- ],
905
- storeEnv: {
906
- PI_CODING_AGENT_DIR: ".pi/agent",
907
- PI_CODING_AGENT_SESSION_DIR: ".pi/agent/sessions",
908
- "--session-dir": ".pi/agent/sessions"
909
- },
910
- evidence: {
911
- servedModel: "session-record",
912
- usage: "per-response",
913
- endingError: "session-record"
914
- },
915
- cliVersion: HARNESS_CLI_VERSIONS.pi
916
- },
917
- defect: null
918
- },
919
- config: {
920
- kind: "model",
921
- providerRequiresModel: true,
922
- keySources: [
923
- "managed",
924
- "api-key",
925
- "api-key-env",
926
- "cli-auth"
927
- ],
928
- baseUrl: "caller-or-managed",
929
- modelWire: "openai-compat",
930
- envVars: {
931
- apiKey: "OPENCODE_MODEL_API_KEY",
932
- model: "TANGLE_ROUTER_MODEL",
933
- baseUrl: "TANGLE_ROUTER_BASE_URL"
934
- }
935
- },
936
- lifecycle: {
937
- runtime: {},
938
- coldCreate: { kind: "required" },
939
- warmClaim: { kind: "required" },
940
- parkResume: { kind: "required" },
941
- branchChild: { kind: "required" },
942
- killResume: { kind: "required" }
943
- }
944
- },
945
- "kimi-code": kimi_code_default,
946
- "factory-droids": factory_droids_default,
947
- amp: amp_default,
948
- prime: {
949
- session: {
950
- kind: "native",
951
- processProbe: {
952
- versionCommand: "prime-agent --version",
953
- kill: ["-f", "[p]rime-agent"]
954
- },
955
- contract: {
956
- version: 1,
957
- stores: [{
958
- root: ".prime-provider/prime-agent-dirs",
959
- files: ["**/*_{id}.jsonl"],
960
- write: "jsonl-append",
961
- shared: false,
962
- format: "prime.session-jsonl"
963
- }],
964
- identity: {
965
- kind: "api-created",
966
- call: "acp session/new"
967
- },
968
- resume: { kind: "api" },
969
- forbiddenArgs: ["--no-session"],
970
- storeEnv: {},
971
- evidence: {
972
- servedModel: "session-record",
973
- usage: "per-response",
974
- endingError: "session-record"
975
- },
976
- cliVersion: HARNESS_CLI_VERSIONS.prime
977
- },
978
- defect: {
979
- issue: "#10096",
980
- reason: "agent dir lives under the workspace, outside the runtime HOME"
981
- }
982
- },
983
- config: {
984
- kind: "model",
985
- providerRequiresModel: true,
986
- keySources: [
987
- "managed",
988
- "api-key",
989
- "api-key-env"
990
- ],
991
- baseUrl: "caller-or-managed",
992
- modelWire: "openai-compat",
993
- envVars: {
994
- apiKey: "OPENCODE_MODEL_API_KEY",
995
- model: "TANGLE_ROUTER_MODEL",
996
- baseUrl: "TANGLE_ROUTER_BASE_URL"
997
- }
998
- },
999
- lifecycle: {
1000
- runtime: void 0,
1001
- coldCreate: { kind: "required" },
1002
- warmClaim: { kind: "required" },
1003
- parkResume: { kind: "required" },
1004
- branchChild: { kind: "required" },
1005
- killResume: { kind: "required" }
1006
- }
1007
- },
1008
- hermes: hermes_default,
1009
- forge: forge_default,
1010
- openclaw: openclaw_default,
1011
- nanoclaw: nanoclaw_default,
1012
- acp: acp_default,
1013
- cursor: cursor_default,
1014
- "cli-base": cli_base_default
1015
- };
1016
- /**
1017
- * The native session projection of the per-harness declarations in tests/harness/contracts. Each entry is
1018
- * proven by a conformance receipt (tests/harness/receipts) for
1019
- * its pinned CLI version, or is listed in HARNESS_CONFORMANCE_PENDING.
1020
- *
1021
- * CLI versions are the pins in infra/nix (agent-clis.json and flake.nix),
1022
- * generated into harness-cli-versions.ts by the bump. The registry test
1023
- * tests/harness-session-contract.test.ts fails when a pin, a contract or an
1024
- * adapter's source moves without a new receipt.
1025
- */
1026
- const NATIVE_SESSION_CONTRACTS = {
1027
- "claude-code": HARNESSES["claude-code"].session.contract,
1028
- codex: HARNESSES["codex"].session.contract,
1029
- opencode: HARNESSES["opencode"].session.contract,
1030
- pi: HARNESSES["pi"].session.contract,
1031
- "kimi-code": HARNESSES["kimi-code"].session.contract,
1032
- "factory-droids": HARNESSES["factory-droids"].session.contract,
1033
- amp: HARNESSES["amp"].session.contract,
1034
- prime: HARNESSES["prime"].session.contract,
1035
- hermes: HARNESSES["hermes"].session.contract,
1036
- forge: HARNESSES["forge"].session.contract,
1037
- openclaw: HARNESSES["openclaw"].session.contract,
1038
- acp: HARNESSES["acp"].session.contract
1039
- };
1040
- HARNESSES["kimi-code"].session.defect.reason, HARNESSES["factory-droids"].session.defect.reason, HARNESSES["amp"].session.defect.reason, HARNESSES["prime"].session.defect.reason, HARNESSES["hermes"].session.defect.reason, HARNESSES["forge"].session.defect.reason, HARNESSES["openclaw"].session.defect.reason, HARNESSES["acp"].session.defect.reason;
1041
- HARNESSES["nanoclaw"].session.defect.reason, HARNESSES["cursor"].session.defect.reason;
1042
- //#endregion
1043
- //#region ../../../packages/cli-agent-registry/dist/specs-BTESVUkS.mjs
1044
- z.globalRegistry.add(agentProfileSchema$1, {
1045
- id: "AgentProfile",
1046
- ...agentProfileJsonSchema
1047
- });
1048
- const CLI_AGENT_SPECS = [
1049
- {
1050
- name: BACKEND_TYPE.OPENCODE,
1051
- nativeSession: NATIVE_SESSION_CONTRACTS.opencode,
1052
- messageStorageDir: ".opencode",
1053
- cliDirLayout: {
1054
- sessionData: ["snapshot/**"],
1055
- configAllow: ["bin/**"]
1056
- },
1057
- displayName: "OpenCode Agent",
1058
- description: "OpenCode CLI coding agent with native sessions, profiles, tools, and MCP.",
1059
- envVars: HARNESSES["opencode"].config.envVars,
1060
- capabilities: {
1061
- streaming: true,
1062
- toolUse: true,
1063
- reasoning: true,
1064
- multimodal: true,
1065
- contextWindow: 2e5,
1066
- mcp: true,
1067
- runtimeAttachments: { mcp: true },
1068
- sessions: true,
1069
- configurable: true,
1070
- interactions: [
1071
- "permission",
1072
- "question",
1073
- "plan"
1074
- ],
1075
- imageInput: true
1076
- },
1077
- hostPassthroughEnvVars: [
1078
- "OPENCODE_MODEL_MODE",
1079
- "OPENCODE_CODEX_PLUGIN_VERSION",
1080
- "OPENCODE_EXPERIMENTAL_NATIVE_LLM"
1081
- ],
1082
- interactiveSeededPrompt: true,
1083
- builtinTools: [
1084
- {
1085
- id: "apply_patch",
1086
- name: "Apply Patch",
1087
- description: "Apply a unified-diff patch to files"
1088
- },
1089
- {
1090
- id: "bash",
1091
- name: "Bash",
1092
- description: "Execute bash commands"
1093
- },
1094
- {
1095
- id: "codesearch",
1096
- name: "Code Search",
1097
- description: "Search code across the workspace"
1098
- },
1099
- {
1100
- id: "edit",
1101
- name: "Edit",
1102
- description: "Edit a file with string replacement"
1103
- },
1104
- {
1105
- id: "glob",
1106
- name: "Glob",
1107
- description: "Find files by glob pattern"
1108
- },
1109
- {
1110
- id: "grep",
1111
- name: "Grep",
1112
- description: "Search file contents using regular expressions"
1113
- },
1114
- {
1115
- id: "question",
1116
- name: "Question",
1117
- description: "Ask the user a question and wait for the answer"
1118
- },
1119
- {
1120
- id: "read",
1121
- name: "Read",
1122
- description: "Read file contents"
1123
- },
1124
- {
1125
- id: "skill",
1126
- name: "Skill",
1127
- description: "Invoke an installed skill"
1128
- },
1129
- {
1130
- id: "task",
1131
- name: "Task",
1132
- description: "Delegate a task to a subagent"
1133
- },
1134
- {
1135
- id: "todowrite",
1136
- name: "Todo Write",
1137
- description: "Maintain the turn's todo list"
1138
- },
1139
- {
1140
- id: "webfetch",
1141
- name: "Webfetch",
1142
- description: "Fetch and read web content"
1143
- },
1144
- {
1145
- id: "websearch",
1146
- name: "Websearch",
1147
- description: "Search the web"
1148
- },
1149
- {
1150
- id: "write",
1151
- name: "Write",
1152
- description: "Write content to a file"
1153
- }
1154
- ],
1155
- runtime: HARNESSES["opencode"].lifecycle.runtime,
1156
- cliAuthHome: { kind: "inherit-home" },
1157
- hasCliAuth: false
1158
- },
1159
- {
1160
- name: BACKEND_TYPE.CLAUDE_CODE,
1161
- nativeSession: NATIVE_SESSION_CONTRACTS["claude-code"],
1162
- runtime: HARNESSES["claude-code"].lifecycle.runtime,
1163
- messageStorageDir: ".claude-code",
1164
- cliDirLayout: {
1165
- sessionData: [
1166
- "plans/**",
1167
- "file-history/**",
1168
- "debug/**",
1169
- "projects/*/*/subagents/**/*.meta.json",
1170
- "projects/*/*/tool-results/**"
1171
- ],
1172
- configAllow: [
1173
- ".last-cleanup",
1174
- "policy-limits.json*",
1175
- "remote-settings.json",
1176
- "skills/**"
1177
- ],
1178
- credential: [
1179
- "backups/**",
1180
- "session-env/**",
1181
- "shell-snapshots/**",
1182
- "sessions/**"
1183
- ]
1184
- },
1185
- displayName: "Claude Code",
1186
- description: "Anthropic Claude Code CLI-based agent backend.",
1187
- envVars: HARNESSES["claude-code"].config.envVars,
1188
- modelWire: HARNESSES["claude-code"].config.modelWire,
1189
- capabilities: {
1190
- streaming: true,
1191
- toolUse: true,
1192
- reasoning: true,
1193
- multimodal: true,
1194
- contextWindow: 2e5,
1195
- mcp: true,
1196
- runtimeAttachments: { mcp: true },
1197
- sessions: true,
1198
- configurable: true,
1199
- interactions: [
1200
- "permission",
1201
- "question",
1202
- "plan"
1203
- ],
1204
- imageInput: true
1205
- },
1206
- securityCapabilities: [
1207
- "SYS_PTRACE",
1208
- "SETUID",
1209
- "SETGID",
1210
- "DAC_OVERRIDE",
1211
- "CHOWN",
1212
- "FOWNER"
1213
- ],
1214
- interactiveSeededPrompt: true,
1215
- cliAuthHome: {
1216
- kind: "agent-home",
1217
- uid: 1e3,
1218
- home: "/home/agent"
1219
- },
1220
- hasCliAuth: true,
1221
- byoOAuth: true
1222
- },
1223
- {
1224
- name: BACKEND_TYPE.KIMI_CODE,
1225
- nativeSession: NATIVE_SESSION_CONTRACTS["kimi-code"],
1226
- runtime: HARNESSES["kimi-code"].lifecycle.runtime,
1227
- messageStorageDir: ".kimi-code",
1228
- displayName: "Kimi Code",
1229
- description: "Moonshot AI Kimi Code CLI — headless non-interactive mode via `kimi --print --output-format stream-json --prompt ...`. Defaults to OAuth (Kimi Code subscription) with credentials materialized from the host-managed ~/.kimi/credentials/kimi-code.json; falls back to MOONSHOT_API_KEY when an apiKey is supplied.",
1230
- envVars: HARNESSES["kimi-code"].config.envVars,
1231
- capabilities: {
1232
- streaming: true,
1233
- toolUse: true,
1234
- reasoning: true,
1235
- multimodal: true,
1236
- contextWindow: 262144,
1237
- mcp: false,
1238
- runtimeAttachments: { mcp: true },
1239
- sessions: true,
1240
- configurable: true,
1241
- interactions: [],
1242
- imageInput: false
1243
- },
1244
- cliAuthHome: { kind: "inherit-home" },
1245
- hasCliAuth: true
1246
- },
1247
- {
1248
- name: BACKEND_TYPE.CODEX,
1249
- nativeSession: NATIVE_SESSION_CONTRACTS.codex,
1250
- messageStorageDir: ".codex",
1251
- cliDirLayout: { sessionData: [
1252
- "logs_*.sqlite*",
1253
- "goals_*.sqlite*",
1254
- "memories_*.sqlite*"
1255
- ] },
1256
- displayName: "Codex",
1257
- description: "OpenAI Codex CLI-based agent backend.",
1258
- envVars: HARNESSES["codex"].config.envVars,
1259
- modelWire: HARNESSES["codex"].config.modelWire,
1260
- capabilities: {
1261
- streaming: true,
1262
- toolUse: true,
1263
- reasoning: false,
1264
- multimodal: true,
1265
- contextWindow: 128e3,
1266
- mcp: false,
1267
- sessions: true,
1268
- configurable: false,
1269
- runtimeAttachments: { mcp: true },
1270
- interactions: [
1271
- "permission",
1272
- "question",
1273
- "plan"
1274
- ],
1275
- imageInput: true
1276
- },
1277
- interactiveSeededPrompt: true,
1278
- cliAuthHome: { kind: "inherit-home" },
1279
- hasCliAuth: true,
1280
- byoOAuth: true
1281
- },
1282
- {
1283
- name: BACKEND_TYPE.AMP,
1284
- nativeSession: NATIVE_SESSION_CONTRACTS.amp,
1285
- messageStorageDir: ".amp-sessions",
1286
- displayName: "AMP (Sourcegraph)",
1287
- description: "Sourcegraph AMP CLI-based agent backend.",
1288
- callerCredentialOnly: true,
1289
- envVars: HARNESSES["amp"].config.envVars,
1290
- capabilities: {
1291
- streaming: true,
1292
- toolUse: true,
1293
- reasoning: false,
1294
- multimodal: false,
1295
- contextWindow: 128e3,
1296
- mcp: false,
1297
- sessions: true,
1298
- configurable: false,
1299
- interactions: [],
1300
- imageInput: false
1301
- },
1302
- cliAuthHome: { kind: "inherit-home" },
1303
- hasCliAuth: true
1304
- },
1305
- {
1306
- name: BACKEND_TYPE.FACTORY_DROIDS,
1307
- nativeSession: NATIVE_SESSION_CONTRACTS["factory-droids"],
1308
- messageStorageDir: ".factory-droids",
1309
- displayName: "Factory Droids",
1310
- description: "Factory Droids CLI-based agent backend. A managed box runs its Tangle Router model as a droid custom model; a caller's FACTORY_API_KEY runs on the caller's Factory account.",
1311
- envVars: HARNESSES["factory-droids"].config.envVars,
1312
- capabilities: {
1313
- streaming: true,
1314
- toolUse: true,
1315
- reasoning: false,
1316
- multimodal: false,
1317
- contextWindow: 128e3,
1318
- mcp: false,
1319
- sessions: true,
1320
- configurable: false,
1321
- interactions: ["question"],
1322
- imageInput: false
1323
- },
1324
- cliAuthHome: { kind: "inherit-home" },
1325
- hasCliAuth: true
1326
- },
1327
- {
1328
- name: BACKEND_TYPE.PI,
1329
- nativeSession: NATIVE_SESSION_CONTRACTS.pi,
1330
- runtime: HARNESSES["pi"].lifecycle.runtime,
1331
- messageStorageDir: ".pi/agent",
1332
- displayName: "Pi",
1333
- description: "Pi CLI backend. Managed OpenAI-compatible model tuples use one private runtime HOME models.json and the shared Pi model schema.",
1334
- envVars: HARNESSES["pi"].config.envVars,
1335
- capabilities: {
1336
- streaming: true,
1337
- toolUse: true,
1338
- reasoning: true,
1339
- multimodal: false,
1340
- contextWindow: 128e3,
1341
- mcp: true,
1342
- sessions: true,
1343
- configurable: true,
1344
- interactions: ["permission"],
1345
- runtimeAttachments: { mcp: true },
1346
- imageInput: false
1347
- },
1348
- interactiveSeededPrompt: true,
1349
- cliAuthHome: { kind: "inherit-home" },
1350
- hasCliAuth: true
1351
- },
1352
- {
1353
- name: BACKEND_TYPE.PRIME,
1354
- nativeSession: NATIVE_SESSION_CONTRACTS.prime,
1355
- messageStorageDir: ".prime-provider",
1356
- displayName: "Prime Agent (PrimeIntellect)",
1357
- description: "PrimeIntellect-ai/prime-agent — IPython-first coding agent (pi hard fork, fork line 0.7.x) driven over its native ACP mode. Model tuple travels via backend.model into a per-session materialized models.json, never env; the adapter pins PRIME_AGENT_CODING_AGENT_DIR to an isolated per-session agent dir (fail-closed harness-state isolation).",
1358
- envVars: HARNESSES["prime"].config.envVars,
1359
- hostPassthroughEnvVars: ["PRIME_AGENT_INSTALL_UV", "PRIME_AGENT_KERNEL_PYTHON"],
1360
- capabilities: {
1361
- streaming: true,
1362
- toolUse: true,
1363
- reasoning: true,
1364
- multimodal: true,
1365
- contextWindow: 128e3,
1366
- mcp: false,
1367
- sessions: true,
1368
- configurable: true,
1369
- interactions: [],
1370
- imageInput: true
1371
- },
1372
- cliAuthHome: { kind: "inherit-home" },
1373
- hasCliAuth: false
1374
- },
1375
- {
1376
- name: BACKEND_TYPE.HERMES,
1377
- nativeSession: NATIVE_SESSION_CONTRACTS.hermes,
1378
- messageStorageDir: ".hermes-agent",
1379
- cliDirLayout: {
1380
- sessionData: ["cache/spillover/**", "cache/delegation/**"],
1381
- configAllow: ["config.yaml"]
1382
- },
1383
- displayName: "Hermes Agent (Nous Research)",
1384
- description: "Open-source self-improving CLI agent. Persistent memory and skills live in $HERMES_HOME (pinned to the per-session workspace mount, not the read-only in-box $HOME) across same-tenant snapshot resumes — the learning loop is the differentiator. Provider-pluggable; defaults to OpenRouter via Tangle Router.",
1385
- envVars: HARNESSES["hermes"].config.envVars,
1386
- capabilities: {
1387
- streaming: false,
1388
- toolUse: true,
1389
- reasoning: false,
1390
- multimodal: false,
1391
- contextWindow: 2e5,
1392
- mcp: true,
1393
- sessions: true,
1394
- configurable: true,
1395
- interactions: [],
1396
- imageInput: true
1397
- },
1398
- cliAuthHome: { kind: "inherit-home" },
1399
- hasCliAuth: true
1400
- },
1401
- {
1402
- name: BACKEND_TYPE.FORGE,
1403
- nativeSession: NATIVE_SESSION_CONTRACTS.forge,
1404
- messageStorageDir: ".forge-agent",
1405
- displayName: "Forge (forgecode.dev)",
1406
- description: "Rust-built multi-provider coding agent from tailcallhq/forgecode. Speaks anthropic/openai/openrouter/gemini/deepseek/kimi + local providers (ollama, lm_studio, llama_cpp). Credentials live in ~/.forge/.credentials.json, materialized via the standard authFiles pipeline — no interactive `forge provider login` required.",
1407
- envVars: HARNESSES["forge"].config.envVars,
1408
- capabilities: {
1409
- streaming: false,
1410
- toolUse: true,
1411
- reasoning: true,
1412
- multimodal: false,
1413
- contextWindow: 2e5,
1414
- mcp: true,
1415
- sessions: true,
1416
- configurable: true,
1417
- interactions: [],
1418
- imageInput: false
1419
- },
1420
- cliAuthHome: { kind: "inherit-home" },
1421
- hasCliAuth: true
1422
- },
1423
- {
1424
- name: BACKEND_TYPE.OPENCLAW,
1425
- nativeSession: NATIVE_SESSION_CONTRACTS.openclaw,
1426
- messageStorageDir: ".openclaw-agent",
1427
- cliDirLayout: { configAllow: ["openclaw.json"] },
1428
- displayName: "OpenClaw (Orchestrator)",
1429
- description: "Orchestrator-tier CLI agent that dispatches to underlying coding-agent CLIs (claude-cli, codex-cli, gemini-cli) via its built-in cliBackends plugin model. Use this when you want one entry point that intelligently routes tasks to the right coding harness.",
1430
- envVars: HARNESSES["openclaw"].config.envVars,
1431
- capabilities: {
1432
- streaming: false,
1433
- toolUse: true,
1434
- reasoning: true,
1435
- multimodal: true,
1436
- contextWindow: 2e5,
1437
- mcp: true,
1438
- sessions: true,
1439
- configurable: true,
1440
- interactions: [],
1441
- imageInput: false
1442
- },
1443
- cliAuthHome: { kind: "inherit-home" },
1444
- hasCliAuth: true
1445
- },
1446
- {
1447
- name: BACKEND_TYPE.NANOCLAW,
1448
- nativeSession: null,
1449
- messageStorageDir: ".nanoclaw-agent",
1450
- displayName: "NanoClaw",
1451
- description: "NanoClaw local socket bridge. Requires a running NanoClaw install and uses its `pnpm run chat` CLI channel; the adapter does not manage NanoClaw's Docker/service lifecycle.",
1452
- envVars: HARNESSES["nanoclaw"].config.envVars,
1453
- capabilities: {
1454
- streaming: false,
1455
- toolUse: true,
1456
- reasoning: true,
1457
- multimodal: false,
1458
- contextWindow: 2e5,
1459
- mcp: false,
1460
- sessions: true,
1461
- configurable: true,
1462
- interactions: [],
1463
- imageInput: false
1464
- },
1465
- cliAuthHome: { kind: "inherit-home" },
1466
- hasCliAuth: false
1467
- },
1468
- {
1469
- name: BACKEND_TYPE.ACP,
1470
- nativeSession: NATIVE_SESSION_CONTRACTS.acp,
1471
- messageStorageDir: ".acp-agent",
1472
- displayName: "ACP Bridge (multi-agent)",
1473
- description: "Generic Agent Client Protocol bridge — fronts any ACP-compliant agent binary (claude-agent-acp, codex-acp, gemini, openclaw acp, hermes acp). Pick the backing agent via config.subAgent; hermes runs on the box's Router model when none is named. One TypeScript adapter, many supported coding harnesses.",
1474
- envVars: HARNESSES["acp"].config.envVars,
1475
- capabilities: {
1476
- streaming: true,
1477
- toolUse: true,
1478
- reasoning: true,
1479
- multimodal: false,
1480
- contextWindow: 2e5,
1481
- mcp: false,
1482
- sessions: true,
1483
- configurable: true,
1484
- interactions: ["permission"],
1485
- imageInput: false
1486
- },
1487
- cliAuthHome: { kind: "inherit-home" },
1488
- hasCliAuth: true
1489
- },
1490
- {
1491
- name: BACKEND_TYPE.CURSOR,
1492
- nativeSession: null,
1493
- messageStorageDir: ".cursor-sdk-sessions",
1494
- displayName: "Cursor Agent SDK",
1495
- description: "Cursor Agent SDK backend. Runs Cursor's local agent against the sandbox workspace via @cursor/sdk, using CURSOR_API_KEY or backend.model.apiKey for authentication.",
1496
- callerCredentialOnly: true,
1497
- egressHosts: ["api2.cursor.sh", "api.cursor.com"],
1498
- envVars: HARNESSES["cursor"].config.envVars,
1499
- capabilities: {
1500
- streaming: true,
1501
- toolUse: true,
1502
- reasoning: true,
1503
- multimodal: true,
1504
- contextWindow: 2e5,
1505
- mcp: true,
1506
- sessions: true,
1507
- configurable: true,
1508
- interactions: [],
1509
- imageInput: true
1510
- },
1511
- cliAuthHome: { kind: "inherit-home" },
1512
- hasCliAuth: false
1513
- },
1514
- {
1515
- name: BACKEND_TYPE.CLI_BASE,
1516
- nativeSession: null,
1517
- displayName: "CLI Base (no agent)",
1518
- description: "Bare sandbox without an AI agent backend. Use when you want the workspace, tools, and SSH access but no LLM dispatch.",
1519
- envVars: HARNESSES["cli-base"].config.envVars,
1520
- capabilities: {
1521
- streaming: false,
1522
- toolUse: false,
1523
- reasoning: false,
1524
- multimodal: false,
1525
- contextWindow: 0,
1526
- mcp: false,
1527
- sessions: false,
1528
- configurable: false,
1529
- interactions: [],
1530
- imageInput: false
1531
- },
1532
- cliAuthHome: { kind: "inherit-home" },
1533
- hasCliAuth: false
1534
- }
1535
- ];
1536
- function getSpec(name) {
1537
- return CLI_AGENT_SPECS.find((spec) => spec.name === name);
1538
- }
1539
- //#endregion
1540
- //#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle.mjs
1541
- const DEFAULT_MODE = 384;
1542
- const AUTH_BUNDLE_PATHS = Object.freeze({
1543
- codex: ".codex/auth.json",
1544
- "claude-code": ".claude/.credentials.json"
1545
- });
1546
- /** Convert a native credential JSON bundle without reading host credentials. */
1547
- function materializeCliAuthBundle(backendType, rawBundle) {
1548
- if (backendType !== "codex" && backendType !== "claude-code") throw new Error("CLI auth bundle is not supported for the selected backend");
1549
- if (typeof rawBundle !== "string") throw new Error("CLI auth bundle must be a JSON object");
1550
- let value;
1551
- try {
1552
- value = JSON.parse(rawBundle);
1553
- } catch {
1554
- throw new Error("CLI auth bundle must be a JSON object");
1555
- }
1556
- if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("CLI auth bundle must be a JSON object");
1557
- return [{
1558
- path: AUTH_BUNDLE_PATHS[backendType],
1559
- content: rawBundle,
1560
- mode: DEFAULT_MODE
1561
- }];
1562
- }
1563
- const cliAuthReferenceSchema = z.object({
1564
- account: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9@._+-]{0,127}$/),
1565
- secretEnv: z.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/),
1566
- format: z.enum([
1567
- "token",
1568
- "bundle",
1569
- "files"
1570
- ])
1571
- }).strict();
1572
- z.array(z.object({
1573
- path: z.string().min(1).max(4096).refine((value) => !value.startsWith("/") && !/^[A-Za-z]:/.test(value) && !/[\\\0]/.test(value) && value.split("/").every((part) => part !== "" && part !== "." && part !== "..")),
1574
- content: z.string().max(1024 * 1024),
1575
- mode: z.number().int().min(0).max(448).refine((mode) => (mode & 63) === 0).optional()
1576
- }).strict()).min(1).max(128);
1577
- function assertCliAuthReferenceSupported(backendType, model) {
1578
- if (model.cliAuth === void 0) return void 0;
1579
- const parsedReference = cliAuthReferenceSchema.safeParse(model.cliAuth);
1580
- if (!parsedReference.success) throw new Error("Invalid native authentication reference");
1581
- const reference = parsedReference.data;
1582
- if (model.authMode === "api-key" || model.apiKey !== void 0 || model.apiKeyEnv !== void 0 || model.baseUrl !== void 0 || model.authFiles !== void 0) throw new Error("cliAuth cannot be combined with API credentials, baseUrl, or inline authFiles");
1583
- const spec = getSpec(backendType);
1584
- if (!spec?.hasCliAuth) throw new Error(`Native CLI authentication is unsupported by ${backendType}`);
1585
- if (reference.format === "token" && !spec.envVars.oauthToken) throw new Error(`Native subscription tokens are unsupported by ${backendType}`);
1586
- if (reference.format === "bundle" && backendType !== "codex" && backendType !== "claude-code") throw new Error(`Native credential bundles are unsupported by ${backendType}`);
1587
- return reference;
1588
- }
1589
- //#endregion
1590
- export { materializeCliAuthBundle as i, assertCliAuthReferenceSupported as n, cliAuthReferenceSchema as r, AUTH_BUNDLE_PATHS as t };