@tangle-network/sandbox 0.69.10 → 0.69.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +3 -3
  5. package/dist/{agent-run-outcome-B5CzWxw4.d.ts → agent-run-outcome-BuebRCWr.d.ts} +2 -2
  6. package/dist/{api-request-D1UVNo16.js → api-request-EseiF9B1.js} +1 -1
  7. package/dist/auth/index.d.ts +2 -2
  8. package/dist/auth/index.js +1 -1
  9. package/dist/browser-interactive-control-controller-Bt1vcu9c.js +4045 -0
  10. package/dist/{browser-interactive-control-controller-SI9hV6r5.d.ts → browser-interactive-control-controller-CVnME80O.d.ts} +5 -7
  11. package/dist/{chunked-upload-l6b9AWFA.js → chunked-upload-Df_5Q2x8.js} +1 -1
  12. package/dist/{chunked-upload-file-CLwAeLrM.js → chunked-upload-file-Dtm1GBkE.js} +2 -2
  13. package/dist/cli-auth-bundle-f2pt7sVA.js +2593 -0
  14. package/dist/{client-qjA1hNOp.js → client-BR_aABY2.js} +11 -11
  15. package/dist/{client-BGm6cw7B.d.ts → client-BWnbrifs.d.ts} +30 -32
  16. package/dist/collaboration/index.d.ts +1 -1
  17. package/dist/collaboration/index.js +1 -1
  18. package/dist/{collaboration-BwLNv6sy.js → collaboration-BTGTf3We.js} +1 -1
  19. package/dist/{core-CG7T2arO.js → core-DeXa_YQ2.js} +5 -4
  20. package/dist/core.d.ts +6 -6
  21. package/dist/core.js +5 -5
  22. package/dist/{direct-http2-Pyj3Rvr1.js → direct-http2-B0ra_xhU.js} +1 -1
  23. package/dist/{errors-Bs5G7JdV.js → errors-ZmDrrk4f.js} +1 -1
  24. package/dist/harness-BD_OISom.js +201 -0
  25. package/dist/harness-DWL2MM4q.js +418 -0
  26. package/dist/{index-nXob5TkM.d.ts → index-DdcCRDq8.d.ts} +14 -16
  27. package/dist/index.d.ts +11 -11
  28. package/dist/index.js +11 -11
  29. package/dist/intelligence/index.js +2 -2
  30. package/dist/interactive-control.d.ts +1 -1
  31. package/dist/interactive-control.js +1 -1
  32. package/dist/{interactive-controller-DSDEfapN.js → interactive-controller-B4bQwRJL.js} +21 -8
  33. package/dist/{interactive-controller-FgmcS8_Y.d.ts → interactive-controller-DlFKGQqu.d.ts} +3 -4
  34. package/dist/lib/prepared-evidence.js +1 -1
  35. package/dist/lib/prepared-process.js +1 -1
  36. package/dist/{lines-D_HDAcVt.js → lines-BqZOl_io.js} +1 -1
  37. package/dist/{lines-BoVYnUCM.d.ts → lines-ptj8SyD4.d.ts} +1 -1
  38. package/dist/lines.d.ts +1 -1
  39. package/dist/lines.js +1 -1
  40. package/dist/{local-cli-auth-YGra1QUA.js → local-cli-auth-Cpi3hT3j.js} +1 -1
  41. package/dist/{mcp-local-Gz1Uygqk.js → mcp-local-BcRLN_Ic.js} +1 -1
  42. package/dist/{prepared-evidence-DUmJSegi.js → prepared-evidence-CuUh_mz6.js} +1 -1
  43. package/dist/{preview-Vu5knAuf.d.ts → preview-ByTCKjiK.d.ts} +3 -3
  44. package/dist/profile-schema-CT3hB1mG.js +1135 -0
  45. package/dist/{public-templates-B6_uwnRZ.d.ts → public-templates-O2mxBX7J.d.ts} +2 -2
  46. package/dist/public-templates.d.ts +1 -1
  47. package/dist/public-templates.js +1 -1
  48. package/dist/{raw-evidence-archive-D60Yg1-5.js → raw-evidence-archive-CqarcYcp.js} +1 -1
  49. package/dist/runtime.d.ts +5 -5
  50. package/dist/runtime.js +5 -5
  51. package/dist/{sandbox-BulsMs3K.js → sandbox-B1ROfJxe.js} +384 -46
  52. package/dist/{secp256k1-DxHlUI6v.js → secp256k1-CZWrpqxW.js} +1 -1
  53. package/dist/select-seat-command.d.ts +1 -1
  54. package/dist/select-seat-command.js +1 -1
  55. package/dist/session-gateway/index.js +3 -3
  56. package/dist/sha2-BUPMvGTk.js +694 -0
  57. package/dist/tangle/index.d.ts +1 -1
  58. package/dist/tangle/index.js +1 -1
  59. package/dist/{tangle-DdzOPPJ9.js → tangle-q-3ualoW.js} +4 -4
  60. package/dist/terminal-stream-types-DwXQzUbH.d.ts +3328 -0
  61. package/dist/{types-CkLWX7i5.d.ts → types-B28t5Sq1.d.ts} +10 -12
  62. package/package.json +6 -6
  63. package/dist/browser-interactive-control-controller-CLHNi8rG.js +0 -292
  64. package/dist/cli-auth-bundle-DmaEJ_qh.js +0 -1590
  65. package/dist/terminal-stream-types-DuzvL1ge.d.ts +0 -676
  66. /package/dist/{abort-signal-BKVZNJul.js → abort-signal-jU-SEjLT.js} +0 -0
  67. /package/dist/{cli-auth-bundle-CeNOYFje.d.ts → cli-auth-bundle-MskLEgtA.d.ts} +0 -0
  68. /package/dist/{index-C0RkLba5.d.ts → index-Dqcr9p97.d.ts} +0 -0
  69. /package/dist/{index-DaIF4c9p.d.ts → index-Dslyq85a.d.ts} +0 -0
  70. /package/dist/{keep-alive-fetch-Bi-zvHpN.js → keep-alive-fetch-C2DX2_rG.js} +0 -0
  71. /package/dist/{prepared-process-Dlk_9JVJ.js → prepared-process-LjBfQnZ5.js} +0 -0
  72. /package/dist/{preview-operations-eTUlPen5.js → preview-operations-BvgwYaoL.js} +0 -0
  73. /package/dist/{response-rewrap-BKkJ5hnn.js → response-rewrap-MBztoTLx.js} +0 -0
  74. /package/dist/{retry-after-header-U_L5Ml9Q.js → retry-after-header-BZbs5rig.js} +0 -0
  75. /package/dist/{sidecar-proxy-error-B2Hxt41g.js → sidecar-proxy-error-Dty4zmN7.js} +0 -0
  76. /package/dist/{sse-parser-CUfurwcm.js → sse-parser-DmO5gP6u.js} +0 -0
  77. /package/dist/{utils-DB8DnUCU.js → utils-vaFoyyiO.js} +0 -0
