@tangle-network/sandbox 0.60.85 → 0.60.86

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.
Files changed (36) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +3 -3
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/{agent-run-outcome-t4YB-M3R.d.ts → agent-run-outcome-CIlpTZNU.d.ts} +1 -1
  5. package/dist/auth/index.d.ts +1 -1
  6. package/dist/auth/index.js +4 -4
  7. package/dist/{browser-interactive-control-controller-rpTbyvAS.d.ts → browser-interactive-control-controller-Cu6J3TUP.d.ts} +1 -1
  8. package/dist/{client-8qpE2rDI.d.ts → client-CUxfURSp.d.ts} +13 -12
  9. package/dist/{client-DM4i5RSw.js → client-D9OomGmE.js} +16 -15
  10. package/dist/collaboration/index.d.ts +1 -1
  11. package/dist/collaboration/index.js +1 -1
  12. package/dist/{collaboration-DaJU5O0E.js → collaboration-YxqL5cZY.js} +4 -4
  13. package/dist/core.d.ts +6 -6
  14. package/dist/core.js +2 -2
  15. package/dist/{errors-DtQPTnqm.d.ts → errors-B7i6lxHc.d.ts} +3 -3
  16. package/dist/{index-DZ27pdB8.d.ts → index-7_-RzCh9.d.ts} +1 -1
  17. package/dist/{index-CrOKqIcs.d.ts → index-BFW3FzJG.d.ts} +4 -5
  18. package/dist/{index-DO7GVpk_.d.ts → index-Vr-2tNP3.d.ts} +1 -1
  19. package/dist/index.d.ts +16 -15
  20. package/dist/index.js +8 -8
  21. package/dist/interactive-control.d.ts +1 -1
  22. package/dist/{interactive-controller-CJ24g8Va.js → interactive-controller-CPtHnjrz.js} +65 -21
  23. package/dist/{lines-EGmJbdDU.d.ts → lines-DosoSbnD.d.ts} +1 -1
  24. package/dist/lines.d.ts +1 -1
  25. package/dist/{managed-process-C4hYjOOD.d.ts → managed-process-CP-geV3k.d.ts} +1 -1
  26. package/dist/{preview-HePhtWQw.d.ts → preview-B-h5p2LF.d.ts} +3 -3
  27. package/dist/runtime.d.ts +6 -6
  28. package/dist/runtime.js +4 -4
  29. package/dist/{sandbox-AeLQuwb4.d.ts → sandbox-Bcs4w1RE.d.ts} +5 -8
  30. package/dist/{sandbox-BcCe13Ws.js → sandbox-DyoFguBU.js} +133 -125
  31. package/dist/tangle/index.d.ts +1 -1
  32. package/dist/tangle/index.js +1 -1
  33. package/dist/{tangle-CoNOTxcu.js → tangle-yvuD9HP_.js} +33 -32
  34. package/dist/{terminal-stream-jdYomM1m.d.ts → terminal-stream-BANlVD4Q.d.ts} +1 -2
  35. package/dist/{types-Zl7vIatu.d.ts → types-H3SX7E33.d.ts} +23 -2
  36. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
- import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-AeLQuwb4.js";
2
- import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, ai as SandboxFleetParent, ca as SessionInfo, d as BackendConfig, k as CodeResultPart, ua as SessionListOptions, xo as BackendType } from "../types-Zl7vIatu.js";
3
- import { i as Sandbox } from "../client-8qpE2rDI.js";
4
- import { u as PreviewAuthorizer } from "../preview-HePhtWQw.js";
1
+ import { g as SandboxSession, m as SandboxTaskSession, n as SandboxInstance } from "../sandbox-Bcs4w1RE.js";
2
+ import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, So as BackendType, d as BackendConfig, da as SessionListOptions, k as CodeResultPart, la as SessionInfo, oi as SandboxFleetParent } from "../types-H3SX7E33.js";
3
+ import { i as Sandbox } from "../client-CUxfURSp.js";
4
+ import { u as PreviewAuthorizer } from "../preview-B-h5p2LF.js";
5
5
  import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
6
6
  import { JSONSchema } from "zod/v4/core";
7
7
  import { ToolSet } from "ai";
@@ -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-DjryqUiY.js";
2
- import { D as assertCurrentBackendType } from "../interactive-controller-CJ24g8Va.js";
2
+ import { D as assertCurrentBackendType } from "../interactive-controller-CPtHnjrz.js";
3
3
  import { _ as StateError, b as ValidationError, d as NotFoundError } from "../errors-DSJBKmGZ.js";
4
- import { n as Sandbox } from "../client-DM4i5RSw.js";
5
- import { t as SandboxInstance } from "../sandbox-BcCe13Ws.js";
4
+ import { n as Sandbox } from "../client-D9OomGmE.js";
5
+ import { t as SandboxInstance } from "../sandbox-DyoFguBU.js";
6
6
  import { z } from "zod";
7
7
  //#region src/agent/instances.ts
8
8
  const managers = /* @__PURE__ */ new WeakMap();
