@kya-os/checkpoint-wasm-runtime 1.3.0 → 1.4.0

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 (50) hide show
  1. package/CHANGELOG.md +110 -1
  2. package/dist/adapters.d.mts +1 -1
  3. package/dist/adapters.d.ts +1 -1
  4. package/dist/engine-edge.d.mts +2 -2
  5. package/dist/engine-edge.d.ts +2 -2
  6. package/dist/engine-edge.js +3 -509
  7. package/dist/engine-edge.mjs +3 -508
  8. package/dist/engine-node.d.mts +46 -0
  9. package/dist/engine-node.d.ts +46 -0
  10. package/dist/engine-node.js +31 -0
  11. package/dist/engine-node.mjs +10 -0
  12. package/dist/engine.d.mts +25 -4
  13. package/dist/engine.d.ts +25 -4
  14. package/dist/engine.js +2 -457
  15. package/dist/engine.mjs +2 -464
  16. package/dist/index.d.mts +531 -3
  17. package/dist/index.d.ts +531 -3
  18. package/dist/index.js +2 -28
  19. package/dist/index.mjs +2 -29
  20. package/dist/node.d.mts +524 -3
  21. package/dist/node.d.ts +524 -3
  22. package/dist/node.js +2 -26
  23. package/dist/node.mjs +2 -26
  24. package/dist/orchestrator-edge.d.mts +24 -10
  25. package/dist/orchestrator-edge.d.ts +24 -10
  26. package/dist/orchestrator-edge.js +5 -510
  27. package/dist/orchestrator-edge.mjs +5 -509
  28. package/dist/orchestrator-node.d.mts +60 -52
  29. package/dist/orchestrator-node.d.ts +60 -52
  30. package/dist/orchestrator-node.js +50 -487
  31. package/dist/orchestrator-node.mjs +34 -497
  32. package/dist/orchestrator.d.mts +356 -4
  33. package/dist/orchestrator.d.ts +356 -4
  34. package/dist/orchestrator.js +37 -1001
  35. package/dist/orchestrator.mjs +37 -1005
  36. package/dist/{types-ByrdPLL2.d.ts → types-KPEcVvac.d.mts} +31 -1
  37. package/dist/{types-ByrdPLL2.d.mts → types-KPEcVvac.d.ts} +31 -1
  38. package/package.json +13 -2
  39. package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
  40. package/wasm/kya-os-engine/package.json +24 -4
  41. package/wasm/kya-os-engine-bundler/kya_os_engine.d.ts +24 -0
  42. package/wasm/kya-os-engine-bundler/kya_os_engine.js +4 -0
  43. package/wasm/kya-os-engine-bundler/kya_os_engine_bg.js +522 -0
  44. package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm +0 -0
  45. package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm.d.ts +8 -0
  46. package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
  47. package/wasm/kya-os-engine-web/package.json +25 -3
  48. package/dist/kya_os_engine_bg.wasm +0 -0
  49. package/dist/rules-detector-ZIKHN-_y.d.mts +0 -532
  50. package/dist/rules-detector-ZIKHN-_y.d.ts +0 -532
