@tangle-network/sandbox 0.60.78-develop.20261024105952.0f18c1e → 0.60.78-develop.20261024130805.7e6bc5d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-HvudS75t.js";
1
+ import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-OlfnNs7A.js";
2
2
  import { Di as CodeResultPart, Ei as CodeExecutionResult, Ha as CodeLanguage, Ti as CodeExecutionOptions, bn as SandboxFleetParent, vo as BackendType, xa as BackendConfig, xt as SessionListOptions, yt as SessionInfo } from "../types-Dal-kCMH.js";
3
- import { t as Sandbox } from "../client-CBGuaj7J.js";
4
- import { u as PreviewAuthorizer } from "../preview-B-KyEQle.js";
3
+ import { t as Sandbox } from "../client-DLd0YCcK.js";
4
+ import { u as PreviewAuthorizer } from "../preview-MU5AbbbZ.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-CjcoVT7f.js";
2
2
  import { D as assertCurrentBackendType } from "../interactive-controller-DLrI-UvT.js";
3
3
  import { S as StateError, T as ValidationError, h as NotFoundError } from "../errors-CfQHPcLX.js";
4
- import { t as Sandbox } from "../client-C5ode0Xi.js";
5
- import { t as SandboxInstance } from "../sandbox-bIH2qdvI.js";
4
+ import { t as Sandbox } from "../client-DwTEoQ8Q.js";
5
+ import { t as SandboxInstance } from "../sandbox-eHrem1Ut.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-B-KyEQle.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-MU5AbbbZ.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 { A as TraceExportResult, H as MaterializeProfileFileMountsOptions, O as SandboxInstance, U as MaterializeProfileFileMountsResult, W as ProfileFileMountBox, j as TraceExportSink } from "./index-HvudS75t.js";
1
+ import { A as TraceExportResult, H as MaterializeProfileFileMountsOptions, O as SandboxInstance, U as MaterializeProfileFileMountsResult, W as ProfileFileMountBox, j as TraceExportSink } from "./index-OlfnNs7A.js";
2
2
  import { F as SandboxError, c as MintInteractiveSessionTokenOptions, u as ScopedToken } from "./terminal-stream-types-BTqOP3Zi.js";
3
3
  import { $n as TeeAttestationReport, $t as ReapExpiredSandboxFleetsResult, A as SandboxIdentity, Ai as ManagedProcessRecord, An as SandboxFleetUsage, Bt as FleetDispatchCancelResult, En as SandboxFleetTraceBundle, Fn as ListSandboxOptions, Ft as CreateSandboxFleetWithCoordinatorOptions, Gt as FleetExecDispatchResult, Hn as SandboxRunGeneration, Ht as FleetDispatchResultBufferOptions, Ia as GpuLeaseProviderName, Ii as SdkTimingHook, It as FleetAgentId, Jt as FleetPromptDispatchResult, Ki as BatchRunOptions, Kt as FleetMachineId, M as UsageInfo, Mi as ManagedProcessSpec, Mn as SandboxFleetWorkspaceReconcileResult, Mt as AttachSandboxFleetMachineOptions, Nn as SandboxFleetWorkspaceRestoreResult, Nt as CreateSandboxFleetOptions, Oi as ManagedProcessJobs, Pi as HttpClient, Pn as SandboxFleetWorkspaceSnapshotResult, Pt as CreateSandboxFleetTokenOptions, Qt as ReapExpiredSandboxFleetsOptions, Rt as FleetAgentResult, Sn as SandboxFleetPolicy, T as SshKeysManager, Tn as SandboxFleetToken, Ut as FleetDispatchStreamOptions, Vt as FleetDispatchResultBuffer, Wt as FleetExecDispatchOptions, X as FleetDriveTurnRequest, Xt as FleetRunOptions, Y as FleetDriveTurnOutcome, Yt as FleetRunEvent, Z as TokenRefreshHandler, Zi as CreateIntelligenceReportOptions, Zt as ListSandboxFleetOptions, _n as SandboxFleetManifest, a as DeleteMatchingSandboxesResult, aa as IntelligenceReportBudget, an as SandboxFleetArtifactSpec, ar as CreateSandboxOptions, bn as SandboxFleetParent, ca as IntelligenceReportWindow, cn as SandboxFleetDispatchResponse, cr as SandboxShapesInfo, da as PromptResult, dn as SandboxFleetInfo, do as PublicBatchRunRequestInput, ei as ExecOptions, en as ReconcileSandboxFleetsOptions, er as TeeAttestationResponse, fa as SandboxEvent, fr as SandboxShapePreset, gn as SandboxFleetMachineSpec, hn as SandboxFleetMachineRecord, i as DeleteMatchingSandboxesOptions, ia as IntelligenceReport, in as SandboxFleetArtifact, ir as CreateRequestOptions, j as SubscriptionInfo, ji as ManagedProcessResumeOptions, ki as ManagedProcessOptions, kn as SandboxFleetTraceOptions, la as PromptInputPart, ln as SandboxFleetDriverCapability, nn as SandboxFleetAgent, nt as ConversationTurnResult, oa as IntelligenceReportCompareTo, oi as SandboxEnvironment, on as SandboxFleetCostEstimate, or as SandboxConfig, pn as SandboxFleetMachine, po as BatchEvent, qt as FleetPromptDispatchOptions, r as DeleteMatchingSandboxesFilter, so as BatchResult, sr as SandboxResources, ti as ExecResult, tn as ReconcileSandboxFleetsResult, tt as ConversationTurnOptions, ua as PromptOptions, uo as PublicBatchRunRequest, w as SecretsManager, wn as SandboxFleetSpend, xa as BackendConfig, ya as TurnBackendConfig, yn as SandboxFleetOperationsSummary, zn as SandboxInfo } from "./types-Dal-kCMH.js";
4
4
  import { t as LinesClient } from "./lines-DwApng9S.js";
@@ -3,7 +3,7 @@ import { A as normalizeRuntimeBackendConfig, C as encodePromptForWire, D as asse
3
3
  import { T as ValidationError, a as AuthError, b as SandboxError, d as GpuProviderNotConfiguredError, g as PartialFailureError, h as NotFoundError, i as readResponseJson, m as NetworkError, n as parseErrorResponse, p as NON_RETRYABLE_CREATE_QUOTA_REASONS, r as parseResponseError, v as QuotaError, w as TimeoutError, x as ServerError } from "./errors-CfQHPcLX.js";
4
4
  import { f as combineAbortSignals } from "./browser-interactive-control-controller-k1KkqDGF.js";
5
5
  import { n as fetchWithKeepAlive } from "./keep-alive-fetch-BOEM_9nC.js";
6
- import { A as normalizeSandboxCreateReceipt, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeSandboxShape, I as rewrapResponse, M as parseStopPhase, N as normalizeConnection, O as isRetryableProfileFileMaterializeFailure, P as normalizeEgressPolicyFields, T as splitInlineProfileFileMounts, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle } from "./sandbox-bIH2qdvI.js";
6
+ import { A as normalizeSandboxCreateReceipt, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeSandboxShape, I as rewrapResponse, M as parseStopPhase, N as normalizeConnection, O as isRetryableProfileFileMaterializeFailure, P as normalizeEgressPolicyFields, T as splitInlineProfileFileMounts, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle } from "./sandbox-eHrem1Ut.js";
7
7
  import { t as LinesClient } from "./lines-DBaAhcFv.js";
8
8
  import { PublicTemplatesClient } from "./public-templates.js";
9
9
  import { z } from "zod";
package/dist/core.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryReport, z as WorkspaceImagePublishRequestOptions } from "./index-HvudS75t.js";
1
+ import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryReport, z as WorkspaceImagePublishRequestOptions } from "./index-OlfnNs7A.js";
2
2
  import { A as NotFoundError, F as SandboxError, H as TimeoutError, I as SandboxErrorJson, L as SandboxFailureDetail, M as ProfileFileMountPathError, N as QuotaError, R as ServerError, S as CapabilityError, T as FileWriteConflictError, U as ValidationError, b as AuthError, j as PartialFailureError, k as NetworkError, z as StateError } from "./terminal-stream-types-BTqOP3Zi.js";
3
3
  import { Ai as ManagedProcessRecord, Ba as WorkspaceImagePublishInput, Ct as SessionMessageAdmission, H as PreviewLinkInfo, Ja as SandboxEnvRecoveryView, Mi as ManagedProcessSpec, Ni as ManagedProcessState, Oi as ManagedProcessJobs, U as PreviewLinkManager, Va as WorkspaceImagePublishResult, W as PreviewLinkWaitOptions, _r as NetworkConfig, ar as CreateSandboxOptions, ei as ExecOptions, ji as ManagedProcessResumeOptions, ki as ManagedProcessOptions, la as PromptInputPart, lr as SandboxStatus, nt as ConversationTurnResult, or as SandboxConfig, qa as SandboxEnvRecovery, ti as ExecResult, tt as ConversationTurnOptions, zn as SandboxInfo } from "./types-Dal-kCMH.js";