@@ -1,2 +1,2 @@
1
- import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-HePhtWQw.js";
1
+ import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-B-h5p2LF.js";
2
2
  export { AgentPreviewError, AgentPreviewOptions, PREVIEW_MCP_ALIAS, PREVIEW_TOOLS, PreviewAuthorizationRequest, PreviewAuthorizer, PreviewExecutionContext, PreviewTool, PublishAgentPreviewOptions, assertPreviewId, ensureAgentPreview, getAgentPreview, listAgentPreviews, previewOperationTool, previewToolsForProfile, publishAgentPreview, removeAgentPreview, resolveSelfSandbox, servePreviewMcp };
@@ -1,4 +1,4 @@
1
- import { Br as SandboxEvent, a as AgentQuestionRequest, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation, ut as DurablePlanSnapshot } from "./types-Zl7vIatu.js";
1
+ import { Vr as SandboxEvent, a as AgentQuestionRequest, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation, ut as DurablePlanSnapshot } from "./types-H3SX7E33.js";
2
2
  import { InteractionRequest } from "@tangle-network/agent-interface";
3
3
 
4
4
  //#region src/agent-run-outcome.d.ts
@@ -1,3 +1,3 @@
1
1
  import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema, t as CliAuthReference } from "../cli-auth-bundle-ODe06Ts7.js";
2
- import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-DO7GVpk_.js";
2
+ import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-Vr-2tNP3.js";
3
3
  export { AnyTokenPayload, BatchScopedTokenPayload, CliAuthReference, CollaborationAccess, CollaborationTokenPayload, IssueCollaborationTokenOptions, ProductTokenIssuer, ProjectScopedTokenPayload, ReadTokenPayload, SessionScopedTokenPayload, TokenScope, assertCliAuthReferenceSupported, cliAuthReferenceSchema, getTokenTTL, isTokenExpiringSoon, issueBatchScopedToken, issueCollaborationToken, issueProjectScopedToken, issueReadToken, issueSessionScopedToken, materializeCliAuthBundle, unsafeDecodeToken, verifyToken };
