@tangle-network/sandbox 1.0.285 → 1.0.286
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 +4 -4
- package/dist/agent/preview.js +1 -1
- package/dist/{api-request-CaSTdTqP.js → api-request-jPff7Jml.js} +1 -1
- package/dist/{browser-interactive-control-controller-vWHzqEl4.js → browser-interactive-control-controller-n0QMLrI7.js} +1 -1
- package/dist/{client-BOYw1STo.js → client-BBiGe89R.js} +3 -3
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-DRwybZD_.js → collaboration-9BQ1--Ms.js} +1 -1
- package/dist/core.js +2 -2
- package/dist/gpu-lease/index.js +1 -1
- package/dist/index.js +7 -145
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-D95pUj_w.js → interactive-controller-CNDcKO-e.js} +2 -2
- package/dist/{mcp-local-B18F2DwO.js → mcp-local-B7PNEs8P.js} +2 -2
- package/dist/runtime.js +3 -3
- package/dist/{sandbox-CubFR1Ts.js → sandbox-R753-oV0.js} +142 -4
- package/dist/session-gateway/index.js +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-hrP6dCOR.js → tangle-Ca4eQ4EO.js} +2 -2
- package/package.json +5 -5
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-
|
|
2
|
-
import { D as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-B7PNEs8P.js";
|
|
2
|
+
import { D as assertCurrentBackendType } from "../interactive-controller-CNDcKO-e.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-R753-oV0.js";
|
|
4
4
|
import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-D44qyFpy.js";
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
5
|
+
import { t as Sandbox } from "../client-BBiGe89R.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-B7PNEs8P.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,
|
|
@@ -30,7 +30,7 @@ function rewrapResponse(original, headers, body = original.body) {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/lib/api-request.mjs
|
|
32
32
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
33
|
-
const SDK_VERSION = "1.0.
|
|
33
|
+
const SDK_VERSION = "1.0.286";
|
|
34
34
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
35
35
|
const headers = new Headers(response.headers);
|
|
36
36
|
headers.set("x-tangle-request-path", path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as boundedIdentifierSchema, D as isBoundedEventContentJson, E as boundedStringSchema, S as boundedEventContentStringSchema, T as boundedJsonSchema, _ as CONTRACT_MAX_ARRAY_LENGTH, b as boundedEventContentJsonSchema, g as sha256DigestSchema, o as canonicalCandidateDigest, w as boundedJsonRecordSchema, x as boundedEventContentRecordSchema, y as CONTRACT_MAX_STRING_LENGTH } from "./harness--g8UQ5TZ.js";
|
|
2
2
|
import { t as agentExecutionPreparationReceiptSchema } from "./agent-execution-preparation-receipt-j1Z7Om0k.js";
|
|
3
3
|
import { t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
|
|
4
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
4
|
+
import { i as fetchSandboxApi } from "./api-request-jPff7Jml.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.20/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
7
7
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { D as assertCurrentBackendType, E as applyRequestedModel, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, V as backendTypeSchema, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-
|
|
1
|
+
import { D as assertCurrentBackendType, E as applyRequestedModel, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, V as backendTypeSchema, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-CNDcKO-e.js";
|
|
2
2
|
import { r as agentProfileSchema } from "./profile-schema-B11dRfGB.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as createRetryDelayMs, A as splitInlineProfileSkills, B as normalizeSandboxCreateReceipt, E as deleteSandbox, G as normalizeConnection, J as normalizeSandboxShape, K as normalizeEgressPolicyFields, Q as awaitCreateResend, U as dateOf, V as normalizeStartupDiagnostics, W as parseLifecycleTimes, X as CAPACITY_ETA_WAIT_MAX_MS, Y as CAPACITY_ETA_MARGIN_MS, Z as DEPLOY_WINDOW_RETRY_MS, at as isRetryableCreateError, d as exportTraceBundle, et as extendableDeadline, g as sandboxLedgerUsd, it as isRateLimitCreateError, j as validateDeferredProfileFileMounts, k as splitInlineProfileFileMounts, n as createSandboxInstanceFromResponse, nt as isCapacityShortageCreateError, q as normalizeProxySecretReceipt, rt as isDeployWindowCreateError, tt as generateIdempotencyKey, z as normalizeCaptureProof } from "./sandbox-R753-oV0.js";
|
|
4
4
|
import { C as SandboxError, D as TimeoutError, O as ValidationError, _ as NetworkError, a as readResponseJson, c as AuthError, i as parseResponseError, r as parseErrorResponse, v as NotFoundError, w as ServerError, y as PartialFailureError } from "./errors-D44qyFpy.js";
|
|
5
5
|
import { n as combineAbortSignals } from "./abort-signal-BsriwJ8L.js";
|
|
6
6
|
import { r as abortableSleep, t as RETRY_POLICY } from "./retry-policy-oW3_ljoc.js";
|
|
7
|
-
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-
|
|
7
|
+
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-jPff7Jml.js";
|
|
8
8
|
import { l as SANDBOX_AGENT_HOME, t as isInsideReservedDir } from "./file-transfer-DOSTbUSR.js";
|
|
9
9
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-sGVP8skk.js";
|
|
10
10
|
import { t as parseSSEStream } from "./sse-parser-BCG3iL9j.js";
|
|
@@ -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-9BQ1--Ms.js";
|
|
2
2
|
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as TimeoutError, _ as NetworkError, r as parseErrorResponse } from "./errors-D44qyFpy.js";
|
|
2
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
2
|
+
import { i as fetchSandboxApi } from "./api-request-jPff7Jml.js";
|
|
3
3
|
//#region src/collaboration/client.ts
|
|
4
4
|
function normalizeBaseUrl(url) {
|
|
5
5
|
return url.replace(/\/+$/, "");
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-R753-oV0.js";
|
|
2
2
|
import { C as SandboxError, D as TimeoutError, O as ValidationError, T as StateError, _ as NetworkError, b as ProfileFileMountPathError, c as AuthError, m as FileWriteConflictError, o as responseMetadata, r as parseErrorResponse, u as CapabilityError, v as NotFoundError, w as ServerError, x as QuotaError, y as PartialFailureError } from "./errors-D44qyFpy.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-BBiGe89R.js";
|
|
4
4
|
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-DwJ7AKx7.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
6
6
|
import { a as parseLineApplicationResult, i as parseLineApplicationRequest, n as LINE_APPLICATION_REPLY_MAX_CHARS, o as sandboxFailureKind, r as LINE_APPLICATION_REQUEST_MAX_BYTES, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-CTkHtpap.js";
|
package/dist/gpu-lease/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as fetchSandboxApi } from "../api-request-
|
|
1
|
+
import { i as fetchSandboxApi } from "../api-request-jPff7Jml.js";
|
|
2
2
|
import { t as ITangleJobsAbi } from "../abi-pcDt2Adp.js";
|
|
3
3
|
import { createPublicClient, createWalletClient, decodeAbiParameters, encodeAbiParameters, encodeFunctionData, hexToBytes, http, keccak256, parseAbi, parseAbiParameters, parseEventLogs, recoverMessageAddress, stringToHex } from "viem";
|
|
4
4
|
import { privateKeyToAccount } from "viem/accounts";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as requestedPublicProfileDigest, B as ALL_BACKEND_TYPES, F as createAgentRunOutcomeTracker, H as isolationPrincipalSchema, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, V as backendTypeSchema, W as parseBackendType, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-
|
|
1
|
+
import { A as requestedPublicProfileDigest, B as ALL_BACKEND_TYPES, F as createAgentRunOutcomeTracker, H as isolationPrincipalSchema, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, V as backendTypeSchema, W as parseBackendType, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-CNDcKO-e.js";
|
|
2
2
|
import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-B11dRfGB.js";
|
|
3
|
-
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-
|
|
4
|
-
import { A as
|
|
3
|
+
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-n0QMLrI7.js";
|
|
4
|
+
import { A as splitInlineProfileSkills, C as collectAgentResponseText, D as ManagedProcessClient, F as isMaterializerHarness, I as materializeProfile, L as SandboxOperation, M as HARNESS_LAUNCH_MATERIALIZE_OPTIONS, N as ProfileUnsupportedError, O as materializeProfileFileMounts, P as enforceWorkspacePlanSupport, R as SandboxOperationFailedError, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as InteractiveSessionHandle, a as SANDBOX_RUNTIMES, b as createInteractiveTerminalSession, c as gpuLeaseAttachSchema, d as exportTraceBundle, f as otelTraceIdForTangleTrace, h as SandboxSession, i as MAX_EGRESS_DENIALS_LIMIT, j as validateDeferredProfileFileMounts, k as splitInlineProfileFileMounts, l as gpuLeaseCommandSchema, m as SandboxTaskSession, o as GPU_LEASE_PROVIDER_NAMES, p as toOtelJson, r as WorkspaceImages, s as gpuAcceleratorSchema, t as SandboxInstance, u as buildTraceExportPayload, v as InteractiveTerminalFrameLog, w as getSandboxEventText, x as applySandboxEventText, y as createInteractiveTerminalCapture } from "./sandbox-R753-oV0.js";
|
|
5
5
|
import { C as SandboxError, D as TimeoutError, E as StreamInterruptedError, O as ValidationError, S as ResumeEnvRequiredError, T as StateError, _ as NetworkError, b as ProfileFileMountPathError, c as AuthError, d as CompliancePlacementError, f as EdgeNotReadyError, g as KeyBudgetExhaustedError, h as GpuProviderNotConfiguredError, l as BranchFanoutExceedsHostError, m as FileWriteConflictError, o as responseMetadata, p as EgressProxyRecoveryError, r as parseErrorResponse, t as TerminalStreamError, u as CapabilityError, v as NotFoundError, w as ServerError, x as QuotaError, y as PartialFailureError } from "./errors-D44qyFpy.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-
|
|
7
|
-
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-
|
|
8
|
-
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-
|
|
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-BBiGe89R.js";
|
|
7
|
+
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-jPff7Jml.js";
|
|
8
|
+
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-9BQ1--Ms.js";
|
|
9
9
|
import "./file-transfer-DOSTbUSR.js";
|
|
10
10
|
import { t as parseSSEStream } from "./sse-parser-BCG3iL9j.js";
|
|
11
11
|
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-DwJ7AKx7.js";
|
|
@@ -13,7 +13,7 @@ import { t as downloadFile } from "./file-download-BO-Hmn3x.js";
|
|
|
13
13
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
14
14
|
import { a as parseLineApplicationResult, i as parseLineApplicationRequest, n as LINE_APPLICATION_REPLY_MAX_CHARS, o as sandboxFailureKind, r as LINE_APPLICATION_REQUEST_MAX_BYTES, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-CTkHtpap.js";
|
|
15
15
|
import { a as createSelectSeat, i as SeatSelectionError, o as gatewaySeatTransport } from "./select-seat-D0YBpIJl.js";
|
|
16
|
-
import { s as BlueprintSandboxClient } from "./tangle-
|
|
16
|
+
import { s as BlueprintSandboxClient } from "./tangle-Ca4eQ4EO.js";
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
//#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
|
|
19
19
|
const MANAGED_MODEL_KEY_SENTINEL = "proxy-managed-per-request";
|
|
@@ -318,144 +318,6 @@ function startTeeAttestationHeartbeat(sandbox, options = {}) {
|
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
//#endregion
|
|
321
|
-
//#region ../../../packages/runtime-contracts/dist/gpu-lease.js
|
|
322
|
-
const GPU_LEASE_PROVIDER_NAMES = [
|
|
323
|
-
"runpod",
|
|
324
|
-
"vast-ai",
|
|
325
|
-
"lambda-labs",
|
|
326
|
-
"modal"
|
|
327
|
-
];
|
|
328
|
-
const gpuLeaseProviderSchema = z.string().trim().toLowerCase().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/);
|
|
329
|
-
const gpuAcceleratorKindSchema = z.string().trim().toLowerCase().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/);
|
|
330
|
-
const gpuAcceleratorSchema = z.object({
|
|
331
|
-
kind: gpuAcceleratorKindSchema,
|
|
332
|
-
count: z.number().int().positive().default(1),
|
|
333
|
-
vramGb: z.number().positive().optional()
|
|
334
|
-
}).strict();
|
|
335
|
-
const gpuLeaseCommandSchema = z.object({
|
|
336
|
-
command: z.string().min(1).max(8192),
|
|
337
|
-
timeoutMs: z.number().int().positive().max(2147453647).optional(),
|
|
338
|
-
env: z.record(z.string(), z.string()).optional(),
|
|
339
|
-
cwd: z.string().min(1).max(2048).optional()
|
|
340
|
-
}).strict();
|
|
341
|
-
z.object({
|
|
342
|
-
refresh: z.enum(["true", "false"]).optional(),
|
|
343
|
-
acceleratorKind: gpuAcceleratorKindSchema.optional(),
|
|
344
|
-
acceleratorCount: z.coerce.number().pipe(gpuAcceleratorSchema.shape.count.unwrap()).optional(),
|
|
345
|
-
acceleratorVramGb: z.coerce.number().positive().optional()
|
|
346
|
-
}).strict();
|
|
347
|
-
z.object({
|
|
348
|
-
maxSpendUsd: z.number().positive().max(1e4).optional(),
|
|
349
|
-
maxLifetimeSeconds: z.number().int().positive().max(1440 * 60).optional()
|
|
350
|
-
}).strict().refine((value) => value.maxSpendUsd !== void 0 || value.maxLifetimeSeconds !== void 0, "Renewal requires a lifetime or spend cap");
|
|
351
|
-
const gpuLeaseOptionsSchema = z.object({
|
|
352
|
-
provider: gpuLeaseProviderSchema.optional(),
|
|
353
|
-
image: z.string().min(1).max(512).optional(),
|
|
354
|
-
env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).optional(),
|
|
355
|
-
diskGb: z.number().int().positive().optional(),
|
|
356
|
-
volumeGb: z.number().int().nonnegative().optional(),
|
|
357
|
-
volumeMountPath: z.string().startsWith("/").max(2048).optional(),
|
|
358
|
-
region: z.string().min(1).max(128).optional(),
|
|
359
|
-
manifest: z.record(z.string(), z.unknown()).optional(),
|
|
360
|
-
command: z.array(z.string().max(8192)).min(1).max(256).optional(),
|
|
361
|
-
ports: z.array(z.number().int().min(1).max(65535)).max(32).optional(),
|
|
362
|
-
endpoint: z.object({
|
|
363
|
-
port: z.number().int().min(1).max(65535),
|
|
364
|
-
healthPath: z.string().regex(/^\/(?![/\\])/).refine((path) => ![
|
|
365
|
-
"\r",
|
|
366
|
-
"\n",
|
|
367
|
-
" "
|
|
368
|
-
].some((char) => path.includes(char))).max(2048).optional()
|
|
369
|
-
}).strict().optional(),
|
|
370
|
-
allowSpot: z.boolean().optional(),
|
|
371
|
-
maxHourlyUsd: z.number().positive().optional(),
|
|
372
|
-
weights: z.object({
|
|
373
|
-
manifestSha: z.string().regex(/^[a-f0-9]{64}$/),
|
|
374
|
-
sizeBytes: z.number().int().positive().safe()
|
|
375
|
-
}).strict().optional(),
|
|
376
|
-
arms: z.array(z.unknown()).min(1).max(256).optional(),
|
|
377
|
-
maxSpendUsd: z.number().positive().max(1e4),
|
|
378
|
-
maxLifetimeSeconds: z.number().int().positive().max(1440 * 60),
|
|
379
|
-
idleTimeoutSeconds: z.number().int().positive().optional()
|
|
380
|
-
}).strict();
|
|
381
|
-
const gpuLeaseAttachSchema = gpuLeaseOptionsSchema.extend({ accelerator: gpuAcceleratorSchema });
|
|
382
|
-
const acceleratorSchema$1 = gpuAcceleratorSchema;
|
|
383
|
-
const providerSchema = gpuLeaseProviderSchema;
|
|
384
|
-
z.object({
|
|
385
|
-
...gpuLeaseOptionsSchema.omit({ env: true }).shape,
|
|
386
|
-
id: z.string(),
|
|
387
|
-
projectRef: z.string(),
|
|
388
|
-
ownerUserId: z.string(),
|
|
389
|
-
productId: z.string().optional(),
|
|
390
|
-
provider: providerSchema,
|
|
391
|
-
providerLeaseId: z.string().optional(),
|
|
392
|
-
providerInstanceType: z.string().optional(),
|
|
393
|
-
workerUrl: z.string().optional(),
|
|
394
|
-
endpointUrl: z.string().optional(),
|
|
395
|
-
status: z.enum([
|
|
396
|
-
"provisioning",
|
|
397
|
-
"ready",
|
|
398
|
-
"detaching",
|
|
399
|
-
"destroyed",
|
|
400
|
-
"failed"
|
|
401
|
-
]),
|
|
402
|
-
accelerator: acceleratorSchema$1,
|
|
403
|
-
providerCostPerHourUsd: z.number().optional(),
|
|
404
|
-
customerPricePerHourUsd: z.number().optional(),
|
|
405
|
-
estimatedProviderCostUsd: z.number().optional(),
|
|
406
|
-
estimatedCustomerCostUsd: z.number().optional(),
|
|
407
|
-
providerSelection: z.object({
|
|
408
|
-
strategy: z.enum([
|
|
409
|
-
"explicit",
|
|
410
|
-
"cheapest",
|
|
411
|
-
"ranked"
|
|
412
|
-
]),
|
|
413
|
-
selectedProvider: providerSchema,
|
|
414
|
-
requestedProvider: providerSchema.optional(),
|
|
415
|
-
candidates: z.array(z.object({
|
|
416
|
-
provider: providerSchema,
|
|
417
|
-
accelerator: acceleratorSchema$1,
|
|
418
|
-
providerInstanceType: z.string().optional(),
|
|
419
|
-
region: z.string().optional(),
|
|
420
|
-
pricingSource: z.enum(["live", "configured"]).optional(),
|
|
421
|
-
providerCostPerHourUsd: z.number(),
|
|
422
|
-
customerPricePerHourUsd: z.number(),
|
|
423
|
-
maxLifetimeSeconds: z.number(),
|
|
424
|
-
estimatedProviderCostUsd: z.number(),
|
|
425
|
-
estimatedCustomerCostUsd: z.number()
|
|
426
|
-
})),
|
|
427
|
-
rejected: z.array(z.object({
|
|
428
|
-
provider: providerSchema,
|
|
429
|
-
error: z.string()
|
|
430
|
-
}))
|
|
431
|
-
}).optional(),
|
|
432
|
-
createdAt: z.string(),
|
|
433
|
-
updatedAt: z.string(),
|
|
434
|
-
readyAt: z.string().optional(),
|
|
435
|
-
startedAt: z.string().optional(),
|
|
436
|
-
lastUsedAt: z.string().optional(),
|
|
437
|
-
destroyedAt: z.string().optional(),
|
|
438
|
-
failure: z.string().optional(),
|
|
439
|
-
billing: z.object({
|
|
440
|
-
seconds: z.number(),
|
|
441
|
-
providerCostUsd: z.number(),
|
|
442
|
-
customerCostUsd: z.number(),
|
|
443
|
-
providerCostPerHourUsd: z.number(),
|
|
444
|
-
customerPricePerHourUsd: z.number(),
|
|
445
|
-
startedAt: z.string(),
|
|
446
|
-
stoppedAt: z.string()
|
|
447
|
-
}).optional()
|
|
448
|
-
});
|
|
449
|
-
//#endregion
|
|
450
|
-
//#region ../../../packages/runtime-contracts/dist/runtime-backend.js
|
|
451
|
-
/**
|
|
452
|
-
* The runtime a sandbox runs on, which a create names as `runtime`: a Docker
|
|
453
|
-
* container on the host kernel, or a Firecracker microVM with its own kernel.
|
|
454
|
-
* It is also what a provisioned host runs and the autoscaler buys.
|
|
455
|
-
*/
|
|
456
|
-
const SANDBOX_RUNTIMES = ["docker", "firecracker"];
|
|
457
|
-
[...SANDBOX_RUNTIMES];
|
|
458
|
-
//#endregion
|
|
459
321
|
//#region src/image.ts
|
|
460
322
|
function isFetchClient(client) {
|
|
461
323
|
return typeof client.fetch === "function";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as TimeoutError, _ as NetworkError, r as parseErrorResponse, u as CapabilityError } from "../errors-D44qyFpy.js";
|
|
2
|
-
import { i as fetchSandboxApi } from "../api-request-
|
|
2
|
+
import { i as fetchSandboxApi } from "../api-request-jPff7Jml.js";
|
|
3
3
|
import { n as verifyDownload } from "../file-download-BO-Hmn3x.js";
|
|
4
4
|
import { t as rawEvidenceArchiveAttemptSchema } from "../raw-evidence-export-Dog7W5zP.js";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-
|
|
1
|
+
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-n0QMLrI7.js";
|
|
2
2
|
export { BrowserInteractiveSessionControlController, InteractiveSessionNotRunningError, browserInteractiveControlHolderId };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { C as boundedIdentifierSchema, T as boundedJsonSchema, o as canonicalCandidateDigest } from "./harness--g8UQ5TZ.js";
|
|
2
2
|
import { r as agentProfileSchema } from "./profile-schema-B11dRfGB.js";
|
|
3
|
-
import { B as PlanContinuationSchema, D as agentInteractiveSessionControlClaimMatchesRef, P as AgentExactRunControlRefSchema, R as AgentExecutionOutcomeSchema, U as InteractionRequestSchema, c as assertInteractiveSessionRef, h as AgentInteractiveSessionAttachSchema, i as createBrowserInteractiveSessionControlTransport, o as InteractiveSessionControlController, r as browserInteractiveTerminalEndpoint, v as AgentInteractiveSessionControlClaimSchema, x as AgentInteractiveSessionRefSchema, z as DurablePlanSchema } from "./browser-interactive-control-controller-
|
|
3
|
+
import { B as PlanContinuationSchema, D as agentInteractiveSessionControlClaimMatchesRef, P as AgentExactRunControlRefSchema, R as AgentExecutionOutcomeSchema, U as InteractionRequestSchema, c as assertInteractiveSessionRef, h as AgentInteractiveSessionAttachSchema, i as createBrowserInteractiveSessionControlTransport, o as InteractiveSessionControlController, r as browserInteractiveTerminalEndpoint, v as AgentInteractiveSessionControlClaimSchema, x as AgentInteractiveSessionRefSchema, z as DurablePlanSchema } from "./browser-interactive-control-controller-n0QMLrI7.js";
|
|
4
4
|
import { O as ValidationError, _ as NetworkError, i as parseResponseError, s as retryWhen, t as TerminalStreamError, u as CapabilityError, w as ServerError } from "./errors-D44qyFpy.js";
|
|
5
5
|
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
|
|
6
|
-
import { n as SDK_TIMEOUTS } from "./api-request-
|
|
6
|
+
import { n as SDK_TIMEOUTS } from "./api-request-jPff7Jml.js";
|
|
7
7
|
import { c as awaitSdkResend, s as uploadChunked } from "./chunked-upload-ChZB-dYE.js";
|
|
8
8
|
import { t as parseSSEStream } from "./sse-parser-BCG3iL9j.js";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./api-request-
|
|
1
|
+
import "./api-request-jPff7Jml.js";
|
|
2
2
|
import { u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-DOSTbUSR.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-BTHZR1w2.js";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
@@ -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.286"
|
|
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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-
|
|
2
|
-
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-
|
|
1
|
+
import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-CNDcKO-e.js";
|
|
2
|
+
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-n0QMLrI7.js";
|
|
3
3
|
import { C as SandboxError, D as TimeoutError, O as ValidationError, T as StateError, _ as NetworkError, b as ProfileFileMountPathError, c as AuthError, m as FileWriteConflictError, u as CapabilityError, v as NotFoundError, w as ServerError, x as QuotaError, y as PartialFailureError } from "./errors-D44qyFpy.js";
|
|
4
|
-
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-
|
|
4
|
+
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-jPff7Jml.js";
|
|
5
5
|
import { s as uploadChunked } from "./chunked-upload-ChZB-dYE.js";
|
|
6
6
|
//#region src/runtime-client.ts
|
|
7
7
|
function requireToken(token) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as requestedPublicProfileDigest, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, U as normalizeEffectiveBackend, _ as mintTraceId, a as assertScopedTokenActive, b as validateAcceptedDispatchRunRef, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as encodePromptForWire, y as resolveDispatchRunIdentity } from "./interactive-controller-
|
|
1
|
+
import { A as requestedPublicProfileDigest, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, U as normalizeEffectiveBackend, _ as mintTraceId, a as assertScopedTokenActive, b as validateAcceptedDispatchRunRef, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as encodePromptForWire, y as resolveDispatchRunIdentity } from "./interactive-controller-CNDcKO-e.js";
|
|
2
2
|
import { C as boundedIdentifierSchema$1, E as boundedStringSchema$1, g as sha256DigestSchema$1, o as canonicalCandidateDigest$1, s as canonicalCandidateJson$1 } from "./harness--g8UQ5TZ.js";
|
|
3
3
|
import { a as ProxySecretReceiptSchema$1, r as agentProfileSchema$1 } from "./profile-schema-B11dRfGB.js";
|
|
4
4
|
import { t as sha256$1 } from "./sha2-BIoWepwn.js";
|
|
5
|
-
import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-
|
|
5
|
+
import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-n0QMLrI7.js";
|
|
6
6
|
import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-N1ksNIIJ.js";
|
|
7
7
|
import { C as SandboxError, D as TimeoutError, E as StreamInterruptedError, O as ValidationError, T as StateError, _ as NetworkError, a as readResponseJson, b as ProfileFileMountPathError, c as AuthError, f as EdgeNotReadyError, i as parseResponseError, n as isTransientWrite, o as responseMetadata, r as parseErrorResponse, s as retryWhen, t as TerminalStreamError, u as CapabilityError, v as NotFoundError, w as ServerError, y as PartialFailureError } from "./errors-D44qyFpy.js";
|
|
8
8
|
import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-BZbs5rig.js";
|
|
9
9
|
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
|
|
10
10
|
import { a as backoffDelayMs, o as isUndelivered, r as abortableSleep } from "./retry-policy-oW3_ljoc.js";
|
|
11
|
-
import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-
|
|
11
|
+
import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-jPff7Jml.js";
|
|
12
12
|
import { a as SANDBOX_PROXY_REQUEST_MAX_BYTES, c as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, d as isProfileFileMountOutsideRoots, f as profileFileMountOutsideRootsMessage, l as SANDBOX_AGENT_HOME, o as FILE_OPERATION_LIMITS, u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-DOSTbUSR.js";
|
|
13
13
|
import { c as awaitSdkResend, l as takeSdkTurn, s as uploadChunked } from "./chunked-upload-ChZB-dYE.js";
|
|
14
14
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-sGVP8skk.js";
|
|
@@ -13828,6 +13828,144 @@ var SandboxEgressCapabilities = class extends SandboxTraceCapabilities {
|
|
|
13828
13828
|
}
|
|
13829
13829
|
};
|
|
13830
13830
|
//#endregion
|
|
13831
|
+
//#region ../../../packages/runtime-contracts/dist/gpu-lease.js
|
|
13832
|
+
const GPU_LEASE_PROVIDER_NAMES = [
|
|
13833
|
+
"runpod",
|
|
13834
|
+
"vast-ai",
|
|
13835
|
+
"lambda-labs",
|
|
13836
|
+
"modal"
|
|
13837
|
+
];
|
|
13838
|
+
const gpuLeaseProviderSchema = z.string().trim().toLowerCase().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/);
|
|
13839
|
+
const gpuAcceleratorKindSchema = z.string().trim().toLowerCase().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/);
|
|
13840
|
+
const gpuAcceleratorSchema = z.object({
|
|
13841
|
+
kind: gpuAcceleratorKindSchema,
|
|
13842
|
+
count: z.number().int().positive().default(1),
|
|
13843
|
+
vramGb: z.number().positive().optional()
|
|
13844
|
+
}).strict();
|
|
13845
|
+
const gpuLeaseCommandSchema = z.object({
|
|
13846
|
+
command: z.string().min(1).max(8192),
|
|
13847
|
+
timeoutMs: z.number().int().positive().max(2147453647).optional(),
|
|
13848
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
13849
|
+
cwd: z.string().min(1).max(2048).optional()
|
|
13850
|
+
}).strict();
|
|
13851
|
+
z.object({
|
|
13852
|
+
refresh: z.enum(["true", "false"]).optional(),
|
|
13853
|
+
acceleratorKind: gpuAcceleratorKindSchema.optional(),
|
|
13854
|
+
acceleratorCount: z.coerce.number().pipe(gpuAcceleratorSchema.shape.count.unwrap()).optional(),
|
|
13855
|
+
acceleratorVramGb: z.coerce.number().positive().optional()
|
|
13856
|
+
}).strict();
|
|
13857
|
+
z.object({
|
|
13858
|
+
maxSpendUsd: z.number().positive().max(1e4).optional(),
|
|
13859
|
+
maxLifetimeSeconds: z.number().int().positive().max(1440 * 60).optional()
|
|
13860
|
+
}).strict().refine((value) => value.maxSpendUsd !== void 0 || value.maxLifetimeSeconds !== void 0, "Renewal requires a lifetime or spend cap");
|
|
13861
|
+
const gpuLeaseOptionsSchema = z.object({
|
|
13862
|
+
provider: gpuLeaseProviderSchema.optional(),
|
|
13863
|
+
image: z.string().min(1).max(512).optional(),
|
|
13864
|
+
env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).optional(),
|
|
13865
|
+
diskGb: z.number().int().positive().optional(),
|
|
13866
|
+
volumeGb: z.number().int().nonnegative().optional(),
|
|
13867
|
+
volumeMountPath: z.string().startsWith("/").max(2048).optional(),
|
|
13868
|
+
region: z.string().min(1).max(128).optional(),
|
|
13869
|
+
manifest: z.record(z.string(), z.unknown()).optional(),
|
|
13870
|
+
command: z.array(z.string().max(8192)).min(1).max(256).optional(),
|
|
13871
|
+
ports: z.array(z.number().int().min(1).max(65535)).max(32).optional(),
|
|
13872
|
+
endpoint: z.object({
|
|
13873
|
+
port: z.number().int().min(1).max(65535),
|
|
13874
|
+
healthPath: z.string().regex(/^\/(?![/\\])/).refine((path) => ![
|
|
13875
|
+
"\r",
|
|
13876
|
+
"\n",
|
|
13877
|
+
" "
|
|
13878
|
+
].some((char) => path.includes(char))).max(2048).optional()
|
|
13879
|
+
}).strict().optional(),
|
|
13880
|
+
allowSpot: z.boolean().optional(),
|
|
13881
|
+
maxHourlyUsd: z.number().positive().optional(),
|
|
13882
|
+
weights: z.object({
|
|
13883
|
+
manifestSha: z.string().regex(/^[a-f0-9]{64}$/),
|
|
13884
|
+
sizeBytes: z.number().int().positive().safe()
|
|
13885
|
+
}).strict().optional(),
|
|
13886
|
+
arms: z.array(z.unknown()).min(1).max(256).optional(),
|
|
13887
|
+
maxSpendUsd: z.number().positive().max(1e4),
|
|
13888
|
+
maxLifetimeSeconds: z.number().int().positive().max(1440 * 60),
|
|
13889
|
+
idleTimeoutSeconds: z.number().int().positive().optional()
|
|
13890
|
+
}).strict();
|
|
13891
|
+
const gpuLeaseAttachSchema = gpuLeaseOptionsSchema.extend({ accelerator: gpuAcceleratorSchema });
|
|
13892
|
+
const acceleratorSchema = gpuAcceleratorSchema;
|
|
13893
|
+
const providerSchema = gpuLeaseProviderSchema;
|
|
13894
|
+
z.object({
|
|
13895
|
+
...gpuLeaseOptionsSchema.omit({ env: true }).shape,
|
|
13896
|
+
id: z.string(),
|
|
13897
|
+
projectRef: z.string(),
|
|
13898
|
+
ownerUserId: z.string(),
|
|
13899
|
+
productId: z.string().optional(),
|
|
13900
|
+
provider: providerSchema,
|
|
13901
|
+
providerLeaseId: z.string().optional(),
|
|
13902
|
+
providerInstanceType: z.string().optional(),
|
|
13903
|
+
workerUrl: z.string().optional(),
|
|
13904
|
+
endpointUrl: z.string().optional(),
|
|
13905
|
+
status: z.enum([
|
|
13906
|
+
"provisioning",
|
|
13907
|
+
"ready",
|
|
13908
|
+
"detaching",
|
|
13909
|
+
"destroyed",
|
|
13910
|
+
"failed"
|
|
13911
|
+
]),
|
|
13912
|
+
accelerator: acceleratorSchema,
|
|
13913
|
+
providerCostPerHourUsd: z.number().optional(),
|
|
13914
|
+
customerPricePerHourUsd: z.number().optional(),
|
|
13915
|
+
estimatedProviderCostUsd: z.number().optional(),
|
|
13916
|
+
estimatedCustomerCostUsd: z.number().optional(),
|
|
13917
|
+
providerSelection: z.object({
|
|
13918
|
+
strategy: z.enum([
|
|
13919
|
+
"explicit",
|
|
13920
|
+
"cheapest",
|
|
13921
|
+
"ranked"
|
|
13922
|
+
]),
|
|
13923
|
+
selectedProvider: providerSchema,
|
|
13924
|
+
requestedProvider: providerSchema.optional(),
|
|
13925
|
+
candidates: z.array(z.object({
|
|
13926
|
+
provider: providerSchema,
|
|
13927
|
+
accelerator: acceleratorSchema,
|
|
13928
|
+
providerInstanceType: z.string().optional(),
|
|
13929
|
+
region: z.string().optional(),
|
|
13930
|
+
pricingSource: z.enum(["live", "configured"]).optional(),
|
|
13931
|
+
providerCostPerHourUsd: z.number(),
|
|
13932
|
+
customerPricePerHourUsd: z.number(),
|
|
13933
|
+
maxLifetimeSeconds: z.number(),
|
|
13934
|
+
estimatedProviderCostUsd: z.number(),
|
|
13935
|
+
estimatedCustomerCostUsd: z.number()
|
|
13936
|
+
})),
|
|
13937
|
+
rejected: z.array(z.object({
|
|
13938
|
+
provider: providerSchema,
|
|
13939
|
+
error: z.string()
|
|
13940
|
+
}))
|
|
13941
|
+
}).optional(),
|
|
13942
|
+
createdAt: z.string(),
|
|
13943
|
+
updatedAt: z.string(),
|
|
13944
|
+
readyAt: z.string().optional(),
|
|
13945
|
+
startedAt: z.string().optional(),
|
|
13946
|
+
lastUsedAt: z.string().optional(),
|
|
13947
|
+
destroyedAt: z.string().optional(),
|
|
13948
|
+
failure: z.string().optional(),
|
|
13949
|
+
billing: z.object({
|
|
13950
|
+
seconds: z.number(),
|
|
13951
|
+
providerCostUsd: z.number(),
|
|
13952
|
+
customerCostUsd: z.number(),
|
|
13953
|
+
providerCostPerHourUsd: z.number(),
|
|
13954
|
+
customerPricePerHourUsd: z.number(),
|
|
13955
|
+
startedAt: z.string(),
|
|
13956
|
+
stoppedAt: z.string()
|
|
13957
|
+
}).optional()
|
|
13958
|
+
});
|
|
13959
|
+
//#endregion
|
|
13960
|
+
//#region ../../../packages/runtime-contracts/dist/runtime-backend.js
|
|
13961
|
+
/**
|
|
13962
|
+
* The runtime a sandbox runs on, which a create names as `runtime`: a Docker
|
|
13963
|
+
* container on the host kernel, or a Firecracker microVM with its own kernel.
|
|
13964
|
+
* It is also what a provisioned host runs and the autoscaler buys.
|
|
13965
|
+
*/
|
|
13966
|
+
const SANDBOX_RUNTIMES = ["docker", "firecracker"];
|
|
13967
|
+
[...SANDBOX_RUNTIMES];
|
|
13968
|
+
//#endregion
|
|
13831
13969
|
//#region ../../../packages/runtime-contracts/dist/egress-activity.js
|
|
13832
13970
|
/**
|
|
13833
13971
|
* The egress activity record a sandbox's proxy log is read into, shared by the
|
|
@@ -15006,4 +15144,4 @@ var SandboxInstance = class SandboxInstance extends SandboxEgressCapabilities {
|
|
|
15006
15144
|
}
|
|
15007
15145
|
};
|
|
15008
15146
|
//#endregion
|
|
15009
|
-
export {
|
|
15147
|
+
export { createRetryDelayMs as $, splitInlineProfileSkills as A, normalizeSandboxCreateReceipt as B, collectAgentResponseText as C, ManagedProcessClient as D, deleteSandbox as E, isMaterializerHarness as F, normalizeConnection as G, readFilesystemIncarnationTuple as H, materializeProfile as I, normalizeSandboxShape as J, normalizeEgressPolicyFields as K, SandboxOperation as L, HARNESS_LAUNCH_MATERIALIZE_OPTIONS as M, ProfileUnsupportedError as N, materializeProfileFileMounts as O, enforceWorkspacePlanSupport as P, awaitCreateResend as Q, SandboxOperationFailedError as R, collectAgentFinalMessageText as S, isToolBearingEvent as T, dateOf as U, normalizeStartupDiagnostics as V, parseLifecycleTimes as W, CAPACITY_ETA_WAIT_MAX_MS as X, CAPACITY_ETA_MARGIN_MS as Y, DEPLOY_WINDOW_RETRY_MS as Z, InteractiveSessionHandle as _, SANDBOX_RUNTIMES as a, isRetryableCreateError as at, createInteractiveTerminalSession as b, gpuLeaseAttachSchema as c, exportTraceBundle as d, extendableDeadline as et, otelTraceIdForTangleTrace as f, sandboxLedgerUsd as g, SandboxSession as h, MAX_EGRESS_DENIALS_LIMIT as i, isRateLimitCreateError as it, validateDeferredProfileFileMounts as j, splitInlineProfileFileMounts as k, gpuLeaseCommandSchema as l, SandboxTaskSession as m, createSandboxInstanceFromResponse as n, isCapacityShortageCreateError as nt, GPU_LEASE_PROVIDER_NAMES as o, toOtelJson as p, normalizeProxySecretReceipt as q, WorkspaceImages as r, isDeployWindowCreateError as rt, gpuAcceleratorSchema as s, SandboxInstance as t, generateIdempotencyKey as tt, buildTraceExportPayload as u, InteractiveTerminalFrameLog as v, getSandboxEventText as w, applySandboxEventText as x, createInteractiveTerminalCapture as y, normalizeCaptureProof as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as combineAbortSignals } from "../abort-signal-BsriwJ8L.js";
|
|
2
|
-
import { i as fetchSandboxApi } from "../api-request-
|
|
2
|
+
import { i as fetchSandboxApi } from "../api-request-jPff7Jml.js";
|
|
3
3
|
import "../sidecar-proxy-error-DTdbCbUM.js";
|
|
4
4
|
import { t as parseSSEStream } from "../sse-parser-BCG3iL9j.js";
|
|
5
5
|
import { PART_TEXT, PART_TEXT_SUFFIX } from "@tangle-network/agent-core/sse";
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as SandboxCreateResponseParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as AgentSandboxBlueprintAbi, g as SandboxCreateParamTypes, h as JsonResponseParamTypes, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_DELETE, n as fetchQuote, o as validateQuote, p as JOB_SANDBOX_CREATE, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxIdParamTypes } from "../tangle-
|
|
1
|
+
import { _ as SandboxCreateResponseParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as AgentSandboxBlueprintAbi, g as SandboxCreateParamTypes, h as JsonResponseParamTypes, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_DELETE, n as fetchQuote, o as validateQuote, p as JOB_SANDBOX_CREATE, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxIdParamTypes } from "../tangle-Ca4eQ4EO.js";
|
|
2
2
|
import { t as ITangleJobsAbi } from "../abi-pcDt2Adp.js";
|
|
3
3
|
export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-R753-oV0.js";
|
|
2
2
|
import { a as readResponseJson } from "./errors-D44qyFpy.js";
|
|
3
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
3
|
+
import { i as fetchSandboxApi } from "./api-request-jPff7Jml.js";
|
|
4
4
|
import { t as ITangleJobsAbi } from "./abi-pcDt2Adp.js";
|
|
5
5
|
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-BvN0Mk3j.js";
|
|
6
6
|
//#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.286",
|
|
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/agent-profile-materialize": "0.27.1",
|
|
157
156
|
"@products/sandbox-test-utils": "0.0.0",
|
|
158
|
-
"@
|
|
157
|
+
"@tangle-network/agent-profile-materialize": "0.27.1",
|
|
159
158
|
"@tangle-network/cli-agent-registry": "0.15.0",
|
|
159
|
+
"@repo/shared": "0.0.0",
|
|
160
160
|
"@tangle-network/runtime-contracts": "0.20.0"
|
|
161
161
|
},
|
|
162
162
|
"tangleRelease": {
|
|
163
|
-
"sourceSha": "
|
|
164
|
-
"mergedAt": "2026-11-
|
|
163
|
+
"sourceSha": "88c7c6b3b66164aa9cdb054a044ea0937056e9ea",
|
|
164
|
+
"mergedAt": "2026-11-07T17:00:57-08:00"
|
|
165
165
|
},
|
|
166
166
|
"scripts": {
|
|
167
167
|
"build": "node scripts/build-dist.mjs && bash scripts/verify-dist.sh",
|