@tangle-network/sandbox 1.0.190 → 1.0.192

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 (57) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +9 -6
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +1 -1
  5. package/dist/{agent-run-outcome-Cst4px_l.d.ts → agent-run-outcome-BO5paRhX.d.ts} +2 -2
  6. package/dist/{api-request-CZlFy3ku.js → api-request-BHbSfsRr.js} +1 -1
  7. package/dist/{browser-interactive-control-controller-DHIS8edi.js → browser-interactive-control-controller-BYbNLahH.js} +1 -1
  8. package/dist/{browser-interactive-control-controller-DIvMQyer.d.ts → browser-interactive-control-controller-KOK6qn2s.d.ts} +1 -1
  9. package/dist/{chunked-upload-vAE2hVcP.js → chunked-upload-D5ytV_s6.js} +9 -13
  10. package/dist/{chunked-upload-file-HLSriv3V.js → chunked-upload-file-DL1-AqRp.js} +2 -2
  11. package/dist/{client-BERYosgI.js → client-DuWQNr-Q.js} +159 -109
  12. package/dist/{client-C4SnCCpF.d.ts → client-yWdLuj_P.d.ts} +5 -5
  13. package/dist/collaboration/index.js +1 -1
  14. package/dist/{collaboration-CmT6Ygiv.js → collaboration-Bbr45lyk.js} +3 -3
  15. package/dist/{core-BT-0QZT-.js → core-BU1I2KvV.js} +13 -7
  16. package/dist/core.d.ts +6 -6
  17. package/dist/core.js +5 -5
  18. package/dist/errors-Mzq10WZq.js +583 -0
  19. package/dist/{file-download-BXgu9BNh.js → file-download-CKOxcATB.js} +1 -1
  20. package/dist/{index-DDIymnCZ.d.ts → index-DKsOu5sq.d.ts} +5 -5
  21. package/dist/index.d.ts +9 -9
  22. package/dist/index.js +10 -10
  23. package/dist/intelligence/index.js +9 -5
  24. package/dist/interactive-control.d.ts +1 -1
  25. package/dist/interactive-control.js +1 -1
  26. package/dist/{interactive-controller-DXGWBdYK.d.ts → interactive-controller-YyZEsoB0.d.ts} +3 -3
  27. package/dist/{interactive-controller-C876Pjaj.js → interactive-controller-jr3_74Pq.js} +90 -57
  28. package/dist/lib/prepared-evidence.js +1 -1
  29. package/dist/lib/prepared-process.js +1 -1
  30. package/dist/{lines-Br3ygqhP.d.ts → lines-CCHDUfQg.d.ts} +1 -1
  31. package/dist/{lines-DxHJhxCe.js → lines-DrG0WOW6.js} +1 -1
  32. package/dist/lines.d.ts +1 -1
  33. package/dist/lines.js +1 -1
  34. package/dist/{mcp-local-D7MpwsW0.js → mcp-local-O1HzsQiZ.js} +3 -3
  35. package/dist/{prepared-evidence-CP1MmeCQ.js → prepared-evidence-4prvV0YK.js} +1 -1
  36. package/dist/{prepared-process-BWVz93cT.js → prepared-process-BSpZXDDw.js} +1 -1
  37. package/dist/{preview-DUxqnKSk.d.ts → preview-I1z42VGY.d.ts} +3 -3
  38. package/dist/{public-templates-DQiblzzK.d.ts → public-templates-Cw6gmWJD.d.ts} +2 -2
  39. package/dist/public-templates.d.ts +1 -1
  40. package/dist/public-templates.js +7 -4
  41. package/dist/{raw-evidence-archive-CgbWa4es.js → raw-evidence-archive-BD37zHN5.js} +2 -2
  42. package/dist/runtime.d.ts +5 -5
  43. package/dist/runtime.js +9 -7
  44. package/dist/{sandbox-B_Xbc9wR.js → sandbox-Dtb-_btd.js} +317 -221
  45. package/dist/select-seat-command.d.ts +1 -1
  46. package/dist/select-seat-command.js +5 -2
  47. package/dist/session-gateway/index.js +1 -1
  48. package/dist/tangle/index.d.ts +1 -1
  49. package/dist/tangle/index.js +1 -1
  50. package/dist/{tangle-Sg9ORVAA.js → tangle-fs17QlcY.js} +2 -2
  51. package/dist/{terminal-stream-types-1YKRrkZB.d.ts → terminal-stream-types-BqNv5EuG.d.ts} +280 -305
  52. package/dist/{types-B-UsXSi6.d.ts → types-CiuGb4lZ.d.ts} +4 -2
  53. package/package.json +4 -4
  54. package/dist/errors-CaX0a5Ry.js +0 -636
  55. /package/dist/{abort-signal-PgWPMn_e.js → abort-signal-Cu4F2VVz.js} +0 -0
  56. /package/dist/{file-transfer-DTHgLccV.js → file-transfer-Cr9Ossea.js} +0 -0
  57. /package/dist/{retry-after-header-Bt-XvU-x.js → retry-after-header-DUdCC0KJ.js} +0 -0
