@nekzus/liop 2.4.0-alpha.24 → 2.4.0-alpha.26

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 (109) hide show
  1. package/README.md +21 -10
  2. package/dist/bin/agent.js +27 -932
  3. package/dist/bridge.d.ts +3 -3
  4. package/dist/bridge.js +1 -5
  5. package/dist/chunk-2XHSALII.js +3 -0
  6. package/dist/chunk-2ZYX736J.js +2 -0
  7. package/dist/chunk-3WRKTVOF.js +2 -0
  8. package/dist/chunk-6KFKO6ZX.js +2 -0
  9. package/dist/chunk-6VK2XALI.js +2 -0
  10. package/dist/chunk-AYDF3IFZ.js +2 -0
  11. package/dist/chunk-CTTTLCGL.js +31 -0
  12. package/dist/chunk-ECRS6N33.js +4 -0
  13. package/dist/chunk-FDJMH4CB.js +2 -0
  14. package/dist/chunk-FTF6AMF6.js +0 -1
  15. package/dist/chunk-GWVSCZUS.js +2 -0
  16. package/dist/chunk-LEXMMIQI.js +15 -0
  17. package/dist/chunk-LM26HOJ6.js +31 -0
  18. package/dist/chunk-MQ5SU26J.js +2 -0
  19. package/dist/chunk-N35BC62H.js +2 -0
  20. package/dist/chunk-P6IJ3VBD.js +3 -0
  21. package/dist/chunk-TKLRW52V.js +2 -0
  22. package/dist/chunk-V35CXJQN.js +2 -0
  23. package/dist/chunk-WP5ER7RH.js +3 -0
  24. package/dist/chunk-XLVEDKM6.js +2 -0
  25. package/dist/chunk-Y675R34Z.js +2 -0
  26. package/dist/chunk-YD2AF2M6.js +46 -0
  27. package/dist/chunk-YLCNV764.js +3 -0
  28. package/dist/chunk-ZZMSFCJP.js +3 -0
  29. package/dist/client.d.ts +4 -4
  30. package/dist/client.js +1 -12
  31. package/dist/gateway.d.ts +5 -5
  32. package/dist/gateway.js +1 -12
  33. package/dist/{hybrid-Cb95yJFg.d.ts → hybrid-BZpCiUaV.d.ts} +3 -3
  34. package/dist/{index-DtovobWb.d.ts → index-BYDtRGue.d.ts} +3 -3
  35. package/dist/{index-D2P6Z_hP.d.ts → index-ByzjpRCk.d.ts} +6 -1
  36. package/dist/index.d.ts +15 -10
  37. package/dist/index.js +4 -319
  38. package/dist/kyber-PULV7PQX.js +2 -0
  39. package/dist/mesh.js +1 -5
  40. package/dist/server.d.ts +3 -3
  41. package/dist/server.js +1 -9
  42. package/dist/{types-rxL19f0l.d.ts → types-29zv9X1V.d.ts} +1 -1
  43. package/dist/types.d.ts +2 -2
  44. package/dist/types.js +1 -3
  45. package/dist/{verifier-EgKmGrh7.d.ts → verifier-DqZ9MQ9l.d.ts} +34 -5
  46. package/dist/verifier-J4NQYZX5.js +2 -0
  47. package/dist/workers/logic-execution.d.ts +2 -1
  48. package/dist/workers/logic-execution.js +1 -326
  49. package/dist/workers/zk-verifier.d.ts +1 -1
  50. package/dist/workers/zk-verifier.js +1 -245
  51. package/dist/{zk-CYImPsa6.d.ts → zk-DzYNWBgo.d.ts} +14 -1
  52. package/package.json +6 -2
  53. package/dist/bin/agent.js.map +0 -1
  54. package/dist/bridge.js.map +0 -1
  55. package/dist/chunk-2VQS2XRH.js +0 -564
  56. package/dist/chunk-2VQS2XRH.js.map +0 -1
  57. package/dist/chunk-3QH44NKZ.js +0 -115
  58. package/dist/chunk-3QH44NKZ.js.map +0 -1
  59. package/dist/chunk-53QKIQNF.js +0 -818
  60. package/dist/chunk-53QKIQNF.js.map +0 -1
  61. package/dist/chunk-7BSCUYUE.js +0 -421
  62. package/dist/chunk-7BSCUYUE.js.map +0 -1
  63. package/dist/chunk-7PITYWOV.js +0 -68
  64. package/dist/chunk-7PITYWOV.js.map +0 -1
  65. package/dist/chunk-FTF6AMF6.js.map +0 -1
  66. package/dist/chunk-GFGSHQN5.js +0 -206884
  67. package/dist/chunk-GFGSHQN5.js.map +0 -1
  68. package/dist/chunk-IDTXJQBH.js +0 -1506
  69. package/dist/chunk-IDTXJQBH.js.map +0 -1
  70. package/dist/chunk-IHKKWXHJ.js +0 -876
  71. package/dist/chunk-IHKKWXHJ.js.map +0 -1
  72. package/dist/chunk-IK7CGWAZ.js +0 -24
  73. package/dist/chunk-IK7CGWAZ.js.map +0 -1
  74. package/dist/chunk-JWFLXXZS.js +0 -3743
  75. package/dist/chunk-JWFLXXZS.js.map +0 -1
  76. package/dist/chunk-K3DGJLUY.js +0 -106
  77. package/dist/chunk-K3DGJLUY.js.map +0 -1
  78. package/dist/chunk-KR5UZUEY.js +0 -98
  79. package/dist/chunk-KR5UZUEY.js.map +0 -1
  80. package/dist/chunk-OHMZZMMC.js +0 -58
  81. package/dist/chunk-OHMZZMMC.js.map +0 -1
  82. package/dist/chunk-P34HDRN5.js +0 -213
  83. package/dist/chunk-P34HDRN5.js.map +0 -1
  84. package/dist/chunk-Q3FKHJ3B.js +0 -345
  85. package/dist/chunk-Q3FKHJ3B.js.map +0 -1
  86. package/dist/chunk-V47P2AQR.js +0 -281
  87. package/dist/chunk-V47P2AQR.js.map +0 -1
  88. package/dist/chunk-WPTOJYN5.js +0 -181
  89. package/dist/chunk-WPTOJYN5.js.map +0 -1
  90. package/dist/chunk-Y62GORQF.js +0 -51
  91. package/dist/chunk-Y62GORQF.js.map +0 -1
  92. package/dist/chunk-ZJGVKM7G.js +0 -803
  93. package/dist/chunk-ZJGVKM7G.js.map +0 -1
  94. package/dist/chunk-ZP3VVXOI.js +0 -66
  95. package/dist/chunk-ZP3VVXOI.js.map +0 -1
  96. package/dist/chunk-ZRWNMP5L.js +0 -165
  97. package/dist/chunk-ZRWNMP5L.js.map +0 -1
  98. package/dist/client.js.map +0 -1
  99. package/dist/gateway.js.map +0 -1
  100. package/dist/index.js.map +0 -1
  101. package/dist/kyber-CGOA7Q6A.js +0 -3
  102. package/dist/kyber-CGOA7Q6A.js.map +0 -1
  103. package/dist/mesh.js.map +0 -1
  104. package/dist/server.js.map +0 -1
  105. package/dist/types.js.map +0 -1
  106. package/dist/verifier-UBJTZQSA.js +0 -6
  107. package/dist/verifier-UBJTZQSA.js.map +0 -1
  108. package/dist/workers/logic-execution.js.map +0 -1
  109. package/dist/workers/zk-verifier.js.map +0 -1