@@ -1,508 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
- };
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
-
11
- // wasm/kya-os-engine-web/kya_os_engine.js
12
- var kya_os_engine_exports = {};
13
- __export(kya_os_engine_exports, {
14
- default: () => kya_os_engine_default,
15
- initSync: () => initSync,
16
- verify: () => verify
17
- });
18
- function getUint8ArrayMemory0() {
19
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
20
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
21
- }
22
- return cachedUint8ArrayMemory0;
23
- }
24
- function decodeText(ptr, len) {
25
- numBytesDecoded += len;
26
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
27
- cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
28
- cachedTextDecoder.decode();
29
- numBytesDecoded = len;
30
- }
31
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
32
- }
33
- function getStringFromWasm0(ptr, len) {
34
- ptr = ptr >>> 0;
35
- return decodeText(ptr, len);
36
- }
37
- function addHeapObject(obj) {
38
- if (heap_next === heap.length) heap.push(heap.length + 1);
39
- const idx = heap_next;
40
- heap_next = heap[idx];
41
- heap[idx] = obj;
42
- return idx;
43
- }
44
- function getObject(idx) {
45
- return heap[idx];
46
- }
47
- function passStringToWasm0(arg, malloc, realloc) {
48
- if (realloc === void 0) {
49
- const buf = cachedTextEncoder.encode(arg);
50
- const ptr2 = malloc(buf.length, 1) >>> 0;
51
- getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
52
- WASM_VECTOR_LEN = buf.length;
53
- return ptr2;
54
- }
55
- let len = arg.length;
56
- let ptr = malloc(len, 1) >>> 0;
57
- const mem = getUint8ArrayMemory0();
58
- let offset = 0;
59
- for (; offset < len; offset++) {
60
- const code = arg.charCodeAt(offset);
61
- if (code > 127) break;
62
- mem[ptr + offset] = code;
63
- }
64
- if (offset !== len) {
65
- if (offset !== 0) {
66
- arg = arg.slice(offset);
67
- }
68
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
69
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
70
- const ret = cachedTextEncoder.encodeInto(arg, view);
71
- offset += ret.written;
72
- ptr = realloc(ptr, len, offset, 1) >>> 0;
73
- }
74
- WASM_VECTOR_LEN = offset;
75
- return ptr;
76
- }
77
- function getDataViewMemory0() {
78
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
79
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
80
- }
81
- return cachedDataViewMemory0;
82
- }
83
- function isLikeNone(x) {
84
- return x === void 0 || x === null;
85
- }
86
- function debugString(val) {
87
- const type = typeof val;
88
- if (type == "number" || type == "boolean" || val == null) {
89
- return `${val}`;
90
- }
91
- if (type == "string") {
92
- return `"${val}"`;
93
- }
94
- if (type == "symbol") {
95
- const description = val.description;
96
- if (description == null) {
97
- return "Symbol";
98
- } else {
99
- return `Symbol(${description})`;
100
- }
101
- }
102
- if (type == "function") {
103
- const name = val.name;
104
- if (typeof name == "string" && name.length > 0) {
105
- return `Function(${name})`;
106
- } else {
107
- return "Function";
108
- }
109
- }
110
- if (Array.isArray(val)) {
111
- const length = val.length;
112
- let debug = "[";
113
- if (length > 0) {
114
- debug += debugString(val[0]);
115
- }
116
- for (let i = 1; i < length; i++) {
117
- debug += ", " + debugString(val[i]);
118
- }
119
- debug += "]";
120
- return debug;
121
- }
122
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
123
- let className;
124
- if (builtInMatches && builtInMatches.length > 1) {
125
- className = builtInMatches[1];
126
- } else {
127
- return toString.call(val);
128
- }
129
- if (className == "Object") {
130
- try {
131
- return "Object(" + JSON.stringify(val) + ")";
132
- } catch (_) {
133
- return "Object";
134
- }
135
- }
136
- if (val instanceof Error) {
137
- return `${val.name}: ${val.message}
138
- ${val.stack}`;
139
- }
140
- return className;
141
- }
142
- function handleError(f, args) {
143
- try {
144
- return f.apply(this, args);
145
- } catch (e) {
146
- wasm.__wbindgen_export3(addHeapObject(e));
147
- }
148
- }
149
- function getArrayU8FromWasm0(ptr, len) {
150
- ptr = ptr >>> 0;
151
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
152
- }
153
- function dropObject(idx) {
154
- if (idx < 132) return;
155
- heap[idx] = heap_next;
156
- heap_next = idx;
157
- }
158
- function takeObject(idx) {
159
- const ret = getObject(idx);
160
- dropObject(idx);
161
- return ret;
162
- }
163
- function verify(input_js, ctx_js) {
164
- try {
165
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
166
- wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
167
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
168
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
169
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
170
- if (r2) {
171
- throw takeObject(r1);
172
- }
173
- return takeObject(r0);
174
- } finally {
175
- wasm.__wbindgen_add_to_stack_pointer(16);
176
- }
177
- }
178
- async function __wbg_load(module, imports) {
179
- if (typeof Response === "function" && module instanceof Response) {
180
- if (typeof WebAssembly.instantiateStreaming === "function") {
181
- try {
182
- return await WebAssembly.instantiateStreaming(module, imports);
183
- } catch (e) {
184
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
185
- if (validResponse && module.headers.get("Content-Type") !== "application/wasm") {
186
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
187
- } else {
188
- throw e;
189
- }
190
- }
191
- }
192
- const bytes = await module.arrayBuffer();
193
- return await WebAssembly.instantiate(bytes, imports);
194
- } else {
195
- const instance = await WebAssembly.instantiate(module, imports);
196
- if (instance instanceof WebAssembly.Instance) {
197
- return { instance, module };
198
- } else {
199
- return instance;
200
- }
201
- }
202
- }
203
- function __wbg_get_imports() {
204
- const imports = {};
205
- imports.wbg = {};
206
- imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
207
- const ret = Error(getStringFromWasm0(arg0, arg1));
208
- return addHeapObject(ret);
209
- };
210
- imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
211
- const ret = Number(getObject(arg0));
212
- return ret;
213
- };
214
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
215
- const ret = String(getObject(arg1));
216
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
217
- const len1 = WASM_VECTOR_LEN;
218
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
219
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
220
- };
221
- imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
222
- const v = getObject(arg1);
223
- const ret = typeof v === "bigint" ? v : void 0;
224
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
225
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
226
- };
227
- imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
228
- const v = getObject(arg0);
229
- const ret = typeof v === "boolean" ? v : void 0;
230
- return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
231
- };
232
- imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
233
- const ret = debugString(getObject(arg1));
234
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
235
- const len1 = WASM_VECTOR_LEN;
236
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
237
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
238
- };
239
- imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
240
- const ret = getObject(arg0) in getObject(arg1);
241
- return ret;
242
- };
243
- imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
244
- const ret = typeof getObject(arg0) === "bigint";
245
- return ret;
246
- };
247
- imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
248
- const ret = typeof getObject(arg0) === "function";
249
- return ret;
250
- };
251
- imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
252
- const val = getObject(arg0);
253
- const ret = typeof val === "object" && val !== null;
254
- return ret;
255
- };
256
- imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
257
- const ret = typeof getObject(arg0) === "string";
258
- return ret;
259
- };
260
- imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
261
- const ret = getObject(arg0) === void 0;
262
- return ret;
263
- };
264
- imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
265
- const ret = getObject(arg0) === getObject(arg1);
266
- return ret;
267
- };
268
- imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
269
- const ret = getObject(arg0) == getObject(arg1);
270
- return ret;
271
- };
272
- imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
273
- const obj = getObject(arg1);
274
- const ret = typeof obj === "number" ? obj : void 0;
275
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
276
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
277
- };
278
- imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
279
- const obj = getObject(arg1);
280
- const ret = typeof obj === "string" ? obj : void 0;
281
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
282
- var len1 = WASM_VECTOR_LEN;
283
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
284
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
285
- };
286
- imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
287
- throw new Error(getStringFromWasm0(arg0, arg1));
288
- };
289
- imports.wbg.__wbg_call_e762c39fa8ea36bf = function() {
290
- return handleError(function(arg0, arg1) {
291
- const ret = getObject(arg0).call(getObject(arg1));
292
- return addHeapObject(ret);
293
- }, arguments);
294
- };
295
- imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
296
- const ret = getObject(arg0).done;
297
- return ret;
298
- };
299
- imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
300
- const ret = Object.entries(getObject(arg0));
301
- return addHeapObject(ret);
302
- };
303
- imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
304
- const ret = getObject(arg0)[arg1 >>> 0];
305
- return addHeapObject(ret);
306
- };
307
- imports.wbg.__wbg_get_efcb449f58ec27c2 = function() {
308
- return handleError(function(arg0, arg1) {
309
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
310
- return addHeapObject(ret);
311
- }, arguments);
312
- };
313
- imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
314
- const ret = getObject(arg0)[getObject(arg1)];
315
- return addHeapObject(ret);
316
- };
317
- imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
318
- let result;
319
- try {
320
- result = getObject(arg0) instanceof ArrayBuffer;
321
- } catch (_) {
322
- result = false;
323
- }
324
- const ret = result;
325
- return ret;
326
- };
327
- imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
328
- let result;
329
- try {
330
- result = getObject(arg0) instanceof Map;
331
- } catch (_) {
332
- result = false;
333
- }
334
- const ret = result;
335
- return ret;
336
- };
337
- imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
338
- let result;
339
- try {
340
- result = getObject(arg0) instanceof Uint8Array;
341
- } catch (_) {
342
- result = false;
343
- }
344
- const ret = result;
345
- return ret;
346
- };
347
- imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
348
- const ret = Array.isArray(getObject(arg0));
349
- return ret;
350
- };
351
- imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
352
- const ret = Number.isSafeInteger(getObject(arg0));
353
- return ret;
354
- };
355
- imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
356
- const ret = Symbol.iterator;
357
- return addHeapObject(ret);
358
- };
359
- imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
360
- const ret = getObject(arg0).length;
361
- return ret;
362
- };
363
- imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
364
- const ret = getObject(arg0).length;
365
- return ret;
366
- };
367
- imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
368
- const ret = new Object();
369
- return addHeapObject(ret);
370
- };
371
- imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
372
- const ret = new Uint8Array(getObject(arg0));
373
- return addHeapObject(ret);
374
- };
375
- imports.wbg.__wbg_new_68651c719dcda04e = function() {
376
- const ret = /* @__PURE__ */ new Map();
377
- return addHeapObject(ret);
378
- };
379
- imports.wbg.__wbg_new_e17d9f43105b08be = function() {
380
- const ret = new Array();
381
- return addHeapObject(ret);
382
- };
383
- imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() {
384
- return handleError(function(arg0) {
385
- const ret = getObject(arg0).next();
386
- return addHeapObject(ret);
387
- }, arguments);
388
- };
389
- imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
390
- const ret = getObject(arg0).next;
391
- return addHeapObject(ret);
392
- };
393
- imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
394
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
395
- };
396
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
397
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
398
- };
399
- imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
400
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
401
- return addHeapObject(ret);
402
- };
403
- imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
404
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
405
- };
406
- imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
407
- const ret = getObject(arg0).value;
408
- return addHeapObject(ret);
409
- };
410
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
411
- const ret = getStringFromWasm0(arg0, arg1);
412
- return addHeapObject(ret);
413
- };
414
- imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
415
- const ret = BigInt.asUintN(64, arg0);
416
- return addHeapObject(ret);
417
- };
418
- imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
419
- const ret = arg0;
420
- return addHeapObject(ret);
421
- };
422
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
423
- const ret = arg0;
424
- return addHeapObject(ret);
425
- };
426
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
427
- const ret = getObject(arg0);
428
- return addHeapObject(ret);
429
- };
430
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
431
- takeObject(arg0);
432
- };
433
- return imports;
434
- }
435
- function __wbg_finalize_init(instance, module) {
436
- wasm = instance.exports;
437
- __wbg_init.__wbindgen_wasm_module = module;
438
- cachedDataViewMemory0 = null;
439
- cachedUint8ArrayMemory0 = null;
440
- return wasm;
441
- }
442
- function initSync(module) {
443
- if (wasm !== void 0) return wasm;
444
- if (typeof module !== "undefined") {
445
- if (Object.getPrototypeOf(module) === Object.prototype) {
446
- ({ module } = module);
447
- } else {
448
- console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
449
- }
450
- }
451
- const imports = __wbg_get_imports();
452
- if (!(module instanceof WebAssembly.Module)) {
453
- module = new WebAssembly.Module(module);
454
- }
455
- const instance = new WebAssembly.Instance(module, imports);
456
- return __wbg_finalize_init(instance, module);
457
- }
458
- async function __wbg_init(module_or_path) {
459
- if (wasm !== void 0) return wasm;
460
- if (typeof module_or_path !== "undefined") {
461
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
462
- ({ module_or_path } = module_or_path);
463
- } else {
464
- console.warn("using deprecated parameters for the initialization function; pass a single object instead");
465
- }
466
- }
467
- if (typeof module_or_path === "undefined") {
468
- module_or_path = new URL("kya_os_engine_bg.wasm", import.meta.url);
469
- }
470
- const imports = __wbg_get_imports();
471
- if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
472
- module_or_path = fetch(module_or_path);
473
- }
474
- const { instance, module } = await __wbg_load(await module_or_path, imports);
475
- return __wbg_finalize_init(instance, module);
476
- }
477
- var wasm, cachedUint8ArrayMemory0, cachedTextDecoder, MAX_SAFARI_DECODE_BYTES, numBytesDecoded, heap, heap_next, WASM_VECTOR_LEN, cachedTextEncoder, cachedDataViewMemory0, EXPECTED_RESPONSE_TYPES, kya_os_engine_default;
478
- var init_kya_os_engine = __esm({
479
- "wasm/kya-os-engine-web/kya_os_engine.js"() {
480
- cachedUint8ArrayMemory0 = null;
481
- cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
482
- cachedTextDecoder.decode();
483
- MAX_SAFARI_DECODE_BYTES = 2146435072;
484
- numBytesDecoded = 0;
485
- heap = new Array(128).fill(void 0);
486
- heap.push(void 0, null, true, false);
487
- heap_next = heap.length;
488
- WASM_VECTOR_LEN = 0;
489
- cachedTextEncoder = new TextEncoder();
490
- if (!("encodeInto" in cachedTextEncoder)) {
491
- cachedTextEncoder.encodeInto = function(arg, view) {
492
- const buf = cachedTextEncoder.encode(arg);
493
- view.set(buf);
494
- return {
495
- read: arg.length,
496
- written: buf.length
497
- };
498
- };
499
- }
500
- cachedDataViewMemory0 = null;
501
- EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
502
- kya_os_engine_default = __wbg_init;
503
- }
504
- });
505
-
506
1
  // src/engine/edge.ts
