@kya-os/checkpoint-wasm-runtime 1.1.0 → 1.1.2

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.
@@ -1,19 +1,472 @@
1
+ import path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+
4
+ var __create = Object.create;
1
5
  var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
+ }) : x)(function(x) {
13
+ if (typeof require !== "undefined") return require.apply(this, arguments);
14
+ throw Error('Dynamic require of "' + x + '" is not supported');
15
+ });
3
16
  var __esm = (fn, res) => function __init() {
4
17
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
18
  };
19
+ var __commonJS = (cb, mod) => function __require2() {
20
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ };
6
22
  var __export = (target, all) => {
7
23
  for (var name in all)
8
24
  __defProp(target, name, { get: all[name], enumerable: true });
9
25
  };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
42
+ var getFilename, getDirname, __dirname$1;
43
+ var init_esm_shims = __esm({
44
+ "../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.15.32_jiti@2.6.1_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.3/node_modules/tsup/assets/esm_shims.js"() {
45
+ getFilename = () => fileURLToPath(import.meta.url);
46
+ getDirname = () => path.dirname(getFilename());
47
+ __dirname$1 = /* @__PURE__ */ getDirname();
48
+ }
49
+ });
50
+
51
+ // wasm/kya-os-engine/kya_os_engine.js
52
+ var require_kya_os_engine = __commonJS({
53
+ "wasm/kya-os-engine/kya_os_engine.js"(exports$1, module) {
54
+ init_esm_shims();
55
+ var imports = {};
56
+ imports["__wbindgen_placeholder__"] = module.exports;
57
+ var cachedUint8ArrayMemory02 = null;
58
+ function getUint8ArrayMemory02() {
59
+ if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
60
+ cachedUint8ArrayMemory02 = new Uint8Array(wasm2.memory.buffer);
61
+ }
62
+ return cachedUint8ArrayMemory02;
63
+ }
64
+ var cachedTextDecoder2 = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
65
+ cachedTextDecoder2.decode();
66
+ function decodeText2(ptr, len) {
67
+ return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
68
+ }
69
+ function getStringFromWasm02(ptr, len) {
70
+ ptr = ptr >>> 0;
71
+ return decodeText2(ptr, len);
72
+ }
73
+ var heap2 = new Array(128).fill(void 0);
74
+ heap2.push(void 0, null, true, false);
75
+ var heap_next2 = heap2.length;
76
+ function addHeapObject2(obj) {
77
+ if (heap_next2 === heap2.length) heap2.push(heap2.length + 1);
78
+ const idx = heap_next2;
79
+ heap_next2 = heap2[idx];
80
+ heap2[idx] = obj;
81
+ return idx;
82
+ }
83
+ function getObject2(idx) {
84
+ return heap2[idx];
85
+ }
86
+ var WASM_VECTOR_LEN2 = 0;
87
+ var cachedTextEncoder2 = new TextEncoder();
88
+ if (!("encodeInto" in cachedTextEncoder2)) {
89
+ cachedTextEncoder2.encodeInto = function(arg, view) {
90
+ const buf = cachedTextEncoder2.encode(arg);
91
+ view.set(buf);
92
+ return {
93
+ read: arg.length,
94
+ written: buf.length
95
+ };
96
+ };
97
+ }
98
+ function passStringToWasm02(arg, malloc, realloc) {
99
+ if (realloc === void 0) {
100
+ const buf = cachedTextEncoder2.encode(arg);
101
+ const ptr2 = malloc(buf.length, 1) >>> 0;
102
+ getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
103
+ WASM_VECTOR_LEN2 = buf.length;
104
+ return ptr2;
105
+ }
106
+ let len = arg.length;
107
+ let ptr = malloc(len, 1) >>> 0;
108
+ const mem = getUint8ArrayMemory02();
109
+ let offset = 0;
110
+ for (; offset < len; offset++) {
111
+ const code = arg.charCodeAt(offset);
112
+ if (code > 127) break;
113
+ mem[ptr + offset] = code;
114
+ }
115
+ if (offset !== len) {
116
+ if (offset !== 0) {
117
+ arg = arg.slice(offset);
118
+ }
119
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
120
+ const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
121
+ const ret = cachedTextEncoder2.encodeInto(arg, view);
122
+ offset += ret.written;
123
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
124
+ }
125
+ WASM_VECTOR_LEN2 = offset;
126
+ return ptr;
127
+ }
128
+ var cachedDataViewMemory02 = null;
129
+ function getDataViewMemory02() {
130
+ if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
131
+ cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
132
+ }
133
+ return cachedDataViewMemory02;
134
+ }
135
+ function isLikeNone2(x) {
136
+ return x === void 0 || x === null;
137
+ }
138
+ function debugString2(val) {
139
+ const type = typeof val;
140
+ if (type == "number" || type == "boolean" || val == null) {
141
+ return `${val}`;
142
+ }
143
+ if (type == "string") {
144
+ return `"${val}"`;
145
+ }
146
+ if (type == "symbol") {
147
+ const description = val.description;
148
+ if (description == null) {
149
+ return "Symbol";
150
+ } else {
151
+ return `Symbol(${description})`;
152
+ }
153
+ }
154
+ if (type == "function") {
155
+ const name = val.name;
156
+ if (typeof name == "string" && name.length > 0) {
157
+ return `Function(${name})`;
158
+ } else {
159
+ return "Function";
160
+ }
161
+ }
162
+ if (Array.isArray(val)) {
163
+ const length = val.length;
164
+ let debug = "[";
165
+ if (length > 0) {
166
+ debug += debugString2(val[0]);
167
+ }
168
+ for (let i = 1; i < length; i++) {
169
+ debug += ", " + debugString2(val[i]);
170
+ }
171
+ debug += "]";
172
+ return debug;
173
+ }
174
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
175
+ let className;
176
+ if (builtInMatches && builtInMatches.length > 1) {
177
+ className = builtInMatches[1];
178
+ } else {
179
+ return toString.call(val);
180
+ }
181
+ if (className == "Object") {
182
+ try {
183
+ return "Object(" + JSON.stringify(val) + ")";
184
+ } catch (_) {
185
+ return "Object";
186
+ }
187
+ }
188
+ if (val instanceof Error) {
189
+ return `${val.name}: ${val.message}
190
+ ${val.stack}`;
191
+ }
192
+ return className;
193
+ }
194
+ function handleError2(f, args) {
195
+ try {
196
+ return f.apply(this, args);
197
+ } catch (e) {
198
+ wasm2.__wbindgen_export3(addHeapObject2(e));
199
+ }
200
+ }
201
+ function getArrayU8FromWasm02(ptr, len) {
202
+ ptr = ptr >>> 0;
203
+ return getUint8ArrayMemory02().subarray(ptr / 1, ptr / 1 + len);
204
+ }
205
+ function dropObject2(idx) {
206
+ if (idx < 132) return;
207
+ heap2[idx] = heap_next2;
208
+ heap_next2 = idx;
209
+ }
210
+ function takeObject2(idx) {
211
+ const ret = getObject2(idx);
212
+ dropObject2(idx);
213
+ return ret;
214
+ }
215
+ exports$1.verify = function(input_js, ctx_js) {
216
+ try {
217
+ const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
218
+ wasm2.verify(retptr, addHeapObject2(input_js), addHeapObject2(ctx_js));
219
+ var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
220
+ var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
221
+ var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
222
+ if (r2) {
223
+ throw takeObject2(r1);
224
+ }
225
+ return takeObject2(r0);
226
+ } finally {
227
+ wasm2.__wbindgen_add_to_stack_pointer(16);
228
+ }
229
+ };
230
+ exports$1.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
231
+ const ret = Error(getStringFromWasm02(arg0, arg1));
232
+ return addHeapObject2(ret);
233
+ };
234
+ exports$1.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
235
+ const ret = Number(getObject2(arg0));
236
+ return ret;
237
+ };
238
+ exports$1.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
239
+ const ret = String(getObject2(arg1));
240
+ const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
241
+ const len1 = WASM_VECTOR_LEN2;
242
+ getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
243
+ getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
244
+ };
245
+ exports$1.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
246
+ const v = getObject2(arg1);
247
+ const ret = typeof v === "bigint" ? v : void 0;
248
+ getDataViewMemory02().setBigInt64(arg0 + 8 * 1, isLikeNone2(ret) ? BigInt(0) : ret, true);
249
+ getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
250
+ };
251
+ exports$1.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
252
+ const v = getObject2(arg0);
253
+ const ret = typeof v === "boolean" ? v : void 0;
254
+ return isLikeNone2(ret) ? 16777215 : ret ? 1 : 0;
255
+ };
256
+ exports$1.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
257
+ const ret = debugString2(getObject2(arg1));
258
+ const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
259
+ const len1 = WASM_VECTOR_LEN2;
260
+ getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
261
+ getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
262
+ };
263
+ exports$1.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
264
+ const ret = getObject2(arg0) in getObject2(arg1);
265
+ return ret;
266
+ };
267
+ exports$1.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
268
+ const ret = typeof getObject2(arg0) === "bigint";
269
+ return ret;
270
+ };
271
+ exports$1.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
272
+ const ret = typeof getObject2(arg0) === "function";
273
+ return ret;
274
+ };
275
+ exports$1.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
276
+ const val = getObject2(arg0);
277
+ const ret = typeof val === "object" && val !== null;
278
+ return ret;
279
+ };
280
+ exports$1.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
281
+ const ret = typeof getObject2(arg0) === "string";
282
+ return ret;
283
+ };
284
+ exports$1.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
285
+ const ret = getObject2(arg0) === void 0;
286
+ return ret;
287
+ };
288
+ exports$1.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
289
+ const ret = getObject2(arg0) === getObject2(arg1);
290
+ return ret;
291
+ };
292
+ exports$1.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
293
+ const ret = getObject2(arg0) == getObject2(arg1);
294
+ return ret;
295
+ };
296
+ exports$1.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
297
+ const obj = getObject2(arg1);
298
+ const ret = typeof obj === "number" ? obj : void 0;
299
+ getDataViewMemory02().setFloat64(arg0 + 8 * 1, isLikeNone2(ret) ? 0 : ret, true);
300
+ getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
301
+ };
302
+ exports$1.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
303
+ const obj = getObject2(arg1);
304
+ const ret = typeof obj === "string" ? obj : void 0;
305
+ var ptr1 = isLikeNone2(ret) ? 0 : passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
306
+ var len1 = WASM_VECTOR_LEN2;
307
+ getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
308
+ getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
309
+ };
310
+ exports$1.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
311
+ throw new Error(getStringFromWasm02(arg0, arg1));
312
+ };
313
+ exports$1.__wbg_call_e762c39fa8ea36bf = function() {
314
+ return handleError2(function(arg0, arg1) {
315
+ const ret = getObject2(arg0).call(getObject2(arg1));
316
+ return addHeapObject2(ret);
317
+ }, arguments);
318
+ };
319
+ exports$1.__wbg_done_2042aa2670fb1db1 = function(arg0) {
320
+ const ret = getObject2(arg0).done;
321
+ return ret;
322
+ };
323
+ exports$1.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
324
+ const ret = Object.entries(getObject2(arg0));
325
+ return addHeapObject2(ret);
326
+ };
327
+ exports$1.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
328
+ const ret = getObject2(arg0)[arg1 >>> 0];
329
+ return addHeapObject2(ret);
330
+ };
331
+ exports$1.__wbg_get_efcb449f58ec27c2 = function() {
332
+ return handleError2(function(arg0, arg1) {
333
+ const ret = Reflect.get(getObject2(arg0), getObject2(arg1));
334
+ return addHeapObject2(ret);
335
+ }, arguments);
336
+ };
337
+ exports$1.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
338
+ const ret = getObject2(arg0)[getObject2(arg1)];
339
+ return addHeapObject2(ret);
340
+ };
341
+ exports$1.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
342
+ let result;
343
+ try {
344
+ result = getObject2(arg0) instanceof ArrayBuffer;
345
+ } catch (_) {
346
+ result = false;
347
+ }
348
+ const ret = result;
349
+ return ret;
350
+ };
351
+ exports$1.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
352
+ let result;
353
+ try {
354
+ result = getObject2(arg0) instanceof Map;
355
+ } catch (_) {
356
+ result = false;
357
+ }
358
+ const ret = result;
359
+ return ret;
360
+ };
361
+ exports$1.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
362
+ let result;
363
+ try {
364
+ result = getObject2(arg0) instanceof Uint8Array;
365
+ } catch (_) {
366
+ result = false;
367
+ }
368
+ const ret = result;
369
+ return ret;
370
+ };
371
+ exports$1.__wbg_isArray_96e0af9891d0945d = function(arg0) {
372
+ const ret = Array.isArray(getObject2(arg0));
373
+ return ret;
374
+ };
375
+ exports$1.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
376
+ const ret = Number.isSafeInteger(getObject2(arg0));
377
+ return ret;
378
+ };
379
+ exports$1.__wbg_iterator_e5822695327a3c39 = function() {
380
+ const ret = Symbol.iterator;
381
+ return addHeapObject2(ret);
382
+ };
383
+ exports$1.__wbg_length_69bca3cb64fc8748 = function(arg0) {
384
+ const ret = getObject2(arg0).length;
385
+ return ret;
386
+ };
387
+ exports$1.__wbg_length_cdd215e10d9dd507 = function(arg0) {
388
+ const ret = getObject2(arg0).length;
389
+ return ret;
390
+ };
391
+ exports$1.__wbg_new_1acc0b6eea89d040 = function() {
392
+ const ret = new Object();
393
+ return addHeapObject2(ret);
394
+ };
395
+ exports$1.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
396
+ const ret = new Uint8Array(getObject2(arg0));
397
+ return addHeapObject2(ret);
398
+ };
399
+ exports$1.__wbg_new_68651c719dcda04e = function() {
400
+ const ret = /* @__PURE__ */ new Map();
401
+ return addHeapObject2(ret);
402
+ };
403
+ exports$1.__wbg_new_e17d9f43105b08be = function() {
404
+ const ret = new Array();
405
+ return addHeapObject2(ret);
406
+ };
407
+ exports$1.__wbg_next_020810e0ae8ebcb0 = function() {
408
+ return handleError2(function(arg0) {
409
+ const ret = getObject2(arg0).next();
410
+ return addHeapObject2(ret);
411
+ }, arguments);
412
+ };
413
+ exports$1.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
414
+ const ret = getObject2(arg0).next;
415
+ return addHeapObject2(ret);
416
+ };
417
+ exports$1.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
418
+ Uint8Array.prototype.set.call(getArrayU8FromWasm02(arg0, arg1), getObject2(arg2));
419
+ };
420
+ exports$1.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
421
+ getObject2(arg0)[takeObject2(arg1)] = takeObject2(arg2);
422
+ };
423
+ exports$1.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
424
+ const ret = getObject2(arg0).set(getObject2(arg1), getObject2(arg2));
425
+ return addHeapObject2(ret);
426
+ };
427
+ exports$1.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
428
+ getObject2(arg0)[arg1 >>> 0] = takeObject2(arg2);
429
+ };
430
+ exports$1.__wbg_value_692627309814bb8c = function(arg0) {
431
+ const ret = getObject2(arg0).value;
432
+ return addHeapObject2(ret);
433
+ };
434
+ exports$1.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
435
+ const ret = getStringFromWasm02(arg0, arg1);
436
+ return addHeapObject2(ret);
437
+ };
438
+ exports$1.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
439
+ const ret = BigInt.asUintN(64, arg0);
440
+ return addHeapObject2(ret);
441
+ };
442
+ exports$1.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
443
+ const ret = arg0;
444
+ return addHeapObject2(ret);
445
+ };
446
+ exports$1.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
447
+ const ret = arg0;
448
+ return addHeapObject2(ret);
449
+ };
450
+ exports$1.__wbindgen_object_clone_ref = function(arg0) {
451
+ const ret = getObject2(arg0);
452
+ return addHeapObject2(ret);
453
+ };
454
+ exports$1.__wbindgen_object_drop_ref = function(arg0) {
455
+ takeObject2(arg0);
456
+ };
457
+ var wasmPath = `${__dirname$1}/kya_os_engine_bg.wasm`;
458
+ var wasmBytes = __require("fs").readFileSync(wasmPath);
459
+ var wasmModule2 = new WebAssembly.Module(wasmBytes);
460
+ var wasm2 = exports$1.__wasm = new WebAssembly.Instance(wasmModule2, imports).exports;
461
+ }
462
+ });
10
463
 