@@ -1,327 +1,2 @@
1
- import { ASTGuardian, WasiSandbox } from '../chunk-7BSCUYUE.js';
2
- import { sanitizeOutput } from '../chunk-Y62GORQF.js';
3
- import { normalizeLogicSource, deriveLogicImageDigest } from '../chunk-IK7CGWAZ.js';
4
- import { encodeJournalV2, receiptCodec } from '../chunk-P34HDRN5.js';
5
- import { Buffer } from 'buffer';
6
- import crypto2 from 'crypto';
7
- import { createMlKem768 } from 'mlkem';
8
-
9
- var DEFAULT_DP_CONFIG = {
10
- epsilon: 1,
11
- sensitivity: 1,
12
- smallDatasetThreshold: 50
13
- };
14
- var EPSILON_FLOOR = 1;
15
- var EPSILON_FLOOR_THRESHOLD = 10;
16
- function laplaceSample(scale, prngState) {
17
- let u;
18
- do {
19
- if (prngState) {
20
- const hash = crypto2.createHash("sha256").update(`${prngState.seed}:${prngState.counter++}`).digest();
21
- u = hash.readUInt32BE(0) / 4294967296 - 0.5;
22
- } else {
23
- const buf = crypto2.randomBytes(4);
24
- const rawVal = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
25
- const cleanVal = Number.parseInt(rawVal.toString(10), 10);
26
- u = cleanVal / 4294967296;
27
- }
28
- } while (u === 0 || u === -0.5);
29
- return -scale * Math.sign(u) * Math.log(1 - 2 * Math.abs(u));
30
- }
31
- function addLaplaceNoise(value, config = {}, prngState) {
32
- const merged = { ...DEFAULT_DP_CONFIG, ...config };
33
- const scale = merged.sensitivity / merged.epsilon;
34
- const noisyValue = value + laplaceSample(scale, prngState);
35
- return Math.round(noisyValue * 1e4) / 1e4;
36
- }
37
- function deriveFieldSensitivity(key, globalSensitivity, recordCount) {
38
- if (!key) return globalSensitivity;
39
- const lk = key.toLowerCase();
40
- const isCountWord = /count|length|size|num|gainer|loser|positive|negative|nan_|null_|empty_|finite_|non_finite_|instruments|tickers|users|records/i.test(
41
- lk
42
- );
43
- const isTotalCount = lk === "total" || lk === "n" || lk === "total_records" || lk.startsWith("total_") || // Catch total_tickers, total_users
44
- lk.startsWith("num_") || // Catch num_records, num_ticks
45
- /total.*(count|items|entries|rows|records|tickers)/i.test(lk);
46
- if (isCountWord || isTotalCount) return 1;
47
- if (/avg|mean|average|var|variance|std|stddev|ratio|bps|drift|pct|percent|imbalance/i.test(
48
- lk
49
- ) && recordCount > 0) {
50
- return globalSensitivity / recordCount;
51
- }
52
- return globalSensitivity;
53
- }
54
- function applyDpToOutput(output, config = {}, recordCount) {
55
- const merged = { ...DEFAULT_DP_CONFIG, ...config };
56
- if (recordCount >= merged.smallDatasetThreshold) {
57
- return output;
58
- }
59
- if (recordCount < EPSILON_FLOOR_THRESHOLD && merged.epsilon < EPSILON_FLOOR) {
60
- merged.epsilon = EPSILON_FLOOR;
61
- }
62
- let prngState;
63
- if (merged.seed) {
64
- prngState = { seed: merged.seed, counter: 0 };
65
- }
66
- return walkAndNoise(output, merged, recordCount, void 0, prngState);
67
- }
68
- function walkAndNoise(node, config, recordCount, currentKey, prngState) {
69
- if (typeof node === "number" && Number.isFinite(node)) {
70
- const fieldSensitivity = deriveFieldSensitivity(
71
- currentKey,
72
- config.sensitivity,
73
- recordCount
74
- );
75
- let noisyValue = addLaplaceNoise(
76
- node,
77
- {
78
- ...config,
79
- sensitivity: fieldSensitivity
80
- },
81
- prngState
82
- );
83
- const isCountKey = currentKey != null && deriveFieldSensitivity(currentKey, config.sensitivity, recordCount) === 1;
84
- if (Number.isInteger(node) || isCountKey) {
85
- noisyValue = Math.round(noisyValue);
86
- }
87
- if (node >= 0) {
88
- noisyValue = Math.max(0, noisyValue);
89
- }
90
- return noisyValue;
91
- }
92
- if (Array.isArray(node)) {
93
- return node.map(
94
- (item) => walkAndNoise(item, config, recordCount, currentKey, prngState)
95
- );
96
- }
97
- if (node !== null && typeof node === "object") {
98
- const result = {};
99
- for (const [key, value] of Object.entries(
100
- node
101
- )) {
102
- result[key] = walkAndNoise(value, config, recordCount, key, prngState);
103
- }
104
- return result;
105
- }
106
- return node;
107
- }
108
-
109
- // src/workers/logic-execution.ts
110
- async function processLogicExecution(data) {
111
- if (typeof Object.prototype === "object" && !Object.isFrozen(Object.prototype)) {
112
- Object.freeze(Object.prototype);
113
- Object.freeze(Array.prototype);
114
- Object.freeze(String.prototype);
115
- Object.freeze(Number.prototype);
116
- Object.freeze(Boolean.prototype);
117
- Object.freeze(RegExp.prototype);
118
- Object.freeze(Map.prototype);
119
- Object.freeze(Set.prototype);
120
- Object.freeze(Promise.prototype);
121
- Object.freeze(Error.prototype);
122
- }
123
- if (data.isWarmup) {
124
- return {
125
- image_id: "",
126
- output: "warm",
127
- fuel_consumed: 0
128
- };
129
- }
130
- if (data.sessionTimestamp !== void 0) {
131
- const MAX_SESSION_KEY_LIFETIME_MS = 3600 * 1e3;
132
- const age = Date.now() - data.sessionTimestamp;
133
- if (age > MAX_SESSION_KEY_LIFETIME_MS) {
134
- throw new Error(
135
- `[LIOP-PQC] Session secret expired: Age (${Math.round(age / 1e3)}s) exceeds 3600s TTL limit.`
136
- );
137
- }
138
- if (data.sessionTimestamp > Date.now() + 6e4) {
139
- throw new Error(
140
- "[LIOP-PQC] Session secret invalid: Timestamp is in the future."
141
- );
142
- }
143
- }
144
- const {
145
- ciphertext,
146
- secretKeyObj,
147
- wasmBinary,
148
- inputs,
149
- aesNonce,
150
- records,
151
- isEncrypted = true,
152
- dpConfig
153
- } = data;
154
- let decryptedPayload;
155
- const decryptedInputs = {};
156
- let sessionSecret = Buffer.alloc(32);
157
- if (isEncrypted) {
158
- const sk = new Uint8Array(secretKeyObj);
159
- const ct = new Uint8Array(ciphertext);
160
- const kem = await createMlKem768();
161
- const sharedSecret = kem.decap(ct, sk);
162
- const aesKey = Buffer.from(sharedSecret);
163
- sessionSecret = aesKey;
164
- const wasmBuffer = Buffer.from(wasmBinary);
165
- const authTag = wasmBuffer.subarray(-16);
166
- const encryptedData = wasmBuffer.subarray(0, -16);
167
- const decipher = crypto2.createDecipheriv(
168
- "aes-256-gcm",
169
- aesKey,
170
- Buffer.from(aesNonce || new Uint8Array(12))
171
- );
172
- decipher.setAuthTag(authTag);
173
- let decrypted = decipher.update(encryptedData);
174
- decrypted = Buffer.concat([decrypted, decipher.final()]);
175
- decryptedPayload = decrypted;
176
- for (const [key, encValue] of Object.entries(inputs || {})) {
177
- const valBuffer = Buffer.from(encValue);
178
- const inputNonce = valBuffer.subarray(0, 12);
179
- const valTag = valBuffer.subarray(-16);
180
- const valData = valBuffer.subarray(12, -16);
181
- const valDecipher = crypto2.createDecipheriv(
182
- "aes-256-gcm",
183
- aesKey,
184
- inputNonce
185
- );
186
- valDecipher.setAuthTag(valTag);
187
- let valDecrypted = valDecipher.update(valData);
188
- valDecrypted = Buffer.concat([valDecrypted, valDecipher.final()]);
189
- decryptedInputs[key] = JSON.parse(valDecrypted.toString("utf-8"));
190
- }
191
- } else {
192
- if (wasmBinary[0] === 0 && wasmBinary[1] === 97 && wasmBinary[2] === 115 && wasmBinary[3] === 109) {
193
- decryptedPayload = Buffer.from(wasmBinary);
194
- } else {
195
- decryptedPayload = Buffer.from(wasmBinary).toString("utf-8");
196
- }
197
- }
198
- const isWasm = decryptedPayload[0] === 0 && decryptedPayload[1] === 97 && decryptedPayload[2] === 115 && decryptedPayload[3] === 109;
199
- if (decryptedPayload instanceof Buffer && isWasm) {
200
- const wasmBytes = new Uint8Array(decryptedPayload);
201
- const compiledModule = await WebAssembly.compile(wasmBytes);
202
- ASTGuardian.analyze(compiledModule);
203
- } else if (decryptedPayload instanceof Buffer && !isWasm) {
204
- decryptedPayload = decryptedPayload.toString("utf-8");
205
- }
206
- if (typeof decryptedPayload === "string") {
207
- decryptedPayload = normalizeLogicSource(decryptedPayload);
208
- }
209
- const sandbox = new WasiSandbox();
210
- await sandbox.init();
211
- try {
212
- const result = await sandbox.execute(
213
- decryptedPayload,
214
- records,
215
- decryptedInputs
216
- );
217
- let finalOutput = result.output;
218
- let logicBytes;
219
- if (typeof decryptedPayload === "string") {
220
- logicBytes = Buffer.from(decryptedPayload, "utf-8");
221
- } else {
222
- logicBytes = new Uint8Array(decryptedPayload);
223
- }
224
- const imageId = deriveLogicImageDigest(logicBytes).toString("hex");
225
- const datasetHash = crypto2.createHash("sha256").update(JSON.stringify(records || [])).digest("hex");
226
- if (dpConfig) {
227
- finalOutput = applyDpToOutput(
228
- finalOutput,
229
- {
230
- ...dpConfig,
231
- seed: `${datasetHash}:${imageId}`
232
- },
233
- records?.length || 0
234
- );
235
- }
236
- finalOutput = sanitizeOutput(finalOutput);
237
- if (data.proofMode === 1 || data.proofMode === 2) {
238
- const guestImageIdBuf = data.guestImageId ? Buffer.from(data.guestImageId, "hex") : crypto2.createHash("sha256").update("liop-default-guest-v2").digest();
239
- const outputStr = typeof finalOutput === "string" ? finalOutput : finalOutput === void 0 ? "undefined" : JSON.stringify(finalOutput);
240
- const journalV2Buf = encodeJournalV2({
241
- guestImageId: guestImageIdBuf,
242
- logicDigest: Buffer.from(imageId, "hex"),
243
- datasetDigest: Buffer.from(datasetHash, "hex"),
244
- outputDigest: crypto2.createHash("sha256").update(outputStr).digest(),
245
- fuelConsumed: BigInt(result.fuelConsumed),
246
- executionTimestamp: BigInt(Date.now())
247
- });
248
- let proofBuf;
249
- let nativeProver = null;
250
- try {
251
- nativeProver = await import('@nekzus/liop-zk-native');
252
- } catch {
253
- nativeProver = null;
254
- }
255
- if (nativeProver && typeof nativeProver.prove_analytical_query === "function") {
256
- try {
257
- const circuit = typeof decryptedInputs?.operation === "string" ? decryptedInputs.operation : "sum";
258
- const inputsJson = JSON.stringify({
259
- records: Array.isArray(records) ? records.map(
260
- // biome-ignore lint/suspicious/noExplicitAny: record mapping
261
- (r) => Number(r.amount ?? r.value ?? 1)
262
- ) : [1],
263
- expected_sum: typeof finalOutput === "number" ? finalOutput : void 0
264
- });
265
- proofBuf = await nativeProver.prove_analytical_query(
266
- circuit,
267
- inputsJson
268
- );
269
- } catch {
270
- proofBuf = Buffer.alloc(128, 66);
271
- }
272
- } else {
273
- proofBuf = Buffer.alloc(128, 66);
274
- }
275
- const receiptBuf2 = receiptCodec.encodeV2(
276
- 2 /* GROTH16 */,
277
- journalV2Buf,
278
- proofBuf
279
- );
280
- const zkReceipt2 = receiptBuf2.toString("base64");
281
- return {
282
- image_id: imageId,
283
- zk_receipt: zkReceipt2,
284
- output: finalOutput,
285
- fuel_consumed: result.fuelConsumed,
286
- proof_type: 2 /* GROTH16 */,
287
- guest_image_id: guestImageIdBuf.toString("hex")
288
- };
289
- }
290
- const journal = Buffer.from(
291
- JSON.stringify({
292
- image_id: imageId,
293
- dataset_hash: datasetHash,
294
- output_hash: crypto2.createHash("sha256").update(
295
- typeof finalOutput === "string" ? finalOutput : finalOutput === void 0 ? "undefined" : JSON.stringify(finalOutput)
296
- ).digest("hex"),
297
- fuel: result.fuelConsumed,
298
- ts: Date.now()
299
- })
300
- );
301
- const seal = crypto2.createHmac("sha256", sessionSecret).update(journal).digest();
302
- const journalLen = Buffer.alloc(2);
303
- journalLen.writeUInt16BE(journal.length);
304
- const receiptBuf = Buffer.concat([
305
- Buffer.from([1]),
306
- // Receipt format v1
307
- journalLen,
308
- journal,
309
- seal
310
- // 32 bytes HMAC
311
- ]);
312
- const zkReceipt = receiptBuf.toString("base64");
313
- return {
314
- image_id: imageId,
315
- zk_receipt: zkReceipt,
316
- output: finalOutput,
317
- fuel_consumed: result.fuelConsumed,
318
- proof_type: 0 /* HMAC_LEGACY */
319
- };
320
- } finally {
321
- await sandbox.teardown();
322
- }
323
- }
324
-
325
- export { processLogicExecution as default };
326
- //# sourceMappingURL=logic-execution.js.map
1
+ import {a as a$1,d}from'../chunk-CTTTLCGL.js';import {a as a$3}from'../chunk-MQ5SU26J.js';import {a as a$2,b}from'../chunk-TKLRW52V.js';import {b as b$1}from'../chunk-2ZYX736J.js';import {f,h}from'../chunk-6VK2XALI.js';import {a}from'../chunk-AYDF3IFZ.js';import {Buffer}from'buffer';import m from'crypto';import {createMlKem768}from'mlkem';var Y={epsilon:1,sensitivity:1,smallDatasetThreshold:50},J=1,ee=10;function te(e,i){let o;do if(i)o=m.createHash("sha256").update(`${i.seed}:${i.counter++}`).digest().readUInt32BE(0)/4294967296-.5;else {let t=m.randomBytes(4),a=t[0]<<24|t[1]<<16|t[2]<<8|t[3];o=Number.parseInt(a.toString(10),10)/4294967296;}while(o===0||o===-0.5);return -e*Math.sign(o)*Math.log(1-2*Math.abs(o))}a(te,"laplaceSample");function re(e,i={},o){let t={...Y,...i},a=t.sensitivity/t.epsilon,c=e+te(a,o);return Math.round(c*1e4)/1e4}a(re,"addLaplaceNoise");function $(e,i,o){if(!e)return i;let t=e.toLowerCase(),a=/count|length|size|num|gainer|loser|positive|negative|nan_|null_|empty_|finite_|non_finite_|instruments|tickers|users|records/i.test(t),c=t==="total"||t==="n"||t==="total_records"||t.startsWith("total_")||t.startsWith("num_")||/total.*(count|items|entries|rows|records|tickers)/i.test(t);return a||c?1:/avg|mean|average|var|variance|std|stddev|ratio|bps|drift|pct|percent|imbalance/i.test(t)&&o>0?i/o:i}a($,"deriveFieldSensitivity");function Z(e,i={},o){let t={...Y,...i};if(o>=t.smallDatasetThreshold)return e;o<ee&&t.epsilon<J&&(t.epsilon=J);let a;return t.seed&&(a={seed:t.seed,counter:0}),R(e,t,o,void 0,a)}a(Z,"applyDpToOutput");function R(e,i,o,t,a){if(typeof e=="number"&&Number.isFinite(e)){let c=$(t,i.sensitivity,o),u=re(e,{...i,sensitivity:c},a),w=t!=null&&$(t,i.sensitivity,o)===1;return (Number.isInteger(e)||w)&&(u=Math.round(u)),e>=0&&(u=Math.max(0,u)),u}if(Array.isArray(e))return e.map(c=>R(c,i,o,t,a));if(e!==null&&typeof e=="object"){let c={};for(let[u,w]of Object.entries(e))c[u]=R(w,i,o,u,a);return c}return e}a(R,"walkAndNoise");async function oe(e){if(typeof Object.prototype=="object"&&!Object.isFrozen(Object.prototype)&&(Object.freeze(Object.prototype),Object.freeze(Array.prototype),Object.freeze(String.prototype),Object.freeze(Number.prototype),Object.freeze(Boolean.prototype),Object.freeze(RegExp.prototype),Object.freeze(Map.prototype),Object.freeze(Set.prototype),Object.freeze(Promise.prototype),Object.freeze(Error.prototype)),e.isWarmup)return {image_id:"",output:"warm",fuel_consumed:0};if(e.sessionTimestamp!==void 0){let n=Date.now()-e.sessionTimestamp;if(n>36e5)throw new Error(`[LIOP-PQC] Session secret expired: Age (${Math.round(n/1e3)}s) exceeds 3600s TTL limit.`);if(e.sessionTimestamp>Date.now()+6e4)throw new Error("[LIOP-PQC] Session secret invalid: Timestamp is in the future.")}let{ciphertext:i,secretKeyObj:o,wasmBinary:t,inputs:a,aesNonce:c,records:u,isEncrypted:w=true,dpConfig:z}=e,s,D={},C=Buffer.alloc(32);if(w){let p=new Uint8Array(o),n=new Uint8Array(i),g=(await createMlKem768()).decap(n,p),d=Buffer.from(g);C=d;let _=Buffer.from(t),k=_.subarray(-16),T=_.subarray(0,-16),A=m.createDecipheriv("aes-256-gcm",d,Buffer.from(c||new Uint8Array(12)));A.setAuthTag(k);let S=A.update(T);S=Buffer.concat([S,A.final()]),s=S;for(let[E,B]of Object.entries(a||{})){let y=Buffer.from(B),f=y.subarray(0,12),h=y.subarray(-16),x=y.subarray(12,-16),O=m.createDecipheriv("aes-256-gcm",d,f);O.setAuthTag(h);let v=O.update(x);v=Buffer.concat([v,O.final()]),D[E]=JSON.parse(v.toString("utf-8"));}}else t[0]===0&&t[1]===97&&t[2]===115&&t[3]===109?s=Buffer.from(t):s=Buffer.from(t).toString("utf-8");let K=s[0]===0&&s[1]===97&&s[2]===115&&s[3]===109;if(s instanceof Buffer&&K){let p=new Uint8Array(s),n=await WebAssembly.compile(p);a$1.analyze(n);}else s instanceof Buffer&&!K&&(s=s.toString("utf-8"));typeof s=="string"&&(s=a$2(s));let N=new d;await N.init();try{let p=await N.execute(s,u,D),n=p.output,I;typeof s=="string"?I=Buffer.from(s,"utf-8"):I=new Uint8Array(s);let g=b(I).toString("hex"),d=m.createHash("sha256").update(JSON.stringify(u||[])).digest("hex");if(z&&(n=Z(n,{...z,seed:`${d}:${g}`},u?.length||0)),n=a$3(n),e.proofMode===1||e.proofMode===2){let E=e.guestImageId?Buffer.from(e.guestImageId,"hex"):m.createHash("sha256").update("liop-default-guest-v2").digest(),B=typeof n=="string"?n:n===void 0?"undefined":JSON.stringify(n),y=f({guestImageId:E,logicDigest:Buffer.from(g,"hex"),datasetDigest:Buffer.from(d,"hex"),outputDigest:m.createHash("sha256").update(B).digest(),fuelConsumed:BigInt(p.fuelConsumed),executionTimestamp:BigInt(Date.now())}),f$1,h$1=null;try{h$1=await import('@nekzus/liop-zk-native');}catch{h$1=null;}if(h$1&&typeof h$1.prove_analytical_query=="function")try{let b=typeof D?.operation=="string"?D.operation:"sum",M=JSON.stringify({records:Array.isArray(u)?u.map(P=>Number(P.amount??P.value??1)):[1],expected_sum:typeof n=="number"?n:void 0});f$1=await h$1.prove_analytical_query(b,M);}catch(b){if(e.proofMode===2)throw new Error(`ZK PROOF GENERATION FAILED: Native Groth16 prover execution error: ${b instanceof Error?b.message:String(b)}`);f$1=Buffer.alloc(128,66);}else {if(e.proofMode===2)throw new Error("ZK PROOF GENERATION FAILED: Native Groth16 prover module unavailable for required policy.");f$1=Buffer.alloc(128,66);}let x,O=2;if(e.pqcSigningKey&&e.pqcSigningKey.length>0){O=3;let b=m.createHash("sha256").update(Buffer.concat([y,f$1])).digest(),M=b$1.sign(b,e.pqcSigningKey),P=b$1.getPublicKey(e.pqcSigningKey);x=h.encodeHybridV2(y,f$1,Buffer.from(M),Buffer.from(P));}else x=h.encodeV2(2,y,f$1);let v=x.toString("base64");return {image_id:g,zk_receipt:v,output:n,fuel_consumed:p.fuelConsumed,proof_type:O,guest_image_id:E.toString("hex")}}let _=Buffer.from(JSON.stringify({image_id:g,dataset_hash:d,output_hash:m.createHash("sha256").update(typeof n=="string"?n:n===void 0?"undefined":JSON.stringify(n)).digest("hex"),fuel:p.fuelConsumed,ts:Date.now()})),k=m.createHmac("sha256",C).update(_).digest(),T=Buffer.alloc(2);T.writeUInt16BE(_.length);let S=Buffer.concat([Buffer.from([1]),T,_,k]).toString("base64");return {image_id:g,zk_receipt:S,output:n,fuel_consumed:p.fuelConsumed,proof_type:0}}finally{await N.teardown();}}a(oe,"processLogicExecution");export{oe as default};//# sourceMappingURL=logic-execution.js.map
327
2
  //# sourceMappingURL=logic-execution.js.map
