@tangle-network/sandbox 1.0.189 → 1.0.191

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 (58) hide show
  1. package/README.md +7 -0
  2. package/dist/agent/index.d.ts +4 -4
  3. package/dist/agent/index.js +9 -6
  4. package/dist/agent/preview.d.ts +1 -1
  5. package/dist/agent/preview.js +1 -1
  6. package/dist/{agent-run-outcome-Cst4px_l.d.ts → agent-run-outcome-BO5paRhX.d.ts} +2 -2
  7. package/dist/{api-request-D4Ln_0F5.js → api-request-BvpTwQKs.js} +4 -1
  8. package/dist/{browser-interactive-control-controller-DHIS8edi.js → browser-interactive-control-controller-BYbNLahH.js} +1 -1
  9. package/dist/{browser-interactive-control-controller-DIvMQyer.d.ts → browser-interactive-control-controller-KOK6qn2s.d.ts} +1 -1
  10. package/dist/{chunked-upload-vAE2hVcP.js → chunked-upload-D5ytV_s6.js} +9 -13
  11. package/dist/{chunked-upload-file-HLSriv3V.js → chunked-upload-file-DL1-AqRp.js} +2 -2
  12. package/dist/{client-CwWS3a-i.js → client-XjkuWhog.js} +159 -109
  13. package/dist/{client-C4SnCCpF.d.ts → client-yWdLuj_P.d.ts} +5 -5
  14. package/dist/collaboration/index.js +1 -1
  15. package/dist/{collaboration-CmT6Ygiv.js → collaboration-Bbr45lyk.js} +3 -3
  16. package/dist/{core-BT-0QZT-.js → core-BU1I2KvV.js} +13 -7
  17. package/dist/core.d.ts +6 -6
  18. package/dist/core.js +5 -5
  19. package/dist/errors-Mzq10WZq.js +583 -0
  20. package/dist/{file-download-BXgu9BNh.js → file-download-CKOxcATB.js} +1 -1
  21. package/dist/{index-DDIymnCZ.d.ts → index-DKsOu5sq.d.ts} +5 -5
  22. package/dist/index.d.ts +9 -9
  23. package/dist/index.js +10 -10
  24. package/dist/intelligence/index.js +9 -5
  25. package/dist/interactive-control.d.ts +1 -1
  26. package/dist/interactive-control.js +1 -1
  27. package/dist/{interactive-controller-DXGWBdYK.d.ts → interactive-controller-YyZEsoB0.d.ts} +3 -3
  28. package/dist/{interactive-controller-C876Pjaj.js → interactive-controller-jr3_74Pq.js} +90 -57
  29. package/dist/lib/prepared-evidence.js +1 -1
  30. package/dist/lib/prepared-process.js +1 -1
  31. package/dist/{lines-Br3ygqhP.d.ts → lines-CCHDUfQg.d.ts} +1 -1
  32. package/dist/{lines-DxHJhxCe.js → lines-DrG0WOW6.js} +1 -1
  33. package/dist/lines.d.ts +1 -1
  34. package/dist/lines.js +1 -1
  35. package/dist/{mcp-local-Cqf4Lpp0.js → mcp-local-Dler9R_s.js} +3 -10
  36. package/dist/{prepared-evidence-CP1MmeCQ.js → prepared-evidence-4prvV0YK.js} +1 -1
  37. package/dist/{prepared-process-BWVz93cT.js → prepared-process-BSpZXDDw.js} +1 -1
  38. package/dist/{preview-DUxqnKSk.d.ts → preview-I1z42VGY.d.ts} +3 -3
  39. package/dist/{public-templates-DQiblzzK.d.ts → public-templates-Cw6gmWJD.d.ts} +2 -2
  40. package/dist/public-templates.d.ts +1 -1
  41. package/dist/public-templates.js +7 -4
  42. package/dist/{raw-evidence-archive-CgbWa4es.js → raw-evidence-archive-BD37zHN5.js} +2 -2
  43. package/dist/runtime.d.ts +5 -5
  44. package/dist/runtime.js +9 -7
  45. package/dist/{sandbox-B_Xbc9wR.js → sandbox-Dtb-_btd.js} +317 -221
  46. package/dist/select-seat-command.d.ts +1 -1
  47. package/dist/select-seat-command.js +5 -2
  48. package/dist/session-gateway/index.js +1 -1
  49. package/dist/tangle/index.d.ts +1 -1
  50. package/dist/tangle/index.js +1 -1
  51. package/dist/{tangle-Sg9ORVAA.js → tangle-fs17QlcY.js} +2 -2
  52. package/dist/{terminal-stream-types-1YKRrkZB.d.ts → terminal-stream-types-BqNv5EuG.d.ts} +280 -305
  53. package/dist/{types-B-UsXSi6.d.ts → types-CiuGb4lZ.d.ts} +4 -2
  54. package/package.json +6 -6
  55. package/dist/errors-CaX0a5Ry.js +0 -636
  56. /package/dist/{abort-signal-PgWPMn_e.js → abort-signal-Cu4F2VVz.js} +0 -0
  57. /package/dist/{file-transfer-DTHgLccV.js → file-transfer-Cr9Ossea.js} +0 -0
  58. /package/dist/{retry-after-header-Bt-XvU-x.js → retry-after-header-DUdCC0KJ.js} +0 -0
@@ -1,5 +1,124 @@
1
1
  import { z } from "zod";
2
2
 
