@tangle-network/sandbox 0.60.61-develop.20261015135525.6c02550 → 0.60.69

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