@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,735 @@
1
+ import { t as HARNESSES } from "./harness-contracts-BZoECCMc.mjs";
2
+ import { NATIVE_SESSION_CONTRACTS } from "./native-session-contracts.mjs";
3
+ import { n as BACKEND_TYPE } from "./backend-types-CNo_Zj_K.mjs";
4
+ import { agentProfileJsonSchema, agentProfileSchema } from "@tangle-network/agent-interface";
5
+ import { z } from "zod";
6
+ import { harnessModelSupport } from "@tangle-network/agent-interface/harness-capabilities";
7
+ //#region src/synthetic-router-model.mjs
8
+ /** Synthetic Router model shared with bare-Node release probes. */
9
+ const SYNTHETIC_ROUTER_MODEL = "tangle/canary-echo";
10
+ //#endregion
11
+ //#region src/spec.ts
12
+ /**
13
+ * The Router's synthetic model: the Router answers it itself, with no provider
14
+ * call and no charge (tangle-router `lib/synthetic-models.ts`). It replies with
15
+ * the text of the last "Reply with exactly <text>" instruction it receives, on
16
+ * every wire a harness speaks (chat completions, Messages, Responses). The
17
+ * production canary and the production benchmark's harness legs run it, so a
18
+ * provider outage or a model-list change cannot page them and they cost $0.
19
+ * A key reaches it only when its model list names it.
20
+ */
21
+ /**
22
+ * Env var name declared with `role` in this spec's extras, or undefined when
23
+ * the spec declares none. At most one extra may carry a given role (enforced
24
+ * by a registry test); the first declaration wins.
25
+ */
26
+ function cliAgentEnvRoleName(spec, role) {
27
+ const extras = spec.envVars.extras;
28
+ if (!extras) return void 0;
29
+ for (const [name, extra] of Object.entries(extras)) if (extra.role === role) return name;
30
+ }
31
+ /** The wire a harness speaks; harnesses that declare none ride openai-compat. */
32
+ function harnessModelWire(spec) {
33
+ return spec.modelWire ?? "openai-compat";
34
+ }
35
+ /**
36
+ * Provider names that select the Router's OpenAI-compatible transport. They say
37
+ * how a request travels, not which vendor serves the model, so a model check
38
+ * never reads them as the model's provider.
39
+ */
40
+ const ROUTER_TRANSPORT_PROVIDERS = new Set(["openai-compat", "tangle-router"]);
41
+ /**
42
+ * The model id a harness and model check reads: a `provider/model` slug as
43
+ * given, a bare id qualified by its tuple's vendor provider, and a bare id
44
+ * alone when the tuple names only the Router transport (agent-interface then
45
+ * resolves its provider from the id's family).
46
+ */
47
+ function canonicalModelSlug(model) {
48
+ const tuple = typeof model === "string" ? { model } : model;
49
+ const id = tuple?.model?.trim();
50
+ if (!id) return void 0;
51
+ if (id.includes("/")) return id;
52
+ const provider = tuple?.provider?.trim();
53
+ return provider && !ROUTER_TRANSPORT_PROVIDERS.has(provider) ? `${provider}/${id}` : id;
54
+ }
55
+ /**
56
+ * Whether a harness can run a model, read from the one capability table in
57
+ * `@tangle-network/agent-interface`: pairs measured to fail on production
58
+ * (and any vendor lock it declares). A refused pair is refused
59
+ * where it is chosen (create, run, an authored workflow action) with the
60
+ * returned message, rather than provisioning a box whose first model call
61
+ * fails. An absent model is the harness's own default and is always supported.
62
+ */
63
+ function harnessModelSupportFor(harness, model, options = {}) {
64
+ const slug = canonicalModelSlug(model);
65
+ if (slug === void 0) return {
66
+ supported: true,
67
+ model: "",
68
+ provider: null
69
+ };
70
+ if (slug === "tangle/canary-echo") return {
71
+ supported: true,
72
+ model: slug,
73
+ provider: null
74
+ };
75
+ return harnessModelSupport(harness, slug, options);
76
+ }
77
+ /**
78
+ * Env var names carrying this harness's claim-deliverable model tuple — the
79
+ * names a warm-claim rebind may deliver to a live sidecar: the model /
80
+ * base-URL / auth-mode roles plus declared extras. Deliberately EXCLUDES the
81
+ * credential-bearing roles: `apiKey` (a BYO key outside egress proxy-swap
82
+ * coverage would put a raw secret in the rebind body — the caller adds the
83
+ * name back only when its transport guarantees a dummy value) and `authFiles`
84
+ * (auth-file payloads are credential content and never ride a rebind).
85
+ */
86
+ function cliAgentClaimEnvVarNames(spec) {
87
+ const names = [];
88
+ if (spec.envVars.model) names.push(spec.envVars.model);
89
+ if (spec.envVars.baseUrl) names.push(spec.envVars.baseUrl);
90
+ if (spec.envVars.authMode) names.push(spec.envVars.authMode);
91
+ if (spec.envVars.extras) names.push(...Object.keys(spec.envVars.extras));
92
+ return names;
93
+ }
94
+ //#endregion
95
+ //#region src/specs.ts
96
+ z.globalRegistry.add(agentProfileSchema, {
97
+ id: "AgentProfile",
98
+ ...agentProfileJsonSchema
99
+ });
100
+ /**
101
+ * Env var naming a sandbox's selected backend. Stamped into every create env
102
+ * by the orchestrator (`buildSidecarContainerConfig`); read by the sidecar's
103
+ * backend resolution (`resolveConfiguredBackend`) and by the host-agent's
104
+ * warm-claim env selection to pick which spec's env vars the rebind delivers.
105
+ */
106
+ const AGENT_BACKEND_ENV_VAR = "AGENT_BACKEND";
107
+ /** Salted proxy model key. The name OPENCODE_MODEL_API_KEY is load-bearing; do not rename it. */
108
+ const MANAGED_MODEL_KEY_ENV_VAR = "OPENCODE_MODEL_API_KEY";
109
+ /** Name of the box env var holding a caller-owned provider key. A name, never a secret. */
110
+ const MANAGED_MODEL_KEY_NAME_ENV_VAR = "OPENCODE_MODEL_API_KEY_ENV";
111
+ /**
112
+ * Env var names declared across ALL registered harness specs, grouped by
113
+ * their `CliAgentEnvVars` role. The ONE derivation every allowlist that must
114
+ * track "what env names can a backend legitimately use" builds from — the
115
+ * FC kernel-cmdline whitelist, the egress secret handling, the sidecar
116
+ * terminal scrub, the SSH env forward, and the rebind union below. Deriving
117
+ * from roles (not one flat set) lets each consumer apply its own security
118
+ * policy per role: apiKey and oauthToken names are secret channels.
119
+ * Native subscription tokens stay out of warm-claim delivery.
120
+ */
121
+ function cliAgentEnvVarNamesByRole() {
122
+ const apiKey = /* @__PURE__ */ new Set();
123
+ const oauthToken = /* @__PURE__ */ new Set();
124
+ const model = /* @__PURE__ */ new Set();
125
+ const baseUrl = /* @__PURE__ */ new Set();
126
+ const authMode = /* @__PURE__ */ new Set();
127
+ const authFiles = /* @__PURE__ */ new Set();
128
+ const extras = /* @__PURE__ */ new Set();
129
+ for (const spec of CLI_AGENT_SPECS) {
130
+ if (spec.envVars.apiKey) apiKey.add(spec.envVars.apiKey);
131
+ if (spec.envVars.oauthToken) oauthToken.add(spec.envVars.oauthToken);
132
+ if (spec.envVars.model) model.add(spec.envVars.model);
133
+ if (spec.envVars.baseUrl) baseUrl.add(spec.envVars.baseUrl);
134
+ if (spec.envVars.authMode) authMode.add(spec.envVars.authMode);
135
+ if (spec.envVars.authFiles) authFiles.add(spec.envVars.authFiles);
136
+ for (const name of Object.keys(spec.envVars.extras ?? {})) extras.add(name);
137
+ }
138
+ return {
139
+ apiKey,
140
+ oauthToken,
141
+ model,
142
+ baseUrl,
143
+ authMode,
144
+ authFiles,
145
+ extras
146
+ };
147
+ }
148
+ /**
149
+ * Union of every spec's `hostPassthroughEnvVars` — the operator tuning names
150
+ * a host process (orchestrator system env, host-agent process env) may
151
+ * forward into containers. Request/caller env always keeps precedence at the
152
+ * host-agent boundary; the orchestrator system-env channel stays
153
+ * operator-authoritative. Replaces the old `OPENCODE_*` prefix forward,
154
+ * which leaked ANY stray host var with that prefix (model tuple and key
155
+ * included) into every tenant.
156
+ */
157
+ function cliAgentHostPassthroughEnvVarNames() {
158
+ const names = /* @__PURE__ */ new Set();
159
+ for (const spec of CLI_AGENT_SPECS) for (const name of spec.hostPassthroughEnvVars ?? []) names.add(name);
160
+ return names;
161
+ }
162
+ /**
163
+ * Union of every env var name a warm-claim rebind may deliver, across all
164
+ * registered harnesses. The ONE source both sides of the rebind derive from:
165
+ * the host-agent selects its delivery from it and the sidecar rebind route
166
+ * carves it out of the loader-control rejection, so the two can never drift
167
+ * into "host delivers a name the sidecar 400s" — which silently cold-paths
168
+ * every warm claim of that backend. Includes each spec's apiKey name because
169
+ * acceptance is a superset of delivery: the HOST decides which key names are
170
+ * safe to send (egress proxy-swap-covered only), while the sidecar must not
171
+ * reject a name a valid host may deliver.
172
+ */
173
+ function claimDeliverableEnvVarNames() {
174
+ const roles = cliAgentEnvVarNamesByRole();
175
+ return new Set([
176
+ AGENT_BACKEND_ENV_VAR,
177
+ MANAGED_MODEL_KEY_ENV_VAR,
178
+ MANAGED_MODEL_KEY_NAME_ENV_VAR,
179
+ ...roles.model,
180
+ ...roles.baseUrl,
181
+ ...roles.authMode,
182
+ ...roles.extras,
183
+ ...roles.apiKey
184
+ ]);
185
+ }
186
+ const BASE_CAPABILITIES = {
187
+ streaming: true,
188
+ toolUse: true,
189
+ reasoning: true,
190
+ multimodal: false
191
+ };
192
+ /**
193
+ * claude-code is the only provider that demotes uid + forces HOME=/home/agent
194
+ * when the sidecar runs as root. All other CLIs inherit the sidecar HOME.
195
+ */
196
+ const CLI_AGENT_SPECS = [
197
+ {
198
+ name: BACKEND_TYPE.OPENCODE,
199
+ nativeSession: NATIVE_SESSION_CONTRACTS.opencode,
200
+ messageStorageDir: ".opencode",
201
+ cliDirLayout: {
202
+ sessionData: [
203
+ "snapshot/**",
204
+ "agent-system-prompt.md",
205
+ "profile-instructions.md"
206
+ ],
207
+ configAllow: [
208
+ "bin/**",
209
+ ".gitignore",
210
+ "log",
211
+ "log/opencode.log",
212
+ "repos"
213
+ ]
214
+ },
215
+ displayName: "OpenCode Agent",
216
+ description: "OpenCode CLI coding agent with native sessions, profiles, tools, and MCP.",
217
+ envVars: HARNESSES["opencode"].config.envVars,
218
+ capabilities: {
219
+ ...BASE_CAPABILITIES,
220
+ multimodal: true,
221
+ contextWindow: 2e5,
222
+ mcp: true,
223
+ runtimeAttachments: { mcp: true },
224
+ sessions: true,
225
+ configurable: true,
226
+ interactions: [
227
+ "permission",
228
+ "question",
229
+ "plan"
230
+ ],
231
+ imageInput: true
232
+ },
233
+ hostPassthroughEnvVars: [
234
+ "OPENCODE_MODEL_MODE",
235
+ "OPENCODE_CODEX_PLUGIN_VERSION",
236
+ "OPENCODE_EXPERIMENTAL_NATIVE_LLM"
237
+ ],
238
+ interactiveSeededPrompt: true,
239
+ builtinTools: [
240
+ {
241
+ id: "apply_patch",
242
+ name: "Apply Patch",
243
+ description: "Apply a unified-diff patch to files"
244
+ },
245
+ {
246
+ id: "bash",
247
+ name: "Bash",
248
+ description: "Execute bash commands"
249
+ },
250
+ {
251
+ id: "codesearch",
252
+ name: "Code Search",
253
+ description: "Search code across the workspace"
254
+ },
255
+ {
256
+ id: "edit",
257
+ name: "Edit",
258
+ description: "Edit a file with string replacement"
259
+ },
260
+ {
261
+ id: "glob",
262
+ name: "Glob",
263
+ description: "Find files by glob pattern"
264
+ },
265
+ {
266
+ id: "grep",
267
+ name: "Grep",
268
+ description: "Search file contents using regular expressions"
269
+ },
270
+ {
271
+ id: "question",
272
+ name: "Question",
273
+ description: "Ask the user a question and wait for the answer"
274
+ },
275
+ {
276
+ id: "read",
277
+ name: "Read",
278
+ description: "Read file contents"
279
+ },
280
+ {
281
+ id: "skill",
282
+ name: "Skill",
283
+ description: "Invoke an installed skill"
284
+ },
285
+ {
286
+ id: "task",
287
+ name: "Task",
288
+ description: "Delegate a task to a subagent"
289
+ },
290
+ {
291
+ id: "todowrite",
292
+ name: "Todo Write",
293
+ description: "Maintain the turn's todo list"
294
+ },
295
+ {
296
+ id: "webfetch",
297
+ name: "Webfetch",
298
+ description: "Fetch and read web content"
299
+ },
300
+ {
301
+ id: "websearch",
302
+ name: "Websearch",
303
+ description: "Search the web"
304
+ },
305
+ {
306
+ id: "write",
307
+ name: "Write",
308
+ description: "Write content to a file"
309
+ }
310
+ ],
311
+ runtime: HARNESSES["opencode"].lifecycle.runtime,
312
+ cliAuthHome: { kind: "inherit-home" },
313
+ hasCliAuth: false
314
+ },
315
+ {
316
+ name: BACKEND_TYPE.CLAUDE_CODE,
317
+ nativeSession: NATIVE_SESSION_CONTRACTS["claude-code"],
318
+ runtime: HARNESSES["claude-code"].lifecycle.runtime,
319
+ messageStorageDir: ".claude-code",
320
+ cliDirLayout: {
321
+ homeSessionData: [".cache/claude-cli-nodejs/-*/mcp-logs-*/*.jsonl"],
322
+ sessionData: [
323
+ "plans/**",
324
+ "file-history/**",
325
+ "debug/**",
326
+ "projects/*/memory/**/*.md",
327
+ "projects/*/*/subagents/**/*.meta.json",
328
+ "projects/*/*/tool-results/**"
329
+ ],
330
+ configAllow: [
331
+ ".last-cleanup",
332
+ "policy-limits.json*",
333
+ "remote-settings.json",
334
+ "remote-settings.json.synced-at",
335
+ "skills/**"
336
+ ],
337
+ credential: [
338
+ "backups/**",
339
+ "session-env/**",
340
+ "shell-snapshots/**",
341
+ "sessions/**"
342
+ ]
343
+ },
344
+ displayName: "Claude Code",
345
+ description: "Anthropic Claude Code CLI-based agent backend.",
346
+ envVars: HARNESSES["claude-code"].config.envVars,
347
+ modelWire: HARNESSES["claude-code"].config.modelWire,
348
+ capabilities: {
349
+ ...BASE_CAPABILITIES,
350
+ multimodal: true,
351
+ contextWindow: 2e5,
352
+ mcp: true,
353
+ runtimeAttachments: { mcp: true },
354
+ sessions: true,
355
+ configurable: true,
356
+ interactions: [
357
+ "permission",
358
+ "question",
359
+ "plan"
360
+ ],
361
+ imageInput: true
362
+ },
363
+ securityCapabilities: [
364
+ "SYS_PTRACE",
365
+ "SETUID",
366
+ "SETGID",
367
+ "DAC_OVERRIDE",
368
+ "CHOWN",
369
+ "FOWNER"
370
+ ],
371
+ interactiveSeededPrompt: true,
372
+ cliAuthHome: {
373
+ kind: "agent-home",
374
+ uid: 1e3,
375
+ home: "/home/agent"
376
+ },
377
+ hasCliAuth: true,
378
+ byoOAuth: true
379
+ },
380
+ {
381
+ name: BACKEND_TYPE.KIMI_CODE,
382
+ nativeSession: NATIVE_SESSION_CONTRACTS["kimi-code"],
383
+ runtime: HARNESSES["kimi-code"].lifecycle.runtime,
384
+ messageStorageDir: ".kimi-code",
385
+ cliDirLayout: { credential: ["config.json"] },
386
+ displayName: "Kimi Code",
387
+ 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.",
388
+ envVars: HARNESSES["kimi-code"].config.envVars,
389
+ capabilities: {
390
+ ...BASE_CAPABILITIES,
391
+ multimodal: true,
392
+ contextWindow: 262144,
393
+ mcp: false,
394
+ runtimeAttachments: { mcp: true },
395
+ sessions: true,
396
+ configurable: true,
397
+ interactions: [],
398
+ imageInput: false
399
+ },
400
+ cliAuthHome: { kind: "inherit-home" },
401
+ hasCliAuth: true
402
+ },
403
+ {
404
+ name: BACKEND_TYPE.CODEX,
405
+ nativeSession: NATIVE_SESSION_CONTRACTS.codex,
406
+ runtime: HARNESSES["codex"].lifecycle.runtime,
407
+ messageStorageDir: ".codex",
408
+ cliDirLayout: {
409
+ sessionData: [
410
+ ...[
411
+ "logs",
412
+ "goals",
413
+ "memories"
414
+ ].map((name) => `${name}_*.sqlite*`),
415
+ ...[
416
+ "state_5",
417
+ "queue_1",
418
+ "thread_history_1"
419
+ ].flatMap((name) => [
420
+ "",
421
+ "-wal",
422
+ "-shm"
423
+ ].map((suffix) => `${name}.sqlite${suffix}`)),
424
+ "skills/**",
425
+ "cache/codex_apps_tools/**",
426
+ "cache/codex_apps_server_info/**",
427
+ "cache/remote_plugin_catalog/**",
428
+ "plugins/cache/**",
429
+ "mcp-oauth-locks/file-store.lock",
430
+ "mcp-oauth-locks/secrets-store.lock",
431
+ "thread-writer-locks/.coordination.lock",
432
+ "thread-writer-locks/*-*-*-*-*.lock",
433
+ "tmp/arg0/codex-arg0*/.lock"
434
+ ],
435
+ configAllow: [
436
+ ".sandbox_migration",
437
+ ".sqlite-maintenance.lock",
438
+ ...[
439
+ "apply_patch",
440
+ "applypatch",
441
+ "codex-execve-wrapper",
442
+ "codex-linux-sandbox"
443
+ ].map((name) => ({
444
+ path: `tmp/arg0/codex-arg0*/${name}`,
445
+ kind: "symlink"
446
+ }))
447
+ ],
448
+ credential: ["shell_snapshots/**"]
449
+ },
450
+ displayName: "Codex",
451
+ description: "OpenAI Codex CLI-based agent backend.",
452
+ envVars: HARNESSES["codex"].config.envVars,
453
+ modelWire: HARNESSES["codex"].config.modelWire,
454
+ capabilities: {
455
+ ...BASE_CAPABILITIES,
456
+ reasoning: false,
457
+ multimodal: true,
458
+ contextWindow: 128e3,
459
+ mcp: false,
460
+ sessions: true,
461
+ configurable: false,
462
+ runtimeAttachments: { mcp: true },
463
+ interactions: [
464
+ "permission",
465
+ "question",
466
+ "plan"
467
+ ],
468
+ imageInput: true
469
+ },
470
+ interactiveSeededPrompt: true,
471
+ cliAuthHome: { kind: "inherit-home" },
472
+ hasCliAuth: true,
473
+ byoOAuth: true
474
+ },
475
+ {
476
+ name: BACKEND_TYPE.AMP,
477
+ nativeSession: NATIVE_SESSION_CONTRACTS.amp,
478
+ messageStorageDir: ".amp-sessions",
479
+ displayName: "AMP (Sourcegraph)",
480
+ description: "Sourcegraph AMP CLI-based agent backend.",
481
+ callerCredentialOnly: true,
482
+ envVars: HARNESSES["amp"].config.envVars,
483
+ capabilities: {
484
+ ...BASE_CAPABILITIES,
485
+ reasoning: false,
486
+ contextWindow: 128e3,
487
+ mcp: false,
488
+ sessions: true,
489
+ configurable: false,
490
+ interactions: [],
491
+ imageInput: false
492
+ },
493
+ cliAuthHome: { kind: "inherit-home" },
494
+ hasCliAuth: true
495
+ },
496
+ {
497
+ name: BACKEND_TYPE.FACTORY_DROIDS,
498
+ nativeSession: NATIVE_SESSION_CONTRACTS["factory-droids"],
499
+ messageStorageDir: ".factory-droids",
500
+ displayName: "Factory Droids",
501
+ 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.",
502
+ envVars: HARNESSES["factory-droids"].config.envVars,
503
+ capabilities: {
504
+ ...BASE_CAPABILITIES,
505
+ reasoning: false,
506
+ contextWindow: 128e3,
507
+ mcp: false,
508
+ sessions: true,
509
+ configurable: false,
510
+ interactions: ["question"],
511
+ imageInput: false
512
+ },
513
+ cliAuthHome: { kind: "inherit-home" },
514
+ hasCliAuth: true
515
+ },
516
+ {
517
+ name: BACKEND_TYPE.PI,
518
+ nativeSession: NATIVE_SESSION_CONTRACTS.pi,
519
+ runtime: HARNESSES["pi"].lifecycle.runtime,
520
+ messageStorageDir: ".pi/agent",
521
+ displayName: "Pi",
522
+ description: "Pi CLI backend. Managed OpenAI-compatible model tuples use one private runtime HOME models.json and the shared Pi model schema.",
523
+ envVars: HARNESSES["pi"].config.envVars,
524
+ capabilities: {
525
+ ...BASE_CAPABILITIES,
526
+ contextWindow: 128e3,
527
+ mcp: true,
528
+ sessions: true,
529
+ configurable: true,
530
+ interactions: ["permission"],
531
+ runtimeAttachments: { mcp: true },
532
+ imageInput: false
533
+ },
534
+ interactiveSeededPrompt: true,
535
+ cliAuthHome: { kind: "inherit-home" },
536
+ hasCliAuth: true
537
+ },
538
+ {
539
+ name: BACKEND_TYPE.PRIME,
540
+ nativeSession: NATIVE_SESSION_CONTRACTS.prime,
541
+ messageStorageDir: ".prime-provider",
542
+ displayName: "Prime Agent (PrimeIntellect)",
543
+ 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).",
544
+ envVars: HARNESSES["prime"].config.envVars,
545
+ hostPassthroughEnvVars: ["PRIME_AGENT_INSTALL_UV", "PRIME_AGENT_KERNEL_PYTHON"],
546
+ capabilities: {
547
+ ...BASE_CAPABILITIES,
548
+ multimodal: true,
549
+ contextWindow: 128e3,
550
+ mcp: false,
551
+ sessions: true,
552
+ configurable: true,
553
+ interactions: [],
554
+ imageInput: true
555
+ },
556
+ cliAuthHome: { kind: "inherit-home" },
557
+ hasCliAuth: false
558
+ },
559
+ {
560
+ name: BACKEND_TYPE.HERMES,
561
+ nativeSession: NATIVE_SESSION_CONTRACTS.hermes,
562
+ messageStorageDir: ".hermes-agent",
563
+ cliDirLayout: {
564
+ sessionData: ["cache/spillover/**", "cache/delegation/**"],
565
+ configAllow: ["config.yaml"]
566
+ },
567
+ displayName: "Hermes Agent (Nous Research)",
568
+ 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.",
569
+ envVars: HARNESSES["hermes"].config.envVars,
570
+ capabilities: {
571
+ ...BASE_CAPABILITIES,
572
+ streaming: false,
573
+ reasoning: false,
574
+ contextWindow: 2e5,
575
+ mcp: true,
576
+ sessions: true,
577
+ configurable: true,
578
+ interactions: [],
579
+ imageInput: true
580
+ },
581
+ cliAuthHome: { kind: "inherit-home" },
582
+ hasCliAuth: true
583
+ },
584
+ {
585
+ name: BACKEND_TYPE.OPENCLAW,
586
+ nativeSession: NATIVE_SESSION_CONTRACTS.openclaw,
587
+ messageStorageDir: ".openclaw-agent",
588
+ cliDirLayout: { configAllow: ["openclaw.json"] },
589
+ displayName: "OpenClaw (Orchestrator)",
590
+ 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.",
591
+ envVars: HARNESSES["openclaw"].config.envVars,
592
+ capabilities: {
593
+ ...BASE_CAPABILITIES,
594
+ streaming: false,
595
+ multimodal: true,
596
+ contextWindow: 2e5,
597
+ mcp: true,
598
+ sessions: true,
599
+ configurable: true,
600
+ interactions: [],
601
+ imageInput: false
602
+ },
603
+ cliAuthHome: { kind: "inherit-home" },
604
+ hasCliAuth: true
605
+ },
606
+ {
607
+ name: BACKEND_TYPE.NANOCLAW,
608
+ nativeSession: NATIVE_SESSION_CONTRACTS.nanoclaw,
609
+ messageStorageDir: ".nanoclaw-agent",
610
+ displayName: "NanoClaw",
611
+ description: "NanoClaw local socket bridge. The daemon persists v2-sessions and the chat bridge prints the session id.",
612
+ envVars: HARNESSES["nanoclaw"].config.envVars,
613
+ capabilities: {
614
+ ...BASE_CAPABILITIES,
615
+ streaming: false,
616
+ contextWindow: 2e5,
617
+ mcp: false,
618
+ sessions: true,
619
+ configurable: true,
620
+ interactions: [],
621
+ imageInput: false
622
+ },
623
+ cliAuthHome: { kind: "inherit-home" },
624
+ hasCliAuth: false,
625
+ unavailable: {
626
+ capability: "docker",
627
+ reason: "NanoClaw runs its agent in Docker, which Tangle sandboxes do not offer. Use another harness, such as opencode."
628
+ }
629
+ },
630
+ {
631
+ name: BACKEND_TYPE.ACP,
632
+ nativeSession: NATIVE_SESSION_CONTRACTS.acp,
633
+ messageStorageDir: ".acp-agent",
634
+ displayName: "ACP Bridge (multi-agent)",
635
+ 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.",
636
+ envVars: HARNESSES["acp"].config.envVars,
637
+ capabilities: {
638
+ ...BASE_CAPABILITIES,
639
+ contextWindow: 2e5,
640
+ mcp: false,
641
+ sessions: true,
642
+ configurable: true,
643
+ interactions: ["permission"],
644
+ imageInput: false
645
+ },
646
+ cliAuthHome: { kind: "inherit-home" },
647
+ hasCliAuth: true
648
+ },
649
+ {
650
+ name: BACKEND_TYPE.CURSOR,
651
+ nativeSession: null,
652
+ messageStorageDir: ".cursor-sdk-sessions",
653
+ displayName: "Cursor Agent SDK",
654
+ 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.",
655
+ callerCredentialOnly: true,
656
+ egressHosts: [
657
+ "api2.cursor.sh",
658
+ "api2direct.cursor.sh",
659
+ "api.cursor.com",
660
+ "api5.cursor.sh",
661
+ "*.api5.cursor.sh"
662
+ ],
663
+ envVars: HARNESSES["cursor"].config.envVars,
664
+ capabilities: {
665
+ ...BASE_CAPABILITIES,
666
+ multimodal: true,
667
+ contextWindow: 2e5,
668
+ mcp: true,
669
+ sessions: true,
670
+ configurable: true,
671
+ interactions: [],
672
+ imageInput: true
673
+ },
674
+ cliAuthHome: { kind: "inherit-home" },
675
+ hasCliAuth: false
676
+ },
677
+ {
678
+ name: BACKEND_TYPE.GROK,
679
+ nativeSession: NATIVE_SESSION_CONTRACTS.grok,
680
+ messageStorageDir: ".grok-sessions",
681
+ displayName: "Grok",
682
+ description: "Grok Build CLI. Headless grok -p against a caller base URL.",
683
+ envVars: HARNESSES.grok.config.envVars,
684
+ capabilities: {
685
+ ...BASE_CAPABILITIES,
686
+ reasoning: false,
687
+ contextWindow: 128e3,
688
+ mcp: false,
689
+ sessions: true,
690
+ configurable: false,
691
+ interactions: [],
692
+ imageInput: false
693
+ },
694
+ cliAuthHome: { kind: "inherit-home" },
695
+ hasCliAuth: false
696
+ },
697
+ {
698
+ name: BACKEND_TYPE.CLI_BASE,
699
+ nativeSession: null,
700
+ displayName: "CLI Base (no agent)",
701
+ description: "Bare sandbox without an AI agent backend. Use when you want the workspace, tools, and SSH access but no LLM dispatch.",
702
+ envVars: HARNESSES["cli-base"].config.envVars,
703
+ capabilities: {
704
+ ...BASE_CAPABILITIES,
705
+ streaming: false,
706
+ toolUse: false,
707
+ reasoning: false,
708
+ contextWindow: 0,
709
+ mcp: false,
710
+ sessions: false,
711
+ configurable: false,
712
+ interactions: [],
713
+ imageInput: false
714
+ },
715
+ cliAuthHome: { kind: "inherit-home" },
716
+ hasCliAuth: false
717
+ }
718
+ ];
719
+ function getSpec(name) {
720
+ return CLI_AGENT_SPECS.find((spec) => spec.name === name);
721
+ }
722
+ /**
723
+ * The directory, relative to a session's storage path, where a backend's
724
+ * message log lives: the one value adapters, the sidecar and the parked
725
+ * export read. Throws for a backend whose spec names none.
726
+ */
727
+ function messageStorageDirOf(name) {
728
+ const dir = getSpec(name)?.messageStorageDir;
729
+ if (!dir) throw new Error(`No message storage directory for backend ${name}`);
730
+ return dir;
731
+ }
732
+ //#endregion
733
+ export { agentProfileSchema as a, cliAgentHostPassthroughEnvVarNames as c, canonicalModelSlug as d, cliAgentClaimEnvVarNames as f, SYNTHETIC_ROUTER_MODEL as g, harnessModelWire as h, MANAGED_MODEL_KEY_NAME_ENV_VAR as i, getSpec as l, harnessModelSupportFor as m, CLI_AGENT_SPECS as n, claimDeliverableEnvVarNames as o, cliAgentEnvRoleName as p, MANAGED_MODEL_KEY_ENV_VAR as r, cliAgentEnvVarNamesByRole as s, AGENT_BACKEND_ENV_VAR as t, messageStorageDirOf as u };
734
+
735
+ //# sourceMappingURL=specs-BBF55TnM.mjs.map