@tangle-network/cli-agent-registry 0.0.0-stage → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +175 -2
  3. package/dist/backend-types-CNo_Zj_K.mjs +36 -0
  4. package/dist/backend-types-DRmLR1e0.d.mts +47 -0
  5. package/dist/backend-types.d.mts +2 -0
  6. package/dist/backend-types.mjs +2 -0
  7. package/dist/cli-auth-bundle-C6DtK7GX.mjs +95 -0
  8. package/dist/cli-auth-bundle-CwAaH0Ap.d.mts +51 -0
  9. package/dist/cli-auth-bundle.d.mts +2 -0
  10. package/dist/cli-auth-bundle.mjs +2 -0
  11. package/dist/cli-auth-placeholder.d.mts +54 -0
  12. package/dist/cli-auth-placeholder.mjs +200 -0
  13. package/dist/cli-backend-auth-env.d.mts +6 -0
  14. package/dist/cli-backend-auth-env.mjs +44 -0
  15. package/dist/default-backend.d.mts +24 -0
  16. package/dist/default-backend.mjs +31 -0
  17. package/dist/harness-D1fTxnDD.mjs +199 -0
  18. package/dist/harness-contracts-BZoECCMc.mjs +1076 -0
  19. package/dist/host-contracts.d.mts +30 -0
  20. package/dist/host-contracts.json +422 -0
  21. package/dist/host-contracts.mjs +63 -0
  22. package/dist/index.d.mts +1397 -0
  23. package/dist/index.mjs +151 -0
  24. package/dist/local-cli-auth.d.mts +14 -0
  25. package/dist/local-cli-auth.mjs +31 -0
  26. package/dist/native-session-contracts.d.mts +349 -0
  27. package/dist/native-session-contracts.mjs +40 -0
  28. package/dist/servable-models.d.mts +103 -0
  29. package/dist/servable-models.mjs +131 -0
  30. package/dist/session-contract-BhzcbPRW.d.mts +97 -0
  31. package/dist/session-contract.d.mts +2 -0
  32. package/dist/session-contract.mjs +142 -0
  33. package/dist/spec-CcvTM7-j.d.mts +346 -0
  34. package/dist/specs-BBF55TnM.mjs +735 -0
  35. package/dist/specs.d.mts +72 -0
  36. package/dist/specs.mjs +3 -0
  37. package/package.json +87 -3
