@tangle-network/sandbox 1.0.198 → 1.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +4 -4
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +1 -1
- package/dist/{api-request-8D8_deoB.js → api-request-DIleh2_r.js} +1 -1
- package/dist/{client-DtQu5U1z.d.ts → client-DI6zE8oB.d.ts} +8 -30
- package/dist/{client-DDEXfah8.js → client-P8MtzuCr.js} +4 -4
- package/dist/{core-DnM7jlJY.js → core-BIwp7ngT.js} +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/intelligence/index.js +1 -1
- package/dist/{interactive-controller-CbA-njUb.js → interactive-controller-CeMBZkXh.js} +3 -1
- package/dist/{mcp-local-sY5ndk_e.js → mcp-local-OSoB6VAi.js} +2 -2
- package/dist/{preview-DcjUC7Wh.d.ts → preview-Dd3Zr9YO.d.ts} +1 -1
- package/dist/runtime.js +2 -2
- package/dist/{sandbox-DMCbx2hY.js → sandbox-DLz2JNkc.js} +13 -11
- package/dist/select-seat-command.d.ts +1 -1
- package/dist/session-gateway/index.js +6 -2
- package/dist/sse-parser-DXRUx6gh.js +58 -0
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-F0HlLqTM.js → tangle-CzOXzt2N.js} +1 -1
- package/package.json +4 -4
- package/dist/sse-parser-B4aH89Nq.js +0 -78
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-BZY242A9.js";
|
|
2
2
|
import { Bt as SandboxFleetParent, Ha as CodeExecutionResult, Ua as CodeLanguage, Ur as CodeExecutionOptions, Wa as CodeResultPart, ga as BackendConfig, ia as SessionListOptions, na as SessionInfo, wo as BackendType } from "../types-CmvYNLKn.js";
|
|
3
|
-
import { t as Sandbox } from "../client-
|
|
4
|
-
import { u as PreviewAuthorizer } from "../preview-
|
|
3
|
+
import { t as Sandbox } from "../client-DI6zE8oB.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-Dd3Zr9YO.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";
|
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-
|
|
2
|
-
import { O as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-OSoB6VAi.js";
|
|
2
|
+
import { O as assertCurrentBackendType } from "../interactive-controller-CeMBZkXh.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-DLz2JNkc.js";
|
|
4
4
|
import { D as ValidationError, _ as NotFoundError, w as StateError } from "../errors-DKIV20jZ.js";
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
5
|
+
import { t as Sandbox } from "../client-P8MtzuCr.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
8
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
package/dist/agent/preview.d.ts
CHANGED
|
@@ -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-
|
|
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-Dd3Zr9YO.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 };
|
package/dist/agent/preview.js
CHANGED
|
@@ -66,7 +66,7 @@ async function servePreviewMcp(request, config) {
|
|
|
66
66
|
if (typeof config.authorize !== "function") throw new Error("Preview MCP requires a host authorization callback");
|
|
67
67
|
const tools = config.tools ?? PREVIEW_TOOLS;
|
|
68
68
|
if (!tools.length || tools.some((tool) => !PREVIEW_TOOLS.includes(tool))) throw new Error("Preview MCP requires an explicit nonempty preview-only tool grant");
|
|
69
|
-
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-
|
|
69
|
+
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-OSoB6VAi.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
|
|
70
70
|
const handle = await createMcpServer(config.box, {
|
|
71
71
|
name: "tangle-previews",
|
|
72
72
|
sessionId: config.sessionId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as rewrapResponse } from "./response-rewrap-Cjoxh2wZ.js";
|
|
2
2
|
//#region src/lib/api-request.mjs
|
|
3
3
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
4
|
-
const SDK_VERSION = "1.0.
|
|
4
|
+
const SDK_VERSION = "1.0.199";
|
|
5
5
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
6
6
|
const headers = new Headers(response.headers);
|
|
7
7
|
headers.set("x-tangle-request-path", path);
|
|
@@ -584,38 +584,16 @@ interface ServerFleetRecord {
|
|
|
584
584
|
/**
|
|
585
585
|
* SSE Stream Parser
|
|
586
586
|
*
|
|
587
|
-
* EventSource stream parsing for SDK consumers. Framing
|
|
588
|
-
*
|
|
589
|
-
* comment heartbeats, BOM — lives in `@tangle-network/agent-core/sse`, the
|
|
590
|
-
* one wire-format implementation, which imports nothing. This
|
|
587
|
+
* EventSource stream parsing for SDK consumers. Framing lives in
|
|
588
|
+
* `@tangle-network/agent-core/sse`, the one wire-format implementation. This
|
|
591
589
|
* module owns the SDK's payload contract on top of it: JSON parsing, the
|
|
592
|
-
* `"message"` default event type,
|
|
593
|
-
*
|
|
594
|
-
*
|
|
590
|
+
* `"message"` default event type (SSE spec §9.2.6 step 3), the malformed-frame
|
|
591
|
+
* policy, and restoring part text a stream sent as suffixes. Used by
|
|
592
|
+
* `Sandbox.streamBatch` and by the web dashboard's batch page; exported so
|
|
593
|
+
* downstream surfaces don't maintain their own copies.
|
|
595
594
|
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
* - Accepts LF- and CRLF-terminated streams interchangeably.
|
|
599
|
-
* - Joins multi-line `data:` per the spec (dispatch joins with
|
|
600
|
-
* "\n" before JSON parse).
|
|
601
|
-
* - Defaults event type to `"message"` when a frame carries
|
|
602
|
-
* `data:` but no `event:` field (SSE spec §9.2.6 step 3).
|
|
603
|
-
* - Surfaces optional `id:` so callers can implement reconnection.
|
|
604
|
-
* - Flushes a dangling event when the stream closes without a
|
|
605
|
-
* terminating blank line (well-behaved servers emit `\n\n`, but
|
|
606
|
-
* some close early).
|
|
607
|
-
* - Throws `AbortError` when the caller-supplied signal fires, so
|
|
608
|
-
* consumers can distinguish "ran to completion" from "cancelled"
|
|
609
|
-
* without peeking at signal state.
|
|
610
|
-
* - Rejects malformed JSON by default. Callers handling recoverable output
|
|
611
|
-
* streams can explicitly warn and skip one invalid frame.
|
|
612
|
-
*
|
|
613
|
-
* What it does NOT do:
|
|
614
|
-
* - CR-only line terminators. No known emitter uses
|
|
615
|
-
* them; supporting them would risk splitting payloads that
|
|
616
|
-
* legitimately contain CR.
|
|
617
|
-
* - Retry/reconnect (caller's responsibility).
|
|
618
|
-
* - Event-type filtering (caller's responsibility).
|
|
595
|
+
* Throws `AbortError` when the caller's signal fires, so a consumer can tell a
|
|
596
|
+
* finished stream from a cancelled one. Retry and filtering are the caller's.
|
|
619
597
|
*/
|
|
620
598
|
interface ParsedSSEEvent {
|
|
621
599
|
/** Event type from the `event:` field, e.g. `task.completed`. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as normalizeRuntimeBackendConfig, D as applyRequestedModel, E as isBrowserRuntime, H as backendTypeSchema, N as withProfileHarness, O as assertCurrentBackendType, P as withoutCreateOnlyModelFields, S as encodePromptForWire, o as requestInteractiveSessionToken } from "./interactive-controller-
|
|
1
|
+
import { A as normalizeRuntimeBackendConfig, D as applyRequestedModel, E as isBrowserRuntime, H as backendTypeSchema, N as withProfileHarness, O as assertCurrentBackendType, P as withoutCreateOnlyModelFields, S as encodePromptForWire, o as requestInteractiveSessionToken } from "./interactive-controller-CeMBZkXh.js";
|
|
2
2
|
import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
|
|
3
|
-
import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as extendableDeadline, I as normalizeEgressPolicyFields, J as isDeployWindowCreateError, K as generateIdempotencyKey, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as createRetryDelayMs, X as isRetryableCreateError, Y as isRateLimitCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as isCapacityShortageCreateError, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-
|
|
3
|
+
import { A as normalizeSandboxCreateReceipt, B as CAPACITY_ETA_WAIT_MAX_MS, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, F as normalizeConnection, G as extendableDeadline, I as normalizeEgressPolicyFields, J as isDeployWindowCreateError, K as generateIdempotencyKey, L as normalizeProxySecretReceipt, N as dateOf, O as isRetryableProfileFileMaterializeFailure, P as parseLifecycleTimes, R as normalizeSandboxShape, T as splitInlineProfileFileMounts, U as DEPLOY_WINDOW_RETRY_MS, W as createRetryDelayMs, X as isRetryableCreateError, Y as isRateLimitCreateError, d as sandboxLedgerUsd, j as normalizeStartupDiagnostics, k as normalizeCaptureProof, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as isCapacityShortageCreateError, z as CAPACITY_ETA_MARGIN_MS } from "./sandbox-DLz2JNkc.js";
|
|
4
4
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, a as readResponseJson, g as NetworkError, i as parseResponseError, o as retryWhen, r as parseErrorResponse, s as AuthError, v as PartialFailureError } from "./errors-DKIV20jZ.js";
|
|
5
5
|
import { r as combineAbortSignals, t as abortableSleep } from "./abort-signal-Cu4F2VVz.js";
|
|
6
6
|
import { l as SANDBOX_AGENT_HOME, t as isInsideReservedDir } from "./file-transfer-Cr9Ossea.js";
|
|
7
|
-
import { n as fetchSandboxApi } from "./api-request-
|
|
7
|
+
import { n as fetchSandboxApi } from "./api-request-DIleh2_r.js";
|
|
8
8
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-C2lFwrMA.js";
|
|
9
|
-
import { t as parseSSEStream } from "./sse-parser-
|
|
9
|
+
import { t as parseSSEStream } from "./sse-parser-DXRUx6gh.js";
|
|
10
10
|
import { t as LinesClient } from "./lines-D3CdWX7Y.js";
|
|
11
11
|
import { PublicTemplatesClient } from "./public-templates.js";
|
|
12
12
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
|
|
2
|
-
import { Z as canonicalAgentProfileDigest } from "./sandbox-
|
|
2
|
+
import { Z as canonicalAgentProfileDigest } from "./sandbox-DLz2JNkc.js";
|
|
3
3
|
import { D as ValidationError, S as SandboxError, l as CapabilityError } from "./errors-DKIV20jZ.js";
|
|
4
4
|
import { n as awaitWithAbort } from "./abort-signal-Cu4F2VVz.js";
|
|
5
5
|
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
|
package/dist/core.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryRep
|
|
|
2
2
|
import { Ct as ServerError, Dt as TimeoutError, Ot as ValidationError, St as SandboxFailureDetail, _t as ProfileFileMountPathError, bt as SandboxError, gt as PartialFailureError, ht as NotFoundError, it as AuthError, mt as NetworkError, ot as CapabilityError, rt as parseErrorResponse, ut as FileWriteConflictError, vt as QuotaError, wt as StateError, xt as SandboxErrorJson } from "./terminal-stream-types-Dy12OgR4.js";
|
|
3
3
|
import { En as SandboxConfig, Ga as ExecResult, Gr as ManagedProcessOptions, H as PreviewLinkInfo, Ia as WorkspaceImagePublishInput, In as NetworkConfig, Ja as SandboxEnvRecoveryView, Jr as ManagedProcessRecord, Kr as ManagedProcessResumeOptions, La as WorkspaceImagePublishResult, Ri as ConversationTurnOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, W as PreviewLinkWaitOptions, Wr as ManagedProcessJobs, Yr as ManagedProcessSpec, an as SandboxInfo, kn as SandboxStatus, oa as SessionMessageAdmission, qa as SandboxEnvRecovery, qr as ManagedProcessState, wi as PromptInputPart, yr as ExecOptions, zi as ConversationTurnResult } from "./types-CmvYNLKn.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-CmxWSizM.js";
|
|
5
|
-
import { Ct as InstanceRestartingError, Dt as sandboxFailureKind, Et as SandboxFailureKind, St as InstanceRecord, Tt as InstancesClient, _t as gatewaySeatTransport, an as backendRegistryEntrySchema, bt as HostedInstance, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, dt as SeatOwnerReply, en as BackendRegistryCapabilities, ft as SeatOwnerTransport, gt as createSelectSeat, ht as SeatSelectionRequest, in as backendRegistryCapabilitiesSchema, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, mt as SeatSelectionError, nn as BackendRegistryInteractionKind, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, pt as SeatResolutionObservation, rn as BackendRegistryResponse, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, vt as ManagedProcessClient, xt as InstanceProfile, yt as EnsureInstanceOptions } from "./client-
|
|
5
|
+
import { Ct as InstanceRestartingError, Dt as sandboxFailureKind, Et as SandboxFailureKind, St as InstanceRecord, Tt as InstancesClient, _t as gatewaySeatTransport, an as backendRegistryEntrySchema, bt as HostedInstance, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, dt as SeatOwnerReply, en as BackendRegistryCapabilities, ft as SeatOwnerTransport, gt as createSelectSeat, ht as SeatSelectionRequest, in as backendRegistryCapabilitiesSchema, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, mt as SeatSelectionError, nn as BackendRegistryInteractionKind, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, pt as SeatResolutionObservation, rn as BackendRegistryResponse, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, vt as ManagedProcessClient, xt as InstanceProfile, yt as EnsureInstanceOptions } from "./client-DI6zE8oB.js";
|
|
6
6
|
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-DV6L-Ndd.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, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-
|
|
1
|
+
import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-DLz2JNkc.js";
|
|
2
2
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, b as QuotaError, g as NetworkError, l as CapabilityError, p as FileWriteConflictError, r as parseErrorResponse, s as AuthError, v as PartialFailureError, w as StateError, y as ProfileFileMountPathError } from "./errors-DKIV20jZ.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-
|
|
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-P8MtzuCr.js";
|
|
4
4
|
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-D3CdWX7Y.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-
|
|
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-BIwp7ngT.js";
|
|
7
7
|
export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, ProfileFileMountPathError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, SeatSelectionError, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, sandboxFailureKind };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { $ as CreateSandboxFleetOptions, $a as RawEvidenceBoxDirectoryExport, $i
|
|
|
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-CmxWSizM.js";
|
|
5
5
|
import { _ as InteractiveSessionStatus, a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as interactiveSessionIdentityDigest, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, 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-BgHKZaE7.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-DRUUUo4N.js";
|
|
7
|
-
import { $ as ImageBuildClient, $t as IntelligenceClient, A as buildTangleRouterResponsesWebSearchRequest, At as CreateConfidentialSandboxOptions, B as MANAGE_SANDBOXES_TOOL_NAME, Bt as TeeAttestationHeartbeatSample, C as RunTangleRouterEvalMatrixInSandboxOptions, Ct as InstanceRestartingError, D as RouterSearchConfigOptions, Dt as sandboxFailureKind, E as RouterSearchConfig, Et as SandboxFailureKind, F as SANDBOX_SIZE_PRESETS, Ft as validateBatchRunRequest, G as manageSandboxesInputSchema, Gt as ParseSSEStreamOptions, H as ManageSandboxesTool, Ht as BuildProgressEvent, I as resolveSandboxResources, It as normalizeRuntimeBackendConfig, J as collectAgentFinalMessageText, Jt as CreateTeamOptions, K as downloadFile, Kt as ParsedSSEEvent, L as sandboxResourcesForSize, Lt as requestedPublicProfileDigest, M as buildTangleRouterSearchProfile, Mt as generateAttestationNonce, N as fetchTangleRouterSearchConfig, Nt as BatchResultAccumulator, O as TangleSearchProvider, Ot as ConfidentialSandboxResult, P as DEFAULT_SANDBOX_SIZE, Pt as createBatchResultAccumulator, Q as Image, Qt as TeamMember, R as materializeProfileFileMounts, Rt as TeeAttestationHeartbeat, S as RouterImportedRunResponse, St as InstanceRecord, T as runTangleRouterEvalMatrixInSandbox, Tt as InstancesClient, U as ManageSandboxesToolOptions, Ut as ImageSpec, V as ManageSandboxesInput, Vt as startTeeAttestationHeartbeat, W as createManageSandboxesTool, Wt as DEFAULT_MAX_EXECUTION_TTL_MS, X as getSandboxEventText, Xt as Team, Y as collectAgentResponseText, Yt as InviteTeamMemberOptions, Z as isToolBearingEvent, Zt as TeamInvitation, _ as RouterEvalMatrixPayload, _t as gatewaySeatTransport, a as SessionBroadcastEvent, an as backendRegistryEntrySchema, at as generateDockerfile, b as RouterEvalMatrixScenario, bt as HostedInstance, c as RunPlacement, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, d as RunWaitOptions, dt as SeatOwnerReply, en as BackendRegistryCapabilities, et as ImageBuildClientConfig, f as RunsClient, ft as SeatOwnerTransport, g as RouterEvalMatrixHarness, gt as createSelectSeat, h as RouterEvalMatrixCaseResult, ht as SeatSelectionRequest, i as terminalUpgradeHeadersSupported, in as backendRegistryCapabilitiesSchema, it as ImageBuilder, j as buildTangleRouterSearchBackend, jt as createConfidentialSandbox, k as buildTangleRouterEvalMatrixRequest, kt as ConfidentialTeeType, l as RunPlacementRecord, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, m as RouterEvalMatrixAgentProfile, mt as SeatSelectionError, n as SandboxFleetClient, nn as BackendRegistryInteractionKind, nt as ImageBuildOptions, o as SessionBroadcastResult, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, p as RunsHttpClient, pt as SeatResolutionObservation, q as applySandboxEventText, qt as parseSSEStream, r as SandboxFleet, rn as BackendRegistryResponse, rt as ImageBuildResult, s as RunOptions, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, tt as ImageBuildFetchClient, u as RunRecord, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, v as RouterEvalMatrixSandboxBox, vt as ManagedProcessClient, w as RunTangleRouterEvalMatrixInSandboxResult, wt as InstanceStart, x as RouterEvalMatrixSuiteResponse, xt as InstanceProfile, y as RouterEvalMatrixSandboxClient, yt as EnsureInstanceOptions, z as MANAGE_SANDBOXES_PARAMETERS, zt as TeeAttestationHeartbeatOptions } from "./client-
|
|
7
|
+
import { $ as ImageBuildClient, $t as IntelligenceClient, A as buildTangleRouterResponsesWebSearchRequest, At as CreateConfidentialSandboxOptions, B as MANAGE_SANDBOXES_TOOL_NAME, Bt as TeeAttestationHeartbeatSample, C as RunTangleRouterEvalMatrixInSandboxOptions, Ct as InstanceRestartingError, D as RouterSearchConfigOptions, Dt as sandboxFailureKind, E as RouterSearchConfig, Et as SandboxFailureKind, F as SANDBOX_SIZE_PRESETS, Ft as validateBatchRunRequest, G as manageSandboxesInputSchema, Gt as ParseSSEStreamOptions, H as ManageSandboxesTool, Ht as BuildProgressEvent, I as resolveSandboxResources, It as normalizeRuntimeBackendConfig, J as collectAgentFinalMessageText, Jt as CreateTeamOptions, K as downloadFile, Kt as ParsedSSEEvent, L as sandboxResourcesForSize, Lt as requestedPublicProfileDigest, M as buildTangleRouterSearchProfile, Mt as generateAttestationNonce, N as fetchTangleRouterSearchConfig, Nt as BatchResultAccumulator, O as TangleSearchProvider, Ot as ConfidentialSandboxResult, P as DEFAULT_SANDBOX_SIZE, Pt as createBatchResultAccumulator, Q as Image, Qt as TeamMember, R as materializeProfileFileMounts, Rt as TeeAttestationHeartbeat, S as RouterImportedRunResponse, St as InstanceRecord, T as runTangleRouterEvalMatrixInSandbox, Tt as InstancesClient, U as ManageSandboxesToolOptions, Ut as ImageSpec, V as ManageSandboxesInput, Vt as startTeeAttestationHeartbeat, W as createManageSandboxesTool, Wt as DEFAULT_MAX_EXECUTION_TTL_MS, X as getSandboxEventText, Xt as Team, Y as collectAgentResponseText, Yt as InviteTeamMemberOptions, Z as isToolBearingEvent, Zt as TeamInvitation, _ as RouterEvalMatrixPayload, _t as gatewaySeatTransport, a as SessionBroadcastEvent, an as backendRegistryEntrySchema, at as generateDockerfile, b as RouterEvalMatrixScenario, bt as HostedInstance, c as RunPlacement, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, d as RunWaitOptions, dt as SeatOwnerReply, en as BackendRegistryCapabilities, et as ImageBuildClientConfig, f as RunsClient, ft as SeatOwnerTransport, g as RouterEvalMatrixHarness, gt as createSelectSeat, h as RouterEvalMatrixCaseResult, ht as SeatSelectionRequest, i as terminalUpgradeHeadersSupported, in as backendRegistryCapabilitiesSchema, it as ImageBuilder, j as buildTangleRouterSearchBackend, jt as createConfidentialSandbox, k as buildTangleRouterEvalMatrixRequest, kt as ConfidentialTeeType, l as RunPlacementRecord, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, m as RouterEvalMatrixAgentProfile, mt as SeatSelectionError, n as SandboxFleetClient, nn as BackendRegistryInteractionKind, nt as ImageBuildOptions, o as SessionBroadcastResult, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, p as RunsHttpClient, pt as SeatResolutionObservation, q as applySandboxEventText, qt as parseSSEStream, r as SandboxFleet, rn as BackendRegistryResponse, rt as ImageBuildResult, s as RunOptions, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, tt as ImageBuildFetchClient, u as RunRecord, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, v as RouterEvalMatrixSandboxBox, vt as ManagedProcessClient, w as RunTangleRouterEvalMatrixInSandboxResult, wt as InstanceStart, x as RouterEvalMatrixSuiteResponse, xt as InstanceProfile, y as RouterEvalMatrixSandboxClient, yt as EnsureInstanceOptions, z as MANAGE_SANDBOXES_PARAMETERS, zt as TeeAttestationHeartbeatOptions } from "./client-DI6zE8oB.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-D2Owom0h.js";
|
|
9
9
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CDtEPygc.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-YbAo-so_.js";
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, G as parseBackendType, H as backendTypeSchema, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-
|
|
1
|
+
import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, G as parseBackendType, H as backendTypeSchema, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, U as isolationPrincipalSchema, V as ALL_BACKEND_TYPES, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-CeMBZkXh.js";
|
|
2
2
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, k as agentInteractiveSessionPromptRequestDigest, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-BYbNLahH.js";
|
|
3
3
|
import { i as SANDBOX_SIZE_PRESET_NAMES, r as agentProfileSchema, t as agentProfileConfidentialSchema } from "./profile-schema-C1KpT-wS.js";
|
|
4
|
-
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-
|
|
4
|
+
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, f as InteractiveSessionHandle, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-DLz2JNkc.js";
|
|
5
5
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, T as StreamInterruptedError, _ as NotFoundError, b as QuotaError, c as BranchFanoutExceedsHostError, d as EdgeNotReadyError, f as EgressProxyRecoveryError, g as NetworkError, h as KeyBudgetExhaustedError, l as CapabilityError, m as GpuProviderNotConfiguredError, p as FileWriteConflictError, r as parseErrorResponse, s as AuthError, t as TerminalStreamError, u as CompliancePlacementError, v as PartialFailureError, w as StateError, x as ResumeEnvRequiredError, y as ProfileFileMountPathError } from "./errors-DKIV20jZ.js";
|
|
6
|
-
import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-
|
|
6
|
+
import { _ as createBatchResultAccumulator, a as InstancesClient, c as runtimeWorkspaceCwdSchema, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, g as IntelligenceClient, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, n as RunsClient, o as SandboxFleetClient, p as isBackendRegistryInteractionKind, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as backendRegistryEntrySchema, v as validateBatchRunRequest } from "./client-P8MtzuCr.js";
|
|
7
7
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-9LAsWHvQ.js";
|
|
8
|
-
import { t as parseSSEStream } from "./sse-parser-
|
|
8
|
+
import { t as parseSSEStream } from "./sse-parser-DXRUx6gh.js";
|
|
9
9
|
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-D3CdWX7Y.js";
|
|
10
10
|
import { t as downloadFile } from "./file-download-DnI_Z_Za.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-
|
|
13
|
-
import { s as BlueprintSandboxClient } from "./tangle-
|
|
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-BIwp7ngT.js";
|
|
13
|
+
import { s as BlueprintSandboxClient } from "./tangle-CzOXzt2N.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
//#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
|
|
16
16
|
const MANAGED_MODEL_KEY_SENTINEL = "proxy-managed-per-request";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as TimeoutError, g as NetworkError, r as parseErrorResponse } from "../errors-DKIV20jZ.js";
|
|
2
|
-
import { n as fetchSandboxApi } from "../api-request-
|
|
2
|
+
import { n as fetchSandboxApi } from "../api-request-DIleh2_r.js";
|
|
3
3
|
import { n as verifyDownload } from "../file-download-DnI_Z_Za.js";
|
|
4
4
|
//#region src/intelligence/index.ts
|
|
5
5
|
/**
|
|
@@ -3,9 +3,10 @@ import { B as PlanContinuationSchema, D as agentInteractiveSessionControlClaimMa
|
|
|
3
3
|
import { r as agentProfileSchema } from "./profile-schema-C1KpT-wS.js";
|
|
4
4
|
import { C as ServerError, D as ValidationError, S as SandboxError, g as NetworkError, i as parseResponseError, l as CapabilityError, t as TerminalStreamError } from "./errors-DKIV20jZ.js";
|
|
5
5
|
import { n as awaitWithAbort, r as combineAbortSignals, t as abortableSleep } from "./abort-signal-Cu4F2VVz.js";
|
|
6
|
-
import { t as parseSSEStream } from "./sse-parser-
|
|
6
|
+
import { t as parseSSEStream } from "./sse-parser-DXRUx6gh.js";
|
|
7
7
|
import { s as uploadChunked } from "./chunked-upload-DCdc8Nly.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
|
+
import { PART_TEXT, PART_TEXT_SUFFIX } from "@tangle-network/agent-core/sse";
|
|
9
10
|
/** Stable declaration order; registry tests check the shipped spec composition. */
|
|
10
11
|
const ALL_BACKEND_TYPES = Object.values({
|
|
11
12
|
OPENCODE: "opencode",
|
|
@@ -1507,6 +1508,7 @@ var SandboxRuntimeApi = class extends RuntimeFiles {
|
|
|
1507
1508
|
await this.transport.ensureRunning();
|
|
1508
1509
|
const search = new URLSearchParams();
|
|
1509
1510
|
search.set("sessionId", sessionId);
|
|
1511
|
+
search.set(PART_TEXT, PART_TEXT_SUFFIX);
|
|
1510
1512
|
if (options.since) search.set("since", options.since);
|
|
1511
1513
|
if (options.executionId) search.set("executionId", options.executionId);
|
|
1512
1514
|
const response = await this.request(`/agents/events?${search.toString()}`, { signal: options.signal });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as SANDBOX_FILE_API_ABSOLUTE_ROOTS } from "./file-transfer-Cr9Ossea.js";
|
|
2
|
-
import "./api-request-
|
|
2
|
+
import "./api-request-DIleh2_r.js";
|
|
3
3
|
import { a as listAgentPreviews, i as getAgentPreview, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "./preview-operations-B3TTvqlm.js";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -396,7 +396,7 @@ async function createMcpServer(box, options = {}) {
|
|
|
396
396
|
const { bindings, handlers } = bindToolSpecs(box, options);
|
|
397
397
|
const server = new serverModule.Server({
|
|
398
398
|
name: options.name ?? "tangle-sandbox",
|
|
399
|
-
version: options.version ?? "1.0.
|
|
399
|
+
version: options.version ?? "1.0.199"
|
|
400
400
|
}, { capabilities: { tools: {} } });
|
|
401
401
|
server.setRequestHandler(typesModule.ListToolsRequestSchema, async () => ({ tools: bindings.map(({ spec: s }) => ({
|
|
402
402
|
name: s.name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { O as SandboxInstance } from "./index-BZY242A9.js";
|
|
2
2
|
import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-CmvYNLKn.js";
|
|
3
|
-
import { t as Sandbox } from "./client-
|
|
3
|
+
import { t as Sandbox } from "./client-DI6zE8oB.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,7 +1,7 @@
|
|
|
1
|
-
import { I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-
|
|
1
|
+
import { I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-CeMBZkXh.js";
|
|
2
2
|
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-BYbNLahH.js";
|
|
3
3
|
import { C as ServerError, D as ValidationError, E as TimeoutError, S as SandboxError, _ as NotFoundError, b as QuotaError, g as NetworkError, l as CapabilityError, p as FileWriteConflictError, s as AuthError, v as PartialFailureError, w as StateError, y as ProfileFileMountPathError } from "./errors-DKIV20jZ.js";
|
|
4
|
-
import { n as fetchSandboxApi } from "./api-request-
|
|
4
|
+
import { n as fetchSandboxApi } from "./api-request-DIleh2_r.js";
|
|
5
5
|
import { s as uploadChunked } from "./chunked-upload-DCdc8Nly.js";
|
|
6
6
|
//#region src/runtime-client.ts
|
|
7
7
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as normalizeRuntimeBackendConfig, C as encodeTextForWire, D as applyRequestedModel, F as withoutRuntimeSecrets, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, M as requestedSecretProfilePublicDigest, O as assertCurrentBackendType, S as encodePromptForWire, T as canUseNodeHttp2, W as normalizeEffectiveBackend, _ as isTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as TRACE_ID_HEADER, h as isRetryableCredentialRefusal, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, k as mergeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as mintTraceId, w as runtimeFilesystemPath, x as validateAcceptedDispatchRunRef, y as resolveTraceId } from "./interactive-controller-
|
|
1
|
+
import { A as normalizeRuntimeBackendConfig, C as encodeTextForWire, D as applyRequestedModel, F as withoutRuntimeSecrets, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, M as requestedSecretProfilePublicDigest, O as assertCurrentBackendType, S as encodePromptForWire, T as canUseNodeHttp2, W as normalizeEffectiveBackend, _ as isTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as TRACE_ID_HEADER, h as isRetryableCredentialRefusal, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, k as mergeRuntimeBackendConfig, l as normalizeSessionInfo, m as assertFileWritePreconditions, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as mintTraceId, w as runtimeFilesystemPath, x as validateAcceptedDispatchRunRef, y as resolveTraceId } from "./interactive-controller-CeMBZkXh.js";
|
|
2
2
|
import { C as boundedIdentifierSchema, E as boundedStringSchema, g as sha256DigestSchema$1, o as canonicalCandidateDigest$1, s as canonicalCandidateJson$1, u as isCanonicalJsonValue$1 } from "./harness-DMaNgn0S.js";
|
|
3
3
|
import { t as sha256 } from "./sha2-vu4U-x2L.js";
|
|
4
4
|
import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-BYbNLahH.js";
|
|
@@ -9,7 +9,7 @@ import { a as SANDBOX_PROXY_REQUEST_MAX_BYTES, c as PROFILE_FILE_MOUNT_OUTSIDE_R
|
|
|
9
9
|
import { t as rewrapResponse } from "./response-rewrap-Cjoxh2wZ.js";
|
|
10
10
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-C2lFwrMA.js";
|
|
11
11
|
import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-DTJbOAWL.js";
|
|
12
|
-
import { t as parseSSEStream } from "./sse-parser-
|
|
12
|
+
import { t as parseSSEStream } from "./sse-parser-DXRUx6gh.js";
|
|
13
13
|
import { s as uploadChunked } from "./chunked-upload-DCdc8Nly.js";
|
|
14
14
|
import { t as runPreparedProcess } from "./prepared-process-BSpZXDDw.js";
|
|
15
15
|
import { a as isBackendType, r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js";
|
|
@@ -21,6 +21,7 @@ import { createHash } from "node:crypto";
|
|
|
21
21
|
import { constants } from "node:fs";
|
|
22
22
|
import "node:path";
|
|
23
23
|
import "node:fs/promises";
|
|
24
|
+
import { PART_TEXT, PART_TEXT_SUFFIX, locatePart } from "@tangle-network/agent-core/sse";
|
|
24
25
|
import { readTokenUsage } from "@tangle-network/agent-core";
|
|
25
26
|
import "@tangle-network/agent-interface/environment-provider";
|
|
26
27
|
import { OTLP_SPAN_KIND, OTLP_STATUS_CODE, msToUnixNano, otlpTraceExport, toOtlpAttributes, toW3CSpanId, toW3CTraceId } from "@tangle-network/agent-trace-contract/otlp";
|
|
@@ -5736,7 +5737,7 @@ function messageTextUpdate(event) {
|
|
|
5736
5737
|
if (event.type !== "message.part.updated") return void 0;
|
|
5737
5738
|
const data = isRecord(event.data) ? event.data : {};
|
|
5738
5739
|
const properties = isRecord(data.properties) ? data.properties : void 0;
|
|
5739
|
-
const part =
|
|
5740
|
+
const part = locatePart(data);
|
|
5740
5741
|
if (part?.type !== "text") return void 0;
|
|
5741
5742
|
const snapshot = firstString(part.text, part.content);
|
|
5742
5743
|
if (snapshot !== void 0) return {
|
|
@@ -5840,8 +5841,7 @@ function isToolBearingEvent(event) {
|
|
|
5840
5841
|
const data = isRecord(event.data) ? event.data : void 0;
|
|
5841
5842
|
if (!data) return false;
|
|
5842
5843
|
if (event.type === "raw" && typeof data.type === "string") return namesATool(data.type);
|
|
5843
|
-
const
|
|
5844
|
-
const part = isRecord(data.part) ? data.part : isRecord(properties?.part) ? properties.part : void 0;
|
|
5844
|
+
const part = locatePart(data);
|
|
5845
5845
|
return typeof part?.type === "string" && namesATool(part.type);
|
|
5846
5846
|
}
|
|
5847
5847
|
/**
|
|
@@ -5897,9 +5897,7 @@ function collectAgentFinalMessageText(events) {
|
|
|
5897
5897
|
for (let i = lastToolAt + 1; i < end; i++) {
|
|
5898
5898
|
const event = events[i];
|
|
5899
5899
|
if (event.type !== "message.part.updated") continue;
|
|
5900
|
-
const
|
|
5901
|
-
const properties = isRecord(data.properties) ? data.properties : void 0;
|
|
5902
|
-
const part = isRecord(data.part) ? data.part : isRecord(properties?.part) ? properties.part : void 0;
|
|
5900
|
+
const part = locatePart(event.data);
|
|
5903
5901
|
if (part?.type !== "text") continue;
|
|
5904
5902
|
const update = messageTextUpdate(event);
|
|
5905
5903
|
const text = update?.text;
|
|
@@ -8192,7 +8190,8 @@ var SandboxPromptTransportCapabilities = class extends SandboxSessionAdmissionCa
|
|
|
8192
8190
|
const explicitReplay = Boolean(options?.executionId && options.lastEventId);
|
|
8193
8191
|
const replaySearch = new URLSearchParams({
|
|
8194
8192
|
lastEventId: options?.lastEventId ?? "0",
|
|
8195
|
-
format: "sse"
|
|
8193
|
+
format: "sse",
|
|
8194
|
+
[PART_TEXT]: PART_TEXT_SUFFIX
|
|
8196
8195
|
});
|
|
8197
8196
|
appendSessionIdQuery(replaySearch, internal?.replaySessionId);
|
|
8198
8197
|
const state = {
|
|
@@ -8205,7 +8204,7 @@ var SandboxPromptTransportCapabilities = class extends SandboxSessionAdmissionCa
|
|
|
8205
8204
|
throwIfTimedOut,
|
|
8206
8205
|
reconcileRuntimeRefusal,
|
|
8207
8206
|
explicitReplay,
|
|
8208
|
-
requestEndpoint: explicitReplay ? `/agents/run/${encodeURIComponent(options?.executionId ?? "")}/events?${replaySearch}` :
|
|
8207
|
+
requestEndpoint: explicitReplay ? `/agents/run/${encodeURIComponent(options?.executionId ?? "")}/events?${replaySearch}` : `/agents/run/stream?${PART_TEXT}=${PART_TEXT_SUFFIX}`,
|
|
8209
8208
|
traceHeaders: options?.traceId ? { [TRACE_ID_HEADER]: options.traceId } : {},
|
|
8210
8209
|
lastEventId: options?.lastEventId,
|
|
8211
8210
|
executionId: options?.executionId,
|
|
@@ -8363,6 +8362,7 @@ var SandboxPromptTransportCapabilities = class extends SandboxSessionAdmissionCa
|
|
|
8363
8362
|
const queryParams = new URLSearchParams();
|
|
8364
8363
|
if (state.lastEventId) queryParams.set("lastEventId", state.lastEventId);
|
|
8365
8364
|
queryParams.set("format", "sse");
|
|
8365
|
+
queryParams.set(PART_TEXT, PART_TEXT_SUFFIX);
|
|
8366
8366
|
appendSessionIdQuery(queryParams, state.internal?.replaySessionId);
|
|
8367
8367
|
const replayResponse = await this.runtimeFetch(`/agents/run/${encodeURIComponent(resumeExecutionId)}/events?${queryParams}`, {
|
|
8368
8368
|
method: "GET",
|
|
@@ -8980,6 +8980,7 @@ var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabil
|
|
|
8980
8980
|
await this.ensureRunning();
|
|
8981
8981
|
const search = new URLSearchParams();
|
|
8982
8982
|
search.set("sessionId", id);
|
|
8983
|
+
search.set(PART_TEXT, PART_TEXT_SUFFIX);
|
|
8983
8984
|
if (opts?.since) search.set("since", opts.since);
|
|
8984
8985
|
if (opts?.executionId) search.set("executionId", opts.executionId);
|
|
8985
8986
|
const response = await this.runtimeFetch(`/agents/events?${search.toString()}`, { signal: opts?.signal });
|
|
@@ -8996,7 +8997,8 @@ var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabil
|
|
|
8996
8997
|
const search = new URLSearchParams({
|
|
8997
8998
|
lastEventId: "0",
|
|
8998
8999
|
format: "sse",
|
|
8999
|
-
sessionId
|
|
9000
|
+
sessionId,
|
|
9001
|
+
[PART_TEXT]: PART_TEXT_SUFFIX
|
|
9000
9002
|
});
|
|
9001
9003
|
const response = await this.runtimeFetch(`/agents/run/${encodeURIComponent(executionId)}/events?${search.toString()}`);
|
|
9002
9004
|
if (!response.ok) throw await parseResponseError(response);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as combineAbortSignals } from "../abort-signal-Cu4F2VVz.js";
|
|
2
2
|
import "../sidecar-proxy-error-DTJbOAWL.js";
|
|
3
|
-
import { t as parseSSEStream } from "../sse-parser-
|
|
3
|
+
import { t as parseSSEStream } from "../sse-parser-DXRUx6gh.js";
|
|
4
|
+
import { PART_TEXT, PART_TEXT_SUFFIX } from "@tangle-network/agent-core/sse";
|
|
4
5
|
//#region ../../../packages/runtime-contracts/dist/session-gateway.js
|
|
5
6
|
/**
|
|
6
7
|
* Shared session-gateway protocol and connection metrics
|
|
@@ -305,7 +306,10 @@ var SessionGatewayClient = class {
|
|
|
305
306
|
if (session.backend) this.#backend = session.backend;
|
|
306
307
|
const turn = this.#follow(session.activeExecutionId);
|
|
307
308
|
this.#releaseHeld(turn);
|
|
308
|
-
const query = new URLSearchParams({
|
|
309
|
+
const query = new URLSearchParams({
|
|
310
|
+
sessionId: this.#config.runtimeSessionId,
|
|
311
|
+
[PART_TEXT]: PART_TEXT_SUFFIX
|
|
312
|
+
});
|
|
309
313
|
if (turn) {
|
|
310
314
|
query.set("executionId", turn.executionId);
|
|
311
315
|
query.set("since", turn.since);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PartTextCoder, decodePartTextFrame, 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 lives in
|
|
7
|
+
* `@tangle-network/agent-core/sse`, the one wire-format implementation. This
|
|
8
|
+
* module owns the SDK's payload contract on top of it: JSON parsing, the
|
|
9
|
+
* `"message"` default event type (SSE spec §9.2.6 step 3), the malformed-frame
|
|
10
|
+
* policy, and restoring part text a stream sent as suffixes. Used by
|
|
11
|
+
* `Sandbox.streamBatch` and by the web dashboard's batch page; exported so
|
|
12
|
+
* downstream surfaces don't maintain their own copies.
|
|
13
|
+
*
|
|
14
|
+
* Throws `AbortError` when the caller's signal fires, so a consumer can tell a
|
|
15
|
+
* finished stream from a cancelled one. Retry and filtering are the caller's.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Parse a streaming SSE response body into an async iterable of
|
|
19
|
+
* structured events.
|
|
20
|
+
*
|
|
21
|
+
* @throws `TypeError` when the response has no body.
|
|
22
|
+
* @throws `DOMException` with `name === "AbortError"` on cancellation.
|
|
23
|
+
*/
|
|
24
|
+
async function* parseSSEStream(body, options) {
|
|
25
|
+
const { signal, invalidEvent = "throw", idleMs } = options ?? {};
|
|
26
|
+
const partText = new PartTextCoder();
|
|
27
|
+
for await (const frame of streamSSEFrames(body, {
|
|
28
|
+
signal,
|
|
29
|
+
idleMs
|
|
30
|
+
})) {
|
|
31
|
+
const effectiveEvent = frame.event || "message";
|
|
32
|
+
let data;
|
|
33
|
+
try {
|
|
34
|
+
data = JSON.parse(frame.data);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (invalidEvent === "warn-and-skip") {
|
|
37
|
+
console.warn("[sandbox-sdk] Malformed SSE JSON skipped");
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
throw new SyntaxError(`Malformed SSE JSON for event "${effectiveEvent}"`, { cause: error });
|
|
41
|
+
}
|
|
42
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
43
|
+
if (invalidEvent === "warn-and-skip") {
|
|
44
|
+
console.warn("[sandbox-sdk] Non-object SSE data skipped");
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
throw new TypeError(`SSE event "${effectiveEvent}" data must be a JSON object`);
|
|
48
|
+
}
|
|
49
|
+
decodePartTextFrame(partText, data);
|
|
50
|
+
yield {
|
|
51
|
+
type: effectiveEvent,
|
|
52
|
+
data,
|
|
53
|
+
id: frame.id
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { parseSSEStream as t };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-
|
|
1
|
+
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as BlueprintSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-CzOXzt2N.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
1
|
+
import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-DLz2JNkc.js";
|
|
2
2
|
import { a as readResponseJson } from "./errors-DKIV20jZ.js";
|
|
3
3
|
import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-CK-x8vXj.js";
|
|
4
4
|
//#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.199",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"url": "https://github.com/tangle-network/agent-container/issues"
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
|
-
"@tangle-network/agent-core": "^1.0.
|
|
111
|
+
"@tangle-network/agent-core": "^1.0.3",
|
|
112
112
|
"@tangle-network/agent-interface": "^5.10.13",
|
|
113
113
|
"@tangle-network/agent-trace-contract": "^2.2.0",
|
|
114
114
|
"tar-stream": "3.2.1",
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
"@tangle-network/runtime-contracts": "0.20.0"
|
|
161
161
|
},
|
|
162
162
|
"tangleRelease": {
|
|
163
|
-
"sourceSha": "
|
|
164
|
-
"mergedAt": "2026-11-
|
|
163
|
+
"sourceSha": "00c8551022807aa27570bd2dd33fa25af94bc9bf",
|
|
164
|
+
"mergedAt": "2026-11-02T20:01:47-08:00"
|
|
165
165
|
},
|
|
166
166
|
"scripts": {
|
|
167
167
|
"build": "node scripts/build-dist.mjs",
|
|
@@ -1,78 +0,0 @@
|
|
|
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 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 skipped");
|
|
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] Non-object SSE data skipped");
|
|
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 };
|