@tangle-network/sandbox 1.0.213 → 1.0.215
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/dist/agent/index.js +3 -3
- package/dist/agent/preview.js +1 -1
- package/dist/{api-request-CFHEMkVm.js → api-request-BKzR6BJ4.js} +1 -1
- package/dist/{client-BIGhA9QY.js → client-DBfpAz8x.js} +2 -2
- package/dist/{core-GPiYUrlN.js → core-HKoYifvH.js} +1 -1
- package/dist/core.js +3 -3
- package/dist/index.js +4 -4
- package/dist/intelligence/index.js +1 -1
- package/dist/{mcp-local-GVKad_0t.js → mcp-local-YFGnFNBR.js} +2 -2
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-BCg12-2Y.js → sandbox-CUPiQpiD.js} +14 -22
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-SgLCOhvG.js → tangle-Bo9s-kSv.js} +1 -1
- package/package.json +7 -7
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-YFGnFNBR.js";
|
|
2
2
|
import { O as assertCurrentBackendType } from "../interactive-controller-C-CuPVMA.js";
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-CUPiQpiD.js";
|
|
4
4
|
import { D as ValidationError, _ as NotFoundError, w as StateError } from "../errors-CNszZUZ2.js";
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
5
|
+
import { t as Sandbox } from "../client-DBfpAz8x.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.js
CHANGED
|
@@ -66,7 +66,7 @@ async function servePreviewMcp(request, config) {
|
|
|
66
66
|
if (typeof config.authorize !== "function") throw new Error("Preview MCP requires a host authorization callback");
|
|
67
67
|
const tools = config.tools ?? PREVIEW_TOOLS;
|
|
68
68
|
if (!tools.length || tools.some((tool) => !PREVIEW_TOOLS.includes(tool))) throw new Error("Preview MCP requires an explicit nonempty preview-only tool grant");
|
|
69
|
-
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-
|
|
69
|
+
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-YFGnFNBR.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
|
|
70
70
|
const handle = await createMcpServer(config.box, {
|
|
71
71
|
name: "tangle-previews",
|
|
72
72
|
sessionId: config.sessionId,
|
|
@@ -29,7 +29,7 @@ function rewrapResponse(original, headers, body = original.body) {
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/lib/api-request.mjs
|
|
31
31
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
32
|
-
const SDK_VERSION = "1.0.
|
|
32
|
+
const SDK_VERSION = "1.0.215";
|
|
33
33
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
34
34
|
const headers = new Headers(response.headers);
|
|
35
35
|
headers.set("x-tangle-request-path", path);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as normalizeRuntimeBackendConfig, D as applyRequestedModel, E as isBrowserRuntime, H as backendTypeSchema, N as withProfileHarness, O as assertCurrentBackendType, P as withoutCreateOnlyModelFields, S as encodePromptForWire, o as requestInteractiveSessionToken } from "./interactive-controller-C-CuPVMA.js";
|
|
2
2
|
import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
|
|
3
|
-
import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as createRetryDelayMs, I as normalizeEgressPolicyFields, J as isCapacityShortageCreateError, K as extendableDeadline, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as awaitCreateResend, X as isRateLimitCreateError, Y as isDeployWindowCreateError, Z as isRetryableCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as generateIdempotencyKey, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-
|
|
3
|
+
import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as createRetryDelayMs, I as normalizeEgressPolicyFields, J as isCapacityShortageCreateError, K as extendableDeadline, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as awaitCreateResend, X as isRateLimitCreateError, Y as isDeployWindowCreateError, Z as isRetryableCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as generateIdempotencyKey, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-CUPiQpiD.js";
|
|
4
4
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, a as readResponseJson, g as NetworkError, i as parseResponseError, r as parseErrorResponse, s as AuthError, v as PartialFailureError } from "./errors-CNszZUZ2.js";
|
|
5
5
|
import { n as combineAbortSignals } from "./abort-signal-BbJTt2QJ.js";
|
|
6
6
|
import { r as abortableSleep, t as RETRY_POLICY } from "./retry-policy-0_NCh5OB.js";
|
|
7
7
|
import { l as SANDBOX_AGENT_HOME, t as isInsideReservedDir } from "./file-transfer-BSe4ayU9.js";
|
|
8
|
-
import { r as fetchSandboxApi } from "./api-request-
|
|
8
|
+
import { r as fetchSandboxApi } from "./api-request-BKzR6BJ4.js";
|
|
9
9
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-BIaDMUtu.js";
|
|
10
10
|
import { t as parseSSEStream } from "./sse-parser-DOCszo1K.js";
|
|
11
11
|
import { t as LinesClient } from "./lines-DHOIUO-t.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
|
|
2
|
-
import { Q as canonicalAgentProfileDigest } from "./sandbox-
|
|
2
|
+
import { Q as canonicalAgentProfileDigest } from "./sandbox-CUPiQpiD.js";
|
|
3
3
|
import { D as ValidationError, S as SandboxError, l as CapabilityError } from "./errors-CNszZUZ2.js";
|
|
4
4
|
import { t as awaitWithAbort } from "./abort-signal-BbJTt2QJ.js";
|
|
5
5
|
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-
|
|
1
|
+
import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-CUPiQpiD.js";
|
|
2
2
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, b as QuotaError, g as NetworkError, l as CapabilityError, p as FileWriteConflictError, r as parseErrorResponse, s as AuthError, v as PartialFailureError, w as StateError, y as ProfileFileMountPathError } from "./errors-CNszZUZ2.js";
|
|
3
|
-
import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } from "./client-
|
|
3
|
+
import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } from "./client-DBfpAz8x.js";
|
|
4
4
|
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-DHOIUO-t.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
6
|
-
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-
|
|
6
|
+
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-HKoYifvH.js";
|
|
7
7
|
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, SeatSelectionError, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, G as parseBackendType, H as backendTypeSchema, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-C-CuPVMA.js";
|
|
2
2
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, k as agentInteractiveSessionPromptRequestDigest, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-BiP6TJFP.js";
|
|
3
3
|
import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-C1KpT-wS.js";
|
|
4
|
-
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-
|
|
4
|
+
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-CUPiQpiD.js";
|
|
5
5
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, T as StreamInterruptedError, _ as NotFoundError, b as QuotaError, c as BranchFanoutExceedsHostError, d as EdgeNotReadyError, f as EgressProxyRecoveryError, g as NetworkError, h as KeyBudgetExhaustedError, l as CapabilityError, m as GpuProviderNotConfiguredError, p as FileWriteConflictError, r as parseErrorResponse, s as AuthError, t as TerminalStreamError, u as CompliancePlacementError, v as PartialFailureError, w as StateError, x as ResumeEnvRequiredError, y as ProfileFileMountPathError } from "./errors-CNszZUZ2.js";
|
|
6
|
-
import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-
|
|
6
|
+
import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-DBfpAz8x.js";
|
|
7
7
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-BgSGO1KD.js";
|
|
8
8
|
import { t as parseSSEStream } from "./sse-parser-DOCszo1K.js";
|
|
9
9
|
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-DHOIUO-t.js";
|
|
10
10
|
import { t as downloadFile } from "./file-download-DrzpcvdM.js";
|
|
11
11
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
12
|
-
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-
|
|
13
|
-
import { s as BlueprintSandboxClient } from "./tangle-
|
|
12
|
+
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-HKoYifvH.js";
|
|
13
|
+
import { s as BlueprintSandboxClient } from "./tangle-Bo9s-kSv.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
//#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
|
|
16
16
|
const MANAGED_MODEL_KEY_SENTINEL = "proxy-managed-per-request";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as TimeoutError, g as NetworkError, r as parseErrorResponse } from "../errors-CNszZUZ2.js";
|
|
2
|
-
import { r as fetchSandboxApi } from "../api-request-
|
|
2
|
+
import { r as fetchSandboxApi } from "../api-request-BKzR6BJ4.js";
|
|
3
3
|
import { n as verifyDownload } from "../file-download-DrzpcvdM.js";
|
|
4
4
|
//#region src/intelligence/index.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-BSe4ayU9.js";
|
|
2
|
-
import "./api-request-
|
|
2
|
+
import "./api-request-BKzR6BJ4.js";
|
|
3
3
|
import { a as listAgentPreviews, i as getAgentPreview, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "./preview-operations-B3TTvqlm.js";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -396,7 +396,7 @@ async function createMcpServer(box, options = {}) {
|
|
|
396
396
|
const { bindings, handlers } = bindToolSpecs(box, options);
|
|
397
397
|
const server = new serverModule.Server({
|
|
398
398
|
name: options.name ?? "tangle-sandbox",
|
|
399
|
-
version: options.version ?? "1.0.
|
|
399
|
+
version: options.version ?? "1.0.215"
|
|
400
400
|
}, { capabilities: { tools: {} } });
|
|
401
401
|
server.setRequestHandler(typesModule.ListToolsRequestSchema, async () => ({ tools: bindings.map(({ spec: s }) => ({
|
|
402
402
|
name: s.name,
|
package/dist/runtime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as
|
|
|
2
2
|
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-BiP6TJFP.js";
|
|
3
3
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, b as QuotaError, g as NetworkError, l as CapabilityError, p as FileWriteConflictError, s as AuthError, v as PartialFailureError, w as StateError, y as ProfileFileMountPathError } from "./errors-CNszZUZ2.js";
|
|
4
4
|
import { s as uploadChunked } from "./chunked-upload-D6ZCQ-iN.js";
|
|
5
|
-
import { r as fetchSandboxApi } from "./api-request-
|
|
5
|
+
import { r as fetchSandboxApi } from "./api-request-BKzR6BJ4.js";
|
|
6
6
|
//#region src/runtime-client.ts
|
|
7
7
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
8
8
|
function requireToken(token) {
|
|
@@ -8,7 +8,7 @@ import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-Bb
|
|
|
8
8
|
import { a as backoffDelayMs, r as abortableSleep } from "./retry-policy-0_NCh5OB.js";
|
|
9
9
|
import { a as SANDBOX_PROXY_REQUEST_MAX_BYTES, c as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, d as isProfileFileMountOutsideRoots, f as profileFileMountOutsideRootsMessage, l as SANDBOX_AGENT_HOME, o as FILE_OPERATION_LIMITS, u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-BSe4ayU9.js";
|
|
10
10
|
import { c as awaitSdkResend, l as countSdkRequest, s as uploadChunked, u as takeSdkTurn } from "./chunked-upload-D6ZCQ-iN.js";
|
|
11
|
-
import { a as rewrapResponse, i as isReplayableBody, t as IDEMPOTENT_METHODS } from "./api-request-
|
|
11
|
+
import { a as rewrapResponse, i as isReplayableBody, t as IDEMPOTENT_METHODS } from "./api-request-BKzR6BJ4.js";
|
|
12
12
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-BIaDMUtu.js";
|
|
13
13
|
import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-DpBLxIof.js";
|
|
14
14
|
import { t as parseSSEStream } from "./sse-parser-DOCszo1K.js";
|
|
@@ -261,11 +261,7 @@ const TerminalReplayWindowSchema = z.strictObject({
|
|
|
261
261
|
const DEFAULT_CREATE_TIMEOUT_MS = 12e4;
|
|
262
262
|
const DEFAULT_GPU_CREATE_TIMEOUT_MS = 900 * 1e3;
|
|
263
263
|
const CREATE_RETRY_MAX_DELAY_MS = 4e3;
|
|
264
|
-
/**
|
|
265
|
-
* 503s that mean "the cell cannot place this now, ask again"; re-POSTing is
|
|
266
|
-
* safe because the key joins any provision that did start.
|
|
267
|
-
* `SANDBOX_CREATE_RECONCILING` is absent: it outlasts any budget here.
|
|
268
|
-
*/
|
|
264
|
+
/** 503s meaning "cannot place now, ask again"; the key joins any provision that started. `SANDBOX_CREATE_RECONCILING` is absent: it outlasts any budget. */
|
|
269
265
|
const DEPLOY_WINDOW_RETRY_CODES = new Set([
|
|
270
266
|
"INTERNAL_CREATE_PACED",
|
|
271
267
|
"IDEMPOTENT_CREATE_PROBE_FAILED",
|
|
@@ -274,17 +270,9 @@ const DEPLOY_WINDOW_RETRY_CODES = new Set([
|
|
|
274
270
|
"PROVISIONING_PAUSED",
|
|
275
271
|
"SANDBOX_TRANSFER_PENDING"
|
|
276
272
|
]);
|
|
277
|
-
/**
|
|
278
|
-
* Longest a create keeps re-POSTing through the deploy-window family, from its
|
|
279
|
-
* start. Sized to the measured 124 s production host-agent roll; the caller's
|
|
280
|
-
* create deadline binds first when shorter.
|
|
281
|
-
*/
|
|
273
|
+
/** Longest a create keeps re-POSTing through the deploy-window family: the measured 124 s host-agent roll. */
|
|
282
274
|
const DEPLOY_WINDOW_RETRY_MS = 15e4;
|
|
283
|
-
/**
|
|
284
|
-
* Longest a create with no `timeoutMs` waits for the host a capacity refusal's
|
|
285
|
-
* `etaSeconds` says is booting: the cell's measured p95 birth (eu1 230 s) plus
|
|
286
|
-
* a cold start and a control tick; the margin covers registration to placement.
|
|
287
|
-
*/
|
|
275
|
+
/** Longest a create with no `timeoutMs` waits for the host a capacity refusal's `etaSeconds` says is booting (eu1 p95 birth 230 s, cold start and tick). */
|
|
288
276
|
const CAPACITY_ETA_WAIT_MAX_MS = 36e4;
|
|
289
277
|
const CAPACITY_ETA_MARGIN_MS = 15e3;
|
|
290
278
|
/** `AbortSignal.timeout` whose deadline may only move later. */
|
|
@@ -340,19 +328,23 @@ function generateIdempotencyKey() {
|
|
|
340
328
|
}
|
|
341
329
|
throw new Error("idempotency key generation requires global crypto");
|
|
342
330
|
}
|
|
331
|
+
const joinsRunningFork = (cause) => cause instanceof TimeoutError || cause instanceof NetworkError || cause instanceof SandboxError && cause.code === "OPERATION_IN_PROGRESS";
|
|
343
332
|
/**
|
|
344
|
-
* A fork re-POSTs
|
|
345
|
-
*
|
|
346
|
-
*
|
|
333
|
+
* A fork re-POSTs under its one key: a deploy-window refusal (none started a
|
|
334
|
+
* fan-out) within 150 s, and a lost answer or a 409 `OPERATION_IN_PROGRESS`
|
|
335
|
+
* within 600 s. The re-POST joins its own fan-out and replays its children,
|
|
336
|
+
* never starting a second. The caller's abort, a key conflict and final codes
|
|
337
|
+
* throw on the first answer.
|
|
347
338
|
*/
|
|
348
339
|
async function retryForkRefusal(post) {
|
|
349
|
-
const
|
|
340
|
+
const startedAt = Date.now();
|
|
350
341
|
for (let failed = 1;; failed++) try {
|
|
351
342
|
return await post();
|
|
352
343
|
} catch (cause) {
|
|
353
|
-
|
|
344
|
+
const joins = joinsRunningFork(cause);
|
|
345
|
+
if (!(joins || isDeployWindowCreateError(cause)) || !await awaitSdkResend(failed, {
|
|
354
346
|
retryAfterMs: createRetryAfterMs(cause),
|
|
355
|
-
deadlineAt,
|
|
347
|
+
deadlineAt: startedAt + (joins ? 6e5 : 15e4),
|
|
356
348
|
capMs: 4e3
|
|
357
349
|
})) throw cause;
|
|
358
350
|
}
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-
|
|
1
|
+
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-Bo9s-kSv.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
1
|
+
import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-CUPiQpiD.js";
|
|
2
2
|
import { a as readResponseJson } from "./errors-CNszZUZ2.js";
|
|
3
3
|
import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-CK-x8vXj.js";
|
|
4
4
|
//#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.215",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -153,15 +153,15 @@
|
|
|
153
153
|
"vitest": "^4.1.12",
|
|
154
154
|
"ws": "^8.22.0",
|
|
155
155
|
"yjs": "13.6.33",
|
|
156
|
-
"@tangle-network/runtime-contracts": "0.20.0",
|
|
157
|
-
"@tangle-network/agent-profile-materialize": "0.27.1",
|
|
158
|
-
"@repo/shared": "0.0.0",
|
|
159
156
|
"@products/sandbox-test-utils": "0.0.0",
|
|
160
|
-
"@tangle-network/
|
|
157
|
+
"@tangle-network/agent-profile-materialize": "0.27.1",
|
|
158
|
+
"@tangle-network/runtime-contracts": "0.20.0",
|
|
159
|
+
"@tangle-network/cli-agent-registry": "0.15.0",
|
|
160
|
+
"@repo/shared": "0.0.0"
|
|
161
161
|
},
|
|
162
162
|
"tangleRelease": {
|
|
163
|
-
"sourceSha": "
|
|
164
|
-
"mergedAt": "2026-11-
|
|
163
|
+
"sourceSha": "7818d2a1a225e128d93176cea1cb7aa63811bc81",
|
|
164
|
+
"mergedAt": "2026-11-04T04:29:49-08:00"
|
|
165
165
|
},
|
|
166
166
|
"scripts": {
|
|
167
167
|
"build": "node scripts/build-dist.mjs",
|