@@ -0,0 +1,583 @@
1
+ import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-DUdCC0KJ.js";
2
+ //#region ../../../packages/runtime-contracts/dist/error-catalog.js
3
+ const ERROR_CATALOG = {
4
+ VALIDATION_ERROR: "400 final | The request is malformed or a field is invalid. | Fix the field the message names and send the request again.",
5
+ INVALID_REQUEST: "400 final | The request is malformed or a field is invalid. | Fix the field the message names and send the request again.",
6
+ INVALID_TEXT_PART: "400 final | A text part is missing its text or is not base64-encoded UTF-8. | Base64-encode every text part, then send the request again.",
7
+ UNAUTHORIZED: "401 final | The credential is missing, invalid or expired. | Sign in again or send a valid API key.",
8
+ PAYMENT_REQUIRED: "402 final | The account has no balance, credit or plan for this request. | Add credit or upgrade the plan, then retry.",
9
+ FORBIDDEN: "403 final | The caller is authenticated but not allowed to do this. | Use a credential with the role or scope the message names.",
10
+ FEATURE_DISABLED: "403 final | This capability is switched off for this deployment or account. | Ask the operator to enable it.",
11
+ NOT_FOUND: "404 final | The resource does not exist or this account cannot see it. | Check the id and the account or team that owns it.",
12
+ SIDECAR_NOT_FOUND: "404 final | The sandbox runtime does not exist or this account cannot see it. | Check the sandbox id, or create the sandbox again.",
13
+ CONFLICT: "409 final | The request conflicts with an existing resource or an earlier request. | Read the existing resource, or use a new name or idempotency key.",
14
+ STALE_STATE: "409 final | The caller's view of the resource is stale. | Read the resource again and repeat the request against its current state.",
15
+ INVALID_STATE: "409 final | The resource is in the wrong state for this operation. | Bring it to the state the message names, then retry.",
16
+ IN_PROGRESS: "409 retry | Another operation holds this resource. | Wait for that operation to finish, then retry.",
17
+ EGRESS_PROXY_RECOVERY_REQUIRED: "409 final | The egress proxy lost the credentials it serves. | Recreate the sandbox to rematerialize its egress credentials.",
18
+ EGRESS_PROXY_SECRETS_UNAVAILABLE: "409 final | The egress proxy rebuild found no value for secrets the box still references. | Send the missing secrets the response names in one retry, or recreate the sandbox.",
19
+ EGRESS_IN_PLACE_RELOAD_UNAVAILABLE: "409 final | The egress proxy cannot be re-keyed without a restart. | Re-key once no agent turn is streaming, allowing a proxy restart.",
20
+ EXPIRED: "410 final | The token, decision or grant has expired. | Request a new one.",
21
+ PAYLOAD_TOO_LARGE: "413 final | The body or artifact is over its size limit. | Send a smaller body, or split it.",
22
+ NOT_CONNECTED: "424 final | A required integration connection is missing. | Connect the integration the message names, then retry.",
23
+ QUOTA_EXCEEDED: "429 final | A plan or concurrency quota is reached. | Stop or delete resources, or raise the quota.",
24
+ RATE_LIMITED: "429 retry | Too many requests in the current window. | Wait for the Retry-After interval, then retry.",
25
+ RATE_LIMIT_EXCEEDED: "429 retry | Too many requests in the current window. | Wait for the Retry-After interval, then retry.",
26
+ INTERNAL_ERROR: "500 final | The server failed for a reason it did not classify. | Report the request id; the request itself did not cause it.",
27
+ OPERATION_FAILED: "500 final | A server-side operation failed. | Report the request id with the operation the message names.",
28
+ CONFIGURATION_ERROR: "500 final | The deployment is missing configuration or has an invalid value. | The operator sets the configuration key the message names.",
29
+ AGENT_EXECUTION_FAILED: "500 final | The agent run failed inside the sandbox. | Read the cause in the message; fix the prompt, model or credential it names.",
30
+ BACKEND_START_FAILED: "500 final | The agent backend cannot start, and a retry fails the same way. | Fix the configuration, credential or session the cause names.",
31
+ MESSAGE_RETRIEVAL_FAILED: "500 final | Message storage cannot serve this read. | Report the request id; the stored session needs repair.",
32
+ UNSUPPORTED: "501 final | This operation is not supported for this runtime, harness or driver. | Choose a runtime or option that supports it.",
33
+ UPSTREAM_ERROR: "502 retry | An upstream service failed or answered outside its contract. | Retry with backoff; report the request id if it persists.",
34
+ UNAVAILABLE: "503 retry | A dependency or capacity is temporarily unavailable. | Retry after the Retry-After interval.",
35
+ NOT_READY: "503 retry | The target is starting, restarting, recovering or draining. | Retry after the Retry-After interval.",
36
+ BACKEND_UNAVAILABLE: "503 retry | The agent backend did not answer. | Retry after the Retry-After interval.",
37
+ MESSAGE_RETRIEVAL_UNAVAILABLE: "503 retry | Message storage did not answer. | Retry after the Retry-After interval.",
38
+ TIMEOUT: "504 retry | The operation exceeded its deadline. | Retry; if it repeats, raise the timeout or split the work.",
39
+ KV_VALUE_TOO_LARGE: "413 final | A workflow KV value is over the per-value size cap. | Store a smaller value, or put the data in an artifact and keep its id in KV.",
40
+ KV_KEY_LIMIT: "409 final | The workflow has reached its KV key cap. | Delete keys the workflow no longer reads, then write again.",
41
+ KV_VERSION_CONFLICT: "409 final | Another writer changed the KV key since it was read. | Read the key again and retry the compare-and-swap against its current version.",
42
+ PRECONDITION_FAILED: "412 final | The stored version no longer matches the request's precondition. | Read the current version or etag and send it with the request.",
43
+ UNPROCESSABLE: "422 final | The input has nothing usable for this operation. | Record the history the message names, then ask again.",
44
+ BASE_IMAGE_NOT_FOUND: "400 final | The requested image does not exist. | Check the image name and tag, then create again.",
45
+ BASE_IMAGE_MISSING_BEFORE_CREATE: "400 final | The requested image does not exist; the host proved it before creating anything. | Check the image name and tag, then create again.",
46
+ UNSUPPORTED_EGRESS_POLICY: "400 final | This runtime cannot enforce the requested egress policy. | Choose a policy the runtime supports, or another runtime.",
47
+ UNSUPPORTED_FOR_RUNTIME: "400 final | The requested runtime cannot honour a create input. | Remove the input the message names, or choose another runtime.",
48
+ ROOT_USER_FORBIDDEN: "403 final | The sandbox may not run as root. | Run the workload as a non-root user.",
49
+ EGRESS_DOMAIN_NOT_ALLOWED: "403 final | The sandbox egress allowlist does not include this host. | Add the host to egressPolicy.allowDomains with box.egress.update.",
50
+ EGRESS_REQUEST_REFUSED: "403 final | The sandbox egress policy refused this request. | Read box.egress.denials() for the rule that refused it.",
51
+ NOT_MANAGED: "404 final | This host does not manage the named container. | Check the sandbox id; the platform resolves its host again on retry.",
52
+ SNAPSHOT_NOT_FOUND: "404 final | The snapshot does not exist or this account cannot see it. | List the sandbox snapshots and use an id from that list.",
53
+ BRANCH_PARENT_NOT_RUNNING: "409 final | The branch parent is not running. | Resume the parent sandbox, then branch again.",
54
+ CONTAINER_RESERVATION_CONFLICT: "409 retry | Another lifecycle operation holds this sandbox. | Wait for that operation to finish, then retry.",
55
+ CONTAINER_NETWORK_MISSING: "409 final | The stopped sandbox lost its network, so it cannot start in place; its files remain. | Resume the sandbox so the platform recreates it.",
56
+ EGRESS_DISABLED: "409 final | Egress is not enabled on this host. | Place the sandbox on a host with egress enabled.",
57
+ NATIVE_CAPTURE_UNAVAILABLE: "409 final | The host cannot prove the native capture image this create requires. | Retry on another host, or create without native capture.",
58
+ NETWORK_ISOLATION_REQUIRED: "409 final | The create requires its own network, and the host did not place one. | Retry on a host that supports network isolation.",
59
+ SESSION_CLAIM_MISMATCH: "409 final | The request names a session other than the one bound to this container. | Use the session id the container was created for.",
60
+ SNAPSHOT_NOT_SYNCED: "409 retry | The snapshot has not finished uploading. | Retry after the upload completes.",
61
+ WARM_CLAIM_REMOVED: "409 final | Another lifecycle operation removed the claimed warm sandbox. | Create the sandbox again.",
62
+ WORKSPACE_STORAGE_MISSING: "409 final | The stopped sandbox storage is gone or replaced, so the host refused to start it. | Restore the sandbox from a snapshot.",
63
+ RESTORE_QUOTA_EXCEEDED: "413 final | The snapshot is larger than the workspace quota. | Create with a larger disk, or restore a smaller snapshot.",
64
+ GIT_CLONE_REFUSED: "422 final | The repository refused the clone credential, or the credential cannot see it. | Fix the git credential or repository URL, then create again.",
65
+ BRANCH_FAILED: "500 final | The live branch of a running sandbox failed. | Report the request id; branch from a snapshot instead.",
66
+ CONTAINER_START_FAILED: "500 retry | The host started the sandbox and its runtime failed. | Retry; if it repeats, recreate the sandbox from a snapshot.",
67
+ GIT_CLONE_FAILED: "500 retry | Cloning the repository failed. | Retry; if it repeats, check that the repository URL is reachable.",
68
+ GIT_CLONE_TIMEOUT: "500 retry | Cloning the repository exceeded its deadline. | Retry, or clone a smaller repository.",
69
+ HOST_CLEANUP_UNCONFIRMED: "500 retry | The host cannot prove it removed what a failed create made. | Retry; the platform reconciles the earlier attempt first.",
70
+ HOST_RESERVATION_COMMIT_FAILED: "500 retry | The host could not record the create after cleaning it up. | Retry the create.",
71
+ MISSING_SIDECAR_AUTH_TOKEN: "500 final | The sandbox has no runtime auth token, so its host cannot route to it. | Recreate the sandbox.",
72
+ SNAPSHOT_RESTORE_FAILED: "500 final | Restoring the snapshot into the sandbox failed; no empty workspace was served. | Report the request id, or restore another snapshot.",
73
+ VM_START_FAILED: "500 retry | The microVM failed to start. | Retry; if it repeats, recreate the sandbox.",
74
+ SIDECAR_UPSTREAM_UNAVAILABLE: "502 retry | The host could not reach the sandbox runtime. | Retry; the request may have reached the sandbox.",
75
+ BRANCH_UFFD_UNAVAILABLE: "503 retry | The parent host cannot fork live memory now. | Retry, or branch from a snapshot.",
76
+ CAPACITY_EXHAUSTED: "503 retry | No host has room for this sandbox now. | Retry after the Retry-After interval.",
77
+ COMPLIANCE_CAPACITY_UNAVAILABLE: "503 retry | No verified compliance-scope host can take this sandbox now. | Retry after the Retry-After interval.",
78
+ FIRECRACKER_IMAGE_UNAVAILABLE: "503 final | No host carries the requested Firecracker image. | Choose an image the Firecracker hosts carry, or the Docker runtime.",
79
+ HOST_UNAVAILABLE: "503 retry | The host did not answer; the sandbox and its files remain. | Retry after the Retry-After interval.",
80
+ IN_BOX_DOCKER_UNAVAILABLE: "503 retry | Docker inside the sandbox is not available. | Retry, or create the sandbox with in-box Docker enabled.",
81
+ NO_IP: "503 retry | The sandbox has no network address yet. | Retry after the Retry-After interval.",
82
+ ROUTE_LOOKUP_FAILED: "503 retry | The host could not look up the sandbox route. | Retry after the Retry-After interval.",
83
+ SNAPSHOT_STORAGE_UNAVAILABLE: "503 retry | Snapshot storage did not answer. | Retry after the Retry-After interval.",
84
+ THIN_POOL_HEADROOM: "503 final | The sandbox host cannot grow this workspace. | Recreate the sandbox from a snapshot so it lands on another host.",
85
+ WARM_RECONNECT_MISS: "503 retry | The warm restore path is unavailable. | Retry; the platform restores through the cold path.",
86
+ WORKSPACE_IMAGE_BUILDER_BUSY: "503 retry | The workspace image builder is busy. | Retry after the Retry-After interval.",
87
+ WORKSPACE_IMAGE_BUILDER_UNAVAILABLE: "503 retry | The workspace image builder is unavailable. | Retry after the Retry-After interval.",
88
+ SIDECAR_HEALTH_TIMEOUT: "504 retry | The sandbox runtime did not become ready within its boot attempts. | Retry; if it repeats, recreate the sandbox.",
89
+ rate_limit_error: "429 retry | The model provider rate-limited this turn. | Wait for the provider's window, then send the turn again.",
90
+ provider_quota_exhausted: "429 final | The harness subscription quota is spent until its resetAt. | Wait until resetAt, or send the turn with another credential.",
91
+ native_api_error: "502 final | The harness's model API refused the turn; the message carries its answer. | Fix what the provider's answer names, then send the turn again.",
92
+ empty_visible_output: "502 retry | The turn ended without visible output from the model. | Send the turn again; if it repeats, change the model or the prompt.",
93
+ session_rehydration_failed: "409 final | The session's stored transcript cannot be replayed into a new harness session. | Start a new session; this one cannot resume.",
94
+ SESSION_DIED: "500 final | The harness session process died during the turn; the message says why. | Send the turn again in a new session.",
95
+ MEMORY_LIMIT_KILLED: "500 final | The harness ran out of memory and was killed. | Give the sandbox more memory or split the work, then send the turn again.",
96
+ PROCESS_OUTPUT_GAP: "410 final | A process log reader fell behind the spool, so output was evicted before it was read. | Read faster or redirect output to a file; missedBytes says how much.",
97
+ SESSION_CREDENTIAL_NOT_RETAINED: "409 final | A restored session's model credential is not kept in session storage. | Send the model credential with the turn.",
98
+ interaction_kind_unsupported: "400 final | The turn asks for an interaction kind this harness cannot originate. | Drop the interaction toggle or choose a harness that supports it.",
99
+ invalid_attachment: "400 final | An attachment has no url or path, or content the harness cannot take. | Fix the attachment the message names, then send the turn again.",
100
+ PROFILE_NOT_CACHED: "409 final | The turn names a profile by hash that this runtime does not hold. | Send the full profile object instead of its hash.",
101
+ MODEL_CALL_LIMIT_REACHED: "400 final | The bounded turn needed more model calls than it allowed. | Raise the turn's model-call limit or split the task.",
102
+ MODEL_CALL_LIMIT_UNSUPPORTED: "400 final | This harness's model calls cannot be counted, so a call limit cannot hold. | Drop the limit or choose a harness that supports it.",
103
+ TOOL_DISABLED_TURN_UNSUPPORTED: "400 final | This harness cannot run a turn with its tools disabled. | Allow tools, or choose a harness that supports tool-free turns.",
104
+ EXECUTION_TTL_EXPIRED: "504 final | The execution ran past its time limit and was stopped. | Raise ttlMs up to the deployment ceiling, or split the work.",
105
+ EXECUTION_TTL_EXCEEDS_LIMIT: "400 final | The requested execution time limit is above this deployment's ceiling. | Send a ttlMs at or below the ceiling the message names.",
106
+ MESSAGE_ADMISSION_EXPIRED: "409 final | The message's admission deadline passed before the harness was invoked. | Dispatch the message again with a new deadline.",
107
+ BACKEND_HARNESS_CONFLICT: "400 final | Running the turn would run a harness other than the one the caller named. | Name one harness for the session and its turns.",
108
+ HARNESS_MODEL_UNSUPPORTED: "400 final | The named harness cannot run the named model. | Choose a model the harness supports, or another harness.",
109
+ HARNESS_RUNTIME_UNAVAILABLE: "503 retry | The harness's local daemon exited before it could serve the session. | Retry after the Retry-After interval; the message carries the daemon's reason.",
110
+ GPU_PROVIDER_NOT_CONFIGURED: "503 final | No GPU provider is configured for this deployment. | Create the sandbox without a GPU, or ask the operator to configure a provider.",
111
+ COMPLIANCE_NOT_ENTITLED: "403 final | The account is not entitled to the requested compliance placement. | Enable the compliance plan for the account, or create without it.",
112
+ COMPLIANCE_CELL_UNAVAILABLE: "503 final | No cell serves the requested compliance placement. | Choose another region or compliance mode, or ask the operator.",
113
+ NETWORK_ERROR: "503 retry | The request did not reach the platform, or its answer was lost. | Check connectivity, then retry; a keyed create joins its earlier attempt.",
114
+ STREAM_INTERRUPTED: "503 retry | The execution's stream ended without its terminal event; its outcome is unknown. | Rejoin with its executionId and lastEventId, or read the session status.",
115
+ PUBLIC_PROFILE_PIN_REFUSED: "400 final | The runtime refused the pinned public profile revision this turn named. | Send the turn with the revision and digest the profile has now.",
116
+ model_credential_refused: "403 final | The account owner refused the model credential for this seat. | Reconnect or replace that seat's credential, or choose another seat.",
117
+ TEMPLATE_PUBLICATION_WAIT_INTERRUPTED: "504 retry | The SDK stopped waiting for a template publication; the job keeps running. | Resume the wait with resumeJobId instead of publishing again."
118
+ };
119
+ function catalogEntry(code) {
120
+ const [head = "", cause = "", nextStep = ""] = ERROR_CATALOG[code].split(" | ");
121
+ return {
122
+ code,
123
+ status: Number(head.slice(0, 3)),
124
+ retryable: head.endsWith("retry"),
125
+ cause,
126
+ nextStep,
127
+ docs: `https://sandbox.tangle.tools/docs/errors#${code.toLowerCase()}`
128
+ };
129
+ }
130
+ //#endregion
131
+ //#region src/error-classes.ts
132
+ /**
133
+ * Sandbox SDK Errors
134
+ *
135
+ * One error class, `SandboxError`. Its `code` is the catalog's `ErrorCode`
136
+ * (the runtime contracts' error catalog), and `status`,
137
+ * `retryable` and `nextStep` come from that code's catalog entry.
138
+ */
139
+ const STATUS_CODE = {
140
+ 400: "VALIDATION_ERROR",
141
+ 401: "UNAUTHORIZED",
142
+ 402: "PAYMENT_REQUIRED",
143
+ 403: "FORBIDDEN",
144
+ 404: "NOT_FOUND",
145
+ 408: "TIMEOUT",
146
+ 409: "INVALID_STATE",
147
+ 410: "EXPIRED",
148
+ 413: "PAYLOAD_TOO_LARGE",
149
+ 422: "VALIDATION_ERROR",
150
+ 424: "NOT_CONNECTED",
151
+ 425: "NOT_READY",
152
+ 429: "RATE_LIMITED",
153
+ 501: "UNSUPPORTED",
154
+ 502: "UPSTREAM_ERROR",
155
+ 503: "UNAVAILABLE",
156
+ 504: "TIMEOUT",
157
+ 524: "TIMEOUT"
158
+ };
159
+ /** Cluster of a wire code the catalog does not list yet, by its name (design note, section 2). */
160
+ const NAME_CODE = [
161
+ [/QUOTA_EXCEEDED$|CREDIT_EXHAUSTED$/, "QUOTA_EXCEEDED"],
162
+ [/RATE_LIMIT/, "RATE_LIMITED"],
163
+ [/_IN_PROGRESS$|_BUSY$|_PENDING$|_RECONCILING$|_CONTENDED$/, "IN_PROGRESS"],
164
+ [/_NOT_READY$|_RESTARTING$|_STARTING$/, "NOT_READY"],
165
+ [/_DISABLED$|_NOT_ENABLED$/, "FEATURE_DISABLED"],
166
+ [/_NOT_CONFIGURED$|CONFIGURATION/, "CONFIGURATION_ERROR"],
167
+ [/_NOT_FOUND$/, "NOT_FOUND"],
168
+ [/_CONFLICT$/, "CONFLICT"],
169
+ [/PARTIAL_FAILURE$/, "OPERATION_FAILED"],
170
+ [/_TIMEOUT$|_TIMED_OUT$/, "TIMEOUT"],
171
+ [/^TRANSPORT$/, "NETWORK_ERROR"],
172
+ [/UNSUPPORTED$|NOT_IMPLEMENTED$/, "UNSUPPORTED"]
173
+ ];
174
+ /**
175
+ * The catalog code for a wire code: the code itself when the catalog lists
176
+ * it, else its cluster by name, else by HTTP status, else `fallback`.
177
+ */
178
+ function catalogCode(wireCode, status, fallback = "INTERNAL_ERROR") {
179
+ if (Object.hasOwn(ERROR_CATALOG, wireCode)) return wireCode;
180
+ return NAME_CODE.find(([pattern]) => pattern.test(wireCode))?.[1] ?? (status === void 0 ? void 0 : STATUS_CODE[status]) ?? fallback;
181
+ }
182
+ /**
183
+ * The one SDK error. `code` is the catalog code callers branch on; `wireCode`
184
+ * is the code the server sent (it differs while servers still send
185
+ * pre-catalog codes). `retryable` is the catalog's verdict on whether a later
186
+ * retry can succeed, and `nextStep` is what the caller does about it.
187
+ */
188
+ var SandboxError = class extends Error {
189
+ code;
190
+ wireCode;
191
+ /** HTTP status the server answered, else the catalog status of `code`. */
192
+ status;
193
+ retryable;
194
+ nextStep;
195
+ docs;
196
+ /** Best-effort origin of the failing request */
197
+ origin;
198
+ /** Request path or endpoint when known */
199
+ endpoint;
200
+ /** Retry-after duration in ms when surfaced by the upstream */
201
+ retryAfterMs;
202
+ sidecarVersion;
203
+ containerImage;
204
+ /**
205
+ * Seconds the cell measured it needs before it can serve this request (a
206
+ * capacity refusal on create). A real wait to show a human or a scheduler,
207
+ * unlike `retryAfterMs`, which paces the SDK's own retry.
208
+ */
209
+ etaSeconds;
210
+ /** How long the operation ran before this error, when the thrower measured it; never `timeoutMs`. */
211
+ elapsedMs;
212
+ /**
213
+ * On create's top-level error, proves this call's attempts admitted no
214
+ * sandbox. Absence is unknown.
215
+ */
216
+ createFailureDisposition;
217
+ /** The cell kept its last free slots for customers and refused this internal create; create() ends on it. */
218
+ capacityHold;
219
+ resourceType;
220
+ resourceId;
221
+ /** Quota reason: `CONCURRENT_LIMIT`, `CREDIT_EXHAUSTED`, `EGRESS_LIMIT`, or `rate_limit`. */
222
+ quotaType;
223
+ current;
224
+ limit;
225
+ capability;
226
+ /** Every supported GPU provider and the orchestrator variables it needs. */
227
+ providers;
228
+ /** Per-resource failures of a multi-resource operation. */
229
+ failures;
230
+ /** Allocation a create returned before its readiness failed. */
231
+ allocationId;
232
+ idempotencyKey;
233
+ createReceipt;
234
+ /** Field-level validation errors */
235
+ fields;
236
+ path;
237
+ currentState;
238
+ requiredState;
239
+ edgeStatus;
240
+ expectedHash;
241
+ currentHash;
242
+ currentMtime;
243
+ /** The budgeted key a `KEY_BUDGET_EXHAUSTED` refusal names, and its USD budget, spend and reserve. */
244
+ keyId;
245
+ budgetUsd;
246
+ spentUsd;
247
+ reservedUsd;
248
+ /** The env keys the next resume must carry in `ResumeOptions.env`. */
249
+ missingEnvKeys;
250
+ /** Children the parent's host admitted when a branch fan-out was refused. */
251
+ maxChildren;
252
+ requestedChildren;
253
+ /** The operation's configured budget, in milliseconds. NOT how long it ran. */
254
+ timeoutMs;
255
+ executionId;
256
+ sessionId;
257
+ /** The last event id delivered to the caller; a rejoin resumes after it. */
258
+ lastEventId;
259
+ reason;
260
+ lastReplayStatus;
261
+ lastExecutionStatus;
262
+ /** A terminal socket that never reached OPEN. */
263
+ beforeOpen;
264
+ constructor(message, metadata = {}) {
265
+ const { code, status, cause, ...fields } = metadata;
266
+ super(message, cause === void 0 ? void 0 : { cause });
267
+ const fallback = ALIAS_CODE.get(new.target) ?? "INTERNAL_ERROR";
268
+ this.wireCode = code ?? (status === void 0 ? void 0 : STATUS_CODE[status]) ?? fallback;
269
+ this.code = catalogCode(this.wireCode, status, fallback);
270
+ const entry = catalogEntry(this.code);
271
+ this.status = status ?? entry.status;
272
+ this.retryable = entry.retryable;
273
+ this.nextStep = entry.nextStep;
274
+ this.docs = entry.docs;
275
+ Object.assign(this, fields);
276
+ this.name = new.target.name;
277
+ }
278
+ };
279
+ /** @deprecated Removed in 0.62; check `code === "UNAUTHORIZED"`. */
280
+ var AuthError = class extends SandboxError {};
281
+ /** @deprecated Removed in 0.62; check `code === "NOT_FOUND"`. */
282
+ var NotFoundError = class extends SandboxError {};
283
+ /** @deprecated Removed in 0.62; check `code === "QUOTA_EXCEEDED"` or `"RATE_LIMITED"`. */
284
+ var QuotaError = class extends SandboxError {};
285
+ /** @deprecated Removed in 0.62; check `code === "UNSUPPORTED"` or `"FEATURE_DISABLED"`. */
286
+ var CapabilityError = class extends SandboxError {};
287
+ /** @deprecated Removed in 0.62; check `wireCode === "GPU_PROVIDER_NOT_CONFIGURED"`. */
288
+ var GpuProviderNotConfiguredError = class extends CapabilityError {};
289
+ /** @deprecated Removed in 0.62; check `wireCode` for `COMPLIANCE_NOT_ENTITLED` or `COMPLIANCE_CELL_UNAVAILABLE`. */
290
+ var CompliancePlacementError = class extends SandboxError {};
291
+ /** @deprecated Removed in 0.62; read `failures`. */
292
+ var PartialFailureError = class extends SandboxError {};
293
+ /** @deprecated Removed in 0.62; check `code === "VALIDATION_ERROR"`. */
294
+ var ValidationError = class extends SandboxError {};
295
+ /** @deprecated Removed in 0.62; check `wireCode` and read `path`. */
296
+ var ProfileFileMountPathError = class extends SandboxError {};
297
+ /** @deprecated Removed in 0.62; check `code === "INVALID_STATE"`. */
298
+ var StateError = class extends SandboxError {};
299
+ /** @deprecated Removed in 0.62; check `wireCode === "EDGE_NOT_READY"`. */
300
+ var EdgeNotReadyError = class extends SandboxError {};
301
+ /** @deprecated Removed in 0.62; check `wireCode === "FILE_WRITE_CONFLICT"`. */
302
+ var FileWriteConflictError = class extends SandboxError {};
303
+ /** @deprecated Removed in 0.62; check `wireCode === "KEY_BUDGET_EXHAUSTED"`. */
304
+ var KeyBudgetExhaustedError = class extends SandboxError {};
305
+ /** @deprecated Removed in 0.62; check `code === "EGRESS_PROXY_RECOVERY_REQUIRED"`. */
306
+ var EgressProxyRecoveryError = class extends SandboxError {};
307
+ /** @deprecated Removed in 0.62; check `wireCode === "RESUME_ENV_REQUIRED"` and read `missingEnvKeys`. */
308
+ var ResumeEnvRequiredError = class extends SandboxError {};
309
+ /** @deprecated Removed in 0.62; check `wireCode === "BRANCH_FANOUT_EXCEEDS_HOST"` and read `maxChildren`. */
310
+ var BranchFanoutExceedsHostError = class extends SandboxError {};
311
+ /** @deprecated Removed in 0.62; check `code === "TIMEOUT"`. */
312
+ var TimeoutError = class extends SandboxError {};
313
+ /** @deprecated Removed in 0.62; check `code === "NETWORK_ERROR"`. */
314
+ var NetworkError = class extends SandboxError {};
315
+ /**
316
+ * The stream of an admitted execution ended without its terminal event and
317
+ * the SDK could not rejoin it. The outcome is UNKNOWN, never a failure
318
+ * verdict: rejoin with `streamPrompt(message, { executionId, lastEventId,
319
+ * sessionId })`, or read the session status.
320
+ * @deprecated Removed in 0.62; check `code === "STREAM_INTERRUPTED"`.
321
+ */
322
+ var StreamInterruptedError = class extends SandboxError {};
323
+ /** @deprecated Removed in 0.62; check `status >= 500`. */
324
+ var ServerError = class extends SandboxError {};
325
+ /** Each alias, its default code, and the wire codes the parse point builds it for. */
326
+ const ALIASES = [
327
+ [AuthError, "UNAUTHORIZED"],
328
+ [NotFoundError, "NOT_FOUND"],
329
+ [QuotaError, "QUOTA_EXCEEDED"],
330
+ [
331
+ CapabilityError,
332
+ "UNSUPPORTED",
333
+ "CAPABILITY_NOT_ENABLED",
334
+ "CAPABILITY_UNSUPPORTED",
335
+ "UNSUPPORTED_CAPABILITY",
336
+ "FLEET_SHARED_WORKSPACE_UNSUPPORTED",
337
+ "SHARED_WORKSPACE_UNSUPPORTED"
338
+ ],
339
+ [
340
+ GpuProviderNotConfiguredError,
341
+ "CONFIGURATION_ERROR",
342
+ "GPU_PROVIDER_NOT_CONFIGURED",
343
+ "GPU_PROVIDERS_NOT_CONFIGURED"
344
+ ],
345
+ [
346
+ CompliancePlacementError,
347
+ "FORBIDDEN",
348
+ "COMPLIANCE_NOT_ENTITLED",
349
+ "COMPLIANCE_CELL_UNAVAILABLE"
350
+ ],
351
+ [
352
+ PartialFailureError,
353
+ "OPERATION_FAILED",
354
+ "PARTIAL_FAILURE",
355
+ "FLEET_PARTIAL_FAILURE",
356
+ "FLEET_DISPATCH_PARTIAL_FAILURE",
357
+ "FLEET_DEPROVISION_FAILED"
358
+ ],
359
+ [ValidationError, "VALIDATION_ERROR"],
360
+ [
361
+ ProfileFileMountPathError,
362
+ "VALIDATION_ERROR",
363
+ "PROFILE_FILE_MOUNT_OUTSIDE_ROOTS"
364
+ ],
365
+ [StateError, "INVALID_STATE"],
366
+ [
367
+ EdgeNotReadyError,
368
+ "NOT_READY",
369
+ "EDGE_NOT_READY"
370
+ ],
371
+ [
372
+ FileWriteConflictError,
373
+ "CONFLICT",
374
+ "FILE_WRITE_CONFLICT"
375
+ ],
376
+ [
377
+ KeyBudgetExhaustedError,
378
+ "PAYMENT_REQUIRED",
379
+ "KEY_BUDGET_EXHAUSTED"
380
+ ],
381
+ [
382
+ EgressProxyRecoveryError,
383
+ "EGRESS_PROXY_RECOVERY_REQUIRED",
384
+ "EGRESS_PROXY_RECOVERY_REQUIRED"
385
+ ],
386
+ [
387
+ ResumeEnvRequiredError,
388
+ "INVALID_STATE",
389
+ "RESUME_ENV_REQUIRED"
390
+ ],
391
+ [
392
+ BranchFanoutExceedsHostError,
393
+ "QUOTA_EXCEEDED",
394
+ "BRANCH_FANOUT_EXCEEDS_HOST"
395
+ ],
396
+ [TimeoutError, "TIMEOUT"],
397
+ [NetworkError, "NETWORK_ERROR"],
398
+ [StreamInterruptedError, "STREAM_INTERRUPTED"],
399
+ [ServerError, "INTERNAL_ERROR"]
400
+ ];
401
+ const ALIAS_CODE = new Map(ALIASES.map(([alias, code]) => [alias, code]));
402
+ //#endregion
403
+ //#region src/errors.ts
404
+ /**
405
+ * Sandbox SDK Errors
406
+ *
407
+ * The one parse point from an error response to a `SandboxError`.
408
+ */
409
+ /**
410
+ * The one retry rule: retry a failure when the catalog marks its code
411
+ * retryable. A loop adds only its own deliberate exception.
412
+ */
413
+ function retryWhen(error) {
414
+ return error instanceof SandboxError && error.retryable;
415
+ }
416
+ /** A file write or part PUT to resend: retryable, and answered 429 or 5xx, or timed out. */
417
+ function isTransientWrite(error) {
418
+ return retryWhen(error) && (error.status >= 500 || error.status === 429 || error instanceof TimeoutError);
419
+ }
420
+ const ALIAS_BY_WIRE_CODE = new Map(ALIASES.flatMap(([alias, , ...wireCodes]) => wireCodes.map((code) => [code, alias])));
421
+ const ALIAS_BY_STATUS = {
422
+ 400: ValidationError,
423
+ 401: AuthError,
424
+ 404: NotFoundError,
425
+ 408: TimeoutError,
426
+ 409: StateError,
427
+ 429: QuotaError
428
+ };
429
+ /** Detail fields a refusal body may carry at its top level, in `error`, or in `details`. */
430
+ const WIRE_FIELDS = [
431
+ "resourceType",
432
+ "resourceId",
433
+ "quotaType",
434
+ "current",
435
+ "limit",
436
+ "capability",
437
+ "providers",
438
+ "fields",
439
+ "path",
440
+ "currentState",
441
+ "requiredState",
442
+ "expectedHash",
443
+ "currentHash",
444
+ "currentMtime",
445
+ "keyId",
446
+ "budgetUsd",
447
+ "spentUsd",
448
+ "reservedUsd",
449
+ "missingEnvKeys",
450
+ "maxChildren",
451
+ "requestedChildren",
452
+ "timeoutMs"
453
+ ];
454
+ function wireFields(...sources) {
455
+ const fields = {};
456
+ for (const source of sources) {
457
+ if (!isFailureDetail(source)) continue;
458
+ for (const key of WIRE_FIELDS) fields[key] ??= source[key];
459
+ }
460
+ return fields;
461
+ }
462
+ function parseRetryAfterMs(rawValue, data) {
463
+ if (typeof data.retryAfterMs === "number" && Number.isFinite(data.retryAfterMs)) return Math.max(0, data.retryAfterMs);
464
+ return parseSandboxRetryAfterHeader(rawValue);
465
+ }
466
+ /**
467
+ * The server's published wait, in seconds. Only a positive finite number is
468
+ * a wait; anything else is absent. Never derived from `Retry-After` — that
469
+ * header is a pacing hint every refusal carries, while `etaSeconds` is a
470
+ * measurement the cell only publishes when it has one.
471
+ */
472
+ function parseEtaSeconds(data) {
473
+ const raw = data.etaSeconds;
474
+ if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return;
475
+ return raw;
476
+ }
477
+ /**
478
+ * What a capacity refusal publishes: the cell's measured wait, and whether its
479
+ * customer floor refused an internal create (SandboxError.capacityHold).
480
+ */
481
+ function capacityRefusalMetadata(data) {
482
+ return {
483
+ etaSeconds: parseEtaSeconds(data),
484
+ capacityHold: data.code === "CAPACITY_EXHAUSTED" && data.reason === "customer_floor" ? "customer_floor" : void 0
485
+ };
486
+ }
487
+ function inferOrigin(headers, context) {
488
+ const derivedPath = context?.path ?? headers?.get("x-tangle-request-path") ?? void 0;
489
+ if (!headers) return context?.path ? "sandbox-api" : void 0;
490
+ if (headers.has("x-sidecar-version") || headers.has("x-sidecar-image") || headers.has("x-sidecar-image-tag")) return "sidecar";
491
+ if (headers.has("x-orchestrator-version")) return "control-plane";
492
+ if (derivedPath?.startsWith("/v1/")) return "sandbox-api";
493
+ if (derivedPath) {
494
+ if (derivedPath.startsWith("/projects") || derivedPath.startsWith("/sidecars") || derivedPath.startsWith("/instances")) return "control-plane";
495
+ return "runtime";
496
+ }
497
+ return "unknown";
498
+ }
499
+ const ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
500
+ function asErrorCode(value) {
501
+ return typeof value === "string" && ERROR_CODE_PATTERN.test(value) ? value : void 0;
502
+ }
503
+ function isFailureDetail(value) {
504
+ return typeof value === "object" && value !== null && !Array.isArray(value);
505
+ }
506
+ function readFailures(data, errorObj) {
507
+ if (Array.isArray(data.failures)) return data.failures.filter(isFailureDetail);
508
+ if (Array.isArray(data.results)) {
509
+ const failures = data.results.filter((result) => typeof result === "object" && result !== null && result.ok === false);
510
+ if (failures.length > 0) return failures.filter(isFailureDetail);
511
+ }
512
+ if (typeof errorObj === "object" && errorObj !== null && Array.isArray(errorObj.failures)) return errorObj.failures.filter(isFailureDetail);
513
+ }
514
+ /**
515
+ * Parse an error response from the API.
516
+ * @param status - HTTP status code
517
+ * @param body - Response body text
518
+ * @param context - Optional request context for better error messages
519
+ */
520
+ function parseErrorResponse(status, body, context, headers) {
521
+ let data;
522
+ try {
523
+ data = JSON.parse(body);
524
+ } catch {
525
+ data = { message: body };
526
+ }
527
+ const errorObj = data.error;
528
+ const nestedMessage = typeof errorObj === "object" && errorObj !== null ? errorObj.message : void 0;
529
+ const nestedCode = typeof errorObj === "object" && errorObj !== null ? typeof errorObj.code === "string" ? asErrorCode(errorObj.code) : void 0 : void 0;
530
+ const baseMessage = data.message || nestedMessage || (typeof errorObj === "string" ? errorObj : void 0) || body || "Unknown error";
531
+ const details = typeof data.details === "string" && data.details.trim().length > 0 ? data.details.trim() : void 0;
532
+ const shouldAppendDetails = !!details && details !== baseMessage && (baseMessage === "Unknown error" || /^failed\b/i.test(baseMessage) || /^provision failed\b/i.test(baseMessage) || /^deprovision failed\b/i.test(baseMessage));
533
+ const rawReason = typeof data.reason === "string" ? data.reason : typeof errorObj === "object" && errorObj !== null ? errorObj.reason : void 0;
534
+ const reason = typeof rawReason === "string" && rawReason.trim().length > 0 ? rawReason.trim() : void 0;
535
+ const code = (typeof data.code === "string" ? asErrorCode(data.code) : void 0) ?? nestedCode;
536
+ const rawLog = typeof errorObj === "object" && errorObj !== null ? errorObj.log : void 0;
537
+ const logTail = typeof rawLog === "string" && rawLog.trim().length > 0 ? rawLog.trim() : void 0;
538
+ const prefix = context?.method || context?.path ? `${context.method ?? "REQUEST"} ${context.path ?? ""}: ` : "";
539
+ const composedMessage = shouldAppendDetails ? `${baseMessage}: ${details}` : baseMessage;
540
+ const messageWithReason = `${prefix}${reason && !composedMessage.includes(reason) ? `${composedMessage}: ${reason}` : composedMessage}`;
541
+ const message = logTail && !messageWithReason.includes(logTail) ? `${messageWithReason}\n${logTail}` : messageWithReason;
542
+ const metadata = {
543
+ origin: inferOrigin(headers, context),
544
+ endpoint: context?.path ?? headers?.get("x-tangle-request-path") ?? void 0,
545
+ retryAfterMs: parseRetryAfterMs(headers?.get("retry-after") ?? void 0, data),
546
+ ...capacityRefusalMetadata(data),
547
+ sidecarVersion: headers?.get("x-sidecar-version") ?? void 0,
548
+ containerImage: headers?.get("x-sidecar-image") ?? headers?.get("x-sidecar-image-tag") ?? void 0,
549
+ createFailureDisposition: context?.allPreviousCreateAttemptsRefused === true && (context.method ?? headers?.get("x-tangle-request-method")) === "POST" && (context.path ?? headers?.get("x-tangle-request-path")) === "/v1/sandboxes" && status === 429 && (code === "RATE_LIMIT_EXCEEDED" || code === "QUOTA_EXCEEDED" || code === "PLATFORM_RATE_LIMITED") ? "not-admitted" : void 0
550
+ };
551
+ const source = wireFields(data, errorObj, data.details);
552
+ const Alias = ALIAS_BY_WIRE_CODE.get(code ?? "") ?? (code && catalogCode(code) === "QUOTA_EXCEEDED" ? QuotaError : void 0) ?? ALIAS_BY_STATUS[status] ?? (status >= 500 && status !== 501 ? ServerError : SandboxError);
553
+ return new Alias(message, {
554
+ ...source,
555
+ ...metadata,
556
+ code,
557
+ status,
558
+ failures: readFailures(data, errorObj),
559
+ quotaType: Alias === QuotaError ? asErrorCode(reason) ?? source.quotaType ?? "rate_limit" : void 0,
560
+ currentState: source.currentState ?? (Alias === StateError ? "unknown" : void 0)
561
+ });
562
+ }
563
+ /** Read a failed HTTP response without changing its typed error or retry metadata. */
564
+ async function parseResponseError(response) {
565
+ const body = await response.text();
566
+ return parseErrorResponse(response.status, body, void 0, response.headers);
567
+ }
568
+ /** Read a checked response once; callers interpret its JSON wire value. */
569
+ function readResponseJson(response) {
570
+ if (response.ok) return response.json();
571
+ return parseResponseError(response).then((error) => {
572
+ throw error;
573
+ });
574
+ }
575
+ /**
576
+ * A terminal protocol `error` frame (`wireCode` is its protocol code, e.g.
577
+ * `INIT_FAILED`) or a socket fault (`TRANSPORT`). `beforeOpen` is true when
578
+ * the socket never reached OPEN, so no PTY work started on this dial.
579
+ * @deprecated Removed in 0.62; check `code`.
580
+ */
581
+ var TerminalStreamError = class extends SandboxError {};
582
+ //#endregion
583
+ export { ServerError as C, ValidationError as D, TimeoutError as E, SandboxError as S, StreamInterruptedError as T, NotFoundError as _, readResponseJson as a, QuotaError as b, BranchFanoutExceedsHostError as c, EdgeNotReadyError as d, EgressProxyRecoveryError as f, NetworkError as g, KeyBudgetExhaustedError as h, parseResponseError as i, CapabilityError as l, GpuProviderNotConfiguredError as m, isTransientWrite as n, retryWhen as o, FileWriteConflictError as p, parseErrorResponse as r, AuthError as s, TerminalStreamError as t, CompliancePlacementError as u, PartialFailureError as v, StateError as w, ResumeEnvRequiredError as x, ProfileFileMountPathError as y };
@@ -1,5 +1,5 @@
1
1
  import { n as bytesToHex, t as sha256 } from "./sha2-vu4U-x2L.js";
