@tangle-network/cli-agent-registry 0.0.0-stage → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +11 -0
- package/README.md +145 -2
- package/dist/backend-types-CJH-wHS3.d.mts +56 -0
- package/dist/backend-types-CREj4iOY.mjs +45 -0
- package/dist/backend-types.d.mts +2 -0
- package/dist/backend-types.mjs +2 -0
- package/dist/cli-auth-bundle.d.mts +49 -0
- package/dist/cli-auth-bundle.mjs +92 -0
- package/dist/cli-auth-placeholder.d.mts +54 -0
- package/dist/cli-auth-placeholder.mjs +200 -0
- package/dist/cli-backend-auth-env.d.mts +6 -0
- package/dist/cli-backend-auth-env.mjs +44 -0
- package/dist/default-backend.d.mts +24 -0
- package/dist/default-backend.mjs +31 -0
- package/dist/harness-DIdVNSwl.mjs +167 -0
- package/dist/index.d.mts +1400 -0
- package/dist/index.mjs +146 -0
- package/dist/local-cli-auth.d.mts +14 -0
- package/dist/local-cli-auth.mjs +31 -0
- package/dist/native-session-contracts-DWFzgoye.mjs +1162 -0
- package/dist/native-session-contracts.d.mts +354 -0
- package/dist/native-session-contracts.mjs +2 -0
- package/dist/servable-models.d.mts +104 -0
- package/dist/servable-models.mjs +147 -0
- package/dist/session-contract-BC75JdnA.d.mts +131 -0
- package/dist/session-contract.d.mts +2 -0
- package/dist/session-contract.mjs +190 -0
- package/dist/specs-BSELpX1h.d.mts +415 -0
- package/dist/specs-Bbiay_8K.mjs +704 -0
- package/dist/specs.d.mts +3 -0
- package/dist/specs.mjs +3 -0
- package/package.json +81 -3
|
@@ -0,0 +1,1162 @@
|
|
|
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
|
+
opencode: "1.19.4",
|
|
7
|
+
pi: "1.4.0",
|
|
8
|
+
"kimi-code": "1.49.0",
|
|
9
|
+
"factory-droids": "0.249.0",
|
|
10
|
+
amp: "0.0.1793044831-ga1b1a0",
|
|
11
|
+
prime: "0.10.1",
|
|
12
|
+
hermes: "0.22.4",
|
|
13
|
+
forge: "2.14.0",
|
|
14
|
+
openclaw: "2026.10.7",
|
|
15
|
+
acp: "claude-agent-acp 0.97.0; codex-acp 0.16.0; gemini-cli 0.65.0"
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/harness-contracts/session-stores.ts
|
|
19
|
+
const CLAUDE_PROJECTS = {
|
|
20
|
+
root: ".claude/projects",
|
|
21
|
+
files: ["*/{id}.jsonl", "*/{id}/subagents/**/*.jsonl"],
|
|
22
|
+
write: "jsonl-append",
|
|
23
|
+
shared: false,
|
|
24
|
+
format: "claude-code.projects-jsonl"
|
|
25
|
+
};
|
|
26
|
+
const CODEX_ROLLOUTS = {
|
|
27
|
+
root: ".codex/sessions",
|
|
28
|
+
files: ["*/*/*/rollout-*-{id}.jsonl"],
|
|
29
|
+
write: "jsonl-append",
|
|
30
|
+
shared: false,
|
|
31
|
+
format: "codex.rollout-jsonl"
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Rollouts codex moved out of `sessions/` when a thread was archived: the same
|
|
35
|
+
* transcript, flat under `archived_sessions/`. Without it an archived
|
|
36
|
+
* session is no store's, so no copy, capture or export carries it.
|
|
37
|
+
*/
|
|
38
|
+
const CODEX_ARCHIVED_ROLLOUTS = {
|
|
39
|
+
root: ".codex/archived_sessions",
|
|
40
|
+
files: ["rollout-*-{id}.jsonl"],
|
|
41
|
+
write: "jsonl-append",
|
|
42
|
+
shared: false,
|
|
43
|
+
format: "codex.rollout-jsonl"
|
|
44
|
+
};
|
|
45
|
+
const GEMINI_CHATS = {
|
|
46
|
+
root: ".gemini/tmp",
|
|
47
|
+
files: ["*/chats/session-*{id}*.json"],
|
|
48
|
+
write: "json-rewrite",
|
|
49
|
+
shared: false,
|
|
50
|
+
format: "gemini.chat-json"
|
|
51
|
+
};
|
|
52
|
+
const KIMI_SESSIONS = {
|
|
53
|
+
root: ".kimi/sessions",
|
|
54
|
+
files: ["*/{id}/**", "*/{id}.jsonl"],
|
|
55
|
+
write: "jsonl-append",
|
|
56
|
+
shared: false,
|
|
57
|
+
format: "kimi.session-dir"
|
|
58
|
+
};
|
|
59
|
+
const HERMES_STATE = {
|
|
60
|
+
root: ".hermes",
|
|
61
|
+
files: [
|
|
62
|
+
"state.db",
|
|
63
|
+
"state.db-wal",
|
|
64
|
+
"state.db-shm"
|
|
65
|
+
],
|
|
66
|
+
write: "sqlite-wal",
|
|
67
|
+
shared: true,
|
|
68
|
+
format: "hermes.state-sqlite"
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/harness-contracts/contracts/acp.ts
|
|
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
|
+
//#endregion
|
|
149
|
+
//#region src/harness-contracts/contracts/amp.ts
|
|
150
|
+
var amp_default = {
|
|
151
|
+
session: {
|
|
152
|
+
kind: "native",
|
|
153
|
+
processProbe: {
|
|
154
|
+
versionCommand: "amp --version",
|
|
155
|
+
kill: ["-x", "amp"]
|
|
156
|
+
},
|
|
157
|
+
contract: {
|
|
158
|
+
version: 1,
|
|
159
|
+
stores: [{
|
|
160
|
+
root: ".local/share/amp/threads",
|
|
161
|
+
files: ["{id}.json"],
|
|
162
|
+
write: "json-rewrite",
|
|
163
|
+
shared: false,
|
|
164
|
+
format: "amp.thread-json"
|
|
165
|
+
}],
|
|
166
|
+
identity: {
|
|
167
|
+
kind: "first-event",
|
|
168
|
+
event: "thread",
|
|
169
|
+
deadlineMs: 6e4
|
|
170
|
+
},
|
|
171
|
+
resume: {
|
|
172
|
+
kind: "args",
|
|
173
|
+
args: [
|
|
174
|
+
"threads",
|
|
175
|
+
"continue",
|
|
176
|
+
"{id}"
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
forbiddenArgs: [],
|
|
180
|
+
storeEnv: { XDG_DATA_HOME: ".local/share" },
|
|
181
|
+
evidence: {
|
|
182
|
+
servedModel: "session-record",
|
|
183
|
+
usage: "per-response",
|
|
184
|
+
endingError: "none"
|
|
185
|
+
},
|
|
186
|
+
cliVersion: HARNESS_CLI_VERSIONS.amp
|
|
187
|
+
},
|
|
188
|
+
defect: {
|
|
189
|
+
issue: "#10096",
|
|
190
|
+
reason: "threads live on ampcode.com; neither a local copy nor a mock-routable model is proven"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
config: {
|
|
194
|
+
kind: "model",
|
|
195
|
+
providerRequiresModel: true,
|
|
196
|
+
keySources: [
|
|
197
|
+
"api-key",
|
|
198
|
+
"api-key-env",
|
|
199
|
+
"cli-auth"
|
|
200
|
+
],
|
|
201
|
+
baseUrl: "vendor-only",
|
|
202
|
+
modelWire: "openai-compat",
|
|
203
|
+
envVars: {
|
|
204
|
+
apiKey: "AMP_API_KEY",
|
|
205
|
+
model: "AMP_MODEL_NAME",
|
|
206
|
+
authMode: "AMP_AUTH_MODE",
|
|
207
|
+
authFiles: "AMP_AUTH_FILES_JSON"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
lifecycle: {
|
|
211
|
+
runtime: void 0,
|
|
212
|
+
coldCreate: { kind: "required" },
|
|
213
|
+
warmClaim: { kind: "required" },
|
|
214
|
+
parkResume: { kind: "required" },
|
|
215
|
+
branchChild: { kind: "required" },
|
|
216
|
+
killResume: { kind: "required" }
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/harness-contracts/contracts/claude-code.ts
|
|
221
|
+
var claude_code_default = {
|
|
222
|
+
session: {
|
|
223
|
+
kind: "native",
|
|
224
|
+
processProbe: {
|
|
225
|
+
versionCommand: "claude --version",
|
|
226
|
+
kill: ["-x", "claude"]
|
|
227
|
+
},
|
|
228
|
+
contract: {
|
|
229
|
+
version: 1,
|
|
230
|
+
stores: [CLAUDE_PROJECTS],
|
|
231
|
+
identity: {
|
|
232
|
+
kind: "pre-minted",
|
|
233
|
+
args: ["--session-id", "{id}"]
|
|
234
|
+
},
|
|
235
|
+
resume: {
|
|
236
|
+
kind: "args",
|
|
237
|
+
args: ["--resume", "{id}"]
|
|
238
|
+
},
|
|
239
|
+
forbiddenArgs: ["--no-session-persistence", "--fork-session"],
|
|
240
|
+
storeEnv: { CLAUDE_CONFIG_DIR: ".claude" },
|
|
241
|
+
evidence: {
|
|
242
|
+
servedModel: "provider-response",
|
|
243
|
+
usage: "per-response",
|
|
244
|
+
endingError: "session-record"
|
|
245
|
+
},
|
|
246
|
+
cliVersion: HARNESS_CLI_VERSIONS["claude-code"]
|
|
247
|
+
},
|
|
248
|
+
defect: null
|
|
249
|
+
},
|
|
250
|
+
config: {
|
|
251
|
+
kind: "model",
|
|
252
|
+
providerRequiresModel: true,
|
|
253
|
+
assertions: [
|
|
254
|
+
"managed-full-ladder",
|
|
255
|
+
"operator-model-first",
|
|
256
|
+
"named-model-exact"
|
|
257
|
+
],
|
|
258
|
+
keySources: [
|
|
259
|
+
"managed",
|
|
260
|
+
"api-key",
|
|
261
|
+
"api-key-env",
|
|
262
|
+
"cli-auth"
|
|
263
|
+
],
|
|
264
|
+
baseUrl: "caller-or-managed",
|
|
265
|
+
modelWire: "anthropic-messages",
|
|
266
|
+
envVars: {
|
|
267
|
+
apiKey: "ANTHROPIC_API_KEY",
|
|
268
|
+
model: "CLAUDE_CODE_MODEL_NAME",
|
|
269
|
+
authMode: "CLAUDE_CODE_AUTH_MODE",
|
|
270
|
+
authFiles: "CLAUDE_CODE_AUTH_FILES_JSON",
|
|
271
|
+
oauthToken: "CLAUDE_CODE_OAUTH_TOKEN",
|
|
272
|
+
baseUrl: "ANTHROPIC_BASE_URL"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
lifecycle: {
|
|
276
|
+
runtime: {},
|
|
277
|
+
coldCreate: { kind: "required" },
|
|
278
|
+
warmClaim: { kind: "required" },
|
|
279
|
+
parkResume: { kind: "required" },
|
|
280
|
+
branchChild: { kind: "required" },
|
|
281
|
+
killResume: { kind: "required" }
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/harness-contracts/contracts/cli-base.ts
|
|
286
|
+
var cli_base_default = {
|
|
287
|
+
session: {
|
|
288
|
+
kind: "no-agent",
|
|
289
|
+
reason: "This backend runs no agent process"
|
|
290
|
+
},
|
|
291
|
+
config: {
|
|
292
|
+
kind: "no-agent",
|
|
293
|
+
envVars: {},
|
|
294
|
+
reason: "This backend accepts no model or provider"
|
|
295
|
+
},
|
|
296
|
+
lifecycle: {
|
|
297
|
+
runtime: void 0,
|
|
298
|
+
coldCreate: {
|
|
299
|
+
kind: "unsupported",
|
|
300
|
+
reason: "This backend runs no agent turn"
|
|
301
|
+
},
|
|
302
|
+
warmClaim: {
|
|
303
|
+
kind: "unsupported",
|
|
304
|
+
reason: "This backend runs no agent turn"
|
|
305
|
+
},
|
|
306
|
+
parkResume: {
|
|
307
|
+
kind: "unsupported",
|
|
308
|
+
reason: "This backend runs no agent turn"
|
|
309
|
+
},
|
|
310
|
+
branchChild: {
|
|
311
|
+
kind: "unsupported",
|
|
312
|
+
reason: "This backend runs no agent turn"
|
|
313
|
+
},
|
|
314
|
+
killResume: {
|
|
315
|
+
kind: "unsupported",
|
|
316
|
+
reason: "The backend exposes no resumable native session"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/harness-contracts/contracts/codex.ts
|
|
322
|
+
var codex_default = {
|
|
323
|
+
session: {
|
|
324
|
+
kind: "native",
|
|
325
|
+
processProbe: {
|
|
326
|
+
versionCommand: "codex --version",
|
|
327
|
+
kill: ["-f", "bin/[c]odex( |$)"]
|
|
328
|
+
},
|
|
329
|
+
contract: {
|
|
330
|
+
version: 1,
|
|
331
|
+
stores: [CODEX_ROLLOUTS, CODEX_ARCHIVED_ROLLOUTS],
|
|
332
|
+
identity: {
|
|
333
|
+
kind: "first-event",
|
|
334
|
+
event: "thread.started",
|
|
335
|
+
deadlineMs: 3e4
|
|
336
|
+
},
|
|
337
|
+
resume: {
|
|
338
|
+
kind: "args",
|
|
339
|
+
args: [
|
|
340
|
+
"exec",
|
|
341
|
+
"resume",
|
|
342
|
+
"{id}"
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
forbiddenArgs: ["--ephemeral"],
|
|
346
|
+
storeEnv: { CODEX_HOME: ".codex" },
|
|
347
|
+
evidence: {
|
|
348
|
+
servedModel: "turn-context",
|
|
349
|
+
usage: "cumulative",
|
|
350
|
+
endingError: "session-record"
|
|
351
|
+
},
|
|
352
|
+
cliVersion: HARNESS_CLI_VERSIONS.codex
|
|
353
|
+
},
|
|
354
|
+
defect: null
|
|
355
|
+
},
|
|
356
|
+
config: {
|
|
357
|
+
kind: "model",
|
|
358
|
+
providerRequiresModel: true,
|
|
359
|
+
assertions: [
|
|
360
|
+
"managed-full-ladder",
|
|
361
|
+
"operator-model-first",
|
|
362
|
+
"named-model-exact",
|
|
363
|
+
"responses-config-model-id"
|
|
364
|
+
],
|
|
365
|
+
keySources: [
|
|
366
|
+
"managed",
|
|
367
|
+
"api-key",
|
|
368
|
+
"api-key-env",
|
|
369
|
+
"cli-auth"
|
|
370
|
+
],
|
|
371
|
+
baseUrl: "caller-or-managed",
|
|
372
|
+
modelWire: "openai-responses",
|
|
373
|
+
envVars: {
|
|
374
|
+
apiKey: "OPENAI_API_KEY",
|
|
375
|
+
model: "CODEX_MODEL_NAME",
|
|
376
|
+
authMode: "CODEX_AUTH_MODE",
|
|
377
|
+
authFiles: "CODEX_AUTH_FILES_JSON",
|
|
378
|
+
baseUrl: "OPENAI_BASE_URL"
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
lifecycle: {
|
|
382
|
+
runtime: void 0,
|
|
383
|
+
coldCreate: { kind: "required" },
|
|
384
|
+
warmClaim: { kind: "required" },
|
|
385
|
+
parkResume: { kind: "required" },
|
|
386
|
+
branchChild: { kind: "required" },
|
|
387
|
+
killResume: { kind: "required" }
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/harness-contracts/contracts/cursor.ts
|
|
392
|
+
var cursor_default = {
|
|
393
|
+
session: {
|
|
394
|
+
kind: "unsupported",
|
|
395
|
+
defect: {
|
|
396
|
+
issue: "#10096",
|
|
397
|
+
reason: "runs the Cursor SDK in process; the cloud runtime stores the session remotely and model calls cannot be mocked"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
config: {
|
|
401
|
+
kind: "model",
|
|
402
|
+
providerRequiresModel: true,
|
|
403
|
+
keySources: ["api-key", "api-key-env"],
|
|
404
|
+
baseUrl: "vendor-only",
|
|
405
|
+
modelWire: "openai-compat",
|
|
406
|
+
envVars: {
|
|
407
|
+
apiKey: "CURSOR_API_KEY",
|
|
408
|
+
model: "CURSOR_MODEL_NAME"
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
lifecycle: {
|
|
412
|
+
runtime: void 0,
|
|
413
|
+
coldCreate: { kind: "required" },
|
|
414
|
+
warmClaim: { kind: "required" },
|
|
415
|
+
parkResume: { kind: "required" },
|
|
416
|
+
branchChild: { kind: "required" },
|
|
417
|
+
killResume: {
|
|
418
|
+
kind: "unsupported",
|
|
419
|
+
reason: "The backend exposes no resumable native session"
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/harness-contracts/contracts/factory-droids.ts
|
|
425
|
+
var factory_droids_default = {
|
|
426
|
+
session: {
|
|
427
|
+
kind: "native",
|
|
428
|
+
processProbe: {
|
|
429
|
+
versionCommand: "droid --version",
|
|
430
|
+
kill: ["-x", "droid"]
|
|
431
|
+
},
|
|
432
|
+
contract: {
|
|
433
|
+
version: 1,
|
|
434
|
+
stores: [{
|
|
435
|
+
root: ".factory/sessions",
|
|
436
|
+
files: ["*/{id}.jsonl"],
|
|
437
|
+
write: "jsonl-append",
|
|
438
|
+
shared: false,
|
|
439
|
+
format: "factory.session-jsonl"
|
|
440
|
+
}, {
|
|
441
|
+
root: ".factory/sessions",
|
|
442
|
+
files: ["*/{id}.settings.json"],
|
|
443
|
+
write: "json-rewrite",
|
|
444
|
+
shared: false,
|
|
445
|
+
format: "factory.session-jsonl"
|
|
446
|
+
}],
|
|
447
|
+
identity: {
|
|
448
|
+
kind: "first-event",
|
|
449
|
+
event: "session_id",
|
|
450
|
+
deadlineMs: 6e4
|
|
451
|
+
},
|
|
452
|
+
resume: {
|
|
453
|
+
kind: "args",
|
|
454
|
+
args: ["--session-id", "{id}"]
|
|
455
|
+
},
|
|
456
|
+
forbiddenArgs: [],
|
|
457
|
+
storeEnv: {},
|
|
458
|
+
evidence: {
|
|
459
|
+
servedModel: "turn-context",
|
|
460
|
+
usage: "session-total",
|
|
461
|
+
endingError: "none"
|
|
462
|
+
},
|
|
463
|
+
cliVersion: HARNESS_CLI_VERSIONS["factory-droids"]
|
|
464
|
+
},
|
|
465
|
+
defect: {
|
|
466
|
+
issue: "#10096",
|
|
467
|
+
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)"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
config: {
|
|
471
|
+
kind: "model",
|
|
472
|
+
providerRequiresModel: true,
|
|
473
|
+
keySources: [
|
|
474
|
+
"managed",
|
|
475
|
+
"api-key",
|
|
476
|
+
"api-key-env"
|
|
477
|
+
],
|
|
478
|
+
baseUrl: "caller-or-managed",
|
|
479
|
+
modelWire: "openai-compat",
|
|
480
|
+
envVars: {
|
|
481
|
+
apiKey: "FACTORY_API_KEY",
|
|
482
|
+
model: "FACTORY_DROIDS_MODEL_NAME"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
lifecycle: {
|
|
486
|
+
runtime: void 0,
|
|
487
|
+
coldCreate: { kind: "required" },
|
|
488
|
+
warmClaim: { kind: "required" },
|
|
489
|
+
parkResume: { kind: "required" },
|
|
490
|
+
branchChild: { kind: "required" },
|
|
491
|
+
killResume: { kind: "required" }
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/harness-contracts/contracts/forge.ts
|
|
496
|
+
var forge_default = {
|
|
497
|
+
session: {
|
|
498
|
+
kind: "native",
|
|
499
|
+
processProbe: {
|
|
500
|
+
versionCommand: "forgecode --version",
|
|
501
|
+
kill: ["-x", "forgecode"]
|
|
502
|
+
},
|
|
503
|
+
contract: {
|
|
504
|
+
version: 1,
|
|
505
|
+
stores: [{
|
|
506
|
+
root: ".forge",
|
|
507
|
+
files: [
|
|
508
|
+
".forge.db",
|
|
509
|
+
".forge.db-wal",
|
|
510
|
+
".forge.db-shm"
|
|
511
|
+
],
|
|
512
|
+
write: "sqlite-wal",
|
|
513
|
+
shared: true,
|
|
514
|
+
format: "forge.sqlite"
|
|
515
|
+
}],
|
|
516
|
+
identity: {
|
|
517
|
+
kind: "first-event",
|
|
518
|
+
event: "conversation",
|
|
519
|
+
deadlineMs: 6e4
|
|
520
|
+
},
|
|
521
|
+
resume: {
|
|
522
|
+
kind: "args",
|
|
523
|
+
args: ["--conversation-id", "{id}"]
|
|
524
|
+
},
|
|
525
|
+
forbiddenArgs: [],
|
|
526
|
+
storeEnv: {},
|
|
527
|
+
evidence: {
|
|
528
|
+
servedModel: "session-record",
|
|
529
|
+
usage: "per-response",
|
|
530
|
+
endingError: "none"
|
|
531
|
+
},
|
|
532
|
+
cliVersion: HARNESS_CLI_VERSIONS.forge
|
|
533
|
+
},
|
|
534
|
+
defect: {
|
|
535
|
+
issue: "#10096",
|
|
536
|
+
reason: "needs a SQLite-consistent capture and a .forge.db reader"
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
config: {
|
|
540
|
+
kind: "model",
|
|
541
|
+
providerRequiresModel: true,
|
|
542
|
+
keySources: [
|
|
543
|
+
"managed",
|
|
544
|
+
"api-key",
|
|
545
|
+
"api-key-env",
|
|
546
|
+
"cli-auth"
|
|
547
|
+
],
|
|
548
|
+
baseUrl: "caller-or-managed",
|
|
549
|
+
modelWire: "openai-compat",
|
|
550
|
+
envVars: {
|
|
551
|
+
apiKey: "FORGE_API_KEY",
|
|
552
|
+
model: "FORGE_MODEL_ID",
|
|
553
|
+
authMode: "FORGE_AUTH_MODE",
|
|
554
|
+
authFiles: "FORGE_AUTH_FILES_JSON",
|
|
555
|
+
extras: {
|
|
556
|
+
FORGE_SESSION__PROVIDER_ID: { parser: "string" },
|
|
557
|
+
FORGE_SESSION__MODEL_ID: { parser: "string" },
|
|
558
|
+
FORGE_AGENT_ID: { parser: "string" }
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
lifecycle: {
|
|
563
|
+
runtime: void 0,
|
|
564
|
+
coldCreate: { kind: "required" },
|
|
565
|
+
warmClaim: { kind: "required" },
|
|
566
|
+
parkResume: { kind: "required" },
|
|
567
|
+
branchChild: { kind: "required" },
|
|
568
|
+
killResume: { kind: "required" }
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
//#endregion
|
|
572
|
+
//#region src/harness-contracts/contracts/hermes.ts
|
|
573
|
+
var hermes_default = {
|
|
574
|
+
session: {
|
|
575
|
+
kind: "native",
|
|
576
|
+
processProbe: {
|
|
577
|
+
versionCommand: "hermes --version",
|
|
578
|
+
kill: ["-f", "(^|/)[h]ermes( |$)"]
|
|
579
|
+
},
|
|
580
|
+
contract: {
|
|
581
|
+
version: 1,
|
|
582
|
+
stores: [HERMES_STATE],
|
|
583
|
+
identity: {
|
|
584
|
+
kind: "first-event",
|
|
585
|
+
event: "session_id",
|
|
586
|
+
deadlineMs: 6e4
|
|
587
|
+
},
|
|
588
|
+
resume: {
|
|
589
|
+
kind: "args",
|
|
590
|
+
args: ["--resume", "{id}"]
|
|
591
|
+
},
|
|
592
|
+
forbiddenArgs: [],
|
|
593
|
+
storeEnv: { HERMES_HOME: ".hermes" },
|
|
594
|
+
evidence: {
|
|
595
|
+
servedModel: "session-record",
|
|
596
|
+
usage: "session-total",
|
|
597
|
+
endingError: "none"
|
|
598
|
+
},
|
|
599
|
+
cliVersion: HARNESS_CLI_VERSIONS.hermes
|
|
600
|
+
},
|
|
601
|
+
defect: {
|
|
602
|
+
issue: "#10096",
|
|
603
|
+
reason: "HERMES_HOME lives under the workspace, and the session id arrives on stderr after exit"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
config: {
|
|
607
|
+
kind: "model",
|
|
608
|
+
providerRequiresModel: true,
|
|
609
|
+
keySources: [
|
|
610
|
+
"managed",
|
|
611
|
+
"api-key",
|
|
612
|
+
"api-key-env",
|
|
613
|
+
"cli-auth"
|
|
614
|
+
],
|
|
615
|
+
baseUrl: "caller-or-managed",
|
|
616
|
+
modelWire: "openai-compat",
|
|
617
|
+
envVars: {
|
|
618
|
+
apiKey: "HERMES_API_KEY",
|
|
619
|
+
model: "HERMES_MODEL_NAME",
|
|
620
|
+
authMode: "HERMES_AUTH_MODE",
|
|
621
|
+
authFiles: "HERMES_AUTH_FILES_JSON",
|
|
622
|
+
baseUrl: "HERMES_BASE_URL",
|
|
623
|
+
extras: { HERMES_INFERENCE_PROVIDER: { parser: "string" } }
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
lifecycle: {
|
|
627
|
+
runtime: void 0,
|
|
628
|
+
coldCreate: { kind: "required" },
|
|
629
|
+
warmClaim: { kind: "required" },
|
|
630
|
+
parkResume: { kind: "required" },
|
|
631
|
+
branchChild: { kind: "required" },
|
|
632
|
+
killResume: { kind: "required" }
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region ../runtime-contracts/dist/harness-warm-transport.js
|
|
637
|
+
/** Set only by the Sandbox API after the OpenCode warm-server rollout decision. */
|
|
638
|
+
const AGENT_INTERNAL_OPENCODE_WARM_SERVER_ENV_VAR = "AGENT_INTERNAL_OPENCODE_WARM_SERVER";
|
|
639
|
+
/**
|
|
640
|
+
* Sidecar switch: after a warm claim, start the first session's OpenCode
|
|
641
|
+
* server before that session's first turn. Effective only with
|
|
642
|
+
* AGENT_INTERNAL_OPENCODE_WARM_SERVER=1. Any value other than "1" is off.
|
|
643
|
+
*/
|
|
644
|
+
const AGENT_INTERNAL_OPENCODE_PREWARM_ENV_VAR = "AGENT_INTERNAL_OPENCODE_PREWARM";
|
|
645
|
+
/** Persistent Kimi wire process and shared create/resume prewarm gates. */
|
|
646
|
+
const AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR = "AGENT_INTERNAL_KIMI_WARM_SERVER";
|
|
647
|
+
/**
|
|
648
|
+
* Per harness, the two switches the Sandbox API sets from its warm-server
|
|
649
|
+
* rollout decision: the long-lived process transport, and prewarm, which
|
|
650
|
+
* starts that process before the turn that uses it and is only meaningful
|
|
651
|
+
* with it. A harness joins the rollout by adding one row; the Sandbox API,
|
|
652
|
+
* the orchestrator's provision guard and its recreate carry all read this
|
|
653
|
+
* table. Values are "1" or "0"; anything else is off.
|
|
654
|
+
*/
|
|
655
|
+
const HARNESS_WARM_TRANSPORT_ENV = {
|
|
656
|
+
opencode: {
|
|
657
|
+
warmServer: AGENT_INTERNAL_OPENCODE_WARM_SERVER_ENV_VAR,
|
|
658
|
+
prewarm: AGENT_INTERNAL_OPENCODE_PREWARM_ENV_VAR
|
|
659
|
+
},
|
|
660
|
+
"kimi-code": {
|
|
661
|
+
warmServer: AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR,
|
|
662
|
+
prewarm: "AGENT_INTERNAL_KIMI_PREWARM"
|
|
663
|
+
},
|
|
664
|
+
"claude-code": {
|
|
665
|
+
warmServer: "AGENT_INTERNAL_CLAUDE_CODE_WARM_SERVER",
|
|
666
|
+
prewarm: "AGENT_INTERNAL_CLAUDE_CODE_PREWARM"
|
|
667
|
+
},
|
|
668
|
+
codex: {
|
|
669
|
+
warmServer: "AGENT_INTERNAL_CODEX_WARM_SERVER",
|
|
670
|
+
prewarm: "AGENT_INTERNAL_CODEX_PREWARM"
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
//#endregion
|
|
674
|
+
//#region src/harness-contracts/contracts/kimi-code.ts
|
|
675
|
+
var kimi_code_default = {
|
|
676
|
+
session: {
|
|
677
|
+
kind: "native",
|
|
678
|
+
processProbe: {
|
|
679
|
+
versionCommand: "kimi --version",
|
|
680
|
+
kill: ["-f", "^[K]imi Code"]
|
|
681
|
+
},
|
|
682
|
+
contract: {
|
|
683
|
+
version: 1,
|
|
684
|
+
stores: [KIMI_SESSIONS],
|
|
685
|
+
identity: {
|
|
686
|
+
kind: "pre-minted",
|
|
687
|
+
args: ["--session", "{id}"]
|
|
688
|
+
},
|
|
689
|
+
resume: {
|
|
690
|
+
kind: "args",
|
|
691
|
+
args: ["--session", "{id}"]
|
|
692
|
+
},
|
|
693
|
+
forbiddenArgs: [],
|
|
694
|
+
storeEnv: {},
|
|
695
|
+
evidence: {
|
|
696
|
+
servedModel: "session-record",
|
|
697
|
+
usage: "per-response",
|
|
698
|
+
endingError: "none"
|
|
699
|
+
},
|
|
700
|
+
cliVersion: HARNESS_CLI_VERSIONS["kimi-code"]
|
|
701
|
+
},
|
|
702
|
+
defect: {
|
|
703
|
+
issue: "#10096",
|
|
704
|
+
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)"
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
config: {
|
|
708
|
+
kind: "model",
|
|
709
|
+
providerRequiresModel: true,
|
|
710
|
+
assertions: ["moonshot-provider-lock"],
|
|
711
|
+
keySources: [
|
|
712
|
+
"managed",
|
|
713
|
+
"api-key",
|
|
714
|
+
"api-key-env",
|
|
715
|
+
"cli-auth"
|
|
716
|
+
],
|
|
717
|
+
baseUrl: "caller-or-managed",
|
|
718
|
+
modelWire: "openai-compat",
|
|
719
|
+
envVars: {
|
|
720
|
+
apiKey: "MOONSHOT_API_KEY",
|
|
721
|
+
model: "KIMI_CODE_MODEL_NAME",
|
|
722
|
+
authMode: "KIMI_CODE_AUTH_MODE",
|
|
723
|
+
authFiles: "KIMI_CODE_AUTH_FILES_JSON",
|
|
724
|
+
extras: { OPENAI_BASE_URL: { parser: "string" } }
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
lifecycle: {
|
|
728
|
+
runtime: { warmRetention: {
|
|
729
|
+
envVar: AGENT_INTERNAL_KIMI_WARM_SERVER_ENV_VAR,
|
|
730
|
+
enabledByDefault: false
|
|
731
|
+
} },
|
|
732
|
+
coldCreate: { kind: "required" },
|
|
733
|
+
warmClaim: { kind: "required" },
|
|
734
|
+
parkResume: { kind: "required" },
|
|
735
|
+
branchChild: { kind: "required" },
|
|
736
|
+
killResume: { kind: "required" }
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/harness-contracts/contracts/nanoclaw.ts
|
|
741
|
+
var nanoclaw_default = {
|
|
742
|
+
session: {
|
|
743
|
+
kind: "unsupported",
|
|
744
|
+
defect: {
|
|
745
|
+
issue: "#10096",
|
|
746
|
+
reason: "runs chat.ts against a NanoClaw daemon over a Unix socket: no session id, no resume, and the store belongs to the daemon"
|
|
747
|
+
}
|
|
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: {
|
|
781
|
+
kind: "unsupported",
|
|
782
|
+
reason: "The backend exposes no resumable native session"
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/harness-contracts/contracts/openclaw.ts
|
|
788
|
+
var openclaw_default = {
|
|
789
|
+
session: {
|
|
790
|
+
kind: "native",
|
|
791
|
+
processProbe: {
|
|
792
|
+
versionCommand: "openclaw --version",
|
|
793
|
+
kill: ["-f", "[o]penclaw(\\.mjs)?( |$)"]
|
|
794
|
+
},
|
|
795
|
+
contract: {
|
|
796
|
+
version: 1,
|
|
797
|
+
stores: [{
|
|
798
|
+
root: ".openclaw/agents",
|
|
799
|
+
files: ["**/{id}.jsonl"],
|
|
800
|
+
write: "jsonl-append",
|
|
801
|
+
shared: false,
|
|
802
|
+
format: "openclaw.session-jsonl"
|
|
803
|
+
}],
|
|
804
|
+
identity: {
|
|
805
|
+
kind: "first-event",
|
|
806
|
+
event: "session",
|
|
807
|
+
deadlineMs: 6e4
|
|
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: {
|
|
823
|
+
issue: "#10096",
|
|
824
|
+
reason: "config is pinned outside the runtime HOME; store layout unverified"
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
config: {
|
|
828
|
+
kind: "model",
|
|
829
|
+
providerRequiresModel: true,
|
|
830
|
+
keySources: [
|
|
831
|
+
"managed",
|
|
832
|
+
"api-key",
|
|
833
|
+
"api-key-env",
|
|
834
|
+
"cli-auth"
|
|
835
|
+
],
|
|
836
|
+
baseUrl: "caller-or-managed",
|
|
837
|
+
modelWire: "openai-compat",
|
|
838
|
+
envVars: {
|
|
839
|
+
apiKey: "OPENCODE_MODEL_API_KEY",
|
|
840
|
+
model: "TANGLE_ROUTER_MODEL",
|
|
841
|
+
baseUrl: "TANGLE_ROUTER_BASE_URL",
|
|
842
|
+
authMode: "OPENCLAW_AUTH_MODE",
|
|
843
|
+
authFiles: "OPENCLAW_AUTH_FILES_JSON"
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
lifecycle: {
|
|
847
|
+
runtime: void 0,
|
|
848
|
+
coldCreate: { kind: "required" },
|
|
849
|
+
warmClaim: { kind: "required" },
|
|
850
|
+
parkResume: { kind: "required" },
|
|
851
|
+
branchChild: { kind: "required" },
|
|
852
|
+
killResume: { kind: "required" }
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region src/harness-contracts/index.ts
|
|
857
|
+
const HARNESSES = {
|
|
858
|
+
"claude-code": claude_code_default,
|
|
859
|
+
codex: codex_default,
|
|
860
|
+
opencode: {
|
|
861
|
+
session: {
|
|
862
|
+
kind: "native",
|
|
863
|
+
processProbe: {
|
|
864
|
+
versionCommand: "opencode --version",
|
|
865
|
+
kill: ["-x", "opencode"]
|
|
866
|
+
},
|
|
867
|
+
contract: {
|
|
868
|
+
version: 1,
|
|
869
|
+
stores: [{
|
|
870
|
+
root: ".local/share/opencode",
|
|
871
|
+
files: [
|
|
872
|
+
"opencode.db",
|
|
873
|
+
"opencode.db-wal",
|
|
874
|
+
"opencode.db-shm"
|
|
875
|
+
],
|
|
876
|
+
write: "sqlite-wal",
|
|
877
|
+
shared: true,
|
|
878
|
+
format: "opencode.sqlite"
|
|
879
|
+
}],
|
|
880
|
+
identity: {
|
|
881
|
+
kind: "first-event",
|
|
882
|
+
event: "sessionID",
|
|
883
|
+
deadlineMs: 3e5
|
|
884
|
+
},
|
|
885
|
+
resume: {
|
|
886
|
+
kind: "args",
|
|
887
|
+
args: ["--session", "{id}"]
|
|
888
|
+
},
|
|
889
|
+
forbiddenArgs: [],
|
|
890
|
+
storeEnv: { XDG_DATA_HOME: ".local/share" },
|
|
891
|
+
evidence: {
|
|
892
|
+
servedModel: "turn-context",
|
|
893
|
+
usage: "per-response",
|
|
894
|
+
endingError: "session-record"
|
|
895
|
+
},
|
|
896
|
+
cliVersion: HARNESS_CLI_VERSIONS.opencode
|
|
897
|
+
},
|
|
898
|
+
defect: null
|
|
899
|
+
},
|
|
900
|
+
config: {
|
|
901
|
+
kind: "model",
|
|
902
|
+
providerRequiresModel: true,
|
|
903
|
+
keySources: [
|
|
904
|
+
"managed",
|
|
905
|
+
"api-key",
|
|
906
|
+
"api-key-env"
|
|
907
|
+
],
|
|
908
|
+
baseUrl: "caller-or-managed",
|
|
909
|
+
modelWire: "openai-compat",
|
|
910
|
+
envVars: {
|
|
911
|
+
apiKey: "OPENCODE_MODEL_API_KEY",
|
|
912
|
+
model: "OPENCODE_MODEL_NAME",
|
|
913
|
+
baseUrl: "OPENCODE_MODEL_BASE_URL",
|
|
914
|
+
extras: {
|
|
915
|
+
OPENCODE_MODEL_PROVIDER: {
|
|
916
|
+
parser: "string",
|
|
917
|
+
role: "provider"
|
|
918
|
+
},
|
|
919
|
+
OPENCODE_MODEL_MODE: {
|
|
920
|
+
parser: "string",
|
|
921
|
+
role: "mode"
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
lifecycle: {
|
|
927
|
+
runtime: {
|
|
928
|
+
redactsHostEnv: true,
|
|
929
|
+
supportsToolDisabledTurns: true
|
|
930
|
+
},
|
|
931
|
+
coldCreate: { kind: "required" },
|
|
932
|
+
warmClaim: { kind: "required" },
|
|
933
|
+
parkResume: { kind: "required" },
|
|
934
|
+
branchChild: { kind: "required" },
|
|
935
|
+
killResume: { kind: "required" }
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
pi: {
|
|
939
|
+
session: {
|
|
940
|
+
kind: "native",
|
|
941
|
+
processProbe: {
|
|
942
|
+
versionCommand: "pi --version",
|
|
943
|
+
kill: ["-x", "pi"]
|
|
944
|
+
},
|
|
945
|
+
contract: {
|
|
946
|
+
version: 1,
|
|
947
|
+
stores: [{
|
|
948
|
+
root: ".pi/agent/sessions",
|
|
949
|
+
files: ["**/*_{id}.jsonl"],
|
|
950
|
+
write: "jsonl-append",
|
|
951
|
+
shared: false,
|
|
952
|
+
format: "pi.session-jsonl"
|
|
953
|
+
}],
|
|
954
|
+
identity: {
|
|
955
|
+
kind: "pre-minted",
|
|
956
|
+
args: ["--session-id", "{id}"]
|
|
957
|
+
},
|
|
958
|
+
resume: {
|
|
959
|
+
kind: "args",
|
|
960
|
+
args: ["--session", "{id}"]
|
|
961
|
+
},
|
|
962
|
+
forbiddenArgs: [
|
|
963
|
+
"--no-session",
|
|
964
|
+
"--fork",
|
|
965
|
+
"--continue"
|
|
966
|
+
],
|
|
967
|
+
storeEnv: {
|
|
968
|
+
PI_CODING_AGENT_DIR: ".pi/agent",
|
|
969
|
+
PI_CODING_AGENT_SESSION_DIR: ".pi/agent/sessions",
|
|
970
|
+
"--session-dir": ".pi/agent/sessions"
|
|
971
|
+
},
|
|
972
|
+
evidence: {
|
|
973
|
+
servedModel: "session-record",
|
|
974
|
+
usage: "per-response",
|
|
975
|
+
endingError: "session-record"
|
|
976
|
+
},
|
|
977
|
+
cliVersion: HARNESS_CLI_VERSIONS.pi
|
|
978
|
+
},
|
|
979
|
+
defect: null
|
|
980
|
+
},
|
|
981
|
+
config: {
|
|
982
|
+
kind: "model",
|
|
983
|
+
providerRequiresModel: true,
|
|
984
|
+
keySources: [
|
|
985
|
+
"managed",
|
|
986
|
+
"api-key",
|
|
987
|
+
"api-key-env",
|
|
988
|
+
"cli-auth"
|
|
989
|
+
],
|
|
990
|
+
baseUrl: "caller-or-managed",
|
|
991
|
+
modelWire: "openai-compat",
|
|
992
|
+
envVars: {
|
|
993
|
+
apiKey: "OPENCODE_MODEL_API_KEY",
|
|
994
|
+
model: "TANGLE_ROUTER_MODEL",
|
|
995
|
+
baseUrl: "TANGLE_ROUTER_BASE_URL"
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
lifecycle: {
|
|
999
|
+
runtime: {},
|
|
1000
|
+
coldCreate: { kind: "required" },
|
|
1001
|
+
warmClaim: { kind: "required" },
|
|
1002
|
+
parkResume: { kind: "required" },
|
|
1003
|
+
branchChild: { kind: "required" },
|
|
1004
|
+
killResume: { kind: "required" }
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
"kimi-code": kimi_code_default,
|
|
1008
|
+
"factory-droids": factory_droids_default,
|
|
1009
|
+
amp: amp_default,
|
|
1010
|
+
prime: {
|
|
1011
|
+
session: {
|
|
1012
|
+
kind: "native",
|
|
1013
|
+
processProbe: {
|
|
1014
|
+
versionCommand: "prime-agent --version",
|
|
1015
|
+
kill: ["-f", "[p]rime-agent"]
|
|
1016
|
+
},
|
|
1017
|
+
contract: {
|
|
1018
|
+
version: 1,
|
|
1019
|
+
stores: [{
|
|
1020
|
+
root: ".prime-provider/prime-agent-dirs",
|
|
1021
|
+
files: ["**/*_{id}.jsonl"],
|
|
1022
|
+
write: "jsonl-append",
|
|
1023
|
+
shared: false,
|
|
1024
|
+
format: "prime.session-jsonl"
|
|
1025
|
+
}],
|
|
1026
|
+
identity: {
|
|
1027
|
+
kind: "api-created",
|
|
1028
|
+
call: "acp session/new"
|
|
1029
|
+
},
|
|
1030
|
+
resume: { kind: "api" },
|
|
1031
|
+
forbiddenArgs: ["--no-session"],
|
|
1032
|
+
storeEnv: {},
|
|
1033
|
+
evidence: {
|
|
1034
|
+
servedModel: "session-record",
|
|
1035
|
+
usage: "per-response",
|
|
1036
|
+
endingError: "session-record"
|
|
1037
|
+
},
|
|
1038
|
+
cliVersion: HARNESS_CLI_VERSIONS.prime
|
|
1039
|
+
},
|
|
1040
|
+
defect: {
|
|
1041
|
+
issue: "#10096",
|
|
1042
|
+
reason: "no conformance receipt for the runtime-HOME agent dir yet"
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
config: {
|
|
1046
|
+
kind: "model",
|
|
1047
|
+
providerRequiresModel: true,
|
|
1048
|
+
keySources: [
|
|
1049
|
+
"managed",
|
|
1050
|
+
"api-key",
|
|
1051
|
+
"api-key-env"
|
|
1052
|
+
],
|
|
1053
|
+
baseUrl: "caller-or-managed",
|
|
1054
|
+
modelWire: "openai-compat",
|
|
1055
|
+
envVars: {
|
|
1056
|
+
apiKey: "OPENCODE_MODEL_API_KEY",
|
|
1057
|
+
model: "TANGLE_ROUTER_MODEL",
|
|
1058
|
+
baseUrl: "TANGLE_ROUTER_BASE_URL"
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
lifecycle: {
|
|
1062
|
+
runtime: void 0,
|
|
1063
|
+
coldCreate: { kind: "required" },
|
|
1064
|
+
warmClaim: { kind: "required" },
|
|
1065
|
+
parkResume: { kind: "required" },
|
|
1066
|
+
branchChild: { kind: "required" },
|
|
1067
|
+
killResume: { kind: "required" }
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
hermes: hermes_default,
|
|
1071
|
+
forge: forge_default,
|
|
1072
|
+
openclaw: openclaw_default,
|
|
1073
|
+
nanoclaw: nanoclaw_default,
|
|
1074
|
+
acp: acp_default,
|
|
1075
|
+
cursor: cursor_default,
|
|
1076
|
+
"cli-base": cli_base_default
|
|
1077
|
+
};
|
|
1078
|
+
//#endregion
|
|
1079
|
+
//#region src/native-session-contracts.ts
|
|
1080
|
+
/**
|
|
1081
|
+
* The native session projection of the per-harness declarations in harness-contracts/. Each entry is
|
|
1082
|
+
* proven by a conformance receipt (tests/harness/receipts) for
|
|
1083
|
+
* its pinned CLI version, or is listed in HARNESS_CONFORMANCE_PENDING.
|
|
1084
|
+
*
|
|
1085
|
+
* CLI versions are the pins in infra/nix (agent-clis.json and flake.nix),
|
|
1086
|
+
* generated into harness-cli-versions.ts by the bump. The registry test
|
|
1087
|
+
* tests/harness-session-contract.test.ts fails when a pin, a contract or an
|
|
1088
|
+
* adapter's source moves without a new receipt.
|
|
1089
|
+
*/
|
|
1090
|
+
const NATIVE_SESSION_CONTRACTS = {
|
|
1091
|
+
"claude-code": HARNESSES["claude-code"].session.contract,
|
|
1092
|
+
codex: HARNESSES["codex"].session.contract,
|
|
1093
|
+
opencode: HARNESSES["opencode"].session.contract,
|
|
1094
|
+
pi: HARNESSES["pi"].session.contract,
|
|
1095
|
+
"kimi-code": HARNESSES["kimi-code"].session.contract,
|
|
1096
|
+
"factory-droids": HARNESSES["factory-droids"].session.contract,
|
|
1097
|
+
amp: HARNESSES["amp"].session.contract,
|
|
1098
|
+
prime: HARNESSES["prime"].session.contract,
|
|
1099
|
+
hermes: HARNESSES["hermes"].session.contract,
|
|
1100
|
+
forge: HARNESSES["forge"].session.contract,
|
|
1101
|
+
openclaw: HARNESSES["openclaw"].session.contract,
|
|
1102
|
+
acp: HARNESSES["acp"].session.contract
|
|
1103
|
+
};
|
|
1104
|
+
const HOME_KEYED_RUNTIMES = new Set(["opencode"]);
|
|
1105
|
+
/**
|
|
1106
|
+
* The child environment of a harness whose contract can move every native
|
|
1107
|
+
* store off HOME, or undefined when it cannot.
|
|
1108
|
+
*
|
|
1109
|
+
* HOME becomes the shared agent home, so toolchains and repos the agent puts
|
|
1110
|
+
* under ~ persist across sessions and restarts. Each declared store env and
|
|
1111
|
+
* the XDG roots stay in the private runtime home, so credentials, config and
|
|
1112
|
+
* session records do not collide between sessions. A harness whose contract
|
|
1113
|
+
* declares no store env (kimi-code, factory-droids, forge, openclaw, acp,
|
|
1114
|
+
* prime) writes credentials straight under HOME and keeps the private HOME.
|
|
1115
|
+
* So does OpenCode: its warm-server pool, spare adoption, plugin dependencies
|
|
1116
|
+
* and correlation file all use HOME as the session's runtime identity, and a
|
|
1117
|
+
* shared HOME would merge those identities across sessions.
|
|
1118
|
+
*/
|
|
1119
|
+
function configDirHomeEnv(harness, runtimeHome, agentHome) {
|
|
1120
|
+
const contract = NATIVE_SESSION_CONTRACTS[harness];
|
|
1121
|
+
const stores = Object.entries(contract?.storeEnv ?? {}).filter(([name]) => !name.startsWith("--"));
|
|
1122
|
+
if (stores.length === 0 || HOME_KEYED_RUNTIMES.has(harness)) return void 0;
|
|
1123
|
+
const home = runtimeHome.replace(/\/+$/u, "");
|
|
1124
|
+
return {
|
|
1125
|
+
HOME: agentHome,
|
|
1126
|
+
XDG_CONFIG_HOME: `${home}/.config`,
|
|
1127
|
+
XDG_CACHE_HOME: `${home}/.cache`,
|
|
1128
|
+
XDG_DATA_HOME: `${home}/.local/share`,
|
|
1129
|
+
XDG_STATE_HOME: `${home}/.local/state`,
|
|
1130
|
+
...Object.fromEntries(stores.map(([name, relative]) => [name, `${home}/${relative}`]))
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* Harnesses whose declared contract has no conformance receipt yet, with
|
|
1135
|
+
* the reason. They keep running with persistence-disabling flags refused,
|
|
1136
|
+
* but the store-location and identity-deadline checks wait for their
|
|
1137
|
+
* receipt. This list may only shrink: tests/harness-session-contract.test.ts
|
|
1138
|
+
* fails on a new entry, and on an entry whose receipt now passes.
|
|
1139
|
+
*/
|
|
1140
|
+
const HARNESS_CONFORMANCE_PENDING = {
|
|
1141
|
+
"kimi-code": HARNESSES["kimi-code"].session.defect.reason,
|
|
1142
|
+
"factory-droids": HARNESSES["factory-droids"].session.defect.reason,
|
|
1143
|
+
amp: HARNESSES["amp"].session.defect.reason,
|
|
1144
|
+
prime: HARNESSES["prime"].session.defect.reason,
|
|
1145
|
+
hermes: HARNESSES["hermes"].session.defect.reason,
|
|
1146
|
+
forge: HARNESSES["forge"].session.defect.reason,
|
|
1147
|
+
openclaw: HARNESSES["openclaw"].session.defect.reason,
|
|
1148
|
+
acp: HARNESSES["acp"].session.defect.reason
|
|
1149
|
+
};
|
|
1150
|
+
/**
|
|
1151
|
+
* Harnesses that cannot meet the contract at all. They stay listed until
|
|
1152
|
+
* their product surfaces (sandbox web launch list, CLI connect, SDK
|
|
1153
|
+
* placement) drop them, and no capture claims their sessions.
|
|
1154
|
+
*/
|
|
1155
|
+
const HARNESS_SESSION_UNSUPPORTED = {
|
|
1156
|
+
nanoclaw: HARNESSES["nanoclaw"].session.defect.reason,
|
|
1157
|
+
cursor: HARNESSES["cursor"].session.defect.reason
|
|
1158
|
+
};
|
|
1159
|
+
//#endregion
|
|
1160
|
+
export { HARNESSES as a, configDirHomeEnv as i, HARNESS_SESSION_UNSUPPORTED as n, HARNESS_WARM_TRANSPORT_ENV as o, NATIVE_SESSION_CONTRACTS as r, HARNESS_CONFORMANCE_PENDING as t };
|
|
1161
|
+
|
|
1162
|
+
//# sourceMappingURL=native-session-contracts-DWFzgoye.mjs.map
|