@tangle-network/sandbox 1.0.241 → 1.0.243
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 +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +1 -1
- package/dist/{agent-run-outcome-BiCsXGzw.d.ts → agent-run-outcome-BgSJNbSv.d.ts} +2 -2
- package/dist/{api-request--DWPzmwv.js → api-request-DdzWM-kd.js} +2 -2
- package/dist/{browser-interactive-control-controller-D9plWzEP.d.ts → browser-interactive-control-controller-D1CmLBEn.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-D3ENnAih.js → browser-interactive-control-controller-gOAFGLlO.js} +1 -1
- package/dist/{chunked-upload-O-8ZfTgv.js → chunked-upload-B_CfWth1.js} +1 -1
- package/dist/{chunked-upload-file-Cko41h8C.js → chunked-upload-file-16t2BxYx.js} +1 -1
- package/dist/{client-BaodKpEF.js → client-CwVObMPp.js} +5 -5
- package/dist/{client-CP2Arxbz.d.ts → client-ZpAmrHIa.d.ts} +15 -8
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-BqP_-0rI.js → collaboration-D9UlQ1Xs.js} +2 -2
- package/dist/core.d.ts +7 -7
- package/dist/core.js +5 -5
- package/dist/{error-catalog-LyHHTFoQ.js → error-catalog-CH_n2ubl.js} +1 -0
- package/dist/{errors-BY-3SBlL.js → errors-LJAXbFuF.js} +1 -1
- package/dist/{file-download-C-u5Ejk6.js → file-download-BQZCoO5d.js} +1 -1
- package/dist/{index-B2cujKJI.d.ts → index-Wj7PcCUU.d.ts} +8 -8
- package/dist/index.d.ts +10 -10
- package/dist/index.js +11 -11
- package/dist/intelligence/index.js +3 -3
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-XhBbQdry.d.ts → interactive-controller-Cfx6Y0YB.d.ts} +3 -3
- package/dist/{interactive-controller-CwHdvUR-.js → interactive-controller-r8zayd7q.js} +4 -4
- package/dist/{lines-BNaFiqBy.js → lines-CIkCYod2.js} +1 -1
- package/dist/{lines-Bpzbhe3z.d.ts → lines-Ts_OQha-.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{mcp-local-BrTDDAV2.js → mcp-local-BeYPMmHZ.js} +2 -2
- package/dist/{preview-BEQ_X3h1.d.ts → preview-CCdeS6_7.d.ts} +3 -3
- package/dist/{public-templates-BDIqpwN5.d.ts → public-templates-62hehiOi.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-CpPxVqUK.js → raw-evidence-archive-Bg8v2G0F.js} +1 -1
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-qq0PSq3P.js → sandbox-1pkXjQGb.js} +87 -75
- package/dist/{select-seat-sASXpRdL.js → select-seat-BMbwBp0s.js} +102 -41
- package/dist/select-seat-command.d.ts +5 -6
- package/dist/select-seat-command.js +31 -25
- 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-qoQOQKdR.js → tangle-BR2dRtZx.js} +3 -3
- package/dist/{terminal-stream-types-DQNUfdKj.d.ts → terminal-stream-types-DHBpfcAh.d.ts} +1 -0
- package/dist/{types-D2l2jaHS.d.ts → types-Ds1aBGvy.d.ts} +3 -1
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as agentProfileSchema } from "./profile-schema-C0n0VgmA.js";
|
|
2
2
|
import { t as canonicalAgentProfileDigest } from "./agent-execution-preparation-CjKTjmJ9.js";
|
|
3
|
-
import { C as SandboxError, O as ValidationError, u as CapabilityError } from "./errors-
|
|
4
|
-
import { t as awaitWithAbort } from "./abort-signal-CRxC2dlT.js";
|
|
3
|
+
import { C as SandboxError, O as ValidationError, u as CapabilityError } from "./errors-LJAXbFuF.js";
|
|
4
|
+
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-CRxC2dlT.js";
|
|
5
5
|
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-C6DtK7GX-DoqlFTT-.js";
|
|
6
6
|
import "./cli-auth-bundle-BinY89CX.js";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -56,50 +56,111 @@ const resolutionSchema = z.strictObject({
|
|
|
56
56
|
const refusalSchema = seatSelectionRefusalSchema;
|
|
57
57
|
const SEAT_OWNER_MAX_RESPONSE_BYTES = 64 * 1024;
|
|
58
58
|
const SEAT_OWNER_MAX_REQUEST_BYTES = 8 * 1024 * 1024;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const SEAT_COMMAND_TIMEOUT_MS = 3e4;
|
|
60
|
+
/** @internal Shared command/broker timer policy; not a root SDK export. */
|
|
61
|
+
function seatOwnerTimeoutMs(timeoutMs = SEAT_COMMAND_TIMEOUT_MS) {
|
|
62
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 2147483647) throw new ValidationError("The account owner requires a positive timer bound");
|
|
63
|
+
return timeoutMs;
|
|
64
|
+
}
|
|
65
|
+
/** The existing authenticated client, or a private account-owner broker. */
|
|
66
|
+
function gatewaySeatTransport(source) {
|
|
67
|
+
let send;
|
|
68
|
+
let timeoutMs;
|
|
69
|
+
const rawBroker = !("fetch" in source);
|
|
70
|
+
if ("fetch" in source) send = (init) => source.fetch("/v1/model-credentials/resolve", init);
|
|
71
|
+
else {
|
|
72
|
+
const options = source;
|
|
73
|
+
let endpoint;
|
|
74
|
+
try {
|
|
75
|
+
endpoint = new URL(options.url);
|
|
76
|
+
} catch {
|
|
77
|
+
throw new ValidationError("The account owner broker URL is invalid");
|
|
78
|
+
}
|
|
79
|
+
if (typeof options.url !== "string" || options.url.length > 2048 || /\s/u.test(options.url) || endpoint.username || endpoint.password || endpoint.search || endpoint.hash || endpoint.protocol !== "https:" && !(endpoint.protocol === "http:" && [
|
|
80
|
+
"localhost",
|
|
81
|
+
"127.0.0.1",
|
|
82
|
+
"[::1]"
|
|
83
|
+
].includes(endpoint.hostname))) throw new ValidationError("The account owner requires HTTPS or loopback HTTP without URL credentials or parameters");
|
|
84
|
+
timeoutMs = seatOwnerTimeoutMs(options.timeoutMs);
|
|
85
|
+
const bearer = (configured = options.bearer) => {
|
|
86
|
+
const value = typeof configured === "function" ? configured() : configured;
|
|
87
|
+
if (typeof value !== "string" || value.length < 32 || value.length > 4096 || /\s/u.test(value)) throw new ValidationError("The account owner requires a bounded private bearer grant");
|
|
88
|
+
return value;
|
|
89
|
+
};
|
|
90
|
+
const configured = options.bearer;
|
|
91
|
+
if (typeof configured !== "function") bearer(configured);
|
|
92
|
+
send = (init) => fetch(endpoint, {
|
|
93
|
+
...init,
|
|
94
|
+
credentials: "omit",
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `Bearer ${bearer()}`,
|
|
97
|
+
"Content-Type": "application/json"
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
61
101
|
return async (request, signal) => {
|
|
102
|
+
signal?.throwIfAborted();
|
|
62
103
|
const payload = JSON.stringify(request);
|
|
63
|
-
if (new TextEncoder().encode(payload).byteLength > 8388608) throw new ValidationError("The account owner request exceeded its public bound");
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
104
|
+
if (typeof payload !== "string" || new TextEncoder().encode(payload).byteLength > 8388608) throw new ValidationError("The account owner request exceeded its public bound");
|
|
105
|
+
const controller = timeoutMs === void 0 ? void 0 : new AbortController();
|
|
106
|
+
const active = controller ? combineAbortSignals([controller.signal, ...signal ? [signal] : []]) : signal;
|
|
107
|
+
const timer = controller ? setTimeout(() => controller.abort(new SandboxError("The account owner request timed out", {
|
|
108
|
+
code: "SEAT_SELECTION_UNCONFIRMED",
|
|
109
|
+
status: 502
|
|
110
|
+
})), timeoutMs) : void 0;
|
|
111
|
+
const wait = (work) => {
|
|
112
|
+
active?.throwIfAborted();
|
|
113
|
+
return awaitWithAbort(Promise.resolve().then(() => {
|
|
114
|
+
active?.throwIfAborted();
|
|
115
|
+
return work();
|
|
116
|
+
}), active);
|
|
117
|
+
};
|
|
74
118
|
try {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
const response = await wait(() => send({
|
|
120
|
+
method: "POST",
|
|
121
|
+
redirect: "error",
|
|
122
|
+
body: payload,
|
|
123
|
+
...active ? { signal: active } : {}
|
|
124
|
+
}));
|
|
125
|
+
const reader = response.body?.getReader();
|
|
126
|
+
if (!reader) throw new ValidationError("The account owner returned no reply");
|
|
127
|
+
const decoder = new TextDecoder();
|
|
128
|
+
let text = "";
|
|
129
|
+
let size = 0;
|
|
130
|
+
try {
|
|
131
|
+
for (;;) {
|
|
132
|
+
const { done, value } = await wait(() => reader.read());
|
|
133
|
+
if (done) break;
|
|
134
|
+
size += value.byteLength;
|
|
135
|
+
if (size > 65536) throw new ValidationError("The account owner exceeded its public response bound");
|
|
136
|
+
text += decoder.decode(value, { stream: true });
|
|
137
|
+
}
|
|
138
|
+
} finally {
|
|
139
|
+
reader.cancel().catch(() => {});
|
|
140
|
+
reader.releaseLock();
|
|
81
141
|
}
|
|
142
|
+
let body;
|
|
143
|
+
try {
|
|
144
|
+
body = JSON.parse(text + decoder.decode());
|
|
145
|
+
} catch {
|
|
146
|
+
throw new ValidationError("The account owner returned invalid JSON");
|
|
147
|
+
}
|
|
148
|
+
active?.throwIfAborted();
|
|
149
|
+
return {
|
|
150
|
+
ok: response.ok,
|
|
151
|
+
status: response.status,
|
|
152
|
+
body
|
|
153
|
+
};
|
|
154
|
+
} catch (error) {
|
|
155
|
+
active?.throwIfAborted();
|
|
156
|
+
if (rawBroker && !(error instanceof SandboxError)) throw new SandboxError("The account owner request failed", {
|
|
157
|
+
code: "SEAT_SELECTION_UNCONFIRMED",
|
|
158
|
+
status: 502
|
|
159
|
+
});
|
|
160
|
+
throw error;
|
|
82
161
|
} finally {
|
|
83
|
-
|
|
84
|
-
reader.releaseLock();
|
|
162
|
+
clearTimeout(timer);
|
|
85
163
|
}
|
|
86
|
-
const bytes = new Uint8Array(size);
|
|
87
|
-
let offset = 0;
|
|
88
|
-
for (const chunk of chunks) {
|
|
89
|
-
bytes.set(chunk, offset);
|
|
90
|
-
offset += chunk.byteLength;
|
|
91
|
-
}
|
|
92
|
-
let body;
|
|
93
|
-
try {
|
|
94
|
-
body = JSON.parse(new TextDecoder().decode(bytes));
|
|
95
|
-
} catch {
|
|
96
|
-
throw new ValidationError("The account owner returned invalid JSON");
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
ok: response.ok,
|
|
100
|
-
status: response.status,
|
|
101
|
-
body
|
|
102
|
-
};
|
|
103
164
|
};
|
|
104
165
|
}
|
|
105
166
|
/** Classified owner refusal, with fixed diagnostics and no upstream credential material. */
|
|
@@ -242,4 +303,4 @@ function createSelectSeat(options) {
|
|
|
242
303
|
};
|
|
243
304
|
}
|
|
244
305
|
//#endregion
|
|
245
|
-
export {
|
|
306
|
+
export { createSelectSeat as a, SeatSelectionError as i, SEAT_OWNER_MAX_REQUEST_BYTES as n, gatewaySeatTransport as o, SEAT_OWNER_MAX_RESPONSE_BYTES as r, seatOwnerTimeoutMs as s, SEAT_COMMAND_TIMEOUT_MS as t };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { R as SandboxError } from "./terminal-stream-types-
|
|
2
|
-
import {
|
|
1
|
+
import { R as SandboxError } from "./terminal-stream-types-DHBpfcAh.js";
|
|
2
|
+
import { _t as SeatOwnerTransport, bt as SeatSelectionRequest, ft as SEAT_COMMAND_TIMEOUT_MS } from "./client-ZpAmrHIa.js";
|
|
3
3
|
|
|
4
4
|
//#region src/select-seat-command.d.ts
|
|
5
5
|
/** Public reply bound; the owner prints one metadata object. */
|
|
6
6
|
declare const SEAT_COMMAND_MAX_RESPONSE_BYTES: number;
|
|
7
|
-
declare const SEAT_COMMAND_TIMEOUT_MS = 30000;
|
|
8
7
|
interface CommandSeatTransportOptions {
|
|
9
|
-
/**
|
|
8
|
+
/** Owner argv; never run through a shell. */
|
|
10
9
|
command: readonly string[];
|
|
11
|
-
/** Complete environment for
|
|
12
|
-
env?: Record<string, string | undefined
|
|
10
|
+
/** Complete environment, read afresh for each request. */
|
|
11
|
+
env?: Record<string, string | undefined> | (() => Record<string, string | undefined>);
|
|
13
12
|
timeoutMs?: number;
|
|
14
13
|
}
|
|
15
14
|
declare class SeatOwnerCommandError extends SandboxError {
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import { C as SandboxError, O as ValidationError } from "./errors-
|
|
2
|
-
import {
|
|
1
|
+
import { C as SandboxError, O as ValidationError } from "./errors-LJAXbFuF.js";
|
|
2
|
+
import { r as SEAT_OWNER_MAX_RESPONSE_BYTES, s as seatOwnerTimeoutMs, t as SEAT_COMMAND_TIMEOUT_MS } from "./select-seat-BMbwBp0s.js";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
//#region src/select-seat-command.ts
|
|
5
5
|
/**
|
|
6
|
-
* Node-only transport for
|
|
7
|
-
* command (for example `acct sandbox resolve`) on a trusted controller host.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { createSelectSeat } from "@tangle-network/sandbox";
|
|
12
|
-
* import { commandSeatTransport } from "@tangle-network/sandbox/select-seat/command";
|
|
13
|
-
*
|
|
14
|
-
* const selectSeat = createSelectSeat({ client, runId, minimumValidUntil, createBackend,
|
|
15
|
-
* transport: commandSeatTransport({ command: ["/usr/local/bin/acct", "sandbox", "resolve"] }) });
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
6
|
+
* Node-only account-owner command transport for seat selection and credentials.
|
|
18
7
|
* @packageDocumentation
|
|
19
8
|
*/
|
|
20
9
|
/** Public reply bound; the owner prints one metadata object. */
|
|
21
10
|
const SEAT_COMMAND_MAX_RESPONSE_BYTES = SEAT_OWNER_MAX_RESPONSE_BYTES;
|
|
22
|
-
const SEAT_COMMAND_TIMEOUT_MS = 3e4;
|
|
23
11
|
/** The owner command's exit contract: 0 selected, 75 capacity refusal, 78 permanent route refusal. */
|
|
24
12
|
const EXIT_STATUS = {
|
|
25
13
|
0: 200,
|
|
26
14
|
75: 503,
|
|
27
15
|
78: 400
|
|
28
16
|
};
|
|
17
|
+
function commandEnvironment(env) {
|
|
18
|
+
if (env === void 0) return { ...process.env };
|
|
19
|
+
const entries = [];
|
|
20
|
+
if (env && typeof env === "object" && !Array.isArray(env)) for (const key in env) entries.push([key, env[key]]);
|
|
21
|
+
if (!env || typeof env !== "object" || Array.isArray(env) || entries.some(([key, value]) => !key || /[=\0]/u.test(key) || value !== void 0 && (typeof value !== "string" || value.includes("\0")))) throw new ValidationError("The account owner requires valid private process variables");
|
|
22
|
+
return Object.fromEntries(entries);
|
|
23
|
+
}
|
|
29
24
|
var SeatOwnerCommandError = class extends SandboxError {
|
|
30
25
|
constructor(message, exitCode = null, terminationSignal = null) {
|
|
31
26
|
super(message, {
|
|
@@ -37,16 +32,23 @@ var SeatOwnerCommandError = class extends SandboxError {
|
|
|
37
32
|
}
|
|
38
33
|
};
|
|
39
34
|
function commandSeatTransport(options) {
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
|
|
35
|
+
const command = options.command;
|
|
36
|
+
if (!Array.isArray(command) || command.length === 0 || command.length > 128 || [...command].some((part) => typeof part !== "string" || part.length === 0 || part.length > 4096 || part.includes("\0"))) throw new ValidationError("Seat selection requires a configured account command");
|
|
37
|
+
const [program, ...args] = command;
|
|
38
|
+
const timeoutMs = seatOwnerTimeoutMs(options.timeoutMs);
|
|
39
|
+
const configured = options.env;
|
|
40
|
+
if (typeof configured !== "function" && (!configured || Object.getPrototypeOf(configured) === Object.prototype || Array.isArray(configured)) && !Object.values(Object.getOwnPropertyDescriptors(configured ?? {})).some(({ enumerable, get }) => enumerable && get)) commandEnvironment(configured);
|
|
41
|
+
return async (request, signal) => {
|
|
42
|
+
signal?.throwIfAborted();
|
|
44
43
|
const payload = JSON.stringify(request);
|
|
45
|
-
if (Buffer.byteLength(payload) > 8388608)
|
|
44
|
+
if (typeof payload !== "string" || Buffer.byteLength(payload) > 8388608) throw new ValidationError("The account owner request exceeded its public bound");
|
|
46
45
|
return new Promise((resolve, reject) => {
|
|
46
|
+
signal?.throwIfAborted();
|
|
47
|
+
const configured = options.env;
|
|
48
|
+
const env = commandEnvironment(typeof configured === "function" ? configured() : configured);
|
|
47
49
|
signal?.throwIfAborted();
|
|
48
50
|
const child = spawn(program, args, {
|
|
49
|
-
env
|
|
51
|
+
env,
|
|
50
52
|
shell: false,
|
|
51
53
|
stdio: [
|
|
52
54
|
"pipe",
|
|
@@ -62,13 +64,14 @@ function commandSeatTransport(options) {
|
|
|
62
64
|
settled = true;
|
|
63
65
|
clearTimeout(timer);
|
|
64
66
|
signal?.removeEventListener("abort", abort);
|
|
65
|
-
if (
|
|
67
|
+
if (reply) resolve(reply);
|
|
68
|
+
else {
|
|
66
69
|
child.kill("SIGKILL");
|
|
67
70
|
reject(error);
|
|
68
|
-
}
|
|
71
|
+
}
|
|
69
72
|
};
|
|
70
73
|
const fail = (message, code = null, signal = null) => finish(new SeatOwnerCommandError(message, code, signal));
|
|
71
|
-
const abort = () => finish(signal?.reason
|
|
74
|
+
const abort = () => finish(signal?.reason);
|
|
72
75
|
signal?.addEventListener("abort", abort, { once: true });
|
|
73
76
|
const timer = setTimeout(() => fail("The account owner command timed out"), timeoutMs);
|
|
74
77
|
child.stderr.resume();
|
|
@@ -86,7 +89,7 @@ function commandSeatTransport(options) {
|
|
|
86
89
|
try {
|
|
87
90
|
body = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
88
91
|
} catch {
|
|
89
|
-
return
|
|
92
|
+
return fail("The account owner returned invalid JSON", code, terminationSignal);
|
|
90
93
|
}
|
|
91
94
|
finish(null, {
|
|
92
95
|
ok: status === 200,
|
|
@@ -95,6 +98,9 @@ function commandSeatTransport(options) {
|
|
|
95
98
|
});
|
|
96
99
|
});
|
|
97
100
|
child.stdin.end(payload);
|
|
101
|
+
}).catch((error) => {
|
|
102
|
+
signal?.throwIfAborted();
|
|
103
|
+
throw error instanceof SandboxError ? error : new SeatOwnerCommandError("The account owner command could not start");
|
|
98
104
|
});
|
|
99
105
|
};
|
|
100
106
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as combineAbortSignals } from "../abort-signal-CRxC2dlT.js";
|
|
2
|
-
import { i as fetchSandboxApi } from "../api-request
|
|
2
|
+
import { i as fetchSandboxApi } from "../api-request-DdzWM-kd.js";
|
|
3
3
|
import "../sidecar-proxy-error-DTdbCbUM.js";
|
|
4
4
|
import { t as parseSSEStream } from "../sse-parser-BCG3iL9j.js";
|
|
5
5
|
import { PART_TEXT, PART_TEXT_SUFFIX } from "@tangle-network/agent-core/sse";
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_CHAIN_ID, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as BlueprintSandboxClientConfig, h as BlueprintSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_JOBS_CONTRACT, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-
|
|
1
|
+
import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_CHAIN_ID, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as BlueprintSandboxClientConfig, h as BlueprintSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_JOBS_CONTRACT, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-Wj7PcCUU.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, BlueprintSandboxClient, BlueprintSandboxClientConfig, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
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-BR2dRtZx.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,6 +1,6 @@
|
|
|
1
|
-
import { R as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
-
import { a as readResponseJson } from "./errors-
|
|
3
|
-
import { i as fetchSandboxApi } from "./api-request
|
|
1
|
+
import { R as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-1pkXjQGb.js";
|
|
2
|
+
import { a as readResponseJson } from "./errors-LJAXbFuF.js";
|
|
3
|
+
import { i as fetchSandboxApi } from "./api-request-DdzWM-kd.js";
|
|
4
4
|
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-BT2q9nkO.js";
|
|
5
5
|
//#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
|
|
6
6
|
/**
|
|
@@ -3323,6 +3323,7 @@ declare const ERROR_CATALOG: {
|
|
|
3323
3323
|
readonly UNSUPPORTED: "501 final | This operation is not supported for this runtime, harness or driver. | Choose a runtime or option that supports it.";
|
|
3324
3324
|
readonly UPSTREAM_ERROR: "502 retry | An upstream service failed or answered outside its contract. | Retry with backoff; report the request id if it persists.";
|
|
3325
3325
|
readonly UNAVAILABLE: "503 retry | A dependency or capacity is temporarily unavailable. | Retry after the Retry-After interval.";
|
|
3326
|
+
readonly UPSTREAM_UNAVAILABLE: "503 retry | The sandbox controller did not answer, or answered without a code the catalog knows. | Retry after the Retry-After interval.";
|
|
3326
3327
|
readonly NOT_READY: "503 retry | The target is starting, restarting, recovering or draining. | Retry after the Retry-After interval.";
|
|
3327
3328
|
readonly BACKEND_UNAVAILABLE: "503 retry | The agent backend did not answer. | Retry after the Retry-After interval.";
|
|
3328
3329
|
readonly MESSAGE_RETRIEVAL_UNAVAILABLE: "503 retry | Message storage did not answer. | Retry after the Retry-After interval.";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as BatchBackendInput, B as SandboxErrorMetadata, Bt as PlanContinuation, Ct as AgentRuntimeAttachments, Dt as AgentProfile, Ft as AgentProfileValidationResult, It as ReasoningEffort, Ot as AgentProfileCapabilities, Rt as ProxySecretReceipt, Tt as InteractionRequest, Y as SandboxCreateReceipt, a as TerminalStreamOptions, bt as AgentExactRunControlRef, g as TerminalReadyInfo, i as TerminalStreamHandlers, it as SandboxSizePreset, kt as AgentProfileConfidential, s as TerminalStreamToken, t as TerminalAttachTimings } from "./terminal-stream-types-
|
|
1
|
+
import { $ as BatchBackendInput, B as SandboxErrorMetadata, Bt as PlanContinuation, Ct as AgentRuntimeAttachments, Dt as AgentProfile, Ft as AgentProfileValidationResult, It as ReasoningEffort, Ot as AgentProfileCapabilities, Rt as ProxySecretReceipt, Tt as InteractionRequest, Y as SandboxCreateReceipt, a as TerminalStreamOptions, bt as AgentExactRunControlRef, g as TerminalReadyInfo, i as TerminalStreamHandlers, it as SandboxSizePreset, kt as AgentProfileConfidential, s as TerminalStreamToken, t as TerminalAttachTimings } from "./terminal-stream-types-DHBpfcAh.js";
|
|
2
2
|
import { t as CliAuthReference } from "./cli-auth-bundle-eUl7Sa1x.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../../../packages/runtime-contracts/dist/backend-types.d.ts
|
|
@@ -1227,6 +1227,8 @@ interface SessionEventStreamOptions {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
/** Select one exact execution when awaiting a session result. */
|
|
1229
1229
|
interface SessionResultOptions {
|
|
1230
|
+
/** Cancel this result wait without interrupting the execution. */
|
|
1231
|
+
signal?: AbortSignal;
|
|
1230
1232
|
/**
|
|
1231
1233
|
* Runtime execution to replay and aggregate.
|
|
1232
1234
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.243",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -154,14 +154,14 @@
|
|
|
154
154
|
"ws": "^8.22.0",
|
|
155
155
|
"yjs": "13.6.33",
|
|
156
156
|
"@products/sandbox-test-utils": "0.0.0",
|
|
157
|
-
"@repo/shared": "0.0.0",
|
|
158
157
|
"@tangle-network/agent-profile-materialize": "0.27.1",
|
|
159
158
|
"@tangle-network/cli-agent-registry": "0.15.0",
|
|
160
|
-
"@tangle-network/runtime-contracts": "0.20.0"
|
|
159
|
+
"@tangle-network/runtime-contracts": "0.20.0",
|
|
160
|
+
"@repo/shared": "0.0.0"
|
|
161
161
|
},
|
|
162
162
|
"tangleRelease": {
|
|
163
|
-
"sourceSha": "
|
|
164
|
-
"mergedAt": "2026-11-
|
|
163
|
+
"sourceSha": "2610fa24827acda4cb7c05a9a6d41a7a6ddb6a6c",
|
|
164
|
+
"mergedAt": "2026-11-05T02:05:58-08:00"
|
|
165
165
|
},
|
|
166
166
|
"scripts": {
|
|
167
167
|
"build": "node scripts/build-dist.mjs",
|