@tangle-network/sandbox 1.0.190 → 1.0.191
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 +4 -4
- package/dist/agent/index.js +9 -6
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +1 -1
- package/dist/{agent-run-outcome-Cst4px_l.d.ts → agent-run-outcome-BO5paRhX.d.ts} +2 -2
- package/dist/{api-request-CZlFy3ku.js → api-request-BvpTwQKs.js} +1 -1
- package/dist/{browser-interactive-control-controller-DHIS8edi.js → browser-interactive-control-controller-BYbNLahH.js} +1 -1
- package/dist/{browser-interactive-control-controller-DIvMQyer.d.ts → browser-interactive-control-controller-KOK6qn2s.d.ts} +1 -1
- package/dist/{chunked-upload-vAE2hVcP.js → chunked-upload-D5ytV_s6.js} +9 -13
- package/dist/{chunked-upload-file-HLSriv3V.js → chunked-upload-file-DL1-AqRp.js} +2 -2
- package/dist/{client-BERYosgI.js → client-XjkuWhog.js} +159 -109
- package/dist/{client-C4SnCCpF.d.ts → client-yWdLuj_P.d.ts} +5 -5
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-CmT6Ygiv.js → collaboration-Bbr45lyk.js} +3 -3
- package/dist/{core-BT-0QZT-.js → core-BU1I2KvV.js} +13 -7
- package/dist/core.d.ts +6 -6
- package/dist/core.js +5 -5
- package/dist/errors-Mzq10WZq.js +583 -0
- package/dist/{file-download-BXgu9BNh.js → file-download-CKOxcATB.js} +1 -1
- package/dist/{index-DDIymnCZ.d.ts → index-DKsOu5sq.d.ts} +5 -5
- package/dist/index.d.ts +9 -9
- package/dist/index.js +10 -10
- package/dist/intelligence/index.js +9 -5
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-DXGWBdYK.d.ts → interactive-controller-YyZEsoB0.d.ts} +3 -3
- package/dist/{interactive-controller-C876Pjaj.js → interactive-controller-jr3_74Pq.js} +90 -57
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-Br3ygqhP.d.ts → lines-CCHDUfQg.d.ts} +1 -1
- package/dist/{lines-DxHJhxCe.js → lines-DrG0WOW6.js} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{mcp-local-D7MpwsW0.js → mcp-local-Dler9R_s.js} +3 -3
- package/dist/{prepared-evidence-CP1MmeCQ.js → prepared-evidence-4prvV0YK.js} +1 -1
- package/dist/{prepared-process-BWVz93cT.js → prepared-process-BSpZXDDw.js} +1 -1
- package/dist/{preview-DUxqnKSk.d.ts → preview-I1z42VGY.d.ts} +3 -3
- package/dist/{public-templates-DQiblzzK.d.ts → public-templates-Cw6gmWJD.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +7 -4
- package/dist/{raw-evidence-archive-CgbWa4es.js → raw-evidence-archive-BD37zHN5.js} +2 -2
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +9 -7
- package/dist/{sandbox-B_Xbc9wR.js → sandbox-Dtb-_btd.js} +317 -221
- package/dist/select-seat-command.d.ts +1 -1
- package/dist/select-seat-command.js +5 -2
- package/dist/session-gateway/index.js +1 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-Sg9ORVAA.js → tangle-fs17QlcY.js} +2 -2
- package/dist/{terminal-stream-types-1YKRrkZB.d.ts → terminal-stream-types-BqNv5EuG.d.ts} +280 -305
- package/dist/{types-B-UsXSi6.d.ts → types-CiuGb4lZ.d.ts} +4 -2
- package/package.json +6 -6
- package/dist/errors-CaX0a5Ry.js +0 -636
- /package/dist/{abort-signal-PgWPMn_e.js → abort-signal-Cu4F2VVz.js} +0 -0
- /package/dist/{file-transfer-DTHgLccV.js → file-transfer-Cr9Ossea.js} +0 -0
- /package/dist/{retry-after-header-Bt-XvU-x.js → retry-after-header-DUdCC0KJ.js} +0 -0
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-
|
|
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-
|
|
3
|
-
import { t as Sandbox } from "../client-
|
|
4
|
-
import { u as PreviewAuthorizer } from "../preview-
|
|
1
|
+
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-DKsOu5sq.js";
|
|
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-CiuGb4lZ.js";
|
|
3
|
+
import { t as Sandbox } from "../client-yWdLuj_P.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-I1z42VGY.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-
|
|
4
|
-
import {
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-Dler9R_s.js";
|
|
2
|
+
import { O as assertCurrentBackendType } from "../interactive-controller-jr3_74Pq.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-Dtb-_btd.js";
|
|
4
|
+
import { D as ValidationError, _ as NotFoundError, w as StateError } from "../errors-Mzq10WZq.js";
|
|
5
|
+
import { t as Sandbox } from "../client-XjkuWhog.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
8
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
|
@@ -107,7 +107,10 @@ var SandboxAgentManager = class {
|
|
|
107
107
|
}
|
|
108
108
|
async startPrepared(spec) {
|
|
109
109
|
if (spec.callerSelectedId) {
|
|
110
|
-
if (await this.sandbox.session(spec.id).status()) throw new StateError(`Agent ${spec.id} already exists; use box.agents.get("${spec.id}") to reattach or choose a new id`,
|
|
110
|
+
if (await this.sandbox.session(spec.id).status()) throw new StateError(`Agent ${spec.id} already exists; use box.agents.get("${spec.id}") to reattach or choose a new id`, {
|
|
111
|
+
currentState: "existing-agent",
|
|
112
|
+
requiredState: "new-agent-id"
|
|
113
|
+
});
|
|
111
114
|
}
|
|
112
115
|
if (spec.workspace.mode === "isolated") return (await this.sandbox.createTaskSession({
|
|
113
116
|
sessionId: spec.id,
|
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-I1z42VGY.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-Dler9R_s.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,5 +1,5 @@
|
|
|
1
|
-
import { V as InteractionRequest } from "./terminal-stream-types-
|
|
2
|
-
import { Di as SandboxEvent, _i as DurablePlanSnapshot, ci as AgentApprovalRequirement, di as AgentToolInvocation, li as AgentQuestionRequest, ui as AgentRunStatus } from "./types-
|
|
1
|
+
import { V as InteractionRequest } from "./terminal-stream-types-BqNv5EuG.js";
|
|
2
|
+
import { Di as SandboxEvent, _i as DurablePlanSnapshot, ci as AgentApprovalRequirement, di as AgentToolInvocation, li as AgentQuestionRequest, ui as AgentRunStatus } from "./types-CiuGb4lZ.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
5
5
|
interface AgentRunOutcome {
|
|
@@ -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.191";
|
|
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);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as boundedIdentifierSchema, D as isBoundedEventContentJson, E as boundedStringSchema, S as boundedEventContentStringSchema, T as boundedJsonSchema, _ as CONTRACT_MAX_ARRAY_LENGTH, b as boundedEventContentJsonSchema, g as sha256DigestSchema, h as omitTopLevelDigest, m as looksLikeCredential, n as REASONING_EFFORTS, o as canonicalCandidateDigest, p as isWellFormedUnicode, s as canonicalCandidateJson, t as harnessTypeSchema, u as isCanonicalJsonValue, w as boundedJsonRecordSchema, x as boundedEventContentRecordSchema, y as CONTRACT_MAX_STRING_LENGTH } from "./harness-DMaNgn0S.js";
|
|
2
|
-
import { n as awaitWithAbort } from "./abort-signal-
|
|
2
|
+
import { n as awaitWithAbort } from "./abort-signal-Cu4F2VVz.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.13/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentInteractiveSessionStatus, C as AgentInteractiveSessionAttach, E as AgentInteractiveSessionControlClaimRequest, T as AgentInteractiveSessionControlClaimAcknowledgement, i as TerminalStreamHandlers, k as AgentInteractiveSessionRef, w as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-
|
|
1
|
+
import { A as AgentInteractiveSessionStatus, C as AgentInteractiveSessionAttach, E as AgentInteractiveSessionControlClaimRequest, T as AgentInteractiveSessionControlClaimAcknowledgement, i as TerminalStreamHandlers, k as AgentInteractiveSessionRef, w as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-BqNv5EuG.js";
|
|
2
2
|
|
|
3
3
|
//#region src/interactive-types.d.ts
|
|
4
4
|
/** Cancellation for an interactive SDK request. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { S as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-Mzq10WZq.js";
|
|
2
|
+
import { t as abortableSleep } from "./abort-signal-Cu4F2VVz.js";
|
|
3
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES, n as isFileTooLargeErrorBody, r as isPayloadTooLargeErrorBody } from "./file-transfer-Cr9Ossea.js";
|
|
4
4
|
//#region src/generated/sandbox-upload-operations.ts
|
|
5
5
|
function uploadSessionInit(transport, input, init = {}) {
|
|
6
6
|
return transport.fetch(`/fs/upload-session`, {
|
|
@@ -50,15 +50,8 @@ const RETRY_MAX_MS = 2e3;
|
|
|
50
50
|
* staging budget. */
|
|
51
51
|
const DEFAULT_UPLOAD_CONCURRENCY = 4;
|
|
52
52
|
const MAX_UPLOAD_CONCURRENCY = 8;
|
|
53
|
-
/** Transient part-upload failures worth retrying: rate-limit/budget (429),
|
|
54
|
-
* 5xx, transport (network), and request timeouts — mirrors
|
|
55
|
-
* `isTransientWriteError` in `sandbox.ts`. A non-transient error (bad path,
|
|
56
|
-
* auth, checksum, containment) fails loud immediately. */
|
|
57
|
-
function isTransientUploadError(rejection) {
|
|
58
|
-
return rejection instanceof QuotaError || rejection instanceof ServerError || rejection instanceof NetworkError || rejection instanceof TimeoutError;
|
|
59
|
-
}
|
|
60
53
|
function isChecksumMismatch(rejection) {
|
|
61
|
-
return rejection instanceof SandboxError && rejection.
|
|
54
|
+
return rejection instanceof SandboxError && rejection.wireCode === "CHECKSUM_MISMATCH";
|
|
62
55
|
}
|
|
63
56
|
/** Cheap size probe used for the pre-flight cap check, read directly off
|
|
64
57
|
* the input shape (`Blob.size` / `ArrayBuffer.byteLength` / view
|
|
@@ -223,7 +216,7 @@ async function putPart(transport, uploadId, index, options, wire) {
|
|
|
223
216
|
if (!response.ok) throw await parseUploadError(response);
|
|
224
217
|
return;
|
|
225
218
|
} catch (err) {
|
|
226
|
-
if (
|
|
219
|
+
if (isTransientWrite(err) && attempt < maxRetries) {
|
|
227
220
|
const retryAfterMs = err instanceof SandboxError ? err.retryAfterMs : void 0;
|
|
228
221
|
const backoff = Math.min(RETRY_BASE_MS * 2 ** attempt, RETRY_MAX_MS);
|
|
229
222
|
await abortableSleep(retryAfterMs ?? backoff, options.signal);
|
|
@@ -339,7 +332,10 @@ async function abortSession(transport, uploadId) {
|
|
|
339
332
|
*/
|
|
340
333
|
async function uploadChunked(transport, remotePath, data, options = {}) {
|
|
341
334
|
const estimatedSize = sizeOfInput(data);
|
|
342
|
-
if (estimatedSize > 67108864) throw new SandboxError(`Payload for ${remotePath} is ${estimatedSize} bytes, over the ${FILE_UPLOAD_SESSION_MAX_BYTES} byte chunked-upload session cap`,
|
|
335
|
+
if (estimatedSize > 67108864) throw new SandboxError(`Payload for ${remotePath} is ${estimatedSize} bytes, over the ${FILE_UPLOAD_SESSION_MAX_BYTES} byte chunked-upload session cap`, {
|
|
336
|
+
code: "PAYLOAD_TOO_LARGE",
|
|
337
|
+
status: 413
|
|
338
|
+
});
|
|
343
339
|
options.signal?.throwIfAborted();
|
|
344
340
|
const bytes = await normalizeToBytes(data);
|
|
345
341
|
options.signal?.throwIfAborted();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-
|
|
2
|
-
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-
|
|
1
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-Cr9Ossea.js";
|
|
2
|
+
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-D5ytV_s6.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { open } from "node:fs/promises";
|
|
5
5
|
//#region src/lib/chunked-upload-file.ts
|