@tangle-network/sandbox 0.62.14 → 0.62.16

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 (39) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +4 -4
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/{agent-run-outcome-BjZ1EHSq.d.ts → agent-run-outcome-DelYPNu3.d.ts} +1 -1
  5. package/dist/auth/index.js +1 -1
  6. package/dist/{chunked-upload-ClCKGr59.js → chunked-upload-B867njKv.js} +2 -59
  7. package/dist/{chunked-upload-file-RaMaNFN_.js → chunked-upload-file-Bs5qcfRB.js} +2 -1
  8. package/dist/{client-CdNw2DEF.js → client-C1hSgXB-.js} +9 -8
  9. package/dist/{client-C7KaqyfN.d.ts → client-CAA0Vnkx.d.ts} +5 -5
  10. package/dist/collaboration/index.js +1 -1
  11. package/dist/{collaboration-DZCyTGdn.js → collaboration-CXtTwK3x.js} +1 -1
  12. package/dist/core.d.ts +8 -8
  13. package/dist/core.js +4 -4
  14. package/dist/{errors-DSJBKmGZ.js → errors-Bfhg_Zc6.js} +130 -1
  15. package/dist/{errors-BSmxfVt0.d.ts → errors-DNxN33_n.d.ts} +14 -2
  16. package/dist/{index-BiJDEVsu.d.ts → index-5Iv50Yu9.d.ts} +2 -2
  17. package/dist/index.d.ts +10 -10
  18. package/dist/index.js +7 -7
  19. package/dist/intelligence/index.js +1 -1
  20. package/dist/{interactive-controller-B2VcB_SK.js → interactive-controller-B8W1CCXk.js} +18 -18
  21. package/dist/{lines-CodL_Yhd.d.ts → lines-joXwwKub.d.ts} +1 -1
  22. package/dist/lines.d.ts +1 -1
  23. package/dist/lines.js +1 -1
  24. package/dist/{local-cli-auth-BSFX2vnt.js → local-cli-auth-yn7YxF87.js} +1 -1
  25. package/dist/{managed-process-BEgMYGGu.d.ts → managed-process-Cri6fY06.d.ts} +1 -1
  26. package/dist/{preview-BamI9Yoe.d.ts → preview-BWkrbSW-.d.ts} +3 -3
  27. package/dist/{public-templates-CAMfH_Yr.d.ts → public-templates-DtRGMy8F.d.ts} +2 -2
  28. package/dist/public-templates.d.ts +1 -1
  29. package/dist/public-templates.js +1 -1
  30. package/dist/runtime.d.ts +4 -4
  31. package/dist/runtime.js +4 -4
  32. package/dist/{sandbox-BGyIDjUH.js → sandbox-ChgyE6cI.js} +128 -24
  33. package/dist/{sandbox-I390rjrp.d.ts → sandbox-I9ZSVMP7.d.ts} +12 -4
  34. package/dist/tangle/index.d.ts +1 -1
  35. package/dist/tangle/index.js +1 -1
  36. package/dist/{tangle-9PQPjv8y.js → tangle-CSMVbnXg.js} +2 -2
  37. package/dist/{types-Bal6rlUP.d.ts → types-C-VC0oGh.d.ts} +12 -2
  38. package/package.json +3 -3
  39. /package/dist/{cli-auth-bundle-BvXQd1UX.js → cli-auth-bundle-DBRU4ifV.js} +0 -0
@@ -1,7 +1,7 @@
1
- import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-I390rjrp.js";
2
- import { D as CodeExecutionResult, Do as BackendType, E as CodeExecutionOptions, O as CodeLanguage, d as BackendConfig, fa as SessionListOptions, k as CodeResultPart, si as SandboxFleetParent, ua as SessionInfo } from "../types-Bal6rlUP.js";
3
- import { i as Sandbox } from "../client-C7KaqyfN.js";
4
- import { u as PreviewAuthorizer } from "../preview-BamI9Yoe.js";
1
+ import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-I9ZSVMP7.js";
2
+ import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, Oo as BackendType, ci as SandboxFleetParent, d as BackendConfig, da as SessionInfo, k as CodeResultPart, pa as SessionListOptions } from "../types-C-VC0oGh.js";
3
+ import { i as Sandbox } from "../client-CAA0Vnkx.js";
4
+ import { u as PreviewAuthorizer } from "../preview-BWkrbSW-.js";
5
5
  import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
6
6
  import { JSONSchema } from "zod/v4/core";
7
7
  import { ToolSet } from "ai";
@@ -1,8 +1,8 @@
1
1
  import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-BYHcA72Z.js";
2
- import { k as assertCurrentBackendType } from "../interactive-controller-B2VcB_SK.js";
3
- import { _ as StateError, b as ValidationError, d as NotFoundError } from "../errors-DSJBKmGZ.js";
4
- import { n as Sandbox } from "../client-CdNw2DEF.js";
5
- import { t as SandboxInstance } from "../sandbox-BGyIDjUH.js";
2
+ import { A as assertCurrentBackendType } from "../interactive-controller-B8W1CCXk.js";
3
+ import { d as NotFoundError, v as StateError, x as ValidationError } from "../errors-Bfhg_Zc6.js";
4
+ import { n as Sandbox } from "../client-C1hSgXB-.js";
5
+ import { t as SandboxInstance } from "../sandbox-ChgyE6cI.js";
6
6
  import { z } from "zod";
7
7
  //#region src/agent/instances.ts
8
8
  const managers = /* @__PURE__ */ new WeakMap();
@@ -1,2 +1,2 @@
1
- import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-BamI9Yoe.js";
1
+ import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-BWkrbSW-.js";
2
2
  export { AgentPreviewError, AgentPreviewOptions, PREVIEW_MCP_ALIAS, PREVIEW_TOOLS, PreviewAuthorizationRequest, PreviewAuthorizer, PreviewExecutionContext, PreviewTool, PublishAgentPreviewOptions, assertPreviewId, ensureAgentPreview, getAgentPreview, listAgentPreviews, previewOperationTool, previewToolsForProfile, publishAgentPreview, removeAgentPreview, resolveSelfSandbox, servePreviewMcp };