507
2
  var initialised = null;
508
3
  function initEngineEdge(moduleOrPath) {
@@ -511,7 +6,7 @@ function initEngineEdge(moduleOrPath) {
511
6
  function ensureReady(moduleOrPath) {
512
7
  if (initialised) return initialised;
513
8
  const pending = (async () => {
514
- const mod = await Promise.resolve().then(() => (init_kya_os_engine(), kya_os_engine_exports));
9
+ const mod = await import('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine.js');
515
10
  await mod.default(moduleOrPath !== void 0 ? { module_or_path: moduleOrPath } : void 0);
516
11
  return mod.verify;
517
12
  })();
@@ -524,8 +19,8 @@ function ensureReady(moduleOrPath) {
524
19
  return initialised;
525
20
  }
526
21
  async function engineVerifyEdge(input, ctx) {
527
- const verify2 = await ensureReady();
528
- return verify2(input, ctx);
22
+ const verify = await ensureReady();
23
+ return verify(input, ctx);
529
24
  }
530
25
 
531
26
  export { engineVerifyEdge, initEngineEdge };
@@ -0,0 +1,46 @@
1
+ import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.mjs';
2
+ export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineConfig, f as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction, T as Tier3Action, g as VerificationMethod } from './types-KPEcVvac.mjs';
3
+ export { DetectionDetail, McpIPayload } from '@kya-os/checkpoint-shared';
4
+
5
+ /**
6
+ * `kya-os-engine` WASM bridge — Node fallback (SDK-Next.js-Integration-
7
+ * Audit-1 #2618 follow-up).
8
+ *
9
+ * Wraps the wasm-bindgen `--target nodejs` artifact for consumers
10
+ * running under Webpack-class bundlers WITHOUT `asyncWebAssembly`
11
+ * support, or under raw Node ESM without a bundler. The default
12
+ * `@kya-os/checkpoint-wasm-runtime` entry (see `./index.ts`) uses
13
+ * the `--target bundler` artifact and works in Turbopack, Vite,
14
+ * Webpack 5 w/ asyncWebAssembly, etc.; this fallback exists for the
15
+ * remainder.
16
+ *
17
+ * The nodejs artifact's glue uses CJS `__dirname` + `fs.readFileSync`
18
+ * at module load. The tsup `./node` subpath config keeps the
19
+ * `shims: true` + `banner: createRequire(import.meta.url)` band-aids
20
+ * in place so the dist files have access to CJS globals + a real
21
+ * `require` in ESM scope. The glue itself stays external (regex
22
+ * `wasm/kya-os-engine/` in tsup's `commonOpts.external`) and resolves
23
+ * `__dirname` against its location in `node_modules/.../wasm/
24
+ * kya-os-engine/` where the `.wasm` already lives — no dist copy
25
+ * needed.
26
+ *
27
+ * Direct .wasm path (for callers building their own loaders):
28
+ * `@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine/kya_os_engine_bg.wasm`
29
+ *
30
+ * For Edge runtime (Vercel Edge, Cloudflare Workers), use the
31
+ * `./edge` subpath which uses `--target web` with `new URL(…)`
32
+ * native loading.
33
+ */
34
+
35
+ /**
36
+ * Verify an AgentRequest synchronously against a pre-fetched
37
+ * [`ContextSpec`]. Identical contract to the bundler-target entry
38
+ * (`./index.ts`); routes through the nodejs glue + CJS fs read.
39
+ *
40
+ * @throws {Error} if the WASM glue rejects the input (deserialisation
41
+ * failure) or the engine returns a `VerifyError` (resolver /
42
+ * status-list / reputation / policy infrastructure failure).
43
+ */
44
+ declare function engineVerify(input: AgentRequest, ctx: ContextSpec): VerifyResult;
45
+
46
+ export { AgentRequest, ContextSpec, VerifyResult, engineVerify };
@@ -0,0 +1,46 @@
1
+ import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.js';
2
+ export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineConfig, f as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction, T as Tier3Action, g as VerificationMethod } from './types-KPEcVvac.js';
3
+ export { DetectionDetail, McpIPayload } from '@kya-os/checkpoint-shared';
4
+
5
+ /**
6
+ * `kya-os-engine` WASM bridge — Node fallback (SDK-Next.js-Integration-
7
+ * Audit-1 #2618 follow-up).
8
+ *
9
+ * Wraps the wasm-bindgen `--target nodejs` artifact for consumers
10
+ * running under Webpack-class bundlers WITHOUT `asyncWebAssembly`
11
+ * support, or under raw Node ESM without a bundler. The default
12
+ * `@kya-os/checkpoint-wasm-runtime` entry (see `./index.ts`) uses
13
+ * the `--target bundler` artifact and works in Turbopack, Vite,
14
+ * Webpack 5 w/ asyncWebAssembly, etc.; this fallback exists for the
15
+ * remainder.
16
+ *
17
+ * The nodejs artifact's glue uses CJS `__dirname` + `fs.readFileSync`
18
+ * at module load. The tsup `./node` subpath config keeps the
19
+ * `shims: true` + `banner: createRequire(import.meta.url)` band-aids
20
+ * in place so the dist files have access to CJS globals + a real
21
+ * `require` in ESM scope. The glue itself stays external (regex
22
+ * `wasm/kya-os-engine/` in tsup's `commonOpts.external`) and resolves
23
+ * `__dirname` against its location in `node_modules/.../wasm/
24
+ * kya-os-engine/` where the `.wasm` already lives — no dist copy
25
+ * needed.
26
+ *
27
+ * Direct .wasm path (for callers building their own loaders):
28
+ * `@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine/kya_os_engine_bg.wasm`
29
+ *
30
+ * For Edge runtime (Vercel Edge, Cloudflare Workers), use the
31
+ * `./edge` subpath which uses `--target web` with `new URL(…)`
32
+ * native loading.
33
+ */
34
+
35
+ /**
36
+ * Verify an AgentRequest synchronously against a pre-fetched
37
+ * [`ContextSpec`]. Identical contract to the bundler-target entry
38
+ * (`./index.ts`); routes through the nodejs glue + CJS fs read.
39
+ *
40
+ * @throws {Error} if the WASM glue rejects the input (deserialisation
41
+ * failure) or the engine returns a `VerifyError` (resolver /
42
+ * status-list / reputation / policy infrastructure failure).
43
+ */
44
+ declare function engineVerify(input: AgentRequest, ctx: ContextSpec): VerifyResult;
45
+
46
+ export { AgentRequest, ContextSpec, VerifyResult, engineVerify };
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var wasmModule = require('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine/kya_os_engine.js');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var wasmModule__namespace = /*#__PURE__*/_interopNamespace(wasmModule);
24
+
25
+ // src/engine/node.ts
26
+ function engineVerify(input, ctx) {
27
+ const verify2 = wasmModule__namespace.verify;
28
+ return verify2(input, ctx);
29
+ }
30
+
31
+ exports.engineVerify = engineVerify;
@@ -0,0 +1,10 @@
1
+ import { createRequire } from 'module';
2
+ import * as wasmModule from '@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine/kya_os_engine.js';
3
+
4
+ createRequire(import.meta.url);
5
+ function engineVerify(input, ctx) {
6
+ const verify2 = wasmModule.verify;
7
+ return verify2(input, ctx);
8
+ }
9
+
10
+ export { engineVerify };