@tangle-network/sandbox 1.0.184 → 1.0.186

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
1
  import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-Cqf4Lpp0.js";
2
2
  import { O as assertCurrentBackendType } from "../interactive-controller-C876Pjaj.js";
3
- import { t as SandboxInstance } from "../sandbox-J25gA1la.js";
3
+ import { t as SandboxInstance } from "../sandbox-DmUUv6Yl.js";
4
4
  import { C as StateError, E as ValidationError, g as NotFoundError } from "../errors-CaX0a5Ry.js";
5
- import { t as Sandbox } from "../client-DKvkEgEu.js";
5
+ import { t as Sandbox } from "../client--BsO9F_O.js";
6
6
  import { z } from "zod";
7
7
  //#region src/agent/instances.ts
8
8
  const managers = /* @__PURE__ */ new WeakMap();
@@ -1,5 +1,5 @@
1
- import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-CwJjUmvo-CD3jrgbH.js";
2
- import "../cli-auth-bundle-MqvlO-rb.js";
1
+ import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
2
+ import "../cli-auth-bundle-CMJWI99l.js";
3
3
  //#region src/auth/tokens.ts
4
4
  const textEncoder = new TextEncoder();
5
5
  const textDecoder = new TextDecoder();
@@ -1,7 +1,7 @@
1
1
  import { n as agentProfileJsonSchema, r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
2
2
  import { z } from "zod";
3
3
  import "@tangle-network/agent-interface/harness-capabilities";
4
- //#region ../../../packages/cli-agent-registry/dist/harness-contracts-D8ecaUiL.mjs
4
+ //#region ../../../packages/cli-agent-registry/dist/harness-contracts-BZoECCMc.mjs
5
5
  /** The CLI version infra/nix ships for each registered harness. */
6
6
  const HARNESS_CLI_VERSIONS = {
7
7
  "claude-code": "2.1.311",
@@ -956,7 +956,7 @@ const HARNESSES = {
956
956
  root: ".prime-provider/prime-agent-dirs",
957
957
  files: ["**/sessions/*.jsonl"],
958
958
  write: "jsonl-append",
959
- shared: false,
959
+ shared: true,
960
960
  format: "prime.session-jsonl"
961
961
  }],
962
962
  identity: {
@@ -1055,7 +1055,7 @@ function isBackendType(value) {
1055
1055
  return BACKEND_TYPE_SET.has(value);
1056
1056
  }
1057
1057
  //#endregion
1058
- //#region ../../../packages/cli-agent-registry/dist/specs-B-8kWldX.mjs
1058
+ //#region ../../../packages/cli-agent-registry/dist/specs-BBF55TnM.mjs
1059
1059
  z.globalRegistry.add(agentProfileSchema, {
1060
1060
  id: "AgentProfile",
1061
1061
  ...agentProfileJsonSchema
@@ -1597,7 +1597,7 @@ function getSpec(name) {
1597
1597
  return CLI_AGENT_SPECS.find((spec) => spec.name === name);
1598
1598
  }
1599
1599
  //#endregion
1600
- //#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle-CwJjUmvo.mjs
1600
+ //#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle-C6DtK7GX.mjs
1601
1601
  const cliAuthReferenceSchema = z.strictObject({
1602
1602
  account: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9@._+-]{0,127}$/),
1603
1603
  secretEnv: z.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/),
@@ -0,0 +1,2 @@
1
+ import "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
2
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { A as normalizeRuntimeBackendConfig, D as applyRequestedModel, E as isBrowserRuntime, H as backendTypeSchema, N as withProfileHarness, O as assertCurrentBackendType, P as withoutCreateOnlyModelFields, S as encodePromptForWire, o as requestInteractiveSessionToken } from "./interactive-controller-C876Pjaj.js";
2
2
  import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
3
- import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as extendableDeadline, I as normalizeEgressPolicyFields, J as isDeployWindowCreateError, K as generateIdempotencyKey, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as createRetryDelayMs, X as isRetryableCreateError, Y as isRateLimitCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as isCapacityShortageCreateError, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-J25gA1la.js";
3
+ import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as extendableDeadline, I as normalizeEgressPolicyFields, J as isDeployWindowCreateError, K as generateIdempotencyKey, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as createRetryDelayMs, X as isRetryableCreateError, Y as isRateLimitCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as isCapacityShortageCreateError, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-DmUUv6Yl.js";
4
4
  import { l as SANDBOX_AGENT_HOME, t as isInsideReservedDir } from "./file-transfer-DTHgLccV.js";
5
5
  import { E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, g as NotFoundError, h as NetworkError, i as readResponseJson, n as parseErrorResponse, r as parseResponseError, x as SandboxError } from "./errors-CaX0a5Ry.js";
6
6
  import { r as combineAbortSignals, t as abortableSleep } from "./abort-signal-PgWPMn_e.js";
@@ -1212,11 +1212,11 @@ function isLocalSandboxEndpoint(baseUrl) {
1212
1212
  }
1213
1213
  }
1214
1214
  async function resolveLocalCliAuthFiles(backendType) {
1215
- const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-C33U2G-c.js");
1215
+ const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-CPS9yuTc.js");
1216
1216
  return discoverLocalCliAuthFiles(backendType);
1217
1217
  }
1218
1218
  async function loadLocalCliAuthExpectation(backendType) {
1219
- const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-C33U2G-c.js");
1219
+ const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-CPS9yuTc.js");
1220
1220
  return describe(backendType);
1221
1221
  }
1222
1222
  /**
@@ -1,9 +1,9 @@
1
1
  import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
2
- import { Z as canonicalAgentProfileDigest } from "./sandbox-J25gA1la.js";
2
+ import { Z as canonicalAgentProfileDigest } from "./sandbox-DmUUv6Yl.js";
3
3
  import { E as ValidationError, s as CapabilityError, x as SandboxError } from "./errors-CaX0a5Ry.js";
4
4
  import { n as awaitWithAbort } from "./abort-signal-PgWPMn_e.js";
5
- import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-CwJjUmvo-CD3jrgbH.js";
6
- import "./cli-auth-bundle-MqvlO-rb.js";
5
+ import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
6
+ import "./cli-auth-bundle-CMJWI99l.js";
7
7
  import { z } from "zod";
8
8
  //#region src/failure-kind.ts
9
9
  const LOST_CODES = new Set(["BACKING_CONTAINER_MISSING", "SANDBOX_NOT_FOUND"]);
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
- import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-J25gA1la.js";
1
+ import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-DmUUv6Yl.js";
2
2
  import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, d as FileWriteConflictError, g as NotFoundError, h as NetworkError, n as parseErrorResponse, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-CaX0a5Ry.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-DKvkEgEu.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--BsO9F_O.js";
4
4
  import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-DxHJhxCe.js";
5
5
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
6
- import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-ze7_svOX.js";
6
+ import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-Cpfg1iZF.js";
7
7
  export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, ProfileFileMountPathError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, SeatSelectionError, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, G as parseBackendType, H as backendTypeSchema, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-C876Pjaj.js";
2
2
  import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, k as agentInteractiveSessionPromptRequestDigest, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-DHIS8edi.js";
3
3
  import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-C1KpT-wS.js";
4
- import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-J25gA1la.js";
4
+ import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-DmUUv6Yl.js";
5
5
  import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, b as ResumeEnvRequiredError, c as CompliancePlacementError, d as FileWriteConflictError, f as GpuProviderNotConfiguredError, g as NotFoundError, h as NetworkError, l as EdgeNotReadyError, n as parseErrorResponse, o as BranchFanoutExceedsHostError, p as KeyBudgetExhaustedError, s as CapabilityError, t as TerminalStreamError, u as EgressProxyRecoveryError, v as ProfileFileMountPathError, w as StreamInterruptedError, x as SandboxError, y as QuotaError } from "./errors-CaX0a5Ry.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-DKvkEgEu.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--BsO9F_O.js";
7
7
  import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CmT6Ygiv.js";
8
8
  import { t as parseSSEStream } from "./sse-parser-B4aH89Nq.js";
9
9
  import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-DxHJhxCe.js";
10
10
  import { t as downloadFile } from "./file-download-BXgu9BNh.js";
11
11
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
12
- import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-ze7_svOX.js";
13
- import { s as BlueprintSandboxClient } from "./tangle-CeRKIc8Z.js";
12
+ import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-Cpfg1iZF.js";
13
+ import { s as BlueprintSandboxClient } from "./tangle-B_xWyY1M.js";
14
14
  import { z } from "zod";
15
15
  //#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
16
16
  const MANAGED_MODEL_KEY_SENTINEL = "proxy-managed-per-request";
@@ -1,4 +1,4 @@
1
- import { t as AUTH_BUNDLE_PATHS } from "./cli-auth-bundle-CwJjUmvo-CD3jrgbH.js";
1
+ import { t as AUTH_BUNDLE_PATHS } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { basename, dirname, join } from "node:path";
4
4
  import { homedir } from "node:os";
@@ -12,8 +12,8 @@ import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-DTJbOAWL.
12
12
  import { t as parseSSEStream } from "./sse-parser-B4aH89Nq.js";
13
13
  import { s as uploadChunked } from "./chunked-upload-vAE2hVcP.js";
14
14
  import { t as runPreparedProcess } from "./prepared-process-BWVz93cT.js";
15
- import { a as isBackendType, r as cliAuthReferenceSchema } from "./cli-auth-bundle-CwJjUmvo-CD3jrgbH.js";
16
- import "./cli-auth-bundle-MqvlO-rb.js";
15
+ import { a as isBackendType, r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
16
+ import "./cli-auth-bundle-CMJWI99l.js";
17
17
  import { n as SandboxLines } from "./lines-DxHJhxCe.js";
18
18
  import { t as downloadFile } from "./file-download-BXgu9BNh.js";
19
19
  import { z } from "zod";
@@ -5589,46 +5589,29 @@ var SandboxLifecycleCapabilities = class extends SandboxLifecycleEventsCapabilit
5589
5589
  */
5590
5590
  const LIFECYCLE_CONFLICT_CODE = "SANDBOX_LIFECYCLE_IN_PROGRESS";
5591
5591
  /**
5592
- * How long a lifecycle call re-attempts that refusal before it surfaces.
5593
- *
5594
- * MEASURED MOTIVE. `resume`, `stop` and `delete` are the only three routes the
5595
- * API guards, and they share one lease per sandbox, `lifecycle-<id>`. That
5596
- * lease outlives the response of the call that took it: the delete handler
5597
- * registers deferred key-revoke and meta-delete work through
5598
- * `deferSandboxLifecycleWork`, and the release is chained after that work
5599
- * through `executionCtx.waitUntil`. So a second lifecycle call landing inside
5600
- * that window is refused even though nothing is wrong and the caller only has
5601
- * to wait. The platform's own workflow smoke already hand-rolls this retry and
5602
- * says why (scripts/platform-workflow-deploy-smoke.mjs: "the worker can still
5603
- * hold the sandbox lifecycle claim while its final action cleanup completes,
5604
- * so sandbox-api returns a typed 409 for a short, valid window").
5605
- *
5606
- * The number: 2 of 2 provider-seam runs (tangle-network/agent-sdk#280)
5607
- * lost a completed agent turn to this refusal. `agent-runtime`'s provider
5608
- * executor destroys one environment twice — once when the stream settles and
5609
- * once from `teardown()` — and the second DELETE was refused, which discarded
5610
- * the first one's result. Nothing about the sandbox document tells a client the
5611
- * lease is held (the response schema is `.strict()` and carries no lifecycle
5612
- * field), so a status poll cannot replace this retry.
5613
- *
5614
- * The ceiling is short on purpose. The lease TTL is 360 s, but the window this
5615
- * closes is the deferred-cleanup tail of an operation that already answered;
5616
- * a conflict that outlives ~11 s is a genuinely concurrent operation and
5617
- * belongs to the caller, not to a longer sleep here.
5592
+ * How long a lifecycle call re-attempts a refusal that only asks it to wait.
5593
+ * `resume`, `stop` and `delete` share one lease per sandbox, `lifecycle-<id>`,
5594
+ * held past a response while its deferred cleanup runs (the workflow smoke
5595
+ * hand-rolls the same retry), so a second call in that window is refused 409;
5596
+ * 2 of 2 provider-seam runs (agent-sdk#280) lost a completed turn to it. A
5597
+ * lease-store or storage outage answers 503 (us1 2026-11-01: 16/16 child
5598
+ * deletes failed through a Platform deploy that had removed every child). The
5599
+ * ceiling (~11 s) is short: a longer conflict is a real concurrent operation.
5618
5600
  */
5619
5601
  const LIFECYCLE_CONFLICT_MAX_ATTEMPTS = 6;
5620
5602
  const LIFECYCLE_CONFLICT_BASE_DELAY_MS = 500;
5621
5603
  const LIFECYCLE_CONFLICT_MAX_DELAY_MS = 4e3;
5604
+ /** A lease-store or storage outage the API answers 503 before or after its effect: a retry is safe. */
5605
+ const LIFECYCLE_OUTAGE_CODES = new Set(["SANDBOX_LIFECYCLE_COORDINATION_UNAVAILABLE", "STORAGE_UNAVAILABLE"]);
5622
5606
  function isLifecycleConflict(cause) {
5623
- return cause instanceof SandboxError && cause.status === 409 && cause.code === LIFECYCLE_CONFLICT_CODE;
5607
+ return cause instanceof SandboxError && (cause.status === 409 && cause.code === LIFECYCLE_CONFLICT_CODE || cause.status === 503 && LIFECYCLE_OUTAGE_CODES.has(cause.code));
5624
5608
  }
5625
5609
  function lifecycleConflictDelayMs(cause, failedAttempt) {
5626
5610
  if (cause instanceof SandboxError && cause.retryAfterMs !== void 0) return cause.retryAfterMs;
5627
5611
  return Math.min(LIFECYCLE_CONFLICT_BASE_DELAY_MS * 2 ** Math.max(0, failedAttempt - 1), LIFECYCLE_CONFLICT_MAX_DELAY_MS);
5628
5612
  }
5629
5613
  /**
5630
- * Run one lifecycle mutation, re-attempting only the platform's typed
5631
- * "already in progress" refusal.
5614
+ * Run one lifecycle mutation, re-attempting only the refusals above.
5632
5615
  *
5633
5616
  * Every other failure keeps its identity and its stack: this widens no other
5634
5617
  * error class, and a caller abort ends the wait immediately.
@@ -1,2 +1,2 @@
1
- import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-CeRKIc8Z.js";
1
+ import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-B_xWyY1M.js";
2
2
  export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,4 +1,4 @@
1
- import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-J25gA1la.js";
1
+ import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-DmUUv6Yl.js";
2
2
  import { i as readResponseJson } from "./errors-CaX0a5Ry.js";
3
3
  import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-CK-x8vXj.js";
4
4
  //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "1.0.184",
3
+ "version": "1.0.186",
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",
158
+ "@tangle-network/agent-profile-materialize": "0.27.1",
159
159
  "@tangle-network/cli-agent-registry": "0.15.0",
160
160
  "@tangle-network/runtime-contracts": "0.20.0"
161
161
  },
162
162
  "tangleRelease": {
163
- "sourceSha": "dcc7def46f0c15b9f0ea7f4f3268e9725fe5a248",
164
- "mergedAt": "2026-11-02T01:13:43-08:00"
163
+ "sourceSha": "58a2e24fe96a5718ed220698bf08afc073d102a2",
164
+ "mergedAt": "2026-11-02T01:19:58-08:00"
165
165
  },
166
166
  "scripts": {
167
167
  "build": "node scripts/build-dist.mjs",
@@ -1,2 +0,0 @@
1
- import "./cli-auth-bundle-CwJjUmvo-CD3jrgbH.js";
2
- export {};