@tangle-network/sandbox 1.0.13 → 1.0.14

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
1
  import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-C3GQDkDm.js";
2
2
  import { Co as BackendType, Di as CodeResultPart, Ei as CodeExecutionResult, Ti as CodeExecutionOptions, Va as CodeLanguage, ba as BackendConfig, bn as SandboxFleetParent, xt as SessionListOptions, yt as SessionInfo } from "../types-BF8se4_x.js";
3
- import { t as Sandbox } from "../client-KYoUgWWa.js";
4
- import { u as PreviewAuthorizer } from "../preview-Cdq7psjp.js";
3
+ import { t as Sandbox } from "../client-DEvdnu0z.js";
4
+ import { u as PreviewAuthorizer } from "../preview-DQs0Zh9L.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-BcRLN_Ic.js";
2
- import { E as assertCurrentBackendType } from "../interactive-controller-B4bQwRJL.js";
3
- import { t as SandboxInstance } from "../sandbox-DAG5tyIP.js";
2
+ import { E as assertCurrentBackendType } from "../interactive-controller-BkfV4Cs_.js";
3
+ import { t as SandboxInstance } from "../sandbox-CTG1pJ1v.js";
4
4
  import { C as StateError, E as ValidationError, g as NotFoundError } from "../errors-ZmDrrk4f.js";