@@ -1,4 +1,4 @@
1
- import { Hr as SandboxEvent, a as AgentQuestionRequest, dt as DurablePlanSnapshot, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-Bal6rlUP.js";
1
+ import { Ur as SandboxEvent, a as AgentQuestionRequest, ft as DurablePlanSnapshot, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-C-VC0oGh.js";
2
2
  import { InteractionRequest } from "@tangle-network/agent-interface";
3
3
 
4
4
  //#region src/agent-run-outcome.d.ts
@@ -1,4 +1,4 @@
1
- import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-BvXQd1UX.js";
1
+ import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-DBRU4ifV.js";
2
2
  //#region src/auth/tokens.ts
3
3
  const textEncoder = new TextEncoder();
4
4
  const textDecoder = new TextDecoder();
@@ -1,61 +1,4 @@
1
- import { g as ServerError, h as SandboxError, p as QuotaError, u as NetworkError, x as parseErrorResponse, y as TimeoutError } from "./errors-DSJBKmGZ.js";
2
- //#region ../../../packages/runtime-contracts/dist/file-limits.js
3
- const MEBIBYTE$1 = 1024 * 1024;
4
- 10 * MEBIBYTE$1;
5
- const FILE_DECODED_WRITE_MAX_BYTES = 5 * MEBIBYTE$1;
6
- 5 * MEBIBYTE$1;
7
- 10 * MEBIBYTE$1;
8
- 5 * MEBIBYTE$1;
9
- //#endregion
10
- //#region ../../../packages/runtime-contracts/dist/request-limits.js
11
- /**
12
- * Raw WIRE/TRANSPORT caps: request-byte limits checked while the body
13
- * streams in (bodyLimit middleware, Content-Length, encoded proxy bodies),
14
- * before anything is parsed or decoded. Rejections against these carry
15
- * code `PAYLOAD_TOO_LARGE` (`payload-too-large.ts`) — the remedy is to
16
- * split the delivery. Decoded/parsed-content caps (code `FILE_TOO_LARGE`)
17
- * live in `file-io.ts`.
18
- */
19
- const MEBIBYTE = 1024 * 1024;
20
- /**
21
- * Gateway (CF Worker) proxy cap on any request body it forwards — both
22
- * pass-through requests and route-constructed (`options.body`) proxy
23
- * payloads. Workers buffer forwarded bodies (streaming upstream stalls),
24
- * so this bounds Worker memory per request.
25
- */
26
- const SANDBOX_PROXY_REQUEST_MAX_BYTES = MEBIBYTE;
27
- 32 * MEBIBYTE;
28
- /**
29
- * Max assembled size of one chunked-upload session — the ceiling of the
30
- * sanctioned >1 MiB delivery path. Parts stage in sidecar memory until
31
- * commit, so this bounds per-session memory, not the destination
32
- * filesystem.
33
- */
34
- const FILE_UPLOAD_SESSION_MAX_BYTES = 64 * MEBIBYTE;
35
- 128 * MEBIBYTE;
36
- //#endregion
37
- //#region ../../../packages/runtime-contracts/dist/size-limit-errors.js
38
- /** Canonical error codes for wire-size and decoded-content rejections. */
39
- const PAYLOAD_TOO_LARGE_CODE = "PAYLOAD_TOO_LARGE";
40
- const FILE_TOO_LARGE_CODE = "FILE_TOO_LARGE";
41
- function isRecord(value) {
42
- return value !== null && typeof value === "object" && !Array.isArray(value);
43
- }
44
- function isPositiveInteger(value) {
45
- return typeof value === "number" && Number.isInteger(value) && value > 0;
46
- }
47
- function isSizeLimitErrorBodyFor(value, code) {
48
- if (!isRecord(value) || value.success !== false || !isRecord(value.error)) return false;
49
- const error = value.error;
50
- return error.code === code && typeof error.message === "string" && typeof error.surface === "string" && isPositiveInteger(error.limitBytes) && (error.actualBytes === void 0 || isPositiveInteger(error.actualBytes));
51
- }
52
- function isPayloadTooLargeErrorBody(value) {
53
- return isSizeLimitErrorBodyFor(value, PAYLOAD_TOO_LARGE_CODE);
54
- }
55
- function isFileTooLargeErrorBody(value) {
56
- return isSizeLimitErrorBodyFor(value, FILE_TOO_LARGE_CODE);
57
- }
58
- //#endregion
1
+ import { D as FILE_UPLOAD_SESSION_MAX_BYTES, E as isPayloadTooLargeErrorBody, S as parseErrorResponse, T as isFileTooLargeErrorBody, _ as ServerError, b as TimeoutError, g as SandboxError, m as QuotaError, u as NetworkError } from "./errors-Bfhg_Zc6.js";
59
2
  //#region src/lib/chunked-upload.ts
60
3
  /**
61
4
  * Chunked upload — the sanctioned SDK path for delivering payloads larger
@@ -432,4 +375,4 @@ var ChunkedUploadInterruptedError = class extends Error {
432
375
  }
433
376
  };
434
377
  //#endregion
435
- export { planCompression as a, FILE_UPLOAD_SESSION_MAX_BYTES as c, partCount as i, SANDBOX_PROXY_REQUEST_MAX_BYTES as l, commitSession as n, putPart as o, initUploadSession as r, uploadChunked as s, abortSession as t, FILE_DECODED_WRITE_MAX_BYTES as u };
378
+ export { planCompression as a, partCount as i, commitSession as n, putPart as o, initUploadSession as r, uploadChunked as s, abortSession as t };
@@ -1,4 +1,5 @@
1
- import { a as planCompression, c as FILE_UPLOAD_SESSION_MAX_BYTES, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-ClCKGr59.js";
1
+ import { D as FILE_UPLOAD_SESSION_MAX_BYTES } from "./errors-Bfhg_Zc6.js";
2
+ import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-B867njKv.js";
2
3
  import { createHash } from "node:crypto";
3
4
  import { open } from "node:fs/promises";
4
5
  //#region src/lib/chunked-upload-file.ts
@@ -1,8 +1,8 @@
1
1
  import { r as backendTypeSchema } from "./backend-types-D6bYbvMB.js";
2
- import { A as foldModelRoutingFields, D as parseSSEStream, F as withProfileHarness, I as withoutCreateOnlyModelFields, M as normalizeRuntimeBackendConfig, O as applyRequestedModel, T as encodePromptForWire, c as requestInteractiveSessionToken, k as assertCurrentBackendType } from "./interactive-controller-B2VcB_SK.js";
3
- import { C as readResponseJson, S as parseResponseError, b as ValidationError, d as NotFoundError, f as PartialFailureError, g as ServerError, h as SandboxError, l as NON_RETRYABLE_CREATE_QUOTA_REASONS, p as QuotaError, s as GpuProviderNotConfiguredError, t as AuthError, u as NetworkError, x as parseErrorResponse, y as TimeoutError } from "./errors-DSJBKmGZ.js";
2
+ import { A as assertCurrentBackendType, E as encodePromptForWire, I as withProfileHarness, L as withoutCreateOnlyModelFields, N as normalizeRuntimeBackendConfig, O as parseSSEStream, c as requestInteractiveSessionToken, j as foldModelRoutingFields, k as applyRequestedModel } from "./interactive-controller-B8W1CCXk.js";
3
+ import { C as parseResponseError, S as parseErrorResponse, _ as ServerError, b as TimeoutError, d as NotFoundError, f as PartialFailureError, g as SandboxError, l as NON_RETRYABLE_CREATE_QUOTA_REASONS, m as QuotaError, s as GpuProviderNotConfiguredError, t as AuthError, u as NetworkError, w as readResponseJson, x as ValidationError } from "./errors-Bfhg_Zc6.js";
4
4
  import { f as combineAbortSignals } from "./browser-interactive-control-controller-BJf0P_J4.js";
5
- import { A as rewrapResponse, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, M as exportTraceBundle, O as normalizeConnection, T as splitInlineProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, k as normalizeSandboxShape, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof } from "./sandbox-BGyIDjUH.js";
5
+ import { A as normalizeSandboxShape, D as splitInlineProfileSkills, E as splitInlineProfileFileMounts, N as exportTraceBundle, O as validateDeferredProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, j as rewrapResponse, k as normalizeConnection, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof, w as isRetryableProfileFileMaterializeFailure } from "./sandbox-ChgyE6cI.js";
6
6
  import { n as fetchWithKeepAlive } from "./keep-alive-fetch-qPVvvkgJ.js";
7
7
  import { LinesClient } from "./lines.js";
8
8
  import { PublicTemplatesClient } from "./public-templates.js";
@@ -3340,11 +3340,11 @@ function withRequestContextHeaders(response, path, method, body = response.body)
3340
3340
  return rewrapResponse(response, headers, body);
3341
3341
  }
3342
3342
  async function resolveLocalCliAuthFiles(backendType) {
3343
- const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-BSFX2vnt.js");
3343
+ const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-yn7YxF87.js");
3344
3344
  return discoverLocalCliAuthFiles(backendType);
3345
3345
  }
3346
3346
  async function describeLocalCliAuthExpectation(backendType) {
3347
- const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-BSFX2vnt.js");
3347
+ const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-yn7YxF87.js");
3348
3348
  return describe(backendType);
3349
3349
  }
3350
3350
  /**
@@ -3668,7 +3668,7 @@ var Sandbox = class Sandbox {
3668
3668
  handleProfile = split.leanProfile;
3669
3669
  if (deferredProfileFiles.length > 0) {
3670
3670
  profileFilesFailOnError = profile.resources?.failOnError !== false;
3671
- validateDeferredProfileFileMounts(deferredProfileFiles);
3671
+ deferredProfileFiles = validateDeferredProfileFileMounts(deferredProfileFiles, { failOnError: profileFilesFailOnError });
3672
3672
  }
3673
3673
  }
3674
3674
  handleBackend = {
@@ -3862,7 +3862,7 @@ var Sandbox = class Sandbox {
3862
3862
  console.warn(`[sandbox.create] ${message}`);
3863
3863
  return instance;
3864
3864
  }
3865
- throw new PartialFailureError(message, "PROFILE_FILES_MATERIALIZE_FAILED", 502, void 0, paths.map((path) => ({ path })));
3865
+ throw new PartialFailureError(message, "PROFILE_FILES_MATERIALIZE_INTERRUPTED", 502, void 0, paths.map((path) => ({ path })));
3866
3866
  }
3867
3867
  try {
3868
3868
  await instance.materializeProfileFiles(resolvedBackend.profile, void 0, "replace");
@@ -3873,7 +3873,8 @@ var Sandbox = class Sandbox {
3873
3873
  console.warn(`[sandbox.create] ${message}`);
3874
3874
  return instance;
3875
3875
  }
3876
- throw new PartialFailureError(message, "PROFILE_FILES_MATERIALIZE_FAILED", 502, void 0, paths.map((path) => ({ path })), err);
3876
+ const retryable = isRetryableProfileFileMaterializeFailure(err);
3877
+ throw new PartialFailureError(message, retryable ? "PROFILE_FILES_MATERIALIZE_INTERRUPTED" : "PROFILE_FILES_MATERIALIZE_FAILED", retryable ? 502 : 422, void 0, paths.map((path) => ({ path })), err);
3877
3878
  }
3878
3879
  }
3879
3880
  if (deferredProfileForPriming !== void 0) try {
@@ -1,9 +1,9 @@
1
- import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance } from "./sandbox-I390rjrp.js";
2
- import { B as CreateSandboxOptions, Bt as FleetDispatchCancelResult, Ci as SandboxInfo, Cn as HttpClient, Dn as IntelligenceReportCompareTo, Ea as SshKeysManager, En as IntelligenceReportBudget, F as CreateIntelligenceReportOptions, Fr as SandboxConfig, G as DeleteMatchingSandboxesFilter, Gr as SandboxFleetArtifact, Gt as FleetDriveTurnRequest, Ha as TokenRefreshHandler, Ht as FleetDispatchResultBufferOptions, I as CreateRequestOptions, It as FleetAgentId, Jt as FleetMachineId, K as DeleteMatchingSandboxesOptions, Kr as SandboxFleetArtifactSpec, Kt as FleetExecDispatchOptions, L as CreateSandboxFleetOptions, M as ConversationTurnOptions, N as ConversationTurnResult, Ni as SandboxRunGeneration, Nn as ListSandboxFleetOptions, Pn as ListSandboxOptions, Qr as SandboxFleetInfo, Qt as FleetRunOptions, R as CreateSandboxFleetTokenOptions, Ri as SandboxShapesInfo, Rt as FleetAgentResult, Si as SandboxIdentity, So as BatchEvent, St as ExecResult, Tn as IntelligenceReport, Ur as SandboxFleetAgent, Ut as FleetDispatchStreamOptions, Vr as SandboxEnvironment, Vt as FleetDispatchResultBuffer, Wt as FleetDriveTurnOutcome, Xr as SandboxFleetDriverCapability, Xt as FleetPromptDispatchResult, Ya as UsageInfo, Yr as SandboxFleetDispatchResponse, Yt as FleetPromptDispatchOptions, Zt as FleetRunEvent, _i as SandboxFleetUsage, b as BatchRunRequest, bi as SandboxFleetWorkspaceRestoreResult, br as ReconcileSandboxFleetsOptions, cr as PromptResult, d as BackendConfig, di as SandboxFleetSpend, ea as SecretsManager, fi as SandboxFleetToken, gi as SandboxFleetTraceOptions, ii as SandboxFleetManifest, ja as SubscriptionInfo, kn as IntelligenceReportWindow, l as AttachSandboxFleetMachineOptions, li as SandboxFleetPolicy, ni as SandboxFleetMachineRecord, no as SdkTimingHook, oi as SandboxFleetOperationsSummary, or as PromptInputPart, pi as SandboxFleetTraceBundle, q as DeleteMatchingSandboxesResult, qr as SandboxFleetCostEstimate, qt as FleetExecDispatchResult, ri as SandboxFleetMachineSpec, si as SandboxFleetParent, sr as PromptOptions, v as BatchResult, vr as ReapExpiredSandboxFleetsOptions, xi as SandboxFleetWorkspaceSnapshotResult, xr as ReconcileSandboxFleetsResult, xt as ExecOptions, y as BatchRunOptions, yi as SandboxFleetWorkspaceReconcileResult, yr as ReapExpiredSandboxFleetsResult, z as CreateSandboxFleetWithCoordinatorOptions } from "./types-Bal6rlUP.js";
1
+ import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance } from "./sandbox-I9ZSVMP7.js";
2
+ import { $r as SandboxFleetInfo, $t as FleetRunOptions, An as IntelligenceReportWindow, B as CreateSandboxFleetWithCoordinatorOptions, Ci as SandboxIdentity, Co as BatchEvent, Ct as ExecResult, Da as SshKeysManager, Dn as IntelligenceReportBudget, En as IntelligenceReport, Fn as ListSandboxOptions, Gt as FleetDriveTurnOutcome, Hr as SandboxEnvironment, Ht as FleetDispatchResultBuffer, I as CreateIntelligenceReportOptions, Ir as SandboxConfig, J as DeleteMatchingSandboxesResult, Jr as SandboxFleetCostEstimate, Jt as FleetExecDispatchResult, K as DeleteMatchingSandboxesFilter, Kr as SandboxFleetArtifact, Kt as FleetDriveTurnRequest, L as CreateRequestOptions, Lt as FleetAgentId, Ma as SubscriptionInfo, N as ConversationTurnOptions, On as IntelligenceReportCompareTo, P as ConversationTurnResult, Pi as SandboxRunGeneration, Pn as ListSandboxFleetOptions, Qt as FleetRunEvent, R as CreateSandboxFleetOptions, Si as SandboxFleetWorkspaceSnapshotResult, Sr as ReconcileSandboxFleetsResult, St as ExecOptions, Ua as TokenRefreshHandler, Ut as FleetDispatchResultBufferOptions, V as CreateSandboxOptions, Vt as FleetDispatchCancelResult, Wr as SandboxFleetAgent, Wt as FleetDispatchStreamOptions, Xa as UsageInfo, Xr as SandboxFleetDispatchResponse, Xt as FleetPromptDispatchOptions, Yt as FleetMachineId, Zr as SandboxFleetDriverCapability, Zt as FleetPromptDispatchResult, _i as SandboxFleetTraceOptions, ai as SandboxFleetManifest, b as BatchRunRequest, bi as SandboxFleetWorkspaceReconcileResult, br as ReapExpiredSandboxFleetsResult, ci as SandboxFleetParent, cr as PromptOptions, d as BackendConfig, fi as SandboxFleetSpend, ii as SandboxFleetMachineSpec, l as AttachSandboxFleetMachineOptions, lr as PromptResult, mi as SandboxFleetTraceBundle, pi as SandboxFleetToken, q as DeleteMatchingSandboxesOptions, qr as SandboxFleetArtifactSpec, qt as FleetExecDispatchOptions, ri as SandboxFleetMachineRecord, ro as SdkTimingHook, si as SandboxFleetOperationsSummary, sr as PromptInputPart, ta as SecretsManager, ui as SandboxFleetPolicy, v as BatchResult, vi as SandboxFleetUsage, wi as SandboxInfo, wn as HttpClient, xi as SandboxFleetWorkspaceRestoreResult, xr as ReconcileSandboxFleetsOptions, y as BatchRunOptions, yr as ReapExpiredSandboxFleetsOptions, z as CreateSandboxFleetTokenOptions, zi as SandboxShapesInfo, zt as FleetAgentResult } from "./types-C-VC0oGh.js";
3
3
  import { d as MintInteractiveSessionTokenOptions, p as ScopedToken } from "./terminal-stream-DgD7GlFi.js";
4
- import { L as LinesClient } from "./lines-CodL_Yhd.js";
5
- import { h as SandboxError } from "./errors-BSmxfVt0.js";
6
- import { a as PublicTemplatesClient } from "./public-templates-CAMfH_Yr.js";
4
+ import { L as LinesClient } from "./lines-joXwwKub.js";
5
+ import { g as SandboxError } from "./errors-DNxN33_n.js";
6
+ import { a as PublicTemplatesClient } from "./public-templates-DtRGMy8F.js";
7
7
  import { z } from "zod";
8
8
  import { AgentInteractiveSessionRef, AgentProfile } from "@tangle-network/agent-interface";
9
9
 
@@ -1,2 +1,2 @@
1
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-DZCyTGdn.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-CXtTwK3x.js";
2
2
  export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
@@ -1,4 +1,4 @@
1
- import { u as NetworkError, x as parseErrorResponse, y as TimeoutError } from "./errors-DSJBKmGZ.js";
1
+ import { S as parseErrorResponse, b as TimeoutError, u as NetworkError } from "./errors-Bfhg_Zc6.js";
2
2
  //#region src/collaboration/client.ts
3
3
  const DEFAULT_TIMEOUT_MS = 3e4;
4
4
  function normalizeBaseUrl(url) {
package/dist/core.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { _ as ProfileFileDeliveryReport, a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-I390rjrp.js";
2
- import { B as CreateSandboxOptions, Bn as ManagedProcessSpec, Ci as SandboxInfo, Fr as SandboxConfig, In as ManagedProcessJobs, Ln as ManagedProcessOptions, M as ConversationTurnOptions, N as ConversationTurnResult, Rn as ManagedProcessRecord, St as ExecResult, Vn as ManagedProcessState, Wn as NetworkConfig, Xn as PreviewLinkManager, Yn as PreviewLinkInfo, Zn as PreviewLinkWaitOptions, ao as SandboxEnvRecovery, ma as SessionMessageAdmission, oo as SandboxEnvRecoveryView, or as PromptInputPart, xt as ExecOptions, zi as SandboxStatus, zn as ManagedProcessResumeOptions } from "./types-Bal6rlUP.js";
3
- import { A as LineSendReceipt, B as lineInstanceKey, C as LineReplyCode, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, J as LineApplicationView, K as LineApplicationResult, L as LinesClient, M as LineSenderVerificationStart, S as LineReminderPreferences, U as LINE_APPLICATION_REQUEST_MAX_BYTES, V as profileChannelReference, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, a as LineApplicationAttachOptions, b as LineNumberInventory, c as LineAttachmentReauthorization, d as LineImage, f as LineInstanceAttachOptions, g as LineMemberInstance, h as LineMember, j as LineSenderVerification, k as LineSendInput, l as LineExecutionKey, n as LineAgentRolePolicy, p as LineInstanceCreate, q as LineApplicationState, s as LineAttachment, t as Line, w as LineReplyCodeInput, x as LineProvider } from "./lines-CodL_Yhd.js";
4
- import { C as ValidationError, S as TimeoutError, _ as SandboxFailureDetail, d as NotFoundError, f as PartialFailureError, g as SandboxErrorJson, h as SandboxError, o as FileWriteConflictError, p as QuotaError, r as CapabilityError, t as AuthError, u as NetworkError, v as ServerError, y as StateError } from "./errors-BSmxfVt0.js";
5
- import { A as BackendRegistryEntry, C as InstancesClient, F as backendRegistryInteractionKindSchema, I as backendRegistryResponseSchema, L as isBackendRegistryInteractionKind, M as BackendRegistryResponse, N as backendRegistryCapabilitiesSchema, P as backendRegistryEntrySchema, R as parseBackendRegistryResponse, _ as EnsureInstanceOptions, b as InstanceRecord, i as Sandbox, j as BackendRegistryInteractionKind, k as BackendRegistryCapabilities, v as HostedInstance, x as InstanceRestartingError, y as InstanceProfile, z as parseBackendRegistryResponseBody } from "./client-C7KaqyfN.js";
6
- import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-CAMfH_Yr.js";
7
- import { t as ManagedProcessClient } from "./managed-process-BEgMYGGu.js";
1
+ import { _ as ProfileFileDeliveryReport, a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-I9ZSVMP7.js";
2
+ import { Bi as SandboxStatus, Bn as ManagedProcessResumeOptions, Ct as ExecResult, Gn as NetworkConfig, Hn as ManagedProcessState, Ir as SandboxConfig, Ln as ManagedProcessJobs, N as ConversationTurnOptions, P as ConversationTurnResult, Qn as PreviewLinkWaitOptions, Rn as ManagedProcessOptions, St as ExecOptions, V as CreateSandboxOptions, Vn as ManagedProcessSpec, Xn as PreviewLinkInfo, Zn as PreviewLinkManager, ha as SessionMessageAdmission, oo as SandboxEnvRecovery, so as SandboxEnvRecoveryView, sr as PromptInputPart, wi as SandboxInfo, zn as ManagedProcessRecord } from "./types-C-VC0oGh.js";
3
+ import { A as LineSendReceipt, B as lineInstanceKey, C as LineReplyCode, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, J as LineApplicationView, K as LineApplicationResult, L as LinesClient, M as LineSenderVerificationStart, S as LineReminderPreferences, U as LINE_APPLICATION_REQUEST_MAX_BYTES, V as profileChannelReference, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, a as LineApplicationAttachOptions, b as LineNumberInventory, c as LineAttachmentReauthorization, d as LineImage, f as LineInstanceAttachOptions, g as LineMemberInstance, h as LineMember, j as LineSenderVerification, k as LineSendInput, l as LineExecutionKey, n as LineAgentRolePolicy, p as LineInstanceCreate, q as LineApplicationState, s as LineAttachment, t as Line, w as LineReplyCodeInput, x as LineProvider } from "./lines-joXwwKub.js";
4
+ import { C as TimeoutError, _ as SandboxErrorJson, b as StateError, d as NotFoundError, f as PartialFailureError, g as SandboxError, m as QuotaError, o as FileWriteConflictError, p as ProfileFileMountPathError, r as CapabilityError, t as AuthError, u as NetworkError, v as SandboxFailureDetail, w as ValidationError, y as ServerError } from "./errors-DNxN33_n.js";
5
+ import { A as BackendRegistryEntry, C as InstancesClient, F as backendRegistryInteractionKindSchema, I as backendRegistryResponseSchema, L as isBackendRegistryInteractionKind, M as BackendRegistryResponse, N as backendRegistryCapabilitiesSchema, P as backendRegistryEntrySchema, R as parseBackendRegistryResponse, _ as EnsureInstanceOptions, b as InstanceRecord, i as Sandbox, j as BackendRegistryInteractionKind, k as BackendRegistryCapabilities, v as HostedInstance, x as InstanceRestartingError, y as InstanceProfile, z as parseBackendRegistryResponseBody } from "./client-CAA0Vnkx.js";
6
+ import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-DtRGMy8F.js";
7
+ import { t as ManagedProcessClient } from "./managed-process-Cri6fY06.js";
8
8
 
9
9
  //#region src/core.d.ts
10
10
  /** Local SDK protocol support only, not a deployed-host readiness assertion.
@@ -13,4 +13,4 @@ import { t as ManagedProcessClient } from "./managed-process-BEgMYGGu.js";
13
13
  * still inspect the host receipt and their own customer/workspace binding. */
14
14
  declare const ISOLATED_CREATION_ATTESTATION_VERSION: 1;
15
15
  //#endregion
16
- export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type ConversationTurnOptions, type ConversationTurnResult, type CreateSandboxOptions, type EnsureInstanceOptions, type ExecOptions, type ExecResult, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, type InstanceProfile, type InstanceRecord, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, type Line, type LineAgentRolePolicy, type LineApplication, type LineApplicationAttachOptions, type LineApplicationRequest, type LineApplicationResult, type LineApplicationState, type LineApplicationView, type LineAttachment, type LineAttachmentReauthorization, type LineExecutionKey, type LineImage, type LineInstanceAttachOptions, type LineInstanceCreate, type LineMember, type LineMemberInstance, type LineNumberInventory, type LineProvider, type LineReminderPreferences, type LineReplyCode, type LineReplyCodeInput, type LineSendInput, type LineSendReceipt, type LineSenderVerification, type LineSenderVerificationStart, LinesClient, ManagedProcessClient, type ManagedProcessJobs, type ManagedProcessOptions, type ManagedProcessRecord, type ManagedProcessResumeOptions, type ManagedProcessSpec, type ManagedProcessState, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type ProfileFileDeliveryReport, type PromptInputPart, type PublicTemplatePublishArtifact, PublicTemplatePublishError, type PublicTemplatePublishJob, type PublicTemplatePublishRequestOptions, PublicTemplatesClient, QuotaError, Sandbox, type SandboxConfig, type SandboxEnvRecovery, type SandboxEnvRecoveryView, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, type SessionMessageAdmission, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference };
16
+ export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type ConversationTurnOptions, type ConversationTurnResult, type CreateSandboxOptions, type EnsureInstanceOptions, type ExecOptions, type ExecResult, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, type InstanceProfile, type InstanceRecord, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, type Line, type LineAgentRolePolicy, type LineApplication, type LineApplicationAttachOptions, type LineApplicationRequest, type LineApplicationResult, type LineApplicationState, type LineApplicationView, type LineAttachment, type LineAttachmentReauthorization, type LineExecutionKey, type LineImage, type LineInstanceAttachOptions, type LineInstanceCreate, type LineMember, type LineMemberInstance, type LineNumberInventory, type LineProvider, type LineReminderPreferences, type LineReplyCode, type LineReplyCodeInput, type LineSendInput, type LineSendReceipt, type LineSenderVerification, type LineSenderVerificationStart, LinesClient, ManagedProcessClient, type ManagedProcessJobs, type ManagedProcessOptions, type ManagedProcessRecord, type ManagedProcessResumeOptions, type ManagedProcessSpec, type ManagedProcessState, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type ProfileFileDeliveryReport, ProfileFileMountPathError, type PromptInputPart, type PublicTemplatePublishArtifact, PublicTemplatePublishError, type PublicTemplatePublishJob, type PublicTemplatePublishRequestOptions, PublicTemplatesClient, QuotaError, Sandbox, type SandboxConfig, type SandboxEnvRecovery, type SandboxEnvRecoveryView, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, type SessionMessageAdmission, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference };
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as StateError, b as ValidationError, d as NotFoundError, f as PartialFailureError, g as ServerError, h as SandboxError, o as FileWriteConflictError, p as QuotaError, r as CapabilityError, t as AuthError, u as NetworkError, y as TimeoutError } from "./errors-DSJBKmGZ.js";
2
- import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-CdNw2DEF.js";
3
- import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-BGyIDjUH.js";
1
+ import { _ as ServerError, b as TimeoutError, d as NotFoundError, f as PartialFailureError, g as SandboxError, m as QuotaError, o as FileWriteConflictError, p as ProfileFileMountPathError, r as CapabilityError, t as AuthError, u as NetworkError, v as StateError, x as ValidationError } from "./errors-Bfhg_Zc6.js";
2
+ import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-C1hSgXB-.js";
3
+ import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-ChgyE6cI.js";
4
4
  import { LinesClient, lineInstanceKey, profileChannelReference } from "./lines.js";