@@ -0,0 +1,3328 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/create-receipt-types.d.ts
4
+ /** Create admission evidence shared by SDK errors and public sandbox types.
5
+ * This contract has no SDK implementation imports. */
6
+ /**
7
+ * What one `create()` call did to the sandbox environment.
8
+ *
9
+ * - `created`: the call allocated the environment. The platform states this
10
+ * only when the create identity belonged to the call alone.
11
+ * - `idempotent_replay`: the platform returned the environment that an earlier
12
+ * call with the same idempotency key allocated. The call allocated nothing.
13
+ * - `unknown`: the platform cannot prove either outcome, so another caller can
14
+ * hold the environment.
15
+ */
16
+ type SandboxCreateOutcome = "created" | "idempotent_replay" | "unknown";
17
+ /**
18
+ * The platform verdict for one create call.
19
+ *
20
+ * Delete the environment only on a `created` outcome. `idempotencyKeyApplied`
21
+ * reports whether the idempotency key selected the environment: a false value
22
+ * means a retry of the same request allocates a second sandbox.
23
+ */
24
+ interface SandboxCreateReceipt {
25
+ outcome: SandboxCreateOutcome;
26
+ idempotencyKeyApplied: boolean;
27
+ /** Host-confirmed credential-inheritance policy, not a VM-isolation or
28
+ * privacy-from-operator attestation. Missing on older hosts and on unverified
29
+ * replays; isolated creation requires an explicit isolated verdict. */
30
+ ownerContext?: "inherit" | "isolated";
31
+ /**
32
+ * Names of the stored secrets this call decrypted for the sandbox.
33
+ * Read it to size what the box can read. The set is sorted and
34
+ * de-duplicated, and it also counts the names a startup script or a Hub
35
+ * credential pulled in, so it is a superset of the `secrets` the create
36
+ * asked for rather than the same list. A `secrets` entry that declared a
37
+ * `host` is on the list, but the box reads only a placeholder for it: the
38
+ * egress proxy holds the value. Absent on an idempotent replay, and
39
+ * on a platform old enough not to report the set.
40
+ */
41
+ injectedSecrets?: string[];
42
+ /** Host-confirmed identity of the container whose native rollout is retained. */
43
+ captureProof?: {
44
+ hostId: string;
45
+ containerId: string;
46
+ imageId: string;
47
+ bundleRevision: string;
48
+ bundleChecksum: string;
49
+ };
50
+ }
51
+ //#endregion
52
+ //#region src/error-classes.d.ts
53
+ /**
54
+ * Base error class for all Sandbox SDK errors.
55
+ */
56
+ declare class SandboxError extends Error {
57
+ /** HTTP status code if applicable */
58
+ readonly status?: number;
59
+ /** Error code for programmatic handling */
60
+ readonly code: string;
61
+ /** Best-effort origin of the failing request */
62
+ readonly origin?: SandboxErrorOrigin;
63
+ /** Request path or endpoint when known */
64
+ readonly endpoint?: string;
65
+ /** Retry-after duration in ms when surfaced by the upstream */
66
+ readonly retryAfterMs?: number;
67
+ /** Sidecar version when the runtime emitted it */
68
+ readonly sidecarVersion?: string;
69
+ /** Sidecar image/tag/sha when the runtime emitted it */
70
+ readonly containerImage?: string;
71
+ /**
72
+ * Seconds the control plane expects to need before it can serve this
73
+ * request, when it published one. Today only a capacity refusal on create
74
+ * carries it: the cell sizes it from the host add already in flight plus
75
+ * the measured p95 host-birth time, so it is a real wait, not a backoff
76
+ * hint. `retryAfterMs` paces the SDK's own retry; this is the number to
77
+ * show a human or feed to a scheduler.
78
+ */
79
+ readonly etaSeconds?: number;
80
+ /**
81
+ * On create's top-level error, proves this call's attempts admitted no
82
+ * sandbox. Absence is unknown. Earlier errors in `cause` describe only
83
+ * their attempt prefix, not subsequent attempts or earlier calls using
84
+ * the same idempotency key.
85
+ */
86
+ readonly createFailureDisposition?: "not-admitted";
87
+ constructor(message: string, code: string, status?: number, metadata?: SandboxErrorMetadata);
88
+ }
89
+ type SandboxErrorOrigin = "sidecar" | "sandbox-api" | "control-plane" | "runtime" | "unknown";
90
+ interface SandboxErrorMetadata {
91
+ origin?: SandboxErrorOrigin;
92
+ endpoint?: string;
93
+ retryAfterMs?: number;
94
+ sidecarVersion?: string;
95
+ containerImage?: string;
96
+ etaSeconds?: number;
97
+ /** How long the operation ran, for a TimeoutError that measured it. */
98
+ elapsedMs?: number;
99
+ createFailureDisposition?: "not-admitted";
100
+ }
101
+ type SandboxErrorJson = string | number | boolean | null | {
102
+ [key: string]: SandboxErrorJson;
103
+ } | SandboxErrorJson[];
104
+ type SandboxFailureDetail = {
105
+ [key: string]: SandboxErrorJson;
106
+ };
107
+ /**
108
+ * Authentication failed or API key is invalid.
109
+ */
110
+ declare class AuthError extends SandboxError {
111
+ constructor(message?: string, metadata?: SandboxErrorMetadata);
112
+ }
113
+ /**
114
+ * The requested resource was not found.
115
+ */
116
+ declare class NotFoundError extends SandboxError {
117
+ /** The resource type that was not found */
118
+ readonly resourceType: string;
119
+ /** The resource ID that was not found */
120
+ readonly resourceId: string;
121
+ constructor(resourceType: string, resourceId: string, metadata?: SandboxErrorMetadata, message?: string, code?: string);
122
+ }
123
+ /**
124
+ * Account quota or rate limit exceeded.
125
+ */
126
+ declare class QuotaError extends SandboxError {
127
+ /** The type of quota that was exceeded */
128
+ readonly quotaType: string;
129
+ /** Current usage */
130
+ readonly current?: number;
131
+ /** Maximum allowed */
132
+ readonly limit?: number;
133
+ /** Suggested retry-after duration in ms */
134
+ readonly retryAfterMs?: number;
135
+ constructor(quotaType: string, message?: string, current?: number, limit?: number, metadata?: SandboxErrorMetadata, status?: number);
136
+ }
137
+ /**
138
+ * The requested capability is unavailable for the account, driver, or sandbox.
139
+ */
140
+ declare class CapabilityError extends SandboxError {
141
+ /** Capability or feature that was rejected when known */
142
+ readonly capability?: string;
143
+ constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, capability?: string);
144
+ }
145
+ /** What one supported GPU provider needs, as a refusal reports it. */
146
+ interface GpuProviderRequirement {
147
+ provider: string;
148
+ /** `ready`, `credential-invalid`, `unverified`, `not-configured`, `disabled`. */
149
+ state: string;
150
+ /** Orchestrator environment variables it needs (`A|B`: either). */
151
+ envVars: string[];
152
+ }
153
+ /**
154
+ * No configured GPU provider can take the lease: none is configured, the
155
+ * named one is not, or the provider refused its credential. Status 503, code
156
+ * `GPU_PROVIDER_NOT_CONFIGURED`. The message names every supported provider
157
+ * and the orchestrator variables it needs; `providers` carries the same.
158
+ */
159
+ declare class GpuProviderNotConfiguredError extends CapabilityError {
160
+ readonly providers: GpuProviderRequirement[];
161
+ constructor(message: string, providers?: GpuProviderRequirement[], status?: number, metadata?: SandboxErrorMetadata);
162
+ }
163
+ /**
164
+ * A create that requires HIPAA placement was refused. `code` says why:
165
+ * `COMPLIANCE_NOT_ENTITLED` (403) when the credential carries no HIPAA
166
+ * entitlement, `COMPLIANCE_CELL_UNAVAILABLE` (503) when no HIPAA-designated
167
+ * cell can take the create now. Either way nothing was created, and the
168
+ * create was not placed in any other cell. The SDK does not retry it.
169
+ */
170
+ declare class CompliancePlacementError extends SandboxError {
171
+ constructor(message: string, code: "COMPLIANCE_NOT_ENTITLED" | "COMPLIANCE_CELL_UNAVAILABLE", status: number, metadata?: SandboxErrorMetadata);
172
+ }
173
+ /**
174
+ * A multi-resource operation failed for one or more branches.
175
+ */
176
+ declare class PartialFailureError extends SandboxError {
177
+ /** Per-resource failures returned by the API when available */
178
+ readonly failures?: SandboxFailureDetail[];
179
+ /** The operation that failed after another resource was already created. */
180
+ readonly cause?: unknown;
181
+ /** Allocation returned before create readiness failed. */
182
+ readonly allocationId?: string;
183
+ /** Key used for the create call that returned the allocation. */
184
+ readonly idempotencyKey?: string;
185
+ /** Ownership verdict returned by that create call, if available. */
186
+ readonly createReceipt?: SandboxCreateReceipt | null;
187
+ constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, failures?: SandboxFailureDetail[], cause?: unknown, createFailure?: {
188
+ allocationId: string;
189
+ idempotencyKey: string;
190
+ createReceipt: SandboxCreateReceipt | null;
191
+ });
192
+ }
193
+ /**
194
+ * The request was invalid or malformed.
195
+ */
196
+ declare class ValidationError extends SandboxError {
197
+ /** Field-level validation errors */
198
+ readonly fields?: Record<string, string>;
199
+ constructor(message: string, fields?: Record<string, string>, metadata?: SandboxErrorMetadata, code?: string);
200
+ }
201
+ /**
202
+ * A profile file mount names a path that the sidecar file API refuses: an
203
+ * absolute path outside `SANDBOX_FILE_API_ABSOLUTE_ROOTS`. create() throws it
204
+ * before it provisions a sandbox, and a turn throws it before any write. The
205
+ * status is 422 and the code is `PROFILE_FILE_MOUNT_OUTSIDE_ROOTS`: a retry
206
+ * with the same profile gets the same refusal.
207
+ */
208
+ declare class ProfileFileMountPathError extends SandboxError {
209
+ /** The refused mount path, exactly as the profile gave it. */
210
+ readonly path: string;
211
+ constructor(path: string, message: string, code: string, metadata?: SandboxErrorMetadata);
212
+ }
213
+ /**
214
+ * The sandbox is not in a valid state for the requested operation.
215
+ */
216
+ declare class StateError extends SandboxError {
217
+ /** Current state of the sandbox */
218
+ readonly currentState: string;
219
+ /** Required state for the operation */
220
+ readonly requiredState?: string;
221
+ constructor(message: string, currentState: string, requiredState?: string, metadata?: SandboxErrorMetadata, code?: string);
222
+ }
223
+ /**
224
+ * The sandbox lifecycle is running, but its consumer-facing runtime edge is
225
+ * still attaching or has failed to attach.
226
+ */
227
+ declare class EdgeNotReadyError extends SandboxError {
228
+ /** Current public edge state. */
229
+ readonly edgeStatus: "pending" | "failed";
230
+ constructor(message: string, edgeStatus: "pending" | "failed", metadata?: SandboxErrorMetadata);
231
+ }
232
+ declare class FileWriteConflictError extends SandboxError {
233
+ readonly path: string;
234
+ readonly currentHash: string | null;
235
+ readonly currentMtime: number | null;
236
+ readonly expectedHash?: string;
237
+ constructor(message: string, path: string, expectedHash: string | undefined, currentHash: string | null, currentMtime: number | null, metadata?: SandboxErrorMetadata);
238
+ }
239
+ /**
240
+ * The Platform key funding the request has no lifetime budget left.
241
+ *
242
+ * A budgeted key funds any number of sandboxes until its budget is spent;
243
+ * then every create, resume, and model credential it funds is refused with
244
+ * this error. The refusal is decided: retrying cannot succeed until the
245
+ * budget is raised or another key is used, so the SDK never retries it.
246
+ */
247
+ declare class KeyBudgetExhaustedError extends SandboxError {
248
+ /**
249
+ * The key the refusal names: the budgeted key with nothing left when
250
+ * Platform refused a delegation, or the presented key when authentication
251
+ * refused it. Absent when the server named none.
252
+ */
253
+ readonly keyId?: string;
254
+ /** That key's lifetime budget, in USD, when Platform reported it. */
255
+ readonly budgetUsd?: number;
256
+ /** What that key has spent, in USD. */
257
+ readonly spentUsd?: number;
258
+ /** What that key has reserved for budgeted children, in USD. */
259
+ readonly reservedUsd?: number;
260
+ constructor(message: string, details?: {
261
+ keyId?: string;
262
+ budgetUsd?: number;
263
+ spentUsd?: number;
264
+ reservedUsd?: number;
265
+ }, metadata?: SandboxErrorMetadata);
266
+ }
267
+ declare class EgressProxyRecoveryError extends SandboxError {
268
+ readonly phase: "egress_proxy_recovery";
269
+ constructor(message: string, metadata?: SandboxErrorMetadata);
270
+ }
271
+ /**
272
+ * Resume must build a new runtime, and that runtime needs public env values
273
+ * the platform does not store at rest: a per-run coordination or capability
274
+ * token, or a secret passed at create. Resume again with each key in
275
+ * `missingEnvKeys` in `ResumeOptions.env`.
276
+ */
277
+ declare class ResumeEnvRequiredError extends SandboxError {
278
+ /** The env keys the next resume must carry. */
279
+ readonly missingEnvKeys: readonly string[];
280
+ constructor(message: string, missingEnvKeys: readonly string[], metadata?: SandboxErrorMetadata);
281
+ }
282
+ /**
283
+ * A branch asked for more children than the parent's host has memory for.
284
+ * Children can only live on the parent's host (their clone is local to its
285
+ * volume), so no other host can take the rest. `maxChildren` is how many
286
+ * children that host admits now; branch that many or fewer, or wait for the
287
+ * host to free memory. Nothing was created and nothing is held.
288
+ *
289
+ * A retry under the same idempotency key replays this refusal unchanged,
290
+ * `maxChildren` included, so the count is the host's room when the key was
291
+ * first used. To branch fewer children, use a new key.
292
+ */
293
+ declare class BranchFanoutExceedsHostError extends SandboxError {
294
+ /** Children the parent's host admitted when it refused (0 when none). */
295
+ readonly maxChildren?: number;
296
+ /** The fan-out width this request asked for. */
297
+ readonly requestedChildren?: number;
298
+ constructor(message: string, counts: {
299
+ maxChildren?: number;
300
+ requestedChildren?: number;
301
+ }, metadata?: SandboxErrorMetadata);
302
+ }
303
+ /**
304
+ * The request timed out.
305
+ */
306
+ declare class TimeoutError extends SandboxError {
307
+ /** The operation's configured budget, in milliseconds. NOT how long it ran. */
308
+ readonly timeoutMs: number;
309
+ /**
310
+ * How long the operation actually ran before this error, in milliseconds,
311
+ * when the thrower measured it.
312
+ *
313
+ * `create()` can end before its budget: when a server-supplied `Retry-After`
314
+ * outlasts the remaining budget, no further attempt can follow that sleep,
315
+ * so the create ends there rather than idling. Reading `timeoutMs` as the
316
+ * duration would record a two-minute timeout for a three-second refusal.
317
+ * Absent means the thrower did not measure it; it never means `timeoutMs`.
318
+ */
319
+ readonly elapsedMs?: number;
320
+ /**
321
+ * The last typed failure the operation had already received when the
322
+ * deadline fired, when there was one.
323
+ *
324
+ * An operation that spends its budget across several attempts (create's
325
+ * bounded POST retry) usually learns the server's failure class on an
326
+ * earlier attempt — `CONTAINER_START_FAILED`, `PROVISIONING_ERROR`,
327
+ * `RATE_LIMIT_EXCEEDED`. Without this field that class dies at the
328
+ * deadline and the caller is left with a timeout that names no cause,
329
+ * which is the last discard in a chain built specifically to deliver it.
330
+ */
331
+ readonly cause?: SandboxError;
332
+ constructor(timeoutMs: number, message?: string, metadata?: SandboxErrorMetadata, cause?: SandboxError);
333
+ }
334
+ /**
335
+ * A network or connection error occurred.
336
+ */
337
+ declare class NetworkError extends SandboxError {
338
+ /** The underlying error */
339
+ readonly cause?: Error;
340
+ constructor(message: string, causeOrMetadata?: Error | SandboxErrorMetadata, metadata?: SandboxErrorMetadata);
341
+ }
342
+ /** Why the SDK stopped rejoining an execution whose stream dropped. */
343
+ type StreamInterruptionReason = /** The caller's reconnect window elapsed while the execution stayed unreachable. */"reconnect-window-elapsed" /** The sandbox is stopped, failed, expired or deleted; the run cannot resume. */ | "sandbox-not-running" /** The runtime kept answering that it has no such execution. */ | "execution-not-found";
344
+ /**
345
+ * The stream of an admitted execution ended without its terminal event, and
346
+ * the SDK could not rejoin it. The execution's outcome is UNKNOWN: it may
347
+ * still be running, or it may have finished while no reader was attached.
348
+ * This is never a failure verdict. Rejoin later with `streamPrompt(message,
349
+ * { executionId, lastEventId, sessionId })`, or read the session status.
350
+ */
351
+ declare class StreamInterruptedError extends SandboxError {
352
+ readonly executionId: string;
353
+ readonly sessionId?: string;
354
+ /** The last event id delivered to the caller; replay resumes after it. */
355
+ readonly lastEventId?: string;
356
+ readonly reason: StreamInterruptionReason;
357
+ /** Last HTTP status the replay endpoint answered, when it answered. */
358
+ readonly lastReplayStatus?: number;
359
+ /** Last execution status the runtime reported, when it reported one. */
360
+ readonly lastExecutionStatus?: string;
361
+ readonly cause?: unknown;
362
+ constructor(details: {
363
+ message: string;
364
+ executionId: string;
365
+ sessionId?: string;
366
+ lastEventId?: string;
367
+ reason: StreamInterruptionReason;
368
+ lastReplayStatus?: number;
369
+ lastExecutionStatus?: string;
370
+ cause?: unknown;
371
+ });
372
+ }
373
+ /**
374
+ * The server returned an unexpected error.
375
+ */
376
+ declare class ServerError extends SandboxError {
377
+ constructor(message: string, status?: number, metadata?: SandboxErrorMetadata, code?: string);
378
+ }
379
+ //#endregion
380
+ //#region src/errors.d.ts
381
+ /** A protocol `error` control frame or a transport failure. */
382
+ declare class TerminalStreamError extends Error {
383
+ /** Protocol error code (e.g. `INIT_FAILED`) or `TRANSPORT` for socket faults. */
384
+ readonly code: string;
385
+ /**
386
+ * True when the socket never reached OPEN: the upgrade was refused (a
387
+ * WebSocket client cannot read the HTTP status, so a 401 and a network drop
388
+ * look alike) or the runtime rejected the dial's options. No PTY work had
389
+ * started on the client's side of that dial.
390
+ */
391
+ readonly beforeOpen: boolean;
392
+ constructor(message: string, code: string, options?: {
393
+ beforeOpen?: boolean;
394
+ });
395
+ }
396
+ //#endregion
397
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@4.0.0/node_modules/@tangle-network/agent-interface/dist/harness.d.ts
398
+ /**
399
+ * The execution runner for an agent — WHICH runtime materializes and runs an `AgentProfile`.
400
+ *
401
+ * This enum describes an EXECUTION concern. When an `AgentProfile` authors a `harness`
402
+ * preference, that field participates in its canonical identity like every other parsed profile
403
+ * field. A caller or executor may override the preference for one run, but the execution receipt
404
+ * preserves the authored identity, effective identity, and selected harness separately. This is
405
+ * the single shared enum every layer references instead of keeping its own copy (session control,
406
+ * the profile materializer, the cli-bridge backends, VB profile specs).
407
+ *
408
+ * `cli-base` is the router-backed mode — a plain multi-turn router call (a reviewer, a cheap judge,
409
+ * a one-shot) with no full coding-agent harness. The rest are full agentic harnesses run in a
410
+ * sandbox or locally via the CLI bridge.
411
+ *
412
+ * `forge` (tailcallhq/forgecode) and `cursor` (cursor-agent) are multi-provider CLI harnesses with
413
+ * no vendor lock, so they carry no entry in the capability tables and resolve as router-backed.
414
+ *
415
+ * `prime` (PrimeIntellect-ai/prime-agent) is the prime fork of the pi line — the RLM
416
+ * IPython-kernel harness. It is a distinct harness from `pi`: the fork's wire protocol has
417
+ * diverged (its daemon rejects pi-line clients), so the two are not interchangeable at run time.
418
+ */
419
+ type HarnessType$1 = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "prime" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "forge" | "cursor" | "acp" | "cli-base";
420
+ //#endregion
421
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@4.0.0/node_modules/@tangle-network/agent-interface/dist/agent-profile.d.ts
422
+ /**
423
+ * Permission policy value for a capability.
424
+ */
425
+ type AgentProfilePermissionValue$1 = "allow" | "ask" | "deny";
426
+ type AgentProfilePermission$1 = AgentProfilePermissionValue$1 | Record<string, AgentProfilePermissionValue$1>;
427
+ /**
428
+ * Generic resource reference that can be resolved into a file or instruction.
429
+ */
430
+ type AgentProfileResourceRef$1 = {
431
+ kind: "inline";
432
+ name: string;
433
+ content: string;
434
+ } | {
435
+ kind: "github";
436
+ /**
437
+ * Optional repository in "owner/repo" form. When omitted, providers may
438
+ * only resolve the path if they have an ambient repository context.
439
+ */
440
+ repository?: string;
441
+ path: string;
442
+ ref?: string;
443
+ name?: string;
444
+ };
445
+ /**
446
+ * Resource mounted into a backend workspace.
447
+ */
448
+ interface AgentProfileFileMount$1 {
449
+ path: string;
450
+ resource: AgentProfileResourceRef$1;
451
+ executable?: boolean;
452
+ }
453
+ /**
454
+ * Provider-neutral resource bundle.
455
+ */
456
+ interface AgentProfileResources$1 {
457
+ /**
458
+ * Generic files to materialize into the agent workspace before execution.
459
+ */
460
+ files?: AgentProfileFileMount$1[];
461
+ /**
462
+ * Provider-native tool files. Backends materialize these into their standard
463
+ * discovery location when they support file-based tools.
464
+ */
465
+ tools?: AgentProfileResourceRef$1[];
466
+ /**
467
+ * Agent Skills (`SKILL.md`) packages. Supported by Cursor, Claude Code,
468
+ * Codex-compatible layouts, OpenCode, and Hermes-style skill harnesses.
469
+ */
470
+ skills?: AgentProfileResourceRef$1[];
471
+ /**
472
+ * Provider-native subagent definition files.
473
+ */
474
+ agents?: AgentProfileResourceRef$1[];
475
+ /**
476
+ * Provider-native slash command files.
477
+ */
478
+ commands?: AgentProfileResourceRef$1[];
479
+ /**
480
+ * Additional instructions injected into the agent context.
481
+ */
482
+ instructions?: string | AgentProfileResourceRef$1;
483
+ /**
484
+ * Fail initialization when a provider cannot materialize a resource.
485
+ */
486
+ failOnError?: boolean;
487
+ }
488
+ /**
489
+ * Portable reasoning/thinking effort. Backends map it to their native control at materialization:
490
+ * codex `model_reasoning_effort`, kimi `--thinking`/`--no-thinking`, claude thinking budget.
491
+ * Ordered low→high:
492
+ * - `none` — extended thinking OFF (no reasoning budget at all)
493
+ * - `minimal` — thinking ON, the lowest budget (distinct from `none`)
494
+ * - `low` / `medium` / `high` / `xhigh`
495
+ * - `ultracode` — maximum (Claude Code's `max` and Codex's `ultra` reconcile here).
496
+ * A backend without a matching native tier may clamp down to its strongest supported level, but it
497
+ * must never turn reasoning on for `none` or silently increase a requested effort.
498
+ */
499
+ declare const REASONING_EFFORTS$1: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"];
500
+ type ReasoningEffort$1 = (typeof REASONING_EFFORTS$1)[number];
501
+ /**
502
+ * Model selection hints for backends.
503
+ */
504
+ interface AgentProfileModelHints$1 {
505
+ /**
506
+ * Preferred default model (format depends on backend, commonly "provider/model").
507
+ */
508
+ default?: string;
509
+ /**
510
+ * Preferred small/cheap model for lightweight work.
511
+ */
512
+ small?: string;
513
+ /**
514
+ * Optional provider preference hint.
515
+ */
516
+ provider?: string;
517
+ /**
518
+ * Reasoning/thinking effort hint — a first-class, portable model dimension (not buried in
519
+ * `extensions`). Backends map it to their native control at materialization.
520
+ *
521
+ * This is a quality dial, not a spend limit. It never bounds token count.
522
+ */
523
+ reasoningEffort?: ReasoningEffort$1;
524
+ /**
525
+ * Maximum visible answer tokens a backend may bill for one completion.
526
+ * A positive integer. Independent of the reasoning and total ceilings.
527
+ */
528
+ maxVisibleOutputTokens?: number;
529
+ /**
530
+ * Maximum hidden reasoning tokens a backend may bill for one completion.
531
+ * A positive integer, separate from visible answer tokens.
532
+ */
533
+ maxReasoningTokens?: number;
534
+ /**
535
+ * Maximum total billed completion tokens for visible answer and hidden
536
+ * reasoning tokens together. A positive integer. When it is set with either
537
+ * single ceiling, that single ceiling must not exceed it.
538
+ */
539
+ maxTotalOutputTokens?: number;
540
+ /**
541
+ * Backend-agnostic model metadata/hints.
542
+ */
543
+ metadata?: Record<string, unknown>;
544
+ }
545
+ /** An authored subscription choice. The executor resolves account availability at run time. */
546
+ interface AgentProfileSeat$1 {
547
+ /** Exact harness to use for this segment. */
548
+ harness: HarnessType$1;
549
+ /** Provider that must serve `model`; a different provider requires another stage. */
550
+ provider: string;
551
+ /** Exact model requested from this provider. */
552
+ model: string;
553
+ /** Select all eligible accounts in account-manager order, or one named account. */
554
+ selector: {
555
+ kind: "all-eligible";
556
+ } | {
557
+ kind: "seat";
558
+ id: string;
559
+ };
560
+ /** Replace the profile-level native tool map for this stage; `{}` clears it. */
561
+ tools?: Record<string, boolean>;
562
+ /** Replace the profile-level permission map for this stage; `{}` clears it. */
563
+ permissions?: Record<string, AgentProfilePermission$1>;
564
+ }
565
+ /**
566
+ * Prompt shaping for an agent.
567
+ *
568
+ * Replacement and addition are two different intents against the same channel
569
+ * and are never interchangeable. A backend that can only do one of them must
570
+ * refuse the other rather than substituting it, which is why
571
+ * {@link AgentProfileCapabilities.systemPrompt} carries a separate bit for each.
572
+ *
573
+ * Setting `systemPrompt` and `appendSystemPrompt` together is legal and ordered:
574
+ * the replacement is installed first and the addition composes on top of it, so
575
+ * the effective prompt is `systemPrompt` then `appendSystemPrompt`. The pair is
576
+ * deliberately allowed because {@link mergeAgentProfiles} composes the two
577
+ * fields independently — refusing it would let two individually valid profiles
578
+ * merge into an invalid one.
579
+ */
580
+ interface AgentProfilePrompt$1 {
581
+ /**
582
+ * REPLACE the harness's own system prompt with this text.
583
+ *
584
+ * The harness's built-in prompt is DELETED, not extended: the model stops
585
+ * receiving the tool descriptions, output conventions, refusal rules, and
586
+ * workflow scaffolding it was tuned against, so behavior can move far beyond
587
+ * the words written here. Supply a prompt that stands on its own.
588
+ *
589
+ * Honored only where {@link AgentProfileSystemPromptCapability.replace} is
590
+ * true — a harness that exposes a real replacement control (`pi
591
+ * --system-prompt <file>` with context files, skills, and prompt templates
592
+ * off; gemini `.gemini/system.md` with `GEMINI_SYSTEM_MD=1`). A backend that
593
+ * can only add text must reject this field. Folding it into an addition is a
594
+ * silent semantic downgrade: the instructions the caller asked to delete stay
595
+ * in force, and nothing in the result says so.
596
+ */
597
+ systemPrompt?: string;
598
+ /**
599
+ * ADD this text to the harness's own system prompt, which stays intact.
600
+ *
601
+ * The model keeps everything it was tuned against and receives this on top,
602
+ * in the same privileged position as the system prompt. Maps to claude-code
603
+ * `--append-system-prompt`, and to a leading `role: "system"` message on
604
+ * harnesses that take a message list.
605
+ *
606
+ * Distinct from {@link AgentProfilePrompt.instructions}, which harnesses
607
+ * materialize into their lower-privilege project-instruction surface.
608
+ *
609
+ * Honored only where {@link AgentProfileSystemPromptCapability.append} is
610
+ * true.
611
+ */
612
+ appendSystemPrompt?: string;
613
+ /**
614
+ * Additional instruction lines composed into the agent's project-instruction
615
+ * surface — the harness's `AGENTS.md` / `CLAUDE.md`-style files or its own
616
+ * caller-instruction preamble. Lower privilege than
617
+ * {@link AgentProfilePrompt.appendSystemPrompt} and placed wherever the
618
+ * harness keeps caller instructions rather than in the system prompt.
619
+ */
620
+ instructions?: string[];
621
+ }
622
+ /** Deliberately public configuration included in profile identity. */
623
+ interface AgentProfilePublicConfigValue$1 {
624
+ kind: "public";
625
+ value: string;
626
+ }
627
+ /**
628
+ * Opaque reference resolved only inside the private prepared executor.
629
+ * `key` is caller-declared public identity naming provider/operator-owned
630
+ * secret material; callers must not put the secret value in it.
631
+ */
632
+ interface AgentProfileSecretRef$1 {
633
+ kind: "secret-ref";
634
+ key: string;
635
+ /** Apply no decoration or a `Bearer ` prefix after private resolution. */
636
+ format?: "raw" | "bearer";
637
+ }
638
+ /** A configuration value is public bytes or an opaque secret identity. */
639
+ type AgentProfileConfigValue$1 = AgentProfilePublicConfigValue$1 | AgentProfileSecretRef$1;
640
+ /**
641
+ * Generic subagent definition.
642
+ */
643
+ interface AgentSubagentProfile$1 {
644
+ description?: string;
645
+ prompt?: string;
646
+ model?: string;
647
+ tools?: Record<string, boolean>;
648
+ permissions?: Record<string, AgentProfilePermission$1>;
649
+ maxSteps?: number;
650
+ metadata?: Record<string, unknown>;
651
+ }
652
+ interface AgentProfileHookCommand$1 {
653
+ command: string;
654
+ timeoutMs?: number;
655
+ blocking?: boolean;
656
+ matcher?: string;
657
+ env?: Record<string, AgentProfileConfigValue$1>;
658
+ }
659
+ interface AgentProfileMode$1 {
660
+ description?: string;
661
+ model?: string;
662
+ prompt?: string;
663
+ tools?: Record<string, boolean>;
664
+ permissions?: Record<string, AgentProfilePermission$1>;
665
+ metadata?: Record<string, unknown>;
666
+ }
667
+ /**
668
+ * Confidential-execution options for sandbox backends.
669
+ *
670
+ * The Tangle blueprint path translates this into TEE job parameters and fails
671
+ * closed when the requested TEE is unavailable. Callers should verify returned
672
+ * attestation evidence before treating a session as confidential.
673
+ */
674
+ interface AgentProfileConfidential$1 {
675
+ /**
676
+ * TEE variant requested from the operator.
677
+ */
678
+ tee?: "tdx" | "nitro" | "phala-dstack" | "sev-snp" | "any" | (string & {});
679
+ /**
680
+ * Optional hex-encoded 32-64 byte challenge for deploy-time report data.
681
+ */
682
+ attestationNonce?: string;
683
+ /**
684
+ * Require no persistence across session end when supported by the backend.
685
+ */
686
+ sealed?: boolean;
687
+ /**
688
+ * Ask the SDK/backend to create or require a fresh attestation challenge.
689
+ */
690
+ attestationRefresh?: boolean;
691
+ }
692
+ /**
693
+ * Generic MCP server configuration.
694
+ */
695
+ interface AgentProfileMcpServerBase$1 {
696
+ metadata?: Record<string, unknown>;
697
+ }
698
+ interface AgentProfileLocalMcpServer$1 extends AgentProfileMcpServerBase$1 {
699
+ enabled?: true;
700
+ transport?: "stdio";
701
+ command: string;
702
+ args?: AgentProfileConfigValue$1[];
703
+ env?: Record<string, AgentProfileConfigValue$1>;
704
+ cwd?: string;
705
+ url?: never;
706
+ headers?: never;
707
+ }
708
+ interface AgentProfileRemoteMcpServer$1 extends AgentProfileMcpServerBase$1 {
709
+ enabled?: true;
710
+ transport?: "sse" | "http";
711
+ command?: never;
712
+ args?: never;
713
+ env?: never;
714
+ cwd?: never;
715
+ url: string;
716
+ headers?: Record<string, AgentProfileConfigValue$1>;
717
+ }
718
+ interface AgentProfileDisabledMcpServer$1 extends AgentProfileMcpServerBase$1 {
719
+ enabled: false;
720
+ transport?: never;
721
+ command?: never;
722
+ args?: never;
723
+ env?: never;
724
+ cwd?: never;
725
+ url?: never;
726
+ headers?: never;
727
+ }
728
+ type AgentProfileMcpServer$1 = AgentProfileLocalMcpServer$1 | AgentProfileRemoteMcpServer$1 | AgentProfileDisabledMcpServer$1;
729
+ /**
730
+ * Hub-managed integration grant. The sandbox runtime resolves each declared
731
+ * connection/capability pair into an MCP tool backed by Tangle Hub policy.
732
+ */
733
+ interface AgentProfileConnection$1 {
734
+ /**
735
+ * Hub connection id selected by the user, for example a connected Gmail
736
+ * account.
737
+ */
738
+ connectionId: string;
739
+ /**
740
+ * Capability paths explicitly granted to the agent.
741
+ */
742
+ capabilities: string[];
743
+ /**
744
+ * Optional MCP server alias. Must be unique after profile merge.
745
+ */
746
+ alias?: string;
747
+ }
748
+ /** Identity of a task whose data was exposed to training or model selection. */
749
+ interface AgentTrainingTask$1 {
750
+ benchmark: string;
751
+ task: string;
752
+ contentDigest: Sha256Digest$1;
753
+ }
754
+ /** Complete exposure inventory, derived from the exact dataset delivered to a trainer. */
755
+ interface AgentTrainingDatasetIdentity$1 {
756
+ digest: Sha256Digest$1;
757
+ taskSetDigest: Sha256Digest$1;
758
+ tasks: AgentTrainingTask$1[];
759
+ }
760
+ interface AgentTrainingReceipt$1 {
761
+ version: 1;
762
+ dataset: AgentTrainingDatasetIdentity$1;
763
+ parentProfileDigest: Sha256Digest$1;
764
+ /** Null only when the parent has no training receipt. */
765
+ parentReceiptDigest: Sha256Digest$1 | null;
766
+ executionRef: Sha256Digest$1;
767
+ trainer: {
768
+ mode: "command" | "managed";
769
+ id: string;
770
+ revision: Sha256Digest$1; /** Public hyperparameters only; credentials belong to the private executor. */
771
+ parameters: Record<string, string | number | boolean | null>;
772
+ };
773
+ checkpoint: {
774
+ artifactDigest: Sha256Digest$1;
775
+ artifactBytes: number;
776
+ routerModelId: string; /** Digest of independently verified serving evidence, not trainer stdout. */
777
+ servingDigest: Sha256Digest$1;
778
+ };
779
+ }
780
+ interface AgentProfileTraining$1 {
781
+ receipt: AgentTrainingReceipt$1;
782
+ /** Immediate parent first, terminating at a receipt with parentReceiptDigest=null. */
783
+ ancestors: AgentTrainingReceipt$1[];
784
+ }
785
+ interface AgentProfileMetadata$1 extends Record<string, unknown> {
786
+ /** Reserved: a trained model is admitted only with a complete checkpoint receipt. */
787
+ training?: AgentProfileTraining$1;
788
+ }
789
+ /**
790
+ * Public provider-neutral agent profile contract.
791
+ */
792
+ interface AgentProfile$1 {
793
+ name?: string;
794
+ description?: string;
795
+ version?: string;
796
+ tags?: string[];
797
+ prompt?: AgentProfilePrompt$1;
798
+ model?: AgentProfileModelHints$1;
799
+ /**
800
+ * Preferred execution harness for this profile — the coding-CLI runtime that
801
+ * materializes and runs it (`claude-code`, `codex`, `opencode`, `pi`, …).
802
+ *
803
+ * This optional authored preference participates in canonical profile
804
+ * identity. An executor MAY override it for one run; the effective profile and
805
+ * execution receipt then bind that override without changing what was
806
+ * authored. When unset, the caller/executor chooses. Formalizes what runtimes
807
+ * already read as `profile.harness`; making it typed also lets an improvement
808
+ * loop optimize harness routing as a first-class lever.
809
+ */
810
+ harness?: HarnessType$1;
811
+ /**
812
+ * Ordered, authored subscription chain for one logical agent. The first
813
+ * stage must match `harness`, `model.provider`, and `model.default` above.
814
+ * Omission preserves the existing single-provider execution policy.
815
+ */
816
+ seats?: AgentProfileSeat$1[];
817
+ permissions?: Record<string, AgentProfilePermission$1>;
818
+ tools?: Record<string, boolean>;
819
+ mcp?: Record<string, AgentProfileMcpServer$1>;
820
+ connections?: AgentProfileConnection$1[];
821
+ subagents?: Record<string, AgentSubagentProfile$1>;
822
+ resources?: AgentProfileResources$1;
823
+ hooks?: Record<string, AgentProfileHookCommand$1[]>;
824
+ modes?: Record<string, AgentProfileMode$1>;
825
+ confidential?: AgentProfileConfidential$1;
826
+ metadata?: AgentProfileMetadata$1;
827
+ /**
828
+ * Non-portable backend-specific extensions.
829
+ *
830
+ * Use this only for features that cannot be expressed generically.
831
+ * SDK consumers should treat extension keys as backend namespaces.
832
+ */
833
+ extensions?: Record<string, Record<string, unknown> | undefined>;
834
+ }
835
+ //#endregion
836
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@4.0.0/node_modules/@tangle-network/agent-interface/dist/agent-candidate.d.ts
837
+ /** Full SHA-256 digest with an explicit algorithm prefix. */
838
+ type Sha256Digest$1 = `sha256:${string}`;
839
+ //#endregion
840
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@4.0.0/node_modules/@tangle-network/agent-interface/dist/environment-interactive-control.d.ts
841
+ /**
842
+ * Durable identity of one coding-agent TUI.
843
+ *
844
+ * This reference identifies the exact admitted run and preparation receipt.
845
+ * It is not a generic shell id and cannot be used to create another process.
846
+ */
847
+ declare const AgentInteractiveSessionRefSchema$1: z.ZodObject<{
848
+ run: z.ZodObject<{
849
+ runId: z.ZodString;
850
+ provider: z.ZodString;
851
+ environmentId: z.ZodString;
852
+ sessionId: z.ZodString;
853
+ executionId: z.ZodString;
854
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
855
+ }, z.core.$strict>;
856
+ preparationReceipt: z.ZodObject<{
857
+ kind: z.ZodLiteral<"agent-execution-preparation">;
858
+ schemaVersion: z.ZodLiteral<1>;
859
+ preparationId: z.ZodString;
860
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
861
+ authoredProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
862
+ effectiveProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
863
+ backend: z.ZodString;
864
+ harness: z.ZodEnum<{
865
+ acp: "acp";
866
+ amp: "amp";
867
+ "claude-code": "claude-code";
868
+ "cli-base": "cli-base";
869
+ codex: "codex";
870
+ cursor: "cursor";
871
+ "factory-droids": "factory-droids";
872
+ forge: "forge";
873
+ gemini: "gemini";
874
+ hermes: "hermes";
875
+ "kimi-code": "kimi-code";
876
+ nanoclaw: "nanoclaw";
877
+ openclaw: "openclaw";
878
+ opencode: "opencode";
879
+ pi: "pi";
880
+ prime: "prime";
881
+ }>;
882
+ harnessVersion: z.ZodString;
883
+ resolvedModel: z.ZodObject<{
884
+ requested: z.ZodString;
885
+ resolved: z.ZodString;
886
+ provider: z.ZodOptional<z.ZodString>;
887
+ reasoningEffort: z.ZodOptional<z.ZodObject<{
888
+ requested: z.ZodEnum<{
889
+ high: "high";
890
+ low: "low";
891
+ medium: "medium";
892
+ minimal: "minimal";
893
+ none: "none";
894
+ ultracode: "ultracode";
895
+ xhigh: "xhigh";
896
+ }>;
897
+ resolved: z.ZodOptional<z.ZodEnum<{
898
+ high: "high";
899
+ low: "low";
900
+ medium: "medium";
901
+ minimal: "minimal";
902
+ none: "none";
903
+ ultracode: "ultracode";
904
+ xhigh: "xhigh";
905
+ }>>;
906
+ fidelity: z.ZodEnum<{
907
+ clamped: "clamped";
908
+ exact: "exact";
909
+ unsupported: "unsupported";
910
+ }>;
911
+ }, z.core.$strict>>;
912
+ }, z.core.$strict>;
913
+ workspace: z.ZodObject<{
914
+ leaseId: z.ZodString;
915
+ provider: z.ZodString;
916
+ identityDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
917
+ isolation: z.ZodEnum<{
918
+ "per-run": "per-run";
919
+ shared: "shared";
920
+ }>;
921
+ sourceSnapshotDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
922
+ sourceSnapshotPolicy: z.ZodObject<{
923
+ kind: z.ZodLiteral<"provider-declared">;
924
+ name: z.ZodString;
925
+ version: z.ZodNumber;
926
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
927
+ }, z.core.$strict>;
928
+ preparedWorkspaceDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
929
+ profileActivationDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
930
+ }, z.core.$strict>;
931
+ axisResults: z.ZodArray<z.ZodObject<{
932
+ axis: z.ZodEnum<{
933
+ appendSystemPrompt: "appendSystemPrompt";
934
+ commands: "commands";
935
+ confidential: "confidential";
936
+ connections: "connections";
937
+ description: "description";
938
+ extensions: "extensions";
939
+ files: "files";
940
+ harness: "harness";
941
+ hooks: "hooks";
942
+ instructions: "instructions";
943
+ mcp: "mcp";
944
+ metadata: "metadata";
945
+ modelDefault: "modelDefault";
946
+ modelMaxReasoningTokens: "modelMaxReasoningTokens";
947
+ modelMaxTotalOutputTokens: "modelMaxTotalOutputTokens";
948
+ modelMaxVisibleOutputTokens: "modelMaxVisibleOutputTokens";
949
+ modelMetadata: "modelMetadata";
950
+ modelProvider: "modelProvider";
951
+ modelReasoningEffort: "modelReasoningEffort";
952
+ modelSmall: "modelSmall";
953
+ modes: "modes";
954
+ name: "name";
955
+ permissions: "permissions";
956
+ resourceAgents: "resourceAgents";
957
+ resourceFailOnError: "resourceFailOnError";
958
+ resourceInstructions: "resourceInstructions";
959
+ resourceTools: "resourceTools";
960
+ seats: "seats";
961
+ skills: "skills";
962
+ subagents: "subagents";
963
+ systemPrompt: "systemPrompt";
964
+ tags: "tags";
965
+ tools: "tools";
966
+ version: "version";
967
+ }>;
968
+ disposition: z.ZodEnum<{
969
+ behavior: "behavior";
970
+ control: "control";
971
+ overridden: "overridden";
972
+ unsupported: "unsupported";
973
+ }>;
974
+ owner: z.ZodEnum<{
975
+ executor: "executor";
976
+ runtime: "runtime";
977
+ }>;
978
+ mechanism: z.ZodString;
979
+ evidenceDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
980
+ path: z.ZodOptional<z.ZodString>;
981
+ reason: z.ZodOptional<z.ZodString>;
982
+ }, z.core.$strict>>;
983
+ executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
984
+ materializer: z.ZodObject<{
985
+ name: z.ZodString;
986
+ version: z.ZodString;
987
+ }, z.core.$strict>;
988
+ expiresAtMs: z.ZodNumber;
989
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
990
+ }, z.core.$strict>;
991
+ incarnationId: z.ZodString;
992
+ startedAt: z.ZodISODateTime;
993
+ }, z.core.$strict>;
994
+ type AgentInteractiveSessionRef$1 = z.infer<typeof AgentInteractiveSessionRefSchema$1>;
995
+ /**
996
+ * Provider-issued write authority for one exact interactive process.
997
+ *
998
+ * Expiry blocks mutations but does not kill the coding process. A coordinator
999
+ * can issue a new compare-and-swap claim after expiry. The provider's PTY owner
1000
+ * lease remains the separate process-cleanup authority.
1001
+ */
1002
+ declare const AgentInteractiveSessionControlClaimSchema$1: z.ZodObject<{
1003
+ refDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1004
+ generation: z.ZodNumber;
1005
+ leaseId: z.ZodString;
1006
+ holderId: z.ZodString;
1007
+ expiresAt: z.ZodISODateTime;
1008
+ }, z.core.$strict>;
1009
+ type AgentInteractiveSessionControlClaim$1 = z.infer<typeof AgentInteractiveSessionControlClaimSchema$1>;
1010
+ //#endregion
1011
+ //#region ../../../packages/runtime-contracts/dist/terminal-websocket.d.ts
1012
+ /** Non-credential protocol selected during a successful terminal handshake. */
1013
+ declare const TERMINAL_WS_ECHO_SUBPROTOCOL = "tangle.terminal.v1";
1014
+ /**
1015
+ * Server stamps for one attach, in epoch milliseconds on the sidecar's clock.
1016
+ * They are absolute so a caller can lay them against its own marks and read
1017
+ * each leg (client clock skew is the only error). `spawn*` and `initPersistAt`
1018
+ * are absent when the attach adopted a PTY that already existed.
1019
+ */
1020
+ declare const terminalReadyTimingsSchema: z.ZodObject<{
1021
+ upgradeAt: z.ZodNumber;
1022
+ authAt: z.ZodNumber;
1023
+ initAt: z.ZodNumber;
1024
+ loadAt: z.ZodNumber;
1025
+ spawnAt: z.ZodOptional<z.ZodNumber>;
1026
+ initPersistAt: z.ZodOptional<z.ZodNumber>;
1027
+ loadedAt: z.ZodNumber;
1028
+ historyAt: z.ZodNumber;
1029
+ historyEvents: z.ZodNumber;
1030
+ historyBytes: z.ZodNumber;
1031
+ readyAt: z.ZodNumber;
1032
+ via: z.ZodEnum<{
1033
+ upgrade: "upgrade";
1034
+ frame: "frame";
1035
+ }>;
1036
+ ptid: z.ZodOptional<z.ZodString>;
1037
+ }, z.core.$strip>;
1038
+ type TerminalReadyTimings = z.infer<typeof terminalReadyTimingsSchema>;
1039
+ declare const terminalReadyMessageSchema: z.ZodObject<{
1040
+ type: z.ZodLiteral<"ready">;
1041
+ connectionId: z.ZodString;
1042
+ sessionId: z.ZodString;
1043
+ restored: z.ZodBoolean;
1044
+ detachTimeoutMs: z.ZodNumber;
1045
+ attachCount: z.ZodOptional<z.ZodNumber>;
1046
+ cursors: z.ZodOptional<z.ZodObject<{
1047
+ earliest: z.ZodNumber;
1048
+ latest: z.ZodNumber;
1049
+ }, z.core.$strip>>;
1050
+ timings: z.ZodOptional<z.ZodObject<{
1051
+ upgradeAt: z.ZodNumber;
1052
+ authAt: z.ZodNumber;
1053
+ initAt: z.ZodNumber;
1054
+ loadAt: z.ZodNumber;
1055
+ spawnAt: z.ZodOptional<z.ZodNumber>;
1056
+ initPersistAt: z.ZodOptional<z.ZodNumber>;
1057
+ loadedAt: z.ZodNumber;
1058
+ historyAt: z.ZodNumber;
1059
+ historyEvents: z.ZodNumber;
1060
+ historyBytes: z.ZodNumber;
1061
+ readyAt: z.ZodNumber;
1062
+ via: z.ZodEnum<{
1063
+ upgrade: "upgrade";
1064
+ frame: "frame";
1065
+ }>;
1066
+ ptid: z.ZodOptional<z.ZodString>;
1067
+ }, z.core.$strip>>;
1068
+ }, z.core.$strip>;
1069
+ type TerminalReadyMessage = z.infer<typeof terminalReadyMessageSchema>;
1070
+ type TerminalReadyInfo = Omit<TerminalReadyMessage, "type">;
1071
+ /** One sequenced output frame for an exact interactive terminal. */
1072
+ declare const terminalOutputMessageSchema: z.ZodObject<{
1073
+ type: z.ZodLiteral<"output">;
1074
+ seq: z.ZodNumber;
1075
+ data: z.ZodString;
1076
+ }, z.core.$strip>;
1077
+ type TerminalOutputMessage = z.infer<typeof terminalOutputMessageSchema>;
1078
+ declare const terminalExitMessageSchema: z.ZodObject<{
1079
+ type: z.ZodLiteral<"exit">;
1080
+ exitCode: z.ZodOptional<z.ZodNumber>;
1081
+ exitSignal: z.ZodOptional<z.ZodString>;
1082
+ }, z.core.$strip>;
1083
+ type TerminalExitMessage = z.infer<typeof terminalExitMessageSchema>;
1084
+ type TerminalExitInfo = Omit<TerminalExitMessage, "type">;
1085
+ type TerminalStreamAuthFormat = "edge" | "sidecar-direct";
1086
+ interface TerminalInteractiveSessionIdentity {
1087
+ incarnationId: AgentInteractiveSessionRef$1["incarnationId"];
1088
+ control: AgentInteractiveSessionControlClaim$1;
1089
+ }
1090
+ //#endregion
1091
+ //#region src/scoped-token-types.d.ts
1092
+ /**
1093
+ * Public types for scoped consumer-side tokens.
1094
+ *
1095
+ * This module intentionally has no SDK implementation imports. Terminal
1096
+ * streams and token requests share these contracts without depending on the
1097
+ * SDK's aggregate types module.
1098
+ */
1099
+ /**
1100
+ * Scope of a `box.mintScopedToken()` request. `session` and `project` mint
1101
+ * SessionGateway read tokens. `session-runtime` and `read-only` mint sidecar
1102
+ * capability tokens for browser-safe runtime access; request access:"read-only"
1103
+ * on session-runtime for a session event stream without write capabilities.
1104
+ */
1105
+ type ScopedTokenScope = "session" | "session-runtime" | "project" | "read-only";
1106
+ interface MintScopedTokenBase {
1107
+ /** TTL in minutes. Default 5; clamped to [1, 15]. */
1108
+ ttlMinutes?: number;
1109
+ /** Cancel the token request before it reaches the terminal dial. */
1110
+ signal?: AbortSignal;
1111
+ }
1112
+ /** Options for `box.mintScopedToken()`, narrowed by consumer scope. */
1113
+ type MintScopedTokenOptions = (MintScopedTokenBase & {
1114
+ scope: "session"; /** Client-facing browser session ID. */
1115
+ sessionId: string; /** Actual runtime session ID used to filter the sandbox event stream. */
1116
+ runtimeSessionId: string;
1117
+ }) | (MintScopedTokenBase & {
1118
+ scope: "session-runtime";
1119
+ sessionId: string; /** Restrict this session's bearer to reads; omission also grants workspace/terminal. */
1120
+ access?: "read-only";
1121
+ runtimeSessionId?: never;
1122
+ }) | (MintScopedTokenBase & {
1123
+ scope: "project" | "read-only";
1124
+ sessionId?: never;
1125
+ runtimeSessionId?: never;
1126
+ });
1127
+ /** Options for the server-side exact interactive-session token request. */
1128
+ type MintInteractiveSessionTokenOptions = Pick<MintScopedTokenBase, "ttlMinutes" | "signal">;
1129
+ /**
1130
+ * Returned by `box.mintScopedToken()`. Native session streams use a read-only
1131
+ * session-runtime token. Session/project tokens retain legacy gateway semantics.
1132
+ */
1133
+ interface ScopedToken {
1134
+ /** Bearer token (JWT) for the consumer selected by `scope`. */
1135
+ token: string;
1136
+ /** When the token expires. */
1137
+ expiresAt: Date;
1138
+ /** The runtime's direct edge URL. Use with runtime scopes; session/project
1139
+ * tokens instead connect to the Sandbox API's `/session` WebSocket. */
1140
+ runtimeUrl: string;
1141
+ /** Browser-safe Sandbox API proxy base for terminal and runtime requests. */
1142
+ sidecarProxyUrl: string;
1143
+ /** Echo of the requested scope. */
1144
+ scope: ScopedTokenScope;
1145
+ /** Acknowledged session-runtime restriction; absent for unrestricted requests. */
1146
+ access?: "read-only";
1147
+ }
1148
+ //#endregion
1149
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/plan.d.ts
1150
+ /**
1151
+ * Typed server-originated continuation. Adapters consume this instead of
1152
+ * inferring approval from a free-form user message.
1153
+ */
1154
+ declare const PlanContinuationSchema: z.ZodObject<{
1155
+ version: z.ZodLiteral<1>;
1156
+ plan: z.ZodObject<{
1157
+ id: z.ZodString;
1158
+ revision: z.ZodNumber;
1159
+ title: z.ZodOptional<z.ZodString>;
1160
+ body: z.ZodString;
1161
+ submittedAt: z.ZodString;
1162
+ }, z.core.$strict>;
1163
+ sourceToolCallId: z.ZodString;
1164
+ decision: z.ZodDiscriminatedUnion<[z.ZodObject<{
1165
+ outcome: z.ZodLiteral<"approved">;
1166
+ }, z.core.$strict>, z.ZodObject<{
1167
+ outcome: z.ZodLiteral<"rejected">;
1168
+ feedback: z.ZodString;
1169
+ }, z.core.$strict>], "outcome">;
1170
+ providerState: z.ZodDiscriminatedUnion<[z.ZodObject<{
1171
+ kind: z.ZodLiteral<"claude-code">;
1172
+ version: z.ZodLiteral<1>;
1173
+ nativeSessionId: z.ZodString;
1174
+ }, z.core.$strict>, z.ZodObject<{
1175
+ kind: z.ZodLiteral<"codex">;
1176
+ version: z.ZodLiteral<1>;
1177
+ threadId: z.ZodString;
1178
+ }, z.core.$strict>, z.ZodObject<{
1179
+ kind: z.ZodLiteral<"opencode">;
1180
+ version: z.ZodLiteral<1>;
1181
+ }, z.core.$strict>], "kind">;
1182
+ }, z.core.$strict>;
1183
+ type PlanContinuation = z.infer<typeof PlanContinuationSchema>;
1184
+ //#endregion
1185
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/interaction-data.d.ts
1186
+ declare const InteractionSecretReferenceSchema: z.ZodObject<{
1187
+ kind: z.ZodLiteral<"secret_handle">;
1188
+ handleId: z.ZodString;
1189
+ oneUse: z.ZodLiteral<true>;
1190
+ }, z.core.$strict>;
1191
+ type InteractionSecretReference = z.infer<typeof InteractionSecretReferenceSchema>;
1192
+ type InteractionDataValue = string | number | boolean | string[] | InteractionSecretReference;
1193
+ type InteractionData = Record<string, InteractionDataValue>;
1194
+ declare const InteractionResolutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1195
+ outcome: z.ZodLiteral<"accepted">;
1196
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1197
+ }, z.core.$strict>, z.ZodObject<{
1198
+ outcome: z.ZodLiteral<"declined">;
1199
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1200
+ }, z.core.$strict>, z.ZodObject<{
1201
+ outcome: z.ZodLiteral<"cancelled">;
1202
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1203
+ }, z.core.$strict>], "outcome">;
1204
+ type InteractionResolution = z.infer<typeof InteractionResolutionSchema>;
1205
+ //#endregion
1206
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/proxy-secrets.d.ts
1207
+ declare const ProxySecretBindingSchema: z.ZodObject<{
1208
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
1209
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1210
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1211
+ envName: z.ZodString;
1212
+ secretRef: z.ZodObject<{
1213
+ key: z.ZodString;
1214
+ kind: z.ZodLiteral<"secret-ref">;
1215
+ }, z.core.$strict>;
1216
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
1217
+ type: z.ZodLiteral<"bearer">;
1218
+ }, z.core.$strict>, z.ZodObject<{
1219
+ type: z.ZodLiteral<"basic">;
1220
+ username: z.ZodString;
1221
+ }, z.core.$strict>, z.ZodObject<{
1222
+ type: z.ZodLiteral<"header">;
1223
+ name: z.ZodString;
1224
+ }, z.core.$strict>, z.ZodObject<{
1225
+ type: z.ZodLiteral<"query">;
1226
+ name: z.ZodString;
1227
+ }, z.core.$strict>], "type">;
1228
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
1229
+ jwt: "jwt";
1230
+ opaque: "opaque";
1231
+ }>>;
1232
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
1233
+ }, z.core.$strict>;
1234
+ type ProxySecretBinding = z.infer<typeof ProxySecretBindingSchema>;
1235
+ /** Advertise only when served API, driver, host, proxy and materializer agree. Absence,
1236
+ * protocol skew, or unsupported driver/presentation/format refuses before resolution or launch.
1237
+ */
1238
+ declare const ProxySecretCapabilitiesSchema: z.ZodObject<{
1239
+ protocolVersion: z.ZodLiteral<1>;
1240
+ supportedDrivers: z.ZodArray<z.ZodString>;
1241
+ presentations: z.ZodArray<z.ZodEnum<{
1242
+ bearer: "bearer";
1243
+ basic: "basic";
1244
+ header: "header";
1245
+ query: "query";
1246
+ }>>;
1247
+ placeholderFormats: z.ZodArray<z.ZodEnum<{
1248
+ jwt: "jwt";
1249
+ opaque: "opaque";
1250
+ }>>;
1251
+ enforcement: z.ZodLiteral<"exact">;
1252
+ transports: z.ZodTuple<[z.ZodLiteral<"https:443">], null>;
1253
+ lifecycle: z.ZodLiteral<true>;
1254
+ placementReceiptRequired: z.ZodLiteral<true>;
1255
+ }, z.core.$strict>;
1256
+ type ProxySecretCapabilities = z.infer<typeof ProxySecretCapabilitiesSchema>;
1257
+ //#endregion
1258
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/harness.d.ts
1259
+ /**
1260
+ * Recognized execution identities, not a deployment's list of installed runners.
1261
+ * A profile's authored harness remains part of its canonical identity; execution
1262
+ * receipts record authored identity, effective identity and selected harness
1263
+ * separately. Retiring an executable must not invalidate historical profiles,
1264
+ * sessions or receipts. Availability is admitted against the selected deployment.
1265
+ *
1266
+ * `cli-base` names router-backed execution without a full coding-agent harness.
1267
+ * `prime` is a distinct Pi-line fork with a different native wire protocol; its
1268
+ * sessions are not interchangeable with Pi sessions. A shared identity does not
1269
+ * assert protocol, model, profile-control or native-resume compatibility.
1270
+ */
1271
+ declare const harnessTypeSchema: z.ZodEnum<{
1272
+ "claude-code": "claude-code";
1273
+ nanoclaw: "nanoclaw";
1274
+ codex: "codex";
1275
+ opencode: "opencode";
1276
+ "kimi-code": "kimi-code";
1277
+ pi: "pi";
1278
+ prime: "prime";
1279
+ gemini: "gemini";
1280
+ hermes: "hermes";
1281
+ openclaw: "openclaw";
1282
+ amp: "amp";
1283
+ "factory-droids": "factory-droids";
1284
+ forge: "forge";
1285
+ cursor: "cursor";
1286
+ acp: "acp";
1287
+ "cli-base": "cli-base";
1288
+ }>;
1289
+ /** One declaration owns runtime validation and the compile-time vocabulary. */
1290
+ type HarnessType = z.infer<typeof harnessTypeSchema>;
1291
+ //#endregion
1292
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/agent-profile.d.ts
1293
+ /**
1294
+ * Permission policy value for a capability.
1295
+ */
1296
+ type AgentProfilePermissionValue = "allow" | "ask" | "deny";
1297
+ type AgentProfilePermission = AgentProfilePermissionValue | Record<string, AgentProfilePermissionValue>;
1298
+ /**
1299
+ * Generic resource reference that can be resolved into a file or instruction.
1300
+ */
1301
+ type AgentProfileResourceRef = {
1302
+ kind: "inline";
1303
+ name: string;
1304
+ content: string;
1305
+ } | {
1306
+ kind: "github";
1307
+ /**
1308
+ * Optional repository in "owner/repo" form. When omitted, providers may
1309
+ * only resolve the path if they have an ambient repository context.
1310
+ */
1311
+ repository?: string;
1312
+ path: string;
1313
+ ref?: string;
1314
+ name?: string;
1315
+ };
1316
+ /**
1317
+ * Resource mounted into a backend workspace.
1318
+ */
1319
+ interface AgentProfileFileMount {
1320
+ path: string;
1321
+ resource: AgentProfileResourceRef;
1322
+ executable?: boolean;
1323
+ }
1324
+ /** Immutable Hub source generation. This is public identity, never retrieval authority. */
1325
+ interface AgentProfileKnowledgeRef {
1326
+ sourceId: string;
1327
+ generation: string;
1328
+ }
1329
+ interface AgentProfileResources {
1330
+ /** Owner-authorized source generations resolved by the execution host before admission.
1331
+ * Source content and credentials must never be inlined into a profile or prompt. */
1332
+ knowledge?: AgentProfileKnowledgeRef[];
1333
+ /**
1334
+ * Generic files to materialize into the agent workspace before execution.
1335
+ */
1336
+ files?: AgentProfileFileMount[];
1337
+ /**
1338
+ * Provider-native tool files. Backends materialize these into their standard
1339
+ * discovery location when they support file-based tools.
1340
+ */
1341
+ tools?: AgentProfileResourceRef[];
1342
+ /**
1343
+ * Agent Skills (`SKILL.md`) packages. Supported by Cursor, Claude Code,
1344
+ * Codex-compatible layouts, OpenCode, and Hermes-style skill harnesses.
1345
+ */
1346
+ skills?: AgentProfileResourceRef[];
1347
+ /**
1348
+ * Provider-native subagent definition files.
1349
+ */
1350
+ agents?: AgentProfileResourceRef[];
1351
+ /**
1352
+ * Provider-native slash command files.
1353
+ */
1354
+ commands?: AgentProfileResourceRef[];
1355
+ /**
1356
+ * Additional instructions injected into the agent context.
1357
+ */
1358
+ instructions?: string | AgentProfileResourceRef;
1359
+ /**
1360
+ * Fail initialization when a provider cannot materialize a resource.
1361
+ */
1362
+ failOnError?: boolean;
1363
+ }
1364
+ /**
1365
+ * Portable reasoning/thinking effort. Backends map it to their native control at materialization:
1366
+ * codex `model_reasoning_effort`, kimi `--thinking`/`--no-thinking`, claude thinking budget.
1367
+ * Ordered low→high:
1368
+ * - `none` — extended thinking OFF (no reasoning budget at all)
1369
+ * - `minimal` — thinking ON, the lowest budget (distinct from `none`)
1370
+ * - `low` / `medium` / `high` / `xhigh`
1371
+ * - `ultracode` — maximum (Claude Code's `max` and Codex's `ultra` reconcile here).
1372
+ * A backend without a matching native tier may clamp down to its strongest supported level, but it
1373
+ * must never turn reasoning on for `none` or silently increase a requested effort.
1374
+ */
1375
+ declare const REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"];
1376
+ type ReasoningEffort = (typeof REASONING_EFFORTS)[number];
1377
+ /** Model selection hints for backends. */
1378
+ interface AgentProfileModelHints {
1379
+ /** Preferred default model, commonly provider/model. */
1380
+ default?: string;
1381
+ /** Preferred small/cheap model for lightweight work. */
1382
+ small?: string;
1383
+ /** Optional provider preference hint. */
1384
+ provider?: string;
1385
+ /**
1386
+ * Reasoning/thinking effort hint — a first-class, portable model dimension (not buried in
1387
+ * `extensions`). Backends map it to their native control at materialization.
1388
+ *
1389
+ * This is a quality dial, not a spend limit. It never bounds token count.
1390
+ */
1391
+ reasoningEffort?: ReasoningEffort;
1392
+ /** Positive maximum billed visible answer tokens per completion, independent of reasoning/total ceilings. */
1393
+ maxVisibleOutputTokens?: number;
1394
+ /** Positive maximum billed hidden reasoning tokens per completion, separate from visible answer tokens. */
1395
+ maxReasoningTokens?: number;
1396
+ /** Positive total ceiling for billed visible/hidden completion tokens; neither individual ceiling may exceed it. */
1397
+ maxTotalOutputTokens?: number;
1398
+ /** Backend-agnostic model metadata/hints. */
1399
+ metadata?: Record<string, unknown>;
1400
+ }
1401
+ /** An authored subscription choice. The executor resolves account availability at run time. */
1402
+ interface AgentProfileSeat {
1403
+ /** Exact harness to use for this segment. */
1404
+ harness: HarnessType;
1405
+ /** Provider that must serve `model`; a different provider requires another stage. */
1406
+ provider: string;
1407
+ /** Exact model requested from this provider. */
1408
+ model: string;
1409
+ /** Override profile.model.reasoningEffort for this stage; omission inherits, none disables thinking. */
1410
+ reasoningEffort?: ReasoningEffort;
1411
+ /** Select all eligible accounts in account-manager order, or one named account. */
1412
+ selector: {
1413
+ kind: "all-eligible";
1414
+ } | {
1415
+ kind: "seat";
1416
+ id: string;
1417
+ };
1418
+ /** Replace the profile-level native tool map for this stage; `{}` clears it. */
1419
+ tools?: Record<string, boolean>;
1420
+ /** Replace the profile-level permission map for this stage; `{}` clears it. */
1421
+ permissions?: Record<string, AgentProfilePermission>;
1422
+ }
1423
+ /**
1424
+ * Prompt shaping for an agent.
1425
+ *
1426
+ * Replacement and addition are two different intents against the same channel
1427
+ * and are never interchangeable. A backend that can only do one of them must
1428
+ * refuse the other rather than substituting it, which is why
1429
+ * {@link AgentProfileCapabilities.systemPrompt} carries a separate bit for each.
1430
+ *
1431
+ * Setting `systemPrompt` and `appendSystemPrompt` together is legal and ordered:
1432
+ * the replacement is installed first and the addition composes on top of it, so
1433
+ * the effective prompt is `systemPrompt` then `appendSystemPrompt`. The pair is
1434
+ * deliberately allowed because {@link mergeAgentProfiles} composes the two
1435
+ * fields independently — refusing it would let two individually valid profiles
1436
+ * merge into an invalid one.
1437
+ */
1438
+ interface AgentProfilePrompt {
1439
+ /**
1440
+ * REPLACE the harness's own system prompt with this text.
1441
+ *
1442
+ * The harness's built-in prompt is DELETED, not extended: the model stops
1443
+ * receiving the tool descriptions, output conventions, refusal rules, and
1444
+ * workflow scaffolding it was tuned against, so behavior can move far beyond
1445
+ * the words written here. Supply a prompt that stands on its own.
1446
+ *
1447
+ * Honored only where {@link AgentProfileSystemPromptCapability.replace} is
1448
+ * true — a harness that exposes a real replacement control (`pi
1449
+ * --system-prompt <file>` with context files, skills, and prompt templates
1450
+ * off; gemini `.gemini/system.md` with `GEMINI_SYSTEM_MD=1`). A backend that
1451
+ * can only add text must reject this field. Folding it into an addition is a
1452
+ * silent semantic downgrade: the instructions the caller asked to delete stay
1453
+ * in force, and nothing in the result says so.
1454
+ */
1455
+ systemPrompt?: string;
1456
+ /**
1457
+ * ADD this text to the harness's own system prompt, which stays intact.
1458
+ *
1459
+ * The model keeps everything it was tuned against and receives this on top,
1460
+ * in the same privileged position as the system prompt. Maps to claude-code
1461
+ * `--append-system-prompt`, and to a leading `role: "system"` message on
1462
+ * harnesses that take a message list.
1463
+ *
1464
+ * Distinct from {@link AgentProfilePrompt.instructions}, which harnesses
1465
+ * materialize into their lower-privilege project-instruction surface.
1466
+ *
1467
+ * Honored only where {@link AgentProfileSystemPromptCapability.append} is
1468
+ * true.
1469
+ */
1470
+ appendSystemPrompt?: string;
1471
+ /**
1472
+ * Additional instruction lines composed into the agent's project-instruction
1473
+ * surface — the harness's `AGENTS.md` / `CLAUDE.md`-style files or its own
1474
+ * caller-instruction preamble. Lower privilege than
1475
+ * {@link AgentProfilePrompt.appendSystemPrompt} and placed wherever the
1476
+ * harness keeps caller instructions rather than in the system prompt.
1477
+ */
1478
+ instructions?: string[];
1479
+ }
1480
+ /** Deliberately public configuration included in profile identity. */
1481
+ interface AgentProfilePublicConfigValue {
1482
+ kind: "public";
1483
+ value: string;
1484
+ }
1485
+ /**
1486
+ * Opaque reference resolved only inside the private prepared executor.
1487
+ * `key` is caller-declared public identity naming provider/operator-owned
1488
+ * secret material; callers must not put the secret value in it.
1489
+ */
1490
+ interface AgentProfileSecretRef {
1491
+ kind: "secret-ref";
1492
+ key: string;
1493
+ /** Apply no decoration or a `Bearer ` prefix after private resolution. */
1494
+ format?: "raw" | "bearer";
1495
+ }
1496
+ /** A configuration value is public bytes or an opaque secret identity. */
1497
+ type AgentProfileConfigValue = AgentProfilePublicConfigValue | AgentProfileSecretRef;
1498
+ /**
1499
+ * Generic subagent definition.
1500
+ */
1501
+ interface AgentSubagentProfile {
1502
+ description?: string;
1503
+ prompt?: string;
1504
+ model?: string;
1505
+ tools?: Record<string, boolean>;
1506
+ permissions?: Record<string, AgentProfilePermission>;
1507
+ maxSteps?: number;
1508
+ metadata?: Record<string, unknown>;
1509
+ }
1510
+ interface AgentProfileHookCommand {
1511
+ command: string;
1512
+ timeoutMs?: number;
1513
+ blocking?: boolean;
1514
+ matcher?: string;
1515
+ env?: Record<string, AgentProfileConfigValue>;
1516
+ }
1517
+ interface AgentProfileMode {
1518
+ description?: string;
1519
+ model?: string;
1520
+ prompt?: string;
1521
+ tools?: Record<string, boolean>;
1522
+ permissions?: Record<string, AgentProfilePermission>;
1523
+ metadata?: Record<string, unknown>;
1524
+ }
1525
+ /**
1526
+ * Confidential-execution options for sandbox backends.
1527
+ *
1528
+ * The Tangle blueprint path translates this into TEE job parameters and fails
1529
+ * closed when the requested TEE is unavailable. Callers should verify returned
1530
+ * attestation evidence before treating a session as confidential.
1531
+ */
1532
+ interface AgentProfileConfidential {
1533
+ /**
1534
+ * TEE variant requested from the operator.
1535
+ */
1536
+ tee?: "tdx" | "nitro" | "phala-dstack" | "sev-snp" | "any" | (string & {});
1537
+ /**
1538
+ * Optional hex-encoded 32-64 byte challenge for deploy-time report data.
1539
+ */
1540
+ attestationNonce?: string;
1541
+ /**
1542
+ * Require no persistence across session end when supported by the backend.
1543
+ */
1544
+ sealed?: boolean;
1545
+ /**
1546
+ * Ask the SDK/backend to create or require a fresh attestation challenge.
1547
+ */
1548
+ attestationRefresh?: boolean;
1549
+ }
1550
+ /**
1551
+ * Generic MCP server configuration.
1552
+ */
1553
+ interface AgentProfileMcpServerBase {
1554
+ metadata?: Record<string, unknown>;
1555
+ }
1556
+ interface AgentProfileLocalMcpServer extends AgentProfileMcpServerBase {
1557
+ enabled?: true;
1558
+ transport?: "stdio";
1559
+ command: string;
1560
+ args?: AgentProfileConfigValue[];
1561
+ env?: Record<string, AgentProfileConfigValue>;
1562
+ cwd?: string;
1563
+ url?: never;
1564
+ headers?: never;
1565
+ }
1566
+ interface AgentProfileRemoteMcpServer extends AgentProfileMcpServerBase {
1567
+ enabled?: true;
1568
+ transport?: "sse" | "http";
1569
+ command?: never;
1570
+ args?: never;
1571
+ env?: never;
1572
+ cwd?: never;
1573
+ url: string;
1574
+ headers?: Record<string, AgentProfileConfigValue>;
1575
+ }
1576
+ interface AgentProfileDisabledMcpServer extends AgentProfileMcpServerBase {
1577
+ enabled: false;
1578
+ transport?: never;
1579
+ command?: never;
1580
+ args?: never;
1581
+ env?: never;
1582
+ cwd?: never;
1583
+ url?: never;
1584
+ headers?: never;
1585
+ }
1586
+ type AgentProfileMcpServer = AgentProfileLocalMcpServer | AgentProfileRemoteMcpServer | AgentProfileDisabledMcpServer;
1587
+ /**
1588
+ * Hub-managed integration grant. The sandbox runtime resolves each declared
1589
+ * connection/capability pair into an MCP tool backed by Tangle Hub policy.
1590
+ */
1591
+ interface AgentProfileConnection {
1592
+ /**
1593
+ * Hub connection id selected by the user, for example a connected Gmail
1594
+ * account.
1595
+ */
1596
+ connectionId: string;
1597
+ /**
1598
+ * Capability paths explicitly granted to the agent.
1599
+ */
1600
+ capabilities: string[];
1601
+ /**
1602
+ * Optional MCP server alias. Must be unique after profile merge.
1603
+ */
1604
+ alias?: string;
1605
+ }
1606
+ /** Identity of a task whose data was exposed to training or model selection. */
1607
+ interface AgentTrainingTask {
1608
+ benchmark: string;
1609
+ task: string;
1610
+ contentDigest: Sha256Digest;
1611
+ }
1612
+ /** Complete exposure inventory, derived from the exact dataset delivered to a trainer. */
1613
+ interface AgentTrainingDatasetIdentity {
1614
+ digest: Sha256Digest;
1615
+ taskSetDigest: Sha256Digest;
1616
+ tasks: AgentTrainingTask[];
1617
+ }
1618
+ interface AgentTrainingReceipt {
1619
+ version: 1;
1620
+ dataset: AgentTrainingDatasetIdentity;
1621
+ parentProfileDigest: Sha256Digest;
1622
+ /** Null only when the parent has no training receipt. */
1623
+ parentReceiptDigest: Sha256Digest | null;
1624
+ executionRef: Sha256Digest;
1625
+ trainer: {
1626
+ mode: "command" | "managed";
1627
+ id: string;
1628
+ revision: Sha256Digest; /** Public hyperparameters only; credentials belong to the private executor. */
1629
+ parameters: Record<string, string | number | boolean | null>;
1630
+ };
1631
+ checkpoint: {
1632
+ artifactDigest: Sha256Digest;
1633
+ artifactBytes: number;
1634
+ routerModelId: string; /** Digest of independently verified serving evidence, not trainer stdout. */
1635
+ servingDigest: Sha256Digest;
1636
+ };
1637
+ }
1638
+ interface AgentProfileTraining {
1639
+ receipt: AgentTrainingReceipt;
1640
+ /** Immediate parent first, terminating at a receipt with parentReceiptDigest=null. */
1641
+ ancestors: AgentTrainingReceipt[];
1642
+ }
1643
+ interface AgentProfileMetadata extends Record<string, unknown> {
1644
+ /** Reserved: a trained model is admitted only with a complete checkpoint receipt. */
1645
+ training?: AgentProfileTraining;
1646
+ }
1647
+ /**
1648
+ * Public provider-neutral agent profile contract.
1649
+ */
1650
+ interface AgentProfile {
1651
+ name?: string;
1652
+ description?: string;
1653
+ version?: string;
1654
+ tags?: string[];
1655
+ prompt?: AgentProfilePrompt;
1656
+ model?: AgentProfileModelHints;
1657
+ /**
1658
+ * Preferred execution harness for this profile — the coding-CLI runtime that
1659
+ * materializes and runs it (`claude-code`, `codex`, `opencode`, `pi`, …).
1660
+ *
1661
+ * This optional authored preference participates in canonical profile
1662
+ * identity. An executor MAY override it for one run; the effective profile and
1663
+ * execution receipt then bind that override without changing what was
1664
+ * authored. When unset, the caller/executor chooses. Formalizes what runtimes
1665
+ * already read as `profile.harness`; making it typed also lets an improvement
1666
+ * loop optimize harness routing as a first-class lever.
1667
+ */
1668
+ harness?: HarnessType;
1669
+ /**
1670
+ * Ordered, authored subscription chain for one logical agent. The first
1671
+ * stage must match `harness`, `model.provider`, and `model.default` above.
1672
+ * Omission preserves the existing single-provider execution policy.
1673
+ */
1674
+ seats?: AgentProfileSeat[];
1675
+ /** Reference-only proxy custody. Overlay replaces the entire selection; [] clears it.
1676
+ * Authorization and issuer scope remain outside this authored profile. */
1677
+ proxySecrets?: ProxySecretBinding[];
1678
+ permissions?: Record<string, AgentProfilePermission>;
1679
+ tools?: Record<string, boolean>;
1680
+ mcp?: Record<string, AgentProfileMcpServer>;
1681
+ connections?: AgentProfileConnection[];
1682
+ subagents?: Record<string, AgentSubagentProfile>;
1683
+ resources?: AgentProfileResources;
1684
+ hooks?: Record<string, AgentProfileHookCommand[]>;
1685
+ modes?: Record<string, AgentProfileMode>;
1686
+ confidential?: AgentProfileConfidential;
1687
+ metadata?: AgentProfileMetadata;
1688
+ /**
1689
+ * Non-portable backend-specific extensions.
1690
+ *
1691
+ * Use this only for features that cannot be expressed generically.
1692
+ * SDK consumers should treat extension keys as backend namespaces.
1693
+ */
1694
+ extensions?: Record<string, Record<string, unknown> | undefined>;
1695
+ }
1696
+ /**
1697
+ * What a backend can do to the harness's system prompt.
1698
+ *
1699
+ * Two independent bits, because most harnesses can do exactly one of them. A
1700
+ * single boolean cannot separate "I delete the built-in prompt and install
1701
+ * yours" from "I keep the built-in prompt and add yours to it", so a caller
1702
+ * reading it has no way to tell whether a requested replacement will actually
1703
+ * happen. Neither bit implies the other: declare each from what the backend's
1704
+ * materialization really does, not from whether it accepts the field.
1705
+ */
1706
+ interface AgentProfileSystemPromptCapability {
1707
+ /**
1708
+ * The backend honors {@link AgentProfilePrompt.systemPrompt} by deleting the
1709
+ * harness's own system prompt and installing the caller's. `false` means a
1710
+ * profile carrying `systemPrompt` must be REFUSED — never quietly added to
1711
+ * the built-in prompt instead.
1712
+ */
1713
+ replace: boolean;
1714
+ /**
1715
+ * The backend honors {@link AgentProfilePrompt.appendSystemPrompt} by keeping
1716
+ * the harness's own system prompt and adding the caller's text to it.
1717
+ */
1718
+ append: boolean;
1719
+ }
1720
+ /**
1721
+ * Capabilities describing how a backend interprets AgentProfile.
1722
+ */
1723
+ interface AgentProfileCapabilities {
1724
+ namedProfiles: boolean;
1725
+ /** Absent means proxy-only profiles must be refused before secret resolution. */
1726
+ proxySecrets?: ProxySecretCapabilities;
1727
+ systemPrompt: AgentProfileSystemPromptCapability;
1728
+ instructions: boolean;
1729
+ tools: boolean;
1730
+ permissions: boolean;
1731
+ mcp: boolean;
1732
+ subagents: boolean;
1733
+ resources: {
1734
+ files: boolean;
1735
+ instructions: boolean;
1736
+ tools?: boolean;
1737
+ skills?: boolean;
1738
+ agents?: boolean;
1739
+ commands?: boolean;
1740
+ };
1741
+ hooks?: boolean;
1742
+ modes?: boolean;
1743
+ runtimeUpdate: boolean;
1744
+ validation: boolean;
1745
+ /**
1746
+ * Backend extension namespaces understood by this backend.
1747
+ */
1748
+ extensions?: string[];
1749
+ }
1750
+ /**
1751
+ * Validation issue for a profile/backend pairing.
1752
+ */
1753
+ interface AgentProfileValidationIssue {
1754
+ level: "error" | "warning" | "info";
1755
+ code: string;
1756
+ message: string;
1757
+ path?: string;
1758
+ }
1759
+ /**
1760
+ * Validation output for a provider adapter.
1761
+ */
1762
+ interface AgentProfileValidationResult {
1763
+ ok: boolean;
1764
+ issues: AgentProfileValidationIssue[];
1765
+ normalizedProfile?: AgentProfile;
1766
+ }
1767
+ //#endregion
1768
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/agent-candidate.d.ts
1769
+ /** Full SHA-256 digest with an explicit algorithm prefix. */
1770
+ type Sha256Digest = `sha256:${string}`;
1771
+ //#endregion
1772
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/interaction-fields.d.ts
1773
+ declare const InteractionAnswerSpecSchema: z.ZodObject<{
1774
+ fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1775
+ type: z.ZodLiteral<"text">;
1776
+ multiline: z.ZodOptional<z.ZodBoolean>;
1777
+ placeholder: z.ZodOptional<z.ZodString>;
1778
+ maxLength: z.ZodOptional<z.ZodNumber>;
1779
+ default: z.ZodOptional<z.ZodString>;
1780
+ name: z.ZodString;
1781
+ label: z.ZodString;
1782
+ required: z.ZodOptional<z.ZodBoolean>;
1783
+ }, z.core.$strict>, z.ZodObject<{
1784
+ type: z.ZodLiteral<"number">;
1785
+ min: z.ZodOptional<z.ZodNumber>;
1786
+ max: z.ZodOptional<z.ZodNumber>;
1787
+ default: z.ZodOptional<z.ZodNumber>;
1788
+ name: z.ZodString;
1789
+ label: z.ZodString;
1790
+ required: z.ZodOptional<z.ZodBoolean>;
1791
+ }, z.core.$strict>, z.ZodObject<{
1792
+ type: z.ZodLiteral<"boolean">;
1793
+ default: z.ZodOptional<z.ZodBoolean>;
1794
+ name: z.ZodString;
1795
+ label: z.ZodString;
1796
+ required: z.ZodOptional<z.ZodBoolean>;
1797
+ }, z.core.$strict>, z.ZodObject<{
1798
+ type: z.ZodLiteral<"select">;
1799
+ options: z.ZodArray<z.ZodObject<{
1800
+ value: z.ZodString;
1801
+ label: z.ZodString;
1802
+ description: z.ZodOptional<z.ZodString>;
1803
+ }, z.core.$strict>>;
1804
+ multi: z.ZodOptional<z.ZodBoolean>;
1805
+ allowCustom: z.ZodOptional<z.ZodBoolean>;
1806
+ default: z.ZodOptional<z.ZodArray<z.ZodString>>;
1807
+ name: z.ZodString;
1808
+ label: z.ZodString;
1809
+ required: z.ZodOptional<z.ZodBoolean>;
1810
+ }, z.core.$strict>, z.ZodObject<{
1811
+ type: z.ZodLiteral<"secret">;
1812
+ placeholder: z.ZodOptional<z.ZodString>;
1813
+ maxLength: z.ZodOptional<z.ZodNumber>;
1814
+ name: z.ZodString;
1815
+ label: z.ZodString;
1816
+ required: z.ZodOptional<z.ZodBoolean>;
1817
+ }, z.core.$strict>], "type">>;
1818
+ }, z.core.$strict>;
1819
+ /** Scope at which an accepted answer may be reused by an explicit policy. */
1820
+ declare const InteractionResponseScopeSchema: z.ZodEnum<{
1821
+ interaction: "interaction";
1822
+ session: "session";
1823
+ persistent: "persistent";
1824
+ }>;
1825
+ //#endregion
1826
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/interaction-envelope.d.ts
1827
+ declare const InteractionSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1828
+ type: z.ZodLiteral<"tool">;
1829
+ toolName: z.ZodString;
1830
+ input: z.ZodOptional<z.ZodCustom<unknown, unknown>>;
1831
+ }, z.core.$strict>, z.ZodObject<{
1832
+ type: z.ZodLiteral<"command">;
1833
+ command: z.ZodString;
1834
+ }, z.core.$strict>, z.ZodObject<{
1835
+ type: z.ZodLiteral<"file">;
1836
+ path: z.ZodString;
1837
+ preview: z.ZodOptional<z.ZodString>;
1838
+ }, z.core.$strict>, z.ZodObject<{
1839
+ type: z.ZodLiteral<"resource">;
1840
+ uri: z.ZodString;
1841
+ }, z.core.$strict>], "type">;
1842
+ type InteractionSubject = z.infer<typeof InteractionSubjectSchema>;
1843
+ declare const InteractionOutcomeSchema: z.ZodEnum<{
1844
+ cancelled: "cancelled";
1845
+ accepted: "accepted";
1846
+ declined: "declined";
1847
+ }>;
1848
+ type InteractionOutcome = z.infer<typeof InteractionOutcomeSchema>;
1849
+ declare const InteractionRequestBindingSchema: z.ZodObject<{
1850
+ runId: z.ZodString;
1851
+ provider: z.ZodString;
1852
+ environmentId: z.ZodString;
1853
+ sessionId: z.ZodString;
1854
+ executionId: z.ZodString;
1855
+ interactionId: z.ZodString;
1856
+ }, z.core.$strict>;
1857
+ type InteractionRequestBinding = z.infer<typeof InteractionRequestBindingSchema>;
1858
+ interface InteractionRequestMaterial {
1859
+ id: string;
1860
+ kind: string;
1861
+ title: string;
1862
+ body?: string;
1863
+ subject?: InteractionSubject;
1864
+ answerSpec: z.infer<typeof InteractionAnswerSpecSchema>;
1865
+ responseScopes?: z.infer<typeof InteractionResponseScopeSchema>[];
1866
+ allowedOutcomes?: InteractionOutcome[];
1867
+ default?: InteractionResolution;
1868
+ timeoutMs?: number;
1869
+ onTimeout?: "default" | "fail" | "wait";
1870
+ binding: InteractionRequestBinding;
1871
+ }
1872
+ interface InteractionRequest extends InteractionRequestMaterial {
1873
+ requestDigest: Sha256Digest;
1874
+ }
1875
+ /** Retryable command sent to an environment or retained session. */
1876
+ declare const InteractionResponseCommandSchema: z.ZodObject<{
1877
+ operationId: z.ZodString;
1878
+ binding: z.ZodObject<{
1879
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1880
+ runId: z.ZodString;
1881
+ provider: z.ZodString;
1882
+ environmentId: z.ZodString;
1883
+ sessionId: z.ZodString;
1884
+ executionId: z.ZodString;
1885
+ interactionId: z.ZodString;
1886
+ }, z.core.$strict>;
1887
+ commandDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1888
+ response: z.ZodDiscriminatedUnion<[z.ZodObject<{
1889
+ id: z.ZodString;
1890
+ outcome: z.ZodLiteral<"accepted">;
1891
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1892
+ }, z.core.$strict>, z.ZodObject<{
1893
+ id: z.ZodString;
1894
+ outcome: z.ZodLiteral<"declined">;
1895
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1896
+ }, z.core.$strict>, z.ZodObject<{
1897
+ id: z.ZodString;
1898
+ outcome: z.ZodLiteral<"cancelled">;
1899
+ data: z.ZodOptional<z.ZodType<Record<string, InteractionDataValue>, unknown, z.core.$ZodTypeInternals<Record<string, InteractionDataValue>, unknown>>>;
1900
+ }, z.core.$strict>], "outcome">;
1901
+ }, z.core.$strict>;
1902
+ type InteractionResponseCommand = z.infer<typeof InteractionResponseCommandSchema>;
1903
+ /** Durable result of one interaction response operation. */
1904
+ declare const InteractionAcknowledgementSchema: z.ZodObject<{
1905
+ operationId: z.ZodString;
1906
+ binding: z.ZodObject<{
1907
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1908
+ runId: z.ZodString;
1909
+ provider: z.ZodString;
1910
+ environmentId: z.ZodString;
1911
+ sessionId: z.ZodString;
1912
+ executionId: z.ZodString;
1913
+ interactionId: z.ZodString;
1914
+ }, z.core.$strict>;
1915
+ commandDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
1916
+ status: z.ZodEnum<{
1917
+ cancelled: "cancelled";
1918
+ expired: "expired";
1919
+ accepted: "accepted";
1920
+ already_resolved_same: "already_resolved_same";
1921
+ already_resolved_different: "already_resolved_different";
1922
+ unknown_interaction: "unknown_interaction";
1923
+ unknown_run: "unknown_run";
1924
+ binding_mismatch: "binding_mismatch";
1925
+ invalid_response: "invalid_response";
1926
+ transport_failure: "transport_failure";
1927
+ }>;
1928
+ message: z.ZodOptional<z.ZodString>;
1929
+ retryable: z.ZodOptional<z.ZodBoolean>;
1930
+ }, z.core.$strict>;
1931
+ type InteractionAcknowledgement = z.infer<typeof InteractionAcknowledgementSchema>;
1932
+ //#endregion
1933
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/runtime-control.d.ts
1934
+ /** Provider-neutral coordinates sufficient to recreate control of one run. */
1935
+ interface AgentRunControlRef {
1936
+ runId: string;
1937
+ provider: string;
1938
+ environmentId: string;
1939
+ sessionId?: string;
1940
+ executionId?: string;
1941
+ /** Provider admission digest for detecting changed-input run reuse. */
1942
+ requestDigest?: Sha256Digest;
1943
+ }
1944
+ /** Coordinates that are complete enough for a retryable state-changing action. */
1945
+ interface AgentExactRunControlRef extends AgentRunControlRef {
1946
+ sessionId: string;
1947
+ executionId: string;
1948
+ requestDigest: Sha256Digest;
1949
+ }
1950
+ type AgentRunCancellationEffect = "cancel_requested" | "cancelled" | "not_live" | "unknown";
1951
+ interface AgentRunCancellationRequestMaterial {
1952
+ operationId: string;
1953
+ run: AgentExactRunControlRef;
1954
+ reason?: string;
1955
+ }
1956
+ interface AgentRunCancellationRequest extends AgentRunCancellationRequestMaterial {
1957
+ requestDigest: Sha256Digest;
1958
+ }
1959
+ interface AgentRunCancellationAcknowledgement {
1960
+ operationId: string;
1961
+ requestDigest: Sha256Digest;
1962
+ run: AgentExactRunControlRef;
1963
+ status: "accepted" | "replayed" | "conflict" | "unknown";
1964
+ effect: AgentRunCancellationEffect;
1965
+ message?: string;
1966
+ retryable?: boolean;
1967
+ existingRequestDigest?: Sha256Digest;
1968
+ }
1969
+ //#endregion
1970
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/environment-terminal.d.ts
1971
+ /**
1972
+ * Provider-neutral handle for one interactive terminal.
1973
+ *
1974
+ * The handle carries no raw process id and no environment map, so a terminal
1975
+ * reference never leaks host process detail or injected secrets. Every terminal
1976
+ * is bound to a parent execution and carries an explicit expiry, so an orphan
1977
+ * or an expired terminal fails closed at the call sites that read it.
1978
+ */
1979
+ declare const TerminalSessionRefSchema: z.ZodObject<{
1980
+ terminalSessionId: z.ZodString;
1981
+ parentExecutionId: z.ZodString;
1982
+ name: z.ZodString;
1983
+ shell: z.ZodString;
1984
+ command: z.ZodOptional<z.ZodString>;
1985
+ cwd: z.ZodString;
1986
+ cols: z.ZodNumber;
1987
+ rows: z.ZodNumber;
1988
+ connectionId: z.ZodOptional<z.ZodString>;
1989
+ createdAt: z.ZodISODateTime;
1990
+ lastActivityAt: z.ZodISODateTime;
1991
+ expiresAt: z.ZodISODateTime;
1992
+ isRunning: z.ZodBoolean;
1993
+ exitCode: z.ZodOptional<z.ZodNumber>;
1994
+ exitSignal: z.ZodOptional<z.ZodString>;
1995
+ attachCount: z.ZodNumber;
1996
+ }, z.core.$strict>;
1997
+ type TerminalSessionRef = z.infer<typeof TerminalSessionRefSchema>;
1998
+ /** Raw bytes written to the terminal, normalized to UTF-8 text. */
1999
+ declare const TerminalInputSchema: z.ZodObject<{
2000
+ data: z.ZodString;
2001
+ }, z.core.$strict>;
2002
+ type TerminalInput = z.infer<typeof TerminalInputSchema>;
2003
+ /** New terminal geometry. */
2004
+ declare const TerminalResizeSchema: z.ZodObject<{
2005
+ cols: z.ZodNumber;
2006
+ rows: z.ZodNumber;
2007
+ }, z.core.$strict>;
2008
+ type TerminalResize = z.infer<typeof TerminalResizeSchema>;
2009
+ /**
2010
+ * One ordered terminal output frame. `output` frames carry a monotonic `seq`
2011
+ * that a consumer replays from, so a reconnect resumes without loss or
2012
+ * duplication.
2013
+ */
2014
+ declare const TerminalOutputEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2015
+ type: z.ZodLiteral<"ready">;
2016
+ cols: z.ZodOptional<z.ZodNumber>;
2017
+ rows: z.ZodOptional<z.ZodNumber>;
2018
+ }, z.core.$strict>, z.ZodObject<{
2019
+ type: z.ZodLiteral<"output">;
2020
+ seq: z.ZodNumber;
2021
+ data: z.ZodString;
2022
+ }, z.core.$strict>, z.ZodObject<{
2023
+ type: z.ZodLiteral<"resize">;
2024
+ cols: z.ZodNumber;
2025
+ rows: z.ZodNumber;
2026
+ }, z.core.$strict>, z.ZodObject<{
2027
+ type: z.ZodLiteral<"exit">;
2028
+ exitCode: z.ZodOptional<z.ZodNumber>;
2029
+ exitSignal: z.ZodOptional<z.ZodString>;
2030
+ }, z.core.$strict>, z.ZodObject<{
2031
+ type: z.ZodLiteral<"error">;
2032
+ message: z.ZodString;
2033
+ }, z.core.$strict>], "type">;
2034
+ type TerminalOutputEvent = z.infer<typeof TerminalOutputEventSchema>;
2035
+ /** Acknowledgement of a detach or close. */
2036
+ declare const TerminalDetachAckSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2037
+ status: z.ZodLiteral<"detached">;
2038
+ terminalSessionId: z.ZodString;
2039
+ connectionId: z.ZodOptional<z.ZodString>;
2040
+ }, z.core.$strict>, z.ZodObject<{
2041
+ status: z.ZodLiteral<"closed">;
2042
+ terminalSessionId: z.ZodString;
2043
+ exitCode: z.ZodOptional<z.ZodNumber>;
2044
+ exitSignal: z.ZodOptional<z.ZodString>;
2045
+ }, z.core.$strict>, z.ZodObject<{
2046
+ status: z.ZodLiteral<"unknown">;
2047
+ terminalSessionId: z.ZodString;
2048
+ message: z.ZodString;
2049
+ retryable: z.ZodBoolean;
2050
+ }, z.core.$strict>], "status">;
2051
+ type TerminalDetachAck = z.infer<typeof TerminalDetachAckSchema>;
2052
+ /**
2053
+ * The replay cursors a terminal handle can serve.
2054
+ *
2055
+ * `earliest` is the oldest cursor `events` accepts and `latest` is the newest
2056
+ * frame the handle holds. A handle retains a bounded number of frames, so a
2057
+ * consumer that holds no cursor, or holds one the handle dropped, reads this
2058
+ * window to resume from a cursor that still exists.
2059
+ */
2060
+ declare const TerminalReplayWindowSchema: z.ZodObject<{
2061
+ earliest: z.ZodNumber;
2062
+ latest: z.ZodNumber;
2063
+ }, z.core.$strict>;
2064
+ type TerminalReplayWindow = z.infer<typeof TerminalReplayWindowSchema>;
2065
+ /** Live handle for one interactive terminal. */
2066
+ interface AgentTerminalSession {
2067
+ readonly ref: TerminalSessionRef;
2068
+ /** Cursors this handle can serve, so an evicted cursor is recoverable. */
2069
+ readonly cursors: TerminalReplayWindow;
2070
+ input(input: TerminalInput, options?: {
2071
+ signal?: AbortSignal;
2072
+ }): Promise<void>;
2073
+ resize(resize: TerminalResize, options?: {
2074
+ signal?: AbortSignal;
2075
+ }): Promise<void>;
2076
+ detach(options?: {
2077
+ signal?: AbortSignal;
2078
+ }): Promise<TerminalDetachAck>;
2079
+ close(options?: {
2080
+ signal?: AbortSignal;
2081
+ }): Promise<TerminalDetachAck>;
2082
+ /** Replays retained frames from `since`, then continues until the terminal exits. */
2083
+ events(options?: {
2084
+ since?: number;
2085
+ signal?: AbortSignal;
2086
+ }): AsyncIterable<TerminalOutputEvent>;
2087
+ }
2088
+ //#endregion
2089
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/environment-interactive-control.d.ts
2090
+ /**
2091
+ * Durable identity of one coding-agent TUI.
2092
+ *
2093
+ * This reference identifies the exact admitted run and preparation receipt.
2094
+ * It is not a generic shell id and cannot be used to create another process.
2095
+ */
2096
+ declare const AgentInteractiveSessionRefSchema: z.ZodObject<{
2097
+ run: z.ZodObject<{
2098
+ runId: z.ZodString;
2099
+ provider: z.ZodString;
2100
+ environmentId: z.ZodString;
2101
+ sessionId: z.ZodString;
2102
+ executionId: z.ZodString;
2103
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2104
+ }, z.core.$strict>;
2105
+ preparationReceipt: z.ZodObject<{
2106
+ kind: z.ZodLiteral<"agent-execution-preparation">;
2107
+ schemaVersion: z.ZodLiteral<1>;
2108
+ preparationId: z.ZodString;
2109
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2110
+ authoredProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2111
+ effectiveProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2112
+ backend: z.ZodString;
2113
+ harness: z.ZodEnum<{
2114
+ "claude-code": "claude-code";
2115
+ nanoclaw: "nanoclaw";
2116
+ codex: "codex";
2117
+ opencode: "opencode";
2118
+ "kimi-code": "kimi-code";
2119
+ pi: "pi";
2120
+ prime: "prime";
2121
+ gemini: "gemini";
2122
+ hermes: "hermes";
2123
+ openclaw: "openclaw";
2124
+ amp: "amp";
2125
+ "factory-droids": "factory-droids";
2126
+ forge: "forge";
2127
+ cursor: "cursor";
2128
+ acp: "acp";
2129
+ "cli-base": "cli-base";
2130
+ }>;
2131
+ harnessVersion: z.ZodString;
2132
+ resolvedModel: z.ZodObject<{
2133
+ requested: z.ZodString;
2134
+ resolved: z.ZodString;
2135
+ provider: z.ZodOptional<z.ZodString>;
2136
+ reasoningEffort: z.ZodOptional<z.ZodObject<{
2137
+ requested: z.ZodEnum<{
2138
+ none: "none";
2139
+ minimal: "minimal";
2140
+ low: "low";
2141
+ medium: "medium";
2142
+ high: "high";
2143
+ xhigh: "xhigh";
2144
+ ultracode: "ultracode";
2145
+ }>;
2146
+ resolved: z.ZodOptional<z.ZodEnum<{
2147
+ none: "none";
2148
+ minimal: "minimal";
2149
+ low: "low";
2150
+ medium: "medium";
2151
+ high: "high";
2152
+ xhigh: "xhigh";
2153
+ ultracode: "ultracode";
2154
+ }>>;
2155
+ fidelity: z.ZodEnum<{
2156
+ exact: "exact";
2157
+ unsupported: "unsupported";
2158
+ clamped: "clamped";
2159
+ }>;
2160
+ }, z.core.$strict>>;
2161
+ }, z.core.$strict>;
2162
+ workspace: z.ZodObject<{
2163
+ leaseId: z.ZodString;
2164
+ provider: z.ZodString;
2165
+ identityDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2166
+ isolation: z.ZodEnum<{
2167
+ "per-run": "per-run";
2168
+ shared: "shared";
2169
+ }>;
2170
+ sourceSnapshotDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2171
+ sourceSnapshotPolicy: z.ZodObject<{
2172
+ kind: z.ZodLiteral<"provider-declared">;
2173
+ name: z.ZodString;
2174
+ version: z.ZodNumber;
2175
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2176
+ }, z.core.$strict>;
2177
+ preparedWorkspaceDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2178
+ profileActivationDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2179
+ }, z.core.$strict>;
2180
+ axisResults: z.ZodArray<z.ZodObject<{
2181
+ axis: z.ZodEnum<{
2182
+ metadata: "metadata";
2183
+ description: "description";
2184
+ files: "files";
2185
+ name: "name";
2186
+ version: "version";
2187
+ tags: "tags";
2188
+ harness: "harness";
2189
+ seats: "seats";
2190
+ proxySecrets: "proxySecrets";
2191
+ permissions: "permissions";
2192
+ tools: "tools";
2193
+ mcp: "mcp";
2194
+ connections: "connections";
2195
+ subagents: "subagents";
2196
+ hooks: "hooks";
2197
+ modes: "modes";
2198
+ confidential: "confidential";
2199
+ extensions: "extensions";
2200
+ systemPrompt: "systemPrompt";
2201
+ appendSystemPrompt: "appendSystemPrompt";
2202
+ instructions: "instructions";
2203
+ knowledge: "knowledge";
2204
+ skills: "skills";
2205
+ commands: "commands";
2206
+ modelDefault: "modelDefault";
2207
+ modelSmall: "modelSmall";
2208
+ modelProvider: "modelProvider";
2209
+ modelReasoningEffort: "modelReasoningEffort";
2210
+ modelMaxVisibleOutputTokens: "modelMaxVisibleOutputTokens";
2211
+ modelMaxReasoningTokens: "modelMaxReasoningTokens";
2212
+ modelMaxTotalOutputTokens: "modelMaxTotalOutputTokens";
2213
+ modelMetadata: "modelMetadata";
2214
+ resourceTools: "resourceTools";
2215
+ resourceAgents: "resourceAgents";
2216
+ resourceInstructions: "resourceInstructions";
2217
+ resourceFailOnError: "resourceFailOnError";
2218
+ }>;
2219
+ disposition: z.ZodEnum<{
2220
+ unsupported: "unsupported";
2221
+ behavior: "behavior";
2222
+ control: "control";
2223
+ overridden: "overridden";
2224
+ }>;
2225
+ owner: z.ZodEnum<{
2226
+ runtime: "runtime";
2227
+ executor: "executor";
2228
+ }>;
2229
+ mechanism: z.ZodString;
2230
+ evidenceDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
2231
+ path: z.ZodOptional<z.ZodString>;
2232
+ reason: z.ZodOptional<z.ZodString>;
2233
+ }, z.core.$strict>>;
2234
+ executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2235
+ materializer: z.ZodObject<{
2236
+ name: z.ZodString;
2237
+ version: z.ZodString;
2238
+ }, z.core.$strict>;
2239
+ expiresAtMs: z.ZodNumber;
2240
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2241
+ }, z.core.$strict>;
2242
+ incarnationId: z.ZodString;
2243
+ startedAt: z.ZodISODateTime;
2244
+ }, z.core.$strict>;
2245
+ type AgentInteractiveSessionRef = z.infer<typeof AgentInteractiveSessionRefSchema>;
2246
+ /**
2247
+ * Provider-issued write authority for one exact interactive process.
2248
+ *
2249
+ * Expiry blocks mutations but does not kill the coding process. A coordinator
2250
+ * can issue a new compare-and-swap claim after expiry. The provider's PTY owner
2251
+ * lease remains the separate process-cleanup authority.
2252
+ */
2253
+ declare const AgentInteractiveSessionControlClaimSchema: z.ZodObject<{
2254
+ refDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2255
+ generation: z.ZodNumber;
2256
+ leaseId: z.ZodString;
2257
+ holderId: z.ZodString;
2258
+ expiresAt: z.ZodISODateTime;
2259
+ }, z.core.$strict>;
2260
+ type AgentInteractiveSessionControlClaim = z.infer<typeof AgentInteractiveSessionControlClaimSchema>;
2261
+ interface AgentInteractiveSessionControlClaimRequestMaterial {
2262
+ operationId: string;
2263
+ ref: AgentInteractiveSessionRef;
2264
+ holderId: string;
2265
+ /** Compare-and-swap value. Use zero when no coordinator currently holds a claim. */
2266
+ expectedGeneration: number;
2267
+ }
2268
+ interface AgentInteractiveSessionControlClaimRequest extends AgentInteractiveSessionControlClaimRequestMaterial {
2269
+ requestDigest: `sha256:${string}`;
2270
+ }
2271
+ interface AgentInteractiveSessionControlClaimAcknowledgement {
2272
+ operationId: string;
2273
+ requestDigest: `sha256:${string}`;
2274
+ ref: AgentInteractiveSessionRef;
2275
+ status: "accepted" | "replayed" | "conflict" | "unknown";
2276
+ control?: AgentInteractiveSessionControlClaim;
2277
+ /** Why a provider rejected this claim request. */
2278
+ conflictReason?: "generation_mismatch" | "operation_reuse";
2279
+ /** Current non-secret generation for a compare-and-swap conflict. */
2280
+ currentGeneration?: number;
2281
+ /** Present when this operation id already names different material. */
2282
+ existingRequestDigest?: `sha256:${string}`;
2283
+ message?: string;
2284
+ retryable?: boolean;
2285
+ }
2286
+ /** Geometry for one attachment to the existing coding-agent TUI. */
2287
+ declare const AgentInteractiveSessionAttachSchema: z.ZodObject<{
2288
+ control: z.ZodObject<{
2289
+ refDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2290
+ generation: z.ZodNumber;
2291
+ leaseId: z.ZodString;
2292
+ holderId: z.ZodString;
2293
+ expiresAt: z.ZodISODateTime;
2294
+ }, z.core.$strict>;
2295
+ cols: z.ZodOptional<z.ZodNumber>;
2296
+ rows: z.ZodOptional<z.ZodNumber>;
2297
+ }, z.core.$strict>;
2298
+ type AgentInteractiveSessionAttach = z.infer<typeof AgentInteractiveSessionAttachSchema>;
2299
+ /** Provider-observed lifecycle of one native coding-agent TUI. */
2300
+ declare const AgentInteractiveSessionStatusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2301
+ state: z.ZodLiteral<"running">;
2302
+ ref: z.ZodObject<{
2303
+ run: z.ZodObject<{
2304
+ runId: z.ZodString;
2305
+ provider: z.ZodString;
2306
+ environmentId: z.ZodString;
2307
+ sessionId: z.ZodString;
2308
+ executionId: z.ZodString;
2309
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2310
+ }, z.core.$strict>;
2311
+ preparationReceipt: z.ZodObject<{
2312
+ kind: z.ZodLiteral<"agent-execution-preparation">;
2313
+ schemaVersion: z.ZodLiteral<1>;
2314
+ preparationId: z.ZodString;
2315
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2316
+ authoredProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2317
+ effectiveProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2318
+ backend: z.ZodString;
2319
+ harness: z.ZodEnum<{
2320
+ "claude-code": "claude-code";
2321
+ nanoclaw: "nanoclaw";
2322
+ codex: "codex";
2323
+ opencode: "opencode";
2324
+ "kimi-code": "kimi-code";
2325
+ pi: "pi";
2326
+ prime: "prime";
2327
+ gemini: "gemini";
2328
+ hermes: "hermes";
2329
+ openclaw: "openclaw";
2330
+ amp: "amp";
2331
+ "factory-droids": "factory-droids";
2332
+ forge: "forge";
2333
+ cursor: "cursor";
2334
+ acp: "acp";
2335
+ "cli-base": "cli-base";
2336
+ }>;
2337
+ harnessVersion: z.ZodString;
2338
+ resolvedModel: z.ZodObject<{
2339
+ requested: z.ZodString;
2340
+ resolved: z.ZodString;
2341
+ provider: z.ZodOptional<z.ZodString>;
2342
+ reasoningEffort: z.ZodOptional<z.ZodObject<{
2343
+ requested: z.ZodEnum<{
2344
+ none: "none";
2345
+ minimal: "minimal";
2346
+ low: "low";
2347
+ medium: "medium";
2348
+ high: "high";
2349
+ xhigh: "xhigh";
2350
+ ultracode: "ultracode";
2351
+ }>;
2352
+ resolved: z.ZodOptional<z.ZodEnum<{
2353
+ none: "none";
2354
+ minimal: "minimal";
2355
+ low: "low";
2356
+ medium: "medium";
2357
+ high: "high";
2358
+ xhigh: "xhigh";
2359
+ ultracode: "ultracode";
2360
+ }>>;
2361
+ fidelity: z.ZodEnum<{
2362
+ exact: "exact";
2363
+ unsupported: "unsupported";
2364
+ clamped: "clamped";
2365
+ }>;
2366
+ }, z.core.$strict>>;
2367
+ }, z.core.$strict>;
2368
+ workspace: z.ZodObject<{
2369
+ leaseId: z.ZodString;
2370
+ provider: z.ZodString;
2371
+ identityDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2372
+ isolation: z.ZodEnum<{
2373
+ "per-run": "per-run";
2374
+ shared: "shared";
2375
+ }>;
2376
+ sourceSnapshotDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2377
+ sourceSnapshotPolicy: z.ZodObject<{
2378
+ kind: z.ZodLiteral<"provider-declared">;
2379
+ name: z.ZodString;
2380
+ version: z.ZodNumber;
2381
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2382
+ }, z.core.$strict>;
2383
+ preparedWorkspaceDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2384
+ profileActivationDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2385
+ }, z.core.$strict>;
2386
+ axisResults: z.ZodArray<z.ZodObject<{
2387
+ axis: z.ZodEnum<{
2388
+ metadata: "metadata";
2389
+ description: "description";
2390
+ files: "files";
2391
+ name: "name";
2392
+ version: "version";
2393
+ tags: "tags";
2394
+ harness: "harness";
2395
+ seats: "seats";
2396
+ proxySecrets: "proxySecrets";
2397
+ permissions: "permissions";
2398
+ tools: "tools";
2399
+ mcp: "mcp";
2400
+ connections: "connections";
2401
+ subagents: "subagents";
2402
+ hooks: "hooks";
2403
+ modes: "modes";
2404
+ confidential: "confidential";
2405
+ extensions: "extensions";
2406
+ systemPrompt: "systemPrompt";
2407
+ appendSystemPrompt: "appendSystemPrompt";
2408
+ instructions: "instructions";
2409
+ knowledge: "knowledge";
2410
+ skills: "skills";
2411
+ commands: "commands";
2412
+ modelDefault: "modelDefault";
2413
+ modelSmall: "modelSmall";
2414
+ modelProvider: "modelProvider";
2415
+ modelReasoningEffort: "modelReasoningEffort";
2416
+ modelMaxVisibleOutputTokens: "modelMaxVisibleOutputTokens";
2417
+ modelMaxReasoningTokens: "modelMaxReasoningTokens";
2418
+ modelMaxTotalOutputTokens: "modelMaxTotalOutputTokens";
2419
+ modelMetadata: "modelMetadata";
2420
+ resourceTools: "resourceTools";
2421
+ resourceAgents: "resourceAgents";
2422
+ resourceInstructions: "resourceInstructions";
2423
+ resourceFailOnError: "resourceFailOnError";
2424
+ }>;
2425
+ disposition: z.ZodEnum<{
2426
+ unsupported: "unsupported";
2427
+ behavior: "behavior";
2428
+ control: "control";
2429
+ overridden: "overridden";
2430
+ }>;
2431
+ owner: z.ZodEnum<{
2432
+ runtime: "runtime";
2433
+ executor: "executor";
2434
+ }>;
2435
+ mechanism: z.ZodString;
2436
+ evidenceDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
2437
+ path: z.ZodOptional<z.ZodString>;
2438
+ reason: z.ZodOptional<z.ZodString>;
2439
+ }, z.core.$strict>>;
2440
+ executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2441
+ materializer: z.ZodObject<{
2442
+ name: z.ZodString;
2443
+ version: z.ZodString;
2444
+ }, z.core.$strict>;
2445
+ expiresAtMs: z.ZodNumber;
2446
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2447
+ }, z.core.$strict>;
2448
+ incarnationId: z.ZodString;
2449
+ startedAt: z.ZodISODateTime;
2450
+ }, z.core.$strict>;
2451
+ }, z.core.$strict>, z.ZodObject<{
2452
+ state: z.ZodLiteral<"exited">;
2453
+ ref: z.ZodObject<{
2454
+ run: z.ZodObject<{
2455
+ runId: z.ZodString;
2456
+ provider: z.ZodString;
2457
+ environmentId: z.ZodString;
2458
+ sessionId: z.ZodString;
2459
+ executionId: z.ZodString;
2460
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2461
+ }, z.core.$strict>;
2462
+ preparationReceipt: z.ZodObject<{
2463
+ kind: z.ZodLiteral<"agent-execution-preparation">;
2464
+ schemaVersion: z.ZodLiteral<1>;
2465
+ preparationId: z.ZodString;
2466
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2467
+ authoredProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2468
+ effectiveProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2469
+ backend: z.ZodString;
2470
+ harness: z.ZodEnum<{
2471
+ "claude-code": "claude-code";
2472
+ nanoclaw: "nanoclaw";
2473
+ codex: "codex";
2474
+ opencode: "opencode";
2475
+ "kimi-code": "kimi-code";
2476
+ pi: "pi";
2477
+ prime: "prime";
2478
+ gemini: "gemini";
2479
+ hermes: "hermes";
2480
+ openclaw: "openclaw";
2481
+ amp: "amp";
2482
+ "factory-droids": "factory-droids";
2483
+ forge: "forge";
2484
+ cursor: "cursor";
2485
+ acp: "acp";
2486
+ "cli-base": "cli-base";
2487
+ }>;
2488
+ harnessVersion: z.ZodString;
2489
+ resolvedModel: z.ZodObject<{
2490
+ requested: z.ZodString;
2491
+ resolved: z.ZodString;
2492
+ provider: z.ZodOptional<z.ZodString>;
2493
+ reasoningEffort: z.ZodOptional<z.ZodObject<{
2494
+ requested: z.ZodEnum<{
2495
+ none: "none";
2496
+ minimal: "minimal";
2497
+ low: "low";
2498
+ medium: "medium";
2499
+ high: "high";
2500
+ xhigh: "xhigh";
2501
+ ultracode: "ultracode";
2502
+ }>;
2503
+ resolved: z.ZodOptional<z.ZodEnum<{
2504
+ none: "none";
2505
+ minimal: "minimal";
2506
+ low: "low";
2507
+ medium: "medium";
2508
+ high: "high";
2509
+ xhigh: "xhigh";
2510
+ ultracode: "ultracode";
2511
+ }>>;
2512
+ fidelity: z.ZodEnum<{
2513
+ exact: "exact";
2514
+ unsupported: "unsupported";
2515
+ clamped: "clamped";
2516
+ }>;
2517
+ }, z.core.$strict>>;
2518
+ }, z.core.$strict>;
2519
+ workspace: z.ZodObject<{
2520
+ leaseId: z.ZodString;
2521
+ provider: z.ZodString;
2522
+ identityDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2523
+ isolation: z.ZodEnum<{
2524
+ "per-run": "per-run";
2525
+ shared: "shared";
2526
+ }>;
2527
+ sourceSnapshotDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2528
+ sourceSnapshotPolicy: z.ZodObject<{
2529
+ kind: z.ZodLiteral<"provider-declared">;
2530
+ name: z.ZodString;
2531
+ version: z.ZodNumber;
2532
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2533
+ }, z.core.$strict>;
2534
+ preparedWorkspaceDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2535
+ profileActivationDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2536
+ }, z.core.$strict>;
2537
+ axisResults: z.ZodArray<z.ZodObject<{
2538
+ axis: z.ZodEnum<{
2539
+ metadata: "metadata";
2540
+ description: "description";
2541
+ files: "files";
2542
+ name: "name";
2543
+ version: "version";
2544
+ tags: "tags";
2545
+ harness: "harness";
2546
+ seats: "seats";
2547
+ proxySecrets: "proxySecrets";
2548
+ permissions: "permissions";
2549
+ tools: "tools";
2550
+ mcp: "mcp";
2551
+ connections: "connections";
2552
+ subagents: "subagents";
2553
+ hooks: "hooks";
2554
+ modes: "modes";
2555
+ confidential: "confidential";
2556
+ extensions: "extensions";
2557
+ systemPrompt: "systemPrompt";
2558
+ appendSystemPrompt: "appendSystemPrompt";
2559
+ instructions: "instructions";
2560
+ knowledge: "knowledge";
2561
+ skills: "skills";
2562
+ commands: "commands";
2563
+ modelDefault: "modelDefault";
2564
+ modelSmall: "modelSmall";
2565
+ modelProvider: "modelProvider";
2566
+ modelReasoningEffort: "modelReasoningEffort";
2567
+ modelMaxVisibleOutputTokens: "modelMaxVisibleOutputTokens";
2568
+ modelMaxReasoningTokens: "modelMaxReasoningTokens";
2569
+ modelMaxTotalOutputTokens: "modelMaxTotalOutputTokens";
2570
+ modelMetadata: "modelMetadata";
2571
+ resourceTools: "resourceTools";
2572
+ resourceAgents: "resourceAgents";
2573
+ resourceInstructions: "resourceInstructions";
2574
+ resourceFailOnError: "resourceFailOnError";
2575
+ }>;
2576
+ disposition: z.ZodEnum<{
2577
+ unsupported: "unsupported";
2578
+ behavior: "behavior";
2579
+ control: "control";
2580
+ overridden: "overridden";
2581
+ }>;
2582
+ owner: z.ZodEnum<{
2583
+ runtime: "runtime";
2584
+ executor: "executor";
2585
+ }>;
2586
+ mechanism: z.ZodString;
2587
+ evidenceDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
2588
+ path: z.ZodOptional<z.ZodString>;
2589
+ reason: z.ZodOptional<z.ZodString>;
2590
+ }, z.core.$strict>>;
2591
+ executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2592
+ materializer: z.ZodObject<{
2593
+ name: z.ZodString;
2594
+ version: z.ZodString;
2595
+ }, z.core.$strict>;
2596
+ expiresAtMs: z.ZodNumber;
2597
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2598
+ }, z.core.$strict>;
2599
+ incarnationId: z.ZodString;
2600
+ startedAt: z.ZodISODateTime;
2601
+ }, z.core.$strict>;
2602
+ endedAt: z.ZodISODateTime;
2603
+ reason: z.ZodEnum<{
2604
+ stopped: "stopped";
2605
+ exited: "exited";
2606
+ lost: "lost";
2607
+ }>;
2608
+ exitCode: z.ZodOptional<z.ZodNumber>;
2609
+ exitSignal: z.ZodOptional<z.ZodString>;
2610
+ }, z.core.$strict>, z.ZodObject<{
2611
+ state: z.ZodLiteral<"unknown">;
2612
+ ref: z.ZodObject<{
2613
+ run: z.ZodObject<{
2614
+ runId: z.ZodString;
2615
+ provider: z.ZodString;
2616
+ environmentId: z.ZodString;
2617
+ sessionId: z.ZodString;
2618
+ executionId: z.ZodString;
2619
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2620
+ }, z.core.$strict>;
2621
+ preparationReceipt: z.ZodObject<{
2622
+ kind: z.ZodLiteral<"agent-execution-preparation">;
2623
+ schemaVersion: z.ZodLiteral<1>;
2624
+ preparationId: z.ZodString;
2625
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2626
+ authoredProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2627
+ effectiveProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2628
+ backend: z.ZodString;
2629
+ harness: z.ZodEnum<{
2630
+ "claude-code": "claude-code";
2631
+ nanoclaw: "nanoclaw";
2632
+ codex: "codex";
2633
+ opencode: "opencode";
2634
+ "kimi-code": "kimi-code";
2635
+ pi: "pi";
2636
+ prime: "prime";
2637
+ gemini: "gemini";
2638
+ hermes: "hermes";
2639
+ openclaw: "openclaw";
2640
+ amp: "amp";
2641
+ "factory-droids": "factory-droids";
2642
+ forge: "forge";
2643
+ cursor: "cursor";
2644
+ acp: "acp";
2645
+ "cli-base": "cli-base";
2646
+ }>;
2647
+ harnessVersion: z.ZodString;
2648
+ resolvedModel: z.ZodObject<{
2649
+ requested: z.ZodString;
2650
+ resolved: z.ZodString;
2651
+ provider: z.ZodOptional<z.ZodString>;
2652
+ reasoningEffort: z.ZodOptional<z.ZodObject<{
2653
+ requested: z.ZodEnum<{
2654
+ none: "none";
2655
+ minimal: "minimal";
2656
+ low: "low";
2657
+ medium: "medium";
2658
+ high: "high";
2659
+ xhigh: "xhigh";
2660
+ ultracode: "ultracode";
2661
+ }>;
2662
+ resolved: z.ZodOptional<z.ZodEnum<{
2663
+ none: "none";
2664
+ minimal: "minimal";
2665
+ low: "low";
2666
+ medium: "medium";
2667
+ high: "high";
2668
+ xhigh: "xhigh";
2669
+ ultracode: "ultracode";
2670
+ }>>;
2671
+ fidelity: z.ZodEnum<{
2672
+ exact: "exact";
2673
+ unsupported: "unsupported";
2674
+ clamped: "clamped";
2675
+ }>;
2676
+ }, z.core.$strict>>;
2677
+ }, z.core.$strict>;
2678
+ workspace: z.ZodObject<{
2679
+ leaseId: z.ZodString;
2680
+ provider: z.ZodString;
2681
+ identityDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2682
+ isolation: z.ZodEnum<{
2683
+ "per-run": "per-run";
2684
+ shared: "shared";
2685
+ }>;
2686
+ sourceSnapshotDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2687
+ sourceSnapshotPolicy: z.ZodObject<{
2688
+ kind: z.ZodLiteral<"provider-declared">;
2689
+ name: z.ZodString;
2690
+ version: z.ZodNumber;
2691
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2692
+ }, z.core.$strict>;
2693
+ preparedWorkspaceDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2694
+ profileActivationDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2695
+ }, z.core.$strict>;
2696
+ axisResults: z.ZodArray<z.ZodObject<{
2697
+ axis: z.ZodEnum<{
2698
+ metadata: "metadata";
2699
+ description: "description";
2700
+ files: "files";
2701
+ name: "name";
2702
+ version: "version";
2703
+ tags: "tags";
2704
+ harness: "harness";
2705
+ seats: "seats";
2706
+ proxySecrets: "proxySecrets";
2707
+ permissions: "permissions";
2708
+ tools: "tools";
2709
+ mcp: "mcp";
2710
+ connections: "connections";
2711
+ subagents: "subagents";
2712
+ hooks: "hooks";
2713
+ modes: "modes";
2714
+ confidential: "confidential";
2715
+ extensions: "extensions";
2716
+ systemPrompt: "systemPrompt";
2717
+ appendSystemPrompt: "appendSystemPrompt";
2718
+ instructions: "instructions";
2719
+ knowledge: "knowledge";
2720
+ skills: "skills";
2721
+ commands: "commands";
2722
+ modelDefault: "modelDefault";
2723
+ modelSmall: "modelSmall";
2724
+ modelProvider: "modelProvider";
2725
+ modelReasoningEffort: "modelReasoningEffort";
2726
+ modelMaxVisibleOutputTokens: "modelMaxVisibleOutputTokens";
2727
+ modelMaxReasoningTokens: "modelMaxReasoningTokens";
2728
+ modelMaxTotalOutputTokens: "modelMaxTotalOutputTokens";
2729
+ modelMetadata: "modelMetadata";
2730
+ resourceTools: "resourceTools";
2731
+ resourceAgents: "resourceAgents";
2732
+ resourceInstructions: "resourceInstructions";
2733
+ resourceFailOnError: "resourceFailOnError";
2734
+ }>;
2735
+ disposition: z.ZodEnum<{
2736
+ unsupported: "unsupported";
2737
+ behavior: "behavior";
2738
+ control: "control";
2739
+ overridden: "overridden";
2740
+ }>;
2741
+ owner: z.ZodEnum<{
2742
+ runtime: "runtime";
2743
+ executor: "executor";
2744
+ }>;
2745
+ mechanism: z.ZodString;
2746
+ evidenceDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
2747
+ path: z.ZodOptional<z.ZodString>;
2748
+ reason: z.ZodOptional<z.ZodString>;
2749
+ }, z.core.$strict>>;
2750
+ executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2751
+ materializer: z.ZodObject<{
2752
+ name: z.ZodString;
2753
+ version: z.ZodString;
2754
+ }, z.core.$strict>;
2755
+ expiresAtMs: z.ZodNumber;
2756
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2757
+ }, z.core.$strict>;
2758
+ incarnationId: z.ZodString;
2759
+ startedAt: z.ZodISODateTime;
2760
+ }, z.core.$strict>;
2761
+ message: z.ZodString;
2762
+ retryable: z.ZodBoolean;
2763
+ }, z.core.$strict>], "state">;
2764
+ type AgentInteractiveSessionStatus = z.infer<typeof AgentInteractiveSessionStatusSchema>;
2765
+ interface AgentInteractiveSessionStopCommandMaterial {
2766
+ operationId: string;
2767
+ ref: AgentInteractiveSessionRef;
2768
+ control: AgentInteractiveSessionControlClaim;
2769
+ }
2770
+ interface AgentInteractiveSessionStopCommand extends AgentInteractiveSessionStopCommandMaterial {
2771
+ requestDigest: `sha256:${string}`;
2772
+ }
2773
+ type AgentInteractiveSessionStopEffect = "stop_requested" | "stopped" | "not_live" | "unknown";
2774
+ interface AgentInteractiveSessionStopAcknowledgement {
2775
+ operationId: string;
2776
+ requestDigest: `sha256:${string}`;
2777
+ ref: AgentInteractiveSessionRef;
2778
+ control: AgentInteractiveSessionControlClaim;
2779
+ status: "accepted" | "replayed" | "conflict" | "unknown";
2780
+ effect: AgentInteractiveSessionStopEffect;
2781
+ message?: string;
2782
+ retryable?: boolean;
2783
+ existingRequestDigest?: `sha256:${string}`;
2784
+ }
2785
+ /** Terminal returned after attach; every write remains bound to this claim. */
2786
+ interface AgentInteractiveTerminalSession extends AgentTerminalSession {
2787
+ readonly control: AgentInteractiveSessionControlClaim;
2788
+ }
2789
+ interface AgentInteractiveSessionPromptCommandMaterial {
2790
+ operationId: string;
2791
+ ref: AgentInteractiveSessionRef;
2792
+ control: AgentInteractiveSessionControlClaim;
2793
+ prompt: string;
2794
+ }
2795
+ interface AgentInteractiveSessionPromptCommand extends AgentInteractiveSessionPromptCommandMaterial {
2796
+ requestDigest: `sha256:${string}`;
2797
+ }
2798
+ declare function agentInteractiveSessionPromptRequestDigest(value: AgentInteractiveSessionPromptCommandMaterial): `sha256:${string}`;
2799
+ interface AgentInteractiveSessionPromptAcknowledgement {
2800
+ operationId: string;
2801
+ requestDigest: `sha256:${string}`;
2802
+ ref: AgentInteractiveSessionRef;
2803
+ control: AgentInteractiveSessionControlClaim;
2804
+ status: "accepted" | "replayed" | "conflict" | "unknown";
2805
+ message?: string;
2806
+ retryable?: boolean;
2807
+ existingRequestDigest?: `sha256:${string}`;
2808
+ }
2809
+ //#endregion
2810
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/environment-interactive-start.d.ts
2811
+ /**
2812
+ * Start one native coding-agent TUI from caller-owned request material.
2813
+ *
2814
+ * The provider owns profile materialization and returns its preparation receipt
2815
+ * in the resulting reference. Replaying the same exact request/run returns the
2816
+ * same reference, even after the process exits; changed material cannot reuse it.
2817
+ */
2818
+ declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
2819
+ run: z.ZodObject<{
2820
+ runId: z.ZodString;
2821
+ provider: z.ZodString;
2822
+ environmentId: z.ZodString;
2823
+ sessionId: z.ZodString;
2824
+ executionId: z.ZodString;
2825
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
2826
+ }, z.core.$strict>;
2827
+ profile: z.ZodObject<{
2828
+ name: z.ZodOptional<z.ZodString>;
2829
+ description: z.ZodOptional<z.ZodString>;
2830
+ version: z.ZodOptional<z.ZodString>;
2831
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
2832
+ prompt: z.ZodOptional<z.ZodObject<{
2833
+ systemPrompt: z.ZodOptional<z.ZodString>;
2834
+ appendSystemPrompt: z.ZodOptional<z.ZodString>;
2835
+ instructions: z.ZodOptional<z.ZodArray<z.ZodString>>;
2836
+ }, z.core.$strict>>;
2837
+ model: z.ZodOptional<z.ZodObject<{
2838
+ default: z.ZodOptional<z.ZodString>;
2839
+ small: z.ZodOptional<z.ZodString>;
2840
+ provider: z.ZodOptional<z.ZodString>;
2841
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
2842
+ none: "none";
2843
+ minimal: "minimal";
2844
+ low: "low";
2845
+ medium: "medium";
2846
+ high: "high";
2847
+ xhigh: "xhigh";
2848
+ ultracode: "ultracode";
2849
+ }>>;
2850
+ maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
2851
+ maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
2852
+ maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
2853
+ metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
2854
+ }, z.core.$strict>>;
2855
+ harness: z.ZodOptional<z.ZodEnum<{
2856
+ "claude-code": "claude-code";
2857
+ nanoclaw: "nanoclaw";
2858
+ codex: "codex";
2859
+ opencode: "opencode";
2860
+ "kimi-code": "kimi-code";
2861
+ pi: "pi";
2862
+ prime: "prime";
2863
+ gemini: "gemini";
2864
+ hermes: "hermes";
2865
+ openclaw: "openclaw";
2866
+ amp: "amp";
2867
+ "factory-droids": "factory-droids";
2868
+ forge: "forge";
2869
+ cursor: "cursor";
2870
+ acp: "acp";
2871
+ "cli-base": "cli-base";
2872
+ }>>;
2873
+ seats: z.ZodOptional<z.ZodArray<z.ZodObject<{
2874
+ harness: z.ZodEnum<{
2875
+ "claude-code": "claude-code";
2876
+ nanoclaw: "nanoclaw";
2877
+ codex: "codex";
2878
+ opencode: "opencode";
2879
+ "kimi-code": "kimi-code";
2880
+ pi: "pi";
2881
+ prime: "prime";
2882
+ gemini: "gemini";
2883
+ hermes: "hermes";
2884
+ openclaw: "openclaw";
2885
+ amp: "amp";
2886
+ "factory-droids": "factory-droids";
2887
+ forge: "forge";
2888
+ cursor: "cursor";
2889
+ acp: "acp";
2890
+ "cli-base": "cli-base";
2891
+ }>;
2892
+ provider: z.ZodString;
2893
+ model: z.ZodString;
2894
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
2895
+ none: "none";
2896
+ minimal: "minimal";
2897
+ low: "low";
2898
+ medium: "medium";
2899
+ high: "high";
2900
+ xhigh: "xhigh";
2901
+ ultracode: "ultracode";
2902
+ }>>;
2903
+ selector: z.ZodUnion<readonly [z.ZodObject<{
2904
+ kind: z.ZodLiteral<"all-eligible">;
2905
+ }, z.core.$strict>, z.ZodObject<{
2906
+ kind: z.ZodLiteral<"seat">;
2907
+ id: z.ZodString;
2908
+ }, z.core.$strict>]>;
2909
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
2910
+ permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
2911
+ }, z.core.$strict>>>;
2912
+ proxySecrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
2913
+ hosts: z.ZodReadonly<z.ZodArray<z.ZodString>>;
2914
+ methods: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2915
+ paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2916
+ envName: z.ZodString;
2917
+ secretRef: z.ZodObject<{
2918
+ key: z.ZodString;
2919
+ kind: z.ZodLiteral<"secret-ref">;
2920
+ }, z.core.$strict>;
2921
+ presentation: z.ZodDiscriminatedUnion<[z.ZodObject<{
2922
+ type: z.ZodLiteral<"bearer">;
2923
+ }, z.core.$strict>, z.ZodObject<{
2924
+ type: z.ZodLiteral<"basic">;
2925
+ username: z.ZodString;
2926
+ }, z.core.$strict>, z.ZodObject<{
2927
+ type: z.ZodLiteral<"header">;
2928
+ name: z.ZodString;
2929
+ }, z.core.$strict>, z.ZodObject<{
2930
+ type: z.ZodLiteral<"query">;
2931
+ name: z.ZodString;
2932
+ }, z.core.$strict>], "type">;
2933
+ placeholderFormat: z.ZodOptional<z.ZodEnum<{
2934
+ jwt: "jwt";
2935
+ opaque: "opaque";
2936
+ }>>;
2937
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
2938
+ }, z.core.$strict>>>;
2939
+ permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
2940
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
2941
+ mcp: z.ZodOptional<z.ZodType<Record<string, AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, AgentProfileMcpServer>, unknown>>>;
2942
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
2943
+ connectionId: z.ZodString;
2944
+ capabilities: z.ZodArray<z.ZodString>;
2945
+ alias: z.ZodOptional<z.ZodString>;
2946
+ }, z.core.$strict>>>;
2947
+ subagents: z.ZodOptional<z.ZodType<Record<string, {
2948
+ description?: string | undefined;
2949
+ prompt?: string | undefined;
2950
+ model?: string | undefined;
2951
+ tools?: Record<string, boolean> | undefined;
2952
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
2953
+ maxSteps?: number | undefined;
2954
+ metadata?: Record<string, unknown> | undefined;
2955
+ }>, unknown, z.core.$ZodTypeInternals<Record<string, {
2956
+ description?: string | undefined;
2957
+ prompt?: string | undefined;
2958
+ model?: string | undefined;
2959
+ tools?: Record<string, boolean> | undefined;
2960
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
2961
+ maxSteps?: number | undefined;
2962
+ metadata?: Record<string, unknown> | undefined;
2963
+ }>, unknown>>>;
2964
+ resources: z.ZodOptional<z.ZodObject<{
2965
+ knowledge: z.ZodOptional<z.ZodArray<z.ZodObject<{
2966
+ sourceId: z.ZodString;
2967
+ generation: z.ZodString;
2968
+ }, z.core.$strict>>>;
2969
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
2970
+ path: z.ZodString;
2971
+ resource: z.ZodUnion<readonly [z.ZodObject<{
2972
+ kind: z.ZodLiteral<"inline">;
2973
+ name: z.ZodString;
2974
+ content: z.ZodString;
2975
+ }, z.core.$strict>, z.ZodObject<{
2976
+ kind: z.ZodLiteral<"github">;
2977
+ repository: z.ZodOptional<z.ZodString>;
2978
+ path: z.ZodString;
2979
+ ref: z.ZodOptional<z.ZodString>;
2980
+ name: z.ZodOptional<z.ZodString>;
2981
+ }, z.core.$strict>]>;
2982
+ executable: z.ZodOptional<z.ZodBoolean>;
2983
+ }, z.core.$strict>>>;
2984
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2985
+ kind: z.ZodLiteral<"inline">;
2986
+ name: z.ZodString;
2987
+ content: z.ZodString;
2988
+ }, z.core.$strict>, z.ZodObject<{
2989
+ kind: z.ZodLiteral<"github">;
2990
+ repository: z.ZodOptional<z.ZodString>;
2991
+ path: z.ZodString;
2992
+ ref: z.ZodOptional<z.ZodString>;
2993
+ name: z.ZodOptional<z.ZodString>;
2994
+ }, z.core.$strict>]>>>;
2995
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2996
+ kind: z.ZodLiteral<"inline">;
2997
+ name: z.ZodString;
2998
+ content: z.ZodString;
2999
+ }, z.core.$strict>, z.ZodObject<{
3000
+ kind: z.ZodLiteral<"github">;
3001
+ repository: z.ZodOptional<z.ZodString>;
3002
+ path: z.ZodString;
3003
+ ref: z.ZodOptional<z.ZodString>;
3004
+ name: z.ZodOptional<z.ZodString>;
3005
+ }, z.core.$strict>]>>>;
3006
+ agents: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
3007
+ kind: z.ZodLiteral<"inline">;
3008
+ name: z.ZodString;
3009
+ content: z.ZodString;
3010
+ }, z.core.$strict>, z.ZodObject<{
3011
+ kind: z.ZodLiteral<"github">;
3012
+ repository: z.ZodOptional<z.ZodString>;
3013
+ path: z.ZodString;
3014
+ ref: z.ZodOptional<z.ZodString>;
3015
+ name: z.ZodOptional<z.ZodString>;
3016
+ }, z.core.$strict>]>>>;
3017
+ commands: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
3018
+ kind: z.ZodLiteral<"inline">;
3019
+ name: z.ZodString;
3020
+ content: z.ZodString;
3021
+ }, z.core.$strict>, z.ZodObject<{
3022
+ kind: z.ZodLiteral<"github">;
3023
+ repository: z.ZodOptional<z.ZodString>;
3024
+ path: z.ZodString;
3025
+ ref: z.ZodOptional<z.ZodString>;
3026
+ name: z.ZodOptional<z.ZodString>;
3027
+ }, z.core.$strict>]>>>;
3028
+ instructions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
3029
+ kind: z.ZodLiteral<"inline">;
3030
+ name: z.ZodString;
3031
+ content: z.ZodString;
3032
+ }, z.core.$strict>, z.ZodObject<{
3033
+ kind: z.ZodLiteral<"github">;
3034
+ repository: z.ZodOptional<z.ZodString>;
3035
+ path: z.ZodString;
3036
+ ref: z.ZodOptional<z.ZodString>;
3037
+ name: z.ZodOptional<z.ZodString>;
3038
+ }, z.core.$strict>]>]>>;
3039
+ failOnError: z.ZodOptional<z.ZodBoolean>;
3040
+ }, z.core.$strict>>;
3041
+ hooks: z.ZodOptional<z.ZodType<Record<string, {
3042
+ command: string;
3043
+ timeoutMs?: number | undefined;
3044
+ blocking?: boolean | undefined;
3045
+ matcher?: string | undefined;
3046
+ env?: Record<string, {
3047
+ kind: "secret-ref";
3048
+ key: string;
3049
+ format?: "raw" | "bearer" | undefined;
3050
+ } | {
3051
+ kind: "public";
3052
+ value: string;
3053
+ }> | undefined;
3054
+ }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
3055
+ command: string;
3056
+ timeoutMs?: number | undefined;
3057
+ blocking?: boolean | undefined;
3058
+ matcher?: string | undefined;
3059
+ env?: Record<string, {
3060
+ kind: "secret-ref";
3061
+ key: string;
3062
+ format?: "raw" | "bearer" | undefined;
3063
+ } | {
3064
+ kind: "public";
3065
+ value: string;
3066
+ }> | undefined;
3067
+ }[]>, unknown>>>;
3068
+ modes: z.ZodOptional<z.ZodType<Record<string, {
3069
+ description?: string | undefined;
3070
+ model?: string | undefined;
3071
+ prompt?: string | undefined;
3072
+ tools?: Record<string, boolean> | undefined;
3073
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
3074
+ metadata?: Record<string, unknown> | undefined;
3075
+ }>, unknown, z.core.$ZodTypeInternals<Record<string, {
3076
+ description?: string | undefined;
3077
+ model?: string | undefined;
3078
+ prompt?: string | undefined;
3079
+ tools?: Record<string, boolean> | undefined;
3080
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
3081
+ metadata?: Record<string, unknown> | undefined;
3082
+ }>, unknown>>>;
3083
+ confidential: z.ZodOptional<z.ZodObject<{
3084
+ tee: z.ZodOptional<z.ZodString>;
3085
+ attestationNonce: z.ZodOptional<z.ZodString>;
3086
+ sealed: z.ZodOptional<z.ZodBoolean>;
3087
+ attestationRefresh: z.ZodOptional<z.ZodBoolean>;
3088
+ }, z.core.$strict>>;
3089
+ metadata: z.ZodOptional<z.ZodType<AgentProfileMetadata, unknown, z.core.$ZodTypeInternals<AgentProfileMetadata, unknown>>>;
3090
+ extensions: z.ZodOptional<z.ZodType<Record<string, Record<string, unknown> | undefined>, unknown, z.core.$ZodTypeInternals<Record<string, Record<string, unknown> | undefined>, unknown>>>;
3091
+ }, z.core.$strict>;
3092
+ requestedProfileDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
3093
+ authMode: z.ZodOptional<z.ZodLiteral<"oauth">>;
3094
+ initialPrompt: z.ZodOptional<z.ZodString>;
3095
+ cwd: z.ZodOptional<z.ZodString>;
3096
+ cols: z.ZodOptional<z.ZodNumber>;
3097
+ rows: z.ZodOptional<z.ZodNumber>;
3098
+ }, z.core.$strict>;
3099
+ type AgentInteractiveSessionStart = z.infer<typeof AgentInteractiveSessionStartSchema>;
3100
+ //#endregion
3101
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/runtime-attachments.d.ts
3102
+ /** Runtime-owned bindings do not alter the authored AgentProfile or candidate identity. */
3103
+ interface AgentRuntimeAttachments {
3104
+ mcp: Record<string, AgentProfileMcpServer>;
3105
+ }
3106
+ //#endregion
3107
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/sandbox-size.d.ts
3108
+ /**
3109
+ * Portable sandbox size vocabulary.
3110
+ *
3111
+ * A size preset is a provider-neutral NAME for a compute tier (cpu / memory /
3112
+ * disk). This module owns only the vocabulary — the names and their smallest→
3113
+ * largest ordering — so the lowest shared layer can reference a size without
3114
+ * depending on the sandbox SDK (`Capability.recommendedSize` lives here, and
3115
+ * agent-interface must not depend on `@tangle-network/sandbox`).
3116
+ *
3117
+ * The concrete cpu/memory/disk numbers for each preset are the sandbox SDK's
3118
+ * single source of truth (`@tangle-network/sandbox` → `SANDBOX_SIZE_PRESETS`),
3119
+ * which imports these names. Mirrors how this package owns the `ReasoningEffort`
3120
+ * vocabulary while backends own its native mapping.
3121
+ */
3122
+ /** Compute tiers, ordered smallest → largest. */
3123
+ declare const SANDBOX_SIZE_PRESET_NAMES: readonly ["nano", "small", "medium", "large"];
3124
+ /**
3125
+ * A named compute tier for a sandbox. `nano` suits thin glue work (a single API
3126
+ * call, a notify); `large` suits heavy builds over big repositories. Sizing is a
3127
+ * per-task decision — a thin workflow step should not provision a maxed box.
3128
+ */
3129
+ type SandboxSizePreset = (typeof SANDBOX_SIZE_PRESET_NAMES)[number];
3130
+ //#endregion
3131
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/profile-schema.d.ts
3132
+ /**
3133
+ * A registered capability: a stable id paired with its canonical
3134
+ * {@link AgentProfile}. `definition` is the full profile (prompt/model/tools/
3135
+ * mcp/permissions), so a capability carries the whole agent shape, not just a
3136
+ * system prompt. The platform capability registry validates and stores these.
3137
+ */
3138
+ interface Capability {
3139
+ /** Stable, deterministic id — the key a workflow's `agent.run.profile` names. */
3140
+ id: string;
3141
+ /** The canonical agent profile (prompt/model/tools/mcp/permissions). */
3142
+ definition: AgentProfile;
3143
+ /**
3144
+ * Recommended compute tier for a sandbox running this capability. A dispatcher
3145
+ * uses it as the size DEFAULT when the caller does not pick one — so a
3146
+ * capability that only ever does thin work defaults to a small box instead of
3147
+ * a maxed one. The caller may always override it per dispatch. Omitted → the
3148
+ * dispatcher's own default tier.
3149
+ */
3150
+ recommendedSize?: SandboxSizePreset;
3151
+ }
3152
+ //#endregion
3153
+ //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.8.1/node_modules/@tangle-network/agent-interface/dist/profile-security.d.ts
3154
+ /** Policy for {@link validateAgentProfileSecurity}. */
3155
+ interface AgentProfileSecurityPolicy {
3156
+ /**
3157
+ * Allow stdio/local MCP servers (a spawned local process). Off in cloud: an
3158
+ * inline profile must not start arbitrary commands at MCP init.
3159
+ */
3160
+ allowLocalMcp: boolean;
3161
+ /**
3162
+ * Allow lifecycle hooks (shell commands run automatically around the turn).
3163
+ * Off in cloud: hooks are author-controlled shell outside the agent's loop.
3164
+ */
3165
+ allowHooks: boolean;
3166
+ /**
3167
+ * Glob allowlist for REMOTE MCP hosts (http/sse `url` hostnames). A set list
3168
+ * rejects any host that matches no pattern; an empty list (`[]`) blocks ALL
3169
+ * remote MCP.
3170
+ *
3171
+ * SECURITY: `undefined` leaves remote MCP hosts UNRESTRICTED — it does NOT
3172
+ * protect against SSRF (an inline profile could point an MCP server at, e.g.,
3173
+ * `http://169.254.169.254/` cloud metadata or an internal address). When this
3174
+ * is `undefined`, the caller MUST enforce SSRF/egress controls at the network
3175
+ * layer, or set a restrictive allowlist (or `[]`) to fail closed.
3176
+ */
3177
+ allowedMcpHosts?: string[];
3178
+ /**
3179
+ * Allow `connections` (hub-managed integration grants). `undefined` leaves them
3180
+ * allowed — a connection is a legitimate inline-profile feature where the host
3181
+ * wires it. A host that does NOT support inline connection grants (e.g. a
3182
+ * surface that grants hub access through a separate, audited path) sets this
3183
+ * `false` so an inline profile cannot smuggle hub access through the profile.
3184
+ */
3185
+ allowConnections?: boolean;
3186
+ }
3187
+ //#endregion
3188
+ //#region src/terminal-stream-types.d.ts
3189
+ /**
3190
+ * Event callbacks, passed at construction (the same idiom as
3191
+ * `SessionGatewayClient`'s `handlers` config). Registering them up front is
3192
+ * load-bearing: the server replays PTY history immediately after `ready`, so
3193
+ * a handler attached after connect would miss the replayed screen.
3194
+ */
3195
+ interface TerminalStreamHandlers {
3196
+ /** Raw PTY output bytes (both live output and reattach history replay). */
3197
+ onData?: (data: Uint8Array) => void;
3198
+ /** Server-sequenced output for exact interactive terminal sessions. */
3199
+ onOutput?: (seq: number, data: Uint8Array) => void;
3200
+ onReady?: (info: TerminalReadyInfo) => void;
3201
+ onExit?: (info: TerminalExitInfo) => void;
3202
+ /** Protocol `error` frames and post-connect transport failures. */
3203
+ onError?: (error: TerminalStreamError) => void;
3204
+ /** Socket closed — by the server, the network, or a local `close()`. */
3205
+ onClose?: (code: number, reason: string) => void;
3206
+ }
3207
+ /**
3208
+ * Which WebSocket-subprotocol auth envelope to offer. A WebSocket client
3209
+ * cannot set an Authorization header, so the bearer rides the
3210
+ * `Sec-WebSocket-Protocol` offer — and the two dialable endpoints expect
3211
+ * DIFFERENT envelopes:
3212
+ *
3213
+ * - `"edge"` (default): the public API runtime proxy
3214
+ * (`wss://<api>/v1/sandboxes/{id}/runtime/terminals/{id}/ws`, or its older
3215
+ * spelling `/v1/sidecar-proxy/{id}/...`) expects
3216
+ * `bearer.<base64url(token)>` — see `bearerFromSubprotocolOffer` in the
3217
+ * platform's runtime contracts. The fixed
3218
+ * `tangle.terminal.v1` marker is offered alongside the credential (see
3219
+ * {@link TERMINAL_WS_ECHO_SUBPROTOCOL}).
3220
+ * - `"sidecar-direct"`: the sidecar's own `/terminals/{id}/ws` route expects
3221
+ * `tangle.bearer.<token>` plus the same `tangle.terminal.v1` echo marker —
3222
+ * see `apps/sidecar/src/routes/ws-subprotocol-auth.ts`. Only
3223
+ * platform-internal callers (and the composed integration tests) dial the
3224
+ * sidecar directly.
3225
+ */
3226
+ /**
3227
+ * Bearer credential for the dial: a token string, or a provider invoked on
3228
+ * EVERY dial (including {@link TerminalStream.reconnect}). The provider
3229
+ * receives that dial's AbortSignal so token minting observes cancellation.
3230
+ * Scoped terminal tokens are short-lived (the platform clamps them to <= 15
3231
+ * minutes), so a provider lets the SDK re-mint a fresh token per dial.
3232
+ */
3233
+ type TerminalStreamBearerToken = string | ScopedToken | ((signal?: AbortSignal) => Promise<string | ScopedToken> | string | ScopedToken);
3234
+ /**
3235
+ * The account API key, sent as the `Authorization` header of the upgrade
3236
+ * instead of a subprotocol credential. Only a runtime that can set headers on
3237
+ * a WebSocket upgrade (Node, Bun) can dial this way — see
3238
+ * {@link terminalUpgradeHeadersSupported}; a browser keeps a scoped token. The
3239
+ * public API proxy takes its owner path for the key, so no scoped token is
3240
+ * minted first. Dial the public API proxy with it, never the sidecar directly.
3241
+ */
3242
+ interface TerminalStreamApiKey {
3243
+ readonly apiKey: string;
3244
+ }
3245
+ type TerminalStreamToken = TerminalStreamBearerToken | TerminalStreamApiKey;
3246
+ /**
3247
+ * Wall-clock marks for one attach, in milliseconds on the caller's monotonic
3248
+ * clock. `server` holds the sidecar's absolute stamps from the `ready` frame
3249
+ * (epoch milliseconds on the sidecar's clock); a caller lays them against its
3250
+ * own epoch marks to split each leg.
3251
+ */
3252
+ interface TerminalAttachTimings {
3253
+ /** The caller's wall to mint the scoped token; absent when the dial used the API key. */
3254
+ mintMs?: number;
3255
+ /** WebSocket construction to `open`: the upgrade round trip. */
3256
+ wsOpenMs: number;
3257
+ /** `open` to `ready`. One client/sidecar round trip plus the sidecar's work when `init` was a frame; the sidecar's work alone once the PTY starts on the upgrade. */
3258
+ initToReadyMs: number;
3259
+ /** `ready` to the first output byte (replayed screen or live output); absent until it arrives. */
3260
+ firstByteMs?: number;
3261
+ /** The first `write()` to the next output byte; absent until it arrives. */
3262
+ echoRttMs?: number;
3263
+ /** How the init was offered: on the upgrade URL as well as in the frame (a default-shell attach), or in the frame alone. */
3264
+ init: "upgrade" | "frame";
3265
+ /** The sidecar's stamps; absent from a sidecar that predates them. */
3266
+ server?: TerminalReadyTimings;
3267
+ }
3268
+ /** Authority refreshed before an interactive stream reconnects. */
3269
+ interface TerminalStreamReconnectBinding {
3270
+ incarnationId: TerminalInteractiveSessionIdentity["incarnationId"];
3271
+ control: TerminalInteractiveSessionIdentity["control"];
3272
+ /** Release a claim if the new socket cannot be opened. */
3273
+ onFailure?: () => Promise<void> | void;
3274
+ }
3275
+ /** Internal SDK hook that reclaims interactive authority before reconnect. */
3276
+ interface TerminalStreamReconnectAuthority {
3277
+ acquire(signal?: AbortSignal): Promise<TerminalStreamReconnectBinding>;
3278
+ }
3279
+ interface TerminalStreamOptions {
3280
+ /**
3281
+ * Absolute URL of the terminal WebSocket endpoint. `http(s)` URLs are
3282
+ * converted to `ws(s)` automatically.
3283
+ */
3284
+ url: string;
3285
+ /**
3286
+ * Bearer token carried in the auth subprotocol (see `authFormat`) — a
3287
+ * string, or a provider re-invoked on every dial so short-lived scoped
3288
+ * tokens stay fresh across reconnects.
3289
+ */
3290
+ token: TerminalStreamToken;
3291
+ /**
3292
+ * PTY connection id — also sent in the `init` frame; the server rejects a
3293
+ * mismatch with the URL's id. Reusing an id reattaches the existing PTY.
3294
+ */
3295
+ connectionId: string;
3296
+ cols?: number;
3297
+ rows?: number;
3298
+ /** Command to run when the id has no live PTY (defaults to the shell). */
3299
+ command?: string;
3300
+ cwd?: string;
3301
+ env?: Record<string, string>;
3302
+ /**
3303
+ * Exact interactive-agent incarnation. Ordinary terminal consumers omit
3304
+ * both interactive fields and retain the existing wire contract.
3305
+ */
3306
+ incarnationId?: TerminalInteractiveSessionIdentity["incarnationId"];
3307
+ /** Exact active control claim for the interactive-agent incarnation. */
3308
+ control?: TerminalInteractiveSessionIdentity["control"];
3309
+ /** Auth subprotocol envelope. Default `"edge"`. */
3310
+ authFormat?: TerminalStreamAuthFormat;
3311
+ handlers?: TerminalStreamHandlers;
3312
+ /** Reject `connect()` if `ready` has not arrived within this window. */
3313
+ connectTimeoutMs?: number;
3314
+ /** Cancel token resolution or an in-progress WebSocket handshake. */
3315
+ signal?: AbortSignal;
3316
+ /** Reclaim interactive authority before a reconnecting dial. */
3317
+ reconnectAuthority?: TerminalStreamReconnectAuthority;
3318
+ /**
3319
+ * Correlation id for this attach: sent as `x-tangle-trace-id` where the
3320
+ * runtime can set upgrade headers, and on the upgrade URL and the `init`
3321
+ * frame everywhere else. A fresh id is minted when omitted.
3322
+ */
3323
+ traceId?: string;
3324
+ /** Wall the caller spent minting this dial's credential, reported in {@link TerminalAttachTimings}. */
3325
+ mintMs?: number;
3326
+ }
3327
+ //#endregion
3328
+ export { PlanContinuation as $, AgentRunCancellationRequest as A, SandboxErrorJson as At, AgentProfileMcpServer as B, AgentInteractiveSessionStopCommand as C, NetworkError as Ct, TerminalReplayWindow as D, QuotaError as Dt, TerminalOutputEvent as E, ProfileFileMountPathError as Et, AgentProfileCapabilities as F, StreamInterruptionReason as Ft, AgentProfileResourceRef as G, AgentProfileModelHints as H, AgentProfileConfidential as I, TimeoutError as It, AgentProfileValidationIssue as J, AgentProfileResources as K, AgentProfileConfigValue as L, ValidationError as Lt, InteractionRequest as M, ServerError as Mt, InteractionResponseCommand as N, StateError as Nt, AgentExactRunControlRef as O, ResumeEnvRequiredError as Ot, AgentProfile as P, StreamInterruptedError as Pt, InteractionData as Q, AgentProfileConnection as R, SandboxCreateOutcome as Rt, AgentInteractiveSessionStopAcknowledgement as S, KeyBudgetExhaustedError as St, agentInteractiveSessionPromptRequestDigest as T, PartialFailureError as Tt, AgentProfilePermissionValue as U, AgentProfileMetadata as V, AgentProfilePrompt as W, AgentSubagentProfile as X, AgentProfileValidationResult as Y, ReasoningEffort as Z, AgentInteractiveSessionControlClaimRequest as _, EdgeNotReadyError as _t, TerminalStreamOptions as a, TerminalExitInfo as at, AgentInteractiveSessionRef as b, GpuProviderNotConfiguredError as bt, AgentProfileSecurityPolicy as c, TerminalReadyInfo as ct, SandboxSizePreset as d, AgentProfile$1 as dt, MintInteractiveSessionTokenOptions as et, AgentRuntimeAttachments as f, TerminalStreamError as ft, AgentInteractiveSessionControlClaimAcknowledgement as g, CompliancePlacementError as gt, AgentInteractiveSessionControlClaim as h, CapabilityError as ht, TerminalStreamHandlers as i, TERMINAL_WS_ECHO_SUBPROTOCOL as it, InteractionAcknowledgement as j, SandboxFailureDetail as jt, AgentRunCancellationAcknowledgement as k, SandboxError as kt, Capability as l, TerminalReadyTimings as lt, AgentInteractiveSessionAttach as m, BranchFanoutExceedsHostError as mt, TerminalStreamApiKey as n, ScopedToken as nt, TerminalStreamReconnectAuthority as o, TerminalInteractiveSessionIdentity as ot, AgentInteractiveSessionStart as p, AuthError as pt, AgentProfileSeat as q, TerminalStreamBearerToken as r, ScopedTokenScope as rt, TerminalStreamToken as s, TerminalOutputMessage as st, TerminalAttachTimings as t, MintScopedTokenOptions as tt, SANDBOX_SIZE_PRESET_NAMES as u, TerminalStreamAuthFormat as ut, AgentInteractiveSessionPromptAcknowledgement as v, EgressProxyRecoveryError as vt, AgentInteractiveTerminalSession as w, NotFoundError as wt, AgentInteractiveSessionStatus as x, GpuProviderRequirement as xt, AgentInteractiveSessionPromptCommand as y, FileWriteConflictError as yt, AgentProfileFileMount as z, SandboxCreateReceipt as zt };