4
4
  import { D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, I as LineSenderVerificationStart, J as LineApplicationView, K as LineApplicationResult, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, T as LineProvider, U as LINE_APPLICATION_REQUEST_MAX_BYTES, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, _ as LineInstanceCreate, a as Line, b as LineMemberInstance, d as LineAttachment, f as LineAttachmentReauthorization, g as LineInstanceAttachOptions, h as LineImage, i as profileChannelReference, l as LineApplicationAttachOptions, o as LineAgentRolePolicy, p as LineExecutionKey, q as LineApplicationState, r as lineInstanceKey, t as LinesClient, w as LineNumberInventory, y as LineMember } from "./lines-DwApng9S.js";
5
- import { Ct as InstancesClient, _t as EnsureInstanceOptions, an as BackendRegistryInteractionKind, bt as InstanceRecord, cn as backendRegistryEntrySchema, dn as isBackendRegistryInteractionKind, fn as parseBackendRegistryResponse, in as BackendRegistryEntry, it as ManagedProcessClient, ln as backendRegistryInteractionKindSchema, on as BackendRegistryResponse, pn as parseBackendRegistryResponseBody, rn as BackendRegistryCapabilities, sn as backendRegistryCapabilitiesSchema, t as Sandbox, un as backendRegistryResponseSchema, vt as HostedInstance, xt as InstanceRestartingError, yt as InstanceProfile } from "./client-CBGuaj7J.js";
5
+ import { Ct as InstancesClient, _t as EnsureInstanceOptions, an as BackendRegistryInteractionKind, bt as InstanceRecord, cn as backendRegistryEntrySchema, dn as isBackendRegistryInteractionKind, fn as parseBackendRegistryResponse, in as BackendRegistryEntry, it as ManagedProcessClient, ln as backendRegistryInteractionKindSchema, on as BackendRegistryResponse, pn as parseBackendRegistryResponseBody, rn as BackendRegistryCapabilities, sn as backendRegistryCapabilitiesSchema, t as Sandbox, un as backendRegistryResponseSchema, vt as HostedInstance, xt as InstanceRestartingError, yt as InstanceProfile } from "./client-DLd0YCcK.js";
6
6
  import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-CqQWFYZG.js";
7
7
 
8
8
  //#region src/core.d.ts
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { S as StateError, T as ValidationError, _ as ProfileFileMountPathError, a as AuthError, b as SandboxError, g as PartialFailureError, h as NotFoundError, m as NetworkError, s as CapabilityError, u as FileWriteConflictError, v as QuotaError, w as TimeoutError, x as ServerError } from "./errors-CfQHPcLX.js";
2
- import { _ as parseBackendRegistryResponse, a as InstancesClient, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, m as backendRegistryInteractionKindSchema, p as backendRegistryEntrySchema, r as HostedInstance, t as Sandbox, v as parseBackendRegistryResponseBody } from "./client-C5ode0Xi.js";
3
- import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-bIH2qdvI.js";
2
+ import { _ as parseBackendRegistryResponse, a as InstancesClient, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, m as backendRegistryInteractionKindSchema, p as backendRegistryEntrySchema, r as HostedInstance, t as Sandbox, v as parseBackendRegistryResponseBody } from "./client-DwTEoQ8Q.js";
3
+ import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-eHrem1Ut.js";
4
4
  import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-DBaAhcFv.js";