3
+ //#region ../../../packages/runtime-contracts/dist/error-catalog.d.ts
4
+ declare const ERROR_CATALOG: {
5
+ readonly VALIDATION_ERROR: "400 final | The request is malformed or a field is invalid. | Fix the field the message names and send the request again.";
6
+ readonly INVALID_REQUEST: "400 final | The request is malformed or a field is invalid. | Fix the field the message names and send the request again.";
7
+ readonly 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.";
8
+ readonly UNAUTHORIZED: "401 final | The credential is missing, invalid or expired. | Sign in again or send a valid API key.";
9
+ readonly PAYMENT_REQUIRED: "402 final | The account has no balance, credit or plan for this request. | Add credit or upgrade the plan, then retry.";
10
+ readonly FORBIDDEN: "403 final | The caller is authenticated but not allowed to do this. | Use a credential with the role or scope the message names.";
11
+ readonly FEATURE_DISABLED: "403 final | This capability is switched off for this deployment or account. | Ask the operator to enable it.";
12
+ readonly 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.";
13
+ readonly 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.";
14
+ readonly 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.";
15
+ readonly 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.";
16
+ readonly INVALID_STATE: "409 final | The resource is in the wrong state for this operation. | Bring it to the state the message names, then retry.";
17
+ readonly IN_PROGRESS: "409 retry | Another operation holds this resource. | Wait for that operation to finish, then retry.";
18
+ readonly EGRESS_PROXY_RECOVERY_REQUIRED: "409 final | The egress proxy lost the credentials it serves. | Recreate the sandbox to rematerialize its egress credentials.";
19
+ readonly 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.";
20
+ readonly 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.";
21
+ readonly EXPIRED: "410 final | The token, decision or grant has expired. | Request a new one.";
22
+ readonly PAYLOAD_TOO_LARGE: "413 final | The body or artifact is over its size limit. | Send a smaller body, or split it.";
23
+ readonly NOT_CONNECTED: "424 final | A required integration connection is missing. | Connect the integration the message names, then retry.";
24
+ readonly QUOTA_EXCEEDED: "429 final | A plan or concurrency quota is reached. | Stop or delete resources, or raise the quota.";
25
+ readonly RATE_LIMITED: "429 retry | Too many requests in the current window. | Wait for the Retry-After interval, then retry.";
26
+ readonly RATE_LIMIT_EXCEEDED: "429 retry | Too many requests in the current window. | Wait for the Retry-After interval, then retry.";
27
+ readonly 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.";
28
+ readonly OPERATION_FAILED: "500 final | A server-side operation failed. | Report the request id with the operation the message names.";
29
+ readonly CONFIGURATION_ERROR: "500 final | The deployment is missing configuration or has an invalid value. | The operator sets the configuration key the message names.";
30
+ readonly 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.";
31
+ readonly 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.";
32
+ readonly MESSAGE_RETRIEVAL_FAILED: "500 final | Message storage cannot serve this read. | Report the request id; the stored session needs repair.";
33
+ readonly UNSUPPORTED: "501 final | This operation is not supported for this runtime, harness or driver. | Choose a runtime or option that supports it.";
34
+ readonly UPSTREAM_ERROR: "502 retry | An upstream service failed or answered outside its contract. | Retry with backoff; report the request id if it persists.";
35
+ readonly UNAVAILABLE: "503 retry | A dependency or capacity is temporarily unavailable. | Retry after the Retry-After interval.";
36
+ readonly NOT_READY: "503 retry | The target is starting, restarting, recovering or draining. | Retry after the Retry-After interval.";
37
+ readonly BACKEND_UNAVAILABLE: "503 retry | The agent backend did not answer. | Retry after the Retry-After interval.";
38
+ readonly MESSAGE_RETRIEVAL_UNAVAILABLE: "503 retry | Message storage did not answer. | Retry after the Retry-After interval.";
39
+ readonly TIMEOUT: "504 retry | The operation exceeded its deadline. | Retry; if it repeats, raise the timeout or split the work.";
40
+ readonly 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.";
41
+ readonly KV_KEY_LIMIT: "409 final | The workflow has reached its KV key cap. | Delete keys the workflow no longer reads, then write again.";
42
+ readonly 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.";
43
+ readonly 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.";
44
+ readonly UNPROCESSABLE: "422 final | The input has nothing usable for this operation. | Record the history the message names, then ask again.";
45
+ readonly BASE_IMAGE_NOT_FOUND: "400 final | The requested image does not exist. | Check the image name and tag, then create again.";
46
+ readonly 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.";
47
+ readonly UNSUPPORTED_EGRESS_POLICY: "400 final | This runtime cannot enforce the requested egress policy. | Choose a policy the runtime supports, or another runtime.";
48
+ readonly UNSUPPORTED_FOR_RUNTIME: "400 final | The requested runtime cannot honour a create input. | Remove the input the message names, or choose another runtime.";
49
+ readonly ROOT_USER_FORBIDDEN: "403 final | The sandbox may not run as root. | Run the workload as a non-root user.";
50
+ readonly 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.";
51
+ readonly EGRESS_REQUEST_REFUSED: "403 final | The sandbox egress policy refused this request. | Read box.egress.denials() for the rule that refused it.";
52
+ readonly NOT_MANAGED: "404 final | This host does not manage the named container. | Check the sandbox id; the platform resolves its host again on retry.";
53
+ readonly 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.";
54
+ readonly BRANCH_PARENT_NOT_RUNNING: "409 final | The branch parent is not running. | Resume the parent sandbox, then branch again.";
55
+ readonly CONTAINER_RESERVATION_CONFLICT: "409 retry | Another lifecycle operation holds this sandbox. | Wait for that operation to finish, then retry.";
56
+ readonly 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.";
57
+ readonly EGRESS_DISABLED: "409 final | Egress is not enabled on this host. | Place the sandbox on a host with egress enabled.";
58
+ readonly 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.";
59
+ readonly 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.";
60
+ readonly 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.";
61
+ readonly SNAPSHOT_NOT_SYNCED: "409 retry | The snapshot has not finished uploading. | Retry after the upload completes.";
62
+ readonly WARM_CLAIM_REMOVED: "409 final | Another lifecycle operation removed the claimed warm sandbox. | Create the sandbox again.";
63
+ readonly 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.";
64
+ readonly RESTORE_QUOTA_EXCEEDED: "413 final | The snapshot is larger than the workspace quota. | Create with a larger disk, or restore a smaller snapshot.";
65
+ readonly 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.";
66
+ readonly BRANCH_FAILED: "500 final | The live branch of a running sandbox failed. | Report the request id; branch from a snapshot instead.";
67
+ readonly CONTAINER_START_FAILED: "500 retry | The host started the sandbox and its runtime failed. | Retry; if it repeats, recreate the sandbox from a snapshot.";
68
+ readonly GIT_CLONE_FAILED: "500 retry | Cloning the repository failed. | Retry; if it repeats, check that the repository URL is reachable.";
69
+ readonly GIT_CLONE_TIMEOUT: "500 retry | Cloning the repository exceeded its deadline. | Retry, or clone a smaller repository.";
70
+ readonly HOST_CLEANUP_UNCONFIRMED: "500 retry | The host cannot prove it removed what a failed create made. | Retry; the platform reconciles the earlier attempt first.";
71
+ readonly HOST_RESERVATION_COMMIT_FAILED: "500 retry | The host could not record the create after cleaning it up. | Retry the create.";
72
+ readonly MISSING_SIDECAR_AUTH_TOKEN: "500 final | The sandbox has no runtime auth token, so its host cannot route to it. | Recreate the sandbox.";
73
+ readonly 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.";
74
+ readonly VM_START_FAILED: "500 retry | The microVM failed to start. | Retry; if it repeats, recreate the sandbox.";
75
+ readonly SIDECAR_UPSTREAM_UNAVAILABLE: "502 retry | The host could not reach the sandbox runtime. | Retry; the request may have reached the sandbox.";
76
+ readonly BRANCH_UFFD_UNAVAILABLE: "503 retry | The parent host cannot fork live memory now. | Retry, or branch from a snapshot.";
77
+ readonly CAPACITY_EXHAUSTED: "503 retry | No host has room for this sandbox now. | Retry after the Retry-After interval.";
78
+ readonly COMPLIANCE_CAPACITY_UNAVAILABLE: "503 retry | No verified compliance-scope host can take this sandbox now. | Retry after the Retry-After interval.";
79
+ readonly FIRECRACKER_IMAGE_UNAVAILABLE: "503 final | No host carries the requested Firecracker image. | Choose an image the Firecracker hosts carry, or the Docker runtime.";
80
+ readonly HOST_UNAVAILABLE: "503 retry | The host did not answer; the sandbox and its files remain. | Retry after the Retry-After interval.";
81
+ readonly IN_BOX_DOCKER_UNAVAILABLE: "503 retry | Docker inside the sandbox is not available. | Retry, or create the sandbox with in-box Docker enabled.";
82
+ readonly NO_IP: "503 retry | The sandbox has no network address yet. | Retry after the Retry-After interval.";
83
+ readonly ROUTE_LOOKUP_FAILED: "503 retry | The host could not look up the sandbox route. | Retry after the Retry-After interval.";
84
+ readonly SNAPSHOT_STORAGE_UNAVAILABLE: "503 retry | Snapshot storage did not answer. | Retry after the Retry-After interval.";
85
+ readonly THIN_POOL_HEADROOM: "503 final | The sandbox host cannot grow this workspace. | Recreate the sandbox from a snapshot so it lands on another host.";
86
+ readonly WARM_RECONNECT_MISS: "503 retry | The warm restore path is unavailable. | Retry; the platform restores through the cold path.";
87
+ readonly WORKSPACE_IMAGE_BUILDER_BUSY: "503 retry | The workspace image builder is busy. | Retry after the Retry-After interval.";
88
+ readonly WORKSPACE_IMAGE_BUILDER_UNAVAILABLE: "503 retry | The workspace image builder is unavailable. | Retry after the Retry-After interval.";
89
+ readonly SIDECAR_HEALTH_TIMEOUT: "504 retry | The sandbox runtime did not become ready within its boot attempts. | Retry; if it repeats, recreate the sandbox.";
90
+ readonly rate_limit_error: "429 retry | The model provider rate-limited this turn. | Wait for the provider's window, then send the turn again.";
91
+ readonly provider_quota_exhausted: "429 final | The harness subscription quota is spent until its resetAt. | Wait until resetAt, or send the turn with another credential.";
92
+ readonly 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.";
93
+ readonly 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.";
94
+ readonly 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.";
95
+ readonly SESSION_DIED: "500 final | The harness session process died during the turn; the message says why. | Send the turn again in a new session.";
96
+ readonly 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.";
97
+ readonly 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.";
98
+ readonly 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.";
99
+ readonly 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.";
100
+ readonly 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.";
101
+ readonly 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.";
102
+ readonly 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.";
103
+ readonly 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.";
104
+ readonly 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.";
105
+ readonly 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.";
106
+ readonly 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.";
107
+ readonly MESSAGE_ADMISSION_EXPIRED: "409 final | The message's admission deadline passed before the harness was invoked. | Dispatch the message again with a new deadline.";
108
+ readonly 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.";
109
+ readonly HARNESS_MODEL_UNSUPPORTED: "400 final | The named harness cannot run the named model. | Choose a model the harness supports, or another harness.";
110
+ readonly 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.";
111
+ readonly 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.";
112
+ readonly 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.";
113
+ readonly COMPLIANCE_CELL_UNAVAILABLE: "503 final | No cell serves the requested compliance placement. | Choose another region or compliance mode, or ask the operator.";
114
+ readonly 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.";
115
+ readonly 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.";
116
+ readonly 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.";
117
+ readonly 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.";
118
+ readonly 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.";
119
+ };
120
+ type ErrorCode = keyof typeof ERROR_CATALOG;
121
+ //#endregion
3
122
  //#region src/create-receipt-types.d.ts
