@tangle-network/sandbox 0.11.1-develop.20260723131320.f0c1459 → 0.11.1-develop.20260723133806.2c3f22f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -566,6 +566,39 @@ console.log(result.stdout);
566
566
  console.log(result.stderr);
567
567
  ```
568
568
 
569
+ #### `box.images.publish(input, options?)`
570
+
571
+ Build a Dockerfile from the sandbox workspace and publish the resulting image through the public Sandbox API.
572
+ Registry credentials are sent to the trusted publisher and are not exposed to sandbox processes.
573
+ Use the top-level `ImageBuilder` for an image specification needed before sandbox creation; use `box.images.publish()` for files already built or edited inside a live sandbox.
574
+
575
+ ```typescript
576
+ const published = await box.images.publish(
577
+ {
578
+ contextPath: "apps/web",
579
+ dockerfilePath: "Dockerfile",
580
+ repository: "ghcr.io/acme/web",
581
+ auth: {
582
+ username: process.env.REGISTRY_USERNAME!,
583
+ password: process.env.REGISTRY_PASSWORD!,
584
+ },
585
+ platform: "linux/amd64",
586
+ },
587
+ {
588
+ idempotencyKey: "deploy-request-0184",
589
+ timeoutMs: 15 * 60 * 1000,
590
+ },
591
+ );
592
+
593
+ console.log(published.image); // ghcr.io/acme/web@sha256:...
594
+ console.log(published.taggedImage); // deterministic operation tag
595
+ ```
596
+
597
+ Reuse the same `idempotencyKey` only when retrying the same logical publication.
598
+ The returned `image` is immutable and digest-addressed.
599
+ Operation tags are create-only: replaying identical content succeeds, while attempting to reuse a tag for different content fails.
600
+ The repository must omit the scheme, tag, and digest.
601
+
569
602
  #### `box.prompt(message, options?)`
570
603
 
571
604
  Send a single prompt to the AI agent.
@@ -1,6 +1,6 @@
1
1
  import { C as CodeExecutionResult, E as CodeResultPart, S as CodeExecutionOptions, w as CodeLanguage } from "../types-Bzq-iUmW.js";
2
- import { n as SandboxInstance } from "../sandbox-DXMNXst0.js";
3
- import { i as SandboxClient } from "../client-Cnu6gYNE.js";
2
+ import { n as SandboxInstance } from "../sandbox-ZpKhrYxh.js";
3
+ import { i as SandboxClient } from "../client-DibkX46e.js";
4
4
  import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
5
5
 
6
6
  //#region src/agent/tools/_specs.d.ts
@@ -1,6 +1,6 @@
1
- import { c as encodeTextForWire, i as SANDBOX_PROXY_REQUEST_MAX_BYTES, o as combineAbortSignals, s as encodePromptForWire } from "./runtime-api-DCMrscis.js";
2
- import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, o as PartialFailureError, p as parseErrorResponse, t as AuthError } from "./errors-hbpL_-S6.js";
3
- import { h as exportTraceBundle, n as createSandboxInstanceFromResponse, p as normalizeConnection, r as normalizeStartupDiagnostics, v as parseSSEStream } from "./sandbox-_XxypYz0.js";
1
+ import { c as encodeTextForWire, i as SANDBOX_PROXY_REQUEST_MAX_BYTES, o as combineAbortSignals, s as encodePromptForWire } from "./runtime-api-XhAv6YiH.js";
2
+ import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, o as PartialFailureError, p as parseErrorResponse, t as AuthError } from "./errors-D9fFOWX9.js";
3
+ import { g as exportTraceBundle, m as normalizeConnection, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, y as parseSSEStream } from "./sandbox-CZRF0EZ3.js";
4
4
  //#region src/resources.ts
5
5
  /**
6
6
  * Compute tiers, ordered smallest → largest. Defined HERE (not imported from
@@ -1,5 +1,5 @@
1
1
  import { $n as SandboxFleetDispatchResponse, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, An as ReconcileSandboxFleetsOptions, Ct as FleetPromptDispatchOptions, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, En as PublishPublicTemplateOptions, F as CreateSandboxOptions, Gn as SandboxClientConfig, Gt as IntelligenceReportBudget, Jt as IntelligenceReportWindow, Kt as IntelligenceReportCompareTo, M as CreateSandboxFleetOptions, N as CreateSandboxFleetTokenOptions, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Qt as ListSandboxFleetOptions, Sr as SandboxInfo, St as FleetMachineId, Tn as PublicTemplateVersionInfo, Vi as BatchEvent, Wt as IntelligenceReport, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Yn as SandboxFleetArtifact, Zn as SandboxFleetCostEstimate, _ as BatchTask, _n as PromptInputPart, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, cr as SandboxFleetManifest, di as SshKeysManager, er as SandboxFleetDriverCapability, fr as SandboxFleetToken, g as BatchRunRequest, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, hi as SubscriptionInfo, j as CreateRequestOptions, jn as ReconcileSandboxFleetsResult, kn as ReapExpiredSandboxFleetsResult, m as BatchResult, nr as SandboxFleetInfo, nt as ExecResult, or as SandboxFleetMachineRecord, p as BatchOptions, pr as SandboxFleetTraceBundle, qn as SandboxEnvironment, tt as ExecOptions, ur as SandboxFleetOperationsSummary, vn as PromptOptions, vt as FleetDispatchResultBufferOptions, wn as PublicTemplateInfo, wt as FleetPromptDispatchResult, xr as SandboxFleetWorkspaceSnapshotResult, xt as FleetExecDispatchResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions } from "./types-Bzq-iUmW.js";
2
- import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-DXMNXst0.js";
2
+ import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance, t as HttpClient } from "./sandbox-ZpKhrYxh.js";
3
3
 
4
4
  //#region src/lib/sse-parser.d.ts
5
5
  /**
@@ -1,2 +1,2 @@
1
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-CeNQA9H_.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-DdD_rFZQ.js";
2
2
  export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
@@ -1,4 +1,4 @@
1
- import { d as TimeoutError, i as NetworkError, p as parseErrorResponse } from "./errors-hbpL_-S6.js";
1
+ import { d as TimeoutError, i as NetworkError, p as parseErrorResponse } from "./errors-D9fFOWX9.js";
2
2
  //#region src/collaboration/client.ts
3
3
  const DEFAULT_TIMEOUT_MS = 3e4;
4
4
  function normalizeBaseUrl(url) {
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { F as CreateSandboxOptions, Gn as SandboxClientConfig, Nr as SandboxStatus, Sr as SandboxInfo, cn as PreviewLinkInfo, ln as PreviewLinkManager, nt as ExecResult, rn as NetworkConfig, tt as ExecOptions } from "./types-Bzq-iUmW.js";
2
- import { n as SandboxInstance } from "./sandbox-DXMNXst0.js";
3
- import { i as SandboxClient } from "./client-Cnu6gYNE.js";
4
- import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
5
- export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError };
2
+ import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-ZpKhrYxh.js";
3
+ import { i as SandboxClient } from "./client-DibkX46e.js";
4
+ import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-C8HMx78o.js";
5
+ export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages };
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
2
- import { t as SandboxInstance } from "./sandbox-_XxypYz0.js";
3
- import { n as SandboxClient } from "./client-Bi9rZKmY.js";
4
- export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
1
+ import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
2
+ import { i as WorkspaceImages, t as SandboxInstance } from "./sandbox-CZRF0EZ3.js";
3
+ import { n as SandboxClient } from "./client-DH-4QDJA.js";
4
+ export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages };
@@ -126,7 +126,7 @@ declare class NetworkError extends SandboxError {
126
126
  * The server returned an unexpected error.
127
127
  */
128
128
  declare class ServerError extends SandboxError {
129
- constructor(message: string, status?: number, metadata?: SandboxErrorMetadata);
129
+ constructor(message: string, status?: number, metadata?: SandboxErrorMetadata, code?: string);
130
130
  }
131
131
  //#endregion
132
132
  export { NotFoundError as a, SandboxError as c, ServerError as d, StateError as f, NetworkError as i, SandboxErrorJson as l, ValidationError as m, CapabilityError as n, PartialFailureError as o, TimeoutError as p, EgressProxyRecoveryError as r, QuotaError as s, AuthError as t, SandboxFailureDetail as u };
@@ -168,8 +168,8 @@ var NetworkError = class extends SandboxError {
168
168
  * The server returned an unexpected error.
169
169
  */
170
170
  var ServerError = class extends SandboxError {
171
- constructor(message, status = 500, metadata) {
172
- super(message, "SERVER_ERROR", status, metadata);
171
+ constructor(message, status = 500, metadata, code = "SERVER_ERROR") {
172
+ super(message, code, status, metadata);
173
173
  this.name = "ServerError";
174
174
  }
175
175
  };
@@ -207,6 +207,10 @@ function isPartialFailureCode(code) {
207
207
  function asString(value) {
208
208
  return typeof value === "string" && value.trim().length > 0 ? value : void 0;
209
209
  }
210
+ const ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
211
+ function asErrorCode(value) {
212
+ return typeof value === "string" && ERROR_CODE_PATTERN.test(value) ? value : void 0;
213
+ }
210
214
  function isFailureDetail(value) {
211
215
  return typeof value === "object" && value !== null && !Array.isArray(value);
212
216
  }
@@ -237,11 +241,11 @@ function parseErrorResponse(status, body, context, headers) {
237
241
  }
238
242
  const errorObj = data.error;
239
243
  const nestedMessage = typeof errorObj === "object" && errorObj !== null ? errorObj.message : void 0;
240
- const nestedCode = typeof errorObj === "object" && errorObj !== null ? errorObj.code : void 0;
244
+ const nestedCode = typeof errorObj === "object" && errorObj !== null ? asErrorCode(errorObj.code) : void 0;
241
245
  const baseMessage = data.message || nestedMessage || (typeof errorObj === "string" ? errorObj : void 0) || body || "Unknown error";
242
246
  const details = typeof data.details === "string" && data.details.trim().length > 0 ? data.details.trim() : void 0;
243
247
  const shouldAppendDetails = !!details && details !== baseMessage && (baseMessage === "Unknown error" || /^failed\b/i.test(baseMessage) || /^provision failed\b/i.test(baseMessage) || /^deprovision failed\b/i.test(baseMessage));
244
- const code = data.code || nestedCode;
248
+ const code = asErrorCode(data.code) ?? nestedCode;
245
249
  const message = `${context ? `${context.method ?? "REQUEST"} ${context.path ?? ""}: ` : ""}${shouldAppendDetails ? `${baseMessage}: ${details}` : baseMessage}`;
246
250
  const metadata = {
247
251
  origin: inferOrigin(headers, context),
@@ -263,7 +267,7 @@ function parseErrorResponse(status, body, context, headers) {
263
267
  case 429: return new QuotaError(data.quotaType || "rate_limit", message, data.current, data.limit, metadata);
264
268
  case 501: return new SandboxError(message, code || "NOT_IMPLEMENTED", status, metadata);
265
269
  default:
266
- if (status >= 500) return new ServerError(message, status, metadata);
270
+ if (status >= 500) return new ServerError(message, status, metadata, code);
267
271
  return new SandboxError(message, code || "UNKNOWN_ERROR", status, metadata);
268
272
  }
269
273
  }
@@ -1,5 +1,5 @@
1
1
  import { F as CreateSandboxOptions } from "./types-Bzq-iUmW.js";
2
- import { n as SandboxInstance, t as HttpClient } from "./sandbox-DXMNXst0.js";
2
+ import { n as SandboxInstance, t as HttpClient } from "./sandbox-ZpKhrYxh.js";
3
3
 
4
4
  //#region src/tangle/abi.d.ts
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { $ as EventStreamOptions, $i as TerminalStreamToken, $n as SandboxFleetDispatchResponse, $r as SentSessionMessage, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, Ai as TurnDriveResult, An as ReconcileSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitDiff, B as DirectoryPermission, Bi as BatchBackendStats, Bn as RolloutStatus, Br as SandboxTraceBundle, Bt as GpuType, Ci as TeeAttestationOptions, Cn as ProvisionStep, Cr as SandboxIntelligenceEnvelope, Ct as FleetPromptDispatchOptions, D as CommitTaskSessionOptions, Di as TeePublicKeyResponse, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, Dt as GitBranch, Ei as TeePublicKey, En as PublishPublicTemplateOptions, Er as SandboxPortPreviewLink, Et as GitAuth, F as CreateSandboxOptions, Fi as WaitForOptions, Fn as Rollout, Fr as SandboxTerminalCreateOptions, Ft as GpuLeaseExecOptions, G as DriveTurnOptions, Gi as TERMINAL_WS_ECHO_SUBPROTOCOL, Gn as SandboxClientConfig, Gr as ScopedToken, Gt as IntelligenceReportBudget, H as DispatchedSession, Hi as BatchEventDataMap, Hn as RunCodeOptions, Hr as SandboxTraceExport, Ht as HostAgentRuntimeBackend, I as CreateSessionOptions, Ii as WaitForRolloutOptions, In as RolloutChildResult, Ir as SandboxTerminalInfo, It as GpuLeaseExecResult, J as DriverType, Ji as TerminalStream, Jn as SandboxEvent, Jr as SearchOptions, Jt as IntelligenceReportWindow, K as DriverConfig, Ki as TerminalExitInfo, Kn as SandboxConnection, Kr as ScopedTokenScope, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Ln as RolloutOptions, Lr as SandboxTerminalManager, Lt as GpuLeaseManager, M as CreateSandboxFleetOptions, Mi as UploadOptions, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Ni as UploadProgress, Nr as SandboxStatus, Nt as GpuLeaseBilling, O as CompletedTurnResult, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, Or as SandboxResourceUsage, Ot as GitCommit, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Pr as SandboxTerminalAttachOptions, Pt as GpuLeaseCommandResult, Q as EnsureDevServerOptions, Qi as TerminalStreamOptions, Qn as SandboxFleetDispatchFailureClass, Qr as SendSessionMessageRequest, Qt as ListSandboxFleetOptions, R as DeleteOptions, Ri as WriteManyFile, Rn as RolloutScorer, Rr as SandboxTerminalRequestOptions, Rt as GpuLeaseProviderName, Sa as validateAgentProfileSecurity, Si as TaskSessionProfile, Sn as ProvisionStatus, Sr as SandboxInfo, St as FleetMachineId, T as CodeResult, Ti as TeeAttestationResponse, Tn as PublicTemplateVersionInfo, Tr as SandboxPortBinding, Tt as GPU_LEASE_PROVIDER_NAMES, U as DownloadOptions, Ui as BatchSidecarGroup, Un as SSHCommandDescriptor, Ur as SandboxTraceOptions, Ut as InstalledTool, V as DispatchPromptOptions, Vi as BatchEvent, Vn as RolloutTurnPart, Vr as SandboxTraceEvent, Vt as HostAgentDriverConfig, W as DownloadProgress, Wi as BatchTaskUsage, Wn as SSHCredentials, Wr as SandboxUser, Wt as IntelligenceReport, X as EgressManager, Xi as TerminalStreamError, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Xt as ListMessagesOptions, Yi as TerminalStreamAuthFormat, Yn as SandboxFleetArtifact, Yr as SecretInfo, Z as EgressPolicy, Zi as TerminalStreamHandlers, Zn as SandboxFleetCostEstimate, Zr as SendSessionMessageOptions, Zt as ListOptions, _ as BatchTask, _a as capabilitySchema, _i as TaskResult, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, aa as AgentProfileMcpServer, ai as SessionMessage, an as NonHostAgentDriverConfig, ar as SandboxFleetMachineMeteredUsage, at as FileReadBatchResult, b as ChunkedUploadOptions, ba as defineInlineResource, bi as TaskSessionFileChange, bn as ProvisionEvent, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, c as BackendInfo, ca as AgentProfilePrompt, ci as SnapshotInfo, cn as PreviewLinkInfo, cr as SandboxFleetManifest, ct as FileRenameResult, d as BackendType, da as AgentProfileSecurityPolicy, dn as ProcessInfo, dr as SandboxFleetPolicy, dt as FileTreeOptions, ea as AgentProfile, ei as SessionBackendCredentials, en as McpServerConfig, er as SandboxFleetDriverCapability, et as ExactProcessSpawnOptions, f as BatchBackend, fa as AgentProfileValidationIssue, fi as StartupDiagnostics, fn as ProcessLogEntry, fr as SandboxFleetToken, ft as FileTreeResult, g as BatchRunRequest, ga as agentProfileSchema, gi as TaskOptions, gn as ProcessStatus, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, ha as Capability, hi as SubscriptionInfo, hn as ProcessSpawnOptions, hr as SandboxFleetTraceExport, ht as FileWriteResult, i as AttachGpuLeaseOptions, ia as AgentProfileFileMount, ii as SessionListOptions, in as NetworkManager, ir as SandboxFleetMachine, it as FileReadBatchOptions, j as CreateRequestOptions, ji as UpdateUserOptions, jn as ReconcileSandboxFleetsResult, jr as SandboxRuntimeProfile, jt as GitStatus, k as CreateGpuLeaseOptions, ki as ToolsConfig, kn as ReapExpiredSandboxFleetsResult, kr as SandboxResources, kt as GitConfig, l as BackendManager, la as AgentProfileResourceRef, li as SnapshotOptions, ln as PreviewLinkManager, lr as SandboxFleetManifestMachine, lt as FileSystem, m as BatchResult, ma as AgentSubagentProfile, mi as StorageConfig, mn as ProcessSignal, mr as SandboxFleetTraceEvent, mt as FileUsageResult, n as AccessPolicyRule, na as AgentProfileConfidential, ni as SessionForkOptions, nn as MkdirOptions, nr as SandboxFleetInfo, nt as ExecResult, o as BackendCapabilities, oa as AgentProfileModelHints, oi as SessionMessageInputPart, on as PermissionLevel, or as SandboxFleetMachineRecord, ot as FileReadError, p as BatchOptions, pa as AgentProfileValidationResult, pi as StartupOperation, pn as ProcessManager, pr as SandboxFleetTraceBundle, pt as FileUsageOptions, q as DriverInfo, qi as TerminalReadyInfo, qn as SandboxEnvironment, qr as SearchMatch, qt as IntelligenceReportSubjectType, r as AddUserOptions, ra as AgentProfileConnection, ri as SessionInfo, rn as NetworkConfig, rr as SandboxFleetIntelligenceEnvelope, rt as FileInfo, s as BackendConfig, sa as AgentProfilePermissionValue, si as SessionStatus, sn as PermissionsManager, sr as SandboxFleetMachineSpec, st as FileReadResult, t as AcceleratorKind, ta as AgentProfileCapabilities, ti as SessionEventStreamOptions, tn as MintScopedTokenOptions, tr as SandboxFleetDriverTimings, tt as ExecOptions, u as BackendStatus, ua as AgentProfileResources, ui as SnapshotResult, un as Process, ur as SandboxFleetOperationsSummary, ut as FileTreeFile, v as BatchTaskResult, va as defineAgentProfile, vi as TaskSessionChanges, vn as PromptOptions, vr as SandboxFleetWorkspace, vt as FleetDispatchResultBufferOptions, wi as TeeAttestationReport, wn as PublicTemplateInfo, wr as SandboxPermissionsConfig, x as ChunkedUploadResult, xa as mergeAgentProfiles, xi as TaskSessionInfo, xn as ProvisionResult, xr as SandboxFleetWorkspaceSnapshotResult, y as BranchOptions, ya as defineGitHubResource, yi as TaskSessionCommitResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions, z as DevServerInfo, zi as WriteManyOptions, zn as RolloutStartResult, zr as SandboxTerminals, zt as GpuLeaseStatus } from "./types-Bzq-iUmW.js";
2
- import { C as CONTROL_PLANE_MCP_SERVER_NAME, D as SandboxMcpServerEntry, E as SandboxMcpEndpoint, O as buildControlPlaneMcpConfig, S as BuildSandboxMcpConfigOptions, T as SandboxMcpConfig, _ as InteractiveSessionStatus, a as TraceExportSink, b as StartInteractiveOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAttachOptions, g as InteractiveSessionInfo, h as InteractiveSessionHost, i as TraceExportResult, k as buildSandboxMcpConfig, l as toOtelJson, m as InteractiveSessionHandle, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveAuthFile, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as InterruptResult, w as SANDBOX_MCP_SERVER_NAME, x as BuildControlPlaneMcpConfigOptions, y as RespondToPermissionOptions } from "./sandbox-DXMNXst0.js";
3
- import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-Cnu6gYNE.js";
2
+ import { A as SandboxMcpEndpoint, C as RespondToPermissionOptions, D as CONTROL_PLANE_MCP_SERVER_NAME, E as BuildSandboxMcpConfigOptions, M as buildControlPlaneMcpConfig, N as buildSandboxMcpConfig, O as SANDBOX_MCP_SERVER_NAME, S as InterruptResult, T as BuildControlPlaneMcpConfigOptions, _ as InteractiveAuthFile, a as WorkspaceImagePublishResult, b as InteractiveSessionInfo, c as TraceExportResult, d as exportTraceBundle, f as otelTraceIdForTangleTrace, g as InteractiveAttachOptions, h as SandboxSession, i as WorkspaceImagePublishRequestOptions, j as SandboxMcpServerEntry, k as SandboxMcpConfig, l as TraceExportSink, m as SandboxTaskSession, n as SandboxInstance, o as WorkspaceImages, p as toOtelJson, r as WorkspaceImagePublishInput, s as TraceExportFormat, u as buildTraceExportPayload, v as InteractiveSessionHandle, w as StartInteractiveOptions, x as InteractiveSessionStatus, y as InteractiveSessionHost } from "./sandbox-ZpKhrYxh.js";
3
+ import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-DibkX46e.js";
4
4
  import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CyHojkuA.js";
5
5
  import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "./index-DKzapw-9.js";
6
- import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
7
- import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-Cz9btKSu.js";
6
+ import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-C8HMx78o.js";
7
+ import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-BX6k9wtw.js";
8
8
 
9
9
  //#region src/attestation-heartbeat.d.ts
10
10
  interface TeeAttestationHeartbeatSample {
@@ -1404,4 +1404,4 @@ interface RouterEvalMatrixCaseResult {
1404
1404
  }
1405
1405
  declare function runTangleRouterEvalMatrixInSandbox(options: RunTangleRouterEvalMatrixInSandboxOptions): Promise<RunTangleRouterEvalMatrixInSandboxResult>;
1406
1406
  //#endregion
1407
- export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchOptions, type BatchResult, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CodeResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type GpuType, type HostAgentDriverConfig, type HostAgentRuntimeBackend, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAttachOptions, type InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type Process, type ProcessInfo, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunCodeOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, type SandboxConnection, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPermissionsConfig, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxProfileSummary, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeHealth, type SandboxRuntimeProfile, type SandboxRuntimeProfileList, SandboxSession, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalAttachOptions, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTerminals, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionForkOptions, type SessionInfo, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartInteractiveOptions, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskOptions, type TaskResult, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, type TerminalExitInfo, type TerminalReadyInfo, TerminalStream, type TerminalStreamAuthFormat, TerminalStreamError, type TerminalStreamHandlers, type TerminalStreamOptions, type TerminalStreamToken, TimeoutError, type TokenRefreshHandler, type ToolsConfig, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
1407
+ export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchOptions, type BatchResult, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CodeResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type GpuType, type HostAgentDriverConfig, type HostAgentRuntimeBackend, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAttachOptions, type InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type Process, type ProcessInfo, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunCodeOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, type SandboxConnection, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPermissionsConfig, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxProfileSummary, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeHealth, type SandboxRuntimeProfile, type SandboxRuntimeProfileList, SandboxSession, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalAttachOptions, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTerminals, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionForkOptions, type SessionInfo, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartInteractiveOptions, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskOptions, type TaskResult, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, type TerminalExitInfo, type TerminalReadyInfo, TerminalStream, type TerminalStreamAuthFormat, TerminalStreamError, type TerminalStreamHandlers, type TerminalStreamOptions, type TerminalStreamToken, TimeoutError, type TokenRefreshHandler, type ToolsConfig, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { d as serializeForSidecar, l as normalizeRuntimeBackendConfig } from "./runtime-api-DCMrscis.js";
2
- import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
3
- import { _ as toOtelJson, a as TerminalStream, c as SandboxSession, d as collectAgentResponseText, f as getSandboxEventText, g as otelTraceIdForTangleTrace, h as exportTraceBundle, i as TERMINAL_WS_ECHO_SUBPROTOCOL, l as InteractiveSessionHandle, m as buildTraceExportPayload, o as TerminalStreamError, s as SandboxTaskSession, t as SandboxInstance, u as applySandboxEventText, v as parseSSEStream } from "./sandbox-_XxypYz0.js";
4
- import { a as splitInlineProfileSkills, c as SandboxFleetClient, d as SANDBOX_SIZE_PRESET_NAMES, f as resolveSandboxResources, i as splitInlineProfileFileMounts, l as DEFAULT_SANDBOX_SIZE, n as SandboxClient, o as validateDeferredProfileFileMounts, p as sandboxResourcesForSize, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as SANDBOX_SIZE_PRESETS } from "./client-Bi9rZKmY.js";
5
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CeNQA9H_.js";
6
- import { t as TangleSandboxClient } from "./tangle-B74oCU6n.js";
1
+ import { d as serializeForSidecar, l as normalizeRuntimeBackendConfig } from "./runtime-api-XhAv6YiH.js";
2
+ import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
3
+ import { _ as otelTraceIdForTangleTrace, a as TERMINAL_WS_ECHO_SUBPROTOCOL, c as SandboxTaskSession, d as applySandboxEventText, f as collectAgentResponseText, g as exportTraceBundle, h as buildTraceExportPayload, i as WorkspaceImages, l as SandboxSession, o as TerminalStream, p as getSandboxEventText, s as TerminalStreamError, t as SandboxInstance, u as InteractiveSessionHandle, v as toOtelJson, y as parseSSEStream } from "./sandbox-CZRF0EZ3.js";
4
+ import { a as splitInlineProfileSkills, c as SandboxFleetClient, d as SANDBOX_SIZE_PRESET_NAMES, f as resolveSandboxResources, i as splitInlineProfileFileMounts, l as DEFAULT_SANDBOX_SIZE, n as SandboxClient, o as validateDeferredProfileFileMounts, p as sandboxResourcesForSize, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as SANDBOX_SIZE_PRESETS } from "./client-DH-4QDJA.js";
5
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DdD_rFZQ.js";
6
+ import { t as TangleSandboxClient } from "./tangle-DMWhe-Uc.js";
7
7
  import { agentProfileSchema, capabilitySchema, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
8
8
  //#region src/confidential.ts
9
9
  function generateAttestationNonce(bytes = 32) {
@@ -1454,4 +1454,4 @@ function stripUndefined(value) {
1454
1454
  return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0).map(([k, v]) => [k, stripUndefined(v)]));
1455
1455
  }
1456
1456
  //#endregion
1457
- export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, EgressProxyRecoveryError, GPU_LEASE_PROVIDER_NAMES, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, SandboxTaskSession, ServerError, StateError, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, TerminalStream, TerminalStreamError, TimeoutError, ValidationError, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
1457
+ export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, EgressProxyRecoveryError, GPU_LEASE_PROVIDER_NAMES, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, SandboxTaskSession, ServerError, StateError, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, TerminalStream, TerminalStreamError, TimeoutError, ValidationError, WorkspaceImages, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
@@ -1,4 +1,4 @@
1
- import { d as TimeoutError, i as NetworkError, p as parseErrorResponse } from "../errors-hbpL_-S6.js";
1
+ import { d as TimeoutError, i as NetworkError, p as parseErrorResponse } from "../errors-D9fFOWX9.js";
2
2
  //#region src/intelligence/index.ts
3
3
  /**
4
4
  * `@tangle-network/sandbox/intelligence` — browser-safe typed client for the
@@ -1,4 +1,4 @@
1
- import { c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, p as parseErrorResponse, s as QuotaError } from "./errors-hbpL_-S6.js";
1
+ import { c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, p as parseErrorResponse, s as QuotaError } from "./errors-D9fFOWX9.js";
2
2
  //#region src/backend-config.ts
3
3
  const LEGACY_QUESTION_ALIAS_KEY = ["question", "Channel"].join("");
4
4
  function normalizeRuntimeModelOverride(model) {
package/dist/runtime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $r as SentSessionMessage, Ar as SandboxRuntimeHealth, D as CommitTaskSessionOptions, Fr as SandboxTerminalCreateOptions, I as CreateSessionOptions, Ir as SandboxTerminalInfo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Lr as SandboxTerminalManager, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Ni as UploadProgress, Qr as SendSessionMessageRequest, Rr as SandboxTerminalRequestOptions, Tr as SandboxPortBinding, Xt as ListMessagesOptions, Zr as SendSessionMessageOptions, ai as SessionMessage, at as FileReadBatchResult, b as ChunkedUploadOptions, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, ht as FileWriteResult, it as FileReadBatchOptions, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionInfo, vi as TaskSessionChanges, x as ChunkedUploadResult, xi as TaskSessionInfo, yi as TaskSessionCommitResult } from "./types-Bzq-iUmW.js";
2
- import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
2
+ import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-C8HMx78o.js";
3
3
 
4
4
  //#region src/lib/chunked-upload.d.ts
5
5
  /** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
package/dist/runtime.js CHANGED
@@ -1,5 +1,5 @@
1
- import { o as combineAbortSignals, r as uploadChunked, t as SandboxRuntimeApi } from "./runtime-api-DCMrscis.js";
2
- import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
1
+ import { o as combineAbortSignals, r as uploadChunked, t as SandboxRuntimeApi } from "./runtime-api-XhAv6YiH.js";
2
+ import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
3
3
  //#region src/runtime-client.ts
4
4
  const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
5
5
  function requireToken(token) {
@@ -1,5 +1,5 @@
1
- import { l as normalizeRuntimeBackendConfig, n as normalizeSessionInfo, o as combineAbortSignals, r as uploadChunked, s as encodePromptForWire, t as SandboxRuntimeApi, u as normalizeRuntimeModelOverride } from "./runtime-api-DCMrscis.js";
2
- import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, p as parseErrorResponse, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
1
+ import { l as normalizeRuntimeBackendConfig, n as normalizeSessionInfo, o as combineAbortSignals, r as uploadChunked, s as encodePromptForWire, t as SandboxRuntimeApi, u as normalizeRuntimeModelOverride } from "./runtime-api-XhAv6YiH.js";
2
+ import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, p as parseErrorResponse, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
3
3
  import { addTokenUsage, readTokenCostUsd, readTokenUsage } from "@tangle-network/agent-core";
4
4
  //#region src/lib/sse-parser.ts
5
5
  /**
@@ -345,7 +345,7 @@ function normalizeSshCredentials(raw) {
345
345
  * lives at `data.part.text` (or `.content`) when
346
346
  * `part.type === "text"`.
347
347
  */
348
- function isRecord(v) {
348
+ function isRecord$1(v) {
349
349
  return typeof v === "object" && v !== null;
350
350
  }
351
351
  /** The first candidate that is actually a string. Using `typeof` rather than a
@@ -356,11 +356,11 @@ function firstString(...candidates) {
356
356
  for (const candidate of candidates) if (typeof candidate === "string") return candidate;
357
357
  }
358
358
  function getSandboxEventText(event) {
359
- const data = isRecord(event.data) ? event.data : {};
359
+ const data = isRecord$1(event.data) ? event.data : {};
360
360
  if (event.type === "result") return firstString(data.finalText, data.response, data.output, data.content, data.text);
361
361
  if (event.type === "token") return firstString(data.value, data.delta, data.text, data.content);
362
362
  if (event.type !== "message.part.updated") return;
363
- const part = isRecord(data.part) ? data.part : void 0;
363
+ const part = isRecord$1(data.part) ? data.part : void 0;
364
364
  if (part?.type !== "text") return;
365
365
  return firstString(part.text, part.content);
366
366
  }
@@ -993,6 +993,210 @@ var TerminalStream = class TerminalStream {
993
993
  }
994
994
  };
995
995
  //#endregion
996
+ //#region src/workspace-images.ts
997
+ const DEFAULT_WORKSPACE_IMAGE_CLIENT_TIMEOUT_MS = 99e4;
998
+ const WORKSPACE_IMAGE_REQUEST_ATTEMPTS = 2;
999
+ const MAX_WORKSPACE_IMAGE_RESPONSE_BYTES = 64 * 1024;
1000
+ const MAX_TIMER_DELAY_MS = 2147483647;
1001
+ const IDEMPOTENCY_KEY_PATTERN = /^[A-Za-z0-9_-]{16,128}$/;
1002
+ function createIdempotencyKey() {
1003
+ const crypto = globalThis.crypto;
1004
+ if (crypto?.randomUUID) return crypto.randomUUID();
1005
+ if (crypto?.getRandomValues) {
1006
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
1007
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
1008
+ }
1009
+ throw new Error("workspace image publication requires global crypto");
1010
+ }
1011
+ function throwIfAborted(signal) {
1012
+ if (!signal?.aborted) return;
1013
+ throw signal.reason instanceof Error ? signal.reason : /* @__PURE__ */ new Error("workspace image publication was aborted");
1014
+ }
1015
+ function awaitWithSignal(promise, signal) {
1016
+ if (signal.aborted) return Promise.reject(signal.reason);
1017
+ return new Promise((resolve, reject) => {
1018
+ const onAbort = () => reject(signal.reason);
1019
+ signal.addEventListener("abort", onAbort, { once: true });
1020
+ promise.then((value) => {
1021
+ signal.removeEventListener("abort", onAbort);
1022
+ resolve(value);
1023
+ }, (error) => {
1024
+ signal.removeEventListener("abort", onAbort);
1025
+ reject(error);
1026
+ });
1027
+ });
1028
+ }
1029
+ async function readBoundedResponseText(response, signal) {
1030
+ const declaredBytes = Number(response.headers.get("content-length"));
1031
+ if (Number.isFinite(declaredBytes) && declaredBytes > MAX_WORKSPACE_IMAGE_RESPONSE_BYTES) {
1032
+ response.body?.cancel();
1033
+ throw new ServerError("Sandbox API returned an oversized workspace image response", 502);
1034
+ }
1035
+ if (!response.body) return "";
1036
+ const reader = response.body.getReader();
1037
+ const chunks = [];
1038
+ let totalBytes = 0;
1039
+ let rejectOnAbort;
1040
+ const aborted = new Promise((_resolve, reject) => {
1041
+ rejectOnAbort = reject;
1042
+ });
1043
+ const onAbort = () => rejectOnAbort?.(signal.reason);
1044
+ signal.addEventListener("abort", onAbort, { once: true });
1045
+ try {
1046
+ if (signal.aborted) throw signal.reason;
1047
+ while (true) {
1048
+ const { done, value } = await Promise.race([reader.read(), aborted]);
1049
+ if (done) break;
1050
+ totalBytes += value.byteLength;
1051
+ if (totalBytes > MAX_WORKSPACE_IMAGE_RESPONSE_BYTES) throw new ServerError("Sandbox API returned an oversized workspace image response", 502);
1052
+ chunks.push(value);
1053
+ }
1054
+ } catch (error) {
1055
+ reader.cancel(error).catch(() => void 0);
1056
+ throw error;
1057
+ } finally {
1058
+ signal.removeEventListener("abort", onAbort);
1059
+ reader.releaseLock();
1060
+ }
1061
+ const body = new Uint8Array(totalBytes);
1062
+ let offset = 0;
1063
+ for (const chunk of chunks) {
1064
+ body.set(chunk, offset);
1065
+ offset += chunk.byteLength;
1066
+ }
1067
+ return new TextDecoder().decode(body);
1068
+ }
1069
+ const WORKSPACE_IMAGE_RESULT_KEYS = [
1070
+ "image",
1071
+ "taggedImage",
1072
+ "digest",
1073
+ "imageId",
1074
+ "sizeBytes",
1075
+ "contextBytes",
1076
+ "contextEntries",
1077
+ "buildDurationMs",
1078
+ "pushDurationMs"
1079
+ ];
1080
+ const SHA256_DIGEST_PATTERN = /^sha256:[a-f0-9]{64}$/;
1081
+ const IMAGE_TAG_PATTERN = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/;
1082
+ function isRecord(value) {
1083
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1084
+ }
1085
+ function isNonNegativeSafeInteger(value) {
1086
+ return Number.isSafeInteger(value) && Number(value) >= 0;
1087
+ }
1088
+ function parseWorkspaceImagePublishResult(value, repository) {
1089
+ if (!isRecord(value)) return void 0;
1090
+ if (Object.keys(value).length !== WORKSPACE_IMAGE_RESULT_KEYS.length || !WORKSPACE_IMAGE_RESULT_KEYS.every((key) => Object.hasOwn(value, key))) return;
1091
+ const { image, taggedImage, digest, imageId, sizeBytes, contextBytes, contextEntries, buildDurationMs, pushDurationMs } = value;
1092
+ if (typeof image !== "string" || typeof taggedImage !== "string" || typeof digest !== "string" || typeof imageId !== "string" || !SHA256_DIGEST_PATTERN.test(digest) || !SHA256_DIGEST_PATTERN.test(imageId) || image !== `${repository}@${digest}` || !taggedImage.startsWith(`${repository}:`) || !IMAGE_TAG_PATTERN.test(taggedImage.slice(repository.length + 1)) || !isNonNegativeSafeInteger(sizeBytes) || !isNonNegativeSafeInteger(contextBytes) || !isNonNegativeSafeInteger(contextEntries) || !isNonNegativeSafeInteger(buildDurationMs) || !isNonNegativeSafeInteger(pushDurationMs)) return;
1093
+ return {
1094
+ image,
1095
+ taggedImage,
1096
+ digest,
1097
+ imageId,
1098
+ sizeBytes,
1099
+ contextBytes,
1100
+ contextEntries,
1101
+ buildDurationMs,
1102
+ pushDurationMs
1103
+ };
1104
+ }
1105
+ /** Builds and publishes the current sandbox workspace from trusted hosts. */
1106
+ var WorkspaceImages = class {
1107
+ constructor(client, sandboxId, ensureRunning, filesystemIncarnationId) {
1108
+ this.client = client;
1109
+ this.sandboxId = sandboxId;
1110
+ this.ensureRunning = ensureRunning;
1111
+ this.filesystemIncarnationId = filesystemIncarnationId;
1112
+ }
1113
+ async publish(input, options = {}) {
1114
+ if (options.timeoutMs !== void 0 && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs <= 0 || options.timeoutMs > MAX_TIMER_DELAY_MS)) throw new TypeError(`workspace image timeoutMs must be a positive safe integer no greater than ${MAX_TIMER_DELAY_MS}`);
1115
+ if (options.idempotencyKey !== void 0 && !IDEMPOTENCY_KEY_PATTERN.test(options.idempotencyKey)) throw new TypeError("workspace image idempotencyKey must be 16-128 letters, numbers, underscores, or dashes");
1116
+ const path = `/v1/sandboxes/${encodeURIComponent(this.sandboxId)}/images`;
1117
+ const timeoutMs = options.timeoutMs ?? DEFAULT_WORKSPACE_IMAGE_CLIENT_TIMEOUT_MS;
1118
+ const deadline = Date.now() + timeoutMs;
1119
+ const timeoutSignal = AbortSignal.timeout(timeoutMs);
1120
+ const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
1121
+ throwIfAborted(options.signal);
1122
+ try {
1123
+ await awaitWithSignal(this.ensureRunning(), signal);
1124
+ } catch (error) {
1125
+ throwIfAborted(options.signal);
1126
+ if (timeoutSignal.aborted || Date.now() >= deadline) throw new TimeoutError(timeoutMs, `Workspace image publication timed out after ${timeoutMs}ms`, {
1127
+ origin: "sandbox-api",
1128
+ endpoint: path
1129
+ });
1130
+ throw error;
1131
+ }
1132
+ throwIfAborted(options.signal);
1133
+ const filesystemIncarnationId = this.filesystemIncarnationId();
1134
+ if (!filesystemIncarnationId) throw new StateError("Sandbox filesystem incarnation is not ready", "running", "running with a ready filesystem incarnation", void 0, "FILESYSTEM_INCARNATION_NOT_READY");
1135
+ const idempotencyKey = options.idempotencyKey ?? createIdempotencyKey();
1136
+ const body = JSON.stringify({
1137
+ ...input,
1138
+ filesystemIncarnationId
1139
+ });
1140
+ for (let attempt = 1; attempt <= WORKSPACE_IMAGE_REQUEST_ATTEMPTS; attempt++) {
1141
+ const remainingMs = deadline - Date.now();
1142
+ if (remainingMs <= 0) throw new TimeoutError(timeoutMs, `Workspace image publication timed out after ${timeoutMs}ms`, {
1143
+ origin: "sandbox-api",
1144
+ endpoint: path
1145
+ });
1146
+ let response;
1147
+ let responseText;
1148
+ try {
1149
+ response = await this.client.fetch(path, {
1150
+ method: "POST",
1151
+ headers: {
1152
+ "Content-Type": "application/json",
1153
+ "Idempotency-Key": idempotencyKey
1154
+ },
1155
+ body,
1156
+ signal
1157
+ }, { timeoutMs: remainingMs });
1158
+ responseText = await readBoundedResponseText(response, signal);
1159
+ } catch (error) {
1160
+ throwIfAborted(options.signal);
1161
+ if (timeoutSignal.aborted || Date.now() >= deadline) throw new TimeoutError(timeoutMs, `Workspace image publication timed out after ${timeoutMs}ms`, {
1162
+ origin: "sandbox-api",
1163
+ endpoint: path
1164
+ });
1165
+ if (error instanceof ServerError) throw error;
1166
+ if (attempt < WORKSPACE_IMAGE_REQUEST_ATTEMPTS && Date.now() < deadline) continue;
1167
+ throw new NetworkError("Failed to read the workspace image publication response", error instanceof Error ? error : new Error(String(error)), {
1168
+ origin: "sandbox-api",
1169
+ endpoint: path
1170
+ });
1171
+ }
1172
+ if (!response.ok) {
1173
+ const error = parseErrorResponse(response.status, responseText, {
1174
+ method: "POST",
1175
+ path
1176
+ }, response.headers);
1177
+ if (error.code === "IMAGE_PUBLISH_OUTCOME_UNKNOWN" && attempt < WORKSPACE_IMAGE_REQUEST_ATTEMPTS && Date.now() < deadline) continue;
1178
+ throw error;
1179
+ }
1180
+ const parsed = parseWorkspaceImagePublishResult((() => {
1181
+ try {
1182
+ return JSON.parse(responseText);
1183
+ } catch {
1184
+ return;
1185
+ }
1186
+ })(), input.repository);
1187
+ if (!parsed) throw new ServerError("Sandbox API returned an invalid workspace image result", 502, {
1188
+ origin: "sandbox-api",
1189
+ endpoint: path
1190
+ });
1191
+ return parsed;
1192
+ }
1193
+ throw new ServerError("Sandbox API did not return a workspace image result", 502, {
1194
+ origin: "sandbox-api",
1195
+ endpoint: path
1196
+ });
1197
+ }
1198
+ };
1199
+ //#endregion
996
1200
  //#region src/sandbox.ts
997
1201
  /**
998
1202
  * Sandbox Instance
@@ -1348,6 +1552,7 @@ var SandboxInstance = class SandboxInstance {
1348
1552
  refreshInFlight;
1349
1553
  defaultRuntimeBackend;
1350
1554
  runtime;
1555
+ workspaceImages;
1351
1556
  /**
1352
1557
  * A profile the runtime has cached (create-time priming), letting turns
1353
1558
  * send `backend.profileSha256` instead of re-shipping the profile's static
@@ -1375,6 +1580,7 @@ var SandboxInstance = class SandboxInstance {
1375
1580
  ensureRunning: () => this.ensureRunning(),
1376
1581
  fetch: (path, init) => this.runtimeFetch(path, init)
1377
1582
  });
1583
+ this.workspaceImages = new WorkspaceImages(this.client, this.info.id, () => this.ensureRunning(), () => this.info.filesystemIncarnationId);
1378
1584
  }
1379
1585
  /** Unique sandbox identifier */
1380
1586
  get id() {
@@ -1436,6 +1642,10 @@ var SandboxInstance = class SandboxInstance {
1436
1642
  get url() {
1437
1643
  return this.info.connection?.webTerminalUrl;
1438
1644
  }
1645
+ /** Build and publish this sandbox's workspace without exposing registry credentials to it. */
1646
+ get images() {
1647
+ return this.workspaceImages;
1648
+ }
1439
1649
  /**
1440
1650
  * The 12-phase startup breakdown (storage_provision, host_select, edge_bind,
1441
1651
  * edge_ready, egress_proxy, docker_pull/create/start, sidecar_boot,
@@ -5584,4 +5794,4 @@ function quoteForShell(value) {
5584
5794
  return `'${value.replace(/'/g, "'\\''")}'`;