@@ -1,4 +1,4 @@
1
- import { Z as ZkPolicy } from '../zk-CYImPsa6.js';
1
+ import { Z as ZkPolicy } from '../zk-DzYNWBgo.js';
2
2
 
3
3
  /**
4
4
  * ZK Verification Payload Structure.
@@ -1,246 +1,2 @@
1
- import { deserializeVKey, deserializeGrothProof, verifyGroth16Proof } from '../chunk-OHMZZMMC.js';
2
- import { deriveLogicImageDigest } from '../chunk-IK7CGWAZ.js';
3
- import { receiptCodec, RECEIPT_VERSION_V1, RECEIPT_VERSION_V2, decodeJournalV2 } from '../chunk-P34HDRN5.js';
4
- import crypto from 'crypto';
5
- import 'worker_threads';
6
-
7
- function deriveImageId(logicPayload) {
8
- return deriveLogicImageDigest(logicPayload);
9
- }
10
- function tryExtractProxyOutput(logicPayload) {
11
- try {
12
- const logicStr = Buffer.from(logicPayload).toString("utf-8").trim();
13
- if (!logicStr.includes("__liop_proxy_tool")) {
14
- return null;
15
- }
16
- const firstBraceIdx = logicStr.indexOf("{");
17
- if (firstBraceIdx === -1) {
18
- return null;
19
- }
20
- let braceCount = 0;
21
- let inDoubleQuote = false;
22
- let inSingleQuote = false;
23
- let inBacktick = false;
24
- let escaped = false;
25
- let lastBraceIdx = -1;
26
- for (let i = firstBraceIdx; i < logicStr.length; i++) {
27
- const char = logicStr[i];
28
- if (escaped) {
29
- escaped = false;
30
- continue;
31
- }
32
- if (char === "\\") {
33
- escaped = true;
34
- continue;
35
- }
36
- if (char === '"' && !inSingleQuote && !inBacktick) {
37
- inDoubleQuote = !inDoubleQuote;
38
- continue;
39
- }
40
- if (char === "'" && !inDoubleQuote && !inBacktick) {
41
- inSingleQuote = !inSingleQuote;
42
- continue;
43
- }
44
- if (char === "`" && !inDoubleQuote && !inSingleQuote) {
45
- inBacktick = !inBacktick;
46
- continue;
47
- }
48
- if (!inDoubleQuote && !inSingleQuote && !inBacktick) {
49
- if (char === "{") {
50
- braceCount++;
51
- } else if (char === "}") {
52
- braceCount--;
53
- if (braceCount === 0) {
54
- lastBraceIdx = i;
55
- break;
56
- }
57
- }
58
- }
59
- }
60
- if (lastBraceIdx !== -1) {
61
- const jsonStr = logicStr.slice(firstBraceIdx, lastBraceIdx + 1);
62
- const parsed = JSON.parse(jsonStr);
63
- if (parsed?.__liop_proxy_tool) {
64
- return parsed;
65
- }
66
- }
67
- } catch (_e) {
68
- }
69
- return null;
70
- }
71
- async function verifyZkReceipt(payload) {
72
- const {
73
- logicPayload,
74
- remoteImageIdHex,
75
- guestImageIdHex,
76
- zkReceipt,
77
- sessionSecret,
78
- vkeyRaw,
79
- expectedOutput,
80
- zkPolicy
81
- } = payload;
82
- if (!logicPayload || !remoteImageIdHex || !zkReceipt) {
83
- return {
84
- verified: false,
85
- message: "Missing required verification fields."
86
- };
87
- }
88
- let decodedReceipt;
89
- try {
90
- decodedReceipt = receiptCodec.decode(Buffer.from(zkReceipt));
91
- } catch (err) {
92
- return {
93
- verified: false,
94
- message: `Receipt Decode Failed: ${err.message}`
95
- };
96
- }
97
- if (decodedReceipt.version === RECEIPT_VERSION_V1) {
98
- if (zkPolicy === "required") {
99
- return {
100
- verified: false,
101
- message: "Policy Violation: Clearance Tier requires ZK proof (Groth16), but received legacy HMAC."
102
- };
103
- }
104
- const localImageId = deriveImageId(logicPayload);
105
- const localImageIdHex = localImageId.toString("hex");
106
- if (localImageIdHex !== remoteImageIdHex) {
107
- return {
108
- verified: false,
109
- message: `Integrity Violation: Local (${localImageIdHex.slice(0, 8)}) != Remote (${remoteImageIdHex.slice(0, 8)})`
110
- };
111
- }
112
- let journalData;
113
- try {
114
- journalData = JSON.parse(decodedReceipt.journal.toString());
115
- if (journalData.image_id !== localImageIdHex) {
116
- return {
117
- verified: false,
118
- message: `Journal ImageID mismatch: ${journalData.image_id.slice(0, 8)} != ${localImageIdHex.slice(0, 8)}`
119
- };
120
- }
121
- } catch (_e) {
122
- return { verified: false, message: "Failed to parse journal data." };
123
- }
124
- if (sessionSecret && sessionSecret.length > 0) {
125
- const expectedSeal = crypto.createHmac("sha256", sessionSecret).update(decodedReceipt.journal).digest();
126
- if (!crypto.timingSafeEqual(decodedReceipt.proof, expectedSeal)) {
127
- return {
128
- verified: false,
129
- message: "Invalid seal: HMAC verification failed."
130
- };
131
- }
132
- }
133
- if (expectedOutput !== void 0) {
134
- const proxyOutput = tryExtractProxyOutput(logicPayload);
135
- const actualExpected = proxyOutput !== null ? proxyOutput : expectedOutput;
136
- const expectedOutputStr = typeof actualExpected === "string" ? actualExpected : actualExpected === void 0 ? "undefined" : JSON.stringify(actualExpected);
137
- const expectedOutputHash = crypto.createHash("sha256").update(expectedOutputStr).digest("hex");
138
- if (journalData.output_hash !== expectedOutputHash) {
139
- return {
140
- verified: false,
141
- message: `Output Hash Mismatch (Replay/Tamper attempt): Journal output_hash (${journalData.output_hash.slice(0, 8)}) != Calculated output_hash (${expectedOutputHash.slice(0, 8)})`
142
- };
143
- }
144
- }
145
- return {
146
- verified: true,
147
- message: "HMAC Commitment Verified: Integrity intact.",
148
- proofType: "hmac"
149
- };
150
- }
151
- if (decodedReceipt.version === RECEIPT_VERSION_V2) {
152
- if (decodedReceipt.proofType !== 2 /* GROTH16 */) {
153
- return {
154
- verified: false,
155
- message: `Unsupported ZK proof type in v2 receipt: ${decodedReceipt.proofType}`
156
- };
157
- }
158
- let journalV2;
159
- try {
160
- journalV2 = decodeJournalV2(decodedReceipt.journal);
161
- } catch (err) {
162
- return {
163
- verified: false,
164
- message: `Failed to decode ZkJournalV2: ${err.message}`
165
- };
166
- }
167
- if (guestImageIdHex) {
168
- const actualGuestId = journalV2.guestImageId.toString("hex");
169
- if (actualGuestId !== guestImageIdHex) {
170
- return {
171
- verified: false,
172
- message: `Guest ImageID Mismatch: Injected guest environment tampered (${actualGuestId.slice(0, 8)} != ${guestImageIdHex.slice(0, 8)}).`
173
- };
174
- }
175
- }
176
- const expectedLogicDigest = deriveImageId(logicPayload);
177
- if (!journalV2.logicDigest.equals(expectedLogicDigest)) {
178
- return {
179
- verified: false,
180
- message: `Logic Digest Mismatch: Remote origin executed unexpected logic (${journalV2.logicDigest.toString("hex").slice(0, 8)} != ${expectedLogicDigest.toString("hex").slice(0, 8)})`
181
- };
182
- }
183
- if (vkeyRaw && vkeyRaw.length > 0) {
184
- try {
185
- const vkey = deserializeVKey(Buffer.from(vkeyRaw));
186
- const proofWithSignals = deserializeGrothProof(decodedReceipt.proof);
187
- const isMathValid = verifyGroth16Proof(vkey, proofWithSignals);
188
- if (!isMathValid) {
189
- return {
190
- verified: false,
191
- message: "Groth16 mathematical pairing verification failed: invalid proof."
192
- };
193
- }
194
- } catch (err) {
195
- return {
196
- verified: false,
197
- message: `Groth16 verification failed to execute: ${err.message}`
198
- };
199
- }
200
- }
201
- if (expectedOutput !== void 0) {
202
- const proxyOutput = tryExtractProxyOutput(logicPayload);
203
- const actualExpected = proxyOutput !== null ? proxyOutput : expectedOutput;
204
- const expectedOutputStr = typeof actualExpected === "string" ? actualExpected : actualExpected === void 0 ? "undefined" : JSON.stringify(actualExpected);
205
- const expectedOutputDigest = crypto.createHash("sha256").update(expectedOutputStr).digest();
206
- if (!journalV2.outputDigest.equals(expectedOutputDigest)) {
207
- return {
208
- verified: false,
209
- message: `Output Digest Mismatch (Replay/Tamper attempt): Journal (${journalV2.outputDigest.toString("hex").slice(0, 8)}) != Calculated (${expectedOutputDigest.toString("hex").slice(0, 8)})`
210
- };
211
- }
212
- }
213
- return {
214
- verified: true,
215
- message: "Groth16 Zero-Knowledge Proof Mathematically Certified.",
216
- proofType: "groth16"
217
- };
218
- }
219
- return {
220
- verified: false,
221
- message: `Unsupported receipt version: ${decodedReceipt.version}`
222
- };
223
- }
224
- async function workerHandler(task) {
225
- try {
226
- if (task.action === "warmup") {
227
- return {
228
- verified: true,
229
- message: "warm"
230
- };
231
- }
232
- if (task.action === "verify_receipt") {
233
- return await verifyZkReceipt(task);
234
- }
235
- throw new Error("Unknown action in ZkVerifier Worker.");
236
- } catch (error) {
237
- return {
238
- verified: false,
239
- message: `Verification Error: ${error.message}`
240
- };
241
- }
242
- }
243
-
244
- export { workerHandler as default };
245
- //# sourceMappingURL=zk-verifier.js.map
1
+ import {d,f,b as b$3}from'../chunk-FDJMH4CB.js';import {b}from'../chunk-TKLRW52V.js';import {b as b$2}from'../chunk-2ZYX736J.js';import {h,b as b$1,c,g}from'../chunk-6VK2XALI.js';import {a}from'../chunk-AYDF3IFZ.js';import v from'crypto';import'worker_threads';function D(s){return b(s)}a(D,"deriveImageId");function O(s){try{let i=Buffer.from(s).toString("utf-8").trim();if(!i.includes("__liop_proxy_tool"))return null;let d=i.indexOf("{");if(d===-1)return null;let p=0,c=!1,n=!1,o=!1,f=!1,y=-1;for(let e=d;e<i.length;e++){let t=i[e];if(f){f=!1;continue}if(t==="\\"){f=!0;continue}if(t==='"'&&!n&&!o){c=!c;continue}if(t==="'"&&!c&&!o){n=!n;continue}if(t==="`"&&!c&&!n){o=!o;continue}if(!c&&!n&&!o){if(t==="{")p++;else if(t==="}"&&(p--,p===0)){y=e;break}}}if(y!==-1){let e=i.slice(d,y+1),t=JSON.parse(e);if(t?.__liop_proxy_tool)return t}}catch{}return null}a(O,"tryExtractProxyOutput");async function T(s){let{logicPayload:i,remoteImageIdHex:d$1,guestImageIdHex:p,zkReceipt:c$1,sessionSecret:n,vkeyRaw:o,expectedOutput:f$1,zkPolicy:y}=s;if(!i||!d$1||!c$1)return {verified:false,message:"Missing required verification fields."};let e;try{e=h.decode(Buffer.from(c$1));}catch(t){return {verified:false,message:`Receipt Decode Failed: ${t.message}`}}if(e.version===b$1){if(y==="required")return {verified:false,message:"Policy Violation: Clearance Tier requires ZK proof (Groth16), but received legacy HMAC."};let g=D(i).toString("hex");if(g!==d$1)return {verified:false,message:`Integrity Violation: Local (${g.slice(0,8)}) != Remote (${d$1.slice(0,8)})`};let u;try{if(u=JSON.parse(e.journal.toString()),u.image_id!==g)return {verified:!1,message:`Journal ImageID mismatch: ${u.image_id.slice(0,8)} != ${g.slice(0,8)}`}}catch{return {verified:false,message:"Failed to parse journal data."}}if(n&&n.length>0){let r=v.createHmac("sha256",n).update(e.journal).digest();if(!v.timingSafeEqual(e.proof,r))return {verified:false,message:"Invalid seal: HMAC verification failed."}}if(f$1!==void 0){let r=O(i),a=r!==null?r:f$1,m=typeof a=="string"?a:a===void 0?"undefined":JSON.stringify(a),l=v.createHash("sha256").update(m).digest("hex");if(u.output_hash!==l)return {verified:false,message:`Output Hash Mismatch (Replay/Tamper attempt): Journal output_hash (${u.output_hash.slice(0,8)}) != Calculated output_hash (${l.slice(0,8)})`}}return {verified:true,message:"HMAC Commitment Verified: Integrity intact.",proofType:"hmac"}}if(e.version===c){if(e.proofType!==2&&e.proofType!==3)return {verified:false,message:`Unsupported ZK proof type in v2 receipt: ${e.proofType}`};if(e.proofType===3){let{pqcSignature:r,pqcPublicKey:a}=e;if(!r||!a)return {verified:false,message:"Hybrid Receipt Error: Missing ML-DSA-65 signature or public key."};let m=v.createHash("sha256").update(Buffer.concat([e.journal,e.proof])).digest();try{if(!b$2.verify(new Uint8Array(r),m,new Uint8Array(a)))return {verified:!1,message:"PQC Signature Verification Failed: ML-DSA-65 co-sign is forged or corrupted."}}catch(l){return {verified:false,message:`PQC Verification Error: ${l.message}`}}}let t;try{t=g(e.journal);}catch(r){return {verified:false,message:`Failed to decode ZkJournalV2: ${r.message}`}}if(p){let r=t.guestImageId.toString("hex");if(r!==p)return {verified:false,message:`Guest ImageID Mismatch: Injected guest environment tampered (${r.slice(0,8)} != ${p.slice(0,8)}).`}}let g$1=D(i);if(!t.logicDigest.equals(g$1))return {verified:false,message:`Logic Digest Mismatch: Remote origin executed unexpected logic (${t.logicDigest.toString("hex").slice(0,8)} != ${g$1.toString("hex").slice(0,8)})`};if(o&&o.length>0)try{let r=d(Buffer.from(o)),a=f(e.proof);if(!b$3(r,a))return {verified:!1,message:"Groth16 mathematical pairing verification failed: invalid proof."}}catch(r){return {verified:false,message:`Groth16 verification failed to execute: ${r.message}`}}if(f$1!==void 0){let r=O(i),a=r!==null?r:f$1,m=typeof a=="string"?a:a===void 0?"undefined":JSON.stringify(a),l=v.createHash("sha256").update(m).digest();if(!t.outputDigest.equals(l))return {verified:false,message:`Output Digest Mismatch (Replay/Tamper attempt): Journal (${t.outputDigest.toString("hex").slice(0,8)}) != Calculated (${l.toString("hex").slice(0,8)})`}}let u=e.proofType===3;return {verified:true,message:u?"Groth16 + ML-DSA-65 Post-Quantum Hybrid Receipt Certified.":o&&o.length>0?"Groth16 Zero-Knowledge Proof Mathematically Certified.":"Groth16 Receipt Structure and Journal Integrity Certified.",proofType:u?"groth16_pqc_hybrid":"groth16"}}return {verified:false,message:`Unsupported receipt version: ${e.version}`}}a(T,"verifyZkReceipt");async function C(s){try{if(s.action==="warmup")return {verified:!0,message:"warm"};if(s.action==="verify_receipt")return await T(s);throw new Error("Unknown action in ZkVerifier Worker.")}catch(i){return {verified:false,message:`Verification Error: ${i.message}`}}}a(C,"workerHandler");export{C as default};//# sourceMappingURL=zk-verifier.js.map
246
2
  //# sourceMappingURL=zk-verifier.js.map
