@tangle-network/sandbox 1.0.235 → 1.0.237

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 (49) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +1 -1
  5. package/dist/{agent-run-outcome-CEf6hJYp.d.ts → agent-run-outcome-DkEeNhH6.d.ts} +2 -2
  6. package/dist/{api-request-DY_5Hnyl.js → api-request-Cm1H_xsv.js} +1 -1
  7. package/dist/{browser-interactive-control-controller-DJGhiJCm.js → browser-interactive-control-controller-CrBx8ETe.js} +1 -1
  8. package/dist/{browser-interactive-control-controller-CcUjQEfa.d.ts → browser-interactive-control-controller-JSGfFeNB.d.ts} +1 -1
  9. package/dist/{chunked-upload-BlvgxPWx.js → chunked-upload-B1kuuezC.js} +1 -1
  10. package/dist/{chunked-upload-file-DOeLpMO0.js → chunked-upload-file-JfRw6PRf.js} +1 -1
  11. package/dist/{client-DN1BxvDF.js → client-Crwo3vqo.js} +5 -5
  12. package/dist/{client-OYkwBKG2.d.ts → client-Cy6Zlb3W.d.ts} +5 -5
  13. package/dist/collaboration/index.js +1 -1
  14. package/dist/{collaboration-CdPAEN0W.js → collaboration-k3yUVGgP.js} +2 -2
  15. package/dist/core.d.ts +7 -7
  16. package/dist/core.js +6 -6
  17. package/dist/{errors-nXGKGVFe.js → errors-DQEu-Q7s.js} +20 -21
  18. package/dist/{file-download-BjkrYzy_.js → file-download-DXgIe-CV.js} +1 -1
  19. package/dist/{index-C8YpXh5N.d.ts → index-DYxmMGbU.d.ts} +12 -87
  20. package/dist/index.d.ts +10 -10
  21. package/dist/index.js +12 -12
  22. package/dist/intelligence/index.js +3 -3
  23. package/dist/interactive-control.d.ts +1 -1
  24. package/dist/interactive-control.js +1 -1
  25. package/dist/{interactive-controller-CJ7BBRpv.d.ts → interactive-controller-DaBe9oR5.d.ts} +3 -3
  26. package/dist/{interactive-controller-D4aEHlv_.js → interactive-controller-mqraKMkh.js} +4 -4
  27. package/dist/{lines-CSGBHEjR.js → lines-Bsp1TFBM.js} +1 -1
  28. package/dist/{lines-CCJZUrBP.d.ts → lines-DfKFyMTA.d.ts} +1 -1
  29. package/dist/lines.d.ts +1 -1
  30. package/dist/lines.js +1 -1
  31. package/dist/{mcp-local-X2JhwaO9.js → mcp-local-DV-BvoUI.js} +2 -2
  32. package/dist/{preview-zpWYtsDJ.d.ts → preview-BqicYuSJ.d.ts} +3 -3
  33. package/dist/{public-templates-DCFFPDEB.d.ts → public-templates-Bk843Kqc.d.ts} +2 -2
  34. package/dist/public-templates.d.ts +1 -1
  35. package/dist/public-templates.js +1 -1
  36. package/dist/{raw-evidence-archive-Cz4j8VMw.js → raw-evidence-archive-XEDh0VUj.js} +1 -1
  37. package/dist/runtime.d.ts +5 -5
  38. package/dist/runtime.js +5 -5
  39. package/dist/{sandbox-hH0ULBcR.js → sandbox-DnuEGRn4.js} +44 -90
  40. package/dist/{select-seat-B4Y-7vIq.js → select-seat-CntQ4bko.js} +1 -1
  41. package/dist/select-seat-command.d.ts +2 -2
  42. package/dist/select-seat-command.js +2 -2
  43. package/dist/session-gateway/index.js +1 -1
  44. package/dist/tangle/index.d.ts +1 -1
  45. package/dist/tangle/index.js +1 -1
  46. package/dist/{tangle-CGi0LnU1.js → tangle-DjcPKCqo.js} +3 -3
  47. package/dist/{terminal-stream-types-eE97lZ-5.d.ts → terminal-stream-types-DBQuAsmB.d.ts} +13 -7
  48. package/dist/{types-B5GAxo6l.d.ts → types-C8aazs-y.d.ts} +297 -1178
  49. package/package.json +6 -6