4
123
  /** Create admission evidence shared by SDK errors and public sandbox types.
5
124
  * This contract has no SDK implementation imports. */
@@ -47,340 +166,204 @@ interface SandboxCreateReceipt {
47
166
  }
48
167
  //#endregion
49
168
  //#region src/error-classes.d.ts
169
+ type SandboxErrorOrigin = "sidecar" | "sandbox-api" | "control-plane" | "runtime" | "unknown";
170
+ type SandboxErrorJson = string | number | boolean | null | {
171
+ [key: string]: SandboxErrorJson;
172
+ } | SandboxErrorJson[];
173
+ type SandboxFailureDetail = {
174
+ [key: string]: SandboxErrorJson;
175
+ };
176
+ /** What one supported GPU provider needs, as a refusal reports it. */
177
+ interface GpuProviderRequirement {
178
+ provider: string;
179
+ /** `ready`, `credential-invalid`, `unverified`, `not-configured`, `disabled`. */
180
+ state: string;
181
+ /** Orchestrator environment variables it needs (`A|B`: either). */
182
+ envVars: string[];
183
+ }
184
+ /** Why the SDK stopped rejoining an execution whose stream dropped. */
185
+ 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";
186
+ /** Everything a failure carries besides its message. Every field is optional. */
187
+ interface SandboxErrorMetadata {
188
+ /** The wire code, or a code the SDK names; `SandboxError.code` is its catalog code. */
189
+ code?: string;
190
+ /** HTTP status the server answered; absent means the catalog's status. */
191
+ status?: number;
192
+ cause?: unknown;
193
+ origin?: SandboxErrorOrigin;
194
+ endpoint?: string;
195
+ retryAfterMs?: number;
196
+ sidecarVersion?: string;
197
+ containerImage?: string;
198
+ etaSeconds?: number;
199
+ elapsedMs?: number;
200
+ createFailureDisposition?: "not-admitted";
201
+ capacityHold?: "customer_floor";
202
+ resourceType?: string;
203
+ resourceId?: string;
204
+ quotaType?: string;
205
+ current?: number;
206
+ limit?: number;
207
+ capability?: string;
208
+ providers?: GpuProviderRequirement[];
209
+ failures?: SandboxFailureDetail[];
210
+ allocationId?: string;
211
+ idempotencyKey?: string;
212
+ createReceipt?: SandboxCreateReceipt | null;
213
+ fields?: Record<string, string>;
214
+ path?: string;
215
+ currentState?: string;
216
+ requiredState?: string;
217
+ edgeStatus?: "pending" | "failed";
218
+ expectedHash?: string;
219
+ currentHash?: string | null;
220
+ currentMtime?: number | null;
221
+ keyId?: string;
222
+ budgetUsd?: number;
223
+ spentUsd?: number;
224
+ reservedUsd?: number;
225
+ missingEnvKeys?: readonly string[];
226
+ maxChildren?: number;
227
+ requestedChildren?: number;
228
+ timeoutMs?: number;
229
+ executionId?: string;
230
+ sessionId?: string;
231
+ lastEventId?: string;
232
+ reason?: string;
233
+ lastReplayStatus?: number;
234
+ lastExecutionStatus?: string;
235
+ beforeOpen?: boolean;
236
+ }
50
237
  /**
51
- * Base error class for all Sandbox SDK errors.
238
+ * The one SDK error. `code` is the catalog code callers branch on; `wireCode`
239
+ * is the code the server sent (it differs while servers still send
240
+ * pre-catalog codes). `retryable` is the catalog's verdict on whether a later
241
+ * retry can succeed, and `nextStep` is what the caller does about it.
52
242
  */