5
5
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
6
6
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-UtPFP0o4.js";
@@ -11,4 +11,4 @@ import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTE
11
11
  * still inspect the host receipt and their own customer/workspace binding. */
12
12
  const ISOLATED_CREATION_ATTESTATION_VERSION = 1;
13
13
  //#endregion
14
- export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference };
14
+ export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, ProfileFileMountPathError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference };
@@ -1,5 +1,117 @@
1
+ //#region ../../../packages/runtime-contracts/dist/file-api-roots.js
2
+ /**
3
+ * The agent user's home directory inside a sandbox. A profile mount path
4
+ * that starts with `~/` resolves under it.
5
+ */
6
+ const SANDBOX_AGENT_HOME = "/home/agent";
7
+ /**
8
+ * Absolute roots that the sidecar file API accepts in addition to the
9
+ * workspace root. This list is the single source: the sidecar's
10
+ * `resolveWorkspacePath` and the SDK's profile mount routing both read it.
11
+ *
12
+ * A root in this list is not writable on every runtime:
13
+ * - Docker with an egress proxy has a read-only root filesystem. Only the
14
+ * workspace, the /tmp tmpfs and the /opt/cache volume are writable there.
15
+ * A write to /output or /home/user then fails deterministically.
16
+ * - Firecracker writes its root through a per-VM copy-on-write snapshot, and
17
+ * the sidecar runs as root, so every root here is writable. With
18
+ * FC_SHARED_ROOTFS the root is read-only, and so are /tmp and /var/tmp:
19
+ * fc-init mounts tmpfs only on /dev/shm.
20
+ */
21
+ const SANDBOX_FILE_API_ABSOLUTE_ROOTS = [
22
+ "/tmp",
23
+ "/output",
24
+ "/home/user",
25
+ SANDBOX_AGENT_HOME,
26
+ "/opt/cache"
27
+ ];
28
+ /** Stable code for a profile file mount path that the sidecar refuses. */
29
+ const PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE = "PROFILE_FILE_MOUNT_OUTSIDE_ROOTS";
30
+ /**
31
+ * Return true when the sidecar refuses a profile file mount path:
32
+ * - any path with a `.` or `..` segment, relative or absolute, because its
33
+ * target is not the path as written;
34
+ * - an absolute path outside {@link SANDBOX_FILE_API_ABSOLUTE_ROOTS}.
35
+ *
36
+ * Other relative paths resolve in the workspace, and `~/` paths resolve in
37
+ * the agent home, so neither is refused.
38
+ */
39
+ function isProfileFileMountOutsideRoots(path) {
40
+ const segments = path.split("/").filter((segment) => segment.length > 0);
41
+ if (segments.some((segment) => segment === "." || segment === "..")) return true;
42
+ if (!path.startsWith("/")) return false;
43
+ const normalized = `/${segments.join("/")}`;
44
+ return !SANDBOX_FILE_API_ABSOLUTE_ROOTS.some((root) => normalized === root || normalized.startsWith(`${root}/`));
45
+ }
46
+ /** The refusal text for a profile file mount path that the sidecar refuses. */
47
+ function profileFileMountOutsideRootsMessage(path) {
48
+ return `Profile file mount path ${path} is outside the sandbox file roots (${SANDBOX_FILE_API_ABSOLUTE_ROOTS.join(", ")}, ~/ or a path relative to the workspace, with no . or .. segment). Mount the file under one of them.`;
49
+ }
50
+ //#endregion
51
+ //#region ../../../packages/runtime-contracts/dist/file-limits.js
52
+ const MEBIBYTE$1 = 1024 * 1024;
53
+ 10 * MEBIBYTE$1;
54
+ const FILE_DECODED_WRITE_MAX_BYTES = 5 * MEBIBYTE$1;
55
+ 5 * MEBIBYTE$1;
56
+ 10 * MEBIBYTE$1;
57
+ 5 * MEBIBYTE$1;
58
+ //#endregion
59
+ //#region ../../../packages/runtime-contracts/dist/request-limits.js
60
+ /**
61
+ * Raw WIRE/TRANSPORT caps: request-byte limits checked while the body
62
+ * streams in (bodyLimit middleware, Content-Length, encoded proxy bodies),
63
+ * before anything is parsed or decoded. Rejections against these carry
64
+ * code `PAYLOAD_TOO_LARGE` (`payload-too-large.ts`) — the remedy is to
65
+ * split the delivery. Decoded/parsed-content caps (code `FILE_TOO_LARGE`)
66
+ * live in `file-io.ts`.
67
+ */
68
+ const MEBIBYTE = 1024 * 1024;
69
+ /**
70
+ * Gateway (CF Worker) proxy cap on any request body it forwards — both
71
+ * pass-through requests and route-constructed (`options.body`) proxy
72
+ * payloads. Workers buffer forwarded bodies (streaming upstream stalls),
73
+ * so this bounds Worker memory per request.
74
+ */
75
+ const SANDBOX_PROXY_REQUEST_MAX_BYTES = MEBIBYTE;
76
+ 32 * MEBIBYTE;
77
+ /**
78
+ * Max assembled size of one chunked-upload session — the ceiling of the
79
+ * sanctioned >1 MiB delivery path. Parts stage in sidecar memory until
80
+ * commit, so this bounds per-session memory, not the destination
81
+ * filesystem.
82
+ */
83
+ const FILE_UPLOAD_SESSION_MAX_BYTES = 64 * MEBIBYTE;
84
+ 128 * MEBIBYTE;
85
+ //#endregion
86
+ //#region ../../../packages/runtime-contracts/dist/size-limit-errors.js
87
+ /** Canonical error codes for wire-size and decoded-content rejections. */
88
+ const PAYLOAD_TOO_LARGE_CODE = "PAYLOAD_TOO_LARGE";
89
+ const FILE_TOO_LARGE_CODE = "FILE_TOO_LARGE";
90
+ function isRecord(value) {
91
+ return value !== null && typeof value === "object" && !Array.isArray(value);
92
+ }
93
+ function isPositiveInteger(value) {
94
+ return typeof value === "number" && Number.isInteger(value) && value > 0;
95
+ }
96
+ function isSizeLimitErrorBodyFor(value, code) {
97
+ if (!isRecord(value) || value.success !== false || !isRecord(value.error)) return false;
98
+ const error = value.error;
99
+ return error.code === code && typeof error.message === "string" && typeof error.surface === "string" && isPositiveInteger(error.limitBytes) && (error.actualBytes === void 0 || isPositiveInteger(error.actualBytes));
100
+ }
101
+ function isPayloadTooLargeErrorBody(value) {
102
+ return isSizeLimitErrorBodyFor(value, PAYLOAD_TOO_LARGE_CODE);
103
+ }
104
+ function isFileTooLargeErrorBody(value) {
105
+ return isSizeLimitErrorBodyFor(value, FILE_TOO_LARGE_CODE);
106
+ }
107
+ //#endregion
1
108
  //#region src/errors.ts