5
- import { t as Sandbox } from "../client-Cig6uTYZ.js";
5
+ import { t as Sandbox } from "../client-VRQjfrZG.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-Cdq7psjp.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-DQs0Zh9L.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 };
@@ -634,9 +634,8 @@ interface ServerFleetRecord {
634
634
  *
635
635
  * EventSource stream parsing for SDK consumers. Framing — buffering
636
636
  * chunk-straddling frames, LF/CRLF terminators, multi-line `data:` joins,
637
- * comment heartbeats, BOM — lives in `@tangle-network/sse-core`, the one
638
- * wire-format implementation shared across the repo (bundled into this
639
- * package's dist, so the SDK stays dependency-free at runtime). This
637
+ * comment heartbeats, BOM — lives in `@tangle-network/agent-core/sse`, the
638
+ * one wire-format implementation, which imports nothing. This
640
639
  * module owns the SDK's payload contract on top of it: JSON parsing, the
641
640
  * `"message"` default event type, and the malformed-frame policy. Used by
642
641
  * `Sandbox.streamBatch` and by the web dashboard's batch page; exported
@@ -689,7 +688,7 @@ interface ParseSSEStreamOptions {
689
688
  invalidEvent?: "throw" | "warn-and-skip";
690
689
  /**
691
690
  * The longest silence the stream may keep, read before each chunk read;
692
- * see `@tangle-network/sse-core`. A longer one throws
691
+ * see `@tangle-network/agent-core/sse`. A longer one throws
693
692
  * `SSEStreamSilentError`.
694
693
  */
695
694
  idleMs?: () => number | undefined;
@@ -1,12 +1,12 @@
1
1
  import { r as backendTypeSchema } from "./backend-types-CLvdSX8V.js";
2
2
  import { a as agentProfileSchema } from "./cli-auth-bundle-DFdTu3lv.js";
3
- import { D as foldModelRoutingFields, E as assertCurrentBackendType, M as withProfileHarness, N as withoutCreateOnlyModelFields, S as encodePromptForWire, T as applyRequestedModel, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken } from "./interactive-controller-B4bQwRJL.js";
4
- import { A as normalizeStartupDiagnostics, D as isRetryableProfileFileMaterializeFailure, E as validateDeferredProfileFileMounts, M as normalizeConnection, N as normalizeEgressPolicyFields, O as normalizeCaptureProof, P as normalizeSandboxShape, T as splitInlineProfileSkills, j as parseStopPhase, k as normalizeSandboxCreateReceipt, n as createSandboxInstanceFromResponse, o as exportTraceBundle, w as splitInlineProfileFileMounts } from "./sandbox-DAG5tyIP.js";
3
+ import { D as foldModelRoutingFields, E as assertCurrentBackendType, M as withProfileHarness, N as withoutCreateOnlyModelFields, S as encodePromptForWire, T as applyRequestedModel, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken } from "./interactive-controller-BkfV4Cs_.js";
4
+ import { A as normalizeStartupDiagnostics, D as isRetryableProfileFileMaterializeFailure, E as validateDeferredProfileFileMounts, M as normalizeConnection, N as normalizeEgressPolicyFields, O as normalizeCaptureProof, P as normalizeSandboxShape, T as splitInlineProfileSkills, j as parseStopPhase, k as normalizeSandboxCreateReceipt, n as createSandboxInstanceFromResponse, o as exportTraceBundle, w as splitInlineProfileFileMounts } from "./sandbox-CTG1pJ1v.js";
5
5
  import { E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, c as CompliancePlacementError, f as GpuProviderNotConfiguredError, g as NotFoundError, h as NetworkError, i as readResponseJson, m as NON_RETRYABLE_CREATE_QUOTA_REASONS, n as parseErrorResponse, r as parseResponseError, x as SandboxError, y as QuotaError } from "./errors-ZmDrrk4f.js";
6
6
  import { n as combineAbortSignals } from "./abort-signal-jU-SEjLT.js";
7
7
  import { t as fetchSandboxApi } from "./api-request-EseiF9B1.js";
8
8
  import { n as fetchWithKeepAlive } from "./keep-alive-fetch-C2DX2_rG.js";
9
- import { t as parseSSEStream } from "./sse-parser-DmO5gP6u.js";
9
+ import { t as parseSSEStream } from "./sse-parser-CJ52bhG3.js";
10
10
  import { t as LinesClient } from "./lines-BqZOl_io.js";
11
11
  import { PublicTemplatesClient } from "./public-templates.js";
12
12
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-DFdTu3lv.js";
2
2
  import { n as agentProfileSchema } from "./profile-schema-CT3hB1mG.js";
3
- import { F as canonicalAgentProfileDigest } from "./sandbox-DAG5tyIP.js";
3
+ import { F as canonicalAgentProfileDigest } from "./sandbox-CTG1pJ1v.js";
4
4
  import { E as ValidationError, s as CapabilityError, x as SandboxError } from "./errors-ZmDrrk4f.js";
5
5
  import { t as awaitWithAbort } from "./abort-signal-jU-SEjLT.js";
6
6
  import { z } from "zod";
package/dist/core.d.ts CHANGED
@@ -2,6 +2,6 @@ import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryRep
2
2
  import { At as SandboxErrorJson, Ct as NetworkError, Dt as QuotaError, Et as ProfileFileMountPathError, It as TimeoutError, Lt as ValidationError, Mt as ServerError, Nt as StateError, Tt as PartialFailureError, ht as CapabilityError, jt as SandboxFailureDetail, kt as SandboxError, pt as AuthError, wt as NotFoundError, yt as FileWriteConflictError } from "./terminal-stream-types-DwXQzUbH.js";
3
3
  import { Ai as ManagedProcessRecord, Ba as WorkspaceImagePublishResult, Ct as SessionMessageAdmission, H as PreviewLinkInfo, Ka as SandboxEnvRecovery, Mi as ManagedProcessSpec, Ni as ManagedProcessState, Oi as ManagedProcessJobs, U as PreviewLinkManager, W as PreviewLinkWaitOptions, _r as NetworkConfig, ar as CreateSandboxOptions, ca as PromptInputPart, ei as ExecOptions, ji as ManagedProcessResumeOptions, ki as ManagedProcessOptions, lr as SandboxStatus, nt as ConversationTurnResult, or as SandboxConfig, qa as SandboxEnvRecoveryView, ti as ExecResult, tt as ConversationTurnOptions, za as WorkspaceImagePublishInput, zn as SandboxInfo } from "./types-BF8se4_x.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-CA1IbRzE.js";
5
- import { $t as BackendRegistryEntry, Et as sandboxFailureKind, Qt as BackendRegistryCapabilities, St as InstanceRestartingError, Tt as SandboxFailureKind, _t as ManagedProcessClient, an as backendRegistryResponseSchema, at as ISOLATED_CREATION_ATTESTATION_VERSION, bt as InstanceProfile, cn as parseBackendRegistryResponseBody, ct as SandboxSeatCredentials, dt as SeatOwnerTransport, en as BackendRegistryInteractionKind, ft as SeatResolutionObservation, gt as gatewaySeatTransport, ht as createSelectSeat, in as backendRegistryInteractionKindSchema, lt as SandboxSeatSelectionInput, mt as SeatSelectionRequest, nn as backendRegistryCapabilitiesSchema, on as isBackendRegistryInteractionKind, ot as CreateSelectSeatOptions, pt as SeatSelectionError, rn as backendRegistryEntrySchema, sn as parseBackendRegistryResponse, st as SandboxResolvedSeat, t as Sandbox, tn as BackendRegistryResponse, ut as SeatOwnerReply, vt as EnsureInstanceOptions, wt as InstancesClient, xt as InstanceRecord, yt as HostedInstance } from "./client-KYoUgWWa.js";
5
+ import { $t as BackendRegistryEntry, Et as sandboxFailureKind, Qt as BackendRegistryCapabilities, St as InstanceRestartingError, Tt as SandboxFailureKind, _t as ManagedProcessClient, an as backendRegistryResponseSchema, at as ISOLATED_CREATION_ATTESTATION_VERSION, bt as InstanceProfile, cn as parseBackendRegistryResponseBody, ct as SandboxSeatCredentials, dt as SeatOwnerTransport, en as BackendRegistryInteractionKind, ft as SeatResolutionObservation, gt as gatewaySeatTransport, ht as createSelectSeat, in as backendRegistryInteractionKindSchema, lt as SandboxSeatSelectionInput, mt as SeatSelectionRequest, nn as backendRegistryCapabilitiesSchema, on as isBackendRegistryInteractionKind, ot as CreateSelectSeatOptions, pt as SeatSelectionError, rn as backendRegistryEntrySchema, sn as parseBackendRegistryResponse, st as SandboxResolvedSeat, t as Sandbox, tn as BackendRegistryResponse, ut as SeatOwnerReply, vt as EnsureInstanceOptions, wt as InstancesClient, xt as InstanceRecord, yt as HostedInstance } from "./client-DEvdnu0z.js";
6
6
  import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-COGktcNu.js";
7
7
  export { AuthError, BackendRegistryCapabilities, BackendRegistryEntry, BackendRegistryInteractionKind, BackendRegistryResponse, CapabilityError, ConversationTurnOptions, ConversationTurnResult, CreateSandboxOptions, CreateSelectSeatOptions, EnsureInstanceOptions, ExecOptions, ExecResult, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceProfile, InstanceRecord, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, Line, LineAgentRolePolicy, LineApplication, LineApplicationAttachOptions, LineApplicationRequest, LineApplicationResult, LineApplicationState, LineApplicationView, LineAttachment, LineAttachmentReauthorization, LineExecutionKey, LineImage, LineInstanceAttachOptions, LineInstanceCreate, LineMember, LineMemberInstance, LineNumberInventory, LineProvider, LineReminderPreferences, LineReplyCode, LineReplyCodeInput, LineSendInput, LineSendReceipt, LineSenderVerification, LineSenderVerificationStart, LinesClient, ManagedProcessClient, ManagedProcessJobs, ManagedProcessOptions, ManagedProcessRecord, ManagedProcessResumeOptions, ManagedProcessSpec, ManagedProcessState, NetworkConfig, NetworkError, NotFoundError, PartialFailureError, PreviewLinkInfo, PreviewLinkManager, PreviewLinkWaitOptions, ProfileFileDeliveryReport, ProfileFileMountPathError, PromptInputPart, PublicTemplatePublishArtifact, PublicTemplatePublishError, PublicTemplatePublishJob, PublicTemplatePublishRequestOptions, PublicTemplatesClient, QuotaError, Sandbox, SandboxConfig, SandboxEnvRecovery, SandboxEnvRecoveryView, SandboxError, SandboxErrorJson, SandboxFailureDetail, SandboxFailureKind, SandboxInfo, SandboxInstance, SandboxResolvedSeat, SandboxSeatCredentials, SandboxSeatSelectionInput, SandboxStatus, SeatOwnerReply, SeatOwnerTransport, SeatResolutionObservation, SeatSelectionError, SeatSelectionRequest, ServerError, SessionMessageAdmission, StateError, TimeoutError, ValidationError, WorkspaceImagePublishInput, WorkspaceImagePublishRequestOptions, WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
- import { b as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-DAG5tyIP.js";
1
+ import { b as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-CTG1pJ1v.js";
2
2
  import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, d as FileWriteConflictError, g as NotFoundError, h as NetworkError, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-ZmDrrk4f.js";
3
- import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } from "./client-Cig6uTYZ.js";
3
+ import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } from "./client-VRQjfrZG.js";
4
4
  import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-BqZOl_io.js";
5
5
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
6
- import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-X0zexFfY.js";
6
+ import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-CGIxrHev.js";
7
7
  export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, ProfileFileMountPathError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, SeatSelectionError, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { $ as CompletedTurnPayload, $a as RawEvidenceBoxExportOptions, $i as Dur
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-CA1IbRzE.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-CVnME80O.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-Bf8yrdzR.js";
7
- import { $ as ImageBuildClientConfig, $t as BackendRegistryEntry, A as buildTangleRouterResponsesWebSearchRequest, At as createConfidentialSandbox, B as MANAGE_SANDBOXES_TOOL_NAME, Bt as startTeeAttestationHeartbeat, C as RunTangleRouterEvalMatrixInSandboxOptions, Ct as InstanceStart, D as RouterSearchConfigOptions, Dt as ConfidentialSandboxResult, E as RouterSearchConfig, Et as sandboxFailureKind, F as SANDBOX_SIZE_PRESETS, Ft as normalizeRuntimeBackendConfig, G as manageSandboxesInputSchema, Gt as parseSSEStream, H as ManageSandboxesTool, Ht as ImageSpec, I as resolveSandboxResources, It as requestedPublicProfileDigest, J as collectAgentResponseText, Jt as Team, K as applySandboxEventText, Kt as CreateTeamOptions, L as sandboxResourcesForSize, Lt as TeeAttestationHeartbeat, M as buildTangleRouterSearchProfile, Mt as BatchResultAccumulator, N as fetchTangleRouterSearchConfig, Nt as createBatchResultAccumulator, O as TangleSearchProvider, Ot as ConfidentialTeeType, P as DEFAULT_SANDBOX_SIZE, Pt as validateBatchRunRequest, Q as ImageBuildClient, Qt as BackendRegistryCapabilities, R as materializeProfileFileMounts, Rt as TeeAttestationHeartbeatOptions, S as RouterImportedRunResponse, St as InstanceRestartingError, T as runTangleRouterEvalMatrixInSandbox, Tt as SandboxFailureKind, U as ManageSandboxesToolOptions, Ut as ParseSSEStreamOptions, V as ManageSandboxesInput, Vt as BuildProgressEvent, W as createManageSandboxesTool, Wt as ParsedSSEEvent, X as isToolBearingEvent, Xt as TeamMember, Y as getSandboxEventText, Yt as TeamInvitation, Z as Image, Zt as IntelligenceClient, _ as RouterEvalMatrixPayload, _t as ManagedProcessClient, a as SessionBroadcastEvent, an as backendRegistryResponseSchema, at as ISOLATED_CREATION_ATTESTATION_VERSION, b as RouterEvalMatrixScenario, bt as InstanceProfile, c as RunPlacement, cn as parseBackendRegistryResponseBody, ct as SandboxSeatCredentials, d as RunWaitOptions, dt as SeatOwnerTransport, en as BackendRegistryInteractionKind, et as ImageBuildFetchClient, f as RunsClient, ft as SeatResolutionObservation, g as RouterEvalMatrixHarness, gt as gatewaySeatTransport, h as RouterEvalMatrixCaseResult, ht as createSelectSeat, i as terminalUpgradeHeadersSupported, in as backendRegistryInteractionKindSchema, it as generateDockerfile, j as buildTangleRouterSearchBackend, jt as generateAttestationNonce, k as buildTangleRouterEvalMatrixRequest, kt as CreateConfidentialSandboxOptions, l as RunPlacementRecord, lt as SandboxSeatSelectionInput, m as RouterEvalMatrixAgentProfile, mt as SeatSelectionRequest, n as SandboxFleetClient, nn as backendRegistryCapabilitiesSchema, nt as ImageBuildResult, o as SessionBroadcastResult, on as isBackendRegistryInteractionKind, ot as CreateSelectSeatOptions, p as RunsHttpClient, pt as SeatSelectionError, q as collectAgentFinalMessageText, qt as InviteTeamMemberOptions, r as SandboxFleet, rn as backendRegistryEntrySchema, rt as ImageBuilder, s as RunOptions, sn as parseBackendRegistryResponse, st as SandboxResolvedSeat, t as Sandbox, tn as BackendRegistryResponse, tt as ImageBuildOptions, u as RunRecord, ut as SeatOwnerReply, v as RouterEvalMatrixSandboxBox, vt as EnsureInstanceOptions, w as RunTangleRouterEvalMatrixInSandboxResult, wt as InstancesClient, x as RouterEvalMatrixSuiteResponse, xt as InstanceRecord, y as RouterEvalMatrixSandboxClient, yt as HostedInstance, z as MANAGE_SANDBOXES_PARAMETERS, zt as TeeAttestationHeartbeatSample } from "./client-KYoUgWWa.js";
7
+ import { $ as ImageBuildClientConfig, $t as BackendRegistryEntry, A as buildTangleRouterResponsesWebSearchRequest, At as createConfidentialSandbox, B as MANAGE_SANDBOXES_TOOL_NAME, Bt as startTeeAttestationHeartbeat, C as RunTangleRouterEvalMatrixInSandboxOptions, Ct as InstanceStart, D as RouterSearchConfigOptions, Dt as ConfidentialSandboxResult, E as RouterSearchConfig, Et as sandboxFailureKind, F as SANDBOX_SIZE_PRESETS, Ft as normalizeRuntimeBackendConfig, G as manageSandboxesInputSchema, Gt as parseSSEStream, H as ManageSandboxesTool, Ht as ImageSpec, I as resolveSandboxResources, It as requestedPublicProfileDigest, J as collectAgentResponseText, Jt as Team, K as applySandboxEventText, Kt as CreateTeamOptions, L as sandboxResourcesForSize, Lt as TeeAttestationHeartbeat, M as buildTangleRouterSearchProfile, Mt as BatchResultAccumulator, N as fetchTangleRouterSearchConfig, Nt as createBatchResultAccumulator, O as TangleSearchProvider, Ot as ConfidentialTeeType, P as DEFAULT_SANDBOX_SIZE, Pt as validateBatchRunRequest, Q as ImageBuildClient, Qt as BackendRegistryCapabilities, R as materializeProfileFileMounts, Rt as TeeAttestationHeartbeatOptions, S as RouterImportedRunResponse, St as InstanceRestartingError, T as runTangleRouterEvalMatrixInSandbox, Tt as SandboxFailureKind, U as ManageSandboxesToolOptions, Ut as ParseSSEStreamOptions, V as ManageSandboxesInput, Vt as BuildProgressEvent, W as createManageSandboxesTool, Wt as ParsedSSEEvent, X as isToolBearingEvent, Xt as TeamMember, Y as getSandboxEventText, Yt as TeamInvitation, Z as Image, Zt as IntelligenceClient, _ as RouterEvalMatrixPayload, _t as ManagedProcessClient, a as SessionBroadcastEvent, an as backendRegistryResponseSchema, at as ISOLATED_CREATION_ATTESTATION_VERSION, b as RouterEvalMatrixScenario, bt as InstanceProfile, c as RunPlacement, cn as parseBackendRegistryResponseBody, ct as SandboxSeatCredentials, d as RunWaitOptions, dt as SeatOwnerTransport, en as BackendRegistryInteractionKind, et as ImageBuildFetchClient, f as RunsClient, ft as SeatResolutionObservation, g as RouterEvalMatrixHarness, gt as gatewaySeatTransport, h as RouterEvalMatrixCaseResult, ht as createSelectSeat, i as terminalUpgradeHeadersSupported, in as backendRegistryInteractionKindSchema, it as generateDockerfile, j as buildTangleRouterSearchBackend, jt as generateAttestationNonce, k as buildTangleRouterEvalMatrixRequest, kt as CreateConfidentialSandboxOptions, l as RunPlacementRecord, lt as SandboxSeatSelectionInput, m as RouterEvalMatrixAgentProfile, mt as SeatSelectionRequest, n as SandboxFleetClient, nn as backendRegistryCapabilitiesSchema, nt as ImageBuildResult, o as SessionBroadcastResult, on as isBackendRegistryInteractionKind, ot as CreateSelectSeatOptions, p as RunsHttpClient, pt as SeatSelectionError, q as collectAgentFinalMessageText, qt as InviteTeamMemberOptions, r as SandboxFleet, rn as backendRegistryEntrySchema, rt as ImageBuilder, s as RunOptions, sn as parseBackendRegistryResponse, st as SandboxResolvedSeat, t as Sandbox, tn as BackendRegistryResponse, tt as ImageBuildOptions, u as RunRecord, ut as SeatOwnerReply, v as RouterEvalMatrixSandboxBox, vt as EnsureInstanceOptions, w as RunTangleRouterEvalMatrixInSandboxResult, wt as InstancesClient, x as RouterEvalMatrixSuiteResponse, xt as InstanceRecord, y as RouterEvalMatrixSandboxClient, yt as HostedInstance, z as MANAGE_SANDBOXES_PARAMETERS, zt as TeeAttestationHeartbeatSample } from "./client-DEvdnu0z.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-I1nMkkrz.js";
9
9
  import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-Dslyq85a.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-Dqcr9p97.js";
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
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 { O as agentInteractiveSessionPromptRequestDigest, 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-Bt1vcu9c.js";
3
- import { A as requestedPublicProfileDigest, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-B4bQwRJL.js";
3
+ import { A as requestedPublicProfileDigest, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, i as terminalUpgradeHeadersSupported, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./interactive-controller-BkfV4Cs_.js";
4
4
  import { n as agentProfileSchema, r as SANDBOX_SIZE_PRESET_NAMES, t as agentProfileConfidentialSchema } from "./profile-schema-CT3hB1mG.js";
5
- import { C as materializeProfileFileMounts, E as validateDeferredProfileFileMounts, S as SandboxOperationFailedError, T as splitInlineProfileSkills, _ as collectAgentResponseText, a as buildTraceExportPayload, b as ManagedProcessClient, c as toOtelJson, d as InteractiveSessionHandle, f as InteractiveTerminalFrameLog, g as collectAgentFinalMessageText, h as applySandboxEventText, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalSession, o as exportTraceBundle, p as createInteractiveTerminalCapture, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as getSandboxEventText, w as splitInlineProfileFileMounts, x as SandboxOperation, y as isToolBearingEvent } from "./sandbox-DAG5tyIP.js";
5
+ import { C as materializeProfileFileMounts, E as validateDeferredProfileFileMounts, S as SandboxOperationFailedError, T as splitInlineProfileSkills, _ as collectAgentResponseText, a as buildTraceExportPayload, b as ManagedProcessClient, c as toOtelJson, d as InteractiveSessionHandle, f as InteractiveTerminalFrameLog, g as collectAgentFinalMessageText, h as applySandboxEventText, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalSession, o as exportTraceBundle, p as createInteractiveTerminalCapture, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as getSandboxEventText, w as splitInlineProfileFileMounts, x as SandboxOperation, y as isToolBearingEvent } from "./sandbox-CTG1pJ1v.js";
6
6
  import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, b as ResumeEnvRequiredError, c as CompliancePlacementError, d as FileWriteConflictError, f as GpuProviderNotConfiguredError, g as NotFoundError, h as NetworkError, l as EdgeNotReadyError, o as BranchFanoutExceedsHostError, p as KeyBudgetExhaustedError, s as CapabilityError, t as TerminalStreamError, u as EgressProxyRecoveryError, v as ProfileFileMountPathError, w as StreamInterruptedError, x as SandboxError, y as QuotaError } from "./errors-ZmDrrk4f.js";
7
- import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-Cig6uTYZ.js";
7
+ import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-VRQjfrZG.js";
8
8
  import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-BTGTf3We.js";
9
- import { t as parseSSEStream } from "./sse-parser-DmO5gP6u.js";
9
+ import { t as parseSSEStream } from "./sse-parser-CJ52bhG3.js";
10
10
  import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-BqZOl_io.js";
11
11
  import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
12
- import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-X0zexFfY.js";
13
- import { s as TangleSandboxClient } from "./tangle-r0QPF3d9.js";
12
+ import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-CGIxrHev.js";
13
+ import { s as TangleSandboxClient } from "./tangle-cI84-QsU.js";
14
14
  import { z } from "zod";
15
15
  //#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
16
16
  /**
@@ -5,7 +5,7 @@ import { S as boundedIdentifierSchema, o as canonicalCandidateDigest$1, w as bou
5
5
  import { n as agentProfileSchema } from "./profile-schema-CT3hB1mG.js";
6
6
  import { E as ValidationError, S as ServerError, h as NetworkError, r as parseResponseError, s as CapabilityError, t as TerminalStreamError, x as SandboxError } from "./errors-ZmDrrk4f.js";
7
7
  import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-jU-SEjLT.js";
8
- import { t as parseSSEStream } from "./sse-parser-DmO5gP6u.js";
8
+ import { t as parseSSEStream } from "./sse-parser-CJ52bhG3.js";
9
9
  import { s as uploadChunked } from "./chunked-upload-Df_5Q2x8.js";
10
10
  import { z } from "zod";
11
11
  const TERMINAL_WS_MAX_DIMENSION = 4096;
@@ -1,6 +1,6 @@
1
1
  import { O as SandboxInstance } from "./index-C3GQDkDm.js";
2
2
  import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-BF8se4_x.js";
3
- import { t as Sandbox } from "./client-KYoUgWWa.js";
3
+ import { t as Sandbox } from "./client-DEvdnu0z.js";
4
4
 
5
5
  //#region src/agent/preview-operations.d.ts
6
6
  type AgentPreviewOptions = Pick<EnsureDevServerOptions, "sessionId" | "cwd"> & {
package/dist/runtime.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-Bt1vcu9c.js";
2
- import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-B4bQwRJL.js";
2
+ import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-BkfV4Cs_.js";
3
3
  import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, d as FileWriteConflictError, g as NotFoundError, h as NetworkError, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-ZmDrrk4f.js";
4
4
  import { t as fetchSandboxApi } from "./api-request-EseiF9B1.js";
5
5
  import { s as uploadChunked } from "./chunked-upload-Df_5Q2x8.js";
@@ -3,7 +3,7 @@ import { A as agentInteractiveSessionStopAcknowledgementMatchesCommand, B as Int
3
3
  import { t as sha256 } from "./sha2-BUPMvGTk.js";
4
4
  import { a as canonicalCandidateDigest$1, h as sha256DigestSchema$1 } from "./harness-BD_OISom.js";
5
5
  import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-DFdTu3lv.js";
6
- import { A as requestedPublicProfileDigest, C as encodeTextForWire, E as assertCurrentBackendType, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodePromptForWire, T as applyRequestedModel, _ as mintTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as sessionHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as waitForRetryAfter, n as InteractiveSessionController, p as isRetryableCredentialRefusal, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as validateAcceptedDispatchRunRef, y as traceHeaders } from "./interactive-controller-B4bQwRJL.js";
6
+ import { A as requestedPublicProfileDigest, C as encodeTextForWire, E as assertCurrentBackendType, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodePromptForWire, T as applyRequestedModel, _ as mintTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as sessionHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as waitForRetryAfter, n as InteractiveSessionController, p as isRetryableCredentialRefusal, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as validateAcceptedDispatchRunRef, y as traceHeaders } from "./interactive-controller-BkfV4Cs_.js";
7
7
  import { S as boundedIdentifierSchema, T as boundedStringSchema, g as sha256DigestSchema$2, o as canonicalCandidateDigest$2, s as canonicalCandidateJson$1, u as isCanonicalJsonValue$1 } from "./harness-DWL2MM4q.js";
8
8
  import { i as canonicalAgentProfileValue, n as agentProfileSchema } from "./profile-schema-CT3hB1mG.js";
9
9
  import { A as SANDBOX_PROXY_REQUEST_MAX_BYTES, C as StateError, E as ValidationError, F as isProfileFileMountOutsideRoots, I as profileFileMountOutsideRootsMessage, M as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, N as SANDBOX_AGENT_HOME, P as SANDBOX_FILE_API_ABSOLUTE_ROOTS, S as ServerError, T as TimeoutError, a as AuthError, g as NotFoundError, h as NetworkError, i as readResponseJson, l as EdgeNotReadyError, n as parseErrorResponse, r as parseResponseError, s as CapabilityError, t as TerminalStreamError, v as ProfileFileMountPathError, w as StreamInterruptedError, x as SandboxError, y as QuotaError } from "./errors-ZmDrrk4f.js";
@@ -11,7 +11,7 @@ import { n as combineAbortSignals, r as delayUntilAborted, t as awaitWithAbort }
11
11
  import { t as rewrapResponse } from "./response-rewrap-MBztoTLx.js";
12
12
  import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-C2DX2_rG.js";
13
13
  import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-Dty4zmN7.js";
14
- import { t as parseSSEStream } from "./sse-parser-DmO5gP6u.js";
14
+ import { t as parseSSEStream } from "./sse-parser-CJ52bhG3.js";
15
15
  import { s as uploadChunked } from "./chunked-upload-Df_5Q2x8.js";
16
16
  import { t as runPreparedProcess } from "./prepared-process-LjBfQnZ5.js";
17
17
  import { n as SandboxLines } from "./lines-BqZOl_io.js";
@@ -1,4 +1,4 @@
1
- import { dt as SeatOwnerTransport } from "./client-KYoUgWWa.js";
1
+ import { dt as SeatOwnerTransport } from "./client-DEvdnu0z.js";
2
2
 
3
3
  //#region src/select-seat-command.d.ts
4
4
  /** Public reply bound; the owner prints one metadata object. */
@@ -1,6 +1,6 @@
1
1
  import { n as combineAbortSignals } from "../abort-signal-jU-SEjLT.js";
2
2
  import "../sidecar-proxy-error-Dty4zmN7.js";
3
- import { t as parseSSEStream } from "../sse-parser-DmO5gP6u.js";
3
+ import { t as parseSSEStream } from "../sse-parser-CJ52bhG3.js";
4
4
  //#region ../../../packages/runtime-contracts/dist/session-gateway.js
5
5
  /**
6
6
  * Calculate connection quality from metrics.
@@ -0,0 +1,78 @@
1
+ import { streamSSEFrames } from "@tangle-network/agent-core/sse";
2
+ //#region src/lib/sse-parser.ts
3
+ /**
4
+ * SSE Stream Parser
5
+ *
6
+ * EventSource stream parsing for SDK consumers. Framing — buffering
7
+ * chunk-straddling frames, LF/CRLF terminators, multi-line `data:` joins,
8
+ * comment heartbeats, BOM — lives in `@tangle-network/agent-core/sse`, the
9
+ * one wire-format implementation, which imports nothing. This
10
+ * module owns the SDK's payload contract on top of it: JSON parsing, the
11
+ * `"message"` default event type, and the malformed-frame policy. Used by
12
+ * `Sandbox.streamBatch` and by the web dashboard's batch page; exported
13
+ * so downstream surfaces don't maintain their own copies.
14
+ *
15
+ * Guarantees:
16
+ * - Correctly buffers frames that straddle chunk boundaries.
17
+ * - Accepts LF- and CRLF-terminated streams interchangeably.
18
+ * - Joins multi-line `data:` per the spec (dispatch joins with
19
+ * "\n" before JSON parse).
20
+ * - Defaults event type to `"message"` when a frame carries
21
+ * `data:` but no `event:` field (SSE spec §9.2.6 step 3).
22
+ * - Surfaces optional `id:` so callers can implement reconnection.
23
+ * - Flushes a dangling event when the stream closes without a
24
+ * terminating blank line (well-behaved servers emit `\n\n`, but
25
+ * some close early).
26
+ * - Throws `AbortError` when the caller-supplied signal fires, so
27
+ * consumers can distinguish "ran to completion" from "cancelled"
28
+ * without peeking at signal state.
29
+ * - Rejects malformed JSON by default. Callers handling recoverable output
30
+ * streams can explicitly warn and skip one invalid frame.
31
+ *
32
+ * What it does NOT do:
33
+ * - CR-only (legacy Mac) line terminators. No known emitter uses
34
+ * them; supporting them would risk splitting payloads that
35
+ * legitimately contain CR.
36
+ * - Retry/reconnect (caller's responsibility).
37
+ * - Event-type filtering (caller's responsibility).
38
+ */
39
+ /**
40
+ * Parse a streaming SSE response body into an async iterable of
41
+ * structured events.
42
+ *
43
+ * @throws `TypeError` when the response has no body.
44
+ * @throws `DOMException` with `name === "AbortError"` on cancellation.
45
+ */
46
+ async function* parseSSEStream(body, options) {
47
+ const { signal, invalidEvent = "throw", idleMs } = options ?? {};
48
+ for await (const frame of streamSSEFrames(body, {
49
+ signal,
50
+ idleMs
51
+ })) {
52
+ const effectiveEvent = frame.event || "message";
53
+ let data;
54
+ try {
55
+ data = JSON.parse(frame.data);
56
+ } catch (error) {
57
+ if (invalidEvent === "warn-and-skip") {
58
+ console.warn(`[sandbox-sdk] Malformed SSE JSON for event "${effectiveEvent}": ${frame.data.slice(0, 200)}`);
59
+ continue;
60
+ }
61
+ throw new SyntaxError(`Malformed SSE JSON for event "${effectiveEvent}"`, { cause: error });
62
+ }
63
+ if (typeof data !== "object" || data === null || Array.isArray(data)) {
64
+ if (invalidEvent === "warn-and-skip") {
65
+ console.warn(`[sandbox-sdk] SSE event "${effectiveEvent}" data must be a JSON object`);
66
+ continue;
67
+ }
68
+ throw new TypeError(`SSE event "${effectiveEvent}" data must be a JSON object`);
69
+ }
70
+ yield {
71
+ type: effectiveEvent,
72
+ data,
73
+ id: frame.id
74
+ };
75
+ }
76
+ }
77
+ //#endregion
78
+ export { parseSSEStream as t };
@@ -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-r0QPF3d9.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-cI84-QsU.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,4 +1,4 @@
1
- import { n as createSandboxInstanceFromResponse } from "./sandbox-DAG5tyIP.js";
1
+ import { n as createSandboxInstanceFromResponse } from "./sandbox-CTG1pJ1v.js";
2
2
  import { i as readResponseJson } from "./errors-ZmDrrk4f.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-vaFoyyiO.js";
4
4
  //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -156,13 +156,12 @@
156
156
  "@products/sandbox-test-utils": "0.0.0",
157
157
  "@repo/shared": "0.0.0",
158
158
  "@tangle-network/agent-profile-materialize": "0.26.0",
159
- "@tangle-network/runtime-contracts": "0.19.0",
160
159
  "@tangle-network/cli-agent-registry": "0.10.2",
161
- "@tangle-network/sse-core": "0.0.0"
160
+ "@tangle-network/runtime-contracts": "0.19.0"
162
161
  },
163
162
  "tangleRelease": {
164
- "sourceSha": "a4ef36c38c31cfe33dea69d3a044ff84c0ecf458",
165
- "mergedAt": "2026-10-26T21:37:18-06:00"
163
+ "sourceSha": "9c8c29269a912c1a9a002a9001b0a9638daa9a79",
164
+ "mergedAt": "2026-10-26T21:49:38-06:00"
166
165
  },
167
166
  "scripts": {
168
167
  "build": "node scripts/build-dist.mjs",
@@ -1,227 +0,0 @@
1
- //#region ../../../packages/sse-core/dist/index.js
2
- /**
3
- * A copy of `value` that shares no memory with the string it was cut from.
4
- *
5
- * V8 can return a short substring of a long string as a view that keeps the
6
- * whole string alive. Consumers keep event names and ids as long as they keep
7
- * events, so a view would keep every chunk its frame arrived in alive.
8
- */
9
- function detached(value) {
10
- return value === "" ? value : JSON.parse(JSON.stringify(value));
11
- }
12
- /**
13
- * Thrown when a stream sends no bytes for longer than its `idleMs`. A
14
- * producer that heartbeats would have written in that time, so the
15
- * connection is dead even though it never closed: a half-open TCP connection
16
- * or a stalled proxy hold the socket open while nothing arrives.
17
- */
18
- var SSEStreamSilentError = class extends Error {
19
- name = "SSEStreamSilentError";
20
- idleMs;
21
- constructor(idleMs) {
22
- super(`SSE stream sent no bytes for ${idleMs} ms`);
23
- this.idleMs = idleMs;
24
- }
25
- };
26
- /**
27
- * Incremental SSE frame parser. Feed decoded text via `push()`; call
28
- * `flush()` when the stream ends.
29
- */
30
- var SSEFrameParser = class {
31
- buffer = "";
32
- frameEvent = "";
33
- frameId;
34
- frameDataLines = null;
35
- bomChecked = false;
36
- /**
37
- * Append a decoded text chunk and return every frame the chunk
38
- * completes. Frame state survives across calls: one frame can
39
- * straddle any number of chunks.
40
- */
41
- push(chunk) {
42
- let text = chunk;
43
- if (!this.bomChecked && text.length > 0) {
44
- this.bomChecked = true;
45
- if (text.charCodeAt(0) === 65279) text = text.slice(1);
46
- }
47
- this.buffer += text;
48
- const lines = this.buffer.split("\n");
49
- this.buffer = lines.pop() ?? "";
50
- return this.processLines(lines);
51
- }
52
- /**
53
- * End-of-stream: process the unterminated trailing line, then
54
- * dispatch a dangling frame that never got its blank line.
55
- * Well-behaved servers end frames with "\n\n", but some close early.
56
- */
57
- flush() {
58
- const rest = this.buffer;
59
- this.buffer = "";
60
- const frames = rest.length > 0 ? this.processLines([rest]) : [];
61
- const dangling = this.dispatch();
62
- if (dangling) frames.push(dangling);
63
- return frames;
64
- }
65
- processLines(lines) {
66
- const frames = [];
67
- for (const rawLine of lines) {
68
- const line = rawLine.endsWith("\r") ? rawLine.slice(0, -1) : rawLine;
69
- if (line === "") {
70
- const frame = this.dispatch();
71
- if (frame) frames.push(frame);
72
- continue;
73
- }
74
- if (line.startsWith(":")) continue;
75
- if (line.startsWith("data:")) {
76
- let value = line.slice(5);
77
- if (value.startsWith(" ")) value = value.slice(1);
78
- if (this.frameDataLines === null) this.frameDataLines = [];
79
- this.frameDataLines.push(value);
80
- continue;
81
- }
82
- if (line.startsWith("event:")) {
83
- this.frameEvent = line.slice(6).trim();
84
- continue;
85
- }
86
- if (line.startsWith("id:")) this.frameId = line.slice(3).trim();
87
- }
88
- return frames;
89
- }
90
- /**
91
- * Dispatch the accumulated frame. A frame with no `data:` field (an
92
- * `event:`/`id:`-only frame, or a bare comment) produces nothing, and
93
- * its field state is consumed and reset either way.
94
- */
95
- dispatch() {
96
- const dataLines = this.frameDataLines;
97
- const frame = dataLines ? {
98
- event: detached(this.frameEvent),
99
- data: dataLines.join("\n"),
100
- id: this.frameId ? detached(this.frameId) : void 0
101
- } : null;
102
- this.frameEvent = "";
103
- this.frameId = void 0;
104
- this.frameDataLines = null;
105
- return frame;
106
- }
107
- };
108
- /**
109
- * Read a streaming SSE response body into parsed frames.
110
- *
111
- * @throws `TypeError` when the body is missing.
112
- * @throws `DOMException` with `name === "AbortError"` on cancellation —
113
- * including the WHATWG-fetch variant where an aborted body resolves
114
- * `done: true` instead of rejecting the read.
115
- */
116
- async function* streamSSEFrames(body, options) {
117
- if (!body) throw new TypeError("SSE stream has no response body");
118
- const reader = body.getReader();
119
- const decoder = new TextDecoder();
120
- const parser = new SSEFrameParser();
121
- const { signal, idleMs } = options ?? {};
122
- const read = () => {
123
- const limit = idleMs?.();
124
- if (limit === void 0) return reader.read();
125
- let timer;
126
- return Promise.race([reader.read(), new Promise((_, reject) => {
127
- timer = setTimeout(() => reject(new SSEStreamSilentError(limit)), limit);
128
- })]).finally(() => clearTimeout(timer));
129
- };
130
- let completed = false;
131
- try {
132
- for (;;) {
133
- if (signal?.aborted) throw new DOMException("SSE stream aborted", "AbortError");
134
- const { done, value } = await read();
135
- if (done) {
136
- if (signal?.aborted) throw new DOMException("SSE stream aborted", "AbortError");
137
- break;
138
- }
139
- for (const frame of parser.push(decoder.decode(value, { stream: true }))) yield frame;
140
- }
141
- for (const frame of parser.push(decoder.decode())) yield frame;
142
- for (const frame of parser.flush()) yield frame;
143
- completed = true;
144
- } finally {
145
- if (!completed) await reader.cancel().catch(() => void 0);
146
- reader.releaseLock();
147
- }
148
- }
149
- //#endregion
150
- //#region src/lib/sse-parser.ts
151
- /**
152
- * SSE Stream Parser
153
- *
154
- * EventSource stream parsing for SDK consumers. Framing — buffering
155
- * chunk-straddling frames, LF/CRLF terminators, multi-line `data:` joins,
156
- * comment heartbeats, BOM — lives in `@tangle-network/sse-core`, the one
157
- * wire-format implementation shared across the repo (bundled into this
158
- * package's dist, so the SDK stays dependency-free at runtime). This
159
- * module owns the SDK's payload contract on top of it: JSON parsing, the
160
- * `"message"` default event type, and the malformed-frame policy. Used by
161
- * `Sandbox.streamBatch` and by the web dashboard's batch page; exported
162
- * so downstream surfaces don't maintain their own copies.
163
- *
164
- * Guarantees:
165
- * - Correctly buffers frames that straddle chunk boundaries.
166
- * - Accepts LF- and CRLF-terminated streams interchangeably.
167
- * - Joins multi-line `data:` per the spec (dispatch joins with
168
- * "\n" before JSON parse).
169
- * - Defaults event type to `"message"` when a frame carries
170
- * `data:` but no `event:` field (SSE spec §9.2.6 step 3).
171
- * - Surfaces optional `id:` so callers can implement reconnection.
172
- * - Flushes a dangling event when the stream closes without a
173
- * terminating blank line (well-behaved servers emit `\n\n`, but
174
- * some close early).
175
- * - Throws `AbortError` when the caller-supplied signal fires, so
176
- * consumers can distinguish "ran to completion" from "cancelled"
177
- * without peeking at signal state.
178
- * - Rejects malformed JSON by default. Callers handling recoverable output
179
- * streams can explicitly warn and skip one invalid frame.
180
- *
181
- * What it does NOT do:
182
- * - CR-only (legacy Mac) line terminators. No known emitter uses
183
- * them; supporting them would risk splitting payloads that
184
- * legitimately contain CR.
185
- * - Retry/reconnect (caller's responsibility).
186
- * - Event-type filtering (caller's responsibility).
187
- */
188
- /**
189
- * Parse a streaming SSE response body into an async iterable of
190
- * structured events.
191
- *
192
- * @throws `TypeError` when the response has no body.
193
- * @throws `DOMException` with `name === "AbortError"` on cancellation.
194
- */
195
- async function* parseSSEStream(body, options) {
196
- const { signal, invalidEvent = "throw", idleMs } = options ?? {};
197
- for await (const frame of streamSSEFrames(body, {
198
- signal,
199
- idleMs
200
- })) {
201
- const effectiveEvent = frame.event || "message";
202
- let data;
203
- try {
204
- data = JSON.parse(frame.data);
205
- } catch (error) {
206
- if (invalidEvent === "warn-and-skip") {
207
- console.warn(`[sandbox-sdk] Malformed SSE JSON for event "${effectiveEvent}": ${frame.data.slice(0, 200)}`);
208
- continue;
209
- }
210
- throw new SyntaxError(`Malformed SSE JSON for event "${effectiveEvent}"`, { cause: error });
211
- }
212
- if (typeof data !== "object" || data === null || Array.isArray(data)) {
213
- if (invalidEvent === "warn-and-skip") {
214
- console.warn(`[sandbox-sdk] SSE event "${effectiveEvent}" data must be a JSON object`);
215
- continue;
216
- }
217
- throw new TypeError(`SSE event "${effectiveEvent}" data must be a JSON object`);
218
- }
219
- yield {
220
- type: effectiveEvent,
221
- data,
222
- id: frame.id
223
- };
224
- }
225
- }
226
- //#endregion
227
- export { parseSSEStream as t };