2
- import { E as ValidationError } from "./errors-CaX0a5Ry.js";
2
+ import { D as ValidationError } from "./errors-Mzq10WZq.js";
3
3
  //#region src/lib/file-download.ts
4
4
  function downloadBounds(options) {
5
5
  for (const [name, value] of Object.entries({
@@ -1,9 +1,9 @@
1
- import { $ as ProxySecretReceipt, At as SandboxCreateReceipt, B as InteractionAcknowledgement, C as AgentInteractiveSessionAttach, D as AgentInteractiveSessionPromptAcknowledgement, E as AgentInteractiveSessionControlClaimRequest, F as TerminalOutputEvent, H as InteractionResponseCommand, I as TerminalReplayWindow, M as AgentInteractiveSessionStopCommand, N as AgentInteractiveTerminalSession, O as AgentInteractiveSessionPromptCommand, R as AgentRunCancellationAcknowledgement, S as AgentInteractiveSessionStart, T as AgentInteractiveSessionControlClaimAcknowledgement, U as AgentProfile, V as InteractionRequest, bt as SandboxError, et as InteractionData, g as TerminalReadyInfo, i as TerminalStreamHandlers, j as AgentInteractiveSessionStopAcknowledgement, k as AgentInteractiveSessionRef, l as MintScopedTokenOptions, o as TerminalStreamReconnectAuthority, q as AgentProfileFileMount, u as ScopedToken, w as AgentInteractiveSessionControlClaim, z as AgentRunCancellationRequest } from "./terminal-stream-types-1YKRrkZB.js";
2
- import { $a as RawEvidenceBoxDirectoryExport, $r as ForkCounts, An as SandboxShape, Ar as DriverInfo, Bi as CreateSessionOptions, C as WorkspaceOperationLookup, Ci as IntelligenceReportWindow, Cn as TerminalStream, D as ProvisionResult, Di as SandboxEvent, E as ProvisionEvent, Ei as PromptResult, Fi as CommitTaskSessionOptions, Fn as EgressManager, G as GitBranch, Ga as ExecResult, Gi as ListMessagesOptions, Ha as CodeExecutionResult, Hi as DispatchPromptOptions, Ia as WorkspaceImagePublishInput, J as GitStatus, Ja as SandboxEnvRecoveryView, Ji as SendSessionMessageRequest, K as GitCommit, Ka as WriteFileRequest, Ki as PublicProfileConflict, Kt as SandboxFleetTraceBundle, La as WorkspaceImagePublishResult, Li as CompletedTurnResult, Ln as NetworkManager, Lr as GpuLeaseManager, Mi as SandboxTraceOptions, Mn as SandboxResourceUsage, Mr as GpuLease, N as WaitForOptions, Nn as SandboxRuntimeCapabilities, Pi as TurnBackendConfig, Qi as SessionExecutionInfo, Qr as BranchOptions, Ri as ConversationTurnOptions, S as StopOptions, Sn as TeePublicKeyResponse, Ti as PromptOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, Ua as CodeLanguage, Ui as DispatchedSession, Ur as CodeExecutionOptions, Vi as CreateTaskSessionOptions, Wi as DriveTurnOptions, Xa as RawEvidenceArchiveManifest, Xr as HttpClient, Yi as SentSessionMessage, Zi as SessionEventStreamOptions, _ as SnapshotInfo, _r as SearchMatch, aa as SessionMessage, ai as WaitForRolloutOptions, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, c as SandboxDeleteOptions, ca as SessionResultOptions, co as InteractionResolutionAcknowledgement, cr as FileWriteResult, d as SandboxOperationKind, ei as ForkIdempotency, eo as RawEvidenceBoxExportOptions, f as SandboxOperationState, fa as TaskSessionInfo, ga as BackendConfig, gn as StartupDiagnostics, gr as WriteManyOptions, hi as DurablePlanDecisionResult, hn as SandboxTerminals, hr as WriteManyFile, ia as SessionListOptions, ii as RolloutStartResult, in as SandboxConnection, k as ResumeOptions, ki as SandboxTraceBundle, kn as SandboxStatus, la as TaskSessionChanges, ln as SandboxRuntimeHealth, m as SnapshotDeleteAcknowledgement, ma as TurnDriveResult, mi as DurablePlanDecisionOptions, mr as WriteFileOptions, na as SessionInfo, ni as Rollout, nn as SSHCommandDescriptor, no as RawEvidenceExportOptions, nr as FileSystem, o as RestoreSnapshotOptions, oa as SessionMessageAdmission, on as SandboxPortBinding, oo as RawEvidenceUnavailable, pi as DurablePlan, q as GitDiff, qa as SandboxEnvRecovery, qi as SendSessionMessageOptions, ra as SessionInterruptOptions, ri as RolloutOptions, rn as SSHCredentials, s as SandboxDeleteAcknowledgement, ta as SessionForkOptions, ti as ForkLookupOptions, to as RawEvidenceDirectoryExport, u as SandboxOperationInfo, ua as TaskSessionCommitResult, un as SandboxTerminalAttachOptions, v as SnapshotOptions, va as BackendManager, vi as EventStreamOptions, vn as TeeAttestationOptions, vr as SearchOptions, wi as PromptInputPart, x as SnapshotResult, xi as IntelligenceReportCompareTo, y as SnapshotProvenance, yi as IntelligenceReport, yr as ExecOptions, z as ProcessManager, zi as ConversationTurnResult } from "./types-B-UsXSi6.js";
1
+ import { $ as ProxySecretReceipt, At as SandboxCreateReceipt, B as InteractionAcknowledgement, C as AgentInteractiveSessionAttach, D as AgentInteractiveSessionPromptAcknowledgement, E as AgentInteractiveSessionControlClaimRequest, F as TerminalOutputEvent, H as InteractionResponseCommand, I as TerminalReplayWindow, M as AgentInteractiveSessionStopCommand, N as AgentInteractiveTerminalSession, O as AgentInteractiveSessionPromptCommand, R as AgentRunCancellationAcknowledgement, S as AgentInteractiveSessionStart, T as AgentInteractiveSessionControlClaimAcknowledgement, U as AgentProfile, V as InteractionRequest, bt as SandboxError, et as InteractionData, g as TerminalReadyInfo, i as TerminalStreamHandlers, j as AgentInteractiveSessionStopAcknowledgement, k as AgentInteractiveSessionRef, l as MintScopedTokenOptions, o as TerminalStreamReconnectAuthority, q as AgentProfileFileMount, u as ScopedToken, w as AgentInteractiveSessionControlClaim, z as AgentRunCancellationRequest } from "./terminal-stream-types-BqNv5EuG.js";
2
+ import { $a as RawEvidenceBoxDirectoryExport, $r as ForkCounts, An as SandboxShape, Ar as DriverInfo, Bi as CreateSessionOptions, C as WorkspaceOperationLookup, Ci as IntelligenceReportWindow, Cn as TerminalStream, D as ProvisionResult, Di as SandboxEvent, E as ProvisionEvent, Ei as PromptResult, Fi as CommitTaskSessionOptions, Fn as EgressManager, G as GitBranch, Ga as ExecResult, Gi as ListMessagesOptions, Ha as CodeExecutionResult, Hi as DispatchPromptOptions, Ia as WorkspaceImagePublishInput, J as GitStatus, Ja as SandboxEnvRecoveryView, Ji as SendSessionMessageRequest, K as GitCommit, Ka as WriteFileRequest, Ki as PublicProfileConflict, Kt as SandboxFleetTraceBundle, La as WorkspaceImagePublishResult, Li as CompletedTurnResult, Ln as NetworkManager, Lr as GpuLeaseManager, Mi as SandboxTraceOptions, Mn as SandboxResourceUsage, Mr as GpuLease, N as WaitForOptions, Nn as SandboxRuntimeCapabilities, Pi as TurnBackendConfig, Qi as SessionExecutionInfo, Qr as BranchOptions, Ri as ConversationTurnOptions, S as StopOptions, Sn as TeePublicKeyResponse, Ti as PromptOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, Ua as CodeLanguage, Ui as DispatchedSession, Ur as CodeExecutionOptions, Vi as CreateTaskSessionOptions, Wi as DriveTurnOptions, Xa as RawEvidenceArchiveManifest, Xr as HttpClient, Yi as SentSessionMessage, Zi as SessionEventStreamOptions, _ as SnapshotInfo, _r as SearchMatch, aa as SessionMessage, ai as WaitForRolloutOptions, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, c as SandboxDeleteOptions, ca as SessionResultOptions, co as InteractionResolutionAcknowledgement, cr as FileWriteResult, d as SandboxOperationKind, ei as ForkIdempotency, eo as RawEvidenceBoxExportOptions, f as SandboxOperationState, fa as TaskSessionInfo, ga as BackendConfig, gn as StartupDiagnostics, gr as WriteManyOptions, hi as DurablePlanDecisionResult, hn as SandboxTerminals, hr as WriteManyFile, ia as SessionListOptions, ii as RolloutStartResult, in as SandboxConnection, k as ResumeOptions, ki as SandboxTraceBundle, kn as SandboxStatus, la as TaskSessionChanges, ln as SandboxRuntimeHealth, m as SnapshotDeleteAcknowledgement, ma as TurnDriveResult, mi as DurablePlanDecisionOptions, mr as WriteFileOptions, na as SessionInfo, ni as Rollout, nn as SSHCommandDescriptor, no as RawEvidenceExportOptions, nr as FileSystem, o as RestoreSnapshotOptions, oa as SessionMessageAdmission, on as SandboxPortBinding, oo as RawEvidenceUnavailable, pi as DurablePlan, q as GitDiff, qa as SandboxEnvRecovery, qi as SendSessionMessageOptions, ra as SessionInterruptOptions, ri as RolloutOptions, rn as SSHCredentials, s as SandboxDeleteAcknowledgement, ta as SessionForkOptions, ti as ForkLookupOptions, to as RawEvidenceDirectoryExport, u as SandboxOperationInfo, ua as TaskSessionCommitResult, un as SandboxTerminalAttachOptions, v as SnapshotOptions, va as BackendManager, vi as EventStreamOptions, vn as TeeAttestationOptions, vr as SearchOptions, wi as PromptInputPart, x as SnapshotResult, xi as IntelligenceReportCompareTo, y as SnapshotProvenance, yi as IntelligenceReport, yr as ExecOptions, z as ProcessManager, zi as ConversationTurnResult } from "./types-CiuGb4lZ.js";
3
3
  import { t as CliAuthReference } from "./cli-auth-bundle-Wg3x2hd2.js";
4
- import { n as SandboxLines } from "./lines-Br3ygqhP.js";
5
- import { _ as InteractiveSessionStatus, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, m as InteractiveControlClaimOptions, p as InteractiveControlClaimAcknowledgement } from "./browser-interactive-control-controller-DIvMQyer.js";
6
- import { r as InteractiveAttachRequest } from "./interactive-controller-DXGWBdYK.js";
4
+ import { n as SandboxLines } from "./lines-CCHDUfQg.js";
5
+ import { _ as InteractiveSessionStatus, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, m as InteractiveControlClaimOptions, p as InteractiveControlClaimAcknowledgement } from "./browser-interactive-control-controller-KOK6qn2s.js";
6
+ import { r as InteractiveAttachRequest } from "./interactive-controller-YyZEsoB0.js";
7
7
  import { z } from "zod";
8
8
  import { OtlpTraceExport } from "@tangle-network/agent-trace-contract/otlp";
9
9