@@ -0,0 +1,1076 @@
1
+ //#region src/harness-cli-versions.ts
2
+ /** The CLI version infra/nix ships for each registered harness. */
3
+ const HARNESS_CLI_VERSIONS = {
4
+ "claude-code": "2.1.311",
5
+ codex: "0.164.0",
6
+ cursor: "2026.10.22-27dcf5f",
7
+ opencode: "1.19.4",
8
+ pi: "1.4.0",
9
+ "kimi-code": "1.49.0",
10
+ "factory-droids": "0.250.0",
11
+ amp: "0.0.1793104576-gc52692",
12
+ prime: "0.10.1",
13
+ hermes: "0.22.4",
14
+ openclaw: "2026.10.8",
15
+ acp: "claude-agent-acp 0.97.0; codex-acp 0.16.0; gemini-cli 0.65.0",
16
+ grok: "0.1.220",
17
+ nanoclaw: "2.1.54"
18
+ };
19
+ //#endregion
20
+ //#region src/harness-contracts/session-stores.ts
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
+ //#endregion
73
+ //#region src/harness-contracts/contracts/acp.ts
74
+ var acp_default = {
75
+ session: {
76
+ kind: "native",
77
+ processProbe: {
78
+ versionCommand: `set -eu
79
+ separator=''
80
+ for entry in claude-agent-acp:claude-agent-acp codex-acp:codex-acp gemini-cli:gemini; do
81
+ package=\${entry%%:*}
82
+ binary=\${entry#*:}
83
+ executable=$(readlink -f "$(command -v "$binary")")
84
+ case "$executable" in /nix/store/*-"$package"-*/bin/"$binary") ;; *) exit 1 ;; esac
85
+ store=\${executable#/nix/store/}
86
+ derivation=\${store%%/*}
87
+ version=\${derivation#*-"$package"-}
88
+ test -n "$version"
89
+ printf '%s%s %s' "$separator" "$package" "$version"
90
+ separator='; '
91
+ done
92
+ printf '\\n'`,
93
+ kill: ["-f", "[h]ermes.* acp( |$)"]
94
+ },
95
+ contract: {
96
+ version: 1,
97
+ stores: [
98
+ CLAUDE_PROJECTS,
99
+ CODEX_ROLLOUTS,
100
+ GEMINI_CHATS,
101
+ KIMI_SESSIONS,
102
+ HERMES_STATE
103
+ ],
104
+ identity: {
105
+ kind: "api-created",
106
+ call: "acp session/new"
107
+ },
108
+ resume: { kind: "api" },
109
+ forbiddenArgs: [],
110
+ storeEnv: {},
111
+ evidence: {
112
+ servedModel: "session-record",
113
+ usage: "session-total",
114
+ endingError: "none"
115
+ },
116
+ cliVersion: HARNESS_CLI_VERSIONS.acp
117
+ },
118
+ defect: null
119
+ },
120
+ config: {
121
+ kind: "model",
122
+ providerRequiresModel: true,
123
+ keySources: [
124
+ "managed",
125
+ "api-key",
126
+ "api-key-env",
127
+ "cli-auth"
128
+ ],
129
+ baseUrl: "caller-or-managed",
130
+ modelWire: "openai-compat",
131
+ envVars: {
132
+ apiKey: "OPENCODE_MODEL_API_KEY",
133
+ model: "TANGLE_ROUTER_MODEL",
134
+ baseUrl: "TANGLE_ROUTER_BASE_URL",
135
+ authFiles: "ACP_AUTH_FILES_JSON"
136
+ }
137
+ },
138
+ lifecycle: {
139
+ runtime: void 0,
140
+ coldCreate: { kind: "required" },
141
+ warmClaim: { kind: "required" },
142
+ parkResume: { kind: "required" },
143
+ branchChild: { kind: "required" },
144
+ killResume: { kind: "required" }
145
+ }
146
+ };
147
+ //#endregion
148
+ //#region src/harness-contracts/contracts/amp.ts
149
+ var amp_default = {
150
+ session: {
151
+ kind: "native",
152
+ processProbe: {
153
+ versionCommand: "amp --version",
154
+ kill: ["-x", "amp"]
155
+ },
156
+ contract: {
157
+ version: 1,
158
+ stores: [{
159
+ root: ".local/share/amp/threads",
160
+ files: ["{id}.json"],
161
+ write: "json-rewrite",
162
+ shared: false,
163
+ format: "amp.thread-json"
164
+ }],
165
+ identity: {
166
+ kind: "first-event",
167
+ event: "thread",
168
+ deadlineMs: 6e4
169
+ },
170
+ resume: {
171
+ kind: "args",
172
+ args: [
173
+ "threads",
174
+ "continue",
175
+ "{id}"
176
+ ]
177
+ },
178
+ forbiddenArgs: [],
179
+ storeEnv: { XDG_DATA_HOME: ".local/share" },
180
+ evidence: {
181
+ servedModel: "session-record",
182
+ usage: "per-response",
183
+ endingError: "none"
184
+ },
185
+ cliVersion: HARNESS_CLI_VERSIONS.amp
186
+ },
187
+ defect: {
188
+ issue: "#10096",
189
+ reason: "threads live on ampcode.com; neither a local copy nor a mock-routable model is proven"
190
+ }
191
+ },
192
+ config: {
193
+ kind: "model",
194
+ providerRequiresModel: true,
195
+ keySources: [
196
+ "api-key",
197
+ "api-key-env",
198
+ "cli-auth"
199
+ ],
200
+ baseUrl: "vendor-only",
201
+ modelWire: "openai-compat",
202
+ envVars: {
203
+ apiKey: "AMP_API_KEY",
204
+ model: "AMP_MODEL_NAME",
205
+ authMode: "AMP_AUTH_MODE",
206
+ authFiles: "AMP_AUTH_FILES_JSON"
207
+ }
208
+ },
209
+ lifecycle: {
210
+ runtime: void 0,
211
+ coldCreate: { kind: "required" },
212
+ warmClaim: { kind: "required" },
213
+ parkResume: { kind: "required" },
214
+ branchChild: { kind: "required" },
215
+ killResume: { kind: "required" }
216
+ }
217
+ };
218
+ //#endregion
219
+ //#region src/harness-contracts/contracts/claude-code.ts
220
+ var claude_code_default = {
221
+ session: {
222
+ kind: "native",
223
+ processProbe: {
224
+ versionCommand: "claude --version",
225
+ kill: ["-x", "claude"]
226
+ },
227
+ contract: {
228
+ version: 1,
229
+ stores: [CLAUDE_PROJECTS],
230
+ identity: {
231
+ kind: "pre-minted",
232
+ args: ["--session-id", "{id}"]
233
+ },
234
+ resume: {
235
+ kind: "args",
236
+ args: ["--resume", "{id}"]
237
+ },
238
+ forbiddenArgs: ["--no-session-persistence", "--fork-session"],
239
+ storeEnv: { CLAUDE_CONFIG_DIR: ".claude" },
240
+ evidence: {
241
+ servedModel: "provider-response",
242
+ usage: "per-response",
243
+ endingError: "session-record"
244
+ },
245
+ cliVersion: HARNESS_CLI_VERSIONS["claude-code"]
246
+ },
247
+ defect: null
248
+ },
249
+ config: {
250
+ kind: "model",
251
+ providerRequiresModel: true,
252
+ assertions: [
253
+ "managed-full-ladder",
254
+ "operator-model-first",
255
+ "named-model-exact"
256
+ ],
257
+ keySources: [
258
+ "managed",
259
+ "api-key",
260
+ "api-key-env",
261
+ "cli-auth"
262
+ ],
263
+ baseUrl: "caller-or-managed",
264
+ modelWire: "anthropic-messages",
265
+ envVars: {
266
+ apiKey: "ANTHROPIC_API_KEY",
267
+ model: "CLAUDE_CODE_MODEL_NAME",
268
+ authMode: "CLAUDE_CODE_AUTH_MODE",
269
+ authFiles: "CLAUDE_CODE_AUTH_FILES_JSON",
270
+ oauthToken: "CLAUDE_CODE_OAUTH_TOKEN",
271
+ baseUrl: "ANTHROPIC_BASE_URL"
272
+ }
273
+ },
274
+ lifecycle: {
275
+ runtime: {},
276
+ coldCreate: { kind: "required" },
277
+ warmClaim: { kind: "required" },
278
+ parkResume: { kind: "required" },
279
+ branchChild: { kind: "required" },
280
+ killResume: { kind: "required" }
281
+ }
282
+ };
283
+ //#endregion
284
+ //#region src/harness-contracts/contracts/cli-base.ts
285
+ var cli_base_default = {
286
+ session: {
287
+ kind: "no-agent",
288
+ reason: "This backend runs no agent process"
289
+ },
290
+ config: {
291
+ kind: "no-agent",
292
+ envVars: {},
293
+ reason: "This backend accepts no model or provider"
294
+ },
295
+ lifecycle: {
296
+ runtime: void 0,
297
+ coldCreate: {
298
+ kind: "unsupported",
299
+ reason: "This backend runs no agent turn"
300
+ },
301
+ warmClaim: {
302
+ kind: "unsupported",
303
+ reason: "This backend runs no agent turn"
304
+ },
305
+ parkResume: {
306
+ kind: "unsupported",
307
+ reason: "This backend runs no agent turn"
308
+ },
309
+ branchChild: {
310
+ kind: "unsupported",
311
+ reason: "This backend runs no agent turn"
312
+ },
313
+ killResume: {
314
+ kind: "unsupported",
315
+ reason: "The backend exposes no resumable native session"
316
+ }
317
+ }
318
+ };
319
+ //#endregion
320
+ //#region src/harness-contracts/contracts/codex.ts
321
+ var codex_default = {
322
+ session: {
323
+ kind: "native",
324
+ processProbe: {
325
+ versionCommand: "codex --version",
326
+ kill: ["-f", "bin/[c]odex( |$)"]
327
+ },
328
+ contract: {
329
+ version: 1,
330
+ stores: [CODEX_ROLLOUTS, CODEX_ARCHIVED_ROLLOUTS],
331
+ identity: {
332
+ kind: "first-event",
333
+ event: "thread.started",
334
+ deadlineMs: 3e4
335
+ },
336
+ resume: {
337
+ kind: "args",
338
+ args: [
339
+ "exec",
340
+ "resume",
341
+ "{id}"
342
+ ]
343
+ },
344
+ forbiddenArgs: ["--ephemeral"],
345
+ storeEnv: { CODEX_HOME: ".codex" },
346
+ evidence: {
347
+ servedModel: "turn-context",
348
+ usage: "cumulative",
349
+ endingError: "session-record"
350
+ },
351
+ cliVersion: HARNESS_CLI_VERSIONS.codex
352
+ },
353
+ defect: null
354
+ },
355
+ config: {
356
+ kind: "model",
357
+ providerRequiresModel: true,
358
+ assertions: [
359
+ "managed-full-ladder",
360
+ "operator-model-first",
361
+ "named-model-exact",
362
+ "responses-config-model-id"
363
+ ],
364
+ keySources: [
365
+ "managed",
366
+ "api-key",
367
+ "api-key-env",
368
+ "cli-auth"
369
+ ],
370
+ baseUrl: "caller-or-managed",
371
+ modelWire: "openai-responses",
372
+ envVars: {
373
+ apiKey: "OPENAI_API_KEY",
374
+ model: "CODEX_MODEL_NAME",
375
+ authMode: "CODEX_AUTH_MODE",
376
+ authFiles: "CODEX_AUTH_FILES_JSON",
377
+ baseUrl: "OPENAI_BASE_URL"
378
+ }
379
+ },
380
+ lifecycle: {
381
+ runtime: { secretProfileIsolation: true },
382
+ coldCreate: { kind: "required" },
383
+ warmClaim: { kind: "required" },
384
+ parkResume: { kind: "required" },
385
+ branchChild: { kind: "required" },
386
+ killResume: { kind: "required" }
387
+ }
388
+ };
389
+ //#endregion
390
+ //#region src/harness-contracts/contracts/cursor.ts
391
+ var cursor_default = {
392
+ session: {
393
+ kind: "unsupported",
394
+ defect: {
395
+ issue: "#10096",
396
+ reason: "local SDK store capture has no qualified harness reader"
397
+ }
398
+ },
399
+ config: {
400
+ kind: "model",
401
+ providerRequiresModel: true,
402
+ keySources: ["api-key", "api-key-env"],
403
+ baseUrl: "vendor-only",
404
+ modelWire: "openai-compat",
405
+ envVars: {
406
+ apiKey: "CURSOR_API_KEY",
407
+ model: "CURSOR_MODEL_NAME"
408
+ }
409
+ },
410
+ lifecycle: {
411
+ runtime: void 0,
412
+ coldCreate: { kind: "required" },
413
+ warmClaim: { kind: "required" },
414
+ parkResume: { kind: "required" },
415
+ branchChild: { kind: "required" },
416
+ killResume: {
417
+ kind: "unsupported",
418
+ reason: "Native Cursor capture contract remains unqualified"
419
+ }
420
+ }
421
+ };
422
+ //#endregion
423
+ //#region src/harness-contracts/contracts/factory-droids.ts
424
+ var factory_droids_default = {
425
+ session: {
426
+ kind: "native",
427
+ processProbe: {
428
+ versionCommand: "droid --version",
429
+ kill: ["-x", "droid"]
430
+ },
431
+ contract: {
432
+ version: 1,
433
+ stores: [{
434
+ root: ".factory/sessions",
435
+ files: ["*/{id}.jsonl"],
436
+ write: "jsonl-append",
437
+ shared: false,
438
+ format: "factory.session-jsonl"
439
+ }, {
440
+ root: ".factory/sessions",
441
+ files: ["*/{id}.settings.json"],
442
+ write: "json-rewrite",
443
+ shared: false,
444
+ format: "factory.session-jsonl"
445
+ }],
446
+ identity: {
447
+ kind: "first-event",
448
+ event: "session_id",
449
+ deadlineMs: 6e4
450
+ },
451
+ resume: {
452
+ kind: "args",
453
+ args: ["--session-id", "{id}"]
454
+ },
455
+ forbiddenArgs: [],
456
+ storeEnv: {},
457
+ evidence: {
458
+ servedModel: "turn-context",
459
+ usage: "session-total",
460
+ endingError: "none"
461
+ },
462
+ cliVersion: HARNESS_CLI_VERSIONS["factory-droids"]
463
+ },
464
+ defect: null
465
+ },
466
+ config: {
467
+ kind: "model",
468
+ providerRequiresModel: true,
469
+ keySources: [
470
+ "managed",
471
+ "api-key",
472
+ "api-key-env"
473
+ ],
474
+ baseUrl: "caller-or-managed",
475
+ modelWire: "openai-compat",
476
+ envVars: {
477
+ apiKey: "FACTORY_API_KEY",
478
+ model: "FACTORY_DROIDS_MODEL_NAME"
479
+ }
480
+ },
481
+ lifecycle: {
482
+ runtime: void 0,
483
+ coldCreate: { kind: "required" },
484
+ warmClaim: { kind: "required" },
485
+ parkResume: { kind: "required" },
486
+ branchChild: { kind: "required" },
487
+ killResume: { kind: "required" }
488
+ }
489
+ };
490
+ //#endregion
491
+ //#region src/harness-contracts/contracts/grok.ts
492
+ var grok_default = {
493
+ session: {
494
+ kind: "native",
495
+ processProbe: {
496
+ versionCommand: "grok --version",
497
+ kill: ["-x", "grok"]
498
+ },
499
+ contract: {
500
+ version: 1,
501
+ stores: [{
502
+ root: ".grok/sessions",
503
+ files: [
504
+ "*/{id}/updates.jsonl",
505
+ "*/{id}/chat_history.jsonl",
506
+ "*/{id}/summary.json",
507
+ "*/{id}/signals.json"
508
+ ],
509
+ write: "jsonl-append",
510
+ shared: false,
511
+ format: "grok.acp-session-dir"
512
+ }],
513
+ identity: {
514
+ kind: "first-event",
515
+ event: "sessionId",
516
+ deadlineMs: 6e4
517
+ },
518
+ resume: {
519
+ kind: "args",
520
+ args: ["-r", "{id}"]
521
+ },
522
+ forbiddenArgs: [],
523
+ storeEnv: { GROK_HOME: ".grok" },
524
+ evidence: {
525
+ servedModel: "session-record",
526
+ usage: "none",
527
+ endingError: "none"
528
+ },
529
+ cliVersion: HARNESS_CLI_VERSIONS.grok
530
+ },
531
+ defect: null
532
+ },
533
+ config: {
534
+ kind: "model",
535
+ providerRequiresModel: true,
536
+ keySources: ["api-key", "api-key-env"],
537
+ baseUrl: "caller-or-managed",
538
+ modelWire: "openai-compat",
539
+ envVars: {
540
+ apiKey: "XAI_API_KEY",
541
+ model: "GROK_MODEL"
542
+ }
543
+ },
544
+ lifecycle: {
545
+ runtime: void 0,
546
+ coldCreate: { kind: "required" },
547
+ warmClaim: { kind: "required" },
548
+ parkResume: { kind: "required" },
549
+ branchChild: { kind: "required" },
550
+ killResume: { kind: "required" }
551
+ }
552
+ };
553
+ //#endregion
554
+ //#region src/harness-contracts/contracts/hermes.ts
555
+ var hermes_default = {
556
+ session: {
557
+ kind: "native",
558
+ processProbe: {
559
+ versionCommand: "hermes --version",
560
+ kill: ["-f", "(^|/)[h]ermes( |$)"]
561
+ },
562
+ contract: {
563
+ version: 1,
564
+ stores: [HERMES_STATE],
565
+ identity: {
566
+ kind: "first-event",
567
+ event: "session_id",
568
+ deadlineMs: 6e4
569
+ },
570
+ resume: {
571
+ kind: "args",
572
+ args: ["--resume", "{id}"]
573
+ },
574
+ forbiddenArgs: [],
575
+ storeEnv: { HERMES_HOME: ".hermes" },
576
+ evidence: {
577
+ servedModel: "session-record",
578
+ usage: "session-total",
579
+ endingError: "none"
580
+ },
581
+ cliVersion: HARNESS_CLI_VERSIONS.hermes
582
+ },
583
+ defect: null
584
+ },
585
+ config: {
586
+ kind: "model",
587
+ providerRequiresModel: true,
588
+ keySources: [
589
+ "managed",
590
+ "api-key",
591
+ "api-key-env",
592
+ "cli-auth"
593
+ ],
594
+ baseUrl: "caller-or-managed",
595
+ modelWire: "openai-compat",
596
+ envVars: {
597
+ apiKey: "HERMES_API_KEY",
598
+ model: "HERMES_MODEL_NAME",
599
+ authMode: "HERMES_AUTH_MODE",
600
+ authFiles: "HERMES_AUTH_FILES_JSON",
601
+ baseUrl: "HERMES_BASE_URL",
602
+ extras: { HERMES_INFERENCE_PROVIDER: { parser: "string" } }
603
+ }
604
+ },
605
+ lifecycle: {
606
+ runtime: void 0,
607
+ coldCreate: { kind: "required" },
608
+ warmClaim: { kind: "required" },
609
+ parkResume: { kind: "required" },
610
+ branchChild: { kind: "required" },
611
+ killResume: { kind: "required" }
612
+ }
613
+ };
614
+ //#endregion
615
+ //#region ../runtime-contracts/dist/harness-warm-transport.js
616
+ /** Set only by the Sandbox API after the OpenCode warm-server rollout decision. */
617
+ const AGENT_INTERNAL_OPENCODE_WARM_SERVER_ENV_VAR = "AGENT_INTERNAL_OPENCODE_WARM_SERVER";
618
+ /**
619
+ * Sidecar switch: after a warm claim, start the first session's OpenCode
620
+ * server before that session's first turn. Effective only with
621
+ * AGENT_INTERNAL_OPENCODE_WARM_SERVER=1. Any value other than "1" is off.
622
+ */
623
+ const AGENT_INTERNAL_OPENCODE_PREWARM_ENV_VAR = "AGENT_INTERNAL_OPENCODE_PREWARM";
624
+ /** Persistent Kimi wire process and shared create/resume prewarm gates. */
625
+ const AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR = "AGENT_INTERNAL_KIMI_WARM_SERVER";
626
+ /**
627
+ * Per harness, the two switches the Sandbox API sets from its warm-server
628
+ * rollout decision: the long-lived process transport, and prewarm, which
629
+ * starts that process before the turn that uses it and is only meaningful
630
+ * with it. A harness joins the rollout by adding one row; the Sandbox API,
631
+ * the orchestrator's provision guard and its recreate carry all read this
632
+ * table. Values are "1" or "0"; anything else is off.
633
+ */
634
+ const HARNESS_WARM_TRANSPORT_ENV = {
635
+ opencode: {
636
+ warmServer: AGENT_INTERNAL_OPENCODE_WARM_SERVER_ENV_VAR,
637
+ prewarm: AGENT_INTERNAL_OPENCODE_PREWARM_ENV_VAR
638
+ },
639
+ "kimi-code": {
640
+ warmServer: AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR,
641
+ prewarm: "AGENT_INTERNAL_KIMI_PREWARM"
642
+ },
643
+ "claude-code": {
644
+ warmServer: "AGENT_INTERNAL_CLAUDE_CODE_WARM_SERVER",
645
+ prewarm: "AGENT_INTERNAL_CLAUDE_CODE_PREWARM"
646
+ },
647
+ codex: {
648
+ warmServer: "AGENT_INTERNAL_CODEX_WARM_SERVER",
649
+ prewarm: "AGENT_INTERNAL_CODEX_PREWARM"
650
+ }
651
+ };
652
+ //#endregion
653
+ //#region src/harness-contracts/contracts/kimi-code.ts
654
+ var kimi_code_default = {
655
+ session: {
656
+ kind: "native",
657
+ processProbe: {
658
+ versionCommand: "kimi --version",
659
+ kill: ["-f", "^[K]imi Code"]
660
+ },
661
+ contract: {
662
+ version: 1,
663
+ stores: [KIMI_SESSIONS],
664
+ identity: {
665
+ kind: "pre-minted",
666
+ args: ["--session", "{id}"]
667
+ },
668
+ resume: {
669
+ kind: "args",
670
+ args: ["--session", "{id}"]
671
+ },
672
+ forbiddenArgs: [],
673
+ storeEnv: {},
674
+ evidence: {
675
+ servedModel: "none",
676
+ usage: "per-response",
677
+ endingError: "session-record"
678
+ },
679
+ cliVersion: HARNESS_CLI_VERSIONS["kimi-code"]
680
+ },
681
+ defect: null
682
+ },
683
+ config: {
684
+ kind: "model",
685
+ providerRequiresModel: true,
686
+ keySources: [
687
+ "managed",
688
+ "api-key",
689
+ "api-key-env",
690
+ "cli-auth"
691
+ ],
692
+ baseUrl: "caller-or-managed",
693
+ modelWire: "openai-compat",
694
+ envVars: {
695
+ apiKey: "MOONSHOT_API_KEY",
696
+ model: "KIMI_CODE_MODEL_NAME",
697
+ authMode: "KIMI_CODE_AUTH_MODE",
698
+ authFiles: "KIMI_CODE_AUTH_FILES_JSON",
699
+ extras: { OPENAI_BASE_URL: { parser: "string" } }
700
+ }
701
+ },
702
+ lifecycle: {
703
+ runtime: { warmRetention: {
704
+ envVar: AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR,
705
+ enabledByDefault: false
706
+ } },
707
+ coldCreate: { kind: "required" },
708
+ warmClaim: { kind: "required" },
709
+ parkResume: { kind: "required" },
710
+ branchChild: { kind: "required" },
711
+ killResume: { kind: "required" }
712
+ }
713
+ };
714
+ //#endregion
715
+ //#region src/harness-contracts/contracts/nanoclaw.ts
716
+ var nanoclaw_default = {
717
+ session: {
718
+ kind: "native",
719
+ processProbe: {
720
+ versionCommand: `node -p "require(require('child_process').execSync('nanoclaw-runtime-root',{encoding:'utf8'}).trim()+'/package.json').version"`,
721
+ kill: ["-f", "[n]anoclaw-chat"]
722
+ },
723
+ contract: {
724
+ version: 1,
725
+ stores: [{
726
+ root: ".nanoclaw/data/v2-sessions",
727
+ files: ["*/{id}/outbound.db", "*/{id}/inbound.db"],
728
+ write: "sqlite-wal",
729
+ shared: false,
730
+ format: "nanoclaw.session-sqlite"
731
+ }],
732
+ identity: {
733
+ kind: "first-event",
734
+ event: "sessionId",
735
+ deadlineMs: 6e4
736
+ },
737
+ resume: { kind: "api" },
738
+ forbiddenArgs: [],
739
+ storeEnv: { NANOCLAW_RUNTIME_ROOT: ".nanoclaw" },
740
+ evidence: {
741
+ servedModel: "none",
742
+ usage: "per-response",
743
+ endingError: "none"
744
+ },
745
+ cliVersion: HARNESS_CLI_VERSIONS.nanoclaw
746
+ },
747
+ defect: null
748
+ },
749
+ config: {
750
+ kind: "model",
751
+ providerRequiresModel: true,
752
+ keySources: [
753
+ "managed",
754
+ "api-key",
755
+ "api-key-env"
756
+ ],
757
+ baseUrl: "caller-or-managed",
758
+ modelWire: "openai-compat",
759
+ envVars: {
760
+ apiKey: "OPENCODE_MODEL_API_KEY",
761
+ model: "TANGLE_ROUTER_MODEL",
762
+ authMode: "NANOCLAW_AUTH_MODE",
763
+ baseUrl: "TANGLE_ROUTER_BASE_URL",
764
+ extras: {
765
+ NANOCLAW_PROJECT_ROOT: { parser: "string" },
766
+ NANOCLAW_NATIVE_CREDENTIALS: { parser: "string" },
767
+ OPENCODE_MODEL_PROVIDER: {
768
+ parser: "string",
769
+ role: "provider"
770
+ }
771
+ }
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
+ //#endregion
784
+ //#region src/harness-contracts/contracts/openclaw.ts
785
+ var openclaw_default = {
786
+ session: {
787
+ kind: "native",
788
+ processProbe: {
789
+ versionCommand: "openclaw --version",
790
+ kill: ["-f", "[o]penclaw(\\.mjs)?( |$)"]
791
+ },
792
+ contract: {
793
+ version: 1,
794
+ stores: [{
795
+ root: ".openclaw",
796
+ files: [
797
+ "agents/main/agent/openclaw-agent.sqlite",
798
+ "agents/main/agent/openclaw-agent.sqlite-wal",
799
+ "agents/main/agent/openclaw-agent.sqlite-shm"
800
+ ],
801
+ write: "sqlite-wal",
802
+ shared: true,
803
+ format: "openclaw.session-jsonl"
804
+ }],
805
+ identity: {
806
+ kind: "pre-minted",
807
+ args: ["--session-id", "{id}"]
808
+ },
809
+ resume: {
810
+ kind: "args",
811
+ args: ["--session-id", "{id}"]
812
+ },
813
+ forbiddenArgs: [],
814
+ storeEnv: {},
815
+ evidence: {
816
+ servedModel: "session-record",
817
+ usage: "per-response",
818
+ endingError: "none"
819
+ },
820
+ cliVersion: HARNESS_CLI_VERSIONS.openclaw
821
+ },
822
+ defect: null
823
+ },
824
+ config: {
825
+ kind: "model",
826
+ providerRequiresModel: true,
827
+ keySources: [
828
+ "managed",
829
+ "api-key",
830
+ "api-key-env",
831
+ "cli-auth"
832
+ ],
833
+ baseUrl: "caller-or-managed",
834
+ modelWire: "openai-compat",
835
+ envVars: {
836
+ apiKey: "OPENCODE_MODEL_API_KEY",
837
+ model: "TANGLE_ROUTER_MODEL",
838
+ baseUrl: "TANGLE_ROUTER_BASE_URL",
839
+ authMode: "OPENCLAW_AUTH_MODE",
840
+ authFiles: "OPENCLAW_AUTH_FILES_JSON"
841
+ }
842
+ },
843
+ lifecycle: {
844
+ runtime: void 0,
845
+ coldCreate: { kind: "required" },
846
+ warmClaim: { kind: "required" },
847
+ parkResume: { kind: "required" },
848
+ branchChild: { kind: "required" },
849
+ killResume: { kind: "required" }
850
+ }
851
+ };
852
+ //#endregion
853
+ //#region src/harness-contracts/index.ts
854
+ const HARNESSES = {
855
+ "claude-code": claude_code_default,
856
+ codex: codex_default,
857
+ opencode: {
858
+ session: {
859
+ kind: "native",
860
+ processProbe: {
861
+ versionCommand: "opencode --version",
862
+ kill: ["-x", "opencode"]
863
+ },
864
+ contract: {
865
+ version: 1,
866
+ stores: [{
867
+ root: ".local/share/opencode",
868
+ files: [
869
+ "opencode.db",
870
+ "opencode.db-wal",
871
+ "opencode.db-shm"
872
+ ],
873
+ write: "sqlite-wal",
874
+ shared: true,
875
+ format: "opencode.sqlite"
876
+ }],
877
+ identity: {
878
+ kind: "first-event",
879
+ event: "sessionID",
880
+ deadlineMs: 3e5
881
+ },
882
+ resume: {
883
+ kind: "args",
884
+ args: ["--session", "{id}"]
885
+ },
886
+ forbiddenArgs: [],
887
+ storeEnv: { XDG_DATA_HOME: ".local/share" },
888
+ evidence: {
889
+ servedModel: "turn-context",
890
+ usage: "per-response",
891
+ endingError: "session-record"
892
+ },
893
+ cliVersion: HARNESS_CLI_VERSIONS.opencode
894
+ },
895
+ defect: null
896
+ },
897
+ config: {
898
+ kind: "model",
899
+ providerRequiresModel: true,
900
+ keySources: [
901
+ "managed",
902
+ "api-key",
903
+ "api-key-env"
904
+ ],
905
+ baseUrl: "caller-or-managed",
906
+ modelWire: "openai-compat",
907
+ envVars: {
908
+ apiKey: "OPENCODE_MODEL_API_KEY",
909
+ model: "OPENCODE_MODEL_NAME",
910
+ baseUrl: "OPENCODE_MODEL_BASE_URL",
911
+ extras: {
912
+ OPENCODE_MODEL_PROVIDER: {
913
+ parser: "string",
914
+ role: "provider"
915
+ },
916
+ OPENCODE_MODEL_MODE: {
917
+ parser: "string",
918
+ role: "mode"
919
+ }
920
+ }
921
+ }
922
+ },
923
+ lifecycle: {
924
+ runtime: {
925
+ secretProfileIsolation: true,
926
+ redactsHostEnv: true,
927
+ supportsToolDisabledTurns: true
928
+ },
929
+ coldCreate: { kind: "required" },
930
+ warmClaim: { kind: "required" },
931
+ parkResume: { kind: "required" },
932
+ branchChild: { kind: "required" },
933
+ killResume: { kind: "required" }
934
+ }
935
+ },
936
+ pi: {
937
+ session: {
938
+ kind: "native",
939
+ processProbe: {
940
+ versionCommand: "pi --version",
941
+ kill: ["-x", "pi"]
942
+ },
943
+ contract: {
944
+ version: 1,
945
+ stores: [{
946
+ root: ".pi/agent/sessions",
947
+ files: ["**/*_{id}.jsonl"],
948
+ write: "jsonl-append",
949
+ shared: false,
950
+ format: "pi.session-jsonl"
951
+ }],
952
+ identity: {
953
+ kind: "pre-minted",
954
+ args: ["--session-id", "{id}"]
955
+ },
956
+ resume: {
957
+ kind: "args",
958
+ args: ["--session", "{id}"]
959
+ },
960
+ forbiddenArgs: [
961
+ "--no-session",
962
+ "--fork",
963
+ "--continue"
964
+ ],
965
+ storeEnv: {
966
+ PI_CODING_AGENT_DIR: ".pi/agent",
967
+ PI_CODING_AGENT_SESSION_DIR: ".pi/agent/sessions",
968
+ "--session-dir": ".pi/agent/sessions"
969
+ },
970
+ evidence: {
971
+ servedModel: "session-record",
972
+ usage: "per-response",
973
+ endingError: "session-record"
974
+ },
975
+ cliVersion: HARNESS_CLI_VERSIONS.pi
976
+ },
977
+ defect: null
978
+ },
979
+ config: {
980
+ kind: "model",
981
+ providerRequiresModel: true,
982
+ keySources: [
983
+ "managed",
984
+ "api-key",
985
+ "api-key-env",
986
+ "cli-auth"
987
+ ],
988
+ baseUrl: "caller-or-managed",
989
+ modelWire: "openai-compat",
990
+ envVars: {
991
+ apiKey: "OPENCODE_MODEL_API_KEY",
992
+ model: "TANGLE_ROUTER_MODEL",
993
+ baseUrl: "TANGLE_ROUTER_BASE_URL"
994
+ }
995
+ },
996
+ lifecycle: {
997
+ runtime: {},
998
+ coldCreate: { kind: "required" },
999
+ warmClaim: { kind: "required" },
1000
+ parkResume: { kind: "required" },
1001
+ branchChild: { kind: "required" },
1002
+ killResume: { kind: "required" }
1003
+ }
1004
+ },
1005
+ "kimi-code": kimi_code_default,
1006
+ "factory-droids": factory_droids_default,
1007
+ grok: grok_default,
1008
+ amp: amp_default,
1009
+ prime: {
1010
+ session: {
1011
+ kind: "native",
1012
+ processProbe: {
1013
+ versionCommand: "prime-agent --version",
1014
+ kill: ["-f", "[p]rime-agent"]
1015
+ },
1016
+ contract: {
1017
+ version: 1,
1018
+ stores: [{
1019
+ root: ".prime-provider/prime-agent-dirs",
1020
+ files: ["**/sessions/*.jsonl"],
1021
+ write: "jsonl-append",
1022
+ shared: true,
1023
+ format: "prime.session-jsonl"
1024
+ }],
1025
+ identity: {
1026
+ kind: "api-created",
1027
+ call: "acp session/new"
1028
+ },
1029
+ resume: { kind: "api" },
1030
+ forbiddenArgs: ["--no-session"],
1031
+ storeEnv: {},
1032
+ evidence: {
1033
+ servedModel: "session-record",
1034
+ usage: "per-response",
1035
+ endingError: "session-record"
1036
+ },
1037
+ cliVersion: HARNESS_CLI_VERSIONS.prime
1038
+ },
1039
+ defect: null
1040
+ },
1041
+ config: {
1042
+ kind: "model",
1043
+ providerRequiresModel: true,
1044
+ keySources: [
1045
+ "managed",
1046
+ "api-key",
1047
+ "api-key-env"
1048
+ ],
1049
+ baseUrl: "caller-or-managed",
1050
+ modelWire: "openai-compat",
1051
+ envVars: {
1052
+ apiKey: "OPENCODE_MODEL_API_KEY",
1053
+ model: "TANGLE_ROUTER_MODEL",
1054
+ baseUrl: "TANGLE_ROUTER_BASE_URL"
1055
+ }
1056
+ },
1057
+ lifecycle: {
1058
+ runtime: void 0,
1059
+ coldCreate: { kind: "required" },
1060
+ warmClaim: { kind: "required" },
1061
+ parkResume: { kind: "required" },
1062
+ branchChild: { kind: "required" },
1063
+ killResume: { kind: "required" }
1064
+ }
1065
+ },
1066
+ hermes: hermes_default,
1067
+ openclaw: openclaw_default,
1068
+ nanoclaw: nanoclaw_default,
1069
+ acp: acp_default,
1070
+ cursor: cursor_default,
1071
+ "cli-base": cli_base_default
1072
+ };
1073
+ //#endregion
1074
+ export { HARNESS_WARM_TRANSPORT_ENV as n, HARNESSES as t };
1075
+
1076
+ //# sourceMappingURL=harness-contracts-BZoECCMc.mjs.map