@@ -258,11 +258,11 @@ function isTokenExpiringSoon(payload, bufferSeconds = 60) {
258
258
  */
259
259
  var ProductTokenIssuer = class {
260
260
  productId;
261
- signingSecret;
261
+ #signingSecret;
262
262
  ttlMinutes;
263
263
  constructor(config) {
264
264
  this.productId = config.productId;
265
- this.signingSecret = config.signingSecret;
265
+ this.#signingSecret = config.signingSecret;
266
266
  this.ttlMinutes = {
267
267
  free: config.ttlMinutes?.free ?? 15,
268
268
  pro: config.ttlMinutes?.pro ?? 240,
@@ -275,7 +275,7 @@ var ProductTokenIssuer = class {
275
275
  issue(params) {
276
276
  const tier = params.tier ?? "free";
277
277
  const ttl = this.ttlMinutes[tier] ?? this.ttlMinutes.free;
278
- const token = issueReadToken(this.signingSecret, {
278
+ const token = issueReadToken(this.#signingSecret, {
279
279
  sub: params.userId,
280
280
  sid: params.sessionId,
281
281
  pid: this.productId,
@@ -294,7 +294,7 @@ var ProductTokenIssuer = class {
294
294
  issueCollaboration(params) {
295
295
  const tier = params.tier ?? "free";
296
296
  const ttl = this.ttlMinutes[tier] ?? this.ttlMinutes.free;
297
- const token = issueCollaborationToken(this.signingSecret, {
297
+ const token = issueCollaborationToken(this.#signingSecret, {
298
298
  userId: params.userId,
299
299
  sessionId: params.sessionId,
300
300
  productId: this.productId,
@@ -1,4 +1,4 @@
1
- import { o as TerminalStreamHandlers } from "./terminal-stream-jdYomM1m.js";
1
+ import { o as TerminalStreamHandlers } from "./terminal-stream-BANlVD4Q.js";
2
2
  import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionStatus } from "@tangle-network/agent-interface";
3
3
  import { AgentInteractiveSessionControlClaim as AgentInteractiveSessionControlClaim$1, AgentInteractiveSessionControlClaimRequest as AgentInteractiveSessionControlClaimRequest$1, AgentInteractiveSessionRef as AgentInteractiveSessionRef$1 } from "@tangle-network/agent-interface/environment-interactive-control";
4
4
 
@@ -1,8 +1,8 @@
1
- import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance } from "./sandbox-AeLQuwb4.js";
2
- import { B as CreateSandboxOptions, Ba as TokenRefreshHandler, Bt as FleetDispatchResultBuffer, En as IntelligenceReportCompareTo, F as CreateIntelligenceReportOptions, Ft as FleetAgentId, G as DeleteMatchingSandboxesFilter, Gr as SandboxFleetCostEstimate, Gt as FleetExecDispatchOptions, Ht as FleetDispatchStreamOptions, I as CreateRequestOptions, Ii as SandboxShapesInfo, Jr as SandboxFleetDriverCapability, Jt as FleetPromptDispatchOptions, K as DeleteMatchingSandboxesOptions, Kt as FleetExecDispatchResult, L as CreateSandboxFleetOptions, Lt as FleetAgentResult, M as ConversationTurnOptions, Mn as ListSandboxFleetOptions, N as ConversationTurnResult, Nn as ListSandboxOptions, Nr as SandboxConfig, On as IntelligenceReportWindow, Qi as SecretsManager, R as CreateSandboxFleetTokenOptions, Sn as HttpClient, Tn as IntelligenceReportBudget, Ur as SandboxFleetArtifact, Ut as FleetDriveTurnOutcome, Vr as SandboxFleetAgent, Vt as FleetDispatchResultBufferOptions, Wr as SandboxFleetArtifactSpec, Wt as FleetDriveTurnRequest, Xr as SandboxFleetInfo, Xt as FleetRunEvent, Yt as FleetPromptDispatchResult, Zt as FleetRunOptions, _i as SandboxFleetWorkspaceReconcileResult, _r as ReapExpiredSandboxFleetsOptions, ai as SandboxFleetParent, ar as PromptInputPart, b as BatchRunRequest, bi as SandboxIdentity, br as ReconcileSandboxFleetsResult, bt as ExecOptions, d as BackendConfig, di as SandboxFleetTraceBundle, ei as SandboxFleetMachineRecord, eo as SdkTimingHook, go as BatchEvent, gr as PublishPublicTemplateVersionOptions, hi as SandboxFleetUsage, hr as PublishPublicTemplateOptions, ii as SandboxFleetOperationsSummary, ji as SandboxRunGeneration, ka as SubscriptionInfo, l as AttachSandboxFleetMachineOptions, li as SandboxFleetSpend, mi as SandboxFleetTraceOptions, mr as PublicTemplateVersionInfo, ni as SandboxFleetManifest, or as PromptOptions, pr as PublicTemplateInfo, q as DeleteMatchingSandboxesResult, qa as UsageInfo, qr as SandboxFleetDispatchResponse, qt as FleetMachineId, si as SandboxFleetPolicy, sr as PromptResult, ti as SandboxFleetMachineSpec, ui as SandboxFleetToken, v as BatchResult, vi as SandboxFleetWorkspaceRestoreResult, vr as ReapExpiredSandboxFleetsResult, wa as SshKeysManager, wn as IntelligenceReport, xi as SandboxInfo, xt as ExecResult, y as BatchRunOptions, yi as SandboxFleetWorkspaceSnapshotResult, yr as ReconcileSandboxFleetsOptions, z as CreateSandboxFleetWithCoordinatorOptions, zr as SandboxEnvironment, zt as FleetDispatchCancelResult } from "./types-Zl7vIatu.js";
3
- import { d as MintInteractiveSessionTokenOptions, p as ScopedToken } from "./terminal-stream-jdYomM1m.js";
4
- import { h as SandboxError } from "./errors-DtQPTnqm.js";
5
- import { L as LinesClient } from "./lines-EGmJbdDU.js";
1
+ import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance } from "./sandbox-Bcs4w1RE.js";
2
+ import { $i as SecretsManager, Aa as SubscriptionInfo, B as CreateSandboxOptions, Br as SandboxEnvironment, Bt as FleetDispatchResultBuffer, En as IntelligenceReportCompareTo, F as CreateIntelligenceReportOptions, Ft as FleetAgentId, G as DeleteMatchingSandboxesFilter, Gr as SandboxFleetArtifactSpec, Gt as FleetExecDispatchOptions, Hr as SandboxFleetAgent, Ht as FleetDispatchStreamOptions, I as CreateRequestOptions, Ja as UsageInfo, Jr as SandboxFleetDispatchResponse, Jt as FleetPromptDispatchOptions, K as DeleteMatchingSandboxesOptions, Kr as SandboxFleetCostEstimate, Kt as FleetExecDispatchResult, L as CreateSandboxFleetOptions, Li as SandboxShapesInfo, Lt as FleetAgentResult, M as ConversationTurnOptions, Mi as SandboxRunGeneration, Mn as ListSandboxFleetOptions, N as ConversationTurnResult, Nn as ListSandboxOptions, On as IntelligenceReportWindow, Pr as SandboxConfig, R as CreateSandboxFleetTokenOptions, Si as SandboxInfo, Sn as HttpClient, Ta as SshKeysManager, Tn as IntelligenceReportBudget, Ut as FleetDriveTurnOutcome, Va as TokenRefreshHandler, Vt as FleetDispatchResultBufferOptions, Wr as SandboxFleetArtifact, Wt as FleetDriveTurnRequest, Xt as FleetRunEvent, Yr as SandboxFleetDriverCapability, Yt as FleetPromptDispatchResult, Zr as SandboxFleetInfo, Zt as FleetRunOptions, _o as BatchEvent, _r as ReapExpiredSandboxFleetsOptions, ai as SandboxFleetOperationsSummary, ar as PromptInputPart, b as BatchRunRequest, bi as SandboxFleetWorkspaceSnapshotResult, br as ReconcileSandboxFleetsResult, bt as ExecOptions, ci as SandboxFleetPolicy, d as BackendConfig, di as SandboxFleetToken, fi as SandboxFleetTraceBundle, gi as SandboxFleetUsage, gr as PublishPublicTemplateVersionOptions, hi as SandboxFleetTraceOptions, hr as PublishPublicTemplateOptions, l as AttachSandboxFleetMachineOptions, mr as PublicTemplateVersionInfo, ni as SandboxFleetMachineSpec, oi as SandboxFleetParent, or as PromptOptions, pr as PublicTemplateInfo, q as DeleteMatchingSandboxesResult, qt as FleetMachineId, ri as SandboxFleetManifest, sr as PromptResult, ti as SandboxFleetMachineRecord, to as SdkTimingHook, ui as SandboxFleetSpend, v as BatchResult, vi as SandboxFleetWorkspaceReconcileResult, vr as ReapExpiredSandboxFleetsResult, wn as IntelligenceReport, xi as SandboxIdentity, xt as ExecResult, y as BatchRunOptions, yi as SandboxFleetWorkspaceRestoreResult, yr as ReconcileSandboxFleetsOptions, z as CreateSandboxFleetWithCoordinatorOptions, zt as FleetDispatchCancelResult } from "./types-H3SX7E33.js";
3
+ import { d as MintInteractiveSessionTokenOptions, p as ScopedToken } from "./terminal-stream-BANlVD4Q.js";
4
+ import { h as SandboxError } from "./errors-B7i6lxHc.js";
5
+ import { L as LinesClient } from "./lines-DosoSbnD.js";
6
6
  import { z } from "zod";
7
7
  import { AgentInteractiveSessionRef, AgentProfile } from "@tangle-network/agent-interface";
8
8
 
@@ -149,6 +149,12 @@ interface ParseSSEStreamOptions {
149
149
  * should keep the default `throw`; output streams may opt into recovery.
150
150
  */
151
151
  invalidEvent?: "throw" | "warn-and-skip";
152
+ /**
153
+ * The longest silence the stream may keep, read before each chunk read;
154
+ * see `@tangle-network/sse-core`. A longer one throws
155
+ * `SSEStreamSilentError`.
156
+ */
157
+ idleMs?: () => number | undefined;
152
158
  }
153
159
  /**
154
160
  * Parse a streaming SSE response body into an async iterable of
@@ -317,13 +323,8 @@ declare class SandboxFleet {
317
323
  private sandboxFor;
318
324
  }
319
325
  declare class SandboxFleetClient {
326
+ #private;
320
327
  private readonly client;
321
- /**
322
- * Budgeted keys of the capped fleets this client created, by fleet id. A
323
- * key's secret exists only here; a child fleet under a capped parent is
324
- * minted with the parent's key, so it must be created by this client.
325
- */
326
- private readonly fleetKeys;
327
328
  constructor(client: FleetClientHost);
328
329
  /** Mint the key a capped fleet's sandboxes charge, under `issuerKey`. */
329
330
  private mintFleetKey;
@@ -660,9 +661,9 @@ interface SessionBroadcastResult {
660
661
  //#endregion
661
662
  //#region src/client.d.ts
662
663
  declare class Sandbox implements HttpClient, ScopedTokenHttpClient {
664
+ #private;
663
665
  private readonly baseUrl;
664
666
  private readonly platformUrl;
665
- private readonly apiKey;
666
667
  private readonly timeoutMs;
667
668
  private readonly trustLocalCliAuth;
668
669
  /** Receives the SDK's timing spans; see `SandboxConfig.onTiming`. */
@@ -1,8 +1,8 @@
1
1
  import { r as backendTypeSchema } from "./backend-types-D6bYbvMB.js";
2
- import { A as normalizeRuntimeBackendConfig, C as encodePromptForWire, D as assertCurrentBackendType, E as applyRequestedModel, N as withProfileHarness, O as foldModelRoutingFields, T as parseSSEStream, c as requestInteractiveSessionToken } from "./interactive-controller-CJ24g8Va.js";
2
+ import { A as normalizeRuntimeBackendConfig, C as encodePromptForWire, D as assertCurrentBackendType, E as applyRequestedModel, N as withProfileHarness, O as foldModelRoutingFields, P as withoutCreateOnlyModelFields, T as parseSSEStream, c as requestInteractiveSessionToken } from "./interactive-controller-CPtHnjrz.js";
3
3
  import { C as readResponseJson, S as parseResponseError, b as ValidationError, d as NotFoundError, f as PartialFailureError, g as ServerError, h as SandboxError, l as NON_RETRYABLE_CREATE_QUOTA_REASONS, p as QuotaError, s as GpuProviderNotConfiguredError, t as AuthError, u as NetworkError, x as parseErrorResponse, y as TimeoutError } from "./errors-DSJBKmGZ.js";
4
4
  import { f as combineAbortSignals } from "./browser-interactive-control-controller-BJf0P_J4.js";
5
- import { A as rewrapResponse, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, N as exportTraceBundle, O as normalizeConnection, T as splitInlineProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, j as fetchWithKeepAlive, k as normalizeSandboxShape, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof } from "./sandbox-BcCe13Ws.js";
5
+ import { A as rewrapResponse, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, N as exportTraceBundle, O as normalizeConnection, T as splitInlineProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, j as fetchWithKeepAlive, k as normalizeSandboxShape, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof } from "./sandbox-DyoFguBU.js";
6
6
  import { LinesClient } from "./lines.js";
7
7
  import { z } from "zod";
8
8
  import { agentProfileSchema } from "@tangle-network/agent-interface";
@@ -2036,9 +2036,10 @@ var SandboxFleetClient = class {
2036
2036
  /**
2037
2037
  * Budgeted keys of the capped fleets this client created, by fleet id. A
2038
2038
  * key's secret exists only here; a child fleet under a capped parent is
2039
- * minted with the parent's key, so it must be created by this client.
2039
+ * minted with the parent's key, so it must be created by this client. An ES
2040
+ * private field, so the keys never print with the client.
2040
2041
  */
2041
- fleetKeys = /* @__PURE__ */ new Map();
2042
+ #fleetKeys = /* @__PURE__ */ new Map();
2042
2043
  constructor(client) {
2043
2044
  this.client = client;
2044
2045
  }
@@ -2072,7 +2073,7 @@ var SandboxFleetClient = class {
2072
2073
  * would spend outside the cap, so it is refused.
2073
2074
  */
2074
2075
  hostFor(fleetId) {
2075
- const key = this.fleetKeys.get(fleetId);
2076
+ const key = this.#fleetKeys.get(fleetId);
2076
2077
  if (!key) throw new ValidationError(`Fleet ${fleetId} is capped; drive its agents from the client that created it, so every charge counts against the cap`, { fleet: "key_unavailable" });
2077
2078
  return this.client.withApiKey(key.key);
2078
2079
  }
@@ -2236,7 +2237,7 @@ var SandboxFleetClient = class {
2236
2237
  }
2237
2238
  let fleetKey;
2238
2239
  const capUsd = options.budgetUsd;
2239
- const parentKey = options.parent ? this.fleetKeys.get(options.parent.fleetId) : void 0;
2240
+ const parentKey = options.parent ? this.#fleetKeys.get(options.parent.fleetId) : void 0;
2240
2241
  if (options.parent && !parentKey) {
2241
2242
  const parentFleet = await this.getServerFleet(options.parent.fleetId);
2242
2243
  if (await this.budgetKeyIdOf(parentFleet) !== void 0) throw new ValidationError(`Parent fleet ${options.parent.fleetId} has a budget; create its child fleets with the client that created it`, { parent: "key_unavailable" });
@@ -2284,7 +2285,7 @@ var SandboxFleetClient = class {
2284
2285
  }
2285
2286
  throw err;
2286
2287
  }
2287
- if (fleetKey) this.fleetKeys.set(fleetId, fleetKey);
2288
+ if (fleetKey) this.#fleetKeys.set(fleetId, fleetKey);
2288
2289
  return this.fromInfo({
2289
2290
  fleetId,
2290
2291
  machines: created,
@@ -3409,7 +3410,7 @@ const PRODUCTION_BASE_URL = "https://sandbox.tangle.tools";
3409
3410
  var Sandbox = class Sandbox {
3410
3411
  baseUrl;
3411
3412
  platformUrl;
3412
- apiKey;
3413
+ #apiKey;
3413
3414
  timeoutMs;
3414
3415
  trustLocalCliAuth;
3415
3416
  /** Receives the SDK's timing spans; see `SandboxConfig.onTiming`. */
@@ -3427,7 +3428,7 @@ var Sandbox = class Sandbox {
3427
3428
  this.baseUrl = config.baseUrl.replace(/\/$/, "");
3428
3429
  const platformUrl = config.platformUrl ?? (this.baseUrl === PRODUCTION_BASE_URL ? DEFAULT_PLATFORM_URL : void 0);
3429
3430
  this.platformUrl = platformUrl?.replace(/\/+$/, "");
3430
- this.apiKey = config.apiKey;
3431
+ this.#apiKey = config.apiKey;
3431
3432
  this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
3432
3433
  this.trustLocalCliAuth = config.trustLocalCliAuth === true;
3433
3434
  this.onTiming = config.onTiming;
@@ -3490,7 +3491,7 @@ var Sandbox = class Sandbox {
3490
3491
  return this._intelligence;
3491
3492
  }
3492
3493
  getApiKey() {
3493
- return this.apiKey;
3494
+ return this.#apiKey;
3494
3495
  }
3495
3496
  /** The Sandbox API this client talks to, without a trailing slash. */
3496
3497
  getBaseUrl() {
@@ -3511,7 +3512,7 @@ var Sandbox = class Sandbox {
3511
3512
  async platformFetch(path, options) {
3512
3513
  if (!this.platformUrl) throw new ValidationError("platformUrl is required for Platform calls when baseUrl is not https://sandbox.tangle.tools", { platformUrl: "required" });
3513
3514
  const headers = new Headers(options?.headers);
3514
- if (!headers.has("Authorization")) headers.set("Authorization", `Bearer ${this.apiKey}`);
3515
+ if (!headers.has("Authorization")) headers.set("Authorization", `Bearer ${this.#apiKey}`);
3515
3516
  return fetch(`${this.platformUrl}${path}`, {
3516
3517
  ...options,
3517
3518
  headers,
@@ -3617,7 +3618,7 @@ var Sandbox = class Sandbox {
3617
3618
  }
3618
3619
  async create(inputOptions, requestOptions) {
3619
3620
  let options = inputOptions;
3620
- normalizeRuntimeBackendConfig(options?.backend);
3621
+ normalizeRuntimeBackendConfig(options?.backend, { allowRouting: true });
3621
3622
  if (options?.backend) options = {
3622
3623
  ...options,
3623
3624
  backend: foldModelRoutingFields(options.backend)
@@ -3827,7 +3828,7 @@ var Sandbox = class Sandbox {
3827
3828
  idempotencyKey,
3828
3829
  createReceipt: info.createReceipt ?? null
3829
3830
  });
3830
- const instance = createSandboxInstanceFromResponse(this, info, handleBackend, data);
3831
+ const instance = createSandboxInstanceFromResponse(this, info, withoutCreateOnlyModelFields(handleBackend), data);
3831
3832
  if (instance.status === "provisioning" || instance.status === "pending") {
3832
3833
  const remainingMs = Math.max(0, deadline - Date.now());
3833
3834
  try {
@@ -4227,7 +4228,7 @@ var Sandbox = class Sandbox {
4227
4228
  response = await globalThis.fetch(url, {
4228
4229
  method: "POST",
4229
4230
  headers: {
4230
- Authorization: `Bearer ${this.apiKey}`,
4231
+ Authorization: `Bearer ${this.#apiKey}`,
4231
4232
  "Content-Type": "application/json",
4232
4233
  Accept: "text/event-stream",
4233
4234
  ...parsedIdempotencyKey?.success ? { "Idempotency-Key": parsedIdempotencyKey.data } : {}
@@ -4289,7 +4290,7 @@ var Sandbox = class Sandbox {
4289
4290
  let bodyOwnsTimeout = false;
4290
4291
  try {
4291
4292
  const headers = new Headers(options?.headers);
4292
- headers.set("Authorization", `Bearer ${this.apiKey}`);
4293
+ headers.set("Authorization", `Bearer ${this.#apiKey}`);
4293
4294
  const isFormDataBody = typeof FormData !== "undefined" && options?.body instanceof FormData;
4294
4295
  if (!headers.has("Content-Type") && !isFormDataBody) headers.set("Content-Type", "application/json");
4295
4296
  const response = await fetchWithKeepAlive(url, {
@@ -1,2 +1,2 @@
1
- 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-DZ27pdB8.js";
1
+ 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-7_-RzCh9.js";
2
2
  export { CollaborationBootstrapRequest, CollaborationBootstrapResponse, CollaborationClient, CollaborationClientConfig, CollaborationDocumentAdapter, CollaborationDocumentChange, CollaborationDocumentRef, CollaborationFileBridge, CollaborationFileBridgeOptions, CollaborationFileEvent, CollaborationPermissions, CollaborationTokenRefreshRequest, CollaborationTokenRefreshResponse, CollaborationTransportConfig, SaveCollaborationSnapshotRequest, SaveCollaborationSnapshotResponse, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
@@ -1,2 +1,2 @@
1
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-DaJU5O0E.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-YxqL5cZY.js";
2
2
  export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
@@ -8,12 +8,12 @@ var CollaborationClient = class {
8
8
  baseUrl;
9
9
  timeoutMs;
10
10
  fetchImpl;
11
- headers;
11
+ #headers;
12
12
  constructor(config) {
13
13
  this.baseUrl = normalizeBaseUrl(config.baseUrl);
14
14
  this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
15
15
  this.fetchImpl = config.fetch ?? globalThis.fetch.bind(globalThis);
16
- this.headers = config.headers;
16
+ this.#headers = config.headers;
17
17
  }
18
18
  async bootstrap(request) {
19
19
  return this.requestJson("/api/collaboration/bootstrap", {
@@ -61,8 +61,8 @@ var CollaborationClient = class {
61
61
  }
62
62
  }
63
63
  async resolveHeaders() {
64
- if (typeof this.headers === "function") return this.headers();
65
- return this.headers;
64
+ if (typeof this.#headers === "function") return this.#headers();
65
+ return this.#headers;
66
66
  }
67
67
  };
68
68
  //#endregion
package/dist/core.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as ProfileFileDeliveryReport, a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-AeLQuwb4.js";
2
- import { B as CreateSandboxOptions, Bn as ManagedProcessState, Fn as ManagedProcessJobs, In as ManagedProcessOptions, Jn as PreviewLinkInfo, Li as SandboxStatus, Ln as ManagedProcessRecord, M as ConversationTurnOptions, N as ConversationTurnResult, Nr as SandboxConfig, Rn as ManagedProcessResumeOptions, Un as NetworkConfig, Xn as PreviewLinkWaitOptions, Yn as PreviewLinkManager, ar as PromptInputPart, bt as ExecOptions, fa as SessionMessageAdmission, io as SandboxEnvRecoveryView, ro as SandboxEnvRecovery, xi as SandboxInfo, xt as ExecResult, zn as ManagedProcessSpec } from "./types-Zl7vIatu.js";
3
- import { C as ValidationError, S as TimeoutError, _ as SandboxFailureDetail, d as NotFoundError, f as PartialFailureError, g as SandboxErrorJson, h as SandboxError, o as FileWriteConflictError, p as QuotaError, r as CapabilityError, t as AuthError, u as NetworkError, v as ServerError, y as StateError } from "./errors-DtQPTnqm.js";
4
- import { A as LineSendReceipt, B as lineInstanceKey, C as LineReplyCode, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, J as LineApplicationView, K as LineApplicationResult, L as LinesClient, M as LineSenderVerificationStart, S as LineReminderPreferences, U as LINE_APPLICATION_REQUEST_MAX_BYTES, V as profileChannelReference, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, a as LineApplicationAttachOptions, b as LineNumberInventory, c as LineAttachmentReauthorization, d as LineImage, f as LineInstanceAttachOptions, g as LineMemberInstance, h as LineMember, j as LineSenderVerification, k as LineSendInput, l as LineExecutionKey, n as LineAgentRolePolicy, p as LineInstanceCreate, q as LineApplicationState, s as LineAttachment, t as Line, w as LineReplyCodeInput, x as LineProvider } from "./lines-EGmJbdDU.js";
5
- import { A as BackendRegistryEntry, C as InstancesClient, F as backendRegistryInteractionKindSchema, I as backendRegistryResponseSchema, L as isBackendRegistryInteractionKind, M as BackendRegistryResponse, N as backendRegistryCapabilitiesSchema, P as backendRegistryEntrySchema, R as parseBackendRegistryResponse, _ as EnsureInstanceOptions, b as InstanceRecord, i as Sandbox, j as BackendRegistryInteractionKind, k as BackendRegistryCapabilities, v as HostedInstance, x as InstanceRestartingError, y as InstanceProfile, z as parseBackendRegistryResponseBody } from "./client-8qpE2rDI.js";
6
- import { t as ManagedProcessClient } from "./managed-process-C4hYjOOD.js";
1
+ import { _ as ProfileFileDeliveryReport, a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-Bcs4w1RE.js";
2
+ import { B as CreateSandboxOptions, Bn as ManagedProcessState, Fn as ManagedProcessJobs, In as ManagedProcessOptions, Jn as PreviewLinkInfo, Ln as ManagedProcessRecord, M as ConversationTurnOptions, N as ConversationTurnResult, Pr as SandboxConfig, Ri as SandboxStatus, Rn as ManagedProcessResumeOptions, Si as SandboxInfo, Un as NetworkConfig, Xn as PreviewLinkWaitOptions, Yn as PreviewLinkManager, ao as SandboxEnvRecoveryView, ar as PromptInputPart, bt as ExecOptions, io as SandboxEnvRecovery, pa as SessionMessageAdmission, xt as ExecResult, zn as ManagedProcessSpec } from "./types-H3SX7E33.js";
3
+ import { C as ValidationError, S as TimeoutError, _ as SandboxFailureDetail, d as NotFoundError, f as PartialFailureError, g as SandboxErrorJson, h as SandboxError, o as FileWriteConflictError, p as QuotaError, r as CapabilityError, t as AuthError, u as NetworkError, v as ServerError, y as StateError } from "./errors-B7i6lxHc.js";
4
+ import { A as LineSendReceipt, B as lineInstanceKey, C as LineReplyCode, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, J as LineApplicationView, K as LineApplicationResult, L as LinesClient, M as LineSenderVerificationStart, S as LineReminderPreferences, U as LINE_APPLICATION_REQUEST_MAX_BYTES, V as profileChannelReference, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, a as LineApplicationAttachOptions, b as LineNumberInventory, c as LineAttachmentReauthorization, d as LineImage, f as LineInstanceAttachOptions, g as LineMemberInstance, h as LineMember, j as LineSenderVerification, k as LineSendInput, l as LineExecutionKey, n as LineAgentRolePolicy, p as LineInstanceCreate, q as LineApplicationState, s as LineAttachment, t as Line, w as LineReplyCodeInput, x as LineProvider } from "./lines-DosoSbnD.js";
5
+ import { A as BackendRegistryEntry, C as InstancesClient, F as backendRegistryInteractionKindSchema, I as backendRegistryResponseSchema, L as isBackendRegistryInteractionKind, M as BackendRegistryResponse, N as backendRegistryCapabilitiesSchema, P as backendRegistryEntrySchema, R as parseBackendRegistryResponse, _ as EnsureInstanceOptions, b as InstanceRecord, i as Sandbox, j as BackendRegistryInteractionKind, k as BackendRegistryCapabilities, v as HostedInstance, x as InstanceRestartingError, y as InstanceProfile, z as parseBackendRegistryResponseBody } from "./client-CUxfURSp.js";
6
+ import { t as ManagedProcessClient } from "./managed-process-CP-geV3k.js";
7
7
 
8
8
  //#region src/core.d.ts
9
9
  /** Local SDK protocol support only, not a deployed-host readiness assertion.
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ as StateError, b as ValidationError, d as NotFoundError, f as PartialFailureError, g as ServerError, h as SandboxError, o as FileWriteConflictError, p as QuotaError, r as CapabilityError, t as AuthError, u as NetworkError, y as TimeoutError } from "./errors-DSJBKmGZ.js";
2
- import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-DM4i5RSw.js";
3
- import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-BcCe13Ws.js";
2
+ import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-D9OomGmE.js";
3
+ import { C as ManagedProcessClient, o as WorkspaceImages, t as SandboxInstance } from "./sandbox-DyoFguBU.js";
4
4
  import { LinesClient, lineInstanceKey, profileChannelReference } from "./lines.js";
5
5
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-Cq6dJLBD.js";
6
6
  //#region src/core.ts
@@ -1,6 +1,6 @@
1
- import { no as SandboxCreateReceipt } from "./types-Zl7vIatu.js";
2
- import { c as TerminalStreamReconnectAuthority, n as TerminalStream, p as ScopedToken } from "./terminal-stream-jdYomM1m.js";
3
- import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, f as InteractiveAttachOptions, h as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-rpTbyvAS.js";
1
+ import { ro as SandboxCreateReceipt } from "./types-H3SX7E33.js";
2
+ import { c as TerminalStreamReconnectAuthority, n as TerminalStream, p as ScopedToken } from "./terminal-stream-BANlVD4Q.js";
3
+ import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, f as InteractiveAttachOptions, h as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-Cu6J3TUP.js";
4
4
  import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
5
5
 
6
6
  //#region src/interactive-controller.d.ts
@@ -91,10 +91,10 @@ interface CollaborationClientConfig {
91
91
  //#endregion
92
92
  //#region src/collaboration/client.d.ts
93
93
  declare class CollaborationClient {
94
+ #private;
94
95
  private readonly baseUrl;
95
96
  private readonly timeoutMs;
96
97
  private readonly fetchImpl;
97
- private readonly headers?;
98
98
  constructor(config: CollaborationClientConfig);
99
99
  bootstrap(request: CollaborationBootstrapRequest): Promise<CollaborationBootstrapResponse>;
100
100
  refreshToken(request: CollaborationTokenRefreshRequest): Promise<CollaborationTokenRefreshResponse>;
@@ -1,5 +1,5 @@
1
- import { n as SandboxInstance } from "./sandbox-AeLQuwb4.js";
2
- import { B as CreateSandboxOptions, Sn as HttpClient } from "./types-Zl7vIatu.js";
1
+ import { n as SandboxInstance } from "./sandbox-Bcs4w1RE.js";
2
+ import { B as CreateSandboxOptions, Sn as HttpClient } from "./types-H3SX7E33.js";
3
3
 
4
4
  //#region src/tangle/abi.d.ts
5
5
  /**
@@ -354,10 +354,9 @@ interface TangleSandboxClientConfig {
354
354
  //#endregion
355
355
  //#region src/tangle/client.d.ts
356
356
  declare class TangleSandboxClient implements HttpClient {
357
+ #private;
357
358
  private readonly chain;
358
- private readonly sandboxes;
359
359
  private readonly operatorApiUrl?;
360
- private readonly operatorApiToken?;
361
360
  private operatorSession;
362
361
  constructor(config: TangleSandboxClientConfig);
363
362
  /**
@@ -473,7 +472,7 @@ declare class OperatorSessionError extends Error {
473
472
  * the caller retries with a fresh session on 401.
474
473
  */
475
474
  declare class OperatorSession {
476
- private readonly token;
475
+ #private;
477
476
  private readonly address;
478
477
  private readonly expiresAtMs;
479
478
  private constructor();
@@ -172,8 +172,8 @@ declare function isTokenExpiringSoon(payload: AnyTokenPayload, bufferSeconds?: n
172
172
  * Use this in your backend to issue read tokens for WebSocket connections.
173
173
  */
174
174
  declare class ProductTokenIssuer {
175
+ #private;
175
176
  private readonly productId;
176
- private readonly signingSecret;
177
177
  private readonly ttlMinutes;
178
178
  constructor(config: {
179
179
  productId: string;