53
243
  declare class SandboxError extends Error {
54
- /** HTTP status code if applicable */
55
- readonly status?: number;
56
- /** Error code for programmatic handling */
57
- readonly code: string;
244
+ readonly code: ErrorCode;
245
+ readonly wireCode: string;
246
+ /** HTTP status the server answered, else the catalog status of `code`. */
247
+ readonly status: number;
248
+ readonly retryable: boolean;
249
+ readonly nextStep: string;
250
+ readonly docs: string;
58
251
  /** Best-effort origin of the failing request */
59
252
  readonly origin?: SandboxErrorOrigin;
60
253
  /** Request path or endpoint when known */
61
254
  readonly endpoint?: string;
62
255
  /** Retry-after duration in ms when surfaced by the upstream */
63
256
  readonly retryAfterMs?: number;
64
- /** Sidecar version when the runtime emitted it */
65
257
  readonly sidecarVersion?: string;
66
- /** Sidecar image/tag/sha when the runtime emitted it */
67
258
  readonly containerImage?: string;
68
259
  /**
69
- * Seconds the control plane expects to need before it can serve this
70
- * request, when it published one. Today only a capacity refusal on create
71
- * carries it: the cell sizes it from the host add already in flight plus
72
- * the measured p95 host-birth time, so it is a real wait, not a backoff
73
- * hint. `retryAfterMs` paces the SDK's own retry; this is the number to
74
- * show a human or feed to a scheduler.
260
+ * Seconds the cell measured it needs before it can serve this request (a
261
+ * capacity refusal on create). A real wait to show a human or a scheduler,
262
+ * unlike `retryAfterMs`, which paces the SDK's own retry.
75
263
  */
76
264
  readonly etaSeconds?: number;
265
+ /** How long the operation ran before this error, when the thrower measured it; never `timeoutMs`. */
266
+ readonly elapsedMs?: number;
77
267
  /**
78
268
  * On create's top-level error, proves this call's attempts admitted no
79
- * sandbox. Absence is unknown. Earlier errors in `cause` describe only
80
- * their attempt prefix, not subsequent attempts or earlier calls using
81
- * the same idempotency key.
269
+ * sandbox. Absence is unknown.
82
270
  */
83
271
  readonly createFailureDisposition?: "not-admitted";
84
- /**
85
- * The cell kept its last free slots for customer creates and refused this
86
- * internal create at once. Only customers may take that room, so create()
87
- * ends on it instead of re-POSTing; a caller records it as held for
88
- * customers, not as a failure.
89
- */
272
+ /** The cell kept its last free slots for customers and refused this internal create; create() ends on it. */
90
273
  readonly capacityHold?: "customer_floor";
91
- constructor(message: string, code: string, status?: number, metadata?: SandboxErrorMetadata);
92
- }
93
- type SandboxErrorOrigin = "sidecar" | "sandbox-api" | "control-plane" | "runtime" | "unknown";
94
- interface SandboxErrorMetadata {
95
- origin?: SandboxErrorOrigin;
96
- endpoint?: string;
97
- retryAfterMs?: number;
98
- sidecarVersion?: string;
99
- containerImage?: string;
100
- etaSeconds?: number;
101
- /** How long the operation ran, for a TimeoutError that measured it. */
102
- elapsedMs?: number;
103
- createFailureDisposition?: "not-admitted";
104
- capacityHold?: "customer_floor";
105
- }
106
- type SandboxErrorJson = string | number | boolean | null | {
107
- [key: string]: SandboxErrorJson;
108
- } | SandboxErrorJson[];
109
- type SandboxFailureDetail = {
110
- [key: string]: SandboxErrorJson;
111
- };
112
- /**
113
- * Authentication failed or API key is invalid.
114
- */
115
- declare class AuthError extends SandboxError {
116
- constructor(message?: string, metadata?: SandboxErrorMetadata);
117
- }
118
- /**
119
- * The requested resource was not found.
120
- */
121
- declare class NotFoundError extends SandboxError {
122
- /** The resource type that was not found */
123
- readonly resourceType: string;
124
- /** The resource ID that was not found */
125
- readonly resourceId: string;
126
- constructor(resourceType: string, resourceId: string, metadata?: SandboxErrorMetadata, message?: string, code?: string);
127
- }
128
- /**
129
- * Account quota or rate limit exceeded.
130
- */
131
- declare class QuotaError extends SandboxError {
132
- /** The type of quota that was exceeded */
133
- readonly quotaType: string;
134
- /** Current usage */
274
+ readonly resourceType?: string;
275
+ readonly resourceId?: string;
276
+ /** Quota reason: `CONCURRENT_LIMIT`, `CREDIT_EXHAUSTED`, `EGRESS_LIMIT`, or `rate_limit`. */
277
+ readonly quotaType?: string;
135
278
  readonly current?: number;
136
- /** Maximum allowed */
137
279
  readonly limit?: number;
138
- /** Suggested retry-after duration in ms */
139
- readonly retryAfterMs?: number;
140
- constructor(quotaType: string, message?: string, current?: number, limit?: number, metadata?: SandboxErrorMetadata, status?: number);
141
- }
142
- /**
143
- * The requested capability is unavailable for the account, driver, or sandbox.
144
- */
145
- declare class CapabilityError extends SandboxError {
146
- /** Capability or feature that was rejected when known */
147
280
  readonly capability?: string;
148
- constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, capability?: string);
149
- }
150
- /** What one supported GPU provider needs, as a refusal reports it. */
151
- interface GpuProviderRequirement {
152
- provider: string;
153
- /** `ready`, `credential-invalid`, `unverified`, `not-configured`, `disabled`. */
154
- state: string;
155
- /** Orchestrator environment variables it needs (`A|B`: either). */
156
- envVars: string[];
157
- }
158
- /**
159
- * No configured GPU provider can take the lease: none is configured, the
160
- * named one is not, or the provider refused its credential. Status 503, code
161
- * `GPU_PROVIDER_NOT_CONFIGURED`. The message names every supported provider
162
- * and the orchestrator variables it needs; `providers` carries the same.
163
- */
164
- declare class GpuProviderNotConfiguredError extends CapabilityError {
165
- readonly providers: GpuProviderRequirement[];
166
- constructor(message: string, providers?: GpuProviderRequirement[], status?: number, metadata?: SandboxErrorMetadata);
167
- }
168
- /**
169
- * A create that requires HIPAA placement was refused. `code` says why:
170
- * `COMPLIANCE_NOT_ENTITLED` (403) when the credential carries no HIPAA
171
- * entitlement, `COMPLIANCE_CELL_UNAVAILABLE` (503) when no HIPAA-designated
172
- * cell can take the create now. Either way nothing was created, and the
173
- * create was not placed in any other cell. The SDK does not retry it.
174
- */
175
- declare class CompliancePlacementError extends SandboxError {
176
- constructor(message: string, code: "COMPLIANCE_NOT_ENTITLED" | "COMPLIANCE_CELL_UNAVAILABLE", status: number, metadata?: SandboxErrorMetadata);
177
- }
178
- /**
179
- * A multi-resource operation failed for one or more branches.
180
- */
181
- declare class PartialFailureError extends SandboxError {
182
- /** Per-resource failures returned by the API when available */
281
+ /** Every supported GPU provider and the orchestrator variables it needs. */
282
+ readonly providers?: GpuProviderRequirement[];
283
+ /** Per-resource failures of a multi-resource operation. */
183
284
  readonly failures?: SandboxFailureDetail[];
184
- /** The operation that failed after another resource was already created. */
185
- readonly cause?: unknown;
186
- /** Allocation returned before create readiness failed. */
285
+ /** Allocation a create returned before its readiness failed. */
187
286
  readonly allocationId?: string;
188
- /** Key used for the create call that returned the allocation. */
189
287
  readonly idempotencyKey?: string;
190
- /** Ownership verdict returned by that create call, if available. */
191
288
  readonly createReceipt?: SandboxCreateReceipt | null;
192
- constructor(message: string, code?: string, status?: number, metadata?: SandboxErrorMetadata, failures?: SandboxFailureDetail[], cause?: unknown, createFailure?: {
193
- allocationId: string;
194
- idempotencyKey: string;
195
- createReceipt: SandboxCreateReceipt | null;
196
- });
197
- }
198
- /**
199
- * The request was invalid or malformed.
200
- */
201
- declare class ValidationError extends SandboxError {
202
289
  /** Field-level validation errors */
203
290
  readonly fields?: Record<string, string>;
204
- constructor(message: string, fields?: Record<string, string>, metadata?: SandboxErrorMetadata, code?: string);
205
- }
206
- /**
207
- * A profile file mount the sandbox refuses; a retry with the same profile gets
208
- * the same refusal. `PROFILE_FILE_MOUNT_OUTSIDE_ROOTS` (422): an absolute path
209
- * outside `SANDBOX_FILE_API_ABSOLUTE_ROOTS`, refused before any write.
210
- * `PROFILE_FILE_CONFLICT` (409): the file changed both in the sandbox and in
211
- * the profile since its last mount, so a turn refuses to replace it.
212
- */
213
- declare class ProfileFileMountPathError extends SandboxError {
214
- /** The refused mount path, exactly as the profile gave it. */
215
- readonly path: string;
216
- constructor(path: string, message: string, code: string, metadata?: SandboxErrorMetadata, status?: number);
217
- }
218
- /**
219
- * The sandbox is not in a valid state for the requested operation.
220
- */
221
- declare class StateError extends SandboxError {
222
- /** Current state of the sandbox */
223
- readonly currentState: string;
224
- /** Required state for the operation */
291
+ readonly path?: string;
292
+ readonly currentState?: string;
225
293
  readonly requiredState?: string;
226
- constructor(message: string, currentState: string, requiredState?: string, metadata?: SandboxErrorMetadata, code?: string);
227
- }
228
- /**
229
- * The sandbox lifecycle is running, but its consumer-facing runtime edge is
230
- * still attaching or has failed to attach.
231
- */
232
- declare class EdgeNotReadyError extends SandboxError {
233
- /** Current public edge state. */
234
- readonly edgeStatus: "pending" | "failed";
235
- constructor(message: string, edgeStatus: "pending" | "failed", metadata?: SandboxErrorMetadata);
236
- }
237
- declare class FileWriteConflictError extends SandboxError {
238
- readonly path: string;
239
- readonly currentHash: string | null;
240
- readonly currentMtime: number | null;
294
+ readonly edgeStatus?: "pending" | "failed";
241
295
  readonly expectedHash?: string;
242
- constructor(message: string, path: string, expectedHash: string | undefined, currentHash: string | null, currentMtime: number | null, metadata?: SandboxErrorMetadata);
243
- }
244
- /**
245
- * The Platform key funding the request has no lifetime budget left.
246
- *
247
- * A budgeted key funds any number of sandboxes until its budget is spent;
248
- * then every create, resume, and model credential it funds is refused with
249
- * this error. The refusal is decided: retrying cannot succeed until the
250
- * budget is raised or another key is used, so the SDK never retries it.
251
- */
252
- declare class KeyBudgetExhaustedError extends SandboxError {
253
- /**
254
- * The key the refusal names: the budgeted key with nothing left when
255
- * Platform refused a delegation, or the presented key when authentication
256
- * refused it. Absent when the server named none.
257
- */
296
+ readonly currentHash?: string | null;
297
+ readonly currentMtime?: number | null;
298
+ /** The budgeted key a `KEY_BUDGET_EXHAUSTED` refusal names, and its USD budget, spend and reserve. */
258
299
  readonly keyId?: string;
259
- /** That key's lifetime budget, in USD, when Platform reported it. */
260
300
  readonly budgetUsd?: number;
261
- /** What that key has spent, in USD. */
262
301
  readonly spentUsd?: number;
263
- /** What that key has reserved for budgeted children, in USD. */
264
302
  readonly reservedUsd?: number;
265
- constructor(message: string, details?: {
266
- keyId?: string;
267
- budgetUsd?: number;
268
- spentUsd?: number;
269
- reservedUsd?: number;
270
- }, metadata?: SandboxErrorMetadata);
271
- }
272
- declare class EgressProxyRecoveryError extends SandboxError {
273
- readonly phase: "egress_proxy_recovery";
274
- constructor(message: string, metadata?: SandboxErrorMetadata);
275
- }
276
- /**
277
- * Resume must build a new runtime, and that runtime needs public env values
278
- * the platform does not store at rest: a per-run coordination or capability
279
- * token, or a secret passed at create. Resume again with each key in
280
- * `missingEnvKeys` in `ResumeOptions.env`.
281
- */
282
- declare class ResumeEnvRequiredError extends SandboxError {
283
- /** The env keys the next resume must carry. */
284
- readonly missingEnvKeys: readonly string[];
285
- constructor(message: string, missingEnvKeys: readonly string[], metadata?: SandboxErrorMetadata);
286
- }
287
- /**
288
- * A branch asked for more children than the parent's host has memory for.
289
- * Children can only live on the parent's host (their clone is local to its
290
- * volume), so no other host can take the rest. `maxChildren` is how many
291
- * children that host admits now; branch that many or fewer, or wait for the
292
- * host to free memory. Nothing was created and nothing is held.
293
- *
294
- * A retry under the same idempotency key replays this refusal unchanged,
295
- * `maxChildren` included, so the count is the host's room when the key was
296
- * first used. To branch fewer children, use a new key.
297
- */
298
- declare class BranchFanoutExceedsHostError extends SandboxError {
299
- /** Children the parent's host admitted when it refused (0 when none). */
303
+ /** The env keys the next resume must carry in `ResumeOptions.env`. */
304
+ readonly missingEnvKeys?: readonly string[];
305
+ /** Children the parent's host admitted when a branch fan-out was refused. */
300
306
  readonly maxChildren?: number;
301
- /** The fan-out width this request asked for. */
302
307
  readonly requestedChildren?: number;
303
- constructor(message: string, counts: {
304
- maxChildren?: number;
305
- requestedChildren?: number;
306
- }, metadata?: SandboxErrorMetadata);
307
- }
308
- /**
309
- * The request timed out.
310
- */
311
- declare class TimeoutError extends SandboxError {
312
308
  /** The operation's configured budget, in milliseconds. NOT how long it ran. */
313
- readonly timeoutMs: number;
314
- /**
315
- * How long the operation actually ran before this error, in milliseconds,
316
- * when the thrower measured it.
317
- *
318
- * `create()` can end before its budget: when a server-supplied `Retry-After`
319
- * outlasts the remaining budget, no further attempt can follow that sleep,
320
- * so the create ends there rather than idling. Reading `timeoutMs` as the
321
- * duration would record a two-minute timeout for a three-second refusal.
322
- * Absent means the thrower did not measure it; it never means `timeoutMs`.
323
- */
324
- readonly elapsedMs?: number;
325
- /**
326
- * The last typed failure the operation had already received when the
327
- * deadline fired, when there was one.
328
- *
329
- * An operation that spends its budget across several attempts (create's
330
- * bounded POST retry) usually learns the server's failure class on an
331
- * earlier attempt — `CONTAINER_START_FAILED`, `PROVISIONING_ERROR`,
332
- * `RATE_LIMIT_EXCEEDED`. Without this field that class dies at the
333
- * deadline and the caller is left with a timeout that names no cause,
334
- * which is the last discard in a chain built specifically to deliver it.
335
- */
336
- readonly cause?: SandboxError;
337
- constructor(timeoutMs: number, message?: string, metadata?: SandboxErrorMetadata, cause?: SandboxError);
338
- }
339
- /**
340
- * A network or connection error occurred.
341
- */
342
- declare class NetworkError extends SandboxError {
343
- /** The underlying error */
344
- readonly cause?: Error;
345
- constructor(message: string, causeOrMetadata?: Error | SandboxErrorMetadata, metadata?: SandboxErrorMetadata);
346
- }
347
- /** Why the SDK stopped rejoining an execution whose stream dropped. */
348
- 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";
349
- /**
350
- * The stream of an admitted execution ended without its terminal event, and
351
- * the SDK could not rejoin it. The execution's outcome is UNKNOWN: it may
352
- * still be running, or it may have finished while no reader was attached.
353
- * This is never a failure verdict. Rejoin later with `streamPrompt(message,
354
- * { executionId, lastEventId, sessionId })`, or read the session status.
355
- */
356
- declare class StreamInterruptedError extends SandboxError {
357
- readonly executionId: string;
309
+ readonly timeoutMs?: number;
310
+ readonly executionId?: string;
358
311
  readonly sessionId?: string;
359
- /** The last event id delivered to the caller; replay resumes after it. */
312
+ /** The last event id delivered to the caller; a rejoin resumes after it. */
360
313
  readonly lastEventId?: string;
361
- readonly reason: StreamInterruptionReason;
362
- /** Last HTTP status the replay endpoint answered, when it answered. */
314
+ readonly reason?: string;
363
315
  readonly lastReplayStatus?: number;
364
- /** Last execution status the runtime reported, when it reported one. */
365
316
  readonly lastExecutionStatus?: string;
366
- readonly cause?: unknown;
367
- constructor(details: {
368
- message: string;
369
- executionId: string;
370
- sessionId?: string;
371
- lastEventId?: string;
372
- reason: StreamInterruptionReason;
373
- lastReplayStatus?: number;
374
- lastExecutionStatus?: string;
375
- cause?: unknown;
376
- });
317
+ /** A terminal socket that never reached OPEN. */
318
+ readonly beforeOpen?: boolean;
319
+ constructor(message: string, metadata?: SandboxErrorMetadata);
377
320
  }