2
109
  /**
110
+ * Sandbox SDK Errors
111
+ *
112
+ * Error classes for the Sandbox client SDK.
113
+ */
114
+ /**
3
115
  * Base error class for all Sandbox SDK errors.
4
116
  */
5
117
  var SandboxError = class extends Error {
@@ -181,6 +293,22 @@ var ValidationError = class extends SandboxError {
181
293
  }
182
294
  };
183
295
  /**
296
+ * A profile file mount names a path that the sidecar file API refuses: an
297
+ * absolute path outside `SANDBOX_FILE_API_ABSOLUTE_ROOTS`. create() throws it
298
+ * before it provisions a sandbox, and a turn throws it before any write. The
299
+ * status is 422 and the code is `PROFILE_FILE_MOUNT_OUTSIDE_ROOTS`: a retry
300
+ * with the same profile gets the same refusal.
301
+ */
302
+ var ProfileFileMountPathError = class extends SandboxError {
303
+ /** The refused mount path, exactly as the profile gave it. */
304
+ path;
305
+ constructor(path, message, code, metadata) {
306
+ super(message, code, 422, metadata);
307
+ this.name = "ProfileFileMountPathError";
308
+ this.path = path;
309
+ }
310
+ };
311
+ /**
184
312
  * The sandbox is not in a valid state for the requested operation.
185
313
  */
