@tangle-network/sandbox 0.68.7 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/abort-signal-BKVZNJul.js +46 -0
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +4 -4
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-Cp8hzV98.d.ts → agent-run-outcome-z5-7NA1x.d.ts} +1 -1
- package/dist/{api-request-D8Mni27A.js → api-request-D1UVNo16.js} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-CH7CLpmc.d.ts → browser-interactive-control-controller-CAmOZ9Sw.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-k1KkqDGF.js → browser-interactive-control-controller-CLHNi8rG.js} +2 -46
- package/dist/{chunked-upload-file-CbbWlCFt.js → chunked-upload-file-CLwAeLrM.js} +1 -1
- package/dist/{client-aBXGR6bc.d.ts → client-BG1kKuT7.d.ts} +5 -5
- package/dist/{client-D5GLp93x.js → client-DP5TOkG6.js} +9 -8
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{core-VOzQz1mc.js → core-CO7om2qW.js} +2 -2
- package/dist/core.d.ts +6 -6
- package/dist/core.js +4 -4
- package/dist/{direct-http2--35cHOv5.js → direct-http2-Pyj3Rvr1.js} +1 -1
- package/dist/{index-EebEqYqj.d.ts → index-DQpx4M1t.d.ts} +8 -8
- package/dist/index.d.ts +11 -11
- package/dist/index.js +9 -8
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-ThIeP_oZ.js → interactive-controller-DIlzqR9a.js} +15 -234
- package/dist/{interactive-controller-Mh7Ud5DQ.d.ts → interactive-controller-qsiVS3gd.d.ts} +3 -3
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-BTIFNxRO.d.ts → lines-B9f2EKS6.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-Dxti_D10.js → local-cli-auth-B5lzT8mt.js} +1 -1
- package/dist/{mcp-local-ClJ5TD-m.js → mcp-local-Gz1Uygqk.js} +1 -1
- package/dist/{preview-D6tTCcmv.d.ts → preview-II4uNVbG.d.ts} +3 -3
- package/dist/{public-templates-sZe-0Qvi.d.ts → public-templates-CkHcnhWA.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/{raw-evidence-archive-iDPF8eF_.js → raw-evidence-archive-D60Yg1-5.js} +1 -1
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +4 -4
- package/dist/{sandbox-Ksajmtq4.js → sandbox-CVieDtU6.js} +31 -39
- package/dist/{secp256k1-CoRKQn1k.js → secp256k1-DxHlUI6v.js} +1 -1
- package/dist/select-seat-command.d.ts +1 -1
- package/dist/session-gateway/index.d.ts +132 -508
- package/dist/session-gateway/index.js +694 -946
- package/dist/sidecar-proxy-error-B2Hxt41g.js +24 -0
- package/dist/sse-parser-CUfurwcm.js +227 -0
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-Cmr8JcO3.js → tangle-B4k-BjIh.js} +3 -3
- package/dist/{terminal-stream-types-yAt76vk7.d.ts → terminal-stream-types-Bgy8iSFg.d.ts} +8 -5
- package/dist/{types-DUNlmyED.d.ts → types-D6n5ohlx.d.ts} +2 -2
- package/package.json +7 -7
- /package/dist/{chunked-upload-CbtLVV6-.js → chunked-upload-l6b9AWFA.js} +0 -0
- /package/dist/{cli-auth-bundle-Can3oLKY.d.ts → cli-auth-bundle-CeNOYFje.d.ts} +0 -0
- /package/dist/{cli-auth-bundle-DlQs_26j.js → cli-auth-bundle-CrO4F3Ru.js} +0 -0
- /package/dist/{collaboration-Ox7K-TN6.js → collaboration-BwLNv6sy.js} +0 -0
- /package/dist/{index-B8xo7y26.d.ts → index-C0RkLba5.d.ts} +0 -0
- /package/dist/{index-mz8_2rr2.d.ts → index-DaIF4c9p.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-C92u8Kce.js → keep-alive-fetch-Bi-zvHpN.js} +0 -0
- /package/dist/{lines-DgRXUg5y.js → lines-D_HDAcVt.js} +0 -0
- /package/dist/{prepared-evidence-Di89Tatw.js → prepared-evidence-DUmJSegi.js} +0 -0
- /package/dist/{prepared-process-DKgEUodb.js → prepared-process-Dlk_9JVJ.js} +0 -0
- /package/dist/{preview-operations-BL7YCkes.js → preview-operations-eTUlPen5.js} +0 -0
- /package/dist/{response-rewrap-Bsj87BIq.js → response-rewrap-BKkJ5hnn.js} +0 -0
- /package/dist/{utils-C86i6t3C.js → utils-DB8DnUCU.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { i as isolationPrincipalSchema, o as parseBackendType, r as backendTypeSchema, t as ALL_BACKEND_TYPES } from "./backend-types-CLvdSX8V.js";
|
|
2
|
-
import { A as
|
|
2
|
+
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-DIlzqR9a.js";
|
|
3
3
|
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-Bs5G7JdV.js";
|
|
4
|
-
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-
|
|
5
|
-
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-
|
|
6
|
-
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-
|
|
7
|
-
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-
|
|
8
|
-
import {
|
|
4
|
+
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-DP5TOkG6.js";
|
|
5
|
+
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-CLHNi8rG.js";
|
|
6
|
+
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-BwLNv6sy.js";
|
|
7
|
+
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-CVieDtU6.js";
|
|
8
|
+
import { t as parseSSEStream } from "./sse-parser-CUfurwcm.js";
|
|
9
|
+
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-D_HDAcVt.js";
|
|
9
10
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
10
|
-
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-
|
|
11
|
-
import { s as TangleSandboxClient } from "./tangle-
|
|
11
|
+
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-CO7om2qW.js";
|
|
12
|
+
import { s as TangleSandboxClient } from "./tangle-B4k-BjIh.js";
|
|
12
13
|
import { z } from "zod";
|
|
13
14
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
14
15
|
//#region ../../../packages/runtime-contracts/dist/model-key-proxy.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { T as TimeoutError, h as NetworkError, n as parseErrorResponse } from "../errors-Bs5G7JdV.js";
|
|
2
|
-
import { t as fetchSandboxApi } from "../api-request-
|
|
2
|
+
import { t as fetchSandboxApi } from "../api-request-D1UVNo16.js";
|
|
3
3
|
//#region src/intelligence/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* `@tangle-network/sandbox/intelligence` — browser-safe typed client for the
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, n as BrowserInteractiveSessionControlControllerOptions, r as browserInteractiveControlHolderId, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-
|
|
1
|
+
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, n as BrowserInteractiveSessionControlControllerOptions, r as browserInteractiveControlHolderId, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-CAmOZ9Sw.js";
|
|
2
2
|
export { BrowserInteractiveSessionControlController, type BrowserInteractiveSessionControlControllerOptions, type InteractiveSessionIdentity, InteractiveSessionNotRunningError, browserInteractiveControlHolderId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-
|
|
1
|
+
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-CLHNi8rG.js";
|
|
2
2
|
export { BrowserInteractiveSessionControlController, InteractiveSessionNotRunningError, browserInteractiveControlHolderId };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { a as normalizeEffectiveBackend, r as backendTypeSchema } from "./backend-types-CLvdSX8V.js";
|
|
2
2
|
import { E as ValidationError, S as ServerError, h as NetworkError, r as parseResponseError, s as CapabilityError, t as TerminalStreamError, x as SandboxError } from "./errors-Bs5G7JdV.js";
|
|
3
|
-
import { c as assertInteractiveSessionRef,
|
|
4
|
-
import {
|
|
3
|
+
import { c as assertInteractiveSessionRef, i as createBrowserInteractiveSessionControlTransport, o as InteractiveSessionControlController, r as browserInteractiveTerminalEndpoint } from "./browser-interactive-control-controller-CLHNi8rG.js";
|
|
4
|
+
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-BKVZNJul.js";
|
|
5
|
+
import { t as parseSSEStream } from "./sse-parser-CUfurwcm.js";
|
|
6
|
+
import { s as uploadChunked } from "./chunked-upload-l6b9AWFA.js";
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionRefSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, PlanContinuationSchema, agentInteractiveSessionControlClaimMatchesRef, agentProfileSchema, canonicalCandidateDigest } from "@tangle-network/agent-interface";
|
|
7
9
|
const TERMINAL_WS_MAX_DIMENSION = 4096;
|
|
@@ -989,232 +991,6 @@ function validateAcceptedDispatchRunRef(raw, expected, sandboxId, sessionId, exe
|
|
|
989
991
|
return accepted;
|
|
990
992
|
}
|
|
991
993
|
//#endregion
|
|
992
|
-
//#region ../../../packages/sse-core/dist/index.js
|
|
993
|
-
/**
|
|
994
|
-
* A copy of `value` that shares no memory with the string it was cut from.
|
|
995
|
-
*
|
|
996
|
-
* V8 can return a short substring of a long string as a view that keeps the
|
|
997
|
-
* whole string alive. Consumers keep event names and ids as long as they keep
|
|
998
|
-
* events, so a view would keep every chunk its frame arrived in alive.
|
|
999
|
-
*/
|
|
1000
|
-
function detached(value) {
|
|
1001
|
-
return value === "" ? value : JSON.parse(JSON.stringify(value));
|
|
1002
|
-
}
|
|
1003
|
-
/**
|
|
1004
|
-
* Thrown when a stream sends no bytes for longer than its `idleMs`. A
|
|
1005
|
-
* producer that heartbeats would have written in that time, so the
|
|
1006
|
-
* connection is dead even though it never closed: a half-open TCP connection
|
|
1007
|
-
* or a stalled proxy hold the socket open while nothing arrives.
|
|
1008
|
-
*/
|
|
1009
|
-
var SSEStreamSilentError = class extends Error {
|
|
1010
|
-
name = "SSEStreamSilentError";
|
|
1011
|
-
idleMs;
|
|
1012
|
-
constructor(idleMs) {
|
|
1013
|
-
super(`SSE stream sent no bytes for ${idleMs} ms`);
|
|
1014
|
-
this.idleMs = idleMs;
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
|
-
/**
|
|
1018
|
-
* Incremental SSE frame parser. Feed decoded text via `push()`; call
|
|
1019
|
-
* `flush()` when the stream ends.
|
|
1020
|
-
*/
|
|
1021
|
-
var SSEFrameParser = class {
|
|
1022
|
-
buffer = "";
|
|
1023
|
-
frameEvent = "";
|
|
1024
|
-
frameId;
|
|
1025
|
-
frameDataLines = null;
|
|
1026
|
-
bomChecked = false;
|
|
1027
|
-
/**
|
|
1028
|
-
* Append a decoded text chunk and return every frame the chunk
|
|
1029
|
-
* completes. Frame state survives across calls: one frame can
|
|
1030
|
-
* straddle any number of chunks.
|
|
1031
|
-
*/
|
|
1032
|
-
push(chunk) {
|
|
1033
|
-
let text = chunk;
|
|
1034
|
-
if (!this.bomChecked && text.length > 0) {
|
|
1035
|
-
this.bomChecked = true;
|
|
1036
|
-
if (text.charCodeAt(0) === 65279) text = text.slice(1);
|
|
1037
|
-
}
|
|
1038
|
-
this.buffer += text;
|
|
1039
|
-
const lines = this.buffer.split("\n");
|
|
1040
|
-
this.buffer = lines.pop() ?? "";
|
|
1041
|
-
return this.processLines(lines);
|
|
1042
|
-
}
|
|
1043
|
-
/**
|
|
1044
|
-
* End-of-stream: process the unterminated trailing line, then
|
|
1045
|
-
* dispatch a dangling frame that never got its blank line.
|
|
1046
|
-
* Well-behaved servers end frames with "\n\n", but some close early.
|
|
1047
|
-
*/
|
|
1048
|
-
flush() {
|
|
1049
|
-
const rest = this.buffer;
|
|
1050
|
-
this.buffer = "";
|
|
1051
|
-
const frames = rest.length > 0 ? this.processLines([rest]) : [];
|
|
1052
|
-
const dangling = this.dispatch();
|
|
1053
|
-
if (dangling) frames.push(dangling);
|
|
1054
|
-
return frames;
|
|
1055
|
-
}
|
|
1056
|
-
processLines(lines) {
|
|
1057
|
-
const frames = [];
|
|
1058
|
-
for (const rawLine of lines) {
|
|
1059
|
-
const line = rawLine.endsWith("\r") ? rawLine.slice(0, -1) : rawLine;
|
|
1060
|
-
if (line === "") {
|
|
1061
|
-
const frame = this.dispatch();
|
|
1062
|
-
if (frame) frames.push(frame);
|
|
1063
|
-
continue;
|
|
1064
|
-
}
|
|
1065
|
-
if (line.startsWith(":")) continue;
|
|
1066
|
-
if (line.startsWith("data:")) {
|
|
1067
|
-
let value = line.slice(5);
|
|
1068
|
-
if (value.startsWith(" ")) value = value.slice(1);
|
|
1069
|
-
if (this.frameDataLines === null) this.frameDataLines = [];
|
|
1070
|
-
this.frameDataLines.push(value);
|
|
1071
|
-
continue;
|
|
1072
|
-
}
|
|
1073
|
-
if (line.startsWith("event:")) {
|
|
1074
|
-
this.frameEvent = line.slice(6).trim();
|
|
1075
|
-
continue;
|
|
1076
|
-
}
|
|
1077
|
-
if (line.startsWith("id:")) this.frameId = line.slice(3).trim();
|
|
1078
|
-
}
|
|
1079
|
-
return frames;
|
|
1080
|
-
}
|
|
1081
|
-
/**
|
|
1082
|
-
* Dispatch the accumulated frame. A frame with no `data:` field (an
|
|
1083
|
-
* `event:`/`id:`-only frame, or a bare comment) produces nothing, and
|
|
1084
|
-
* its field state is consumed and reset either way.
|
|
1085
|
-
*/
|
|
1086
|
-
dispatch() {
|
|
1087
|
-
const dataLines = this.frameDataLines;
|
|
1088
|
-
const frame = dataLines ? {
|
|
1089
|
-
event: detached(this.frameEvent),
|
|
1090
|
-
data: dataLines.join("\n"),
|
|
1091
|
-
id: this.frameId ? detached(this.frameId) : void 0
|
|
1092
|
-
} : null;
|
|
1093
|
-
this.frameEvent = "";
|
|
1094
|
-
this.frameId = void 0;
|
|
1095
|
-
this.frameDataLines = null;
|
|
1096
|
-
return frame;
|
|
1097
|
-
}
|
|
1098
|
-
};
|
|
1099
|
-
/**
|
|
1100
|
-
* Read a streaming SSE response body into parsed frames.
|
|
1101
|
-
*
|
|
1102
|
-
* @throws `TypeError` when the body is missing.
|
|
1103
|
-
* @throws `DOMException` with `name === "AbortError"` on cancellation —
|
|
1104
|
-
* including the WHATWG-fetch variant where an aborted body resolves
|
|
1105
|
-
* `done: true` instead of rejecting the read.
|
|
1106
|
-
*/
|
|
1107
|
-
async function* streamSSEFrames(body, options) {
|
|
1108
|
-
if (!body) throw new TypeError("SSE stream has no response body");
|
|
1109
|
-
const reader = body.getReader();
|
|
1110
|
-
const decoder = new TextDecoder();
|
|
1111
|
-
const parser = new SSEFrameParser();
|
|
1112
|
-
const { signal, idleMs } = options ?? {};
|
|
1113
|
-
const read = () => {
|
|
1114
|
-
const limit = idleMs?.();
|
|
1115
|
-
if (limit === void 0) return reader.read();
|
|
1116
|
-
let timer;
|
|
1117
|
-
return Promise.race([reader.read(), new Promise((_, reject) => {
|
|
1118
|
-
timer = setTimeout(() => reject(new SSEStreamSilentError(limit)), limit);
|
|
1119
|
-
})]).finally(() => clearTimeout(timer));
|
|
1120
|
-
};
|
|
1121
|
-
let completed = false;
|
|
1122
|
-
try {
|
|
1123
|
-
for (;;) {
|
|
1124
|
-
if (signal?.aborted) throw new DOMException("SSE stream aborted", "AbortError");
|
|
1125
|
-
const { done, value } = await read();
|
|
1126
|
-
if (done) {
|
|
1127
|
-
if (signal?.aborted) throw new DOMException("SSE stream aborted", "AbortError");
|
|
1128
|
-
break;
|
|
1129
|
-
}
|
|
1130
|
-
for (const frame of parser.push(decoder.decode(value, { stream: true }))) yield frame;
|
|
1131
|
-
}
|
|
1132
|
-
for (const frame of parser.push(decoder.decode())) yield frame;
|
|
1133
|
-
for (const frame of parser.flush()) yield frame;
|
|
1134
|
-
completed = true;
|
|
1135
|
-
} finally {
|
|
1136
|
-
if (!completed) await reader.cancel().catch(() => void 0);
|
|
1137
|
-
reader.releaseLock();
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
//#endregion
|
|
1141
|
-
//#region src/lib/sse-parser.ts
|
|
1142
|
-
/**
|
|
1143
|
-
* SSE Stream Parser
|
|
1144
|
-
*
|
|
1145
|
-
* EventSource stream parsing for SDK consumers. Framing — buffering
|
|
1146
|
-
* chunk-straddling frames, LF/CRLF terminators, multi-line `data:` joins,
|
|
1147
|
-
* comment heartbeats, BOM — lives in `@tangle-network/sse-core`, the one
|
|
1148
|
-
* wire-format implementation shared across the repo (bundled into this
|
|
1149
|
-
* package's dist, so the SDK stays dependency-free at runtime). This
|
|
1150
|
-
* module owns the SDK's payload contract on top of it: JSON parsing, the
|
|
1151
|
-
* `"message"` default event type, and the malformed-frame policy. Used by
|
|
1152
|
-
* `Sandbox.streamBatch` and by the web dashboard's batch page; exported
|
|
1153
|
-
* so downstream surfaces don't maintain their own copies.
|
|
1154
|
-
*
|
|
1155
|
-
* Guarantees:
|
|
1156
|
-
* - Correctly buffers frames that straddle chunk boundaries.
|
|
1157
|
-
* - Accepts LF- and CRLF-terminated streams interchangeably.
|
|
1158
|
-
* - Joins multi-line `data:` per the spec (dispatch joins with
|
|
1159
|
-
* "\n" before JSON parse).
|
|
1160
|
-
* - Defaults event type to `"message"` when a frame carries
|
|
1161
|
-
* `data:` but no `event:` field (SSE spec §9.2.6 step 3).
|
|
1162
|
-
* - Surfaces optional `id:` so callers can implement reconnection.
|
|
1163
|
-
* - Flushes a dangling event when the stream closes without a
|
|
1164
|
-
* terminating blank line (well-behaved servers emit `\n\n`, but
|
|
1165
|
-
* some close early).
|
|
1166
|
-
* - Throws `AbortError` when the caller-supplied signal fires, so
|
|
1167
|
-
* consumers can distinguish "ran to completion" from "cancelled"
|
|
1168
|
-
* without peeking at signal state.
|
|
1169
|
-
* - Rejects malformed JSON by default. Callers handling recoverable output
|
|
1170
|
-
* streams can explicitly warn and skip one invalid frame.
|
|
1171
|
-
*
|
|
1172
|
-
* What it does NOT do:
|
|
1173
|
-
* - CR-only (legacy Mac) line terminators. No known emitter uses
|
|
1174
|
-
* them; supporting them would risk splitting payloads that
|
|
1175
|
-
* legitimately contain CR.
|
|
1176
|
-
* - Retry/reconnect (caller's responsibility).
|
|
1177
|
-
* - Event-type filtering (caller's responsibility).
|
|
1178
|
-
*/
|
|
1179
|
-
/**
|
|
1180
|
-
* Parse a streaming SSE response body into an async iterable of
|
|
1181
|
-
* structured events.
|
|
1182
|
-
*
|
|
1183
|
-
* @throws `TypeError` when the response has no body.
|
|
1184
|
-
* @throws `DOMException` with `name === "AbortError"` on cancellation.
|
|
1185
|
-
*/
|
|
1186
|
-
async function* parseSSEStream(body, options) {
|
|
1187
|
-
const { signal, invalidEvent = "throw", idleMs } = options ?? {};
|
|
1188
|
-
for await (const frame of streamSSEFrames(body, {
|
|
1189
|
-
signal,
|
|
1190
|
-
idleMs
|
|
1191
|
-
})) {
|
|
1192
|
-
const effectiveEvent = frame.event || "message";
|
|
1193
|
-
let data;
|
|
1194
|
-
try {
|
|
1195
|
-
data = JSON.parse(frame.data);
|
|
1196
|
-
} catch (error) {
|
|
1197
|
-
if (invalidEvent === "warn-and-skip") {
|
|
1198
|
-
console.warn(`[sandbox-sdk] Malformed SSE JSON for event "${effectiveEvent}": ${frame.data.slice(0, 200)}`);
|
|
1199
|
-
continue;
|
|
1200
|
-
}
|
|
1201
|
-
throw new SyntaxError(`Malformed SSE JSON for event "${effectiveEvent}"`, { cause: error });
|
|
1202
|
-
}
|
|
1203
|
-
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
1204
|
-
if (invalidEvent === "warn-and-skip") {
|
|
1205
|
-
console.warn(`[sandbox-sdk] SSE event "${effectiveEvent}" data must be a JSON object`);
|
|
1206
|
-
continue;
|
|
1207
|
-
}
|
|
1208
|
-
throw new TypeError(`SSE event "${effectiveEvent}" data must be a JSON object`);
|
|
1209
|
-
}
|
|
1210
|
-
yield {
|
|
1211
|
-
type: effectiveEvent,
|
|
1212
|
-
data,
|
|
1213
|
-
id: frame.id
|
|
1214
|
-
};
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
//#endregion
|
|
1218
994
|
//#region src/lib/trace-id.ts
|
|
1219
995
|
/**
|
|
1220
996
|
* Request header that carries one turn's trace id. The Sandbox API adopts it
|
|
@@ -1884,23 +1660,25 @@ const scopedTokenResponseSchema = z.object({
|
|
|
1884
1660
|
"session-runtime",
|
|
1885
1661
|
"project",
|
|
1886
1662
|
"read-only"
|
|
1887
|
-
])
|
|
1663
|
+
]),
|
|
1664
|
+
access: z.literal("read-only").optional()
|
|
1888
1665
|
});
|
|
1889
1666
|
/** Reject a scoped credential that the SDK must not send to a consumer. */
|
|
1890
1667
|
function assertScopedTokenActive(token, expectedScope) {
|
|
1891
1668
|
if (expectedScope !== void 0 && token.scope !== expectedScope) throw new ValidationError(`Scoped token must use the ${expectedScope} scope`);
|
|
1892
1669
|
if (typeof token.token !== "string" || !token.token.trim() || !(token.expiresAt instanceof Date) || !Number.isFinite(token.expiresAt.getTime()) || token.expiresAt.getTime() <= Date.now()) throw new ValidationError("Scoped token is expired or invalid");
|
|
1893
1670
|
}
|
|
1894
|
-
function parseScopedTokenResponse(raw, expectedScope) {
|
|
1671
|
+
function parseScopedTokenResponse(raw, expectedScope, expectedAccess) {
|
|
1895
1672
|
const parsed = scopedTokenResponseSchema.safeParse(raw);
|
|
1896
1673
|
if (!parsed.success) throw new ServerError("Sandbox API returned an invalid scoped token response.", 502, { origin: "sandbox-api" });
|
|
1897
|
-
if (parsed.data.scope !== expectedScope) throw new ServerError(
|
|
1674
|
+
if (parsed.data.scope !== expectedScope || parsed.data.access !== expectedAccess) throw new ServerError("Sandbox API did not acknowledge the requested token scope and access.", 502, { origin: "sandbox-api" });
|
|
1898
1675
|
const token = {
|
|
1899
1676
|
token: parsed.data.token,
|
|
1900
1677
|
expiresAt: /* @__PURE__ */ new Date(parsed.data.expiresAt * 1e3),
|
|
1901
1678
|
runtimeUrl: parsed.data.runtimeUrl,
|
|
1902
1679
|
sidecarProxyUrl: parsed.data.sidecarProxyUrl,
|
|
1903
|
-
scope: parsed.data.scope
|
|
1680
|
+
scope: parsed.data.scope,
|
|
1681
|
+
...parsed.data.access ? { access: parsed.data.access } : {}
|
|
1904
1682
|
};
|
|
1905
1683
|
try {
|
|
1906
1684
|
assertScopedTokenActive(token, expectedScope);
|
|
@@ -1910,13 +1688,16 @@ function parseScopedTokenResponse(raw, expectedScope) {
|
|
|
1910
1688
|
return token;
|
|
1911
1689
|
}
|
|
1912
1690
|
async function requestScopedToken(client, sandboxId, options, requestOptions) {
|
|
1691
|
+
if ("access" in options && options.access !== void 0 && (options.scope !== "session-runtime" || options.access !== "read-only")) throw new ValidationError("Only session-runtime permits access=read-only");
|
|
1913
1692
|
if ((options.scope === "session" || options.scope === "session-runtime") && !options.sessionId) throw new ValidationError(`${options.scope} scope requires a sessionId`);
|
|
1914
1693
|
if (options.scope === "session" && !options.runtimeSessionId) throw new ValidationError("session scope requires the actual runtimeSessionId");
|
|
1694
|
+
const access = options.scope === "session-runtime" ? options.access : void 0;
|
|
1915
1695
|
const response = await client.fetch(`/v1/sandboxes/${encodeURIComponent(sandboxId)}/scoped-token`, {
|
|
1916
1696
|
method: "POST",
|
|
1917
1697
|
headers: { "Content-Type": "application/json" },
|
|
1918
1698
|
body: JSON.stringify({
|
|
1919
1699
|
scope: options.scope,
|
|
1700
|
+
...access ? { access } : {},
|
|
1920
1701
|
...options.sessionId ? { sessionId: options.sessionId } : {},
|
|
1921
1702
|
...options.scope === "session" ? { runtimeSessionId: options.runtimeSessionId } : {},
|
|
1922
1703
|
...options.ttlMinutes ? { ttlMinutes: options.ttlMinutes } : {}
|
|
@@ -1930,7 +1711,7 @@ async function requestScopedToken(client, sandboxId, options, requestOptions) {
|
|
|
1930
1711
|
} catch {
|
|
1931
1712
|
throw new ServerError("Sandbox API returned invalid scoped token JSON.", 502, { origin: "sandbox-api" });
|
|
1932
1713
|
}
|
|
1933
|
-
return parseScopedTokenResponse(raw, options.scope);
|
|
1714
|
+
return parseScopedTokenResponse(raw, options.scope, access);
|
|
1934
1715
|
}
|
|
1935
1716
|
function parseInteractiveSessionTokenRef(ref) {
|
|
1936
1717
|
const parsed = AgentInteractiveSessionRefSchema.safeParse(ref);
|
|
@@ -2724,4 +2505,4 @@ var BrowserInteractiveSessionController = class extends InteractiveSessionContro
|
|
|
2724
2505
|
}
|
|
2725
2506
|
};
|
|
2726
2507
|
//#endregion
|
|
2727
|
-
export {
|
|
2508
|
+
export { requestedPublicProfileDigest as A, encodeTextForWire as C, foldModelRoutingFields as D, assertCurrentBackendType as E, createAgentRunOutcomeTracker as F, deriveAgentResultOutcome as I, deriveAgentRunOutcome as L, withProfileHarness as M, withoutCreateOnlyModelFields as N, mergeRuntimeBackendConfig as O, withoutRuntimeSecrets as P, projectAgentTerminalRecord as R, encodePromptForWire as S, applyRequestedModel as T, mintTraceId as _, assertScopedTokenActive as a, resolveDispatchRunIdentity as b, SandboxRuntimeApi as c, appendSessionIdQuery as d, sessionHeaders as f, isTraceId as g, TRACE_ID_HEADER as h, terminalUpgradeHeadersSupported as i, requestedSecretProfilePublicDigest as j, normalizeRuntimeBackendConfig as k, normalizeSessionInfo as l, waitForRetryAfter as m, InteractiveSessionController as n, requestInteractiveSessionToken as o, isRetryableCredentialRefusal as p, TerminalStream as r, requestScopedToken as s, BrowserInteractiveSessionController as t, sessionMessageRequestBody as u, resolveTraceId as v, canUseNodeHttp2 as w, validateAcceptedDispatchRunRef as x, traceHeaders as y, TERMINAL_WS_ECHO_SUBPROTOCOL as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as TerminalStreamReconnectAuthority, u as ScopedToken } from "./terminal-stream-types-
|
|
2
|
-
import { rr as TerminalStream } from "./types-
|
|
3
|
-
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, f as InteractiveAttachOptions, h as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-
|
|
1
|
+
import { o as TerminalStreamReconnectAuthority, u as ScopedToken } from "./terminal-stream-types-Bgy8iSFg.js";
|
|
2
|
+
import { rr as TerminalStream } from "./types-D6n5ohlx.js";
|
|
3
|
+
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, f as InteractiveAttachOptions, h as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-CAmOZ9Sw.js";
|
|
4
4
|
import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
|
|
5
5
|
|
|
6
6
|
//#region src/interactive-controller.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as runPreparedEvidence } from "../prepared-evidence-
|
|
1
|
+
import { t as runPreparedEvidence } from "../prepared-evidence-DUmJSegi.js";
|
|
2
2
|
export { runPreparedEvidence };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as withPreparedProcessCalls, t as runPreparedProcess } from "../prepared-process-
|
|
1
|
+
import { n as withPreparedProcessCalls, t as runPreparedProcess } from "../prepared-process-Dlk_9JVJ.js";
|
|
2
2
|
export { runPreparedProcess, withPreparedProcessCalls };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ar as CreateSandboxOptions, xa as BackendConfig } from "./types-
|
|
1
|
+
import { ar as CreateSandboxOptions, xa as BackendConfig } from "./types-D6n5ohlx.js";
|
|
2
2
|
|
|
3
3
|
//#region src/line-application.d.ts
|
|
4
4
|
/** Bounded callback request bytes after canonicalization, including JSON framing. */
|
package/dist/lines.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as LineRespondAgent, B as LineVoiceOptions, C as LineMessage, D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, I as LineSenderVerificationStart, L as LineThread, M as LineRole, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, R as LineTransport, S as LineMemberSpec, T as LineProvider, V as LinesHttpClient, _ 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, 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-
|
|
1
|
+
import { A as LineRespondAgent, B as LineVoiceOptions, C as LineMessage, D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, I as LineSenderVerificationStart, L as LineThread, M as LineRole, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, R as LineTransport, S as LineMemberSpec, T as LineProvider, V as LinesHttpClient, _ 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, 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-B9f2EKS6.js";
|
|
2
2
|
export { Line, LineAgentRolePolicy, LineAllowance, LineAllowanceSubject, LineApplicationAttachOptions, LineAttachOptions, LineAttachment, LineAttachmentReauthorization, LineExecutionKey, LineFromConnectionInput, LineImage, LineInstanceAttachOptions, LineInstanceCreate, LineLimits, LineMember, LineMemberInstance, LineMemberPatch, LineMemberSpec, LineMessage, LineNumberInventory, LineProvider, LineReminderPreferences, LineReplyCode, LineReplyCodeInput, LineReplyGate, LineRespondAgent, LineRespondView, LineRole, LineSendInput, LineSendReceipt, LineSenderVerification, LineSenderVerificationStart, LineThread, LineTransport, LineVoice, LineVoiceOptions, LinesClient, LinesHttpClient, SandboxLines, lineInstanceKey, profileChannelReference };
|
package/dist/lines.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-
|
|
1
|
+
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-D_HDAcVt.js";
|
|
2
2
|
export { LinesClient, SandboxLines, lineInstanceKey, profileChannelReference };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as AUTH_BUNDLE_PATHS } from "./cli-auth-bundle-
|
|
1
|
+
import { t as AUTH_BUNDLE_PATHS } from "./cli-auth-bundle-CrO4F3Ru.js";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as listAgentPreviews, i as getAgentPreview, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "./preview-operations-
|
|
1
|
+
import { a as listAgentPreviews, i as getAgentPreview, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "./preview-operations-eTUlPen5.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as SandboxInstance } from "./index-
|
|
2
|
-
import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-
|
|
3
|
-
import { t as Sandbox } from "./client-
|
|
1
|
+
import { O as SandboxInstance } from "./index-DQpx4M1t.js";
|
|
2
|
+
import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-D6n5ohlx.js";
|
|
3
|
+
import { t as Sandbox } from "./client-BG1kKuT7.js";
|
|
4
4
|
|
|
5
5
|
//#region src/agent/preview-operations.d.ts
|
|
6
6
|
type AgentPreviewOptions = Pick<EnsureDevServerOptions, "sessionId" | "cwd"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as SandboxError } from "./terminal-stream-types-
|
|
2
|
-
import { Pi as HttpClient, ai as PublishPublicTemplateVersionOptions, ii as PublishPublicTemplateOptions, ni as PublicTemplateInfo, ri as PublicTemplateVersionInfo } from "./types-
|
|
1
|
+
import { I as SandboxError } from "./terminal-stream-types-Bgy8iSFg.js";
|
|
2
|
+
import { Pi as HttpClient, ai as PublishPublicTemplateVersionOptions, ii as PublishPublicTemplateOptions, ni as PublicTemplateInfo, ri as PublicTemplateVersionInfo } from "./types-D6n5ohlx.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/public-templates.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
1
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-CkHcnhWA.js";
|
|
2
2
|
export { PublicTemplatePublishArtifact, PublicTemplatePublishError, PublicTemplatePublishJob, PublicTemplatePublishRequestOptions, PublicTemplatesClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runPreparedEvidence } from "./prepared-evidence-
|
|
1
|
+
import { t as runPreparedEvidence } from "./prepared-evidence-DUmJSegi.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/lib/raw-evidence-archive.ts
|
|
4
4
|
const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/).transform((value) => `sha256:${value.slice(7)}`);
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as NetworkError, B as StateError, E as FileWriteConflictError, I as SandboxError, L as SandboxErrorJson, M as PartialFailureError, N as ProfileFileMountPathError, P as QuotaError, R as SandboxFailureDetail, S as CapabilityError, U as TimeoutError, W as ValidationError, b as AuthError, j as NotFoundError, u as ScopedToken, z as ServerError } from "./terminal-stream-types-
|
|
2
|
-
import { Bn as SandboxPortBinding, Br as FileTreeResult, Ct as SessionMessageAdmission, Dt as TaskSessionCommitResult, Er as ChunkedUploadResult, Et as TaskSessionChanges, Gn as SandboxTerminalCreateOptions, Hr as FileUsageResult, Ir as FileRenameResult, Jn as SandboxTerminalRequestOptions, Jr as UploadProgress, Kn as SandboxTerminalInfo, Kr as RenameOptions, Mr as FileReadBatchOptions, Nr as FileReadBatchResult, Q as CommitTaskSessionOptions, St as SessionMessage, Tr as ChunkedUploadOptions, Un as SandboxRuntimeHealth, Ur as FileWriteResult, Vr as FileUsageOptions, Yr as WriteFileOptions, ct as ListMessagesOptions, dt as SendSessionMessageRequest, fa as SandboxEvent, ft as SentSessionMessage, gt as SessionExecutionStatus, ht as SessionExecutionInfo, it as CreateTaskSessionOptions, kt as TaskSessionInfo, mt as SessionEventStreamOptions, qn as SandboxTerminalManager, rr as TerminalStream, rt as CreateSessionOptions, ut as SendSessionMessageOptions, yt as SessionInfo, zr as FileTreeOptions } from "./types-
|
|
3
|
-
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, r as browserInteractiveControlHolderId } from "./browser-interactive-control-controller-
|
|
4
|
-
import { t as BrowserInteractiveSessionController } from "./interactive-controller-
|
|
5
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, o as projectAgentTerminalRecord, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
1
|
+
import { A as NetworkError, B as StateError, E as FileWriteConflictError, I as SandboxError, L as SandboxErrorJson, M as PartialFailureError, N as ProfileFileMountPathError, P as QuotaError, R as SandboxFailureDetail, S as CapabilityError, U as TimeoutError, W as ValidationError, b as AuthError, j as NotFoundError, u as ScopedToken, z as ServerError } from "./terminal-stream-types-Bgy8iSFg.js";
|
|
2
|
+
import { Bn as SandboxPortBinding, Br as FileTreeResult, Ct as SessionMessageAdmission, Dt as TaskSessionCommitResult, Er as ChunkedUploadResult, Et as TaskSessionChanges, Gn as SandboxTerminalCreateOptions, Hr as FileUsageResult, Ir as FileRenameResult, Jn as SandboxTerminalRequestOptions, Jr as UploadProgress, Kn as SandboxTerminalInfo, Kr as RenameOptions, Mr as FileReadBatchOptions, Nr as FileReadBatchResult, Q as CommitTaskSessionOptions, St as SessionMessage, Tr as ChunkedUploadOptions, Un as SandboxRuntimeHealth, Ur as FileWriteResult, Vr as FileUsageOptions, Yr as WriteFileOptions, ct as ListMessagesOptions, dt as SendSessionMessageRequest, fa as SandboxEvent, ft as SentSessionMessage, gt as SessionExecutionStatus, ht as SessionExecutionInfo, it as CreateTaskSessionOptions, kt as TaskSessionInfo, mt as SessionEventStreamOptions, qn as SandboxTerminalManager, rr as TerminalStream, rt as CreateSessionOptions, ut as SendSessionMessageOptions, yt as SessionInfo, zr as FileTreeOptions } from "./types-D6n5ohlx.js";
|
|
3
|
+
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, r as browserInteractiveControlHolderId } from "./browser-interactive-control-controller-CAmOZ9Sw.js";
|
|
4
|
+
import { t as BrowserInteractiveSessionController } from "./interactive-controller-qsiVS3gd.js";
|
|
5
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, o as projectAgentTerminalRecord, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-z5-7NA1x.js";
|
|
6
6
|
|
|
7
7
|
//#region src/lib/chunked-upload.d.ts
|
|
8
8
|
/** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
|
package/dist/runtime.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, L as deriveAgentRunOutcome, R as projectAgentTerminalRecord, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController } from "./interactive-controller-DIlzqR9a.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-Bs5G7JdV.js";
|
|
3
|
-
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-
|
|
4
|
-
import { t as fetchSandboxApi } from "./api-request-
|
|
5
|
-
import { s as uploadChunked } from "./chunked-upload-
|
|
3
|
+
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-CLHNi8rG.js";
|
|
4
|
+
import { t as fetchSandboxApi } from "./api-request-D1UVNo16.js";
|
|
5
|
+
import { s as uploadChunked } from "./chunked-upload-l6b9AWFA.js";
|
|
6
6
|
//#region src/runtime-client.ts
|
|
7
7
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
8
8
|
function requireToken(token) {
|