321
+ /** @deprecated Removed in 0.62; check `code === "UNAUTHORIZED"`. */
322
+ declare class AuthError extends SandboxError {}
323
+ /** @deprecated Removed in 0.62; check `code === "NOT_FOUND"`. */
324
+ declare class NotFoundError extends SandboxError {}
325
+ /** @deprecated Removed in 0.62; check `code === "QUOTA_EXCEEDED"` or `"RATE_LIMITED"`. */
326
+ declare class QuotaError extends SandboxError {}
327
+ /** @deprecated Removed in 0.62; check `code === "UNSUPPORTED"` or `"FEATURE_DISABLED"`. */
328
+ declare class CapabilityError extends SandboxError {}
329
+ /** @deprecated Removed in 0.62; check `wireCode === "GPU_PROVIDER_NOT_CONFIGURED"`. */
330
+ declare class GpuProviderNotConfiguredError extends CapabilityError {}
331
+ /** @deprecated Removed in 0.62; check `wireCode` for `COMPLIANCE_NOT_ENTITLED` or `COMPLIANCE_CELL_UNAVAILABLE`. */
332
+ declare class CompliancePlacementError extends SandboxError {}
333
+ /** @deprecated Removed in 0.62; read `failures`. */
334
+ declare class PartialFailureError extends SandboxError {}
335
+ /** @deprecated Removed in 0.62; check `code === "VALIDATION_ERROR"`. */
336
+ declare class ValidationError extends SandboxError {}
337
+ /** @deprecated Removed in 0.62; check `wireCode` and read `path`. */
338
+ declare class ProfileFileMountPathError extends SandboxError {}
339
+ /** @deprecated Removed in 0.62; check `code === "INVALID_STATE"`. */
340
+ declare class StateError extends SandboxError {}
341
+ /** @deprecated Removed in 0.62; check `wireCode === "EDGE_NOT_READY"`. */
342
+ declare class EdgeNotReadyError extends SandboxError {}
343
+ /** @deprecated Removed in 0.62; check `wireCode === "FILE_WRITE_CONFLICT"`. */
344
+ declare class FileWriteConflictError extends SandboxError {}
345
+ /** @deprecated Removed in 0.62; check `wireCode === "KEY_BUDGET_EXHAUSTED"`. */
346
+ declare class KeyBudgetExhaustedError extends SandboxError {}
347
+ /** @deprecated Removed in 0.62; check `code === "EGRESS_PROXY_RECOVERY_REQUIRED"`. */
348
+ declare class EgressProxyRecoveryError extends SandboxError {}
349
+ /** @deprecated Removed in 0.62; check `wireCode === "RESUME_ENV_REQUIRED"` and read `missingEnvKeys`. */
350
+ declare class ResumeEnvRequiredError extends SandboxError {}
351
+ /** @deprecated Removed in 0.62; check `wireCode === "BRANCH_FANOUT_EXCEEDS_HOST"` and read `maxChildren`. */
352
+ declare class BranchFanoutExceedsHostError extends SandboxError {}
353
+ /** @deprecated Removed in 0.62; check `code === "TIMEOUT"`. */
354
+ declare class TimeoutError extends SandboxError {}
355
+ /** @deprecated Removed in 0.62; check `code === "NETWORK_ERROR"`. */
356
+ declare class NetworkError extends SandboxError {}
378
357
  /**
379
- * The server returned an unexpected error.
358
+ * The stream of an admitted execution ended without its terminal event and
359
+ * the SDK could not rejoin it. The outcome is UNKNOWN, never a failure
360
+ * verdict: rejoin with `streamPrompt(message, { executionId, lastEventId,
361
+ * sessionId })`, or read the session status.
362
+ * @deprecated Removed in 0.62; check `code === "STREAM_INTERRUPTED"`.
380
363
  */
