@tangle-network/sandbox 0.62.13 → 0.62.15
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.
- package/README.md +20 -0
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +4 -4
- package/dist/agent/preview.d.ts +1 -1
- package/dist/{agent-run-outcome-CWrBnv3S.d.ts → agent-run-outcome-BjZ1EHSq.d.ts} +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/{chunked-upload-ClCKGr59.js → chunked-upload-B867njKv.js} +2 -59
- package/dist/{chunked-upload-file-RaMaNFN_.js → chunked-upload-file-Bs5qcfRB.js} +2 -1
- package/dist/{client-C7NbsKZQ.js → client-Bfc6UMn7.js} +9 -8
- package/dist/{client-CIrZUB7Q.d.ts → client-CnP49sg1.d.ts} +5 -5
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-DZCyTGdn.js → collaboration-CXtTwK3x.js} +1 -1
- package/dist/core.d.ts +8 -8
- package/dist/core.js +4 -4
- package/dist/{errors-DSJBKmGZ.js → errors-Bfhg_Zc6.js} +130 -1
- package/dist/{errors-tik04CKT.d.ts → errors-H96CGXWZ.d.ts} +14 -2
- package/dist/{index-CuFC5al5.d.ts → index-CygLpbAJ.d.ts} +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +7 -7
- package/dist/intelligence/index.js +1 -1
- package/dist/{interactive-controller-B2VcB_SK.js → interactive-controller-CDtsgRnx.js} +2 -2
- package/dist/{lines-BWLeaELK.d.ts → lines-CodL_Yhd.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-BSFX2vnt.js → local-cli-auth-yn7YxF87.js} +1 -1
- package/dist/{managed-process-qH__EafL.d.ts → managed-process-BEgMYGGu.d.ts} +1 -1
- package/dist/{preview-BFBAIphI.d.ts → preview-Bz14bj-R.d.ts} +3 -3
- package/dist/{public-templates-CM9_NpaD.d.ts → public-templates-CrcJd0Ho.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-tCj9wHJ4.js → raw-evidence-archive-Bxk6fUjS.js} +12 -2
- package/dist/runtime.d.ts +4 -4
- package/dist/runtime.js +4 -4
- package/dist/{sandbox-D0NNcvnQ.js → sandbox-NDSp3I1V.js} +132 -32
- package/dist/{sandbox-BogoNKYF.d.ts → sandbox-NDYZY46C.d.ts} +12 -4
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-Cr6EkNcG.js → tangle-Cwu6ql_V.js} +2 -2
- package/dist/{types-B91mhT62.d.ts → types-Bal6rlUP.d.ts} +23 -0
- package/package.json +3 -3
- /package/dist/{cli-auth-bundle-BvXQd1UX.js → cli-auth-bundle-DBRU4ifV.js} +0 -0
package/README.md
CHANGED
|
@@ -993,6 +993,26 @@ most 64 MiB of cumulative part text. Limits and incomplete snapshots never becom
|
|
|
993
993
|
complete coverage. The dedicated Sidecar archive route is required; an older deployment
|
|
994
994
|
returns an error without falling back to the aggregate `rawEvidence()` API.
|
|
995
995
|
|
|
996
|
+
To keep the HOME walk but leave the bytes of directories the harness downloads
|
|
997
|
+
again on the box, name them in `omitContent`. Each file below one keeps its
|
|
998
|
+
metadata, has `contentOmitted: true`, and has no `content` or `sha256`:
|
|
999
|
+
|
|
1000
|
+
```ts
|
|
1001
|
+
const evidence = await box.session(sessionId).exportRawEvidence(destination, {
|
|
1002
|
+
maxBytes: 4 * 1024 ** 3,
|
|
1003
|
+
maxFiles: 100_000,
|
|
1004
|
+
omitContent: [".codex/plugins/cache/", ".codex/cache/remote_plugin_catalog/"],
|
|
1005
|
+
});
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
The manifest lists the honoured prefixes in `omitContent`. A prefix that covers
|
|
1009
|
+
or enters the harness's native session store (for example `.codex/` or
|
|
1010
|
+
`.codex/sessions/`) answers 400, so the session itself always keeps its bytes.
|
|
1011
|
+
The SDK allows at most 64 prefixes of at most 512 characters each, and 8 KiB of
|
|
1012
|
+
encoded query. A Sidecar older than the option ignores it and sends every
|
|
1013
|
+
file's bytes, so keep `maxBytes` sized for the whole HOME until every Sidecar
|
|
1014
|
+
you reach serves this version.
|
|
1015
|
+
|
|
996
1016
|
To keep only the native session store, ask for the session copies alone:
|
|
997
1017
|
|
|
998
1018
|
```ts
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-
|
|
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-
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
4
|
-
import { u as PreviewAuthorizer } from "../preview-
|
|
1
|
+
import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-NDYZY46C.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-CnP49sg1.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-Bz14bj-R.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";
|
package/dist/agent/index.js
CHANGED
|
@@ -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-
|
|
3
|
-
import {
|
|
4
|
-
import { n as Sandbox } from "../client-
|
|
5
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
2
|
+
import { k as assertCurrentBackendType } from "../interactive-controller-CDtsgRnx.js";
|
|
3
|
+
import { d as NotFoundError, v as StateError, x as ValidationError } from "../errors-Bfhg_Zc6.js";
|
|
4
|
+
import { n as Sandbox } from "../client-Bfc6UMn7.js";
|
|
5
|
+
import { t as SandboxInstance } from "../sandbox-NDSp3I1V.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
8
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
package/dist/agent/preview.d.ts
CHANGED
|
@@ -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-
|
|
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-Bz14bj-R.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-
|
|
1
|
+
import { Hr as SandboxEvent, a as AgentQuestionRequest, dt as DurablePlanSnapshot, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-Bal6rlUP.js";
|
|
2
2
|
import { InteractionRequest } from "@tangle-network/agent-interface";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
package/dist/auth/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-
|
|
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 {
|
|
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,
|
|
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 {
|
|
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-
|
|
3
|
-
import { C as
|
|
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-CDtsgRnx.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
|
|
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-NDSp3I1V.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-
|
|
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-
|
|
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, "
|
|
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
|
-
|
|
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-
|
|
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-
|
|
1
|
+
import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance } from "./sandbox-NDYZY46C.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";
|
|
3
3
|
import { d as MintInteractiveSessionTokenOptions, p as ScopedToken } from "./terminal-stream-DgD7GlFi.js";
|
|
4
|
-
import { L as LinesClient } from "./lines-
|
|
5
|
-
import {
|
|
6
|
-
import { a as PublicTemplatesClient } from "./public-templates-
|
|
4
|
+
import { L as LinesClient } from "./lines-CodL_Yhd.js";
|
|
5
|
+
import { g as SandboxError } from "./errors-H96CGXWZ.js";
|
|
6
|
+
import { a as PublicTemplatesClient } from "./public-templates-CrcJd0Ho.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-
|
|
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 {
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
-
import { C as
|
|
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-
|
|
6
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
7
|
-
import { t as ManagedProcessClient } from "./managed-process-
|
|
1
|
+
import { _ as ProfileFileDeliveryReport, a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-NDYZY46C.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 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-H96CGXWZ.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-CnP49sg1.js";
|
|
6
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-CrcJd0Ho.js";
|
|
7
|
+
import { t as ManagedProcessClient } from "./managed-process-BEgMYGGu.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-qH__EafL.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
|
|
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-
|
|
3
|
-
import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-
|
|
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-Bfc6UMn7.js";
|
|
3
|
+
import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-NDSp3I1V.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 {
|
|
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-
|
|
1
|
+
import { io as SandboxCreateReceipt } from "./types-Bal6rlUP.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 {
|
|
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-
|
|
2
|
-
import { B as CreateSandboxOptions, Cn as HttpClient } from "./types-
|
|
1
|
+
import { n as SandboxInstance } from "./sandbox-NDYZY46C.js";
|
|
2
|
+
import { B as CreateSandboxOptions, Cn as HttpClient } from "./types-Bal6rlUP.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|