186
314
  var StateError = class extends SandboxError {
@@ -520,6 +648,7 @@ function parseErrorResponse(status, body, context, headers) {
520
648
  if (isCapabilityCode(code)) return new CapabilityError(message, code, status, metadata, readCapability(data, errorObj));
521
649
  if (isPartialFailureCode(code)) return new PartialFailureError(message, code, status, metadata, readFailures(data, errorObj));
522
650
  if (code === "EGRESS_PROXY_RECOVERY_REQUIRED") return new EgressProxyRecoveryError(message, metadata);
651
+ if (code === "PROFILE_FILE_MOUNT_OUTSIDE_ROOTS" && typeof data.path === "string") return new ProfileFileMountPathError(data.path, message, code, metadata);
523
652
  if (code === "RESUME_ENV_REQUIRED") {
524
653
  const keys = data.missingEnvKeys;
525
654
  return new ResumeEnvRequiredError(message, Array.isArray(keys) ? keys.filter((key) => typeof key === "string") : [], metadata);
@@ -563,4 +692,4 @@ function readResponseJson(response) {
563
692
  });
564
693
  }
565
694
  //#endregion
566
- export { readResponseJson as C, parseResponseError as S, StateError as _, EgressProxyRecoveryError as a, ValidationError as b, KeyBudgetExhaustedError as c, NotFoundError as d, PartialFailureError as f, ServerError as g, SandboxError as h, EdgeNotReadyError as i, NON_RETRYABLE_CREATE_QUOTA_REASONS as l, ResumeEnvRequiredError as m, BranchFanoutExceedsHostError as n, FileWriteConflictError as o, QuotaError as p, CapabilityError as r, GpuProviderNotConfiguredError as s, AuthError as t, NetworkError as u, StreamInterruptedError as v, parseErrorResponse as x, TimeoutError as y };
695
+ export { PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE as A, parseResponseError as C, FILE_UPLOAD_SESSION_MAX_BYTES as D, isPayloadTooLargeErrorBody as E, SANDBOX_FILE_API_ABSOLUTE_ROOTS as M, isProfileFileMountOutsideRoots as N, SANDBOX_PROXY_REQUEST_MAX_BYTES as O, profileFileMountOutsideRootsMessage as P, parseErrorResponse as S, isFileTooLargeErrorBody as T, ServerError as _, EgressProxyRecoveryError as a, TimeoutError as b, KeyBudgetExhaustedError as c, NotFoundError as d, PartialFailureError as f, SandboxError as g, ResumeEnvRequiredError as h, EdgeNotReadyError as i, SANDBOX_AGENT_HOME as j, FILE_DECODED_WRITE_MAX_BYTES as k, NON_RETRYABLE_CREATE_QUOTA_REASONS as l, QuotaError as m, BranchFanoutExceedsHostError as n, FileWriteConflictError as o, ProfileFileMountPathError as p, CapabilityError as r, GpuProviderNotConfiguredError as s, AuthError as t, NetworkError as u, StateError as v, readResponseJson as w, ValidationError as x, StreamInterruptedError as y };
@@ -1,4 +1,4 @@
1
- import { io as SandboxCreateReceipt } from "./types-Bal6rlUP.js";
1
+ import { ao as SandboxCreateReceipt } from "./types-C-VC0oGh.js";
2
2
 
3
3
  //#region src/errors.d.ts
4
4
  /**
@@ -139,6 +139,18 @@ declare class ValidationError extends SandboxError {
139
139
  readonly fields?: Record<string, string>;
140
140
  constructor(message: string, fields?: Record<string, string>, metadata?: SandboxErrorMetadata, code?: string);
141
141
  }
142
+ /**
143
+ * A profile file mount names a path that the sidecar file API refuses: an
144
+ * absolute path outside `SANDBOX_FILE_API_ABSOLUTE_ROOTS`. create() throws it
145
+ * before it provisions a sandbox, and a turn throws it before any write. The
146
+ * status is 422 and the code is `PROFILE_FILE_MOUNT_OUTSIDE_ROOTS`: a retry
147
+ * with the same profile gets the same refusal.
148
+ */
149
+ declare class ProfileFileMountPathError extends SandboxError {
150
+ /** The refused mount path, exactly as the profile gave it. */
151
+ readonly path: string;
152
+ constructor(path: string, message: string, code: string, metadata?: SandboxErrorMetadata);
153
+ }
142
154
  /**
143
155
  * The sandbox is not in a valid state for the requested operation.
144
156
  */
@@ -306,4 +318,4 @@ declare class ServerError extends SandboxError {
306
318
  constructor(message: string, status?: number, metadata?: SandboxErrorMetadata, code?: string);
307
319
  }
308
320
  //#endregion
309
- export { ValidationError as C, TimeoutError as S, SandboxFailureDetail as _, EgressProxyRecoveryError as a, StreamInterruptedError as b, GpuProviderRequirement as c, NotFoundError as d, PartialFailureError as f, SandboxErrorJson as g, SandboxError as h, EdgeNotReadyError as i, KeyBudgetExhaustedError as l, ResumeEnvRequiredError as m, BranchFanoutExceedsHostError as n, FileWriteConflictError as o, QuotaError as p, CapabilityError as r, GpuProviderNotConfiguredError as s, AuthError as t, NetworkError as u, ServerError as v, StreamInterruptionReason as x, StateError as y };
321
+ export { TimeoutError as C, StreamInterruptionReason as S, SandboxErrorJson as _, EgressProxyRecoveryError as a, StateError as b, GpuProviderRequirement as c, NotFoundError as d, PartialFailureError as f, SandboxError as g, ResumeEnvRequiredError as h, EdgeNotReadyError as i, KeyBudgetExhaustedError as l, QuotaError as m, BranchFanoutExceedsHostError as n, FileWriteConflictError as o, ProfileFileMountPathError as p, CapabilityError as r, GpuProviderNotConfiguredError as s, AuthError as t, NetworkError as u, SandboxFailureDetail as v, ValidationError as w, StreamInterruptedError as x, ServerError as y };
@@ -1,5 +1,5 @@
1
- import { n as SandboxInstance } from "./sandbox-I390rjrp.js";
2
- import { B as CreateSandboxOptions, Cn as HttpClient } from "./types-Bal6rlUP.js";
1
+ import { n as SandboxInstance } from "./sandbox-I9ZSVMP7.js";
2
+ import { V as CreateSandboxOptions, wn as HttpClient } from "./types-C-VC0oGh.js";
3
3
 
4
4
  //#region src/tangle/abi.d.ts
5
5
  /**