@tangle-network/sandbox 1.0.381 → 1.0.382

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.
@@ -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-BvfAgG4O.js";
2
- import { D as assertCurrentBackendType } from "../interactive-controller-FILmjc3w.js";
3
- import { t as SandboxInstance } from "../sandbox-Mk6S0e-k.js";
1
+ import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-D3r_gVH4.js";
2
+ import { D as assertCurrentBackendType } from "../interactive-controller-B6TCAhpQ.js";
3
+ import { t as SandboxInstance } from "../sandbox-DGV55h0b.js";
4
4
  import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-vuyhjefs.js";
5
- import { t as Sandbox } from "../client-ffJ-10Z2.js";
5
+ import { t as Sandbox } from "../client-PU-uFS-P.js";
6
6
  import { z } from "zod";
7
7
  //#region src/agent/instances.ts
8
8
  const managers = /* @__PURE__ */ new WeakMap();
@@ -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-BvfAgG4O.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
69
+ const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-D3r_gVH4.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.381";
33
+ const SDK_VERSION = "1.0.382";
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-Dq3XGyYd.js";
2
2
  import { t as agentExecutionPreparationReceiptSchema } from "./agent-execution-preparation-receipt-ClBOzgJ_.js";
3
3
  import { t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
4
- import { i as fetchSandboxApi } from "./api-request-BMVn-gBu.js";
4
+ import { i as fetchSandboxApi } from "./api-request-CG8O1juh.js";
5
5
  import { z } from "zod";
6
6
  //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.23/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, H as backendTypeSchema, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-FILmjc3w.js";
1
+ import { D as assertCurrentBackendType, E as applyRequestedModel, H as backendTypeSchema, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-B6TCAhpQ.js";
2
2
  import { r as agentProfileSchema } from "./profile-schema-BuXg-MCu.js";
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-Mk6S0e-k.js";
3
+ import { $ as isRateLimitCreateError, B as normalizeConnection, E as validateDeferredProfileFileMounts, F as normalizeSandboxCreateReceipt, G as CAPACITY_ETA_WAIT_MAX_MS, H as normalizeProxySecretReceipt, I as normalizeStartupDiagnostics, J as createRetryDelayMs, K as DEPLOY_WINDOW_RETRY_MS, P as normalizeCaptureProof, Q as isDeployWindowCreateError, R as dateOf, T as splitInlineProfileSkills, U as normalizeSandboxShape, V as normalizeEgressPolicyFields, W as CAPACITY_ETA_MARGIN_MS, X as generateIdempotencyKey, Y as extendableDeadline, Z as isCapacityShortageCreateError, d as sandboxLedgerUsd, et as isRetryableCreateError, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as awaitCreateResend, w as splitInlineProfileFileMounts, x as deleteSandbox, z as parseLifecycleTimes } from "./sandbox-DGV55h0b.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-vuyhjefs.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-BMVn-gBu.js";
7
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-CG8O1juh.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-DhJ7fMu4.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-CWrCjZE2.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-vuyhjefs.js";
2
- import { i as fetchSandboxApi } from "./api-request-BMVn-gBu.js";
2
+ import { i as fetchSandboxApi } from "./api-request-CG8O1juh.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 { D as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-Mk6S0e-k.js";
1
+ import { S as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-DGV55h0b.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-vuyhjefs.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-ffJ-10Z2.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-PU-uFS-P.js";
4
4
  import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-vZDk8YYb.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-CBWUEURz.js";
@@ -1,4 +1,4 @@
1
- import { i as fetchSandboxApi } from "../api-request-BMVn-gBu.js";
1
+ import { i as fetchSandboxApi } from "../api-request-CG8O1juh.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, F as createAgentRunOutcomeTracker, G as parseBackendType, H as backendTypeSchema, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-FILmjc3w.js";
1
+ import { A as requestedPublicProfileDigest, F as createAgentRunOutcomeTracker, G as parseBackendType, H as backendTypeSchema, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-B6TCAhpQ.js";
2
2
  import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-BuXg-MCu.js";
3
- 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-Mk6S0e-k.js";
4
- 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-Blff4zB-.js";
3
+ import { A as isMaterializerHarness, C as materializeProfileFileMounts, D as HARNESS_LAUNCH_MATERIALIZE_OPTIONS, E as validateDeferredProfileFileMounts, M as SandboxOperation, N as SandboxOperationFailedError, O as ProfileUnsupportedError, S as ManagedProcessClient, T as splitInlineProfileSkills, _ 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, j as materializeProfile, k as enforceWorkspacePlanSupport, 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 splitInlineProfileFileMounts, y as getSandboxEventText } from "./sandbox-DGV55h0b.js";
4
+ 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-CMgtnlQm.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-vuyhjefs.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-ffJ-10Z2.js";
7
- import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-BMVn-gBu.js";
8
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DhJ7fMu4.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-PU-uFS-P.js";
7
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-CG8O1juh.js";
8
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CWrCjZE2.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-vZDk8YYb.js";
@@ -13,7 +13,7 @@ import { t as downloadFile } from "./file-download-Di-P3rqM.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-CBWUEURz.js";
15
15
  import { a as createSelectSeat, i as SeatSelectionError, o as gatewaySeatTransport } from "./select-seat-i_qyQUEH.js";
16
- import { s as BlueprintSandboxClient } from "./tangle-DlXKftr3.js";
16
+ import { s as BlueprintSandboxClient } from "./tangle-C0eh07MP.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";
@@ -319,6 +319,146 @@ function startTeeAttestationHeartbeat(sandbox, options = {}) {
319
319
  };
320
320
  }
321
321
  //#endregion
322
+ //#region ../../../packages/runtime-contracts/dist/gpu-lease.js
323
+ const GPU_LEASE_PROVIDER_NAMES = [
324
+ "runpod",
325
+ "vast-ai",
326
+ "lambda-labs",
327
+ "aws",
328
+ "gcp",
329
+ "azure",
330
+ "modal"
331
+ ];
332
+ const gpuLeaseProviderSchema = z.string().trim().toLowerCase().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/);
333
+ const gpuAcceleratorKindSchema = z.string().trim().toLowerCase().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/);
334
+ const gpuAcceleratorSchema = z.object({
335
+ kind: gpuAcceleratorKindSchema,
336
+ count: z.number().int().positive().default(1),
337
+ vramGb: z.number().positive().optional()
338
+ }).strict();
339
+ const gpuLeaseCommandSchema = z.object({
340
+ command: z.string().min(1).max(8192),
341
+ timeoutMs: z.number().int().positive().max(2147453647).optional(),
342
+ env: z.record(z.string(), z.string()).optional(),
343
+ cwd: z.string().min(1).max(2048).optional()
344
+ }).strict();
345
+ z.object({
346
+ refresh: z.enum(["true", "false"]).optional(),
347
+ acceleratorKind: gpuAcceleratorKindSchema.optional(),
348
+ acceleratorCount: z.coerce.number().pipe(gpuAcceleratorSchema.shape.count.unwrap()).optional(),
349
+ acceleratorVramGb: z.coerce.number().positive().optional()
350
+ }).strict();
351
+ z.object({
352
+ maxSpendUsd: z.number().positive().max(1e4).optional(),
353
+ maxLifetimeSeconds: z.number().int().positive().max(1440 * 60).optional()
354
+ }).strict().refine((value) => value.maxSpendUsd !== void 0 || value.maxLifetimeSeconds !== void 0, "Renewal requires a lifetime or spend cap");
355
+ const gpuLeaseOptionsSchema = z.object({
356
+ provider: gpuLeaseProviderSchema.optional(),
357
+ image: z.string().min(1).max(512).optional(),
358
+ env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).optional(),
359
+ diskGb: z.number().int().positive().optional(),
360
+ volumeGb: z.number().int().nonnegative().optional(),
361
+ volumeMountPath: z.string().startsWith("/").max(2048).optional(),
362
+ region: z.string().min(1).max(128).optional(),
363
+ manifest: z.record(z.string(), z.unknown()).optional(),
364
+ command: z.array(z.string().max(8192)).min(1).max(256).optional(),
365
+ ports: z.array(z.number().int().min(1).max(65535)).max(32).optional(),
366
+ endpoint: z.object({
367
+ port: z.number().int().min(1).max(65535),
368
+ healthPath: z.string().regex(/^\/(?![/\\])/).refine((path) => ![
369
+ "\r",
370
+ "\n",
371
+ " "
372
+ ].some((char) => path.includes(char))).max(2048).optional()
373
+ }).strict().optional(),
374
+ allowSpot: z.boolean().optional(),
375
+ maxHourlyUsd: z.number().positive().optional(),
376
+ weights: z.object({
377
+ manifestSha: z.string().regex(/^[a-f0-9]{64}$/),
378
+ sizeBytes: z.number().int().positive().safe()
379
+ }).strict().optional(),
380
+ arms: z.array(z.unknown()).min(1).max(256).optional(),
381
+ maxSpendUsd: z.number().positive().max(1e4),
382
+ maxLifetimeSeconds: z.number().int().positive().max(1440 * 60),
383
+ idleTimeoutSeconds: z.number().int().positive().optional()
384
+ }).strict();
385
+ const gpuLeaseAttachSchema = gpuLeaseOptionsSchema.extend({ accelerator: gpuAcceleratorSchema });
386
+ const acceleratorSchema$1 = gpuAcceleratorSchema;
387
+ const providerSchema = gpuLeaseProviderSchema;
388
+ z.object({
389
+ ...gpuLeaseOptionsSchema.omit({ env: true }).shape,
390
+ id: z.string(),
391
+ projectRef: z.string(),
392
+ ownerUserId: z.string(),
393
+ productId: z.string().optional(),
394
+ provider: providerSchema,
395
+ providerLeaseId: z.string().optional(),
396
+ providerInstanceType: z.string().optional(),
397
+ endpointUrl: z.string().optional(),
398
+ status: z.enum([
399
+ "provisioning",
400
+ "ready",
401
+ "detaching",
402
+ "destroyed",
403
+ "failed"
404
+ ]),
405
+ accelerator: acceleratorSchema$1,
406
+ providerCostPerHourUsd: z.number().optional(),
407
+ customerPricePerHourUsd: z.number().optional(),
408
+ estimatedProviderCostUsd: z.number().optional(),
409
+ estimatedCustomerCostUsd: z.number().optional(),
410
+ providerSelection: z.object({
411
+ strategy: z.enum([
412
+ "explicit",
413
+ "cheapest",
414
+ "ranked"
415
+ ]),
416
+ selectedProvider: providerSchema,
417
+ requestedProvider: providerSchema.optional(),
418
+ candidates: z.array(z.object({
419
+ provider: providerSchema,
420
+ accelerator: acceleratorSchema$1,
421
+ providerInstanceType: z.string().optional(),
422
+ region: z.string().optional(),
423
+ pricingSource: z.enum(["live", "configured"]).optional(),
424
+ providerCostPerHourUsd: z.number(),
425
+ customerPricePerHourUsd: z.number(),
426
+ maxLifetimeSeconds: z.number(),
427
+ estimatedProviderCostUsd: z.number(),
428
+ estimatedCustomerCostUsd: z.number()
429
+ })),
430
+ rejected: z.array(z.object({
431
+ provider: providerSchema,
432
+ error: z.string()
433
+ }))
434
+ }).optional(),
435
+ createdAt: z.string(),
436
+ updatedAt: z.string(),
437
+ readyAt: z.string().optional(),
438
+ startedAt: z.string().optional(),
439
+ lastUsedAt: z.string().optional(),
440
+ destroyedAt: z.string().optional(),
441
+ failure: z.string().optional(),
442
+ billing: z.object({
443
+ seconds: z.number(),
444
+ providerCostUsd: z.number(),
445
+ customerCostUsd: z.number(),
446
+ providerCostPerHourUsd: z.number(),
447
+ customerPricePerHourUsd: z.number(),
448
+ startedAt: z.string(),
449
+ stoppedAt: z.string()
450
+ }).optional()
451
+ });
452
+ //#endregion
453
+ //#region ../../../packages/runtime-contracts/dist/runtime-backend.js
454
+ /**
455
+ * The runtime a sandbox runs on, which a create names as `runtime`: a Docker
456
+ * container on the host kernel, or a Firecracker microVM with its own kernel.
457
+ * It is also what a provisioned host runs and the autoscaler buys.
458
+ */
459
+ const SANDBOX_RUNTIMES = ["docker", "firecracker"];
460
+ [...SANDBOX_RUNTIMES];
461
+ //#endregion
322
462
  //#region src/image.ts
