@tangle-network/sandbox 0.39.0 → 0.39.1-develop.20260912191433.b31d83f
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 +11 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +4 -4
- package/dist/{agent-run-outcome-oEXhCh-O.d.ts → agent-run-outcome-BSysiQWr.d.ts} +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/{client-CXb0D47L.d.ts → client-fy_RYdGN.d.ts} +2 -2
- package/dist/{client-CfAcCFQh.js → client-j6FmPkNB.js} +8 -5
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-BKHF1SP8.js → collaboration-CDvc5Hxk.js} +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/core.js +3 -3
- package/dist/{errors-rp1GiVzL.d.ts → errors-Cv3Td7LB.d.ts} +8 -0
- package/dist/{errors-DrJySZQG.js → errors-V6uPkjfJ.js} +11 -2
- package/dist/{index-C_2tEmR1.d.ts → index-CS-t6tPU.d.ts} +3 -2
- package/dist/{index-B88RBB1S.d.ts → index-hYNUMvGr.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -14
- package/dist/intelligence/index.js +1 -1
- package/dist/{runtime-api-B8uIpISe.js → runtime-api-DokfzHVX.js} +5 -4
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.js +2 -2
- package/dist/{sandbox-BwUEeVkk.js → sandbox-BFZa_Gx-.js} +37 -33
- package/dist/{sandbox-EqAbiXhz.d.ts → sandbox-C8xeDrlS.d.ts} +5 -5
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-BPlbGnxF.js → tangle-Dn2pS3TZ.js} +2 -2
- package/dist/{types-CVrkDpOF.d.ts → types-BZuZPQ0N.d.ts} +8 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -277,6 +277,14 @@ try {
|
|
|
277
277
|
|
|
278
278
|
Use the same `idempotencyKey` only when retrying the same logical create request.
|
|
279
279
|
|
|
280
|
+
Inspect `SandboxError.createFailureDisposition` only on the top-level error returned by `create()`.
|
|
281
|
+
The value `"not-admitted"` proves that this call's attempts admitted no sandbox.
|
|
282
|
+
An absent value means unknown, even when the last HTTP status is 429.
|
|
283
|
+
Do not infer this call's disposition from `cause` or earlier calls with the same key.
|
|
284
|
+
This evidence does not exclude a sandbox from an earlier call with that key.
|
|
285
|
+
Cleanup may skip same-key recovery after `"not-admitted"` only when the key was fresh for this call.
|
|
286
|
+
Transport failures and unclassified responses remain uncertain; keep their recovery path.
|
|
287
|
+
|
|
280
288
|
## Commands and files
|
|
281
289
|
|
|
282
290
|
`exec()` returns the exit code, standard output, standard error, and timing data.
|
|
@@ -310,10 +318,10 @@ console.log(config);
|
|
|
310
318
|
| Public API request | 1 MiB | `SANDBOX_PROXY_REQUEST_MAX_BYTES` | Requests routed through the Sandbox API |
|
|
311
319
|
| Direct runtime file request | 32 MiB | `SANDBOX_DIRECT_FILE_REQUEST_MAX_BYTES` | Direct runtime requests |
|
|
312
320
|
| Multipart upload | 5 MiB | `FILE_MULTIPART_UPLOAD_MAX_BYTES` | One multipart upload |
|
|
313
|
-
| Chunked upload part | 768 KiB | `FILE_UPLOAD_PART_MAX_BYTES` | One `fs.uploadData()` part |
|
|
314
|
-
| Chunked upload session | 64 MiB | `FILE_UPLOAD_SESSION_MAX_BYTES` | One complete `fs.uploadData()` call |
|
|
321
|
+
| Chunked upload part | 768 KiB | `FILE_UPLOAD_PART_MAX_BYTES` | One `fs.upload()` or `fs.uploadData()` part |
|
|
322
|
+
| Chunked upload session | 64 MiB | `FILE_UPLOAD_SESSION_MAX_BYTES` | One complete `fs.upload()` or `fs.uploadData()` call |
|
|
315
323
|
|
|
316
|
-
Use `fs.uploadData()`
|
|
324
|
+
Use `fs.upload()` for local files or `fs.uploadData()` for in-memory content larger than the single-request limit.
|
|
317
325
|
|
|
318
326
|
The instance also exposes `git`, `tools`, `process`, `terminals`, `network`, `egress`, `previewLinks`, `images`, and `backend` capability clients.
|
|
319
327
|
Unsupported capabilities fail with a typed SDK error.
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-
|
|
2
|
-
import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, Si as SessionListOptions, bi as SessionInfo, d as BackendConfig, k as CodeResultPart } from "../types-
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
1
|
+
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-C8xeDrlS.js";
|
|
2
|
+
import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, Si as SessionListOptions, bi as SessionInfo, d as BackendConfig, k as CodeResultPart } from "../types-BZuZPQ0N.js";
|
|
3
|
+
import { i as Sandbox } from "../client-fy_RYdGN.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agent/instances.d.ts
|
package/dist/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as assertCurrentBackendType } from "../runtime-api-
|
|
2
|
-
import { f as StateError, m as ValidationError, s as NotFoundError } from "../errors-
|
|
3
|
-
import { n as Sandbox } from "../client-
|
|
4
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
1
|
+
import { f as assertCurrentBackendType } from "../runtime-api-DokfzHVX.js";
|
|
2
|
+
import { f as StateError, m as ValidationError, s as NotFoundError } from "../errors-V6uPkjfJ.js";
|
|
3
|
+
import { n as Sandbox } from "../client-j6FmPkNB.js";
|
|
4
|
+
import { t as SandboxInstance } from "../sandbox-BFZa_Gx-.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
//#region src/agent/instances.ts
|
|
7
7
|
const managers = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AgentQuestionRequest, et as DurablePlanSnapshot, fr as SandboxEvent, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-
|
|
1
|
+
import { a as AgentQuestionRequest, et as DurablePlanSnapshot, fr as SandboxEvent, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-BZuZPQ0N.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.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as ReadTokenPayload, a as issueCollaborationToken, b as materializeCliAuthBundle, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-
|
|
1
|
+
import { _ as ReadTokenPayload, a as issueCollaborationToken, b as materializeCliAuthBundle, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-CS-t6tPU.js";
|
|
2
2
|
export { AnyTokenPayload, BatchScopedTokenPayload, CollaborationAccess, CollaborationTokenPayload, IssueCollaborationTokenOptions, ProductTokenIssuer, ProjectScopedTokenPayload, ReadTokenPayload, SessionScopedTokenPayload, TokenScope, getTokenTTL, isTokenExpiringSoon, issueBatchScopedToken, issueCollaborationToken, issueProjectScopedToken, issueReadToken, issueSessionScopedToken, materializeCliAuthBundle, unsafeDecodeToken, verifyToken };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-
|
|
1
|
+
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-C8xeDrlS.js";
|
|
2
2
|
import { l as ScopedToken, s as MintInteractiveSessionTokenOptions } from "./terminal-stream-CcaBTVg3.js";
|
|
3
|
-
import { Ar as SandboxFleetToken, At as FleetDriveTurnRequest, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Dt as FleetDispatchResultBufferOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fr as SandboxFleetUsage, Ft as FleetPromptDispatchResult, Gn as ReconcileSandboxFleetsOptions, Hn as PublishPublicTemplateVersionOptions, I as CreateSandboxFleetTokenOptions, Ji as TokenRefreshHandler, Kn as ReconcileSandboxFleetsResult, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Lr as SandboxFleetWorkspaceReconcileResult, Mn as PromptInputPart, Mt as FleetExecDispatchResult, N as CreateIntelligenceReportOptions, Ni as SshKeysManager, Nn as PromptOptions, Nt as FleetMachineId, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, R as CreateSandboxOptions, Rr as SandboxFleetWorkspaceRestoreResult, Tt as FleetDispatchCancelResult, Un as ReapExpiredSandboxFleetsOptions, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Wn as ReapExpiredSandboxFleetsResult, _r as SandboxFleetDispatchResponse, an as IntelligenceReportCompareTo, ar as SandboxConfig, b as BatchRunRequest, br as SandboxFleetInfo, ca as BatchEvent, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, fn as ListSandboxOptions, hr as SandboxFleetCostEstimate, in as IntelligenceReportBudget, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, mr as SandboxFleetArtifactSpec, pr as SandboxFleetArtifact, rn as IntelligenceReport, sn as IntelligenceReportWindow, ui as SecretsManager, ut as ExecOptions, v as BatchResult, vr as SandboxFleetDriverCapability, wr as SandboxFleetMachineRecord, y as BatchRunOptions, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult } from "./types-
|
|
3
|
+
import { Ar as SandboxFleetToken, At as FleetDriveTurnRequest, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Dt as FleetDispatchResultBufferOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fr as SandboxFleetUsage, Ft as FleetPromptDispatchResult, Gn as ReconcileSandboxFleetsOptions, Hn as PublishPublicTemplateVersionOptions, I as CreateSandboxFleetTokenOptions, Ji as TokenRefreshHandler, Kn as ReconcileSandboxFleetsResult, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Lr as SandboxFleetWorkspaceReconcileResult, Mn as PromptInputPart, Mt as FleetExecDispatchResult, N as CreateIntelligenceReportOptions, Ni as SshKeysManager, Nn as PromptOptions, Nt as FleetMachineId, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, R as CreateSandboxOptions, Rr as SandboxFleetWorkspaceRestoreResult, Tt as FleetDispatchCancelResult, Un as ReapExpiredSandboxFleetsOptions, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Wn as ReapExpiredSandboxFleetsResult, _r as SandboxFleetDispatchResponse, an as IntelligenceReportCompareTo, ar as SandboxConfig, b as BatchRunRequest, br as SandboxFleetInfo, ca as BatchEvent, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, fn as ListSandboxOptions, hr as SandboxFleetCostEstimate, in as IntelligenceReportBudget, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, mr as SandboxFleetArtifactSpec, pr as SandboxFleetArtifact, rn as IntelligenceReport, sn as IntelligenceReportWindow, ui as SecretsManager, ut as ExecOptions, v as BatchResult, vr as SandboxFleetDriverCapability, wr as SandboxFleetMachineRecord, y as BatchRunOptions, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult } from "./types-BZuZPQ0N.js";
|
|
4
4
|
import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, l as encodeTextForWire, m as normalizeRuntimeBackendConfig, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, u as parseSSEStream, v as backendTypeSchema } from "./runtime-api-
|
|
2
|
-
import { c as PartialFailureError, d as ServerError, h as parseErrorResponse, m as ValidationError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
1
|
+
import { c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, l as encodeTextForWire, m as normalizeRuntimeBackendConfig, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, u as parseSSEStream, v as backendTypeSchema } from "./runtime-api-DokfzHVX.js";
|
|
2
|
+
import { c as PartialFailureError, d as ServerError, h as parseErrorResponse, m as ValidationError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
3
3
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
4
|
-
import { E as normalizeConnection, O as exportTraceBundle, b as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox-
|
|
4
|
+
import { E as normalizeConnection, O as exportTraceBundle, b as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox-BFZa_Gx-.js";
|
|
5
5
|
import { agentProfileSchema } from "@tangle-network/agent-interface";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/backend-registry.ts
|
|
@@ -2819,7 +2819,8 @@ var Sandbox = class {
|
|
|
2819
2819
|
billingOwnerId: options?.billingOwnerId
|
|
2820
2820
|
});
|
|
2821
2821
|
let lastServerError;
|
|
2822
|
-
|
|
2822
|
+
let allPreviousCreateAttemptsRefused = true;
|
|
2823
|
+
const createTimeoutError = () => new TimeoutError(timeoutMs, `Sandbox create did not complete within ${timeoutMs}ms. ` + (lastServerError ? `The last attempt failed with ${lastServerError.code}${lastServerError.status === void 0 ? "" : ` (HTTP ${lastServerError.status})`}: ${lastServerError.message}. ` : "") + `The provision may still be running server-side; retry create() with idempotencyKey="${idempotencyKey}" to join it.`, allPreviousCreateAttemptsRefused && lastServerError?.createFailureDisposition === "not-admitted" ? { createFailureDisposition: "not-admitted" } : void 0, lastServerError);
|
|
2823
2824
|
const sleepBeforeRetry = async (delayMs) => {
|
|
2824
2825
|
try {
|
|
2825
2826
|
await waitForCreateRetry(delayMs, postSignal);
|
|
@@ -2856,6 +2857,7 @@ var Sandbox = class {
|
|
|
2856
2857
|
body: createRequestBody
|
|
2857
2858
|
}, { timeoutMs });
|
|
2858
2859
|
} catch (error) {
|
|
2860
|
+
allPreviousCreateAttemptsRefused = false;
|
|
2859
2861
|
if (requestOptions?.signal?.aborted) throw error;
|
|
2860
2862
|
if (error instanceof SandboxError && !(error instanceof TimeoutError)) lastServerError = error;
|
|
2861
2863
|
if (postDeadline.aborted || Date.now() >= deadline || error instanceof TimeoutError || error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError")) throw createTimeoutError();
|
|
@@ -2865,7 +2867,8 @@ var Sandbox = class {
|
|
|
2865
2867
|
}
|
|
2866
2868
|
if (response.ok) break;
|
|
2867
2869
|
const body = await response.text();
|
|
2868
|
-
const error = parseErrorResponse(response.status, body,
|
|
2870
|
+
const error = parseErrorResponse(response.status, body, { allPreviousCreateAttemptsRefused }, response.headers);
|
|
2871
|
+
allPreviousCreateAttemptsRefused = error.createFailureDisposition === "not-admitted";
|
|
2869
2872
|
lastServerError = error;
|
|
2870
2873
|
if (exhaustsRetryBudget(error)) throw error;
|
|
2871
2874
|
await waitBeforeRetry(error, attempt);
|
|
@@ -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-CDvc5Hxk.js";
|
|
2
2
|
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as parseErrorResponse, o as NetworkError, p as TimeoutError } from "./errors-
|
|
1
|
+
import { h as parseErrorResponse, o as NetworkError, p as TimeoutError } from "./errors-V6uPkjfJ.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,5 +1,5 @@
|
|
|
1
|
-
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-
|
|
2
|
-
import { Cn as PreviewLinkWaitOptions, Mn as PromptInputPart, R as CreateSandboxOptions, Sn as PreviewLinkManager, Vr as SandboxInfo, Yr as SandboxStatus, ar as SandboxConfig, dt as ExecResult, gn as NetworkConfig, ut as ExecOptions, xn as PreviewLinkInfo } from "./types-
|
|
3
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
4
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
1
|
+
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-C8xeDrlS.js";
|
|
2
|
+
import { Cn as PreviewLinkWaitOptions, Mn as PromptInputPart, R as CreateSandboxOptions, Sn as PreviewLinkManager, Vr as SandboxInfo, Yr as SandboxStatus, ar as SandboxConfig, dt as ExecResult, gn as NetworkConfig, ut as ExecOptions, xn as PreviewLinkInfo } from "./types-BZuZPQ0N.js";
|
|
3
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-fy_RYdGN.js";
|
|
4
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-Cv3Td7LB.js";
|
|
5
5
|
export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, FileWriteConflictError, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
2
|
-
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-
|
|
3
|
-
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-
|
|
1
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
2
|
+
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-j6FmPkNB.js";
|
|
3
|
+
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-BFZa_Gx-.js";
|
|
4
4
|
export { AuthError, CapabilityError, FileWriteConflictError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
|
@@ -22,6 +22,13 @@ declare class SandboxError extends Error {
|
|
|
22
22
|
readonly sidecarVersion?: string;
|
|
23
23
|
/** Sidecar image/tag/sha when the runtime emitted it */
|
|
24
24
|
readonly containerImage?: string;
|
|
25
|
+
/**
|
|
26
|
+
* On create's top-level error, proves this call's attempts admitted no
|
|
27
|
+
* sandbox. Absence is unknown. Earlier errors in `cause` describe only
|
|
28
|
+
* their attempt prefix, not subsequent attempts or earlier calls using
|
|
29
|
+
* the same idempotency key.
|
|
30
|
+
*/
|
|
31
|
+
readonly createFailureDisposition?: "not-admitted";
|
|
25
32
|
constructor(message: string, code: string, status?: number, metadata?: SandboxErrorMetadata);
|
|
26
33
|
}
|
|
27
34
|
type SandboxErrorOrigin = "sidecar" | "sandbox-api" | "control-plane" | "runtime" | "unknown";
|
|
@@ -31,6 +38,7 @@ interface SandboxErrorMetadata {
|
|
|
31
38
|
retryAfterMs?: number;
|
|
32
39
|
sidecarVersion?: string;
|
|
33
40
|
containerImage?: string;
|
|
41
|
+
createFailureDisposition?: "not-admitted";
|
|
34
42
|
}
|
|
35
43
|
type SandboxErrorJson = string | number | boolean | null | {
|
|
36
44
|
[key: string]: SandboxErrorJson;
|
|
@@ -22,6 +22,13 @@ var SandboxError = class extends Error {
|
|
|
22
22
|
sidecarVersion;
|
|
23
23
|
/** Sidecar image/tag/sha when the runtime emitted it */
|
|
24
24
|
containerImage;
|
|
25
|
+
/**
|
|
26
|
+
* On create's top-level error, proves this call's attempts admitted no
|
|
27
|
+
* sandbox. Absence is unknown. Earlier errors in `cause` describe only
|
|
28
|
+
* their attempt prefix, not subsequent attempts or earlier calls using
|
|
29
|
+
* the same idempotency key.
|
|
30
|
+
*/
|
|
31
|
+
createFailureDisposition;
|
|
25
32
|
constructor(message, code, status, metadata) {
|
|
26
33
|
super(message);
|
|
27
34
|
this.name = "SandboxError";
|
|
@@ -32,6 +39,7 @@ var SandboxError = class extends Error {
|
|
|
32
39
|
this.retryAfterMs = metadata?.retryAfterMs;
|
|
33
40
|
this.sidecarVersion = metadata?.sidecarVersion;
|
|
34
41
|
this.containerImage = metadata?.containerImage;
|
|
42
|
+
this.createFailureDisposition = metadata?.createFailureDisposition;
|
|
35
43
|
}
|
|
36
44
|
};
|
|
37
45
|
/**
|
|
@@ -301,7 +309,7 @@ function parseErrorResponse(status, body, context, headers) {
|
|
|
301
309
|
const code = (typeof data.code === "string" ? asErrorCode(data.code) : void 0) ?? nestedCode;
|
|
302
310
|
const rawLog = typeof errorObj === "object" && errorObj !== null ? errorObj.log : void 0;
|
|
303
311
|
const logTail = typeof rawLog === "string" && rawLog.trim().length > 0 ? rawLog.trim() : void 0;
|
|
304
|
-
const prefix = context ? `${context.method ?? "REQUEST"} ${context.path ?? ""}: ` : "";
|
|
312
|
+
const prefix = context?.method || context?.path ? `${context.method ?? "REQUEST"} ${context.path ?? ""}: ` : "";
|
|
305
313
|
const composedMessage = shouldAppendDetails ? `${baseMessage}: ${details}` : baseMessage;
|
|
306
314
|
const messageWithReason = `${prefix}${reason && !composedMessage.includes(reason) ? `${composedMessage}: ${reason}` : composedMessage}`;
|
|
307
315
|
const message = logTail && !messageWithReason.includes(logTail) ? `${messageWithReason}\n${logTail}` : messageWithReason;
|
|
@@ -310,7 +318,8 @@ function parseErrorResponse(status, body, context, headers) {
|
|
|
310
318
|
endpoint: context?.path ?? headers?.get("x-tangle-request-path") ?? void 0,
|
|
311
319
|
retryAfterMs: parseRetryAfterMs(headers?.get("retry-after") ?? void 0, data),
|
|
312
320
|
sidecarVersion: headers?.get("x-sidecar-version") ?? void 0,
|
|
313
|
-
containerImage: headers?.get("x-sidecar-image") ?? headers?.get("x-sidecar-image-tag") ?? void 0
|
|
321
|
+
containerImage: headers?.get("x-sidecar-image") ?? headers?.get("x-sidecar-image-tag") ?? void 0,
|
|
322
|
+
createFailureDisposition: context?.allPreviousCreateAttemptsRefused === true && (context.method ?? headers?.get("x-tangle-request-method")) === "POST" && (context.path ?? headers?.get("x-tangle-request-path")) === "/v1/sandboxes" && status === 429 && (code === "RATE_LIMIT_EXCEEDED" || code === "QUOTA_EXCEEDED" || code === "PLATFORM_RATE_LIMITED") ? "not-admitted" : void 0
|
|
314
323
|
};
|
|
315
324
|
if (isQuotaCode(code)) return new QuotaError(data.quotaType || "rate_limit", message, data.current, data.limit, metadata, status);
|
|
316
325
|
if (isCapabilityCode(code)) return new CapabilityError(message, code, status, metadata, readCapability(data, errorObj));
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
//#region ../../../packages/cli-agent-registry/
|
|
1
|
+
//#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle.d.mts
|
|
2
|
+
//#region src/cli-auth-bundle.d.ts
|
|
2
3
|
type LocalCliAuthFile = {
|
|
3
4
|
path: string;
|
|
4
5
|
content: string;
|
|
5
6
|
mode?: number;
|
|
6
7
|
};
|
|
7
8
|
/** Convert a native credential JSON bundle without reading host credentials. */
|
|
8
|
-
declare function materializeCliAuthBundle(backendType: string, rawBundle: string): LocalCliAuthFile[];
|
|
9
|
+
declare function materializeCliAuthBundle(backendType: string, rawBundle: string): LocalCliAuthFile[]; //#endregion
|
|
9
10
|
//#endregion
|
|
10
11
|
//#region src/auth/types.d.ts
|
|
11
12
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as HttpClient, r as SandboxInstance } from "./sandbox-
|
|
2
|
-
import { R as CreateSandboxOptions } from "./types-
|
|
1
|
+
import { n as HttpClient, r as SandboxInstance } from "./sandbox-C8xeDrlS.js";
|
|
2
|
+
import { R as CreateSandboxOptions } from "./types-BZuZPQ0N.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-
|
|
1
|
+
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-C8xeDrlS.js";
|
|
2
2
|
import { c as MintScopedTokenOptions, d as TERMINAL_WS_ECHO_SUBPROTOCOL, f as TerminalExitInfo, g as TerminalStreamAuthFormat, h as TerminalReadyInfo, i as TerminalStreamOptions, l as ScopedToken, m as TerminalOutputMessage, n as TerminalStreamError, o as TerminalStreamToken, p as TerminalInteractiveSessionIdentity, r as TerminalStreamHandlers, s as MintInteractiveSessionTokenOptions, t as TerminalStream, u as ScopedTokenScope } from "./terminal-stream-CcaBTVg3.js";
|
|
3
3
|
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, i as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, r as browserInteractiveControlHolderId, s as InteractiveSessionControlTransport, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-BELrFH4f.js";
|
|
4
|
-
import { $ as DurablePlanDecisionResult, $i as UploadProgress, $n as RolloutScorer, $r as SandboxTerminalManager, $t as GpuLeaseStatus, A as CommitTaskSessionOptions, Ai as SnapshotInfo, An as ProcessSpawnOptions, Ar as SandboxFleetToken, At as FleetDriveTurnRequest, B as CreateTaskSessionOptions, Bi as TaskSessionFileChange, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Bt as GitAuth, C as BranchOptions, Ci as SessionMessage, Cn as PreviewLinkWaitOptions, Cr as SandboxFleetMachineMeteredUsage, Ct as FileUsageResult, Di as SnapshotDeleteAcknowledgement, Dn as ProcessLogEntry, Dr as SandboxFleetManifestMachine, Dt as FleetDispatchResultBufferOptions, Ei as SessionStatus, En as ProcessListOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fi as StartupOperation, Fn as ProvisionEvent, Fr as SandboxFleetUsage, G as DispatchedSession, Gi as TeeAttestationResponse, Gn as ReconcileSandboxFleetsOptions, Gr as SandboxResourceUsage, Gt as GitStatus, H as DevServerInfo, Hi as TaskSessionProfile, Hn as PublishPublicTemplateVersionOptions, Hr as SandboxIntelligenceEnvelope, Ht as GitCommit, Ii as StorageConfig, In as ProvisionResult, Ir as SandboxFleetWorkspace, It as ForkCounts, J as DriveTurnOptions, Ji as TokenRefreshHandler, Jr as SandboxRuntimeHealth, Jt as GpuLeaseCommandResult, K as DownloadOptions, Ki as TeePublicKey, Kn as ReconcileSandboxFleetsResult, Kr as SandboxResources, Kt as GpuLease, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Ln as ProvisionStatus, Lr as SandboxFleetWorkspaceReconcileResult, Lt as ForkIdempotency, M as CreateGpuLeaseOptions, Mi as SnapshotResult, Mn as PromptInputPart, Mr as SandboxFleetTraceEvent, N as CreateIntelligenceReportOptions, Nn as PromptOptions, Nr as SandboxFleetTraceExport, Nt as FleetMachineId, Oi as SnapshotDeleteOutcome, On as ProcessManager, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pi as StartupDiagnostics, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, Q as DurablePlan, Qi as UploadOptions, Qn as RolloutOptions, Qr as SandboxTerminalInfo, Qt as GpuLeaseProviderName, R as CreateSandboxOptions, Ri as TaskSessionChanges, Rn as ProvisionStep, Rr as SandboxFleetWorkspaceRestoreResult, Rt as ForkLookupOptions, S as BatchTaskResult, Si as SessionListOptions, Sn as PreviewLinkManager, Sr as SandboxFleetMachine, St as FileUsageOptions, T as ChunkedUploadResult, Ti as SessionResultOptions, Tn as ProcessInfo, Tr as SandboxFleetMachineSpec, Tt as FleetDispatchCancelResult, U as DirectoryPermission, Ui as TeeAttestationOptions, Un as ReapExpiredSandboxFleetsOptions, Ur as SandboxPortBinding, Ut as GitConfig, V as DeleteOptions, Vi as TaskSessionInfo, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wi as TeeAttestationReport, Wn as ReapExpiredSandboxFleetsResult, Wr as SandboxPortPreviewLink, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Xt as GpuLeaseExecResult, Y as DriverConfig, Yi as TokenUsage, Yr as SandboxStatus, Yt as GpuLeaseExecOptions, Z as DriverType, Zi as UpdateUserOptions, Zn as RolloutChildResult, Zr as SandboxTerminalCreateOptions, Zt as GpuLeaseManager, _ as BatchBackend, _i as SessionExecutionStatus, _n as NetworkManager, _r as SandboxFleetDispatchResponse, _t as FileRenameResult, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, ar as SandboxConfig, at as EgressManager, b as BatchRunRequest, bi as SessionInfo, bn as PermissionsManager, br as SandboxFleetInfo, bt as FileTreeOptions, c as AttachGpuLeaseOptions, ca as BatchEvent, ci as SearchOptions, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, da as BatchTaskUsage, di as SendSessionMessageOptions, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, ei as SandboxTerminalRequestOptions, en as HostAgentDriverConfig, er as RolloutStartResult, f as BackendInfo, fa as PublicBatchRunRequest, fi as SendSessionMessageRequest, fn as ListSandboxOptions, fr as SandboxEvent, ft as FileInfo, g as BackendStatus, gi as SessionExecutionInfo, gn as NetworkConfig, gr as SandboxFleetDispatchFailureClass, gt as FileReadResult, h as BackendRuntimeConfigUpdate, hi as SessionEventStreamOptions, hn as MkdirOptions, hr as SandboxFleetCostEstimate, ht as FileReadError, ia as WriteFileOptions, ii as SandboxTraceExport, in as IntelligenceReportBudget, ir as SSHCredentials, it as EgressDenial, j as CompletedTurnResult, ji as SnapshotOptions, jn as ProcessStatus, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, ki as SnapshotIdempotency, kn as ProcessSignal, kr as SandboxFleetPolicy, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, la as BatchEventDataMap, li as SecretInfo, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, lt as ExactProcessSpawnOptions, m as BackendMcpServerStatus, ma as parseBackendType, mi as SessionBackendCredentials, mn as McpServerConfig, mr as SandboxFleetArtifactSpec, mt as FileReadBatchResult, n as AccessPolicyRule, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, nr as RolloutTurnPart, nt as EffectiveBackendProfile, oa as WriteManyOptions, oi as SandboxUser, on as IntelligenceReportSubjectType, or as SandboxConnection, ot as EgressPolicy, p as BackendManager, pa as BackendType, pi as SentSessionMessage, pn as MAX_EGRESS_DENIALS_LIMIT, pr as SandboxFleetArtifact, pt as FileReadBatchOptions, q as DownloadProgress, qi as TeePublicKeyResponse, qn as RenameOptions, qr as SandboxRuntimeCapabilities, qt as GpuLeaseBilling, r as AddUserOptions, ra as WorkspaceOperationLookup, ri as SandboxTraceEvent, rn as IntelligenceReport, rr as SSHCommandDescriptor, rt as EffectiveBackendSource, sa as BatchBackendStats, si as SearchMatch, sn as IntelligenceReportWindow, sr as SandboxCreateOutcome, st as EnsureDevServerOptions, t as AcceleratorKind, ta as WaitForOptions, ti as SandboxTerminals, tn as HostAgentRuntimeBackend, tr as RolloutStatus, tt as EffectiveBackend, u as BackendCapabilities, ua as BatchSidecarGroup, ui as SecretsManager, un as ListOptions, ur as SandboxDeleteOutcome, ut as ExecOptions, v as BatchResult, vi as SessionFailureReason, vn as NonHostAgentDriverConfig, vr as SandboxFleetDriverCapability, vt as FileSystem, w as ChunkedUploadOptions, wi as SessionMessageInputPart, wn as Process, wr as SandboxFleetMachineRecord, wt as FileWriteResult, x as BatchTask, xi as SessionInterruptOptions, xn as PreviewLinkInfo, xr as SandboxFleetIntelligenceEnvelope, xt as FileTreeResult, y as BatchRunOptions, yi as SessionForkOptions, yn as PermissionLevel, yr as SandboxFleetDriverTimings, yt as FileTreeFile, z as CreateSessionOptions, zi as TaskSessionCommitResult, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult, zt as GPU_LEASE_PROVIDER_NAMES } from "./types-
|
|
5
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
6
|
-
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-
|
|
4
|
+
import { $ as DurablePlanDecisionResult, $i as UploadProgress, $n as RolloutScorer, $r as SandboxTerminalManager, $t as GpuLeaseStatus, A as CommitTaskSessionOptions, Ai as SnapshotInfo, An as ProcessSpawnOptions, Ar as SandboxFleetToken, At as FleetDriveTurnRequest, B as CreateTaskSessionOptions, Bi as TaskSessionFileChange, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Bt as GitAuth, C as BranchOptions, Ci as SessionMessage, Cn as PreviewLinkWaitOptions, Cr as SandboxFleetMachineMeteredUsage, Ct as FileUsageResult, Di as SnapshotDeleteAcknowledgement, Dn as ProcessLogEntry, Dr as SandboxFleetManifestMachine, Dt as FleetDispatchResultBufferOptions, Ei as SessionStatus, En as ProcessListOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fi as StartupOperation, Fn as ProvisionEvent, Fr as SandboxFleetUsage, G as DispatchedSession, Gi as TeeAttestationResponse, Gn as ReconcileSandboxFleetsOptions, Gr as SandboxResourceUsage, Gt as GitStatus, H as DevServerInfo, Hi as TaskSessionProfile, Hn as PublishPublicTemplateVersionOptions, Hr as SandboxIntelligenceEnvelope, Ht as GitCommit, Ii as StorageConfig, In as ProvisionResult, Ir as SandboxFleetWorkspace, It as ForkCounts, J as DriveTurnOptions, Ji as TokenRefreshHandler, Jr as SandboxRuntimeHealth, Jt as GpuLeaseCommandResult, K as DownloadOptions, Ki as TeePublicKey, Kn as ReconcileSandboxFleetsResult, Kr as SandboxResources, Kt as GpuLease, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Ln as ProvisionStatus, Lr as SandboxFleetWorkspaceReconcileResult, Lt as ForkIdempotency, M as CreateGpuLeaseOptions, Mi as SnapshotResult, Mn as PromptInputPart, Mr as SandboxFleetTraceEvent, N as CreateIntelligenceReportOptions, Nn as PromptOptions, Nr as SandboxFleetTraceExport, Nt as FleetMachineId, Oi as SnapshotDeleteOutcome, On as ProcessManager, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pi as StartupDiagnostics, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, Q as DurablePlan, Qi as UploadOptions, Qn as RolloutOptions, Qr as SandboxTerminalInfo, Qt as GpuLeaseProviderName, R as CreateSandboxOptions, Ri as TaskSessionChanges, Rn as ProvisionStep, Rr as SandboxFleetWorkspaceRestoreResult, Rt as ForkLookupOptions, S as BatchTaskResult, Si as SessionListOptions, Sn as PreviewLinkManager, Sr as SandboxFleetMachine, St as FileUsageOptions, T as ChunkedUploadResult, Ti as SessionResultOptions, Tn as ProcessInfo, Tr as SandboxFleetMachineSpec, Tt as FleetDispatchCancelResult, U as DirectoryPermission, Ui as TeeAttestationOptions, Un as ReapExpiredSandboxFleetsOptions, Ur as SandboxPortBinding, Ut as GitConfig, V as DeleteOptions, Vi as TaskSessionInfo, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wi as TeeAttestationReport, Wn as ReapExpiredSandboxFleetsResult, Wr as SandboxPortPreviewLink, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Xt as GpuLeaseExecResult, Y as DriverConfig, Yi as TokenUsage, Yr as SandboxStatus, Yt as GpuLeaseExecOptions, Z as DriverType, Zi as UpdateUserOptions, Zn as RolloutChildResult, Zr as SandboxTerminalCreateOptions, Zt as GpuLeaseManager, _ as BatchBackend, _i as SessionExecutionStatus, _n as NetworkManager, _r as SandboxFleetDispatchResponse, _t as FileRenameResult, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, ar as SandboxConfig, at as EgressManager, b as BatchRunRequest, bi as SessionInfo, bn as PermissionsManager, br as SandboxFleetInfo, bt as FileTreeOptions, c as AttachGpuLeaseOptions, ca as BatchEvent, ci as SearchOptions, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, da as BatchTaskUsage, di as SendSessionMessageOptions, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, ei as SandboxTerminalRequestOptions, en as HostAgentDriverConfig, er as RolloutStartResult, f as BackendInfo, fa as PublicBatchRunRequest, fi as SendSessionMessageRequest, fn as ListSandboxOptions, fr as SandboxEvent, ft as FileInfo, g as BackendStatus, gi as SessionExecutionInfo, gn as NetworkConfig, gr as SandboxFleetDispatchFailureClass, gt as FileReadResult, h as BackendRuntimeConfigUpdate, hi as SessionEventStreamOptions, hn as MkdirOptions, hr as SandboxFleetCostEstimate, ht as FileReadError, ia as WriteFileOptions, ii as SandboxTraceExport, in as IntelligenceReportBudget, ir as SSHCredentials, it as EgressDenial, j as CompletedTurnResult, ji as SnapshotOptions, jn as ProcessStatus, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, ki as SnapshotIdempotency, kn as ProcessSignal, kr as SandboxFleetPolicy, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, la as BatchEventDataMap, li as SecretInfo, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, lt as ExactProcessSpawnOptions, m as BackendMcpServerStatus, ma as parseBackendType, mi as SessionBackendCredentials, mn as McpServerConfig, mr as SandboxFleetArtifactSpec, mt as FileReadBatchResult, n as AccessPolicyRule, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, nr as RolloutTurnPart, nt as EffectiveBackendProfile, oa as WriteManyOptions, oi as SandboxUser, on as IntelligenceReportSubjectType, or as SandboxConnection, ot as EgressPolicy, p as BackendManager, pa as BackendType, pi as SentSessionMessage, pn as MAX_EGRESS_DENIALS_LIMIT, pr as SandboxFleetArtifact, pt as FileReadBatchOptions, q as DownloadProgress, qi as TeePublicKeyResponse, qn as RenameOptions, qr as SandboxRuntimeCapabilities, qt as GpuLeaseBilling, r as AddUserOptions, ra as WorkspaceOperationLookup, ri as SandboxTraceEvent, rn as IntelligenceReport, rr as SSHCommandDescriptor, rt as EffectiveBackendSource, sa as BatchBackendStats, si as SearchMatch, sn as IntelligenceReportWindow, sr as SandboxCreateOutcome, st as EnsureDevServerOptions, t as AcceleratorKind, ta as WaitForOptions, ti as SandboxTerminals, tn as HostAgentRuntimeBackend, tr as RolloutStatus, tt as EffectiveBackend, u as BackendCapabilities, ua as BatchSidecarGroup, ui as SecretsManager, un as ListOptions, ur as SandboxDeleteOutcome, ut as ExecOptions, v as BatchResult, vi as SessionFailureReason, vn as NonHostAgentDriverConfig, vr as SandboxFleetDriverCapability, vt as FileSystem, w as ChunkedUploadOptions, wi as SessionMessageInputPart, wn as Process, wr as SandboxFleetMachineRecord, wt as FileWriteResult, x as BatchTask, xi as SessionInterruptOptions, xn as PreviewLinkInfo, xr as SandboxFleetIntelligenceEnvelope, xt as FileTreeResult, y as BatchRunOptions, yi as SessionForkOptions, yn as PermissionLevel, yr as SandboxFleetDriverTimings, yt as FileTreeFile, z as CreateSessionOptions, zi as TaskSessionCommitResult, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult, zt as GPU_LEASE_PROVIDER_NAMES } from "./types-BZuZPQ0N.js";
|
|
5
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-fy_RYdGN.js";
|
|
6
|
+
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CS-t6tPU.js";
|
|
7
7
|
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "./index-BzAxTiqF.js";
|
|
8
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, i as EgressProxyRecoveryError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
9
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
10
|
-
import { o as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
8
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, i as EgressProxyRecoveryError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-Cv3Td7LB.js";
|
|
9
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-BSysiQWr.js";
|
|
10
|
+
import { o as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-hYNUMvGr.js";
|
|
11
11
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
12
12
|
import { AgentProfile, AgentProfile as AgentProfile$1, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConfigValue, AgentProfileConnection, AgentProfileFileMount, AgentProfileFileMount as AgentProfileFileMount$1, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, AgentSubagentProfile, Capability, SANDBOX_SIZE_PRESET_NAMES, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
13
13
|
import { z } from "zod";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as deriveAgentRunOutcome, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, m as normalizeRuntimeBackendConfig, u as parseSSEStream, v as backendTypeSchema, y as parseBackendType } from "./runtime-api-
|
|
2
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, i as EgressProxyRecoveryError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
3
|
-
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-
|
|
1
|
+
import { _ as deriveAgentRunOutcome, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, m as normalizeRuntimeBackendConfig, u as parseSSEStream, v as backendTypeSchema, y as parseBackendType } from "./runtime-api-DokfzHVX.js";
|
|
2
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, i as EgressProxyRecoveryError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
3
|
+
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-j6FmPkNB.js";
|
|
4
4
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, c as createInteractiveControlHolderId, l as interactiveSessionIdentityDigest, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-Dv0gbFMu.js";
|
|
5
|
-
import { A as toOtelJson, C as collectAgentResponseText, D as buildTraceExportPayload, O as exportTraceBundle, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, k as otelTraceIdForTangleTrace, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox-
|
|
6
|
-
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-
|
|
7
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
5
|
+
import { A as toOtelJson, C as collectAgentResponseText, D as buildTraceExportPayload, O as exportTraceBundle, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, k as otelTraceIdForTangleTrace, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox-BFZa_Gx-.js";
|
|
6
|
+
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CDvc5Hxk.js";
|
|
7
|
+
import { t as TangleSandboxClient } from "./tangle-Dn2pS3TZ.js";
|
|
8
8
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/confidential.ts
|
|
@@ -1098,10 +1098,6 @@ function buildTangleRouterSearchProfile(config, options = {}) {
|
|
|
1098
1098
|
return {
|
|
1099
1099
|
name: options.name ?? "tangle-router-web-search",
|
|
1100
1100
|
model: { default: options.model ?? config.tcloud.sandboxBackend.model.model },
|
|
1101
|
-
permissions: {
|
|
1102
|
-
network: "allow",
|
|
1103
|
-
mcp: "allow"
|
|
1104
|
-
},
|
|
1105
1101
|
mcp: { tangle_web_search: {
|
|
1106
1102
|
transport: "http",
|
|
1107
1103
|
url: config.mcp.streamable_http_url,
|
|
@@ -1250,10 +1246,6 @@ function buildSandboxBackend(options) {
|
|
|
1250
1246
|
const profile = {
|
|
1251
1247
|
name: options.profile?.name ?? options.profile?.id ?? "tangle-router-benchmark",
|
|
1252
1248
|
model: { default: options.profile?.model ?? model.model },
|
|
1253
|
-
permissions: {
|
|
1254
|
-
network: "allow",
|
|
1255
|
-
mcp: "allow"
|
|
1256
|
-
},
|
|
1257
1249
|
mcp: { tangle_web_search: searchProvider === "off" ? { enabled: false } : {
|
|
1258
1250
|
transport: "http",
|
|
1259
1251
|
url: options.config.mcp.streamable_http_url,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as parseErrorResponse, o as NetworkError, p as TimeoutError } from "../errors-
|
|
1
|
+
import { h as parseErrorResponse, o as NetworkError, p as TimeoutError } from "../errors-V6uPkjfJ.js";
|
|
2
2
|
//#region src/intelligence/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* `@tangle-network/sandbox/intelligence` — browser-safe typed client for the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as ServerError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, u as SandboxError } from "./errors-
|
|
1
|
+
import { d as ServerError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
2
2
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
3
3
|
import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, harnessTypeSchema } from "@tangle-network/agent-interface";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -1046,10 +1046,11 @@ function appendSessionIdQuery(params, sessionId) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
//#endregion
|
|
1048
1048
|
//#region src/runtime-api.ts
|
|
1049
|
-
function
|
|
1050
|
-
return error instanceof SandboxError && error.status === 503 && error.code === "MODEL_CREDENTIAL_SUPERSEDED";
|
|
1049
|
+
function isRetryableCredentialRefusal(error) {
|
|
1050
|
+
return error instanceof SandboxError && error.status === 503 && (error.code === "MODEL_CREDENTIAL_SUPERSEDED" || error.code === "HUB_CREDENTIAL_REFRESH_UNAVAILABLE");
|
|
1051
1051
|
}
|
|
1052
1052
|
function waitForRetryAfter(delayMs, signal) {
|
|
1053
|
+
signal?.throwIfAborted();
|
|
1053
1054
|
if (delayMs <= 0) return Promise.resolve();
|
|
1054
1055
|
return new Promise((resolve, reject) => {
|
|
1055
1056
|
let timer;
|
|
@@ -1372,7 +1373,7 @@ var SandboxRuntimeApi = class {
|
|
|
1372
1373
|
try {
|
|
1373
1374
|
return await this.json(path, init);
|
|
1374
1375
|
} catch (error) {
|
|
1375
|
-
if (!
|
|
1376
|
+
if (!isRetryableCredentialRefusal(error)) throw error;
|
|
1376
1377
|
await waitForRetryAfter(error.retryAfterMs ?? 1e3, signal);
|
|
1377
1378
|
return this.json(path, init);
|
|
1378
1379
|
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $i as UploadProgress, $r as SandboxTerminalManager, A as CommitTaskSessionOptions, B as CreateTaskSessionOptions, Ci as SessionMessage, Ct as FileUsageResult, Jr as SandboxRuntimeHealth, Qr as SandboxTerminalInfo, Ri as TaskSessionChanges, St as FileUsageOptions, T as ChunkedUploadResult, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Zr as SandboxTerminalCreateOptions, _i as SessionExecutionStatus, _t as FileRenameResult, bi as SessionInfo, bt as FileTreeOptions, di as SendSessionMessageOptions, ei as SandboxTerminalRequestOptions, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, ln as ListMessagesOptions, mt as FileReadBatchResult, pi as SentSessionMessage, pt as FileReadBatchOptions, qn as RenameOptions, w as ChunkedUploadOptions, wt as FileWriteResult, xt as FileTreeResult, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-
|
|
2
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
3
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
1
|
+
import { $i as UploadProgress, $r as SandboxTerminalManager, A as CommitTaskSessionOptions, B as CreateTaskSessionOptions, Ci as SessionMessage, Ct as FileUsageResult, Jr as SandboxRuntimeHealth, Qr as SandboxTerminalInfo, Ri as TaskSessionChanges, St as FileUsageOptions, T as ChunkedUploadResult, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Zr as SandboxTerminalCreateOptions, _i as SessionExecutionStatus, _t as FileRenameResult, bi as SessionInfo, bt as FileTreeOptions, di as SendSessionMessageOptions, ei as SandboxTerminalRequestOptions, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, ln as ListMessagesOptions, mt as FileReadBatchResult, pi as SentSessionMessage, pt as FileReadBatchOptions, qn as RenameOptions, w as ChunkedUploadOptions, wt as FileWriteResult, xt as FileTreeResult, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-BZuZPQ0N.js";
|
|
2
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as SandboxErrorJson, f as SandboxFailureDetail, g as ValidationError, h as TimeoutError, l as QuotaError, m as StateError, n as CapabilityError, o as NetworkError, p as ServerError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-Cv3Td7LB.js";
|
|
3
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-BSysiQWr.js";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/chunked-upload.d.ts
|
|
6
6
|
/** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
|
package/dist/runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as deriveAgentRunOutcome, a as uploadChunked, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, t as SandboxRuntimeApi } from "./runtime-api-
|
|
2
|
-
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
1
|
+
import { _ as deriveAgentRunOutcome, a as uploadChunked, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, t as SandboxRuntimeApi } from "./runtime-api-DokfzHVX.js";
|
|
2
|
+
import { a as FileWriteConflictError, c as PartialFailureError, d as ServerError, f as StateError, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
3
3
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
4
4
|
//#region src/runtime-client.ts
|
|
5
5
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as uploadChunked, c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, i as sessionHeaders, m as normalizeRuntimeBackendConfig, n as normalizeSessionInfo, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as mergeRuntimeBackendConfig, r as appendSessionIdQuery, t as SandboxRuntimeApi, u as parseSSEStream } from "./runtime-api-
|
|
2
|
-
import { d as ServerError, f as StateError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
1
|
+
import { a as uploadChunked, c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, i as sessionHeaders, m as normalizeRuntimeBackendConfig, n as normalizeSessionInfo, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as mergeRuntimeBackendConfig, r as appendSessionIdQuery, t as SandboxRuntimeApi, u as parseSSEStream } from "./runtime-api-DokfzHVX.js";
|
|
2
|
+
import { d as ServerError, f as StateError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
3
3
|
import { c as createInteractiveControlHolderId, d as interactiveSessionControlReleaseResponseSchema, f as interactiveSessionControlValidationResponseSchema, i as createBrowserInteractiveSessionControlTransport, o as InteractiveSessionControlController, p as interactiveSessionStatusResponseSchema, r as browserInteractiveTerminalEndpoint, s as assertInteractiveSessionRef, u as interactiveSessionControlClaimResponseSchema } from "./browser-interactive-control-controller-Dv0gbFMu.js";
|
|
4
4
|
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-si1WMfJb.js";
|
|
5
5
|
import { AgentExactRunControlRefSchema, AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionPromptCommandSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStartSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentInteractiveSessionStopCommandSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, InteractionAcknowledgementSchema, InteractionBindingSchema, InteractionRequestSchema, InteractionResponseCommandSchema, InteractionResponseSchema, TerminalInputSchema, TerminalOutputEventSchema, TerminalReplayWindowSchema, TerminalResizeSchema, TerminalSessionRefSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimIsNewer, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionPromptRequestDigest, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentRunCancellationAcknowledgementMatchesRequest, canonicalCandidateDigest, exactAgentInteractiveSessionStart, sha256DigestSchema, terminalSessionUsable } from "@tangle-network/agent-interface";
|
|
@@ -4001,12 +4001,13 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4001
4001
|
*/
|
|
4002
4002
|
async exec(command, options) {
|
|
4003
4003
|
const headers = sessionHeaders(options?.sessionId);
|
|
4004
|
-
await this.ensureRunning();
|
|
4004
|
+
await this.ensureRunning(options?.signal);
|
|
4005
4005
|
const timeoutMs = options?.timeoutMs ?? EXEC_DEFAULT_TIMEOUT_MS;
|
|
4006
4006
|
if (!Number.isInteger(timeoutMs) || timeoutMs < EXEC_MIN_TIMEOUT_MS || timeoutMs > EXEC_MAX_TIMEOUT_MS) throw new ValidationError(`exec timeoutMs must be an integer between ${EXEC_MIN_TIMEOUT_MS} and ${EXEC_MAX_TIMEOUT_MS}`);
|
|
4007
4007
|
const response = await this.runtimeFetch("/process/spawn", {
|
|
4008
4008
|
method: "POST",
|
|
4009
4009
|
headers,
|
|
4010
|
+
...options?.signal ? { signal: options.signal } : {},
|
|
4010
4011
|
body: JSON.stringify({
|
|
4011
4012
|
executable: SANDBOX_COMMAND_SHELL,
|
|
4012
4013
|
args: sandboxShellCommandArgs(command),
|
|
@@ -5213,28 +5214,18 @@ var SandboxInstance = class SandboxInstance {
|
|
|
5213
5214
|
}
|
|
5214
5215
|
async fsUpload(localPath, remotePath, options) {
|
|
5215
5216
|
await this.ensureRunning();
|
|
5216
|
-
const
|
|
5217
|
-
const path = await import("node:path");
|
|
5218
|
-
const fileBuffer = await fs.readFile(localPath);
|
|
5219
|
-
const fileName = path.basename(localPath);
|
|
5217
|
+
const fileBuffer = await (await import("node:fs/promises")).readFile(localPath);
|
|
5220
5218
|
if (options?.onProgress) options.onProgress({
|
|
5221
5219
|
bytesUploaded: 0,
|
|
5222
5220
|
totalBytes: fileBuffer.length,
|
|
5223
5221
|
percentage: 0
|
|
5224
5222
|
});
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
method: "POST",
|
|
5231
|
-
body: formData,
|
|
5232
|
-
headers: {}
|
|
5223
|
+
await this.fsUploadData(remotePath, fileBuffer, {
|
|
5224
|
+
mode: options?.permissions,
|
|
5225
|
+
onProgress: options?.onProgress ? (progress) => {
|
|
5226
|
+
if (progress.percentage < 100) options.onProgress?.(progress);
|
|
5227
|
+
} : void 0
|
|
5233
5228
|
});
|
|
5234
|
-
if (!response.ok) {
|
|
5235
|
-
const body = await response.text();
|
|
5236
|
-
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
5237
|
-
}
|
|
5238
5229
|
if (options?.onProgress) options.onProgress({
|
|
5239
5230
|
bytesUploaded: fileBuffer.length,
|
|
5240
5231
|
totalBytes: fileBuffer.length,
|
|
@@ -6933,7 +6924,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6933
6924
|
return attempt;
|
|
6934
6925
|
}, signal ? { signal } : {});
|
|
6935
6926
|
const data = await this.readLifecycleResponse(response);
|
|
6936
|
-
if (!this.applyLifecycleResponse(data)) await this.refresh();
|
|
6927
|
+
if (!this.applyLifecycleResponse(data)) await this.refresh(signal);
|
|
6937
6928
|
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6938
6929
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6939
6930
|
}
|
|
@@ -6949,12 +6940,16 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6949
6940
|
* {@link startupDiagnostics} returns it for post-mortem reads on the
|
|
6950
6941
|
* now-gone sandbox.
|
|
6951
6942
|
*/
|
|
6952
|
-
async delete() {
|
|
6943
|
+
async delete(options) {
|
|
6944
|
+
options?.signal?.throwIfAborted();
|
|
6953
6945
|
let sawLifecycleConflict = false;
|
|
6954
6946
|
let response;
|
|
6955
6947
|
try {
|
|
6956
6948
|
response = await withLifecycleConflictRetry(async () => {
|
|
6957
|
-
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}`, {
|
|
6949
|
+
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}`, {
|
|
6950
|
+
method: "DELETE",
|
|
6951
|
+
...options?.signal ? { signal: options.signal } : {}
|
|
6952
|
+
});
|
|
6958
6953
|
if (!attempt.ok) {
|
|
6959
6954
|
const body = await attempt.text();
|
|
6960
6955
|
const refusal = parseErrorResponse(attempt.status, body, void 0, attempt.headers);
|
|
@@ -6962,7 +6957,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6962
6957
|
throw refusal;
|
|
6963
6958
|
}
|
|
6964
6959
|
return attempt;
|
|
6965
|
-
});
|
|
6960
|
+
}, options);
|
|
6966
6961
|
} catch (caught) {
|
|
6967
6962
|
if (!sawLifecycleConflict || !(caught instanceof NotFoundError)) throw caught;
|
|
6968
6963
|
sandboxStatusObservedAt.delete(this);
|
|
@@ -6972,6 +6967,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6972
6967
|
};
|
|
6973
6968
|
}
|
|
6974
6969
|
const data = await response.json().catch(() => null);
|
|
6970
|
+
options?.signal?.throwIfAborted();
|
|
6975
6971
|
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6976
6972
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6977
6973
|
sandboxStatusObservedAt.delete(this);
|
|
@@ -7124,19 +7120,27 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7124
7120
|
const timeoutMs = options?.timeoutMs ?? 12e4;
|
|
7125
7121
|
const pollIntervalMs = options?.pollIntervalMs ?? 2e3;
|
|
7126
7122
|
const startTime = Date.now();
|
|
7123
|
+
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
7124
|
+
const signal = options?.signal ? combineAbortSignals([options.signal, timeoutSignal]) : timeoutSignal;
|
|
7125
|
+
const rethrowWaitError = (error) => {
|
|
7126
|
+
if (timeoutSignal.aborted) throw new TimeoutError(timeoutMs, `Timed out waiting for sandbox to reach ${statuses.join(" or ")}`);
|
|
7127
|
+
if (options?.signal?.aborted) throw new TimeoutError(0, "Aborted");
|
|
7128
|
+
throw error;
|
|
7129
|
+
};
|
|
7127
7130
|
if (options?.onProgress && (this.status === "provisioning" || this.status === "pending")) try {
|
|
7128
|
-
if (await this.waitForWithSSE(statuses, timeoutMs, options.onProgress,
|
|
7131
|
+
if (await this.waitForWithSSE(statuses, timeoutMs, options.onProgress, signal)) return;
|
|
7129
7132
|
} catch (err) {
|
|
7133
|
+
if (signal.aborted) rethrowWaitError(err);
|
|
7130
7134
|
if (err instanceof StateError || err instanceof TimeoutError) throw err;
|
|
7131
7135
|
}
|
|
7132
7136
|
if (this.hasFreshStatus() && this.hasReachedWaitTarget(statuses)) return;
|
|
7133
7137
|
while (true) {
|
|
7134
|
-
if (
|
|
7135
|
-
await this.refresh();
|
|
7138
|
+
if (signal.aborted) rethrowWaitError(signal.reason);
|
|
7139
|
+
await this.refresh(signal).catch(rethrowWaitError);
|
|
7136
7140
|
if (this.hasReachedWaitTarget(statuses)) return;
|
|
7137
7141
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7138
7142
|
if (Date.now() - startTime > timeoutMs) throw new TimeoutError(timeoutMs, `Timed out waiting for sandbox to reach ${statuses.join(" or ")}`);
|
|
7139
|
-
await
|
|
7143
|
+
await delayUntilAborted(pollIntervalMs, signal).catch(rethrowWaitError);
|
|
7140
7144
|
}
|
|
7141
7145
|
}
|
|
7142
7146
|
/**
|
|
@@ -7173,14 +7177,14 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7173
7177
|
timestamp: d.timestamp ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
7174
7178
|
});
|
|
7175
7179
|
} else if (event.type === "provision_failed") {
|
|
7176
|
-
await this.refresh();
|
|
7180
|
+
await this.refresh(abortController.signal);
|
|
7177
7181
|
throw new StateError(event.data.error ?? "Provisioning failed", this.status);
|
|
7178
7182
|
} else if (event.type === "provision_complete" || event.type === "status_change") {
|
|
7179
|
-
await this.refresh();
|
|
7183
|
+
await this.refresh(abortController.signal);
|
|
7180
7184
|
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
7181
7185
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7182
7186
|
}
|
|
7183
|
-
await this.refresh();
|
|
7187
|
+
await this.refresh(abortController.signal);
|
|
7184
7188
|
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
7185
7189
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7186
7190
|
if (statuses.includes("running") && this.status === "running") return false;
|
|
@@ -7632,9 +7636,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7632
7636
|
* Drive a detached turn forward by exactly one settle → poll → dispatch
|
|
7633
7637
|
* pass and report where it stands. Built for tick-based callers —
|
|
7634
7638
|
* Cloudflare Workflows steps, queue consumers, crons — that re-invoke
|
|
7635
|
-
* on their own schedule instead of holding a stream open.
|
|
7636
|
-
*
|
|
7637
|
-
*
|
|
7639
|
+
* on their own schedule instead of holding a stream open.
|
|
7640
|
+
* The pass does not poll repeatedly or keep a connection alive.
|
|
7641
|
+
* Session admission may retry one classified pre-dispatch credential refusal.
|
|
7638
7642
|
*
|
|
7639
7643
|
* The pass resolves to the first of:
|
|
7640
7644
|
* 1. The completed-turn cache has `turnId` → `completed`, or `failed`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-CcaBTVg3.js";
|
|
2
2
|
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-BELrFH4f.js";
|
|
3
|
-
import { $ as DurablePlanDecisionResult, A as CommitTaskSessionOptions, Ai as SnapshotInfo, B as CreateTaskSessionOptions, C as BranchOptions, Ci as SessionMessage, D as CodeExecutionResult, Di as SnapshotDeleteAcknowledgement, E as CodeExecutionOptions, Fn as ProvisionEvent, G as DispatchedSession, Gi as TeeAttestationResponse, Gr as SandboxResourceUsage, Gt as GitStatus, Ht as GitCommit, In as ProvisionResult, It as ForkCounts, J as DriveTurnOptions, Jn as RestoreSnapshotOptions, Jr as SandboxRuntimeHealth, Kt as GpuLease, Lt as ForkIdempotency, Mi as SnapshotResult, Mn as PromptInputPart, Nn as PromptOptions, O as CodeLanguage, On as ProcessManager, Pi as StartupDiagnostics, Pn as PromptResult, Q as DurablePlan, Qn as RolloutOptions, Ri as TaskSessionChanges, Rt as ForkLookupOptions, Si as SessionListOptions, Sn as PreviewLinkManager, Ti as SessionResultOptions, Ui as TeeAttestationOptions, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Yn as ResumeOptions, Yr as SandboxStatus, Zt as GpuLeaseManager, _n as NetworkManager, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, at as EgressManager, bi as SessionInfo, bn as PermissionsManager, ci as SearchOptions, cn as JsonValue, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, di as SendSessionMessageOptions, dt as ExecResult, er as RolloutStartResult, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, in as IntelligenceReportBudget, ir as SSHCredentials, j as CompletedTurnResult, ji as SnapshotOptions, jr as SandboxFleetTraceBundle, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, oa as WriteManyOptions, or as SandboxConnection, p as BackendManager, pi as SentSessionMessage, qi as TeePublicKeyResponse, qr as SandboxRuntimeCapabilities, ra as WorkspaceOperationLookup, rn as IntelligenceReport, rr as SSHCommandDescriptor, si as SearchMatch, sn as IntelligenceReportWindow, ta as WaitForOptions, ti as SandboxTerminals, ut as ExecOptions, vt as FileSystem, wt as FileWriteResult, xi as SessionInterruptOptions, yi as SessionForkOptions, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-
|
|
3
|
+
import { $ as DurablePlanDecisionResult, A as CommitTaskSessionOptions, Ai as SnapshotInfo, B as CreateTaskSessionOptions, C as BranchOptions, Ci as SessionMessage, D as CodeExecutionResult, Di as SnapshotDeleteAcknowledgement, E as CodeExecutionOptions, Fn as ProvisionEvent, G as DispatchedSession, Gi as TeeAttestationResponse, Gr as SandboxResourceUsage, Gt as GitStatus, Ht as GitCommit, In as ProvisionResult, It as ForkCounts, J as DriveTurnOptions, Jn as RestoreSnapshotOptions, Jr as SandboxRuntimeHealth, Kt as GpuLease, Lt as ForkIdempotency, Mi as SnapshotResult, Mn as PromptInputPart, Nn as PromptOptions, O as CodeLanguage, On as ProcessManager, Pi as StartupDiagnostics, Pn as PromptResult, Q as DurablePlan, Qn as RolloutOptions, Ri as TaskSessionChanges, Rt as ForkLookupOptions, Si as SessionListOptions, Sn as PreviewLinkManager, Ti as SessionResultOptions, Ui as TeeAttestationOptions, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Yn as ResumeOptions, Yr as SandboxStatus, Zt as GpuLeaseManager, _n as NetworkManager, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, at as EgressManager, bi as SessionInfo, bn as PermissionsManager, ci as SearchOptions, cn as JsonValue, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, di as SendSessionMessageOptions, dt as ExecResult, er as RolloutStartResult, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, in as IntelligenceReportBudget, ir as SSHCredentials, j as CompletedTurnResult, ji as SnapshotOptions, jr as SandboxFleetTraceBundle, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, oa as WriteManyOptions, or as SandboxConnection, p as BackendManager, pi as SentSessionMessage, qi as TeePublicKeyResponse, qr as SandboxRuntimeCapabilities, ra as WorkspaceOperationLookup, rn as IntelligenceReport, rr as SSHCommandDescriptor, si as SearchMatch, sn as IntelligenceReportWindow, ta as WaitForOptions, ti as SandboxTerminals, ut as ExecOptions, vt as FileSystem, wt as FileWriteResult, xi as SessionInterruptOptions, yi as SessionForkOptions, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-BZuZPQ0N.js";
|
|
4
4
|
import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentInteractiveTerminalSession, AgentInteractiveTerminalSession as AgentInteractiveTerminalSession$1, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand, TerminalOutputEvent, TerminalReplayWindow, agentInteractiveSessionPromptRequestDigest } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1721,7 +1721,7 @@ declare class SandboxInstance {
|
|
|
1721
1721
|
* {@link startupDiagnostics} returns it for post-mortem reads on the
|
|
1722
1722
|
* now-gone sandbox.
|
|
1723
1723
|
*/
|
|
1724
|
-
delete(): Promise<SandboxDeleteAcknowledgement>;
|
|
1724
|
+
delete(options?: Pick<ResumeOptions, "signal">): Promise<SandboxDeleteAcknowledgement>;
|
|
1725
1725
|
/**
|
|
1726
1726
|
* Read a lifecycle response body once.
|
|
1727
1727
|
*
|
|
@@ -1942,9 +1942,9 @@ declare class SandboxInstance {
|
|
|
1942
1942
|
* Drive a detached turn forward by exactly one settle → poll → dispatch
|
|
1943
1943
|
* pass and report where it stands. Built for tick-based callers —
|
|
1944
1944
|
* Cloudflare Workflows steps, queue consumers, crons — that re-invoke
|
|
1945
|
-
* on their own schedule instead of holding a stream open.
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1945
|
+
* on their own schedule instead of holding a stream open.
|
|
1946
|
+
* The pass does not poll repeatedly or keep a connection alive.
|
|
1947
|
+
* Session admission may retry one classified pre-dispatch credential refusal.
|
|
1948
1948
|
*
|
|
1949
1949
|
* The pass resolves to the first of:
|
|
1950
1950
|
* 1. The completed-turn cache has `turnId` → `completed`, or `failed`
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-hYNUMvGr.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-Dn2pS3TZ.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as parseErrorResponse } from "./errors-
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
1
|
+
import { h as parseErrorResponse } from "./errors-V6uPkjfJ.js";
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-BFZa_Gx-.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -1515,12 +1515,14 @@ interface CreateSandboxOptions {
|
|
|
1515
1515
|
/** Environment variables injected into the sandbox */
|
|
1516
1516
|
env?: Record<string, string>;
|
|
1517
1517
|
/**
|
|
1518
|
-
* Maximum
|
|
1518
|
+
* Maximum continuous runtime in seconds for each create or resume interval.
|
|
1519
1519
|
*
|
|
1520
1520
|
* On expiry the sandbox is SUSPENDED, not deleted: the container stops and
|
|
1521
1521
|
* the workspace is preserved, with a best-effort pre-suspend snapshot when
|
|
1522
1522
|
* the platform has snapshots enabled. It can be resumed for as long as it
|
|
1523
|
-
* stays suspended
|
|
1523
|
+
* stays suspended. Resume starts a new runtime interval with the same limit;
|
|
1524
|
+
* reads, connections, and activity do not extend that interval.
|
|
1525
|
+
* Once the cold window also elapses (6 hours by default)
|
|
1524
1526
|
* the container is reclaimed, and bringing the preserved workspace back is
|
|
1525
1527
|
* a re-provision against the same ref rather than a resume. Drivers with a
|
|
1526
1528
|
* create/delete-only lifecycle (`driver: "tangle"`) skip the suspend
|
|
@@ -2192,6 +2194,8 @@ interface ExecResult {
|
|
|
2192
2194
|
* The command inherits the sandbox runtime environment.
|
|
2193
2195
|
*/
|
|
2194
2196
|
interface ExecOptions {
|
|
2197
|
+
/** Cancel readiness checks and the command request; the server timeout still bounds the process. */
|
|
2198
|
+
signal?: AbortSignal;
|
|
2195
2199
|
/** Working directory for the command. It must resolve within the active
|
|
2196
2200
|
* workspace; paths outside that boundary are rejected. When `sessionId`
|
|
2197
2201
|
* is set, the runtime resolves the path against that task's isolated
|
|
@@ -6049,8 +6053,9 @@ interface FileSystem {
|
|
|
6049
6053
|
search(query: string, options?: SearchOptions): AsyncIterable<SearchMatch>;
|
|
6050
6054
|
/**
|
|
6051
6055
|
* Upload a local file to the sandbox.
|
|
6052
|
-
*
|
|
6056
|
+
* Uses checksum-verified chunked upload through gateway or direct connections.
|
|
6053
6057
|
* Creates parent directories as needed.
|
|
6058
|
+
* The upload session limit also applies to local files.
|
|
6054
6059
|
*
|
|
6055
6060
|
* @param localPath - Path to local file
|
|
6056
6061
|
* @param remotePath - Destination path in sandbox
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.1-develop.20260912191433.b31d83f",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -135,10 +135,11 @@
|
|
|
135
135
|
"vitest": "^4.1.5",
|
|
136
136
|
"ws": "^8.20.0",
|
|
137
137
|
"yjs": "13.6.30",
|
|
138
|
+
"@tangle-network/agent-profile-materialize": "0.20.0",
|
|
138
139
|
"@repo/shared": "0.0.0",
|
|
139
140
|
"@tangle-network/sse-core": "0.0.0",
|
|
140
|
-
"@tangle-network/
|
|
141
|
-
"@tangle-network/
|
|
141
|
+
"@tangle-network/runtime-contracts": "0.6.6",
|
|
142
|
+
"@tangle-network/cli-agent-registry": "0.4.0"
|
|
142
143
|
},
|
|
143
144
|
"scripts": {
|
|
144
145
|
"build": "node scripts/build-dist.mjs",
|