@@ -1,6 +1,7 @@
1
1
  declare enum ProofType {
2
2
  HMAC_LEGACY = 0,
3
- GROTH16 = 2
3
+ GROTH16 = 2,
4
+ GROTH16_PQC_HYBRID = 3
4
5
  }
5
6
  declare const RECEIPT_VERSION_V1 = 1;
6
7
  declare const RECEIPT_VERSION_V2 = 2;
@@ -49,6 +50,8 @@ interface DecodedReceipt {
49
50
  journal: Buffer;
50
51
  proof: Buffer;
51
52
  raw: Buffer;
53
+ pqcSignature?: Buffer;
54
+ pqcPublicKey?: Buffer;
52
55
  }
53
56
  declare const receiptCodec: {
54
57
  /**
@@ -56,6 +59,16 @@ declare const receiptCodec: {
56
59
  * Layout: [0x02][proofType: 1B][journalLen: 4B UInt32BE][journal][proof][checksum: 32B]
57
60
  */
58
61
  encodeV2(proofType: ProofType, journal: Buffer, proof: Buffer): Buffer;
62
+ /**
63
+ * Encodes a version 2.1 Hybrid Binary Receipt (Groth16 + ML-DSA-65 co-sign).
64
+ * Layout:
65
+ * [0x02][0x03 ProofType.GROTH16_PQC_HYBRID][journalLen: 4B UInt32BE][journal: 144B]
66
+ * [proofLen: 2B UInt16BE][groth16 proof: ~260B]
67
+ * [sigLen: 2B UInt16BE][signature: 3309B]
68
+ * [publicKey: 1952B]
69
+ * [checksum: 32B SHA-256]
70
+ */
71
+ encodeHybridV2(journal: Buffer, proof: Buffer, pqcSignature: Buffer, pqcPublicKey: Buffer): Buffer;
59
72
  /**
60
73
  * Decodes any LIOP Binary Receipt (v1 HMAC or v2 ZK).
61
74
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nekzus/liop",
3
- "version": "2.4.0-alpha.24",
3
+ "version": "2.4.0-alpha.26",
4
4
  "description": "Official SDK for Logic-Injection-on-Origin Protocol (LIOP). Deploy Logic-on-Origin with WebAssembly at gRPC speed and bidirectional MCP compatibility.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,6 +32,7 @@
32
32
  "sideEffects": false,
33
33
  "files": [
34
34
  "dist",
35
+ "!dist/**/*.js.map",
35
36
  "README.md",
36
37
  "LICENSE",
37
38
  "NOTICE"
@@ -92,7 +93,6 @@
92
93
  "@types/node": "26.4.0",
93
94
  "@types/oidc-provider": "9.12.1",
94
95
  "@vitest/coverage-v8": "4.1.11",
95
- "gpt-tokenizer": "4.0.0",
96
96
  "tsup": "8.5.1",
97
97
  "tsx": "4.23.13",
98
98
  "typescript": "6.0.3",
@@ -121,6 +121,7 @@
121
121
  "@noble/post-quantum": "0.7.1",
122
122
  "acorn": "8.18.0",
123
123
  "acorn-walk": "8.3.5",
124
+ "gpt-tokenizer": "4.0.0",
124
125
  "hono": "4.13.8",
125
126
  "it-pipe": "3.0.1",
126
127
  "jose": "6.2.12",
@@ -226,6 +227,9 @@
226
227
  "audit:prod:run": "tsx tests/infra/production-audit/cli/audit-run.ts",
227
228
  "audit:prod:runner": "docker compose -f tests/infra/production-audit/docker-compose.production-audit.yml run --rm audit-runner",
228
229
  "audit:prod:clean": "tsx tests/infra/production-audit/cli/audit-clean.ts",
230
+ "audit:local:start": "tsx tests/infra/production-audit/cli/audit-start-local.ts",
231
+ "audit:local:run": "tsx tests/infra/production-audit/cli/audit-run.ts --local",
232
+ "audit:local:runner": "docker compose -f tests/infra/production-audit/docker-compose.production-audit.yml -f tests/infra/production-audit/docker-compose.local.yml run --rm audit-runner",
229
233
  "telemetry:stream": "tsx scripts/telemetry-stream.ts"
230
234
  }
231
235
  }