@@ -1,23 +1,23 @@
1
- import { A as requestedPublicProfileDigest, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, U as normalizeEffectiveBackend, _ as mintTraceId, a as assertScopedTokenActive, b as validateAcceptedDispatchRunRef, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as encodePromptForWire, y as resolveDispatchRunIdentity } from "./interactive-controller-D4aEHlv_.js";
1
+ import { A as requestedPublicProfileDigest, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, U as normalizeEffectiveBackend, _ as mintTraceId, a as assertScopedTokenActive, b as validateAcceptedDispatchRunRef, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as encodePromptForWire, y as resolveDispatchRunIdentity } from "./interactive-controller-mqraKMkh.js";
2
2
  import { C as boundedIdentifierSchema$1, E as boundedStringSchema$1, g as sha256DigestSchema$1, o as canonicalCandidateDigest$1, s as canonicalCandidateJson$1 } from "./harness-DMaNgn0S.js";
3
3
  import { t as sha256$1 } from "./sha2-vu4U-x2L.js";
4
- import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-DJGhiJCm.js";
4
+ import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-CrBx8ETe.js";
5
5
  import { a as ProxySecretReceiptSchema$1, r as agentProfileSchema$1 } from "./profile-schema-C1KpT-wS.js";
6
6
  import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-BJChICex.js";
7
- import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, T as StreamInterruptedError, _ as NotFoundError, a as readResponseJson, d as EdgeNotReadyError, g as NetworkError, i as parseResponseError, l as CapabilityError, n as isTransientWrite, o as retryWhen, r as parseErrorResponse, s as AuthError, t as TerminalStreamError, w as StateError, y as ProfileFileMountPathError } from "./errors-nXGKGVFe.js";
7
+ import { C as SandboxError, D as TimeoutError, E as StreamInterruptedError, O as ValidationError, T as StateError, _ as NetworkError, a as readResponseJson, b as ProfileFileMountPathError, c as AuthError, f as EdgeNotReadyError, i as parseResponseError, n as isTransientWrite, o as responseMetadata, r as parseErrorResponse, s as retryWhen, t as TerminalStreamError, u as CapabilityError, v as NotFoundError, w as ServerError } from "./errors-DQEu-Q7s.js";
8
8
  import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-CRxC2dlT.js";
9
9
  import { a as backoffDelayMs, o as isUndelivered, r as abortableSleep } from "./retry-policy-oW3_ljoc.js";
10
- import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-DY_5Hnyl.js";
10
+ import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-Cm1H_xsv.js";
11
11
  import { a as SANDBOX_PROXY_REQUEST_MAX_BYTES, c as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, d as isProfileFileMountOutsideRoots, f as profileFileMountOutsideRootsMessage, l as SANDBOX_AGENT_HOME, o as FILE_OPERATION_LIMITS, u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-DOSTbUSR.js";
12
- import { c as awaitSdkResend, l as takeSdkTurn, s as uploadChunked } from "./chunked-upload-BlvgxPWx.js";
12
+ import { c as awaitSdkResend, l as takeSdkTurn, s as uploadChunked } from "./chunked-upload-B1kuuezC.js";
13
13
  import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-sGVP8skk.js";
14
14
  import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-DTdbCbUM.js";
15
15
  import { t as parseSSEStream } from "./sse-parser-BCG3iL9j.js";
16
16
  import { t as runPreparedProcess } from "./prepared-process-DQ_68Ofg.js";
17
17
  import { a as isBackendType, r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-mBUPER0R.js";
18
18
  import "./cli-auth-bundle-BLAtE6Dc.js";
19
- import { n as SandboxLines } from "./lines-CSGBHEjR.js";
20
- import { t as downloadFile } from "./file-download-BjkrYzy_.js";
19
+ import { n as SandboxLines } from "./lines-Bsp1TFBM.js";
20
+ import { t as downloadFile } from "./file-download-DXgIe-CV.js";
21
21
  import { z } from "zod";
22
22
  import { createHash } from "node:crypto";
23
23
  import { constants } from "node:fs";
@@ -12001,7 +12001,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
12001
12001
  var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabilities {
12002
12002
  /** @internal — invoked before the sandbox is deleted. */
12003
12003
  async _sessionExportRawEvidence(id, destination, options) {
12004
- const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-Cz4j8VMw.js");
12004
+ const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-XEDh0VUj.js");
12005
12005
  await this.ensureRunning();
12006
12006
  await this.refresh();
12007
12007
  return exportRawEvidenceDirectory((signal, archiveId, cancel) => this.runtimeFetch(`/agents/sessions/${encodeURIComponent(id)}/raw-evidence/archive?${new URLSearchParams([
@@ -12032,7 +12032,7 @@ var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabil
12032
12032
  * and the byte and file bounds are verified before the directory appears.
12033
12033
  */
12034
12034
  async exportRawEvidence(destination, options) {
12035
- const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-Cz4j8VMw.js");
12035
+ const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-XEDh0VUj.js");
12036
12036
  await this.ensureRunning();
12037
12037
  await this.refresh();
12038
12038
  return exportRawEvidenceDirectory((signal, archiveId, cancel) => this.runtimeFetch(`/agents/raw-evidence/archive?${new URLSearchParams({
@@ -13001,13 +13001,7 @@ var SandboxTurnCapabilities = class extends SandboxSessionCapabilities {
13001
13001
  };
13002
13002
  //#endregion
13003
13003
  //#region src/sandbox-snapshots.ts
13004
- /**
13005
- * How long `deleteSnapshot` waits out the platform holding the delete while
13006
- * the snapshot's resume generation is still copying to remote storage
13007
- * (409 RESUME_SNAPSHOT_RETAINED, resume_generation_unconfirmed) or another
13008
- * delete of it is in flight. The copy p99 measured in eu1 on 2026-10-27 was
13009
- * 72.8 s; the production journey met a 37.8 s hold after a restore.
13010
- */
13004
+ /** Bounded wait for a resume-copy or concurrent-delete retention hold. */
13011
13005
  const SNAPSHOT_DELETE_RETAINED_WAIT_MS = 12e4;
13012
13006
  const SNAPSHOT_DELETE_RETAINED_RETRY_MS = 2e3;
13013
13007
  const HELD_REASONS = new Set(["resume_generation_unconfirmed", "snapshot_delete_in_flight"]);
@@ -13094,11 +13088,7 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13094
13088
  ...idempotency ? { idempotency } : {}
13095
13089
  };
13096
13090
  }
13097
- /**
13098
- * `snapshot({ wait: false })`: the API may accept the capture and answer
13099
- * 202 with the operation; a capture it finished synchronously comes back as
13100
- * an operation that is already `succeeded`, its result naming the snapshot.
13101
- */
13091
+ /** Asynchronous acceptance returns an operation; synchronous capture returns a succeeded operation. */
13102
13092
  async #snapshotNoWait(options) {
13103
13093
  if ("paths" in options) throw new Error("Path-scoped snapshot capture is not supported; create a whole-workspace snapshot and use restorePaths()");
13104
13094
  if (options.storage) throw new Error("wait: false is not supported with customer-provided storage; the BYOS3 snapshot path keeps no operation record");
@@ -13122,32 +13112,7 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13122
13112
  tags: Array.isArray(body.tags) ? body.tags.filter((tag) => typeof tag === "string") : []
13123
13113
  } });
13124
13114
  }
13125
- /**
13126
- * List all snapshots for this sandbox.
13127
- *
13128
- * If `storage` is provided (BYOS3), lists snapshots from customer-provided
13129
- * S3 storage.
13130
- *
13131
- * @param storage - Optional customer storage config for BYOS3
13132
- * @returns Array of snapshot metadata
13133
- *
13134
- * @example List from our storage
13135
- * ```typescript
13136
- * const snapshots = await box.listSnapshots();
13137
- * for (const snap of snapshots) {
13138
- * console.log(`${snap.snapshotId}: ${snap.createdAt}`);
13139
- * }
13140
- * ```
13141
- *
13142
- * @example List from customer S3 (BYOS3)
13143
- * ```typescript
13144
- * const snapshots = await box.listSnapshots({
13145
- * type: "s3",
13146
- * bucket: "my-snapshots",
13147
- * credentials: { accessKeyId: "...", secretAccessKey: "..." },
13148
- * });
13149
- * ```
13150
- */
13115
+ /** List snapshots; storage selects the direct customer-S3 path. */
13151
13116
  async listSnapshots(storage) {
13152
13117
  if (storage) {
13153
13118
  await this.ensureRunning();
@@ -13180,13 +13145,7 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13180
13145
  };
13181
13146
  });
13182
13147
  }
13183
- /**
13184
- * Delete a snapshot.
13185
- *
13186
- * Deleting a snapshot that is already gone succeeds and reports
13187
- * `already_absent`, so a retry after an uncertain failure does not raise. A
13188
- * 404 means this sandbox is unknown, not that the snapshot was missing.
13189
- */
13148
+ /** Delete returns already_absent for a missing snapshot; 404 means the sandbox itself is unknown. */
13190
13149
  async deleteSnapshot(snapshotId, options) {
13191
13150
  const started = Date.now();
13192
13151
  const budgetMs = Math.min(SNAPSHOT_DELETE_RETAINED_WAIT_MS, options?.timeoutMs ?? SNAPSHOT_DELETE_RETAINED_WAIT_MS);
@@ -13202,19 +13161,39 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13202
13161
  await abortableSleep(Math.min(error.retryAfterMs ?? SNAPSHOT_DELETE_RETAINED_RETRY_MS, CREATE_RETRY_MAX_DELAY_MS, remainingMs));
13203
13162
  heldUntil = Date.now();
13204
13163
  }
13205
- const body = await response.json().catch(() => ({}));
13164
+ let parseState = "object";
13165
+ const data = await response.json().catch((error) => {
13166
+ parseState = error instanceof SyntaxError ? "invalid-json" : "body-read-failed";
13167
+ return {};
13168
+ });
13169
+ if (parseState === "object") parseState = data === null ? "null" : Array.isArray(data) ? "array" : typeof data === "object" ? "object" : "primitive";
13170
+ const receipt = {
13171
+ ...responseMetadata(response.status, response.headers),
13172
+ receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
13173
+ parseState
13174
+ };
13175
+ const body = data;
13176
+ let wireOutcome;
13177
+ try {
13178
+ wireOutcome = body.outcome;
13179
+ } catch (error) {
13180
+ throw Object.assign(error, receipt);
13181
+ }
13206
13182
  return {
13207
13183
  snapshotId,
13208
- outcome: body.outcome === "deleted" || body.outcome === "already_absent" ? body.outcome : "unknown",
13184
+ outcome: wireOutcome === "deleted" || wireOutcome === "already_absent" ? wireOutcome : "unknown",
13185
+ response: {
13186
+ ...receipt,
13187
+ attestation: {
13188
+ outcome: wireOutcome === void 0 ? "missing" : wireOutcome === "deleted" || wireOutcome === "already_absent" || wireOutcome === "unknown" ? wireOutcome : "unrecognized",
13189
+ ...typeof body.deleted === "boolean" ? { deleted: body.deleted } : {},
13190
+ ...typeof body.success === "boolean" ? { success: body.success } : {}
13191
+ }
13192
+ },
13209
13193
  ...heldUntil === void 0 ? {} : { retainedMs: heldUntil - started }
13210
13194
  };
13211
13195
  }