323
463
  function isFetchClient(client) {
324
464
  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-vuyhjefs.js";
2
- import { i as fetchSandboxApi } from "../api-request-BMVn-gBu.js";
2
+ import { i as fetchSandboxApi } from "../api-request-CG8O1juh.js";
3
3
  import { n as verifyDownload } from "../file-download-Di-P3rqM.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-Blff4zB-.js";
1
+ import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-CMgtnlQm.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-Dq3XGyYd.js";
2
2
  import { r as agentProfileSchema } from "./profile-schema-BuXg-MCu.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-Blff4zB-.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-CMgtnlQm.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-vuyhjefs.js";
5
5
  import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
6
- import { n as SDK_TIMEOUTS } from "./api-request-BMVn-gBu.js";
6
+ import { n as SDK_TIMEOUTS } from "./api-request-CG8O1juh.js";
7
7
  import { c as awaitSdkResend, s as uploadChunked } from "./chunked-upload-wSXiVX7I.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-BMVn-gBu.js";
1
+ import "./api-request-CG8O1juh.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.381"
399
+ version: options.version ?? "1.0.382"
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-FILmjc3w.js";
2
- import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-Blff4zB-.js";
1
+ import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-B6TCAhpQ.js";
2
+ import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-CMgtnlQm.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-vuyhjefs.js";
4
- import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-BMVn-gBu.js";
4
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-CG8O1juh.js";
5
5
  import { s as uploadChunked } from "./chunked-upload-wSXiVX7I.js";
6
6
  //#region src/runtime-client.ts
7
7
  function requireToken(token) {
@@ -1,13 +1,13 @@
1
- import { A as requestedPublicProfileDigest, B as AgentRuntimeAttachmentsSchema, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, W 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-FILmjc3w.js";
1
+ import { A as requestedPublicProfileDigest, B as AgentRuntimeAttachmentsSchema, C as runtimeFilesystemPath, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodeTextForWire, W 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-B6TCAhpQ.js";
2
2
  import { C as boundedIdentifierSchema, E as boundedStringSchema, g as sha256DigestSchema, o as canonicalCandidateDigest, s as canonicalCandidateJson } from "./harness-Dq3XGyYd.js";
3
3
  import { a as ProxySecretReceiptSchema, r as agentProfileSchema } from "./profile-schema-BuXg-MCu.js";
4
- 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-Blff4zB-.js";
4
+ 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-CMgtnlQm.js";
5
5
  import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-CemN5Bl6.js";
6
6
  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-vuyhjefs.js";
7
7
  import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-BZbs5rig.js";
8
8
  import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
9
9
  import { a as backoffDelayMs, o as isUndelivered, r as abortableSleep } from "./retry-policy-oW3_ljoc.js";
10
- import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-BMVn-gBu.js";
10
+ import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-CG8O1juh.js";
11
11
  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";
12
12
  import { c as awaitSdkResend, l as takeSdkTurn, s as uploadChunked } from "./chunked-upload-wSXiVX7I.js";
13
13
  import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-sGVP8skk.js";
@@ -12182,146 +12182,6 @@ var SandboxEgressCapabilities = class extends SandboxTraceCapabilities {
12182
12182
  }
12183
12183
  };
12184
12184
  //#endregion
12185
- //#region ../../../packages/runtime-contracts/dist/gpu-lease.js
12186
- const GPU_LEASE_PROVIDER_NAMES = [
12187
- "runpod",
12188
- "vast-ai",
12189
- "lambda-labs",
12190
- "aws",
12191
- "gcp",
12192
- "azure",
12193
- "modal"
12194
- ];
12195
- const gpuLeaseProviderSchema = z.string().trim().toLowerCase().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/);
12196
- const gpuAcceleratorKindSchema = z.string().trim().toLowerCase().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/);
12197
- const gpuAcceleratorSchema = z.object({
12198
- kind: gpuAcceleratorKindSchema,
12199
- count: z.number().int().positive().default(1),
12200
- vramGb: z.number().positive().optional()
12201
- }).strict();
12202
- const gpuLeaseCommandSchema = z.object({
12203
- command: z.string().min(1).max(8192),
12204
- timeoutMs: z.number().int().positive().max(2147453647).optional(),
12205
- env: z.record(z.string(), z.string()).optional(),
12206
- cwd: z.string().min(1).max(2048).optional()
12207
- }).strict();
12208
- z.object({
12209
- refresh: z.enum(["true", "false"]).optional(),
12210
- acceleratorKind: gpuAcceleratorKindSchema.optional(),
12211
- acceleratorCount: z.coerce.number().pipe(gpuAcceleratorSchema.shape.count.unwrap()).optional(),
12212
- acceleratorVramGb: z.coerce.number().positive().optional()
12213
- }).strict();
12214
- z.object({
12215
- maxSpendUsd: z.number().positive().max(1e4).optional(),
12216
- maxLifetimeSeconds: z.number().int().positive().max(1440 * 60).optional()
12217
- }).strict().refine((value) => value.maxSpendUsd !== void 0 || value.maxLifetimeSeconds !== void 0, "Renewal requires a lifetime or spend cap");
12218
- const gpuLeaseOptionsSchema = z.object({
12219
- provider: gpuLeaseProviderSchema.optional(),
12220
- image: z.string().min(1).max(512).optional(),
12221
- env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).optional(),
12222
- diskGb: z.number().int().positive().optional(),
12223
- volumeGb: z.number().int().nonnegative().optional(),
12224
- volumeMountPath: z.string().startsWith("/").max(2048).optional(),
12225
- region: z.string().min(1).max(128).optional(),
12226
- manifest: z.record(z.string(), z.unknown()).optional(),
12227
- command: z.array(z.string().max(8192)).min(1).max(256).optional(),
12228
- ports: z.array(z.number().int().min(1).max(65535)).max(32).optional(),
12229
- endpoint: z.object({
12230
- port: z.number().int().min(1).max(65535),
12231
- healthPath: z.string().regex(/^\/(?![/\\])/).refine((path) => ![
12232
- "\r",
12233
- "\n",
12234
- " "
12235
- ].some((char) => path.includes(char))).max(2048).optional()
12236
- }).strict().optional(),
12237
- allowSpot: z.boolean().optional(),
12238
- maxHourlyUsd: z.number().positive().optional(),
12239
- weights: z.object({
12240
- manifestSha: z.string().regex(/^[a-f0-9]{64}$/),
12241
- sizeBytes: z.number().int().positive().safe()
12242
- }).strict().optional(),
12243
- arms: z.array(z.unknown()).min(1).max(256).optional(),
12244
- maxSpendUsd: z.number().positive().max(1e4),
12245
- maxLifetimeSeconds: z.number().int().positive().max(1440 * 60),
12246
- idleTimeoutSeconds: z.number().int().positive().optional()
12247
- }).strict();
12248
- const gpuLeaseAttachSchema = gpuLeaseOptionsSchema.extend({ accelerator: gpuAcceleratorSchema });
12249
- const acceleratorSchema = gpuAcceleratorSchema;
12250
- const providerSchema = gpuLeaseProviderSchema;
12251
- z.object({
12252
- ...gpuLeaseOptionsSchema.omit({ env: true }).shape,
12253
- id: z.string(),
12254
- projectRef: z.string(),
12255
- ownerUserId: z.string(),
12256
- productId: z.string().optional(),
12257
- provider: providerSchema,
12258
- providerLeaseId: z.string().optional(),
12259
- providerInstanceType: z.string().optional(),
12260
- endpointUrl: z.string().optional(),
12261
- status: z.enum([
12262
- "provisioning",
12263
- "ready",
12264
- "detaching",
12265
- "destroyed",
12266
- "failed"
12267
- ]),
12268
- accelerator: acceleratorSchema,
12269
- providerCostPerHourUsd: z.number().optional(),
12270
- customerPricePerHourUsd: z.number().optional(),
12271
- estimatedProviderCostUsd: z.number().optional(),
12272
- estimatedCustomerCostUsd: z.number().optional(),
12273
- providerSelection: z.object({
12274
- strategy: z.enum([
12275
- "explicit",
12276
- "cheapest",
12277
- "ranked"
12278
- ]),
12279
- selectedProvider: providerSchema,
12280
- requestedProvider: providerSchema.optional(),
12281
- candidates: z.array(z.object({
12282
- provider: providerSchema,
12283
- accelerator: acceleratorSchema,
12284
- providerInstanceType: z.string().optional(),
12285
- region: z.string().optional(),
12286
- pricingSource: z.enum(["live", "configured"]).optional(),
12287
- providerCostPerHourUsd: z.number(),
12288
- customerPricePerHourUsd: z.number(),
12289
- maxLifetimeSeconds: z.number(),
12290
- estimatedProviderCostUsd: z.number(),
12291
- estimatedCustomerCostUsd: z.number()
12292
- })),
12293
- rejected: z.array(z.object({
12294
- provider: providerSchema,
12295
- error: z.string()
12296
- }))
12297
- }).optional(),
12298
- createdAt: z.string(),
12299
- updatedAt: z.string(),
12300
- readyAt: z.string().optional(),
12301
- startedAt: z.string().optional(),
12302
- lastUsedAt: z.string().optional(),
12303
- destroyedAt: z.string().optional(),
12304
- failure: z.string().optional(),
12305
- billing: z.object({
12306
- seconds: z.number(),
12307
- providerCostUsd: z.number(),
12308
- customerCostUsd: z.number(),
12309
- providerCostPerHourUsd: z.number(),
12310
- customerPricePerHourUsd: z.number(),
12311
- startedAt: z.string(),
12312
- stoppedAt: z.string()
12313
- }).optional()
12314
- });
12315
- //#endregion
12316
- //#region ../../../packages/runtime-contracts/dist/runtime-backend.js
12317
- /**
12318
- * The runtime a sandbox runs on, which a create names as `runtime`: a Docker
12319
- * container on the host kernel, or a Firecracker microVM with its own kernel.
12320
- * It is also what a provisioned host runs and the autoscaler buys.
12321
- */
12322
- const SANDBOX_RUNTIMES = ["docker", "firecracker"];
12323
- [...SANDBOX_RUNTIMES];
12324
- //#endregion
12325
12185
  //#region ../../../packages/runtime-contracts/dist/egress-activity.js
12326
12186
  /**
12327
12187
  * The egress activity record a sandbox's proxy log is read into, shared by the
@@ -13500,4 +13360,4 @@ var SandboxInstance = class SandboxInstance extends SandboxEgressCapabilities {
13500
13360
  }
13501
13361
  };
13502
13362
  //#endregion
13503
- 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 };
13363
+ export { isRateLimitCreateError as $, isMaterializerHarness as A, normalizeConnection as B, materializeProfileFileMounts as C, HARNESS_LAUNCH_MATERIALIZE_OPTIONS as D, validateDeferredProfileFileMounts as E, normalizeSandboxCreateReceipt as F, CAPACITY_ETA_WAIT_MAX_MS as G, normalizeProxySecretReceipt as H, normalizeStartupDiagnostics as I, createRetryDelayMs as J, DEPLOY_WINDOW_RETRY_MS as K, readFilesystemIncarnationTuple as L, SandboxOperation as M, SandboxOperationFailedError as N, ProfileUnsupportedError as O, normalizeCaptureProof as P, isDeployWindowCreateError as Q, dateOf as R, ManagedProcessClient as S, splitInlineProfileSkills as T, normalizeSandboxShape as U, normalizeEgressPolicyFields as V, CAPACITY_ETA_MARGIN_MS as W, generateIdempotencyKey as X, extendableDeadline as Y, isCapacityShortageCreateError as Z, collectAgentFinalMessageText as _, buildTraceExportPayload as a, isToolBearingEvent as b, toOtelJson as c, sandboxLedgerUsd as d, isRetryableCreateError as et, InteractiveSessionHandle as f, applySandboxEventText as g, createInteractiveTerminalSession as h, MAX_EGRESS_DENIALS_LIMIT as i, materializeProfile as j, enforceWorkspacePlanSupport as k, SandboxTaskSession as l, createInteractiveTerminalCapture as m, createSandboxInstanceFromResponse as n, exportTraceBundle as o, InteractiveTerminalFrameLog as p, awaitCreateResend as q, WorkspaceImages as r, otelTraceIdForTangleTrace as s, SandboxInstance as t, SandboxSession as u, collectAgentResponseText as v, splitInlineProfileFileMounts as w, deleteSandbox as x, getSandboxEventText as y, parseLifecycleTimes 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-BMVn-gBu.js";
2
+ import { i as fetchSandboxApi } from "../api-request-CG8O1juh.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";
@@ -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-DlXKftr3.js";
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-C0eh07MP.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 { H as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-Mk6S0e-k.js";
1
+ import { L as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-DGV55h0b.js";
2
2
  import { a as readResponseJson } from "./errors-vuyhjefs.js";
3
- import { i as fetchSandboxApi } from "./api-request-BMVn-gBu.js";
3
+ import { i as fetchSandboxApi } from "./api-request-CG8O1juh.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.381",
3
+ "version": "1.0.382",
4
4
  "description": "TypeScript SDK for Tangle Sandbox: create cloud sandboxes and run commands and coding agents in them",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -155,13 +155,13 @@
155
155
  "yjs": "13.6.33",
156
156
  "@products/sandbox-test-utils": "0.0.0",
157
157
  "@repo/shared": "0.0.0",
158
- "@tangle-network/cli-agent-registry": "0.15.0",
159
158
  "@tangle-network/agent-profile-materialize": "0.27.1",
160
- "@tangle-network/runtime-contracts": "0.20.0"
159
+ "@tangle-network/runtime-contracts": "0.20.0",
160
+ "@tangle-network/cli-agent-registry": "0.15.0"
161
161
  },
162
162
  "tangleRelease": {
163
- "sourceSha": "58e16d5670df46d2864fbd49cef8515047fb0e3c",
164
- "mergedAt": "2026-11-10T23:03:15-08:00"
163
+ "sourceSha": "e1d25c36555a5852acbf1048f9a1fb32dbce2300",
164
+ "mergedAt": "2026-11-10T23:13:15-08:00"
165
165
  },
166
166
  "scripts": {
167
167
  "build": "node scripts/build-dist.mjs && bash scripts/verify-dist.sh",