@tangle-network/sandbox 0.69.10 → 0.69.12

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.
Files changed (77) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +3 -3
  5. package/dist/{agent-run-outcome-B5CzWxw4.d.ts → agent-run-outcome-BuebRCWr.d.ts} +2 -2
  6. package/dist/{api-request-D1UVNo16.js → api-request-EseiF9B1.js} +1 -1
  7. package/dist/auth/index.d.ts +2 -2
  8. package/dist/auth/index.js +1 -1
  9. package/dist/browser-interactive-control-controller-Bt1vcu9c.js +4045 -0
  10. package/dist/{browser-interactive-control-controller-SI9hV6r5.d.ts → browser-interactive-control-controller-CVnME80O.d.ts} +5 -7
  11. package/dist/{chunked-upload-l6b9AWFA.js → chunked-upload-Df_5Q2x8.js} +1 -1
  12. package/dist/{chunked-upload-file-CLwAeLrM.js → chunked-upload-file-Dtm1GBkE.js} +2 -2
  13. package/dist/cli-auth-bundle-f2pt7sVA.js +2593 -0
  14. package/dist/{client-qjA1hNOp.js → client-BR_aABY2.js} +11 -11
  15. package/dist/{client-BGm6cw7B.d.ts → client-BWnbrifs.d.ts} +30 -32
  16. package/dist/collaboration/index.d.ts +1 -1
  17. package/dist/collaboration/index.js +1 -1
  18. package/dist/{collaboration-BwLNv6sy.js → collaboration-BTGTf3We.js} +1 -1
  19. package/dist/{core-CG7T2arO.js → core-DeXa_YQ2.js} +5 -4
  20. package/dist/core.d.ts +6 -6
  21. package/dist/core.js +5 -5
  22. package/dist/{direct-http2-Pyj3Rvr1.js → direct-http2-B0ra_xhU.js} +1 -1
  23. package/dist/{errors-Bs5G7JdV.js → errors-ZmDrrk4f.js} +1 -1
  24. package/dist/harness-BD_OISom.js +201 -0
  25. package/dist/harness-DWL2MM4q.js +418 -0
  26. package/dist/{index-nXob5TkM.d.ts → index-DdcCRDq8.d.ts} +14 -16
  27. package/dist/index.d.ts +11 -11
  28. package/dist/index.js +11 -11
  29. package/dist/intelligence/index.js +2 -2
  30. package/dist/interactive-control.d.ts +1 -1
  31. package/dist/interactive-control.js +1 -1
  32. package/dist/{interactive-controller-DSDEfapN.js → interactive-controller-B4bQwRJL.js} +21 -8
  33. package/dist/{interactive-controller-FgmcS8_Y.d.ts → interactive-controller-DlFKGQqu.d.ts} +3 -4
  34. package/dist/lib/prepared-evidence.js +1 -1
  35. package/dist/lib/prepared-process.js +1 -1
  36. package/dist/{lines-D_HDAcVt.js → lines-BqZOl_io.js} +1 -1
  37. package/dist/{lines-BoVYnUCM.d.ts → lines-ptj8SyD4.d.ts} +1 -1
  38. package/dist/lines.d.ts +1 -1
  39. package/dist/lines.js +1 -1
  40. package/dist/{local-cli-auth-YGra1QUA.js → local-cli-auth-Cpi3hT3j.js} +1 -1
  41. package/dist/{mcp-local-Gz1Uygqk.js → mcp-local-BcRLN_Ic.js} +1 -1
  42. package/dist/{prepared-evidence-DUmJSegi.js → prepared-evidence-CuUh_mz6.js} +1 -1
  43. package/dist/{preview-Vu5knAuf.d.ts → preview-ByTCKjiK.d.ts} +3 -3
  44. package/dist/profile-schema-CT3hB1mG.js +1135 -0
  45. package/dist/{public-templates-B6_uwnRZ.d.ts → public-templates-O2mxBX7J.d.ts} +2 -2
  46. package/dist/public-templates.d.ts +1 -1
  47. package/dist/public-templates.js +1 -1
  48. package/dist/{raw-evidence-archive-D60Yg1-5.js → raw-evidence-archive-CqarcYcp.js} +1 -1
  49. package/dist/runtime.d.ts +5 -5
  50. package/dist/runtime.js +5 -5
  51. package/dist/{sandbox-BulsMs3K.js → sandbox-B1ROfJxe.js} +384 -46
  52. package/dist/{secp256k1-DxHlUI6v.js → secp256k1-CZWrpqxW.js} +1 -1
  53. package/dist/select-seat-command.d.ts +1 -1
  54. package/dist/select-seat-command.js +1 -1
  55. package/dist/session-gateway/index.js +3 -3
  56. package/dist/sha2-BUPMvGTk.js +694 -0
  57. package/dist/tangle/index.d.ts +1 -1
  58. package/dist/tangle/index.js +1 -1
  59. package/dist/{tangle-DdzOPPJ9.js → tangle-q-3ualoW.js} +4 -4
  60. package/dist/terminal-stream-types-DwXQzUbH.d.ts +3328 -0
  61. package/dist/{types-CkLWX7i5.d.ts → types-B28t5Sq1.d.ts} +10 -12
  62. package/package.json +6 -6
  63. package/dist/browser-interactive-control-controller-CLHNi8rG.js +0 -292
  64. package/dist/cli-auth-bundle-DmaEJ_qh.js +0 -1590
  65. package/dist/terminal-stream-types-DuzvL1ge.d.ts +0 -676
  66. /package/dist/{abort-signal-BKVZNJul.js → abort-signal-jU-SEjLT.js} +0 -0
  67. /package/dist/{cli-auth-bundle-CeNOYFje.d.ts → cli-auth-bundle-MskLEgtA.d.ts} +0 -0
  68. /package/dist/{index-C0RkLba5.d.ts → index-Dqcr9p97.d.ts} +0 -0
  69. /package/dist/{index-DaIF4c9p.d.ts → index-Dslyq85a.d.ts} +0 -0
  70. /package/dist/{keep-alive-fetch-Bi-zvHpN.js → keep-alive-fetch-C2DX2_rG.js} +0 -0
  71. /package/dist/{prepared-process-Dlk_9JVJ.js → prepared-process-LjBfQnZ5.js} +0 -0
  72. /package/dist/{preview-operations-eTUlPen5.js → preview-operations-BvgwYaoL.js} +0 -0
  73. /package/dist/{response-rewrap-BKkJ5hnn.js → response-rewrap-MBztoTLx.js} +0 -0
  74. /package/dist/{retry-after-header-U_L5Ml9Q.js → retry-after-header-BZbs5rig.js} +0 -0
  75. /package/dist/{sidecar-proxy-error-B2Hxt41g.js → sidecar-proxy-error-Dty4zmN7.js} +0 -0
  76. /package/dist/{sse-parser-CUfurwcm.js → sse-parser-DmO5gP6u.js} +0 -0
  77. /package/dist/{utils-DB8DnUCU.js → utils-vaFoyyiO.js} +0 -0
