@tangle-network/sandbox 0.60.3 → 0.60.6
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 +2 -0
- 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 +2 -2
- package/dist/{agent-run-outcome-BDxby7zK.d.ts → agent-run-outcome-B7w8HpoL.d.ts} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-C2qVGzQz.d.ts → browser-interactive-control-controller-C-3MDol8.d.ts} +1 -1
- package/dist/{client-Co3TZfTd.d.ts → client-AXO7ykS7.d.ts} +5 -5
- package/dist/{client-p2T45dAv.js → client-qSyPPokh.js} +84 -355
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-C1JAl5kE.js → collaboration-B7QeBrFQ.js} +1 -1
- package/dist/core.d.ts +5 -5
- package/dist/core.js +3 -3
- package/dist/{errors-CKl_BSlD.js → errors-D1JIX7Jm.js} +13 -1
- package/dist/{index-Numcq5sH.d.ts → index-BPt77jdR.d.ts} +88 -3
- package/dist/index.d.ts +12 -12
- package/dist/index.js +6 -6
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/{interactive-controller-DV1HT3NR.js → interactive-controller-f_ePJqoh.js} +14 -8
- package/dist/{interactive-controller-Dghv9yMk.d.ts → interactive-controller-iYddZt8b.d.ts} +2 -2
- package/dist/{lines-CRlIO585.d.ts → lines-ggdLY7xy.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-CdIM0B6p.js → local-cli-auth-D4T4wi9r.js} +1 -1
- package/dist/{mcp-local-BSvH4yAU.js → mcp-local-DjryqUiY.js} +1 -1
- package/dist/{preview-DlN1ee1K.d.ts → preview-CAiSrOuZ.d.ts} +3 -3
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +2 -2
- package/dist/{sandbox-DeE2MDx9.js → sandbox-DF2Z1lqW.js} +128 -558
- package/dist/{sandbox-fyuaDhc3.d.ts → sandbox-DsJ3ZJdA.d.ts} +5 -5
- package/dist/secp256k1-CyKOxB5J.js +2619 -0
- package/dist/session-gateway/index.d.ts +31 -25
- package/dist/session-gateway/index.js +75 -79
- package/dist/tangle/index.d.ts +2 -2
- package/dist/tangle/index.js +2 -2
- package/dist/tangle-CDtwGZtf.js +2847 -0
- package/dist/{types-C9w6MdZB.d.ts → types-BbgO-4f8.d.ts} +6 -2
- package/dist/utils-ChcSLv53.js +170 -0
- package/package.json +8 -7
- package/dist/tangle-SNShua9T.js +0 -1146
- /package/dist/{cli-auth-bundle-gs7xEnA1.d.ts → cli-auth-bundle-CTia4WWs.d.ts} +0 -0
- /package/dist/{cli-auth-bundle-ChOdvrjd.js → cli-auth-bundle-DzbqR2nA.js} +0 -0
- /package/dist/{errors-C6dll8Qf.d.ts → errors-DS32ViPj.d.ts} +0 -0
- /package/dist/{index-BKhRnV0i.d.ts → index-BXcL8P-U.d.ts} +0 -0
- /package/dist/{index-BSCz2Q0v.d.ts → index-BoQeoNOD.d.ts} +0 -0
- /package/dist/{preview-operations-BLsclF88.js → preview-operations-DqSo-IBm.js} +0 -0
- /package/dist/{terminal-stream-C9jxoB07.d.ts → terminal-stream-BUMu8Oae.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-
|
|
2
|
-
import { t as CliAuthReference } from "./cli-auth-bundle-
|
|
1
|
+
import { r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-BUMu8Oae.js";
|
|
2
|
+
import { t as CliAuthReference } from "./cli-auth-bundle-CTia4WWs.js";
|
|
3
3
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
4
4
|
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, AgentRuntimeAttachments, HarnessType, ReasoningEffort, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -3426,6 +3426,8 @@ interface SendSessionMessageRequest {
|
|
|
3426
3426
|
managedModelCredential?: true;
|
|
3427
3427
|
/** Exact caller-owned execution identity for canonical cancellation. */
|
|
3428
3428
|
runControlRef?: AgentExactRunControlRef;
|
|
3429
|
+
/** Absolute UTC deadline for admitting the first native provider call. */
|
|
3430
|
+
admissionDeadline?: string;
|
|
3429
3431
|
parts: SessionMessageInputPart[];
|
|
3430
3432
|
system?: string;
|
|
3431
3433
|
agent?: string;
|
|
@@ -3690,6 +3692,8 @@ interface ConversationTurnOptions {
|
|
|
3690
3692
|
model?: string;
|
|
3691
3693
|
/** Exact execution identity retained by admission and cancellation. */
|
|
3692
3694
|
runControlRef?: AgentExactRunControlRef;
|
|
3695
|
+
/** Absolute UTC deadline for admitting the first native provider call. */
|
|
3696
|
+
admissionDeadline?: string;
|
|
3693
3697
|
/** False is a passive settlement/cancellation lookup; never admits new work. */
|
|
3694
3698
|
allowDispatch?: boolean;
|
|
3695
3699
|
timeoutMs?: number;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import * as nc from "node:crypto";
|
|
2
|
+
//#region ../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
|
|
3
|
+
/**
|
|
4
|
+
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
|
5
|
+
* @todo re-check https://issues.chromium.org/issues/42212588
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
9
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
10
|
+
function fromBig(n, le = false) {
|
|
11
|
+
if (le) return {
|
|
12
|
+
h: Number(n & U32_MASK64),
|
|
13
|
+
l: Number(n >> _32n & U32_MASK64)
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
h: Number(n >> _32n & U32_MASK64) | 0,
|
|
17
|
+
l: Number(n & U32_MASK64) | 0
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function split(lst, le = false) {
|
|
21
|
+
const len = lst.length;
|
|
22
|
+
let Ah = new Uint32Array(len);
|
|
23
|
+
let Al = new Uint32Array(len);
|
|
24
|
+
for (let i = 0; i < len; i++) {
|
|
25
|
+
const { h, l } = fromBig(lst[i], le);
|
|
26
|
+
[Ah[i], Al[i]] = [h, l];
|
|
27
|
+
}
|
|
28
|
+
return [Ah, Al];
|
|
29
|
+
}
|
|
30
|
+
const rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
31
|
+
const rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
32
|
+
const rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
33
|
+
const rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region ../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
36
|
+
/**
|
|
37
|
+
* Internal webcrypto alias.
|
|
38
|
+
* We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.
|
|
39
|
+
* Falls back to Node.js built-in crypto for Node.js <=v14.
|
|
40
|
+
* See utils.ts for details.
|
|
41
|
+
* @module
|
|
42
|
+
*/
|
|
43
|
+
const crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
46
|
+
/**
|
|
47
|
+
* Utilities for hex, bytes, CSPRNG.
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
51
|
+
/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
|
|
52
|
+
function isBytes(a) {
|
|
53
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
54
|
+
}
|
|
55
|
+
/** Asserts something is positive integer. */
|
|
56
|
+
function anumber(n) {
|
|
57
|
+
if (!Number.isSafeInteger(n) || n < 0) throw new Error("positive integer expected, got " + n);
|
|
58
|
+
}
|
|
59
|
+
/** Asserts something is Uint8Array. */
|
|
60
|
+
function abytes(b, ...lengths) {
|
|
61
|
+
if (!isBytes(b)) throw new Error("Uint8Array expected");
|
|
62
|
+
if (lengths.length > 0 && !lengths.includes(b.length)) throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
63
|
+
}
|
|
64
|
+
/** Asserts something is hash */
|
|
65
|
+
function ahash(h) {
|
|
66
|
+
if (typeof h !== "function" || typeof h.create !== "function") throw new Error("Hash should be wrapped by utils.createHasher");
|
|
67
|
+
anumber(h.outputLen);
|
|
68
|
+
anumber(h.blockLen);
|
|
69
|
+
}
|
|
70
|
+
/** Asserts a hash instance has not been destroyed / finished */
|
|
71
|
+
function aexists(instance, checkFinished = true) {
|
|
72
|
+
if (instance.destroyed) throw new Error("Hash instance has been destroyed");
|
|
73
|
+
if (checkFinished && instance.finished) throw new Error("Hash#digest() has already been called");
|
|
74
|
+
}
|
|
75
|
+
/** Asserts output is properly-sized byte array */
|
|
76
|
+
function aoutput(out, instance) {
|
|
77
|
+
abytes(out);
|
|
78
|
+
const min = instance.outputLen;
|
|
79
|
+
if (out.length < min) throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
80
|
+
}
|
|
81
|
+
/** Cast u8 / u16 / u32 to u32. */
|
|
82
|
+
function u32(arr) {
|
|
83
|
+
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
84
|
+
}
|
|
85
|
+
/** Zeroize a byte array. Warning: JS provides no guarantees. */
|
|
86
|
+
function clean(...arrays) {
|
|
87
|
+
for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
|
|
88
|
+
}
|
|
89
|
+
/** Create DataView of an array for easy byte-level manipulation. */
|
|
90
|
+
function createView(arr) {
|
|
91
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
92
|
+
}
|
|
93
|
+
/** The rotate right (circular right shift) operation for uint32 */
|
|
94
|
+
function rotr(word, shift) {
|
|
95
|
+
return word << 32 - shift | word >>> shift;
|
|
96
|
+
}
|
|
97
|
+
/** Is current platform little-endian? Most are. Big-Endian platform: IBM */
|
|
98
|
+
const isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
99
|
+
/** The byte swap operation for uint32 */
|
|
100
|
+
function byteSwap(word) {
|
|
101
|
+
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
102
|
+
}
|
|
103
|
+
/** In place byte swap for Uint32Array */
|
|
104
|
+
function byteSwap32(arr) {
|
|
105
|
+
for (let i = 0; i < arr.length; i++) arr[i] = byteSwap(arr[i]);
|
|
106
|
+
return arr;
|
|
107
|
+
}
|
|
108
|
+
const swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
109
|
+
typeof Uint8Array.from([]).toHex === "function" && Uint8Array.fromHex;
|
|
110
|
+
/**
|
|
111
|
+
* Converts string to bytes using UTF8 encoding.
|
|
112
|
+
* @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])
|
|
113
|
+
*/
|
|
114
|
+
function utf8ToBytes(str) {
|
|
115
|
+
if (typeof str !== "string") throw new Error("string expected");
|
|
116
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Normalizes (non-hex) string or Uint8Array to Uint8Array.
|
|
120
|
+
* Warning: when Uint8Array is passed, it would NOT get copied.
|
|
121
|
+
* Keep in mind for future mutable operations.
|
|
122
|
+
*/
|
|
123
|
+
function toBytes(data) {
|
|
124
|
+
if (typeof data === "string") data = utf8ToBytes(data);
|
|
125
|
+
abytes(data);
|
|
126
|
+
return data;
|
|
127
|
+
}
|
|
128
|
+
/** Copies several Uint8Arrays into one. */
|
|
129
|
+
function concatBytes(...arrays) {
|
|
130
|
+
let sum = 0;
|
|
131
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
132
|
+
const a = arrays[i];
|
|
133
|
+
abytes(a);
|
|
134
|
+
sum += a.length;
|
|
135
|
+
}
|
|
136
|
+
const res = new Uint8Array(sum);
|
|
137
|
+
for (let i = 0, pad = 0; i < arrays.length; i++) {
|
|
138
|
+
const a = arrays[i];
|
|
139
|
+
res.set(a, pad);
|
|
140
|
+
pad += a.length;
|
|
141
|
+
}
|
|
142
|
+
return res;
|
|
143
|
+
}
|
|
144
|
+
/** For runtime check if class implements interface */
|
|
145
|
+
var Hash = class {};
|
|
146
|
+
/** Wraps hash function, creating an interface on top of it */
|
|
147
|
+
function createHasher(hashCons) {
|
|
148
|
+
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
149
|
+
const tmp = hashCons();
|
|
150
|
+
hashC.outputLen = tmp.outputLen;
|
|
151
|
+
hashC.blockLen = tmp.blockLen;
|
|
152
|
+
hashC.create = () => hashCons();
|
|
153
|
+
return hashC;
|
|
154
|
+
}
|
|
155
|
+
function createXOFer(hashCons) {
|
|
156
|
+
const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
|
|
157
|
+
const tmp = hashCons({});
|
|
158
|
+
hashC.outputLen = tmp.outputLen;
|
|
159
|
+
hashC.blockLen = tmp.blockLen;
|
|
160
|
+
hashC.create = (opts) => hashCons(opts);
|
|
161
|
+
return hashC;
|
|
162
|
+
}
|
|
163
|
+
/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
|
|
164
|
+
function randomBytes(bytesLength = 32) {
|
|
165
|
+
if (crypto && typeof crypto.getRandomValues === "function") return crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
166
|
+
if (crypto && typeof crypto.randomBytes === "function") return Uint8Array.from(crypto.randomBytes(bytesLength));
|
|
167
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
export { rotlBH as _, anumber as a, rotlSL as b, concatBytes as c, createXOFer as d, randomBytes as f, u32 as g, toBytes as h, ahash as i, createHasher as l, swap32IfBE as m, abytes as n, aoutput as o, rotr as p, aexists as r, clean as s, Hash as t, createView as u, rotlBL as v, split as x, rotlSH as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.6",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"@mastra/core": "1.67.0",
|
|
139
139
|
"@types/node": "25.6.0",
|
|
140
140
|
"@types/ws": "^8.18.1",
|
|
141
|
-
"@vitest/coverage-v8": "^4.1.
|
|
141
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
142
142
|
"ai": "7.0.107",
|
|
143
143
|
"dotenv": "^16.4.5",
|
|
144
144
|
"openai": "^6.36.0",
|
|
@@ -148,12 +148,13 @@
|
|
|
148
148
|
"vitest": "^4.1.11",
|
|
149
149
|
"ws": "^8.20.0",
|
|
150
150
|
"yjs": "13.6.30",
|
|
151
|
+
"@repo/shared": "0.0.0",
|
|
152
|
+
"@tangle-network/agent-profile-materialize": "0.20.6",
|
|
151
153
|
"@products/sandbox-test-utils": "0.0.0",
|
|
152
|
-
"@tangle-network/agent-
|
|
153
|
-
"@tangle-network/runtime-contracts": "0.11.
|
|
154
|
-
"@tangle-network/
|
|
155
|
-
"@tangle-network/
|
|
156
|
-
"@repo/shared": "0.0.0"
|
|
154
|
+
"@tangle-network/cli-agent-registry": "0.4.18",
|
|
155
|
+
"@tangle-network/runtime-contracts": "0.11.1",
|
|
156
|
+
"@tangle-network/sdk": "3.3.36",
|
|
157
|
+
"@tangle-network/sse-core": "0.0.0"
|
|
157
158
|
},
|
|
158
159
|
"scripts": {
|
|
159
160
|
"build": "node scripts/build-dist.mjs",
|