5585
5795
  }
5586
5796
  //#endregion
5587
- export { toOtelJson as _, TerminalStream as a, SandboxSession as c, collectAgentResponseText as d, getSandboxEventText as f, otelTraceIdForTangleTrace as g, exportTraceBundle as h, TERMINAL_WS_ECHO_SUBPROTOCOL as i, InteractiveSessionHandle as l, buildTraceExportPayload as m, createSandboxInstanceFromResponse as n, TerminalStreamError as o, normalizeConnection as p, normalizeStartupDiagnostics as r, SandboxTaskSession as s, SandboxInstance as t, applySandboxEventText as u, parseSSEStream as v };
5797
+ export { otelTraceIdForTangleTrace as _, TERMINAL_WS_ECHO_SUBPROTOCOL as a, SandboxTaskSession as c, applySandboxEventText as d, collectAgentResponseText as f, exportTraceBundle as g, buildTraceExportPayload as h, WorkspaceImages as i, SandboxSession as l, normalizeConnection as m, createSandboxInstanceFromResponse as n, TerminalStream as o, getSandboxEventText as p, normalizeStartupDiagnostics as r, TerminalStreamError as s, SandboxInstance as t, InteractiveSessionHandle as u, toOtelJson as v, parseSSEStream as y };
@@ -470,6 +470,60 @@ declare function exportTraceBundle(bundle: TraceExportBundle, sink: TraceExportS
470
470
  declare function toOtelJson(bundle: TraceExportBundle, serviceName?: string): JsonObject;
471
471
  declare function otelTraceIdForTangleTrace(traceId: string): string;
472
472
  //#endregion
473
+ //#region ../../../packages/runtime-contracts/dist/workspace-image-types.d.ts
474
+ /** Successful workspace image publication returned by the Sandbox API. */
475
+ interface WorkspaceImagePublishResult$1 {
476
+ /** Immutable registry reference. */
477
+ image: string;
478
+ /** Operation-stable tag used during publication. */
479
+ taggedImage: string;
480
+ digest: string;
481
+ imageId: string;
482
+ sizeBytes: number;
483
+ contextBytes: number;
484
+ contextEntries: number;
485
+ buildDurationMs: number;
486
+ pushDurationMs: number;
487
+ }
488
+ //#endregion
489
+ //#region src/workspace-images.d.ts
490
+ interface WorkspaceImagePublishInput {
491
+ /** Workspace-relative build context. */
492
+ contextPath?: string;
493
+ /** Dockerfile path relative to the build context. */
494
+ dockerfilePath?: string;
495
+ /** Registry host and repository path, without a scheme, tag, or digest. */
496
+ repository: string;
497
+ /** Registry credential used only by the trusted image publisher. */
498
+ auth: {
499
+ username: string;
500
+ password: string;
501
+ };
502
+ platform?: "linux/amd64" | "linux/arm64";
503
+ }
504
+ type WorkspaceImagePublishResult = WorkspaceImagePublishResult$1;
505
+ interface WorkspaceImageHttpClient {
506
+ fetch(path: string, options?: RequestInit, fetchOptions?: {
507
+ timeoutMs?: number;
508
+ }): Promise<Response>;
509
+ }
510
+ interface WorkspaceImagePublishRequestOptions {
511
+ /** Stable key to safely retry the same logical publication. */
512
+ idempotencyKey?: string;
513
+ /** Maximum client wait. The server independently caps the operation. */
514
+ timeoutMs?: number;
515
+ signal?: AbortSignal;
516
+ }
517
+ /** Builds and publishes the current sandbox workspace from trusted hosts. */
518
+ declare class WorkspaceImages {
519
+ private readonly client;
520
+ private readonly sandboxId;
521
+ private readonly ensureRunning;
522
+ private readonly filesystemIncarnationId;
523
+ constructor(client: WorkspaceImageHttpClient, sandboxId: string, ensureRunning: () => Promise<void>, filesystemIncarnationId: () => string | undefined);
524
+ publish(input: WorkspaceImagePublishInput, options?: WorkspaceImagePublishRequestOptions): Promise<WorkspaceImagePublishResult>;
525
+ }
526
+ //#endregion
473
527
  //#region src/sandbox.d.ts
474
528
  /**
475
529
  * Result of registering a sidecar session mapping. `reprovisionRequired` is
@@ -547,6 +601,7 @@ declare class SandboxInstance {
547
601
  private refreshInFlight?;
548
602
  private readonly defaultRuntimeBackend?;
549
603
  private readonly runtime;
604
+ private readonly workspaceImages;
550
605
  /**
551
606
  * A profile the runtime has cached (create-time priming), letting turns
552
607
  * send `backend.profileSha256` instead of re-shipping the profile's static
@@ -589,6 +644,8 @@ declare class SandboxInstance {
589
644
  get gpuLease(): GpuLease | undefined;
590
645
  /** Web terminal URL for browser-based access */
591
646
  get url(): string | undefined;
647
+ /** Build and publish this sandbox's workspace without exposing registry credentials to it. */
648
+ get images(): WorkspaceImages;
592
649
  /**
593
650
  * The 12-phase startup breakdown (storage_provision, host_select, edge_bind,
594
651
  * edge_ready, egress_proxy, docker_pull/create/start, sidecar_boot,
@@ -1739,4 +1796,4 @@ declare class SandboxInstance {
1739
1796
  }): Promise<DurablePlan>;
1740
1797
  }
1741
1798
  //#endregion
1742
- export { CONTROL_PLANE_MCP_SERVER_NAME as C, SandboxMcpServerEntry as D, SandboxMcpEndpoint as E, buildControlPlaneMcpConfig as O, BuildSandboxMcpConfigOptions as S, SandboxMcpConfig as T, InteractiveSessionStatus as _, TraceExportSink as a, StartInteractiveOptions as b, otelTraceIdForTangleTrace as c, SandboxSession as d, InteractiveAttachOptions as f, InteractiveSessionInfo as g, InteractiveSessionHost as h, TraceExportResult as i, buildSandboxMcpConfig as k, toOtelJson as l, InteractiveSessionHandle as m, SandboxInstance as n, buildTraceExportPayload as o, InteractiveAuthFile as p, TraceExportFormat as r, exportTraceBundle as s, HttpClient as t, SandboxTaskSession as u, InterruptResult as v, SANDBOX_MCP_SERVER_NAME as w, BuildControlPlaneMcpConfigOptions as x, RespondToPermissionOptions as y };
1799
+ export { SandboxMcpEndpoint as A, RespondToPermissionOptions as C, CONTROL_PLANE_MCP_SERVER_NAME as D, BuildSandboxMcpConfigOptions as E, buildControlPlaneMcpConfig as M, buildSandboxMcpConfig as N, SANDBOX_MCP_SERVER_NAME as O, InterruptResult as S, BuildControlPlaneMcpConfigOptions as T, InteractiveAuthFile as _, WorkspaceImagePublishResult as a, InteractiveSessionInfo as b, TraceExportResult as c, exportTraceBundle as d, otelTraceIdForTangleTrace as f, InteractiveAttachOptions as g, SandboxSession as h, WorkspaceImagePublishRequestOptions as i, SandboxMcpServerEntry as j, SandboxMcpConfig as k, TraceExportSink as l, SandboxTaskSession as m, SandboxInstance as n, WorkspaceImages as o, toOtelJson as p, WorkspaceImagePublishInput as r, TraceExportFormat as s, HttpClient as t, buildTraceExportPayload as u, InteractiveSessionHandle as v, StartInteractiveOptions as w, InteractiveSessionStatus as x, InteractiveSessionHost as y };
@@ -1,2 +1,2 @@
1
- import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-Cz9btKSu.js";
1
+ import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-BX6k9wtw.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
@@ -1,2 +1,2 @@
1
- import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-B74oCU6n.js";
1
+ import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-DMWhe-Uc.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
@@ -1,5 +1,5 @@
1
- import { p as parseErrorResponse } from "./errors-hbpL_-S6.js";
2
- import { n as createSandboxInstanceFromResponse } from "./sandbox-_XxypYz0.js";
1
+ import { p as parseErrorResponse } from "./errors-D9fFOWX9.js";
2
+ import { n as createSandboxInstanceFromResponse } from "./sandbox-CZRF0EZ3.js";
3
3
  //#region src/tangle/abi.ts
4
4
  /**
5
5
  * Tangle Contract ABI Definitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "0.11.1-develop.20260723131320.f0c1459",
3
+ "version": "0.11.1-develop.20260723133806.2c3f22f",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",