11
464
  // wasm/kya-os-engine-web/kya_os_engine.js
12
465
  var kya_os_engine_exports = {};
13
466
  __export(kya_os_engine_exports, {
14
467
  default: () => kya_os_engine_default,
15
468
  initSync: () => initSync,
16
- verify: () => verify
469
+ verify: () => verify2
17
470
  });
18
471
  function getUint8ArrayMemory0() {
19
472
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -160,7 +613,7 @@ function takeObject(idx) {
160
613
  dropObject(idx);
161
614
  return ret;
162
615
  }
163
- function verify(input_js, ctx_js) {
616
+ function verify2(input_js, ctx_js) {
164
617
  try {
165
618
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
166
619
  wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
@@ -477,6 +930,7 @@ async function __wbg_init(module_or_path) {
477
930
  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
931
  var init_kya_os_engine = __esm({
479
932
  "wasm/kya-os-engine-web/kya_os_engine.js"() {
933
+ init_esm_shims();
480
934
  cachedUint8ArrayMemory0 = null;
481
935
  cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
482
936
  cachedTextDecoder.decode();
@@ -503,7 +957,14 @@ var init_kya_os_engine = __esm({
503
957
  }
504
958
  });
505
959
 
960
+ // src/engine/orchestrator/index.ts
961
+ init_esm_shims();
962
+
963
+ // src/engine/orchestrator/verify-request.ts
964
+ init_esm_shims();
965
+
506
966
  // src/engine/adapters/outbound-url-policy.ts
967
+ init_esm_shims();
507
968
  var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
508
969
  var UnsafeOutboundUrl = class extends Error {
509
970
  kind = "UnsafeOutboundUrl";
@@ -579,12 +1040,18 @@ function isBlockedIpv6(hostname) {
579
1040
  }
580
1041
 
581
1042
  // src/engine/index.ts
1043
+ init_esm_shims();
1044
+ var wasmModule = __toESM(require_kya_os_engine());
582
1045
  function engineVerify(input, ctx) {
583
- const result = (void 0)(input, ctx);
584
- return result;
1046
+ const verify3 = wasmModule.verify;
1047
+ return verify3(input, ctx);
585
1048
  }
586
1049
 
1050
+ // src/engine/orchestrator/build-agent-request.ts
1051
+ init_esm_shims();
1052
+
587
1053
  // src/engine/adapters/util.ts
1054
+ init_esm_shims();
588
1055
  function base64UrlDecode(input) {
589
1056
  const padded = input.replace(/-/g, "+").replace(/_/g, "/");
590
1057
  const padding = padded.length % 4 === 0 ? "" : "=".repeat(4 - padded.length % 4);
@@ -878,7 +1345,11 @@ function defaultLogger(msg) {
878
1345
  console.warn(msg);
879
1346
  }
880
1347
 
1348
+ // src/engine/orchestrator/verify-request-edge.ts
1349
+ init_esm_shims();
1350
+
881
1351
  // src/engine/edge.ts
1352
+ init_esm_shims();
882
1353
  var initialised = null;
883
1354
  function initEngineEdge(moduleOrPath) {
884
1355
  return ensureReady(moduleOrPath).then(() => void 0);
@@ -899,11 +1370,12 @@ function ensureReady(moduleOrPath) {
899
1370
  return initialised;
900
1371
  }
901
1372
  async function engineVerifyEdge(input, ctx) {
902
- const verify2 = await ensureReady();
903
- return verify2(input, ctx);
1373
+ const verify3 = await ensureReady();
1374
+ return verify3(input, ctx);
904
1375
  }
905
1376
 
906
1377
  // src/engine/orchestrator/render-decision.ts
1378
+ init_esm_shims();
907
1379
  function renderDecisionAsResponse(result) {
908
1380
  const baseHeaders = buildBaseHeaders(result);
909
1381
  if (result.enforcementMode === "observe") {
@@ -315,6 +315,68 @@ declare class WasmDetector implements IDetector {
315
315
  private createDefaultResult;
316
316
  }
317
317
 
318
+ /**
319
+ * Dynamic WASM Loader for Node.js
320
+ *
321
+ * This loader dynamically loads and compiles WASM at runtime,
322
+ * which is supported in Node.js but NOT in Edge Runtime.
323
+ *
324
+ * Usage:
325
+ * ```typescript
326
+ * import { DynamicWasmLoader, WasmDetector } from '@kya-os/checkpoint-wasm-runtime/node';
327
+ *
328
+ * const loader = new DynamicWasmLoader();
329
+ * const detector = new WasmDetector(loader);
330
+ * ```
331
+ */
332
+
333
+ /**
334
+ * Dynamic WASM Loader
335
+ *
336
+ * For Node.js environments that support dynamic WASM compilation.
337
+ * Automatically finds and loads the WASM module.
338
+ */
339
+ declare class DynamicWasmLoader implements IWasmLoader {
340
+ private readonly wasmPath?;
341
+ private bindings;
342
+ private instance;
343
+ private loadPromise;
344
+ /**
345
+ * Create a new DynamicWasmLoader
346
+ * @param wasmPath - Optional custom path to WASM file
347
+ */
348
+ constructor(wasmPath?: string | undefined);
349
+ /**
350
+ * Load and compile the WASM module
351
+ */
352
+ load(): Promise<void>;
353
+ private doLoad;
354
+ /**
355
+ * Get the WASM bindings after loading
356
+ */
357
+ getBindings(): IWasmBindings;
358
+ /**
359
+ * Check if WASM is loaded
360
+ */
361
+ isLoaded(): boolean;
362
+ /**
363
+ * Get the loading strategy name
364
+ */
365
+ getStrategy(): string;
366
+ /**
367
+ * Create wasm-bindgen required imports
368
+ */
369
+ private createWasmBindgenImports;
370
+ /**
371
+ * Create bindings wrapper from WASM exports
372
+ */
373
+ private createBindings;
374
+ }
375
+ /**
376
+ * Create a dynamic loader
377
+ */
378
+ declare function createDynamicLoader(wasmPath?: string): DynamicWasmLoader;
379
+
318
380
  /**
319
381
  * Policy Loader
320
382
  *
@@ -467,4 +529,4 @@ declare class RulesDetector implements IDetector {
467
529
  */
468
530
  declare function createRulesDetector(): RulesDetector;
469
531
 
470
- export { CONFIDENCE as C, type DetectionClass as D, type ForgeabilityRisk as F, type IDetectorOptions as I, PolicyLoadError as P, RulesDetector as R, type VerificationMethod as V, WasmDetector as W, type IDetector as a, type ICustomerPolicy as b, type IDetectedAgent as c, type IDetectionInput as d, type IDetectionResult as e, type IPathRule as f, type IPolicyLoader as g, type IWasmBindings as h, type IWasmLoader as i, PolicyLoader as j, type PolicyLoaderConfig as k, createPolicyLoader as l, createRulesDetector as m };
532
+ export { CONFIDENCE as C, type DetectionClass as D, type ForgeabilityRisk as F, type IDetector as I, PolicyLoader as P, RulesDetector as R, type VerificationMethod as V, WasmDetector as W, type IDetectorOptions as a, type IDetectionInput as b, DynamicWasmLoader as c, type ICustomerPolicy as d, type IDetectedAgent as e, type IDetectionResult as f, type IPolicyLoader as g, type IWasmLoader as h, createDynamicLoader as i, createPolicyLoader as j, createRulesDetector as k, type IWasmBindings as l, type IPathRule as m, PolicyLoadError as n, type PolicyLoaderConfig as o };
@@ -315,6 +315,68 @@ declare class WasmDetector implements IDetector {
315
315
  private createDefaultResult;
316
316
  }
317
317
 
318
+ /**
319
+ * Dynamic WASM Loader for Node.js
320
+ *
321
+ * This loader dynamically loads and compiles WASM at runtime,
322
+ * which is supported in Node.js but NOT in Edge Runtime.
323
+ *
324
+ * Usage:
325
+ * ```typescript
326
+ * import { DynamicWasmLoader, WasmDetector } from '@kya-os/checkpoint-wasm-runtime/node';
327
+ *
328
+ * const loader = new DynamicWasmLoader();
329
+ * const detector = new WasmDetector(loader);
330
+ * ```
331
+ */
332
+
333
+ /**
334
+ * Dynamic WASM Loader
335
+ *
336
+ * For Node.js environments that support dynamic WASM compilation.
337
+ * Automatically finds and loads the WASM module.
338
+ */
339
+ declare class DynamicWasmLoader implements IWasmLoader {
340
+ private readonly wasmPath?;
341
+ private bindings;
342
+ private instance;
343
+ private loadPromise;
344
+ /**
345
+ * Create a new DynamicWasmLoader
346
+ * @param wasmPath - Optional custom path to WASM file
347
+ */
348
+ constructor(wasmPath?: string | undefined);
349
+ /**
350
+ * Load and compile the WASM module
351
+ */
352
+ load(): Promise<void>;
353
+ private doLoad;
354
+ /**
355
+ * Get the WASM bindings after loading
356
+ */
357
+ getBindings(): IWasmBindings;
358
+ /**
359
+ * Check if WASM is loaded
360
+ */
361
+ isLoaded(): boolean;
362
+ /**
363
+ * Get the loading strategy name
364
+ */
365
+ getStrategy(): string;
366
+ /**
367
+ * Create wasm-bindgen required imports
368
+ */
369
+ private createWasmBindgenImports;
370
+ /**
371
+ * Create bindings wrapper from WASM exports
372
+ */
373
+ private createBindings;
374
+ }
375
+ /**
376
+ * Create a dynamic loader
377
+ */
378
+ declare function createDynamicLoader(wasmPath?: string): DynamicWasmLoader;
379
+
318
380
  /**
319
381
  * Policy Loader
320
382
  *
@@ -467,4 +529,4 @@ declare class RulesDetector implements IDetector {
467
529
  */
468
530
  declare function createRulesDetector(): RulesDetector;
469
531
 
470
- export { CONFIDENCE as C, type DetectionClass as D, type ForgeabilityRisk as F, type IDetectorOptions as I, PolicyLoadError as P, RulesDetector as R, type VerificationMethod as V, WasmDetector as W, type IDetector as a, type ICustomerPolicy as b, type IDetectedAgent as c, type IDetectionInput as d, type IDetectionResult as e, type IPathRule as f, type IPolicyLoader as g, type IWasmBindings as h, type IWasmLoader as i, PolicyLoader as j, type PolicyLoaderConfig as k, createPolicyLoader as l, createRulesDetector as m };
532
+ export { CONFIDENCE as C, type DetectionClass as D, type ForgeabilityRisk as F, type IDetector as I, PolicyLoader as P, RulesDetector as R, type VerificationMethod as V, WasmDetector as W, type IDetectorOptions as a, type IDetectionInput as b, DynamicWasmLoader as c, type ICustomerPolicy as d, type IDetectedAgent as e, type IDetectionResult as f, type IPolicyLoader as g, type IWasmLoader as h, createDynamicLoader as i, createPolicyLoader as j, createRulesDetector as k, type IWasmBindings as l, type IPathRule as m, PolicyLoadError as n, type PolicyLoaderConfig as o };