5
5
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
6
6
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-CHcIY0uD.js";
@@ -647,8 +647,9 @@ declare abstract class SandboxInfoCapabilities {
647
647
  * the transport `/agents/profiles` rides and the box surface mount
648
648
  * delivery uses for profile-bundle cache claim/publish.
649
649
  */
650
- runtimeFetch(path: string, options?: RequestInit, fetchOptions?: {
650
+ runtimeFetch(path: string, inputOptions?: RequestInit, fetchOptions?: {
651
651
  timeoutMs?: number;
652
+ skipProfileReference?: boolean;
652
653
  }): Promise<Response>;
653
654
  /**
654
655
  * Parse a sandbox API payload into `SandboxInfo`.
@@ -1302,6 +1303,10 @@ declare abstract class SandboxProfileCapabilities extends SandboxFileWriteCapabi
1302
1303
  * to the runtime (`POST /agents/profiles`) and record
1303
1304
  * the returned transport-profile hash via {@link attachProfileReference}, so subsequent turns
1304
1305
  * reference it by `profileSha256` instead of re-sending the corpus.
1306
+ * Set `preserveManagedProfile` to cache the entire profile through bounded
1307
+ * requests. Its managed files stay in the private native revision; this mode
1308
+ * never writes them into the shared workspace. Preparation and dispatch then
1309
+ * reference the same full profile. Runtime grants are never cached.
1305
1310
  * `create()` calls this automatically for its inline profile when
1306
1311
  * `autoDeferProfile` is on; call it directly when the profile only exists
1307
1312
  * per-turn, or when the instance was fetched rather than created. Persist
@@ -1310,7 +1315,9 @@ declare abstract class SandboxProfileCapabilities extends SandboxFileWriteCapabi
1310
1315
  * failure — the caller decides whether that is fatal (it is not: turns fall
1311
1316
  * back to sending the file-free profile inline).
1312
1317
  */
1313
- primeProfile(profile: object): Promise<string>;
1318
+ primeProfile(profile: object, options?: {
1319
+ preserveManagedProfile?: boolean;
1320
+ }): Promise<string>;
1314
1321
  /**
1315
1322
  * Build the run request's `backend` body. When the outgoing profile's CONTENT
1316
1323
  * matches the one the runtime already holds (and we are not resending after a
@@ -1329,6 +1336,8 @@ declare abstract class SandboxProfileCapabilities extends SandboxFileWriteCapabi
1329
1336
  /** @internal Shared create/turn delivery; caller policy decides how to expose failures. */
1330
1337
  materializeProfileFiles(profile: AgentProfile, signal?: AbortSignal, existingFiles?: "replace" | "allow-identical"): Promise<AgentProfile>;
1331
1338
  protected buildRunBackendBody(overrideBackend: Partial<BackendConfig> | undefined, forceFullProfile: boolean, requestedModel?: string, signal?: AbortSignal, preserveManagedProfile?: boolean): Promise<Record<string, unknown> | undefined>;
1339
+ /** Recover only managed references before any stream event or model admission. */
1340
+ protected reprimeManagedRunProfile(options: PromptOptions): Promise<boolean>;
1332
1341
  /**
1333
1342
  * Create a snapshot of the sandbox state.
1334
1343
  * Snapshots can be used to save workspace state for later restoration.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as SandboxInteractionResult, A as TraceExportResult, At as buildControlPlaneMcpConfig, B as WorkspaceImages, Ct as BuildControlPlaneMcpConfigOptions, D as ForkAcknowledgement, Dt as SandboxMcpConfig, Et as SANDBOX_MCP_SERVER_NAME, F as toOtelJson, G as SplitInlineProfileFileMountsResult, H as MaterializeProfileFileMountsOptions, I as SandboxTaskSession, J as splitInlineProfileSkills, K as SplitInlineProfileSkillsResult, L as RawEvidenceExport, M as buildTraceExportPayload, N as exportTraceBundle, O as SandboxInstance, Ot as SandboxMcpEndpoint, P as otelTraceIdForTangleTrace, Q as SandboxInteractionResolution, R as SandboxSession, St as SandboxOperationFailedError, Tt as CONTROL_PLANE_MCP_SERVER_NAME, U as MaterializeProfileFileMountsResult, V as ProfileFileDeliveryReport, X as SandboxInteractionCommandResult, Y as validateDeferredProfileFileMounts, Z as SandboxInteractionConflict, _t as InteractiveTerminalFrameLog, at as InteractiveSessionHandleOptions, bt as createInteractiveTerminalSession, ct as InteractiveSessionInfo, dt as InteractiveSessionStartResult, et as AgentInteractiveTerminalSession, ft as InteractiveStopCommand, gt as InteractiveTerminalCapture, h as TangleSandboxClient, ht as agentInteractiveSessionPromptRequestDigest, it as InteractiveSessionHandle, j as TraceExportSink, jt as buildSandboxMcpConfig, k as TraceExportFormat, kt as SandboxMcpServerEntry, lt as InteractiveSessionRef, mt as RespondToPermissionOptions, nt as InteractivePromptCommand, ot as InteractiveSessionHost, pt as InterruptResult, q as splitInlineProfileFileMounts, rt as InteractiveSessionControlClaim, st as InteractiveSessionIncarnationId, tt as InteractiveControlClaimRequest, ut as InteractiveSessionStartOptions, v as TangleSandboxClientConfig, vt as InteractiveTerminalMetadata, wt as BuildSandboxMcpConfigOptions, xt as SandboxOperation, yt as createInteractiveTerminalCapture, z as WorkspaceImagePublishRequestOptions } from "./index-HvudS75t.js";
1
+ import { $ as SandboxInteractionResult, A as TraceExportResult, At as buildControlPlaneMcpConfig, B as WorkspaceImages, Ct as BuildControlPlaneMcpConfigOptions, D as ForkAcknowledgement, Dt as SandboxMcpConfig, Et as SANDBOX_MCP_SERVER_NAME, F as toOtelJson, G as SplitInlineProfileFileMountsResult, H as MaterializeProfileFileMountsOptions, I as SandboxTaskSession, J as splitInlineProfileSkills, K as SplitInlineProfileSkillsResult, L as RawEvidenceExport, M as buildTraceExportPayload, N as exportTraceBundle, O as SandboxInstance, Ot as SandboxMcpEndpoint, P as otelTraceIdForTangleTrace, Q as SandboxInteractionResolution, R as SandboxSession, St as SandboxOperationFailedError, Tt as CONTROL_PLANE_MCP_SERVER_NAME, U as MaterializeProfileFileMountsResult, V as ProfileFileDeliveryReport, X as SandboxInteractionCommandResult, Y as validateDeferredProfileFileMounts, Z as SandboxInteractionConflict, _t as InteractiveTerminalFrameLog, at as InteractiveSessionHandleOptions, bt as createInteractiveTerminalSession, ct as InteractiveSessionInfo, dt as InteractiveSessionStartResult, et as AgentInteractiveTerminalSession, ft as InteractiveStopCommand, gt as InteractiveTerminalCapture, h as TangleSandboxClient, ht as agentInteractiveSessionPromptRequestDigest, it as InteractiveSessionHandle, j as TraceExportSink, jt as buildSandboxMcpConfig, k as TraceExportFormat, kt as SandboxMcpServerEntry, lt as InteractiveSessionRef, mt as RespondToPermissionOptions, nt as InteractivePromptCommand, ot as InteractiveSessionHost, pt as InterruptResult, q as splitInlineProfileFileMounts, rt as InteractiveSessionControlClaim, st as InteractiveSessionIncarnationId, tt as InteractiveControlClaimRequest, ut as InteractiveSessionStartOptions, v as TangleSandboxClientConfig, vt as InteractiveTerminalMetadata, wt as BuildSandboxMcpConfigOptions, xt as SandboxOperation, yt as createInteractiveTerminalCapture, z as WorkspaceImagePublishRequestOptions } from "./index-OlfnNs7A.js";
2
2
  import { A as NotFoundError, B as StreamInterruptedError, C as EdgeNotReadyError, D as GpuProviderRequirement, E as GpuProviderNotConfiguredError, F as SandboxError, G as SandboxCreateReceipt, H as TimeoutError, I as SandboxErrorJson, L as SandboxFailureDetail, M as ProfileFileMountPathError, N as QuotaError, O as KeyBudgetExhaustedError, P as ResumeEnvRequiredError, R as ServerError, S as CapabilityError, T as FileWriteConflictError, U as ValidationError, V as StreamInterruptionReason, W as SandboxCreateOutcome, _ as TerminalReadyTimings, a as TerminalStreamOptions, b as AuthError, c as MintInteractiveSessionTokenOptions, d as ScopedTokenScope, f as TERMINAL_WS_ECHO_SUBPROTOCOL, g as TerminalReadyInfo, h as TerminalOutputMessage, i as TerminalStreamHandlers, j as PartialFailureError, k as NetworkError, l as MintScopedTokenOptions, m as TerminalInteractiveSessionIdentity, n as TerminalStreamApiKey, p as TerminalExitInfo, r as TerminalStreamBearerToken, s as TerminalStreamToken, t as TerminalAttachTimings, u as ScopedToken, v as TerminalStreamAuthFormat, w as EgressProxyRecoveryError, x as BranchFanoutExceedsHostError, y as TerminalStreamError, z as StateError } from "./terminal-stream-types-BTqOP3Zi.js";
3
3
  import { $ as CompletedTurnPayload, $a as RawEvidenceBoxDirectoryExport, $i as DurablePlanDecisionOptions, $n as TeeAttestationReport, $r as SearchOptions, $t as ReapExpiredSandboxFleetsResult, A as SandboxIdentity, Aa as RolloutChildResult, Ai as ManagedProcessRecord, An as SandboxFleetUsage, Ar as DownloadResult, At as TaskSessionProfile, B as ProcessSignal, Ba as WorkspaceImagePublishInput, Bi as ForkLookupOptions, Bn as SandboxPortBinding, Br as FileTreeResult, Bt as FleetDispatchCancelResult, C as WorkspaceOperationLookup, Ca as BackendManager, Ci as HostAgentRuntimeBackend, Cn as SandboxFleetProfileRef, Cr as GitAuth, Ct as SessionMessageAdmission, D as ProvisionResult, Da as McpServerConfig, Dn as SandboxFleetTraceEvent, Dr as DeleteOptions, Dt as TaskSessionCommitResult, E as ProvisionEvent, Ea as BackendStatus, En as SandboxFleetTraceBundle, Er as ChunkedUploadResult, Et as TaskSessionChanges, F as EnsureDevServerOptions, Fa as GPU_LEASE_PROVIDER_NAMES, Fn as ListSandboxOptions, Fr as FileReadResult, Ft as CreateSandboxFleetWithCoordinatorOptions, G as GitBranch, Ga as ProcessStatus, Gi as BatchBackend, Gn as SandboxTerminalCreateOptions, Gr as MkdirOptions, H as PreviewLinkInfo, Hi as RolloutOptions, Hn as SandboxRunGeneration, Hr as FileUsageResult, Ht as FleetDispatchResultBufferOptions, I as ExactProcessSpawnOptions, Ia as GpuLeaseProviderName, In as SSHCommandDescriptor, Ir as FileRenameResult, It as FleetAgentId, J as GitStatus, Ja as SandboxEnvRecoveryView, Jn as SandboxTerminalRequestOptions, Jr as UploadProgress, Jt as FleetPromptDispatchResult, K as GitCommit, Ka as SessionStatus, Ki as BatchRunOptions, Kn as SandboxTerminalInfo, Kr as RenameOptions, Kt as FleetMachineId, L as Process, La as GpuLeaseProviderState, Li as BranchOptions, Ln as SSHCredentials, Lr as FileSystem, Lt as FleetAgentPlacement, M as UsageInfo, Ma as RolloutStatus, Mi as ManagedProcessSpec, Mn as SandboxFleetWorkspaceReconcileResult, Mr as FileReadBatchOptions, Mt as AttachSandboxFleetMachineOptions, N as WaitForOptions, Na as RolloutTurnPart, Ni as ManagedProcessState, Nn as SandboxFleetWorkspaceRestoreResult, Nr as FileReadBatchResult, Nt as CreateSandboxFleetOptions, O as ProvisionStep, Oa as RouterRoutingOptions, Oi as ManagedProcessJobs, On as SandboxFleetTraceExport, Or as DownloadOptions, Ot as TaskSessionFileChange, P as DevServerInfo, Pa as ProvisionStatus, Pn as SandboxFleetWorkspaceSnapshotResult, Pr as FileReadError, Q as CommitTaskSessionOptions, Qa as RawEvidenceBoxArchiveManifest, Qi as DurablePlan, Qn as TeeAttestationOptions, Qr as SearchMatch, Qt as ReapExpiredSandboxFleetsOptions, R as ProcessLogEntry, Ra as GpuLeaseProviderStatus, Ri as ForkCounts, Rn as SandboxConnection, Rr as FileTreeFile, Rt as FleetAgentResult, S as StopOptions, Sa as BackendInfo, Si as HostAgentDriverConfig, Sn as SandboxFleetPolicy, So as parseBackendType, Sr as MAX_EGRESS_DENIALS_LIMIT, St as SessionMessage, Ta as BackendRuntimeConfigUpdate, Tn as SandboxFleetToken, Tr as ChunkedUploadOptions, Tt as SessionResultOptions, U as PreviewLinkManager, Ua as ProcessInfo, Ui as RolloutStartResult, Un as SandboxRuntimeHealth, Ur as FileWriteResult, Ut as FleetDispatchStreamOptions, V as ProcessSpawnOptions, Va as WorkspaceImagePublishResult, Vi as Rollout, Vn as SandboxPortPreviewLink, Vr as FileUsageOptions, Vt as FleetDispatchResultBuffer, W as PreviewLinkWaitOptions, Wa as ProcessListOptions, Wi as WaitForRolloutOptions, Wn as SandboxTerminalAttachOptions, Wr as ListOptions, Wt as FleetExecDispatchOptions, X as FleetDriveTurnRequest, Xa as RawEvidenceArchiveManifest, Xn as StartupDiagnostics, Xr as WriteManyFile, Xt as FleetRunOptions, Y as FleetDriveTurnOutcome, Ya as NativeStoreHomeCopy, Yn as SandboxTerminals, Yr as WriteFileOptions, Yt as FleetRunEvent, Z as TokenRefreshHandler, Za as RawEvidenceArchiveManifestNative, Zi as CreateIntelligenceReportOptions, Zn as StartupOperation, Zr as WriteManyOptions, Zt as ListSandboxFleetOptions, _ as SnapshotInfo, _a as SandboxTraceOptions, _i as GpuLeaseExecOptions, _n as SandboxFleetManifest, _o as ALL_BACKEND_TYPES, _r as NetworkConfig, _t as SessionFailureReason, a as DeleteMatchingSandboxesResult, aa as IntelligenceReportBudget, ai as PublishPublicTemplateVersionOptions, an as SandboxFleetArtifactSpec, ao as RawEvidenceRecordsFile, ar as CreateSandboxOptions, at as DispatchPromptOptions, b as SnapshotRemoteSync, ba as BackendCapabilities, bi as GpuLeaseProviders, bn as SandboxFleetParent, bo as EffectiveBackendProfile, br as EgressPolicy, bt as SessionInterruptOptions, c as SandboxDeleteOptions, ca as IntelligenceReportWindow, ci as AttachGpuLeaseOptions, cn as SandboxFleetDispatchResponse, co as BatchTaskResult, cr as SandboxShapesInfo, ct as ListMessagesOptions, d as SandboxOperationKind, da as PromptResult, di as DriverConfig, dn as SandboxFleetInfo, do as PublicBatchRunRequestInput, dr as SandboxShape, dt as SendSessionMessageRequest, ea as DurablePlanDecisionResult, ei as ExecOptions, en as ReconcileSandboxFleetsOptions, eo as RawEvidenceBoxExportOptions, er as TeeAttestationResponse, et as CompletedTurnResult, f as SandboxOperationState, fa as SandboxEvent, fi as DriverInfo, fn as SandboxFleetIntelligenceEnvelope, fo as BatchBackendStats, fr as SandboxShapePreset, ft as SentSessionMessage, g as SnapshotIdempotency, ga as SandboxTraceExport, gi as GpuLeaseCommandResult, gn as SandboxFleetMachineSpec, go as BatchTaskUsage, gr as EgressManager, gt as SessionExecutionStatus, h as SnapshotDeleteOutcome, ha as SandboxTraceEvent, hi as GpuLeaseBilling, hn as SandboxFleetMachineRecord, ho as BatchSidecarGroup, hr as StorageConfig, ht as SessionExecutionInfo, i as DeleteMatchingSandboxesOptions, ia as IntelligenceReport, ii as PublishPublicTemplateOptions, in as SandboxFleetArtifact, io as RawEvidencePayloadFile, ir as CreateRequestOptions, it as CreateTaskSessionOptions, j as SubscriptionInfo, ja as RolloutScorer, ji as ManagedProcessResumeOptions, jn as SandboxFleetWorkspace, jr as FileInfo, jt as TurnDriveResult, ka as SecretInfo, ki as ManagedProcessOptions, kn as SandboxFleetTraceOptions, kr as DownloadProgress, kt as TaskSessionInfo, l as SandboxDeleteOutcome, la as PromptInputPart, li as CreateGpuLeaseOptions, ln as SandboxFleetDriverCapability, lo as BatchTaskInput, lr as SandboxStatus, lt as PublicProfileConflict, m as SnapshotDeleteAcknowledgement, ma as SandboxTraceBundle, mi as GpuLease, mn as SandboxFleetMachineMeteredUsage, mo as BatchEventDataMap, mr as SandboxRuntimeCapabilities, mt as SessionEventStreamOptions, n as DeleteMatchingSandboxResult, ni as PublicTemplateInfo, nn as SandboxFleetAgent, no as RawEvidenceExportOptions, nr as TeePublicKeyResponse, nt as ConversationTurnResult, oa as IntelligenceReportCompareTo, oi as SandboxEnvironment, on as SandboxFleetCostEstimate, or as SandboxConfig, ot as DispatchedSession, p as SandboxRemovalState, pa as SandboxIntelligenceEnvelope, pi as DriverType, pn as SandboxFleetMachine, po as BatchEvent, pr as SandboxResourceUsage, pt as SessionBackendCredentials, q as GitDiff, qa as SandboxEnvRecovery, qn as SandboxTerminalManager, qr as UploadOptions, qt as FleetPromptDispatchOptions, r as DeleteMatchingSandboxesFilter, ra as EventStreamOptions, ri as PublicTemplateVersionInfo, rn as SandboxFleetAgentSpec, ro as RawEvidenceNativeFile, rr as TerminalStream, rt as CreateSessionOptions, s as SandboxDeleteAcknowledgement, sa as IntelligenceReportSubjectType, si as AcceleratorKind, sn as SandboxFleetDispatchFailureClass, so as BatchResult, sr as SandboxResources, st as DriveTurnOptions, t as DeleteMatchingSandboxOutcome, ta as DurablePlanFollowUpResume, ti as ExecResult, tn as ReconcileSandboxFleetsResult, to as RawEvidenceDirectoryExport, tr as TeePublicKey, tt as ConversationTurnOptions, u as SandboxOperationInfo, ua as PromptOptions, ui as DockerDriverConfig, un as SandboxFleetDriverTimings, ur as SecretBinding, ut as SendSessionMessageOptions, v as SnapshotOptions, va as TokenUsage, vi as GpuLeaseExecResult, vn as SandboxFleetManifestMachine, vo as BackendType, vr as NetworkManager, vt as SessionForkOptions, w as SecretsManager, wa as BackendMcpServerStatus, wi as NonHostAgentDriverConfig, wn as SandboxFleetSpend, wr as GitConfig, wt as SessionMessageInputPart, x as SnapshotResult, xa as BackendConfig, xi as GpuLeaseProvidersOptions, xn as SandboxFleetPlacement, xo as EffectiveBackendSource, xr as EgressDenial, xt as SessionListOptions, ya as TurnBackendConfig, yi as GpuLeaseManager, yn as SandboxFleetOperationsSummary, yo as EffectiveBackend, yr as SandboxEgressUsage, yt as SessionInfo, z as ProcessManager, za as GpuLeaseStatus, zi as ForkIdempotency, zn as SandboxInfo, zr as FileTreeOptions, zt as FleetAgentRunStatus } from "./types-Dal-kCMH.js";
4
4
  import { A as LineRespondAgent, B as LineVoiceOptions, C as LineMessage, D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, I as LineSenderVerificationStart, J as LineApplicationView, K as LineApplicationResult, L as LineThread, M as LineRole, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, R as LineTransport, S as LineMemberSpec, T as LineProvider, U as LINE_APPLICATION_REQUEST_MAX_BYTES, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, _ as LineInstanceCreate, a as Line, b as LineMemberInstance, c as LineAllowanceSubject, d as LineAttachment, f as LineAttachmentReauthorization, g as LineInstanceAttachOptions, h as LineImage, i as profileChannelReference, j as LineRespondView, k as LineReplyGate, l as LineApplicationAttachOptions, m as LineFromConnectionInput, n as SandboxLines, o as LineAgentRolePolicy, p as LineExecutionKey, q as LineApplicationState, r as lineInstanceKey, s as LineAllowance, t as LinesClient, u as LineAttachOptions, v as LineLimits, w as LineNumberInventory, x as LineMemberPatch, y as LineMember, z as LineVoice } from "./lines-DwApng9S.js";
5
5
  import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as interactiveSessionIdentityDigest, f as InteractiveAttachOptions, g as InteractiveSessionStatus, h as InteractiveRequestOptions, i as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as InteractiveSessionNotRunningError, m as InteractiveControlClaimOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimAcknowledgement, r as browserInteractiveControlHolderId, s as InteractiveSessionControlTransport, t as BrowserInteractiveSessionControlController, u as createInteractiveControlHolderId } from "./browser-interactive-control-controller-DmuOTpD1.js";
6
6
  import { a as InteractiveSessionControllerOptions, i as InteractiveSessionController, n as BrowserInteractiveSessionControllerOptions, o as InteractiveSessionControllerTransport, r as InteractiveAttachRequest, t as BrowserInteractiveSessionController } from "./interactive-controller-CfD8S3S7.js";
7
- import { $ as SANDBOX_SIZE_PRESET_NAMES, $t as Team, A as RunsHttpClient, At as ImageBuilder, B as RunTangleRouterEvalMatrixInSandboxOptions, Bt as normalizeRuntimeBackendConfig, C as SessionBroadcastResult, Ct as InstancesClient, D as RunRecord, Dt as ImageBuildFetchClient, E as RunPlacementRecord, Et as ImageBuildClientConfig, F as RouterEvalMatrixSandboxBox, Ft as createConfidentialSandbox, G as TangleSearchProvider, Gt as startTeeAttestationHeartbeat, H as runTangleRouterEvalMatrixInSandbox, Ht as TeeAttestationHeartbeat, I as RouterEvalMatrixSandboxClient, It as generateAttestationNonce, J as buildTangleRouterSearchBackend, Jt as ParseSSEStreamOptions, K as buildTangleRouterEvalMatrixRequest, Kt as BuildProgressEvent, L as RouterEvalMatrixScenario, Lt as BatchResultAccumulator, M as RouterEvalMatrixCaseResult, Mt as ConfidentialSandboxResult, N as RouterEvalMatrixHarness, Nt as ConfidentialTeeType, O as RunWaitOptions, Ot as ImageBuildOptions, P as RouterEvalMatrixPayload, Pt as CreateConfidentialSandboxOptions, Q as SANDBOX_SIZE_PRESETS, Qt as InviteTeamMemberOptions, R as RouterEvalMatrixSuiteResponse, Rt as createBatchResultAccumulator, S as SessionBroadcastEvent, St as InstanceStart, T as RunPlacement, Tt as ImageBuildClient, U as RouterSearchConfig, Ut as TeeAttestationHeartbeatOptions, V as RunTangleRouterEvalMatrixInSandboxResult, Vt as requestedPublicProfileDigest, W as RouterSearchConfigOptions, Wt as TeeAttestationHeartbeatSample, X as fetchTangleRouterSearchConfig, Xt as parseSSEStream, Y as buildTangleRouterSearchProfile, Yt as ParsedSSEEvent, Z as DEFAULT_SANDBOX_SIZE, Zt as CreateTeamOptions, _ as AgentRunCancellationAcknowledgement, _t as EnsureInstanceOptions, a as AgentProfileCapabilities, an as BackendRegistryInteractionKind, at as MANAGE_SANDBOXES_PARAMETERS, b as Capability, bt as InstanceRecord, c as AgentProfileMcpServer, cn as backendRegistryEntrySchema, ct as ManageSandboxesTool, d as AgentProfilePrompt, dn as isBackendRegistryInteractionKind, dt as manageSandboxesInputSchema, en as TeamInvitation, et as SandboxSizePreset, f as AgentProfileResourceRef, fn as parseBackendRegistryResponse, ft as applySandboxEventText, g as AgentProfileValidationResult, gt as isToolBearingEvent, h as AgentProfileValidationIssue, ht as getSandboxEventText, i as AgentProfile, in as BackendRegistryEntry, it as ManagedProcessClient, j as RouterEvalMatrixAgentProfile, jt as generateDockerfile, k as RunsClient, kt as ImageBuildResult, l as AgentProfileModelHints, ln as backendRegistryInteractionKindSchema, lt as ManageSandboxesToolOptions, m as AgentProfileSecurityPolicy, mt as collectAgentResponseText, n as SandboxFleetClient, nn as IntelligenceClient, nt as sandboxResourcesForSize, o as AgentProfileConnection, on as BackendRegistryResponse, ot as MANAGE_SANDBOXES_TOOL_NAME, p as AgentProfileResources, pn as parseBackendRegistryResponseBody, pt as collectAgentFinalMessageText, q as buildTangleRouterResponsesWebSearchRequest, qt as ImageSpec, r as SandboxFleet, rn as BackendRegistryCapabilities, rt as materializeProfileFileMounts, s as AgentProfileFileMount, sn as backendRegistryCapabilitiesSchema, st as ManageSandboxesInput, t as Sandbox, tn as TeamMember, tt as resolveSandboxResources, u as AgentProfilePermissionValue, un as backendRegistryResponseSchema, ut as createManageSandboxesTool, v as AgentRunCancellationRequest, vt as HostedInstance, w as RunOptions, wt as Image, x as terminalUpgradeHeadersSupported, xt as InstanceRestartingError, y as AgentSubagentProfile, yt as InstanceProfile, z as RouterImportedRunResponse, zt as validateBatchRunRequest } from "./client-CBGuaj7J.js";
7
+ import { $ as SANDBOX_SIZE_PRESET_NAMES, $t as Team, A as RunsHttpClient, At as ImageBuilder, B as RunTangleRouterEvalMatrixInSandboxOptions, Bt as normalizeRuntimeBackendConfig, C as SessionBroadcastResult, Ct as InstancesClient, D as RunRecord, Dt as ImageBuildFetchClient, E as RunPlacementRecord, Et as ImageBuildClientConfig, F as RouterEvalMatrixSandboxBox, Ft as createConfidentialSandbox, G as TangleSearchProvider, Gt as startTeeAttestationHeartbeat, H as runTangleRouterEvalMatrixInSandbox, Ht as TeeAttestationHeartbeat, I as RouterEvalMatrixSandboxClient, It as generateAttestationNonce, J as buildTangleRouterSearchBackend, Jt as ParseSSEStreamOptions, K as buildTangleRouterEvalMatrixRequest, Kt as BuildProgressEvent, L as RouterEvalMatrixScenario, Lt as BatchResultAccumulator, M as RouterEvalMatrixCaseResult, Mt as ConfidentialSandboxResult, N as RouterEvalMatrixHarness, Nt as ConfidentialTeeType, O as RunWaitOptions, Ot as ImageBuildOptions, P as RouterEvalMatrixPayload, Pt as CreateConfidentialSandboxOptions, Q as SANDBOX_SIZE_PRESETS, Qt as InviteTeamMemberOptions, R as RouterEvalMatrixSuiteResponse, Rt as createBatchResultAccumulator, S as SessionBroadcastEvent, St as InstanceStart, T as RunPlacement, Tt as ImageBuildClient, U as RouterSearchConfig, Ut as TeeAttestationHeartbeatOptions, V as RunTangleRouterEvalMatrixInSandboxResult, Vt as requestedPublicProfileDigest, W as RouterSearchConfigOptions, Wt as TeeAttestationHeartbeatSample, X as fetchTangleRouterSearchConfig, Xt as parseSSEStream, Y as buildTangleRouterSearchProfile, Yt as ParsedSSEEvent, Z as DEFAULT_SANDBOX_SIZE, Zt as CreateTeamOptions, _ as AgentRunCancellationAcknowledgement, _t as EnsureInstanceOptions, a as AgentProfileCapabilities, an as BackendRegistryInteractionKind, at as MANAGE_SANDBOXES_PARAMETERS, b as Capability, bt as InstanceRecord, c as AgentProfileMcpServer, cn as backendRegistryEntrySchema, ct as ManageSandboxesTool, d as AgentProfilePrompt, dn as isBackendRegistryInteractionKind, dt as manageSandboxesInputSchema, en as TeamInvitation, et as SandboxSizePreset, f as AgentProfileResourceRef, fn as parseBackendRegistryResponse, ft as applySandboxEventText, g as AgentProfileValidationResult, gt as isToolBearingEvent, h as AgentProfileValidationIssue, ht as getSandboxEventText, i as AgentProfile, in as BackendRegistryEntry, it as ManagedProcessClient, j as RouterEvalMatrixAgentProfile, jt as generateDockerfile, k as RunsClient, kt as ImageBuildResult, l as AgentProfileModelHints, ln as backendRegistryInteractionKindSchema, lt as ManageSandboxesToolOptions, m as AgentProfileSecurityPolicy, mt as collectAgentResponseText, n as SandboxFleetClient, nn as IntelligenceClient, nt as sandboxResourcesForSize, o as AgentProfileConnection, on as BackendRegistryResponse, ot as MANAGE_SANDBOXES_TOOL_NAME, p as AgentProfileResources, pn as parseBackendRegistryResponseBody, pt as collectAgentFinalMessageText, q as buildTangleRouterResponsesWebSearchRequest, qt as ImageSpec, r as SandboxFleet, rn as BackendRegistryCapabilities, rt as materializeProfileFileMounts, s as AgentProfileFileMount, sn as backendRegistryCapabilitiesSchema, st as ManageSandboxesInput, t as Sandbox, tn as TeamMember, tt as resolveSandboxResources, u as AgentProfilePermissionValue, un as backendRegistryResponseSchema, ut as createManageSandboxesTool, v as AgentRunCancellationRequest, vt as HostedInstance, w as RunOptions, wt as Image, x as terminalUpgradeHeadersSupported, xt as InstanceRestartingError, y as AgentSubagentProfile, yt as InstanceProfile, z as RouterImportedRunResponse, zt as validateBatchRunRequest } from "./client-DLd0YCcK.js";
8
8
  import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, o as projectAgentTerminalRecord, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-B2GRLNiR.js";
9
9
  import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-DcEJnM4x.js";
10
10
  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-BMbJOPfn.js";
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { i as isolationPrincipalSchema, o as parseBackendType, r as backendTypeSchema, t as ALL_BACKEND_TYPES } from "./backend-types-CLvdSX8V.js";
2
2
  import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, b as parseSSEStream, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-DLrI-UvT.js";
3
3
  import { C as StreamInterruptedError, S as StateError, T as ValidationError, _ as ProfileFileMountPathError, a as AuthError, b as SandboxError, c as EdgeNotReadyError, d as GpuProviderNotConfiguredError, f as KeyBudgetExhaustedError, g as PartialFailureError, h as NotFoundError, l as EgressProxyRecoveryError, m as NetworkError, o as BranchFanoutExceedsHostError, s as CapabilityError, t as TerminalStreamError, u as FileWriteConflictError, v as QuotaError, w as TimeoutError, x as ServerError, y as ResumeEnvRequiredError } from "./errors-CfQHPcLX.js";
4
- import { _ as parseBackendRegistryResponse, a as InstancesClient, c as IntelligenceClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as RunsClient, o as SandboxFleetClient, p as backendRegistryEntrySchema, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-C5ode0Xi.js";
4
+ import { _ as parseBackendRegistryResponse, a as InstancesClient, c as IntelligenceClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as RunsClient, o as SandboxFleetClient, p as backendRegistryEntrySchema, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-DwTEoQ8Q.js";
5
5
  import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-k1KkqDGF.js";
6
- import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-bIH2qdvI.js";
6
+ import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-eHrem1Ut.js";
7
7
  import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-DBaAhcFv.js";
8
8
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
9
9
  import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CPU10E5p.js";
10
10
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-CHcIY0uD.js";
11
- import { s as TangleSandboxClient } from "./tangle-D9N-QTRs.js";
11
+ import { s as TangleSandboxClient } from "./tangle-BO79_pYa.js";
12
12
  import { z } from "zod";
13
13
  import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
14
14
  //#region src/confidential.ts
@@ -1,6 +1,6 @@
1
- import { O as SandboxInstance } from "./index-HvudS75t.js";
1
+ import { O as SandboxInstance } from "./index-OlfnNs7A.js";
2
2
  import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-Dal-kCMH.js";
3
- import { t as Sandbox } from "./client-CBGuaj7J.js";
3
+ import { t as Sandbox } from "./client-DLd0YCcK.js";
4
4
 
5
5
  //#region src/agent/preview-operations.d.ts
6
6
  type AgentPreviewOptions = Pick<EnsureDevServerOptions, "sessionId" | "cwd"> & {
@@ -133,6 +133,28 @@ function normalizeEgressPolicyFields(data) {
133
133
  };
134
134
  }
135
135
  //#endregion
136
+ //#region ../../../packages/runtime-contracts/dist/profile-cache.js
137
+ /**
138
+ * Wire contract for the content-addressed profile cache.
139
+ *
140
+ * A run turn may reference a previously-sent profile by `backend.profileSha256`
141
+ * instead of re-sending it. When the runtime does not hold that hash it replies
142
+ * with this error code (HTTP 409); the client resends the full profile. The
143
+ * code is shared here so the sidecar (which throws it) and the public SDK
144
+ * (which matches it to trigger the resend) cannot drift out of step.
145
+ */
146
+ const PROFILE_NOT_CACHED_CODE = "PROFILE_NOT_CACHED";
147
+ /** Full public profiles are staged privately; grants never belong in this cache. */
148
+ const PROFILE_IMPORT_MAX_BYTES = 8 * 1024 * 1024;
149
+ const PROFILE_IMPORT_PART_BYTES = 512 * 1024;
150
+ 2 * PROFILE_IMPORT_MAX_BYTES;
151
+ /** Returned by priming only when every session route accepts full-profile references. */
152
+ const MANAGED_PROFILE_TRANSPORT = "managed-profile-reference-v1";
153
+ /** Cache identity follows JSON wire semantics and RFC 8785 key ordering. */
154
+ function profileCacheSha256(profile) {
155
+ return canonicalCandidateDigest(JSON.parse(JSON.stringify(profile))).slice(7);
156
+ }
157
+ //#endregion
136
158
  //#region ../../../packages/runtime-contracts/dist/direct-read.js
137
159
  /**
138
160
  * Wire vocabulary the sandbox SDK and the sandbox API Worker share for the
@@ -384,6 +406,100 @@ var DirectReadRoute = class {
384
406
  }
385
407
  };
386
408
  //#endregion
409
+ //#region src/managed-profile-transport.ts
410
+ function rememberProfileReference(references, identity, reference) {
411
+ references.delete(identity);
412
+ references.set(identity, reference);
413
+ while (references.size > 64) {
414
+ const oldest = references.keys().next().value;
415
+ if (oldest === void 0) break;
416
+ references.delete(oldest);
417
+ }
418
+ }
419
+ /** Only this explicit pre-admission refusal permits a profile transport retry. */
420
+ async function responseNeedsProfileImport(response) {
421
+ if (response.status !== 409) return false;
422
+ try {
423
+ return (await response.clone().json()).error?.code === PROFILE_NOT_CACHED_CODE;
424
+ } catch {
425
+ return false;
426
+ }
427
+ }
428
+ /** Upload the public profile only. Runtime grants remain in the turn backend. */
429
+ async function primeManagedProfile(profile, fetchRuntime) {
430
+ const bytes = new TextEncoder().encode(canonicalCandidateJson(profile));
431
+ const sha256 = profileCacheSha256(profile);
432
+ if (bytes.length > 8388608) throw new ValidationError("Managed profile exceeds the profile import bound");
433
+ const post = async (body) => {
434
+ const response = await fetchRuntime("/agents/profiles", {
435
+ method: "POST",
436
+ headers: { "content-type": "application/json" },
437
+ body: JSON.stringify(body)
438
+ });
439
+ if (!response.ok) throw await parseResponseError(response);
440
+ const receipt = await response.json();
441
+ if (receipt.transport !== "managed-profile-reference-v1") throw new ValidationError("Runtime does not support full managed-profile references; refresh the runtime before priming");
442
+ return receipt;
443
+ };
444
+ if (new TextEncoder().encode(JSON.stringify({ profile })).length <= 1048576) {
445
+ const receipt = await post({ profile });
446
+ if (receipt.sha256 !== sha256) throw new Error("Runtime cached a different managed profile");
447
+ return receipt.sha256;
448
+ }
449
+ const started = await post({ upload: {
450
+ op: "start",
451
+ totalBytes: bytes.length,
452
+ sha256
453
+ } });
454
+ if (!started.uploadId || started.partSize !== 524288) throw new Error("Runtime does not support bounded full-profile priming");
455
+ const uploadId = started.uploadId;
456
+ try {
457
+ for (let offset = 0, index = 0; offset < bytes.length; offset += PROFILE_IMPORT_PART_BYTES, index++) {
458
+ const part = bytes.subarray(offset, offset + PROFILE_IMPORT_PART_BYTES);
459
+ let binary = "";
460
+ for (const byte of part) binary += String.fromCharCode(byte);
461
+ const content = btoa(binary);
462
+ await post({ upload: {
463
+ op: "part",
464
+ uploadId,
465
+ index,
466
+ content
467
+ } });
468
+ }
469
+ const receipt = await post({ upload: {
470
+ op: "commit",
471
+ uploadId
472
+ } });
473
+ if (receipt.sha256 !== sha256) throw new Error("Runtime cached a different managed profile");
474
+ return receipt.sha256;
475
+ } catch (error) {
476
+ await post({ upload: {
477
+ op: "abort",
478
+ uploadId
479
+ } }).catch(() => void 0);
480
+ throw error;
481
+ }
482
+ }
483
+ /** Project validated agent requests at the last transport boundary, after full digest checks. */
484
+ function referencePrimedProfileRequest(path, options, references) {
485
+ if (!references?.size || typeof options?.body !== "string" || !/^\/agents\/(?:run(?:\/stream)?|sessions(?:\/[^/?]+\/(?:messages|public-profile-revisions\/prepare|admissions\/[^/?]+\/check))?)$/.test(path)) return options;
486
+ const body = JSON.parse(options.body);
487
+ const backend = body.backend;
488
+ const reference = backend?.profile === void 0 ? void 0 : references.get(profileCacheSha256(backend.profile));
489
+ if (!backend || !reference) return options;
490
+ const { profile: _profile, ...rest } = backend;
491
+ return {
492
+ ...options,
493
+ body: JSON.stringify({
494
+ ...body,
495
+ backend: {
496
+ ...rest,
497
+ profileSha256: reference.sha256
498
+ }
499
+ })
500
+ };
501
+ }
502
+ //#endregion
387
503
  //#region src/sandbox-instance-state.ts
388
504
  var SandboxInstanceState = class {
389
505
  client;
@@ -397,7 +513,8 @@ var SandboxInstanceState = class {
397
513
  interactiveEnvironmentId;
398
514
  interactiveTerminalOperations;
399
515
  _terminalStreamConnect;
400
- deferredProfileReference;
516
+ profileReferences;
517
+ sessionProfileReferencesSupported = false;
401
518
  profileFiles;
402
519
  profileProvenance;
403
520
  directRead;
@@ -730,14 +847,54 @@ var SandboxInfoCapabilities = class {
730
847
  * the transport `/agents/profiles` rides and the box surface mount
731
848
  * delivery uses for profile-bundle cache claim/publish.
732
849
  */
733
- async runtimeFetch(path, options, fetchOptions) {
850
+ async runtimeFetch(path, inputOptions, fetchOptions) {
851
+ let options = inputOptions;
734
852
  const data = state(this);
735
853
  this.assertFilesystemIncarnationReady();
854
+ const fullOptions = options;
855
+ if (data.sessionProfileReferencesSupported && typeof options?.body === "string" && new TextEncoder().encode(options.body).length > 1048576) {
856
+ const candidate = JSON.parse(options.body);
857
+ if (candidate.expectedPublicProfileRequestDigest && candidate.backend?.profile) {
858
+ const profile = candidate.backend.profile;
859
+ const identity = profileCacheSha256(profile);
860
+ if (!data.profileReferences?.has(identity)) {
861
+ const sha256 = await primeManagedProfile(profile, (endpoint, init) => this.runtimeFetch(endpoint, {
862
+ ...init,
863
+ signal: options?.signal
864
+ }));
865
+ data.profileReferences ??= /* @__PURE__ */ new Map();
866
+ rememberProfileReference(data.profileReferences, identity, {
867
+ sha256,
868
+ managed: true
869
+ });
870
+ }
871
+ }
872
+ }
873
+ if (!fetchOptions?.skipProfileReference && data.sessionProfileReferencesSupported) options = referencePrimedProfileRequest(path, options, data.profileReferences);
736
874
  const url = `/v1/sandboxes/${encodeURIComponent(this.id)}/runtime${path}`;
737
875
  try {
738
876
  let response;
739
877
  if (fetchOptions) response = await data.client.fetch(url, options, fetchOptions);
740
878
  else response = options ? await data.client.fetch(url, options) : await data.client.fetch(url);
879
+ if (options !== fullOptions && typeof fullOptions?.body === "string" && await responseNeedsProfileImport(response)) {
880
+ const profile = JSON.parse(fullOptions.body).backend.profile;
881
+ const identity = profileCacheSha256(profile);
882
+ data.profileReferences?.delete(identity);
883
+ await response.body?.cancel();
884
+ const sha256 = await primeManagedProfile(profile, (endpoint, init) => this.runtimeFetch(endpoint, {
885
+ ...init,
886
+ signal: fullOptions.signal
887
+ }));
888
+ data.profileReferences ??= /* @__PURE__ */ new Map();
889
+ const references = data.profileReferences;
890
+ rememberProfileReference(references, identity, {
891
+ sha256,
892
+ managed: true
893
+ });
894
+ const retry = referencePrimedProfileRequest(path, fullOptions, references);
895
+ response = await data.client.fetch(url, retry, fetchOptions);
896
+ }
897
+ if (options !== fullOptions && response.status === 400 && (await response.clone().text()).includes("profileSha256")) data.sessionProfileReferencesSupported = false;
741
898
  if (response.ok) sandboxStatusObservedAt.set(this, Date.now());
742
899
  return response;
743
900
  } catch (err) {
@@ -5372,15 +5529,6 @@ function isTransientWriteError(err) {
5372
5529
  function isProfileNotCachedError(err) {
5373
5530
  return err instanceof SandboxError && err.code === "PROFILE_NOT_CACHED";
5374
5531
  }
5375
- /**
5376
- * Stable-enough serialization for detecting whether a profile's content has
5377
- * changed since it was primed. Not a canonical hash — key reordering yields a
5378
- * different string, which only forgoes the optimization (the turn sends
5379
- * inline), never breaks correctness. Used purely for the local content check.
5380
- */
5381
- function serializeProfileSnapshot(profile) {
5382
- return canonicalCandidateJson(profile);
5383
- }
5384
5532
  function readPublicProfileConflicts(value) {
5385
5533
  if (!Array.isArray(value) || value.length > 256) return void 0;
5386
5534
  const safePath = (path) => typeof path === "string" && path.length > 0 && !path.startsWith("/") && !path.includes("\\") && [...path].every((character) => {
@@ -5420,10 +5568,12 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5420
5568
  */
5421
5569
  attachProfileReference(profile, sha256, name) {
5422
5570
  const data = state(this);
5423
- data.deferredProfileReference = {
5424
- snapshot: serializeProfileSnapshot(profile),
5425
- sha256
5426
- };
5571
+ data.profileReferences ??= /* @__PURE__ */ new Map();
5572
+ const references = data.profileReferences;
5573
+ rememberProfileReference(references, profileCacheSha256(profile), {
5574
+ sha256,
5575
+ managed: false
5576
+ });
5427
5577
  if (!data.profileProvenance) data.profileProvenance = {
5428
5578
  base: {
5429
5579
  name: name ?? null,
@@ -5448,6 +5598,10 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5448
5598
  * to the runtime (`POST /agents/profiles`) and record
5449
5599
  * the returned transport-profile hash via {@link attachProfileReference}, so subsequent turns
5450
5600
  * reference it by `profileSha256` instead of re-sending the corpus.
5601
+ * Set `preserveManagedProfile` to cache the entire profile through bounded
5602
+ * requests. Its managed files stay in the private native revision; this mode
5603
+ * never writes them into the shared workspace. Preparation and dispatch then
5604
+ * reference the same full profile. Runtime grants are never cached.
5451
5605
  * `create()` calls this automatically for its inline profile when
5452
5606
  * `autoDeferProfile` is on; call it directly when the profile only exists
5453
5607
  * per-turn, or when the instance was fetched rather than created. Persist
@@ -5456,9 +5610,20 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5456
5610
  * failure — the caller decides whether that is fatal (it is not: turns fall
5457
5611
  * back to sending the file-free profile inline).
5458
5612
  */
5459
- async primeProfile(profile) {
5613
+ async primeProfile(profile, options = {}) {
5460
5614
  const parsed = agentProfileSchema.safeParse(profile);
5461
5615
  if (!parsed.success) throw new ValidationError("Profile priming requires an AgentProfile object");
5616
+ if (options.preserveManagedProfile) {
5617
+ const snapshot = JSON.parse(JSON.stringify(profile));
5618
+ await this.ensureRunning();
5619
+ const sha256 = await primeManagedProfile(snapshot, (path, init) => this.runtimeFetch(path, init));
5620
+ this.attachProfileReference(snapshot, sha256);
5621
+ const reference = state(this).profileReferences?.get(profileCacheSha256(snapshot));
5622
+ if (!reference) throw new Error("Managed profile reference was not recorded");
5623
+ reference.managed = true;
5624
+ state(this).sessionProfileReferencesSupported = true;
5625
+ return sha256;
5626
+ }
5462
5627
  const lean = splitInlineProfileFileMounts(parsed.data).leanProfile;
5463
5628
  const body = JSON.stringify({ profile: lean });
5464
5629
  if (new TextEncoder().encode(body).byteLength > 1048576) throw new ValidationError("Profile priming exceeds the gateway request bound; place large content in resources.files");
@@ -5479,6 +5644,7 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5479
5644
  const data = await response.json();
5480
5645
  if (typeof data.sha256 !== "string" || data.sha256.length === 0) throw new Error("Profile priming returned no sha256; runtime response malformed");
5481
5646
  this.attachProfileReference(delivered, data.sha256);
5647
+ state(this).sessionProfileReferencesSupported = data.transport === MANAGED_PROFILE_TRANSPORT;
5482
5648
  return data.sha256;
5483
5649
  }
5484
5650
  /**
@@ -5506,6 +5672,15 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5506
5672
  const backend = mergeRuntimeBackendConfig(state(this).defaultRuntimeBackend, applyRequestedModel(overrideBackend, requestedModel));
5507
5673
  let normalized = normalizeRuntimeBackendConfig(backend, { allowRuntimeSecrets: true });
5508
5674
  if (!normalized) return normalized;
5675
+ if (preserveManagedProfile && backend?.profile && !state(this).profileReferences?.has(profileCacheSha256(backend.profile)) && new TextEncoder().encode(JSON.stringify(normalized)).length > 1048576) await this.primeProfile(backend.profile, { preserveManagedProfile: true });
5676
+ const reference = normalized.profile === void 0 ? void 0 : state(this).profileReferences?.get(profileCacheSha256(normalized.profile));
5677
+ if (!forceFullProfile && reference) {
5678
+ const { profile: _profile, ...rest } = normalized;
5679
+ return {
5680
+ ...rest,
5681
+ profileSha256: reference.sha256
5682
+ };
5683
+ }
5509
5684
  if (backend?.profile !== void 0 && !preserveManagedProfile) try {
5510
5685
  normalized = {
5511
5686
  ...normalized,
@@ -5519,16 +5694,27 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5519
5694
  profile: splitInlineProfileFileMounts(backend.profile).leanProfile
5520
5695
  };
5521
5696
  }
5522
- const deferred = state(this).deferredProfileReference;
5523
- if (!forceFullProfile && deferred !== void 0 && normalized.profile !== void 0 && serializeProfileSnapshot(normalized.profile) === deferred.snapshot) {
5524
- const { profile: _omitted, ...rest } = normalized;
5697
+ const deliveredReference = normalized.profile === void 0 ? void 0 : state(this).profileReferences?.get(profileCacheSha256(normalized.profile));
5698
+ if (!forceFullProfile && deliveredReference) {
5699
+ const { profile: _profile, ...rest } = normalized;
5525
5700
  return {
5526
5701
  ...rest,
5527
- profileSha256: deferred.sha256
5702
+ profileSha256: deliveredReference.sha256
5528
5703
  };
5529
5704
  }
5530
5705
  return normalized;
5531
5706
  }
5707
+ /** Recover only managed references before any stream event or model admission. */
5708
+ async reprimeManagedRunProfile(options) {
5709
+ const backend = mergeRuntimeBackendConfig(state(this).defaultRuntimeBackend, applyRequestedModel(options.backend, options.model));
5710
+ if (!backend?.profile) return false;
5711
+ const identity = profileCacheSha256(backend.profile);
5712
+ const references = state(this).profileReferences;
5713
+ if (!references?.get(identity)?.managed) return false;
5714
+ references.delete(identity);
5715
+ await this.primeProfile(backend.profile, { preserveManagedProfile: true });
5716
+ return true;
5717
+ }
5532
5718
  /**
5533
5719
  * Create a snapshot of the sandbox state.
5534
5720
  * Snapshots can be used to save workspace state for later restoration.
@@ -5614,13 +5800,15 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5614
5800
  expectedPublicProfileRequestDigest
5615
5801
  });
5616
5802
  const endpoint = `/agents/sessions/${encodeURIComponent(opts.sessionId)}/public-profile-revisions/prepare`;
5803
+ const body = JSON.stringify({
5804
+ backend: wire.backend,
5805
+ expectedPublicProfileRequestDigest
5806
+ });
5807
+ if (backend.profile && (!state(this).sessionProfileReferencesSupported || !state(this).profileReferences?.has(profileCacheSha256(backend.profile))) && new TextEncoder().encode(body).length > 1048576) await this.primeProfile(backend.profile, { preserveManagedProfile: true });
5617
5808
  const response = await this.runtimeFetch(endpoint, {
5618
5809
  method: "POST",
5619
5810
  headers: { "Content-Type": "application/json" },
5620
- body: JSON.stringify({
5621
- backend: wire.backend,
5622
- expectedPublicProfileRequestDigest
5623
- })
5811
+ body
5624
5812
  });
5625
5813
  if (!response.ok) throw await parseResponseError(response);
5626
5814
  const receipt = await response.json();
@@ -5651,14 +5839,16 @@ var SandboxProfileCapabilities = class extends SandboxFileWriteCapabilities {
5651
5839
  backend
5652
5840
  });
5653
5841
  const endpoint = `/agents/sessions/${encodeURIComponent(opts.sessionId)}/public-profile-revisions/prepare`;
5842
+ const body = JSON.stringify({
5843
+ backend: wire.backend,
5844
+ expectedPublicProfileRequestDigest,
5845
+ secret: true
5846
+ });
5847
+ if (backend.profile && (!state(this).sessionProfileReferencesSupported || !state(this).profileReferences?.has(profileCacheSha256(backend.profile))) && new TextEncoder().encode(body).length > 1048576) await this.primeProfile(backend.profile, { preserveManagedProfile: true });
5654
5848
  const response = await this.runtimeFetch(endpoint, {
5655
5849
  method: "POST",
5656
5850
  headers: { "Content-Type": "application/json" },
5657
- body: JSON.stringify({
5658
- backend: wire.backend,
5659
- expectedPublicProfileRequestDigest,
5660
- secret: true
5661
- })
5851
+ body
5662
5852
  });
5663
5853
  if (!response.ok) throw await parseResponseError(response);
5664
5854
  const receipt = await response.json();
@@ -6418,11 +6608,11 @@ var SandboxPromptTransportCapabilities = class extends SandboxSessionAdmissionCa
6418
6608
  ...state.options?.detach ? { detach: true } : {},
6419
6609
  ...state.options?.expectedPublicProfileRequestDigest ? { expectedPublicProfileRequestDigest: state.options.expectedPublicProfileRequestDigest } : {},
6420
6610
  ...state.options?.expectedSecretProfileReceipt ? { expectedSecretProfileReceipt: state.options.expectedSecretProfileReceipt } : {},
6421
- backend: await this.buildRunBackendBody(state.options?.backend, (state.internal?.forceFullProfile ?? false) || state.options?.expectedSecretProfileReceipt !== void 0, state.options?.model, state.streamSignal, state.options?.expectedSecretProfileReceipt !== void 0)
6611
+ backend: await this.buildRunBackendBody(state.options?.backend, state.internal?.forceFullProfile ?? false, state.options?.model, state.streamSignal, state.options?.expectedPublicProfileRequestDigest !== void 0)
6422
6612
  })
6423
6613
  };
6424
6614
  if (typeof request.body === "string" && new TextEncoder().encode(request.body).byteLength > 1048576) throw new ValidationError("Agent run request exceeds the gateway request bound; place large content in resources.files");
6425
- response = await this.runtimeFetch(state.requestEndpoint, request);
6615
+ response = await this.runtimeFetch(state.requestEndpoint, request, state.internal?.forceFullProfile ? { skipProfileReference: true } : void 0);
6426
6616
  for (let attempt = 1; !state.explicitReplay && response.status === 503 && attempt <= MAX_CREDENTIAL_REFUSAL_RETRIES; attempt += 1) {
6427
6617
  const body = await response.clone().text();
6428
6618
  const refusal = parseErrorResponse(response.status, body, {
@@ -6431,7 +6621,7 @@ var SandboxPromptTransportCapabilities = class extends SandboxSessionAdmissionCa
6431
6621
  }, response.headers);
6432
6622
  if (!isRetryableCredentialRefusal(refusal)) break;
6433
6623
  await waitForRetryAfter(refusal.retryAfterMs ?? 1e3, state.streamSignal);
6434
- response = await this.runtimeFetch(state.requestEndpoint, request);
6624
+ response = await this.runtimeFetch(state.requestEndpoint, request, state.internal?.forceFullProfile ? { skipProfileReference: true } : void 0);
6435
6625
  }
6436
6626
  state.logStreamCheckpoint("runtime_response_headers", {
6437
6627
  status: response.status,
@@ -6782,12 +6972,13 @@ var SandboxPromptCapabilities = class extends SandboxPromptTransportCapabilities
6782
6972
  let sessionId = options?.sessionId;
6783
6973
  let executionId = options?.lastEventId ? options.executionId : void 0;
6784
6974
  let profileResendAttempted = false;
6975
+ let forceFullProfile = false;
6785
6976
  let streamInterrupted = false;
6786
6977
  try {
6787
6978
  for (;;) {
6788
6979
  let yieldedThisAttempt = false;
6789
6980
  try {
6790
- for await (const event of this.streamPromptInner(message, options, { forceFullProfile: profileResendAttempted })) {
6981
+ for await (const event of this.streamPromptInner(message, options, { forceFullProfile })) {
6791
6982
  yieldedThisAttempt = true;
6792
6983
  if (event.type === "done") receivedTerminal = true;
6793
6984
  if (event.type === "execution.started" && event.data.executionId) {
@@ -6805,6 +6996,7 @@ var SandboxPromptCapabilities = class extends SandboxPromptTransportCapabilities
6805
6996
  executionId
6806
6997
  });
6807
6998
  profileResendAttempted = true;
6999
+ forceFullProfile = !await this.reprimeManagedRunProfile(options);
6808
7000
  continue;
6809
7001
  }
6810
7002
  throw err;
@@ -10200,7 +10392,8 @@ var SandboxInstance = class SandboxInstance extends SandboxEgressCapabilities {
10200
10392
  }
10201
10393
  directInstance.assertRunnable();
10202
10394
  }), { ...data.info }, data.defaultRuntimeBackend);
10203
- if (data.deferredProfileReference !== void 0) state(directInstance).deferredProfileReference = data.deferredProfileReference;
10395
+ if (data.profileReferences) state(directInstance).profileReferences = new Map(data.profileReferences);
10396
+ state(directInstance).sessionProfileReferencesSupported = data.sessionProfileReferencesSupported;
10204
10397
  const observedAt = sandboxStatusObservedAt.get(this);
10205
10398
  if (observedAt !== void 0) sandboxStatusObservedAt.set(directInstance, observedAt);
10206
10399
  return directInstance;
@@ -1,2 +1,2 @@
1
- import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-HvudS75t.js";
1
+ import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-OlfnNs7A.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,2 +1,2 @@
1
- import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-D9N-QTRs.js";
1
+ import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-BO79_pYa.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,5 +1,5 @@
1
1
  import { i as readResponseJson } from "./errors-CfQHPcLX.js";
2
- import { n as createSandboxInstanceFromResponse } from "./sandbox-bIH2qdvI.js";
2
+ import { n as createSandboxInstanceFromResponse } from "./sandbox-eHrem1Ut.js";
3
3
  import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-Bl-H3KsQ.js";
4
4
  //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "0.60.78-develop.20261024105952.0f18c1e",
3
+ "version": "0.60.78-develop.20261024130805.7e6bc5d",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -159,12 +159,12 @@
159
159
  "vitest": "^4.1.11",
160
160
  "ws": "^8.20.0",
161
161
  "yjs": "13.6.30",
162
- "@products/sandbox-test-utils": "0.0.0",
163
162
  "@repo/shared": "0.0.0",
163
+ "@products/sandbox-test-utils": "0.0.0",
164
164
  "@tangle-network/agent-profile-materialize": "0.26.0",
165
+ "@tangle-network/cli-agent-registry": "0.10.2",
165
166
  "@tangle-network/runtime-contracts": "0.19.0",
166
167
  "@tangle-network/sdk": "4.0.16",
167
- "@tangle-network/cli-agent-registry": "0.10.2",
168
168
  "@tangle-network/sse-core": "0.0.0"
169
169
  },
170
170
  "scripts": {