13212
- /**
13213
- * Ask whether the snapshot bound to an idempotency key is decided.
13214
- *
13215
- * Pass the same options the create carried for an exact-body lookup. Omit
13216
- * options to read the operation bound to this owner-scoped key.
13217
- */
13196
+ /** Read the checkpoint operation by key; options request an exact-body lookup. */
13218
13197
  async getSnapshotOperation(idempotencyKey, options) {
13219
13198
  const response = await state(this).client.fetch(`/v1/sandboxes/${this.id}/workspace-operations/lookup`, {
13220
13199
  method: "POST",
@@ -13255,10 +13234,7 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13255
13234
  if (response.status === 202) return this.waitForSnapshotRestore(snapshotId, data);
13256
13235
  return toSnapshotResult(data, state(this).profileProvenance);
13257
13236
  }
13258
- /**
13259
- * Settle a restore from its job's status. The restore's own 202, held to
13260
- * the job's end, is the first status read; only an unfinished one polls.
13261
- */
13237
+ /** Read the accepted restore job first; poll only while unfinished. */
13262
13238
  async waitForSnapshotRestore(snapshotId, accepted) {
13263
13239
  const deadline = Date.now() + SDK_TIMEOUTS.snapshot;
13264
13240
  let status = accepted;
@@ -13310,29 +13286,7 @@ var SandboxSnapshotCapabilities = class extends SandboxTurnCapabilities {
13310
13286
  };
13311
13287
  throw lastError instanceof Error ? lastError : new TimeoutError(`Request timed out after ${SNAPSHOT_VISIBILITY_TIMEOUT_MS}ms`, { timeoutMs: SNAPSHOT_VISIBILITY_TIMEOUT_MS });
13312
13288
  }
13313
- /**
13314
- * Restore from the latest snapshot in customer-provided storage.
13315
- * Only available when using BYOS3 (calls the runtime directly).
13316
- *
13317
- * @param storage - Customer storage config (required)
13318
- * @param destinationPath - Optional path to restore to
13319
- * @returns Snapshot info if restored, null if no snapshot found
13320
- *
13321
- * @example Restore from customer S3
13322
- * ```typescript
13323
- * const result = await box.restoreFromStorage({
13324
- * type: "s3",
13325
- * bucket: "my-snapshots",
13326
- * credentials: { accessKeyId: "...", secretAccessKey: "..." },
13327
- * });
13328
- *
13329
- * if (result) {
13330
- * console.log(`Restored from ${result.snapshotId}`);
13331
- * } else {
13332
- * console.log("No snapshot found");
13333
- * }
13334
- * ```
13335
- */
13289
+ /** Restore the latest customer-storage snapshot directly; null means none found. */
13336
13290
  async restoreFromStorage(storage, options) {
13337
13291
  if (!storage) throw new Error("Storage config is required for restoreFromStorage");
13338
13292
  await this.ensureRunning();
@@ -14167,7 +14121,7 @@ var SandboxFilesystemOperations = class extends DeclaredFilesystemOperations {
14167
14121
  totalBytes: size,
14168
14122
  percentage: 0
14169
14123
  });
14170
- const { uploadChunkedFromFile } = await import("./chunked-upload-file-DOeLpMO0.js");
14124
+ const { uploadChunkedFromFile } = await import("./chunked-upload-file-JfRw6PRf.js");
14171
14125
  await uploadChunkedFromFile({ fetch: (path, init) => this.host.runtimeFetch(path, init) }, remotePath, localPath, {
14172
14126
  mode: options?.permissions,
14173
14127
  onProgress: options?.onProgress ? (progress) => {
@@ -1,6 +1,6 @@
1
1
  import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
2
2
  import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-BJChICex.js";
3
- import { D as ValidationError, S as SandboxError, l as CapabilityError } from "./errors-nXGKGVFe.js";
3
+ import { C as SandboxError, O as ValidationError, u as CapabilityError } from "./errors-DQEu-Q7s.js";
4
4
  import { t as awaitWithAbort } from "./abort-signal-CRxC2dlT.js";
5
5
  import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-mBUPER0R.js";
6
6
  import "./cli-auth-bundle-BLAtE6Dc.js";
@@ -1,5 +1,5 @@
1
- import { L as SandboxError } from "./terminal-stream-types-eE97lZ-5.js";
2
- import { ht as SeatOwnerTransport, vt as SeatSelectionRequest } from "./client-OYkwBKG2.js";
1
+ import { R as SandboxError } from "./terminal-stream-types-DBQuAsmB.js";
2
+ import { ht as SeatOwnerTransport, vt as SeatSelectionRequest } from "./client-Cy6Zlb3W.js";
3
3
 
4
4
  //#region src/select-seat-command.d.ts
5
5
  /** Public reply bound; the owner prints one metadata object. */
@@ -1,5 +1,5 @@
1
- import { D as ValidationError, S as SandboxError } from "./errors-nXGKGVFe.js";
2
- import { n as SEAT_OWNER_MAX_RESPONSE_BYTES } from "./select-seat-B4Y-7vIq.js";
1
+ import { C as SandboxError, O as ValidationError } from "./errors-DQEu-Q7s.js";
2
+ import { n as SEAT_OWNER_MAX_RESPONSE_BYTES } from "./select-seat-CntQ4bko.js";
3
3
  import { spawn } from "node:child_process";
4
4
  //#region src/select-seat-command.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { n as combineAbortSignals } from "../abort-signal-CRxC2dlT.js";
2
- import { i as fetchSandboxApi } from "../api-request-DY_5Hnyl.js";
2
+ import { i as fetchSandboxApi } from "../api-request-Cm1H_xsv.js";
3
3
  import "../sidecar-proxy-error-DTdbCbUM.js";
4
4
  import { t as parseSSEStream } from "../sse-parser-BCG3iL9j.js";
5
5
  import { PART_TEXT, PART_TEXT_SUFFIX } from "@tangle-network/agent-core/sse";
@@ -1,2 +1,2 @@
1
- import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_CHAIN_ID, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as BlueprintSandboxClientConfig, h as BlueprintSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_JOBS_CONTRACT, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-C8YpXh5N.js";
1
+ import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_CHAIN_ID, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as BlueprintSandboxClientConfig, h as BlueprintSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_JOBS_CONTRACT, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-DYxmMGbU.js";
2
2
  export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, BlueprintSandboxClientConfig, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,2 +1,2 @@
1
- import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-CGi0LnU1.js";
1
+ import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-DjcPKCqo.js";
2
2
  export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,6 +1,6 @@
1
- import { L as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-hH0ULBcR.js";
2
- import { a as readResponseJson } from "./errors-nXGKGVFe.js";
3
- import { i as fetchSandboxApi } from "./api-request-DY_5Hnyl.js";
1
+ import { L as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-DnuEGRn4.js";
2
+ import { a as readResponseJson } from "./errors-DQEu-Q7s.js";
3
+ import { i as fetchSandboxApi } from "./api-request-Cm1H_xsv.js";
4
4
  import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-BT2q9nkO.js";
5
5
  //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
6
6
  /**
@@ -3477,6 +3477,9 @@ interface SandboxErrorMetadata {
3477
3477
  cause?: unknown;
3478
3478
  origin?: SandboxErrorOrigin;
3479
3479
  endpoint?: string;
3480
+ method?: string;
3481
+ requestId?: string;
3482
+ traceId?: string;
3480
3483
  retryAfterMs?: number;
3481
3484
  restartKind?: HostAgentRestartKind;
3482
3485
  sidecarVersion?: string;
@@ -3584,17 +3587,20 @@ declare class StreamInterruptedError extends SandboxError {}
3584
3587
  declare class ServerError extends SandboxError {}
3585
3588
  //#endregion
3586
3589
  //#region src/errors.d.ts
3587
- /**
3588
- * Parse an error response from the API.
3589
- * @param status - HTTP status code
3590
- * @param body - Response body text
3591
- * @param context - Optional request context for better error messages
3592
- */
3590
+ /** Parse HTTP refusals into catalog-owned errors with response context. */
3593
3591
  declare function parseErrorResponse(status: number, body: string, context?: {
3594
3592
  method?: string;
3595
3593
  path?: string;
3596
3594
  allPreviousCreateAttemptsRefused?: boolean;
3597
3595
  }, headers?: Headers): SandboxError;
3596
+ /** Allowlisted response identity; absent headers never acquire synthetic ids. */
3597
+ declare function responseMetadata(status: number, headers?: Headers): {
3598
+ status: number;
3599
+ requestId: string | undefined;
3600
+ traceId: string | undefined;
3601
+ method: string | undefined;
3602
+ endpoint: string | undefined;
3603
+ };
3598
3604
  /**
3599
3605
  * A terminal protocol `error` frame (`code` is its protocol code, e.g.
3600
3606
  * `INIT_FAILED`) or a socket fault (`TRANSPORT`). `beforeOpen` is true when
@@ -3888,4 +3894,4 @@ interface TerminalStreamOptions {
3888
3894
  mintMs?: number;
3889
3895
  }
3890
3896
  //#endregion
3891
- export { PublicBatchRunRequest as $, KeyBudgetExhaustedError as A, AgentProfileMcpServer as At, ServerError as B, BatchEvent as Bt, CapabilityError as C, InteractionRequest as Ct, FileWriteConflictError as D, AgentProfileConfidential as Dt, EgressProxyRecoveryError as E, AgentProfileCapabilities as Et, QuotaError as F, HarnessType as Ft, ValidationError as G, StreamInterruptedError as H, BatchSidecarGroup as Ht, ResumeEnvRequiredError as I, ProxySecretReceipt as It, BatchCustody as J, SandboxCreateOutcome as K, SandboxError as L, InteractionData as Lt, NotFoundError as M, AgentProfileSeat as Mt, PartialFailureError as N, AgentProfileValidationResult as Nt, GpuProviderNotConfiguredError as O, AgentProfileConfigValue as Ot, ProfileFileMountPathError as P, ReasoningEffort as Pt, BatchTaskInput as Q, SandboxErrorJson as R, PlanContinuation as Rt, BranchFanoutExceedsHostError as S, InteractionAcknowledgement as St, EdgeNotReadyError as T, AgentProfile as Tt, StreamInterruptionReason as U, BatchTaskUsage as Ut, StateError as V, BatchEventDataMap as Vt, TimeoutError as W, BatchTaskResult as X, BatchResult as Y, BatchBackendInput as Z, TerminalReadyTimings as _, TerminalOutputEvent as _t, TerminalStreamOptions as a, AgentInteractiveSessionAttach as at, parseErrorResponse as b, AgentRunCancellationAcknowledgement as bt, MintInteractiveSessionTokenOptions as c, AgentInteractiveSessionControlClaimRequest as ct, ScopedTokenScope as d, AgentInteractiveSessionRef as dt, PublicBatchRunRequestInput as et, TERMINAL_WS_ECHO_SUBPROTOCOL as f, AgentInteractiveSessionStatus as ft, TerminalReadyInfo as g, agentInteractiveSessionPromptRequestDigest as gt, TerminalOutputMessage as h, AgentInteractiveTerminalSession as ht, TerminalStreamHandlers as i, AgentInteractiveSessionStart as it, NetworkError as j, AgentProfileMetadata as jt, GpuProviderRequirement as k, AgentProfileFileMount as kt, MintScopedTokenOptions as l, AgentInteractiveSessionPromptAcknowledgement as lt, TerminalInteractiveSessionIdentity as m, AgentInteractiveSessionStopCommand as mt, TerminalStreamApiKey as n, SandboxSizePreset as nt, TerminalStreamReconnectAuthority as o, AgentInteractiveSessionControlClaim as ot, TerminalExitInfo as p, AgentInteractiveSessionStopAcknowledgement as pt, SandboxCreateReceipt as q, TerminalStreamBearerToken as r, AgentRuntimeAttachments as rt, TerminalStreamToken as s, AgentInteractiveSessionControlClaimAcknowledgement as st, TerminalAttachTimings as t, SANDBOX_SIZE_PRESET_NAMES as tt, ScopedToken as u, AgentInteractiveSessionPromptCommand as ut, TerminalStreamAuthFormat as v, TerminalReplayWindow as vt, CompliancePlacementError as w, InteractionResponseCommand as wt, AuthError as x, AgentRunCancellationRequest as xt, TerminalStreamError as y, AgentExactRunControlRef as yt, SandboxFailureDetail as z, BatchBackendStats as zt };
3897
+ export { BatchBackendInput as $, GpuProviderRequirement as A, AgentProfileConfigValue as At, SandboxErrorMetadata as B, PlanContinuation as Bt, BranchFanoutExceedsHostError as C, AgentRunCancellationRequest as Ct, EgressProxyRecoveryError as D, AgentProfile as Dt, EdgeNotReadyError as E, InteractionResponseCommand as Et, ProfileFileMountPathError as F, AgentProfileValidationResult as Ft, StreamInterruptionReason as G, BatchTaskUsage as Gt, ServerError as H, BatchEvent as Ht, QuotaError as I, ReasoningEffort as It, SandboxCreateOutcome as J, TimeoutError as K, ResumeEnvRequiredError as L, HarnessType as Lt, NetworkError as M, AgentProfileMcpServer as Mt, NotFoundError as N, AgentProfileMetadata as Nt, FileWriteConflictError as O, AgentProfileCapabilities as Ot, PartialFailureError as P, AgentProfileSeat as Pt, BatchTaskResult as Q, SandboxError as R, ProxySecretReceipt as Rt, AuthError as S, AgentRunCancellationAcknowledgement as St, CompliancePlacementError as T, InteractionRequest as Tt, StateError as U, BatchEventDataMap as Ut, SandboxFailureDetail as V, BatchBackendStats as Vt, StreamInterruptedError as W, BatchSidecarGroup as Wt, BatchCustody as X, SandboxCreateReceipt as Y, BatchResult as Z, TerminalReadyTimings as _, AgentInteractiveTerminalSession as _t, TerminalStreamOptions as a, AgentRuntimeAttachments as at, parseErrorResponse as b, TerminalReplayWindow as bt, MintInteractiveSessionTokenOptions as c, AgentInteractiveSessionControlClaim as ct, ScopedTokenScope as d, AgentInteractiveSessionPromptAcknowledgement as dt, BatchTaskInput as et, TERMINAL_WS_ECHO_SUBPROTOCOL as f, AgentInteractiveSessionPromptCommand as ft, TerminalReadyInfo as g, AgentInteractiveSessionStopCommand as gt, TerminalOutputMessage as h, AgentInteractiveSessionStopAcknowledgement as ht, TerminalStreamHandlers as i, SandboxSizePreset as it, KeyBudgetExhaustedError as j, AgentProfileFileMount as jt, GpuProviderNotConfiguredError as k, AgentProfileConfidential as kt, MintScopedTokenOptions as l, AgentInteractiveSessionControlClaimAcknowledgement as lt, TerminalInteractiveSessionIdentity as m, AgentInteractiveSessionStatus as mt, TerminalStreamApiKey as n, PublicBatchRunRequestInput as nt, TerminalStreamReconnectAuthority as o, AgentInteractiveSessionStart as ot, TerminalExitInfo as p, AgentInteractiveSessionRef as pt, ValidationError as q, TerminalStreamBearerToken as r, SANDBOX_SIZE_PRESET_NAMES as rt, TerminalStreamToken as s, AgentInteractiveSessionAttach as st, TerminalAttachTimings as t, PublicBatchRunRequest as tt, ScopedToken as u, AgentInteractiveSessionControlClaimRequest as ut, TerminalStreamAuthFormat as v, agentInteractiveSessionPromptRequestDigest as vt, CapabilityError as w, InteractionAcknowledgement as wt, responseMetadata as x, AgentExactRunControlRef as xt, TerminalStreamError as y, TerminalOutputEvent as yt, SandboxErrorJson as z, InteractionData as zt };