@kya-os/checkpoint-wasm-runtime 1.2.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.
- package/CHANGELOG.md +176 -0
- package/dist/adapters.d.mts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/engine-edge.d.mts +2 -2
- package/dist/engine-edge.d.ts +2 -2
- package/dist/engine-edge.js +3 -509
- package/dist/engine-edge.mjs +3 -508
- package/dist/engine-node.d.mts +46 -0
- package/dist/engine-node.d.ts +46 -0
- package/dist/engine-node.js +31 -0
- package/dist/engine-node.mjs +10 -0
- package/dist/engine.d.mts +25 -4
- package/dist/engine.d.ts +25 -4
- package/dist/engine.js +2 -457
- package/dist/engine.mjs +2 -464
- package/dist/index.d.mts +531 -3
- package/dist/index.d.ts +531 -3
- package/dist/index.js +2 -28
- package/dist/index.mjs +2 -29
- package/dist/node.d.mts +524 -3
- package/dist/node.d.ts +524 -3
- package/dist/node.js +2 -26
- package/dist/node.mjs +2 -26
- package/dist/orchestrator-edge.d.mts +24 -10
- package/dist/orchestrator-edge.d.ts +24 -10
- package/dist/orchestrator-edge.js +5 -510
- package/dist/orchestrator-edge.mjs +5 -509
- package/dist/orchestrator-node.d.mts +60 -52
- package/dist/orchestrator-node.d.ts +60 -52
- package/dist/orchestrator-node.js +50 -487
- package/dist/orchestrator-node.mjs +34 -497
- package/dist/orchestrator.d.mts +356 -4
- package/dist/orchestrator.d.ts +356 -4
- package/dist/orchestrator.js +37 -1001
- package/dist/orchestrator.mjs +37 -1005
- package/dist/{types-ByrdPLL2.d.ts → types-KPEcVvac.d.mts} +31 -1
- package/dist/{types-ByrdPLL2.d.mts → types-KPEcVvac.d.ts} +31 -1
- package/package.json +13 -2
- package/wasm/agentshield_wasm_bg.wasm +0 -0
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine/package.json +24 -4
- package/wasm/kya-os-engine-bundler/kya_os_engine.d.ts +24 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine.js +4 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.js +522 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm.d.ts +8 -0
- package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-web/package.json +25 -3
- package/dist/kya_os_engine_bg.wasm +0 -0
- package/dist/rules-detector-ZIKHN-_y.d.mts +0 -532
- 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/adapters/outbound-url-policy.ts
|
|
507
2
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
|
|
508
3
|
var UnsafeOutboundUrl = class extends Error {
|
|
@@ -586,7 +81,7 @@ function initEngineEdge(moduleOrPath) {
|
|
|
586
81
|
function ensureReady(moduleOrPath) {
|
|
587
82
|
if (initialised) return initialised;
|
|
588
83
|
const pending = (async () => {
|
|
589
|
-
const mod = await
|
|
84
|
+
const mod = await import('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine.js');
|
|
590
85
|
await mod.default(moduleOrPath !== void 0 ? { module_or_path: moduleOrPath } : void 0);
|
|
591
86
|
return mod.verify;
|
|
592
87
|
})();
|
|
@@ -599,8 +94,8 @@ function ensureReady(moduleOrPath) {
|
|
|
599
94
|
return initialised;
|
|
600
95
|
}
|
|
601
96
|
async function engineVerifyEdge(input, ctx) {
|
|
602
|
-
const
|
|
603
|
-
return
|
|
97
|
+
const verify = await ensureReady();
|
|
98
|
+
return verify(input, ctx);
|
|
604
99
|
}
|
|
605
100
|
|
|
606
101
|
// src/engine/adapters/util.ts
|
|
@@ -1050,7 +545,8 @@ async function verifyRequestEdge_internal(req, opts) {
|
|
|
1050
545
|
reputation: agentDid ? { [agentDid]: repScore } : {},
|
|
1051
546
|
tenantDecision,
|
|
1052
547
|
nowUnix: opts.clock.nowUnix(),
|
|
1053
|
-
enforcementMode: opts.enforcementMode
|
|
548
|
+
enforcementMode: opts.enforcementMode,
|
|
549
|
+
...opts.engineConfig ? { config: opts.engineConfig } : {}
|
|
1054
550
|
};
|
|
1055
551
|
return engineVerifyEdge(agentRequest, ctx);
|
|
1056
552
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as DidDocument, D as Decision, E as EnforcementMode, V as VerifyResult,
|
|
1
|
+
import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.mjs';
|
|
2
2
|
import '@kya-os/checkpoint-shared';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -116,15 +116,6 @@ interface ClockAdapter {
|
|
|
116
116
|
nowUnix(): number;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
/**
|
|
120
|
-
* Orchestrator-layer types — Phase C, host-side only.
|
|
121
|
-
*
|
|
122
|
-
* Nothing here crosses the WASM boundary. The engine ABI types live
|
|
123
|
-
* in `../types.ts`; the adapter interfaces live in
|
|
124
|
-
* `../adapters/index.ts`. This file is the host-wrapper-facing
|
|
125
|
-
* surface — what Phase D (Next.js) and Phase E (Express) import.
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
119
|
/**
|
|
129
120
|
* Framework-agnostic HTTP request shape.
|
|
130
121
|
*
|
|
@@ -181,6 +172,29 @@ interface VerifyRequestOpts {
|
|
|
181
172
|
argusUrl?: string;
|
|
182
173
|
/** Injectable for the once-only Argus configuration warning. */
|
|
183
174
|
logger?: (msg: string) => void;
|
|
175
|
+
/**
|
|
176
|
+
* Override the engine WASM-bridge function used during the sync
|
|
177
|
+
* `verify()` call. Defaults to the wasm-bindgen `--target bundler`
|
|
178
|
+
* variant imported by `./verify-request.ts` from `'../index'`.
|
|
179
|
+
*
|
|
180
|
+
* The `./orchestrator/node` subpath (SDK-Next.js-Integration-Audit-1
|
|
181
|
+
* / #2618 safety net) injects the `--target nodejs` variant here so
|
|
182
|
+
* Webpack-without-asyncWebAssembly consumers don't transitively pull
|
|
183
|
+
* the bundler artifact through the orchestrator's verify call.
|
|
184
|
+
*/
|
|
185
|
+
engineVerifyFn?: (input: AgentRequest, ctx: ContextSpec) => VerifyResult;
|
|
186
|
+
/**
|
|
187
|
+
* Engine-default behaviour knobs forwarded onto every composed
|
|
188
|
+
* `ContextSpec`. Defaults to `{ tier3Action: 'monitor' }` so a host
|
|
189
|
+
* installing `@kya-os/checkpoint-*` with minimal config preserves
|
|
190
|
+
* 1.3.0 behaviour — tenant policy is the arbiter, the engine does
|
|
191
|
+
* not short-circuit known-agent UAs with an engine-default Block.
|
|
192
|
+
*
|
|
193
|
+
* Host wrappers that want the calibrated engine-default block opt
|
|
194
|
+
* into `{ tier3Action: 'block' }`. The bench harness is the
|
|
195
|
+
* canonical opt-in consumer. See the wasm-runtime 1.4.0 CHANGELOG.
|
|
196
|
+
*/
|
|
197
|
+
engineConfig?: EngineConfig;
|
|
184
198
|
}
|
|
185
199
|
/**
|
|
186
200
|
* Transport-agnostic response shape `renderDecisionAsResponse`
|
|
@@ -199,48 +213,6 @@ interface RenderedResponse {
|
|
|
199
213
|
body?: string | object;
|
|
200
214
|
}
|
|
201
215
|
|
|
202
|
-
/**
|
|
203
|
-
* `verifyRequest` async orchestrator — Phase C.2.
|
|
204
|
-
*
|
|
205
|
-
* The single entry point Phase D (Next.js) and Phase E (Express)
|
|
206
|
-
* compose. Async pre-fetch on the host side; one sync `engineVerify`
|
|
207
|
-
* call across the WASM boundary. Sync-engine / async-host invariant
|
|
208
|
-
* (H-1 § 4.5) preserved.
|
|
209
|
-
*
|
|
210
|
-
* Orchestration:
|
|
211
|
-
* 1. Translate HTTP → AgentRequest (no engine I/O).
|
|
212
|
-
* 2. Extract identifiers (issuer DID, agent DID, status-list URL).
|
|
213
|
-
* 3. Conditional Promise.all over the *applicable* adapters —
|
|
214
|
-
* anonymous PlainHttp gets no network calls; signed MCP-I gets
|
|
215
|
-
* DID + status-list + reputation in parallel.
|
|
216
|
-
* 4. Translate adapter errors to verdicts where the architect-
|
|
217
|
-
* ratified posture says so:
|
|
218
|
-
* - DidResolver throw → Block(ParseError) verdict
|
|
219
|
-
* - StatusListCache throw → re-throw (host renders 503)
|
|
220
|
-
* - Reputation throw → impossible (Phase B § 4.5)
|
|
221
|
-
* 5. Compute the tenant Decision via PolicyEvaluator over the
|
|
222
|
-
* resolved reputation.
|
|
223
|
-
* 6. Build ContextSpec, call `engineVerify`, return VerifyResult.
|
|
224
|
-
*
|
|
225
|
-
* Cedar-1 forward-compat: step (5) is the only place the
|
|
226
|
-
* PolicyEvaluator interface gets exercised. When Cedar-1 swaps
|
|
227
|
-
* implementations, this orchestrator does not change.
|
|
228
|
-
*/
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Factory — constructs a `verifyRequest` closure that remembers the
|
|
232
|
-
* one-shot Argus-not-configured warning state. Use this when the
|
|
233
|
-
* host wrapper wants the startup log; call `verifyRequest` directly
|
|
234
|
-
* (the loose function below) if you don't.
|
|
235
|
-
*/
|
|
236
|
-
declare function makeVerifyRequest(opts: VerifyRequestOpts): (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
237
|
-
/**
|
|
238
|
-
* Single-shot async entry. Use [`makeVerifyRequest`] in long-lived
|
|
239
|
-
* hosts (so the Argus warning is one-shot per process); use this
|
|
240
|
-
* loose form in tests + one-off invocations.
|
|
241
|
-
*/
|
|
242
|
-
declare function verifyRequest(req: IncomingHttpLike, opts: VerifyRequestOpts): Promise<VerifyResult>;
|
|
243
|
-
|
|
244
216
|
/**
|
|
245
217
|
* HTTP-to-`AgentRequest` translator — Phase C.1.
|
|
246
218
|
*
|
|
@@ -354,4 +326,40 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
|
|
|
354
326
|
|
|
355
327
|
declare function renderDecisionAsResponse(result: VerifyResult): RenderedResponse;
|
|
356
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Node-runtime orchestrator entry — SDK-Next.js-Integration-Audit-1
|
|
331
|
+
* (#2618) safety net.
|
|
332
|
+
*
|
|
333
|
+
* Bundler-safe variant of `./index.ts` (the runtime-agnostic barrel)
|
|
334
|
+
* for consumers running Webpack-class bundlers WITHOUT the
|
|
335
|
+
* `experiments.asyncWebAssembly` flag — or raw Node ESM without any
|
|
336
|
+
* bundler.
|
|
337
|
+
*
|
|
338
|
+
* **Why this exists:** `./index.ts` binds `verifyRequest` /
|
|
339
|
+
* `makeVerifyRequest` to the wasm-bindgen `--target bundler`
|
|
340
|
+
* `engineVerify`. The bundler artifact's `.wasm` entry uses
|
|
341
|
+
* `import * as wasm from "./*.wasm"` which Turbopack, Vite, esbuild,
|
|
342
|
+
* and Webpack-with-asyncWebAssembly handle natively — but legacy
|
|
343
|
+
* Webpack setups parse the static `.wasm` import as JavaScript and
|
|
344
|
+
* fail with `Unexpected character`. This entry binds the
|
|
345
|
+
* `--target nodejs` `engineVerify` instead (CJS `fs.readFileSync`
|
|
346
|
+
* inside the glue, no bundler involvement) so legacy Webpack
|
|
347
|
+
* consumers + raw Node ESM both work.
|
|
348
|
+
*
|
|
349
|
+
* **Routing:** the package's `exports` map's `"node"` condition on
|
|
350
|
+
* `./orchestrator` routes here for any bundler that respects the
|
|
351
|
+
* standard Node export condition (Next.js + Turbopack ≥16, webpack
|
|
352
|
+
* ≥5, esbuild, Vite, Bun). Consumers under the `"edge-runtime"` /
|
|
353
|
+
* `"browser"` conditions continue to route to `orchestrator-edge.mjs`
|
|
354
|
+
* (unchanged).
|
|
355
|
+
*
|
|
356
|
+
* **Public surface preserved.** Every export Node consumers actually
|
|
357
|
+
* use is re-exported here. The Edge-only exports (`verifyRequestEdge`,
|
|
358
|
+
* `makeVerifyRequestEdge`, `initEngineEdge`) are NOT included — Node
|
|
359
|
+
* consumers that explicitly need the Edge variant should import from
|
|
360
|
+
* `@kya-os/checkpoint-wasm-runtime/orchestrator/edge` directly.
|
|
361
|
+
*/
|
|
362
|
+
declare const verifyRequest: (req: IncomingHttpLike, opts: VerifyRequestOpts) => Promise<VerifyResult>;
|
|
363
|
+
declare const makeVerifyRequest: (opts: VerifyRequestOpts) => (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
364
|
+
|
|
357
365
|
export { type BuildAgentRequestOpts, type IncomingHttpLike, type RenderedResponse, type VerifyRequestOpts, buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody, makeVerifyRequest, renderDecisionAsResponse, verifyRequest };
|