381
- declare class ServerError extends SandboxError {
382
- constructor(message: string, status?: number, metadata?: SandboxErrorMetadata, code?: string);
383
- }
364
+ declare class StreamInterruptedError extends SandboxError {}
365
+ /** @deprecated Removed in 0.62; check `status >= 500`. */
366
+ declare class ServerError extends SandboxError {}
384
367
  //#endregion
385
368
  //#region src/errors.d.ts
386
369
  /**
@@ -394,21 +377,13 @@ declare function parseErrorResponse(status: number, body: string, context?: {
394
377
  path?: string;
395
378
  allPreviousCreateAttemptsRefused?: boolean;
396
379
  }, headers?: Headers): SandboxError;
397
- /** A protocol `error` control frame or a transport failure. */
398
- declare class TerminalStreamError extends Error {
399
- /** Protocol error code (e.g. `INIT_FAILED`) or `TRANSPORT` for socket faults. */
400
- readonly code: string;
401
- /**
402
- * True when the socket never reached OPEN: the upgrade was refused (a
403
- * WebSocket client cannot read the HTTP status, so a 401 and a network drop
404
- * look alike) or the runtime rejected the dial's options. No PTY work had
405
- * started on the client's side of that dial.
406
- */
407
- readonly beforeOpen: boolean;
408
- constructor(message: string, code: string, options?: {
409
- beforeOpen?: boolean;
410
- });
411
- }
380
+ /**
381
+ * A terminal protocol `error` frame (`wireCode` is its protocol code, e.g.
382
+ * `INIT_FAILED`) or a socket fault (`TRANSPORT`). `beforeOpen` is true when
383
+ * the socket never reached OPEN, so no PTY work started on this dial.
384
+ * @deprecated Removed in 0.62; check `code`.
385
+ */
386
+ declare class TerminalStreamError extends SandboxError {}
412
387
  //#endregion
413
388
  //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.13/node_modules/@tangle-network/agent-interface/dist/plan.d.ts
414
389
  /**