@@ -0,0 +1,694 @@
1
+ //#region ../../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_u64.js
2
+ const U32_MASK64 = BigInt(2 ** 32 - 1);
3
+ const _32n = /* @__PURE__ */ BigInt(32);
4
+ function fromBig(n, le = false) {
5
+ if (le) return {
6
+ h: Number(n & U32_MASK64),
7
+ l: Number(n >> _32n & U32_MASK64)
8
+ };
9
+ return {
10
+ h: Number(n >> _32n & U32_MASK64) | 0,
11
+ l: Number(n & U32_MASK64) | 0
12
+ };
13
+ }
14
+ function split(lst, le = false) {
15
+ const len = lst.length;
16
+ let Ah = new Uint32Array(len);
17
+ let Al = new Uint32Array(len);
18
+ for (let i = 0; i < len; i++) {
19
+ const { h, l } = fromBig(lst[i], le);
20
+ [Ah[i], Al[i]] = [h, l];
21
+ }
22
+ return [Ah, Al];
23
+ }
24
+ const fromNumH = (n) => n / 2 ** 32 | 0;
25
+ const fromNumL = (n) => n >>> 0;
26
+ function setU64FromNum(view, byteOffset, n, isLE) {
27
+ const h = fromNumH(n);
28
+ const l = fromNumL(n);
29
+ view.setUint32(byteOffset, isLE ? l : h, isLE);
30
+ view.setUint32(byteOffset + 4, isLE ? h : l, isLE);
31
+ }
32
+ //#endregion
33
+ //#region ../../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js
34
+ /**
35
+ * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.
36
+ * @param a - value to test
37
+ * @returns `true` when the value is a Uint8Array-compatible view.
38
+ * @example
39
+ * Check whether a value is a Uint8Array-compatible view.
40
+ * ```ts
41
+ * isBytes(new Uint8Array([1, 2, 3]));
42
+ * ```
43
+ */
44
+ function isBytes(a) {
45
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
46
+ }
47
+ const atitle = (title) => title ? `"${title}" ` : "";
48
+ /**
49
+ * Asserts something is a non-negative integer.
50
+ * @param n - number to validate
51
+ * @param title - label included in thrown errors
52
+ * @returns The validated number.
53
+ * @throws On wrong argument types. {@link TypeError}
54
+ * @throws On wrong argument ranges or values. {@link RangeError}
55
+ * @example
56
+ * Validate a non-negative integer option.
57
+ * ```ts
58
+ * anumber(32, 'length');
59
+ * ```
60
+ */
61
+ function anumber(n, title = "") {
62
+ if (typeof n !== "number") throw new TypeError(atitle(title) + "expected number, got " + typeof n);
63
+ if (!Number.isSafeInteger(n) || n < 0) throw new RangeError(atitle(title) + "expected integer >= 0, got " + n);
64
+ return n;
65
+ }
66
+ /**
67
+ * Asserts something is Uint8Array.
68
+ * @param value - value to validate
69
+ * @param length - optional exact length constraint
70
+ * @param title - label included in thrown errors
71
+ * @returns The validated byte array.
72
+ * @throws On wrong argument types. {@link TypeError}
73
+ * @throws On wrong argument ranges or values. {@link RangeError}
74
+ * @example
75
+ * Validate that a value is a byte array.
76
+ * ```ts
77
+ * abytes(new Uint8Array([1, 2, 3]));
78
+ * ```
79
+ */
80
+ function abytes(value, length, title = "") {
81
+ if (isBytes(value) && (length === void 0 || value.length === length)) return value;
82
+ if (length !== void 0) anumber(length, "length");
83
+ const bytes = isBytes(value);
84
+ const ofLen = length !== void 0 ? ` of length ${length}` : "";
85
+ const got = bytes ? `length=${value.length}` : `type=${typeof value}`;
86
+ const message = atitle(title) + "expected Uint8Array" + ofLen + ", got " + got;
87
+ if (!bytes) throw new TypeError(message);
88
+ throw new RangeError(message);
89
+ }
90
+ const aobject = (value, label) => {
91
+ if (value === null || typeof value !== "object" || Array.isArray(value)) throw new TypeError((label === "object" ? "" : `"${label}" `) + "expected object, got type=" + typeof value);
92
+ };
93
+ const aopts = (value, label) => {
94
+ aobject(value, label);
95
+ const proto = Object.getPrototypeOf(value);
96
+ if (proto !== Object.prototype && proto !== null) throw new TypeError(`"${label}" expected plain object`);
97
+ if (Object.hasOwn(value, "__proto__")) throw new TypeError(`"${label}.__proto__" is not allowed`);
98
+ };
99
+ /**
100
+ * Asserts a hash instance has not been destroyed or finished.
101
+ * @param instance - hash instance to validate
102
+ * @param checkFinished - whether to reject finalized instances
103
+ * @throws If the hash instance has already been destroyed or finalized. {@link Error}
104
+ * @example
105
+ * Validate that a hash instance is still usable.
106
+ * ```ts
107
+ * import { aexists } from '@noble/hashes/utils.js';
108
+ * import { sha256 } from '@noble/hashes/sha2.js';
109
+ * const hash = sha256.create();
110
+ * aexists(hash);
111
+ * ```
112
+ */
113
+ function aexists(instance, checkFinished = true) {
114
+ if (instance.destroyed) throw new Error("hash was destroyed");
115
+ if (checkFinished && instance.finished) throw new Error("digest() was already called");
116
+ }
117
+ /**
118
+ * Asserts output is a sufficiently-sized byte array.
119
+ * @param out - destination buffer
120
+ * @param instance - hash instance providing output length
121
+ * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.
122
+ * @throws On wrong argument types. {@link TypeError}
123
+ * @throws On wrong argument ranges or values. {@link RangeError}
124
+ * @example
125
+ * Validate a caller-provided digest buffer.
126
+ * ```ts
127
+ * import { aoutput } from '@noble/hashes/utils.js';
128
+ * import { sha256 } from '@noble/hashes/sha2.js';
129
+ * const hash = sha256.create();
130
+ * aoutput(new Uint8Array(hash.outputLen), hash);
131
+ * ```
132
+ */
133
+ function aoutput(out, instance) {
134
+ abytes(out, void 0, "output");
135
+ const min = instance.outputLen;
136
+ if (!(out.length >= min)) throw new RangeError("\"output\" expected length >= " + min);
137
+ }
138
+ /**
139
+ * Zeroizes typed arrays in place. Warning: JS provides no guarantees.
140
+ * @param arrays - arrays to overwrite with zeros
141
+ * @example
142
+ * Zeroize sensitive buffers in place.
143
+ * ```ts
144
+ * clean(new Uint8Array([1, 2, 3]));
145
+ * ```
146
+ */
147
+ function clean(...arrays) {
148
+ for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
149
+ }
150
+ /**
151
+ * Creates a DataView for byte-level manipulation.
152
+ * @param arr - source typed array
153
+ * @returns DataView over the same buffer region.
154
+ * @example
155
+ * Create a DataView over an existing buffer.
156
+ * ```ts
157
+ * createView(new Uint8Array(4));
158
+ * ```
159
+ */
160
+ function createView(arr) {
161
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
162
+ }
163
+ /**
164
+ * Rotate-right operation for uint32 values.
165
+ * @param word - source word
166
+ * @param shift - shift amount in bits
167
+ * @returns Rotated word.
168
+ * @example
169
+ * Rotate a 32-bit word to the right.
170
+ * ```ts
171
+ * rotr(0x12345678, 8);
172
+ * ```
173
+ */
174
+ function rotr(word, shift) {
175
+ return word << 32 - shift | word >>> shift;
176
+ }
177
+ new Uint8Array(new Uint32Array([287454020]).buffer)[0];
178
+ typeof Uint8Array.from([]).toHex === "function" && Uint8Array.fromHex;
179
+ /**
180
+ * Merges default options and passed options.
181
+ * @param defaults - base option object
182
+ * @param opts - user overrides
183
+ * @param title - label included in thrown override errors
184
+ * @returns Fresh merged option object with a null prototype.
185
+ * @throws On wrong argument types. {@link TypeError}
186
+ * @example
187
+ * Merge user overrides onto default options.
188
+ * ```ts
189
+ * checkOpts({ dkLen: 32 }, { asyncTick: 10 });
190
+ * ```
191
+ */
192
+ function checkOpts(defaults, opts, title = "opts") {
193
+ aopts(defaults, "defaults");
194
+ if (opts !== void 0) aopts(opts, title);
195
+ return Object.assign(Object.create(null), defaults, opts);
196
+ }
197
+ /**
198
+ * Creates a callable hash function from a stateful class constructor.
199
+ * @param hashCons - hash constructor or factory
200
+ * @param info - optional metadata such as DER OID
201
+ * @returns Frozen callable hash wrapper with `.create()`.
202
+ * Wrapper construction eagerly calls `hashCons(undefined)` once to read
203
+ * `outputLen` / `blockLen`, so constructor side effects happen at module
204
+ * init time.
205
+ * @throws On wrong argument types. {@link TypeError}
206
+ * @example
207
+ * Wrap a stateful hash constructor into a callable helper.
208
+ * ```ts
209
+ * import { createHasher } from '@noble/hashes/utils.js';
210
+ * import { sha256 } from '@noble/hashes/sha2.js';
211
+ * const wrapped = createHasher(sha256.create, { oid: sha256.oid });
212
+ * wrapped(new Uint8Array([1]));
213
+ * ```
214
+ */
215
+ function createHasher(hashCons, info = {}) {
216
+ if (typeof hashCons !== "function") throw new TypeError("\"hashCons\" expected function, got type=" + typeof hashCons);
217
+ info = checkOpts({}, info, "info");
218
+ const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
219
+ const tmp = hashCons(void 0);
220
+ hashC.outputLen = tmp.outputLen;
221
+ hashC.blockLen = tmp.blockLen;
222
+ hashC.canXOF = tmp.canXOF;
223
+ hashC.create = (opts) => hashCons(opts);
224
+ Object.assign(hashC, info);
225
+ return Object.freeze(hashC);
226
+ }
227
+ /**
228
+ * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.
229
+ * @param suffix - final OID byte for the selected hash.
230
+ * The helper accepts any byte even though only the documented NIST hash
231
+ * suffixes are meaningful downstream.
232
+ * @returns Object containing the DER-encoded OID.
233
+ * @example
234
+ * Build OID metadata for a NIST hash.
235
+ * ```ts
236
+ * oidNist(0x01);
237
+ * ```
238
+ */
239
+ const oidNist = (suffix) => ({ oid: Uint8Array.from([
240
+ 6,
241
+ 9,
242
+ 96,
243
+ 134,
244
+ 72,
245
+ 1,
246
+ 101,
247
+ 3,
248
+ 4,
249
+ 2,
250
+ suffix
251
+ ]) });
252
+ //#endregion
253
+ //#region ../../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_md.js
254
+ /**
255
+ * Internal Merkle-Damgard hash utils.
256
+ * @module
257
+ */
258
+ /**
259
+ * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.
260
+ * Returns bits from `b` when `a` is set, otherwise from `c`.
261
+ * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never
262
+ * set the same bit.
263
+ * @param a - selector word
264
+ * @param b - word chosen when selector bit is set
265
+ * @param c - word chosen when selector bit is clear
266
+ * @returns Mixed 32-bit word.
267
+ * @example
268
+ * Combine three words with the shared 32-bit choice primitive.
269
+ * ```ts
270
+ * Chi(0xffffffff, 0x12345678, 0x87654321);
271
+ * ```
272
+ */
273
+ function Chi(a, b, c) {
274
+ return a & b ^ ~a & c;
275
+ }
276
+ /**
277
+ * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.
278
+ * Returns bits shared by at least two inputs.
279
+ * @param a - first input word
280
+ * @param b - second input word
281
+ * @param c - third input word
282
+ * @returns Mixed 32-bit word.
283
+ * @example
284
+ * Combine three words with the shared 32-bit majority primitive.
285
+ * ```ts
286
+ * Maj(0xffffffff, 0x12345678, 0x87654321);
287
+ * ```
288
+ */
289
+ function Maj(a, b, c) {
290
+ return a & b ^ a & c ^ b & c;
291
+ }
292
+ /**
293
+ * Merkle-Damgard hash construction base class.
294
+ * Could be used to create MD5, RIPEMD, SHA1, SHA2.
295
+ * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit
296
+ * strings with partial-byte tails.
297
+ * @param blockLen - internal block size in bytes
298
+ * @param outputLen - digest size in bytes
299
+ * @param padOffset - trailing length field size in bytes
300
+ * @param isLE - whether length and state words are encoded in little-endian
301
+ * @example
302
+ * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.
303
+ * ```ts
304
+ * import { _SHA1 } from '@noble/hashes/legacy.js';
305
+ * const hash = new _SHA1();
306
+ * hash.update(new Uint8Array([97, 98, 99]));
307
+ * hash.digest();
308
+ * ```
309
+ */
310
+ var HashMD = class {
311
+ blockLen;
312
+ outputLen;
313
+ canXOF = false;
314
+ padOffset;
315
+ isLE;
316
+ buffer;
317
+ view;
318
+ finished = false;
319
+ length = 0;
320
+ pos = 0;
321
+ destroyed = false;
322
+ constructor(blockLen, outputLen, padOffset, isLE) {
323
+ this.blockLen = blockLen;
324
+ this.outputLen = outputLen;
325
+ this.padOffset = padOffset;
326
+ this.isLE = isLE;
327
+ this.buffer = new Uint8Array(blockLen);
328
+ this.view = createView(this.buffer);
329
+ }
330
+ update(data) {
331
+ aexists(this);
332
+ abytes(data);
333
+ const { view, buffer, blockLen } = this;
334
+ const len = data.length;
335
+ let processed = false;
336
+ for (let pos = 0; pos < len;) {
337
+ const take = Math.min(blockLen - this.pos, len - pos);
338
+ if (take === blockLen) {
339
+ const dataView = createView(data);
340
+ for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
341
+ processed = true;
342
+ continue;
343
+ }
344
+ buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
345
+ this.pos += take;
346
+ pos += take;
347
+ if (this.pos === blockLen) {
348
+ this.process(view, 0);
349
+ this.pos = 0;
350
+ processed = true;
351
+ }
352
+ }
353
+ this.length += data.length;
354
+ if (processed) this.roundClean();
355
+ return this;
356
+ }
357
+ digestInto(out) {
358
+ aexists(this);
359
+ aoutput(out, this);
360
+ this.finished = true;
361
+ const { buffer, view, blockLen, isLE } = this;
362
+ let { pos } = this;
363
+ buffer[pos++] = 128;
364
+ buffer.fill(0, pos);
365
+ if (this.padOffset > blockLen - pos) {
366
+ this.process(view, 0);
367
+ buffer.fill(0);
368
+ }
369
+ setU64FromNum(view, blockLen - 8, this.length * 8, isLE);
370
+ this.process(view, 0);
371
+ this.roundClean();
372
+ const oview = out === buffer ? view : createView(out);
373
+ const len = this.outputLen;
374
+ const outLen = len / 4;
375
+ const state = this.get();
376
+ if (len % 4 || outLen > state.length) throw new Error("invalid outputLen");
377
+ for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
378
+ }
379
+ digest() {
380
+ const { buffer, outputLen } = this;
381
+ this.digestInto(buffer);
382
+ const res = buffer.slice(0, outputLen);
383
+ this.destroy();
384
+ return res;
385
+ }
386
+ _cloneIntoMeta(to) {
387
+ const { buffer, length, finished, destroyed, pos } = this;
388
+ to.destroyed = destroyed;
389
+ to.finished = finished;
390
+ to.length = length;
391
+ to.pos = pos;
392
+ if (pos) to.buffer.set(buffer);
393
+ return to;
394
+ }
395
+ clone() {
396
+ return this._cloneInto();
397
+ }
398
+ };
399
+ /**
400
+ * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
401
+ * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
402
+ */
403
+ /** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the
404
+ * square roots of the first eight prime numbers. Exported as a shared table; callers must treat
405
+ * it as read-only because constructors copy words from it by index. */
406
+ const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
407
+ 1779033703,
408
+ 3144134277,
409
+ 1013904242,
410
+ 2773480762,
411
+ 1359893119,
412
+ 2600822924,
413
+ 528734635,
414
+ 1541459225
415
+ ]);
416
+ //#endregion
417
+ //#region ../../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/sha2.js
418
+ /**
419
+ * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
420
+ * SHA256 is the fastest hash implementable in JS, even faster than Blake3.
421
+ * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and
422
+ * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.
423
+ * @module
424
+ */
425
+ /**
426
+ * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits
427
+ * of the cube roots of the first 64 primes (2..311).
428
+ */
429
+ const SHA256_K = /* @__PURE__ */ Uint32Array.from([
430
+ 1116352408,
431
+ 1899447441,
432
+ 3049323471,
433
+ 3921009573,
434
+ 961987163,
435
+ 1508970993,
436
+ 2453635748,
437
+ 2870763221,
438
+ 3624381080,
439
+ 310598401,
440
+ 607225278,
441
+ 1426881987,
442
+ 1925078388,
443
+ 2162078206,
444
+ 2614888103,
445
+ 3248222580,
446
+ 3835390401,
447
+ 4022224774,
448
+ 264347078,
449
+ 604807628,
450
+ 770255983,
451
+ 1249150122,
452
+ 1555081692,
453
+ 1996064986,
454
+ 2554220882,
455
+ 2821834349,
456
+ 2952996808,
457
+ 3210313671,
458
+ 3336571891,
459
+ 3584528711,
460
+ 113926993,
461
+ 338241895,
462
+ 666307205,
463
+ 773529912,
464
+ 1294757372,
465
+ 1396182291,
466
+ 1695183700,
467
+ 1986661051,
468
+ 2177026350,
469
+ 2456956037,
470
+ 2730485921,
471
+ 2820302411,
472
+ 3259730800,
473
+ 3345764771,
474
+ 3516065817,
475
+ 3600352804,
476
+ 4094571909,
477
+ 275423344,
478
+ 430227734,
479
+ 506948616,
480
+ 659060556,
481
+ 883997877,
482
+ 958139571,
483
+ 1322822218,
484
+ 1537002063,
485
+ 1747873779,
486
+ 1955562222,
487
+ 2024104815,
488
+ 2227730452,
489
+ 2361852424,
490
+ 2428436474,
491
+ 2756734187,
492
+ 3204031479,
493
+ 3329325298
494
+ ]);
495
+ /** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */
496
+ const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
497
+ /** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */
498
+ var SHA2_32B = class extends HashMD {
499
+ A = 0;
500
+ B = 0;
501
+ C = 0;
502
+ D = 0;
503
+ E = 0;
504
+ F = 0;
505
+ G = 0;
506
+ H = 0;
507
+ constructor(outputLen, IV) {
508
+ super(64, outputLen, 8, false);
509
+ this.A = IV[0] | 0;
510
+ this.B = IV[1] | 0;
511
+ this.C = IV[2] | 0;
512
+ this.D = IV[3] | 0;
513
+ this.E = IV[4] | 0;
514
+ this.F = IV[5] | 0;
515
+ this.G = IV[6] | 0;
516
+ this.H = IV[7] | 0;
517
+ }
518
+ get() {
519
+ const { A, B, C, D, E, F, G, H } = this;
520
+ return [
521
+ A,
522
+ B,
523
+ C,
524
+ D,
525
+ E,
526
+ F,
527
+ G,
528
+ H
529
+ ];
530
+ }
531
+ set(A, B, C, D, E, F, G, H) {
532
+ this.A = A | 0;
533
+ this.B = B | 0;
534
+ this.C = C | 0;
535
+ this.D = D | 0;
536
+ this.E = E | 0;
537
+ this.F = F | 0;
538
+ this.G = G | 0;
539
+ this.H = H | 0;
540
+ }
541
+ _cloneInto(to) {
542
+ (to ||= new this.constructor()).set(...this.get());
543
+ return this._cloneIntoMeta(to);
544
+ }
545
+ process(view, offset) {
546
+ for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
547
+ for (let i = 16; i < 64; i++) {
548
+ const W15 = SHA256_W[i - 15];
549
+ const W2 = SHA256_W[i - 2];
550
+ const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
551
+ SHA256_W[i] = (rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10) + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
552
+ }
553
+ let { A, B, C, D, E, F, G, H } = this;
554
+ for (let i = 0; i < 64; i++) {
555
+ const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
556
+ const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
557
+ const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
558
+ H = G;
559
+ G = F;
560
+ F = E;
561
+ E = D + T1 | 0;
562
+ D = C;
563
+ C = B;
564
+ B = A;
565
+ A = T1 + T2 | 0;
566
+ }
567
+ A = A + this.A | 0;
568
+ B = B + this.B | 0;
569
+ C = C + this.C | 0;
570
+ D = D + this.D | 0;
571
+ E = E + this.E | 0;
572
+ F = F + this.F | 0;
573
+ G = G + this.G | 0;
574
+ H = H + this.H | 0;
575
+ this.set(A, B, C, D, E, F, G, H);
576
+ }
577
+ roundClean() {
578
+ clean(SHA256_W);
579
+ }
580
+ destroy() {
581
+ this.destroyed = true;
582
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
583
+ clean(this.buffer);
584
+ }
585
+ };
586
+ /** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */
587
+ var _SHA256 = class extends SHA2_32B {
588
+ constructor() {
589
+ super(32, SHA256_IV);
590
+ }
591
+ };
592
+ const K512 = split([
593
+ "0x428a2f98d728ae22",
594
+ "0x7137449123ef65cd",
595
+ "0xb5c0fbcfec4d3b2f",
596
+ "0xe9b5dba58189dbbc",
597
+ "0x3956c25bf348b538",
598
+ "0x59f111f1b605d019",
599
+ "0x923f82a4af194f9b",
600
+ "0xab1c5ed5da6d8118",
601
+ "0xd807aa98a3030242",
602
+ "0x12835b0145706fbe",
603
+ "0x243185be4ee4b28c",
604
+ "0x550c7dc3d5ffb4e2",
605
+ "0x72be5d74f27b896f",
606
+ "0x80deb1fe3b1696b1",
607
+ "0x9bdc06a725c71235",
608
+ "0xc19bf174cf692694",
609
+ "0xe49b69c19ef14ad2",
610
+ "0xefbe4786384f25e3",
611
+ "0x0fc19dc68b8cd5b5",
612
+ "0x240ca1cc77ac9c65",
613
+ "0x2de92c6f592b0275",
614
+ "0x4a7484aa6ea6e483",
615
+ "0x5cb0a9dcbd41fbd4",
616
+ "0x76f988da831153b5",
617
+ "0x983e5152ee66dfab",
618
+ "0xa831c66d2db43210",
619
+ "0xb00327c898fb213f",
620
+ "0xbf597fc7beef0ee4",
621
+ "0xc6e00bf33da88fc2",
622
+ "0xd5a79147930aa725",
623
+ "0x06ca6351e003826f",
624
+ "0x142929670a0e6e70",
625
+ "0x27b70a8546d22ffc",
626
+ "0x2e1b21385c26c926",
627
+ "0x4d2c6dfc5ac42aed",
628
+ "0x53380d139d95b3df",
629
+ "0x650a73548baf63de",
630
+ "0x766a0abb3c77b2a8",
631
+ "0x81c2c92e47edaee6",
632
+ "0x92722c851482353b",
633
+ "0xa2bfe8a14cf10364",
634
+ "0xa81a664bbc423001",
635
+ "0xc24b8b70d0f89791",
636
+ "0xc76c51a30654be30",
637
+ "0xd192e819d6ef5218",
638
+ "0xd69906245565a910",
639
+ "0xf40e35855771202a",
640
+ "0x106aa07032bbd1b8",
641
+ "0x19a4c116b8d2d0c8",
642
+ "0x1e376c085141ab53",
643
+ "0x2748774cdf8eeb99",
644
+ "0x34b0bcb5e19b48a8",
645
+ "0x391c0cb3c5c95a63",
646
+ "0x4ed8aa4ae3418acb",
647
+ "0x5b9cca4f7763e373",
648
+ "0x682e6ff3d6b2b8a3",
649
+ "0x748f82ee5defb2fc",
650
+ "0x78a5636f43172f60",
651
+ "0x84c87814a1f0ab72",
652
+ "0x8cc702081a6439ec",
653
+ "0x90befffa23631e28",
654
+ "0xa4506cebde82bde9",
655
+ "0xbef9a3f7b2c67915",
656
+ "0xc67178f2e372532b",
657
+ "0xca273eceea26619c",
658
+ "0xd186b8c721c0c207",
659
+ "0xeada7dd6cde0eb1e",
660
+ "0xf57d4f7fee6ed178",
661
+ "0x06f067aa72176fba",
662
+ "0x0a637dc5a2c898a6",
663
+ "0x113f9804bef90dae",
664
+ "0x1b710b35131c471b",
665
+ "0x28db77f523047d84",
666
+ "0x32caab7b40c72493",
667
+ "0x3c9ebe0a15c9bebc",
668
+ "0x431d67c49c100d4c",
669
+ "0x4cc5d4becb3e42b6",
670
+ "0x597f299cfc657e2a",
671
+ "0x5fcb6fab3ad6faec",
672
+ "0x6c44198c4a475817"
673
+ ].map((n) => BigInt(n)));
674
+ K512[0];
675
+ K512[1];
676
+ /**
677
+ * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:
678
+ *
679
+ * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.
680
+ * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
681
+ * - Each sha256 hash is executing 2^18 bit operations.
682
+ * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.
683
+ * @param msg - message bytes to hash
684
+ * @param opts - Reserved hash options.
685
+ * @returns Digest bytes.
686
+ * @example
687
+ * Hash a message with SHA2-256.
688
+ * ```ts
689
+ * sha256(new Uint8Array([97, 98, 99]));
690
+ * ```
691
+ */
692
+ const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), /* @__PURE__ */ oidNist(1));
693
+ //#endregion
694
+ export { sha256 as t };
@@ -1,2 +1,2 @@
1
- import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, 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 TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-nXob5TkM.js";
1
+ import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, 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 TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-DdcCRDq8.js";
2
2
  export { AgentSandboxBlueprintAbi, 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, TangleSandboxClient, TangleSandboxClientConfig, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -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 TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-DdzOPPJ9.js";
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 TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-q-3ualoW.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };