@tangle-network/sandbox 1.0.312 → 1.0.314

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-io-gmHrl.js";
2
- import { D as assertCurrentBackendType } from "../interactive-controller-Bw7H9yDw.js";
3
- import { t as SandboxInstance } from "../sandbox-CQQNiQft.js";
1
+ import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-B-V9cbjT.js";
2
+ import { D as assertCurrentBackendType } from "../interactive-controller-tic5yZVM.js";
3
+ import { t as SandboxInstance } from "../sandbox-BPv4y_S8.js";
4
4
  import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-D44qyFpy.js";
5
- import { t as Sandbox } from "../client-CrArChIt.js";
5
+ import { t as Sandbox } from "../client-BkYkohK6.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-io-gmHrl.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
69
+ const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-B-V9cbjT.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.312";
33
+ const SDK_VERSION = "1.0.314";
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-DW2I_kp7.js";
2
2
  import { t as agentExecutionPreparationReceiptSchema } from "./agent-execution-preparation-receipt-BFGr2nAM.js";
3
3
  import { t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
4
- import { i as fetchSandboxApi } from "./api-request-d_c1h__g.js";
4
+ import { i as fetchSandboxApi } from "./api-request-BlTCqcmt.js";
5
5
  import { z } from "zod";
6
6
  //#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.21/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-Bw7H9yDw.js";
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-tic5yZVM.js";
2
2
  import { r as agentProfileSchema } from "./profile-schema-C_MbI9mE.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-CQQNiQft.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-BPv4y_S8.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-d_c1h__g.js";
7
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-BlTCqcmt.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-BXqy0Vqg.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-CVuC0Pei.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-d_c1h__g.js";
2
+ import { i as fetchSandboxApi } from "./api-request-BlTCqcmt.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-CQQNiQft.js";
1
+ import { S as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-BPv4y_S8.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-CrArChIt.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-BkYkohK6.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-CBWUEURz.js";
@@ -1,4 +1,4 @@
1
- import { i as fetchSandboxApi } from "../api-request-d_c1h__g.js";
1
+ import { i as fetchSandboxApi } from "../api-request-BlTCqcmt.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-Bw7H9yDw.js";
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-tic5yZVM.js";
2
2
  import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-C_MbI9mE.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-CqrpUND_.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-CQQNiQft.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-DRzsOTdJ.js";
4
+ 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-BPv4y_S8.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-CrArChIt.js";
7
- import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-d_c1h__g.js";
8
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-BXqy0Vqg.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-BkYkohK6.js";
7
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-BlTCqcmt.js";
8
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CVuC0Pei.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-CBWUEURz.js";
15
15
  import { a as createSelectSeat, i as SeatSelectionError, o as gatewaySeatTransport } from "./select-seat-V4GysL74.js";
16
- import { s as BlueprintSandboxClient } from "./tangle-Ccirv2nB.js";
16
+ import { s as BlueprintSandboxClient } from "./tangle-BPj50tJh.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,6 +318,144 @@ 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
321
459
  //#region src/image.ts
322
460
  function isFetchClient(client) {
323
461
  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-d_c1h__g.js";
2
+ import { i as fetchSandboxApi } from "../api-request-BlTCqcmt.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-CqrpUND_.js";
1
+ import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-DRzsOTdJ.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-DW2I_kp7.js";
2
2
  import { r as agentProfileSchema } from "./profile-schema-C_MbI9mE.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-CqrpUND_.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-DRzsOTdJ.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-d_c1h__g.js";
6
+ import { n as SDK_TIMEOUTS } from "./api-request-BlTCqcmt.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-d_c1h__g.js";
1
+ import "./api-request-BlTCqcmt.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.312"
399
+ version: options.version ?? "1.0.314"
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-Bw7H9yDw.js";
2
- import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-CqrpUND_.js";
1
+ import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-tic5yZVM.js";
2
+ import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-DRzsOTdJ.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-d_c1h__g.js";
4
+ import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-BlTCqcmt.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-Bw7H9yDw.js";
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-tic5yZVM.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-DW2I_kp7.js";
3
3
  import { a as ProxySecretReceiptSchema$1, r as agentProfileSchema$1 } from "./profile-schema-C_MbI9mE.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-CqrpUND_.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-DRzsOTdJ.js";
6
6
  import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-CatenlMs.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-d_c1h__g.js";
11
+ import { a as isReplayableBody, i as fetchSandboxApi, n as SDK_TIMEOUTS, o as rewrapResponse, t as IDEMPOTENT_METHODS } from "./api-request-BlTCqcmt.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";
@@ -4903,13 +4903,7 @@ function harnessAutoLoadsAgentContextFile(harness) {
4903
4903
  assertMaterializerHarness(harness);
4904
4904
  return harness === "pi";
4905
4905
  }
4906
- /**
4907
- * Why a harness refuses a system-prompt REPLACEMENT.
4908
- *
4909
- * The reason names the control that does exist, so the refusal is actionable
4910
- * without a capability-matrix lookup — a bare "unsupported" sends the caller
4911
- * looking for a flag that was never there.
4912
- */
4906
+ /** Why a harness refuses a system-prompt REPLACEMENT, naming any control that does exist. */
4913
4907
  function systemPromptRefusal(harness) {
4914
4908
  switch (harness) {
4915
4909
  case "opencode": return "opencode: the only system-prompt replacement is per-agent (`agent.<name>.prompt`), which binds to the agent selected at launch and a workspace plan cannot guarantee; an executor that applies the plan's \"--agent\" flag to its own spawn declares binds: [\"systemPrompt\"], and one that composes opencode's config itself declares binds: [\"opencode.agent-prompt\"]";
@@ -4917,15 +4911,9 @@ function systemPromptRefusal(harness) {
4917
4911
  }
4918
4912
  }
4919
4913
  /**
4920
- * Why a harness refuses an ADDITION to the system prompt.
4921
- *
4922
- * gemini puts its context file in the system-prompt position, so the temptation
4923
- * is to lower an addition there. That is refused because GEMINI.md is the ONE
4924
- * file it auto-loads: an addition written there is byte-identical to the same
4925
- * text under `prompt.instructions`, and no consumer could tell which intent the
4926
- * caller expressed. opencode is not refused for the same situation, because it
4927
- * loads exactly the files its config names and can therefore carry the two
4928
- * intents in separate, separately-ordered files.
4914
+ * Why a harness refuses an ADDITION to the system prompt. gemini's one
4915
+ * auto-loaded GEMINI.md would make an addition indistinguishable from
4916
+ * `prompt.instructions`; opencode can keep the two in separate files.
4929
4917
  */
4930
4918
  function appendSystemPromptRefusal(harness) {
4931
4919
  switch (harness) {
@@ -4948,20 +4936,9 @@ const CONTEXT_FILE = {
4948
4936
  openclaw: "AGENTS.md"
4949
4937
  };
4950
4938
  /**
4951
- * The paths a profile resource may never mount.
4952
- *
4953
- * Codex names no system-prompt file of its own — `model_instructions_file`
4954
- * takes whatever path it is given — and opencode names none either, since it
4955
- * reads exactly the files its config lists. All three names below were chosen
4956
- * here, so a file already at one of them is this materializer's own output from
4957
- * an earlier application into the same workspace, and a mount there could not
4958
- * survive the next application.
4959
- *
4960
- * That is an inference from the path name, not verified provenance: nothing
4961
- * checks the existing bytes are prior materializer output, so a workspace that
4962
- * carried a foreign file at one of these invented names is overwritten on the
4963
- * first application. Accepted cost of stateless multi-turn re-application,
4964
- * bounded by the names being ones no harness or user convention uses.
4939
+ * The paths a profile resource may never mount: names this package invented,
4940
+ * which no harness or user convention uses, so a file at one counts as earlier
4941
+ * output by name alone and is overwritten without checking its bytes.
4965
4942
  */
4966
4943
  const MATERIALIZER_RESERVED_PATHS = new Set([
4967
4944
  CODEX_SYSTEM_PROMPT_FILE,
@@ -4971,40 +4948,18 @@ const MATERIALIZER_RESERVED_PATHS = new Set([
4971
4948
  /** Every path any harness reads as its project context file. */
4972
4949
  const CONTEXT_FILE_PATHS = new Set(Object.values(CONTEXT_FILE));
4973
4950
  /**
4974
- * The context files this package owns by MARKER rather than by name:
4975
- * `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `HERMES.md`.
4976
- *
4977
- * Each is a documented name a repository can already carry, so the name proves
4978
- * nothing. A generated one carries the line {@link markMaterializerContextFile}
4979
- * writes, and only that line lets the next materialization replace it.
4980
- *
4981
- * opencode's context file is absent because it is a RESERVED name this package
4982
- * invented, already owned by the name alone.
4951
+ * The context files owned by MARKER, not name (`AGENTS.md`, `CLAUDE.md`,
4952
+ * `GEMINI.md`, `HERMES.md`): a repository can carry these names, so only the
4953
+ * {@link markMaterializerContextFile} line lets a materialization replace one.
4983
4954
  */
4984
4955
  const MATERIALIZER_CONTEXT_PATHS = new Set([...CONTEXT_FILE_PATHS].filter((path) => !MATERIALIZER_RESERVED_PATHS.has(path)));
4985
4956
  /**
4986
4957
  * The paths whose generated content is wholly this package's output, per
4987
- * {@link PlanFile.ownership}: the reserved names, the context files, and
4988
- * `opencode.json`, which carries only the registrations this package generates
4989
- * from the profile.
4990
- *
4991
- * `opencode.json` and every context file is a documented name a user repository
4992
- * can carry, so the name alone proves nothing and a profile resource may still
4993
- * mount one. An existing file there is replaced only when
4994
- * {@link materializerReplacement} recognizes its bytes as this package's own
4995
- * earlier output.
4996
- *
4997
- * Deliberately absent: `.gemini/system.md`, the file `prompt.systemPrompt`
4998
- * lowers to. The line a marker would have to add is the reason. A REPLACEMENT
4999
- * is the caller's exact bytes and this package may add none of its own, so that
5000
- * path keeps refusing. A context file carries `prompt.instructions`, which this
5001
- * package already composes — it joins the blocks and appends the final newline
5002
- * — so one more composed line is inside the same authority.
5003
- *
5004
- * That line, not "which channel the harness reads it on", is what separates the
5005
- * two. `GEMINI.md` is owned even though gemini lowers its context file into the
5006
- * system-prompt position as an ADDITION ({@link appendSystemPromptRefusal}),
5007
- * because the intent it carries is still instructions this package composed.
4958
+ * {@link PlanFile.ownership}: the reserved names, the context files and
4959
+ * `opencode.json`. A user repository can carry the last two, so an existing file
4960
+ * there is replaced only when {@link materializerReplacement} recognizes its
4961
+ * bytes. `.gemini/system.md` is absent: a system-prompt REPLACEMENT is the
4962
+ * caller's exact bytes, so it can carry no marker and keeps refusing.
5008
4963
  */
5009
4964
  const MATERIALIZER_OWNED_PATHS = new Set([
5010
4965
  ...MATERIALIZER_RESERVED_PATHS,
@@ -5032,29 +4987,12 @@ function materializerContextMarker(body) {
5032
4987
  }
5033
4988
  /**
5034
4989
  * Mark one generated context file so the NEXT materialization can prove this
5035
- * package wrote the bytes it is about to replace.
5036
- *
5037
- * The marker is an HTML comment on line 1. CommonMark closes an HTML block at
5038
- * the line holding `-->`, so every instruction below it parses exactly as it
5039
- * did without the line, and the line itself states no instruction. It is one
5040
- * more line this package composes into a file it already composes: it goes on
5041
- * a context file, which carries `prompt.instructions`, and NEVER on a
5042
- * system-prompt REPLACEMENT, whose bytes are the caller's exact text
5043
- * (`.gemini/system.md`; `.codex/system-prompt.md` is a reserved name this
5044
- * package invented and needs no marker to be owned).
5045
- *
5046
- * It carries the digest of the generated body below it, which the subagent
5047
- * marker does not need. `CLAUDE.md` is claude-code's own memory file and the
5048
- * agent appends to it mid-session, so a bare marker would still sit on line 1
5049
- * of a file the agent has since rewritten. The digest tells which leading bytes
5050
- * are still this package's own: the next materialization replaces exactly
5051
- * those and keeps what the agent appended below them
5052
- * ({@link generatedContextAppendix}). The marker's wording is part of every
5053
- * marker already written into live workspaces, so it stays as it is.
5054
- *
5055
- * A reserved context path — opencode's invented instruction file — is returned
5056
- * unchanged: its NAME already proves the provenance, and nothing else may mount
5057
- * there.
4990
+ * package wrote the bytes it replaces. The line-1 HTML comment leaves every
4991
+ * instruction below it parsing unchanged. It carries the generated body's
4992
+ * digest because claude-code appends memory to `CLAUDE.md`: the next
4993
+ * materialization replaces exactly the digested bytes and keeps the appendix
4994
+ * ({@link generatedContextAppendix}). Live workspaces hold this wording, so it
4995
+ * stays. opencode's reserved context file is returned unchanged.
5058
4996
  */
5059
4997
  function markMaterializerContextFile(relPath, content) {
5060
4998
  if (!CONTEXT_FILE_PATHS.has(relPath)) throw new Error(`Not a harness context file: ${relPath}`);
@@ -5078,12 +5016,9 @@ function isMaterializerOwnedPath(relPath) {
5078
5016
  return MATERIALIZER_OWNED_PATHS.has(relPath) || MATERIALIZER_SUBAGENT_PATH.test(relPath);
5079
5017
  }
5080
5018
  /**
5081
- * cwd-relative native skill dir per harness, or null if the harness has no
5082
- * cwd skill primitive (skills live in a user/global dir the workspace plan
5083
- * cannot reach). Public so consumers composing a profile can (a) render the
5084
- * exact path the platform will mount a skill at into their prompts instead
5085
- * of hardcoding `~/.claude/skills/...`, and (b) branch on skill support
5086
- * ahead of materialization instead of catching the materialize-time throw.
5019
+ * cwd-relative native skill dir per harness, or null when skills live only in a
5020
+ * user/global dir the workspace plan cannot reach. Public so a profile can name
5021
+ * the mount path in its prompt and branch on skill support before materializing.
5087
5022
  */
5088
5023
  const HARNESS_SKILL_DIRS = {
5089
5024
  "claude-code": ".claude/skills",
@@ -13840,144 +13775,6 @@ var SandboxEgressCapabilities = class extends SandboxTraceCapabilities {
13840
13775
  }
13841
13776
  };
13842
13777
  //#endregion
13843
- //#region ../../../packages/runtime-contracts/dist/gpu-lease.js
13844
- const GPU_LEASE_PROVIDER_NAMES = [
13845
- "runpod",
13846
- "vast-ai",
13847
- "lambda-labs",
13848
- "modal"
13849
- ];
13850
- const gpuLeaseProviderSchema = z.string().trim().toLowerCase().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/);
13851
- const gpuAcceleratorKindSchema = z.string().trim().toLowerCase().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*$/);
13852
- const gpuAcceleratorSchema = z.object({
13853
- kind: gpuAcceleratorKindSchema,
13854
- count: z.number().int().positive().default(1),
13855
- vramGb: z.number().positive().optional()
13856
- }).strict();
13857
- const gpuLeaseCommandSchema = z.object({
13858
- command: z.string().min(1).max(8192),
13859
- timeoutMs: z.number().int().positive().max(2147453647).optional(),
13860
- env: z.record(z.string(), z.string()).optional(),
13861
- cwd: z.string().min(1).max(2048).optional()
13862
- }).strict();
13863
- z.object({
13864
- refresh: z.enum(["true", "false"]).optional(),
13865
- acceleratorKind: gpuAcceleratorKindSchema.optional(),
13866
- acceleratorCount: z.coerce.number().pipe(gpuAcceleratorSchema.shape.count.unwrap()).optional(),
13867
- acceleratorVramGb: z.coerce.number().positive().optional()
13868
- }).strict();
13869
- z.object({
13870
- maxSpendUsd: z.number().positive().max(1e4).optional(),
13871
- maxLifetimeSeconds: z.number().int().positive().max(1440 * 60).optional()
13872
- }).strict().refine((value) => value.maxSpendUsd !== void 0 || value.maxLifetimeSeconds !== void 0, "Renewal requires a lifetime or spend cap");
13873
- const gpuLeaseOptionsSchema = z.object({
13874
- provider: gpuLeaseProviderSchema.optional(),
13875
- image: z.string().min(1).max(512).optional(),
13876
- env: z.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), z.string()).optional(),
13877
- diskGb: z.number().int().positive().optional(),
13878
- volumeGb: z.number().int().nonnegative().optional(),
13879
- volumeMountPath: z.string().startsWith("/").max(2048).optional(),
13880
- region: z.string().min(1).max(128).optional(),
13881
- manifest: z.record(z.string(), z.unknown()).optional(),
13882
- command: z.array(z.string().max(8192)).min(1).max(256).optional(),
13883
- ports: z.array(z.number().int().min(1).max(65535)).max(32).optional(),
13884
- endpoint: z.object({
13885
- port: z.number().int().min(1).max(65535),
13886
- healthPath: z.string().regex(/^\/(?![/\\])/).refine((path) => ![
13887
- "\r",
13888
- "\n",
13889
- " "
13890
- ].some((char) => path.includes(char))).max(2048).optional()
13891
- }).strict().optional(),
13892
- allowSpot: z.boolean().optional(),
13893
- maxHourlyUsd: z.number().positive().optional(),
13894
- weights: z.object({
13895
- manifestSha: z.string().regex(/^[a-f0-9]{64}$/),
13896
- sizeBytes: z.number().int().positive().safe()
13897
- }).strict().optional(),
13898
- arms: z.array(z.unknown()).min(1).max(256).optional(),
13899
- maxSpendUsd: z.number().positive().max(1e4),
13900
- maxLifetimeSeconds: z.number().int().positive().max(1440 * 60),
13901
- idleTimeoutSeconds: z.number().int().positive().optional()
13902
- }).strict();
13903
- const gpuLeaseAttachSchema = gpuLeaseOptionsSchema.extend({ accelerator: gpuAcceleratorSchema });
13904
- const acceleratorSchema = gpuAcceleratorSchema;
13905
- const providerSchema = gpuLeaseProviderSchema;
13906
- z.object({
13907
- ...gpuLeaseOptionsSchema.omit({ env: true }).shape,
13908
- id: z.string(),
13909
- projectRef: z.string(),
13910
- ownerUserId: z.string(),
13911
- productId: z.string().optional(),
13912
- provider: providerSchema,
13913
- providerLeaseId: z.string().optional(),
13914
- providerInstanceType: z.string().optional(),
13915
- workerUrl: z.string().optional(),
13916
- endpointUrl: z.string().optional(),
13917
- status: z.enum([
13918
- "provisioning",
13919
- "ready",
13920
- "detaching",
13921
- "destroyed",
13922
- "failed"
13923
- ]),
13924
- accelerator: acceleratorSchema,
13925
- providerCostPerHourUsd: z.number().optional(),
13926
- customerPricePerHourUsd: z.number().optional(),
13927
- estimatedProviderCostUsd: z.number().optional(),
13928
- estimatedCustomerCostUsd: z.number().optional(),
13929
- providerSelection: z.object({
13930
- strategy: z.enum([
13931
- "explicit",
13932
- "cheapest",
13933
- "ranked"
13934
- ]),
13935
- selectedProvider: providerSchema,
13936
- requestedProvider: providerSchema.optional(),
13937
- candidates: z.array(z.object({
13938
- provider: providerSchema,
13939
- accelerator: acceleratorSchema,
13940
- providerInstanceType: z.string().optional(),
13941
- region: z.string().optional(),
13942
- pricingSource: z.enum(["live", "configured"]).optional(),
13943
- providerCostPerHourUsd: z.number(),
13944
- customerPricePerHourUsd: z.number(),
13945
- maxLifetimeSeconds: z.number(),
13946
- estimatedProviderCostUsd: z.number(),
13947
- estimatedCustomerCostUsd: z.number()
13948
- })),
13949
- rejected: z.array(z.object({
13950
- provider: providerSchema,
13951
- error: z.string()
13952
- }))
13953
- }).optional(),
13954
- createdAt: z.string(),
13955
- updatedAt: z.string(),
13956
- readyAt: z.string().optional(),
13957
- startedAt: z.string().optional(),
13958
- lastUsedAt: z.string().optional(),
13959
- destroyedAt: z.string().optional(),
13960
- failure: z.string().optional(),
13961
- billing: z.object({
13962
- seconds: z.number(),
13963
- providerCostUsd: z.number(),
13964
- customerCostUsd: z.number(),
13965
- providerCostPerHourUsd: z.number(),
13966
- customerPricePerHourUsd: z.number(),
13967
- startedAt: z.string(),
13968
- stoppedAt: z.string()
13969
- }).optional()
13970
- });
13971
- //#endregion
13972
- //#region ../../../packages/runtime-contracts/dist/runtime-backend.js
13973
- /**
13974
- * The runtime a sandbox runs on, which a create names as `runtime`: a Docker
13975
- * container on the host kernel, or a Firecracker microVM with its own kernel.
13976
- * It is also what a provisioned host runs and the autoscaler buys.
13977
- */
13978
- const SANDBOX_RUNTIMES = ["docker", "firecracker"];
13979
- [...SANDBOX_RUNTIMES];
13980
- //#endregion
13981
13778
  //#region ../../../packages/runtime-contracts/dist/egress-activity.js
13982
13779
  /**
13983
13780
  * The egress activity record a sandbox's proxy log is read into, shared by the
@@ -15156,4 +14953,4 @@ var SandboxInstance = class SandboxInstance extends SandboxEgressCapabilities {
15156
14953
  }
15157
14954
  };
15158
14955
  //#endregion
15159
- 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 };
14956
+ 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-d_c1h__g.js";
2
+ import { i as fetchSandboxApi } from "../api-request-BlTCqcmt.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-Ccirv2nB.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-BPj50tJh.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-CQQNiQft.js";
1
+ import { L as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-BPv4y_S8.js";
2
2
  import { a as readResponseJson } from "./errors-D44qyFpy.js";
3
- import { i as fetchSandboxApi } from "./api-request-d_c1h__g.js";
3
+ import { i as fetchSandboxApi } from "./api-request-BlTCqcmt.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.312",
3
+ "version": "1.0.314",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -154,14 +154,14 @@
154
154
  "ws": "^8.22.0",
155
155
  "yjs": "13.6.33",
156
156
  "@products/sandbox-test-utils": "0.0.0",
157
- "@tangle-network/agent-profile-materialize": "0.27.1",
158
157
  "@repo/shared": "0.0.0",
159
158
  "@tangle-network/cli-agent-registry": "0.15.0",
160
- "@tangle-network/runtime-contracts": "0.20.0"
159
+ "@tangle-network/runtime-contracts": "0.20.0",
160
+ "@tangle-network/agent-profile-materialize": "0.27.1"
161
161
  },
162
162
  "tangleRelease": {
163
- "sourceSha": "f2724e0a5df0c645c8a39b7136190e3f03e2f446",
164
- "mergedAt": "2026-11-08T08:24:55-08:00"
163
+ "sourceSha": "f9649571436d525231756cc436cfb2586647c807",
164
+ "mergedAt": "2026-11-08T13:00:27-08:00"
165
165
  },
166
166
  "scripts": {
167
167
  "build": "node scripts/build-dist.mjs && bash scripts/verify-dist.sh",