@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.
- package/CHANGELOG.md +110 -1
- 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/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,472 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
2
|
+
import * as wasmModule from '@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine/kya_os_engine.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __require = /* @__PURE__ */ ((x) => typeof require$1 !== "undefined" ? require$1 : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
|
-
get: (a, b) => (typeof require$1 !== "undefined" ? require$1 : a)[b]
|
|
14
|
-
}) : x)(function(x) {
|
|
15
|
-
if (typeof require$1 !== "undefined") return require$1.apply(this, arguments);
|
|
16
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
-
});
|
|
18
|
-
var __esm = (fn, res) => function __init() {
|
|
19
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
20
|
-
};
|
|
21
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
22
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
23
|
-
};
|
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (let key of __getOwnPropNames(from))
|
|
27
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
-
}
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
33
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
35
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
-
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
|
-
mod
|
|
39
|
-
));
|
|
40
|
-
var getFilename, getDirname, __dirname$1;
|
|
41
|
-
var init_esm_shims = __esm({
|
|
42
|
-
"../../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"() {
|
|
43
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
44
|
-
getDirname = () => path.dirname(getFilename());
|
|
45
|
-
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// wasm/kya-os-engine/kya_os_engine.js
|
|
50
|
-
var require_kya_os_engine = __commonJS({
|
|
51
|
-
"wasm/kya-os-engine/kya_os_engine.js"(exports$1, module) {
|
|
52
|
-
init_esm_shims();
|
|
53
|
-
var imports = {};
|
|
54
|
-
imports["__wbindgen_placeholder__"] = module.exports;
|
|
55
|
-
var cachedUint8ArrayMemory0 = null;
|
|
56
|
-
function getUint8ArrayMemory0() {
|
|
57
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
58
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
59
|
-
}
|
|
60
|
-
return cachedUint8ArrayMemory0;
|
|
61
|
-
}
|
|
62
|
-
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
63
|
-
cachedTextDecoder.decode();
|
|
64
|
-
function decodeText(ptr, len) {
|
|
65
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
66
|
-
}
|
|
67
|
-
function getStringFromWasm0(ptr, len) {
|
|
68
|
-
ptr = ptr >>> 0;
|
|
69
|
-
return decodeText(ptr, len);
|
|
70
|
-
}
|
|
71
|
-
var heap = new Array(128).fill(void 0);
|
|
72
|
-
heap.push(void 0, null, true, false);
|
|
73
|
-
var heap_next = heap.length;
|
|
74
|
-
function addHeapObject(obj) {
|
|
75
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
76
|
-
const idx = heap_next;
|
|
77
|
-
heap_next = heap[idx];
|
|
78
|
-
heap[idx] = obj;
|
|
79
|
-
return idx;
|
|
80
|
-
}
|
|
81
|
-
function getObject(idx) {
|
|
82
|
-
return heap[idx];
|
|
83
|
-
}
|
|
84
|
-
var WASM_VECTOR_LEN = 0;
|
|
85
|
-
var cachedTextEncoder = new TextEncoder();
|
|
86
|
-
if (!("encodeInto" in cachedTextEncoder)) {
|
|
87
|
-
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
88
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
89
|
-
view.set(buf);
|
|
90
|
-
return {
|
|
91
|
-
read: arg.length,
|
|
92
|
-
written: buf.length
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
97
|
-
if (realloc === void 0) {
|
|
98
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
99
|
-
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
100
|
-
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
101
|
-
WASM_VECTOR_LEN = buf.length;
|
|
102
|
-
return ptr2;
|
|
103
|
-
}
|
|
104
|
-
let len = arg.length;
|
|
105
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
106
|
-
const mem = getUint8ArrayMemory0();
|
|
107
|
-
let offset = 0;
|
|
108
|
-
for (; offset < len; offset++) {
|
|
109
|
-
const code = arg.charCodeAt(offset);
|
|
110
|
-
if (code > 127) break;
|
|
111
|
-
mem[ptr + offset] = code;
|
|
112
|
-
}
|
|
113
|
-
if (offset !== len) {
|
|
114
|
-
if (offset !== 0) {
|
|
115
|
-
arg = arg.slice(offset);
|
|
116
|
-
}
|
|
117
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
118
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
119
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
120
|
-
offset += ret.written;
|
|
121
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
122
|
-
}
|
|
123
|
-
WASM_VECTOR_LEN = offset;
|
|
124
|
-
return ptr;
|
|
125
|
-
}
|
|
126
|
-
var cachedDataViewMemory0 = null;
|
|
127
|
-
function getDataViewMemory0() {
|
|
128
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
129
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
130
|
-
}
|
|
131
|
-
return cachedDataViewMemory0;
|
|
132
|
-
}
|
|
133
|
-
function isLikeNone(x) {
|
|
134
|
-
return x === void 0 || x === null;
|
|
135
|
-
}
|
|
136
|
-
function debugString(val) {
|
|
137
|
-
const type = typeof val;
|
|
138
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
139
|
-
return `${val}`;
|
|
140
|
-
}
|
|
141
|
-
if (type == "string") {
|
|
142
|
-
return `"${val}"`;
|
|
143
|
-
}
|
|
144
|
-
if (type == "symbol") {
|
|
145
|
-
const description = val.description;
|
|
146
|
-
if (description == null) {
|
|
147
|
-
return "Symbol";
|
|
148
|
-
} else {
|
|
149
|
-
return `Symbol(${description})`;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (type == "function") {
|
|
153
|
-
const name = val.name;
|
|
154
|
-
if (typeof name == "string" && name.length > 0) {
|
|
155
|
-
return `Function(${name})`;
|
|
156
|
-
} else {
|
|
157
|
-
return "Function";
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (Array.isArray(val)) {
|
|
161
|
-
const length = val.length;
|
|
162
|
-
let debug = "[";
|
|
163
|
-
if (length > 0) {
|
|
164
|
-
debug += debugString(val[0]);
|
|
165
|
-
}
|
|
166
|
-
for (let i = 1; i < length; i++) {
|
|
167
|
-
debug += ", " + debugString(val[i]);
|
|
168
|
-
}
|
|
169
|
-
debug += "]";
|
|
170
|
-
return debug;
|
|
171
|
-
}
|
|
172
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
173
|
-
let className;
|
|
174
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
175
|
-
className = builtInMatches[1];
|
|
176
|
-
} else {
|
|
177
|
-
return toString.call(val);
|
|
178
|
-
}
|
|
179
|
-
if (className == "Object") {
|
|
180
|
-
try {
|
|
181
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
182
|
-
} catch (_) {
|
|
183
|
-
return "Object";
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (val instanceof Error) {
|
|
187
|
-
return `${val.name}: ${val.message}
|
|
188
|
-
${val.stack}`;
|
|
189
|
-
}
|
|
190
|
-
return className;
|
|
191
|
-
}
|
|
192
|
-
function handleError(f, args) {
|
|
193
|
-
try {
|
|
194
|
-
return f.apply(this, args);
|
|
195
|
-
} catch (e) {
|
|
196
|
-
wasm.__wbindgen_export3(addHeapObject(e));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
200
|
-
ptr = ptr >>> 0;
|
|
201
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
202
|
-
}
|
|
203
|
-
function dropObject(idx) {
|
|
204
|
-
if (idx < 132) return;
|
|
205
|
-
heap[idx] = heap_next;
|
|
206
|
-
heap_next = idx;
|
|
207
|
-
}
|
|
208
|
-
function takeObject(idx) {
|
|
209
|
-
const ret = getObject(idx);
|
|
210
|
-
dropObject(idx);
|
|
211
|
-
return ret;
|
|
212
|
-
}
|
|
213
|
-
exports$1.verify = function(input_js, ctx_js) {
|
|
214
|
-
try {
|
|
215
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
216
|
-
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
217
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
218
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
219
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
220
|
-
if (r2) {
|
|
221
|
-
throw takeObject(r1);
|
|
222
|
-
}
|
|
223
|
-
return takeObject(r0);
|
|
224
|
-
} finally {
|
|
225
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
exports$1.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
229
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
230
|
-
return addHeapObject(ret);
|
|
231
|
-
};
|
|
232
|
-
exports$1.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
233
|
-
const ret = Number(getObject(arg0));
|
|
234
|
-
return ret;
|
|
235
|
-
};
|
|
236
|
-
exports$1.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
237
|
-
const ret = String(getObject(arg1));
|
|
238
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
239
|
-
const len1 = WASM_VECTOR_LEN;
|
|
240
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
241
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
242
|
-
};
|
|
243
|
-
exports$1.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
244
|
-
const v = getObject(arg1);
|
|
245
|
-
const ret = typeof v === "bigint" ? v : void 0;
|
|
246
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
247
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
248
|
-
};
|
|
249
|
-
exports$1.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
250
|
-
const v = getObject(arg0);
|
|
251
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
252
|
-
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
253
|
-
};
|
|
254
|
-
exports$1.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
255
|
-
const ret = debugString(getObject(arg1));
|
|
256
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
257
|
-
const len1 = WASM_VECTOR_LEN;
|
|
258
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
259
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
260
|
-
};
|
|
261
|
-
exports$1.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
262
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
263
|
-
return ret;
|
|
264
|
-
};
|
|
265
|
-
exports$1.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
266
|
-
const ret = typeof getObject(arg0) === "bigint";
|
|
267
|
-
return ret;
|
|
268
|
-
};
|
|
269
|
-
exports$1.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
270
|
-
const ret = typeof getObject(arg0) === "function";
|
|
271
|
-
return ret;
|
|
272
|
-
};
|
|
273
|
-
exports$1.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
274
|
-
const val = getObject(arg0);
|
|
275
|
-
const ret = typeof val === "object" && val !== null;
|
|
276
|
-
return ret;
|
|
277
|
-
};
|
|
278
|
-
exports$1.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
279
|
-
const ret = typeof getObject(arg0) === "string";
|
|
280
|
-
return ret;
|
|
281
|
-
};
|
|
282
|
-
exports$1.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
283
|
-
const ret = getObject(arg0) === void 0;
|
|
284
|
-
return ret;
|
|
285
|
-
};
|
|
286
|
-
exports$1.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
287
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
288
|
-
return ret;
|
|
289
|
-
};
|
|
290
|
-
exports$1.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
291
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
292
|
-
return ret;
|
|
293
|
-
};
|
|
294
|
-
exports$1.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
295
|
-
const obj = getObject(arg1);
|
|
296
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
297
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
298
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
299
|
-
};
|
|
300
|
-
exports$1.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
301
|
-
const obj = getObject(arg1);
|
|
302
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
303
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
304
|
-
var len1 = WASM_VECTOR_LEN;
|
|
305
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
306
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
307
|
-
};
|
|
308
|
-
exports$1.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
309
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
310
|
-
};
|
|
311
|
-
exports$1.__wbg_call_e762c39fa8ea36bf = function() {
|
|
312
|
-
return handleError(function(arg0, arg1) {
|
|
313
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
314
|
-
return addHeapObject(ret);
|
|
315
|
-
}, arguments);
|
|
316
|
-
};
|
|
317
|
-
exports$1.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
318
|
-
const ret = getObject(arg0).done;
|
|
319
|
-
return ret;
|
|
320
|
-
};
|
|
321
|
-
exports$1.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
322
|
-
const ret = Object.entries(getObject(arg0));
|
|
323
|
-
return addHeapObject(ret);
|
|
324
|
-
};
|
|
325
|
-
exports$1.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
326
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
327
|
-
return addHeapObject(ret);
|
|
328
|
-
};
|
|
329
|
-
exports$1.__wbg_get_efcb449f58ec27c2 = function() {
|
|
330
|
-
return handleError(function(arg0, arg1) {
|
|
331
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
332
|
-
return addHeapObject(ret);
|
|
333
|
-
}, arguments);
|
|
334
|
-
};
|
|
335
|
-
exports$1.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
336
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
337
|
-
return addHeapObject(ret);
|
|
338
|
-
};
|
|
339
|
-
exports$1.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
340
|
-
let result;
|
|
341
|
-
try {
|
|
342
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
343
|
-
} catch (_) {
|
|
344
|
-
result = false;
|
|
345
|
-
}
|
|
346
|
-
const ret = result;
|
|
347
|
-
return ret;
|
|
348
|
-
};
|
|
349
|
-
exports$1.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
350
|
-
let result;
|
|
351
|
-
try {
|
|
352
|
-
result = getObject(arg0) instanceof Map;
|
|
353
|
-
} catch (_) {
|
|
354
|
-
result = false;
|
|
355
|
-
}
|
|
356
|
-
const ret = result;
|
|
357
|
-
return ret;
|
|
358
|
-
};
|
|
359
|
-
exports$1.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
360
|
-
let result;
|
|
361
|
-
try {
|
|
362
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
363
|
-
} catch (_) {
|
|
364
|
-
result = false;
|
|
365
|
-
}
|
|
366
|
-
const ret = result;
|
|
367
|
-
return ret;
|
|
368
|
-
};
|
|
369
|
-
exports$1.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
370
|
-
const ret = Array.isArray(getObject(arg0));
|
|
371
|
-
return ret;
|
|
372
|
-
};
|
|
373
|
-
exports$1.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
374
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
375
|
-
return ret;
|
|
376
|
-
};
|
|
377
|
-
exports$1.__wbg_iterator_e5822695327a3c39 = function() {
|
|
378
|
-
const ret = Symbol.iterator;
|
|
379
|
-
return addHeapObject(ret);
|
|
380
|
-
};
|
|
381
|
-
exports$1.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
382
|
-
const ret = getObject(arg0).length;
|
|
383
|
-
return ret;
|
|
384
|
-
};
|
|
385
|
-
exports$1.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
386
|
-
const ret = getObject(arg0).length;
|
|
387
|
-
return ret;
|
|
388
|
-
};
|
|
389
|
-
exports$1.__wbg_new_1acc0b6eea89d040 = function() {
|
|
390
|
-
const ret = new Object();
|
|
391
|
-
return addHeapObject(ret);
|
|
392
|
-
};
|
|
393
|
-
exports$1.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
394
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
395
|
-
return addHeapObject(ret);
|
|
396
|
-
};
|
|
397
|
-
exports$1.__wbg_new_68651c719dcda04e = function() {
|
|
398
|
-
const ret = /* @__PURE__ */ new Map();
|
|
399
|
-
return addHeapObject(ret);
|
|
400
|
-
};
|
|
401
|
-
exports$1.__wbg_new_e17d9f43105b08be = function() {
|
|
402
|
-
const ret = new Array();
|
|
403
|
-
return addHeapObject(ret);
|
|
404
|
-
};
|
|
405
|
-
exports$1.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
406
|
-
return handleError(function(arg0) {
|
|
407
|
-
const ret = getObject(arg0).next();
|
|
408
|
-
return addHeapObject(ret);
|
|
409
|
-
}, arguments);
|
|
410
|
-
};
|
|
411
|
-
exports$1.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
412
|
-
const ret = getObject(arg0).next;
|
|
413
|
-
return addHeapObject(ret);
|
|
414
|
-
};
|
|
415
|
-
exports$1.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
416
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
417
|
-
};
|
|
418
|
-
exports$1.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
419
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
420
|
-
};
|
|
421
|
-
exports$1.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
422
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
423
|
-
return addHeapObject(ret);
|
|
424
|
-
};
|
|
425
|
-
exports$1.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
426
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
427
|
-
};
|
|
428
|
-
exports$1.__wbg_value_692627309814bb8c = function(arg0) {
|
|
429
|
-
const ret = getObject(arg0).value;
|
|
430
|
-
return addHeapObject(ret);
|
|
431
|
-
};
|
|
432
|
-
exports$1.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
433
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
434
|
-
return addHeapObject(ret);
|
|
435
|
-
};
|
|
436
|
-
exports$1.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
437
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
438
|
-
return addHeapObject(ret);
|
|
439
|
-
};
|
|
440
|
-
exports$1.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
441
|
-
const ret = arg0;
|
|
442
|
-
return addHeapObject(ret);
|
|
443
|
-
};
|
|
444
|
-
exports$1.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
445
|
-
const ret = arg0;
|
|
446
|
-
return addHeapObject(ret);
|
|
447
|
-
};
|
|
448
|
-
exports$1.__wbindgen_object_clone_ref = function(arg0) {
|
|
449
|
-
const ret = getObject(arg0);
|
|
450
|
-
return addHeapObject(ret);
|
|
451
|
-
};
|
|
452
|
-
exports$1.__wbindgen_object_drop_ref = function(arg0) {
|
|
453
|
-
takeObject(arg0);
|
|
454
|
-
};
|
|
455
|
-
var wasmPath = `${__dirname$1}/kya_os_engine_bg.wasm`;
|
|
456
|
-
var wasmBytes = __require("fs").readFileSync(wasmPath);
|
|
457
|
-
var wasmModule2 = new WebAssembly.Module(wasmBytes);
|
|
458
|
-
var wasm = exports$1.__wasm = new WebAssembly.Instance(wasmModule2, imports).exports;
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
// src/engine/orchestrator/node.ts
|
|
463
|
-
init_esm_shims();
|
|
464
|
-
|
|
465
|
-
// src/engine/orchestrator/verify-request.ts
|
|
466
|
-
init_esm_shims();
|
|
4
|
+
createRequire(import.meta.url);
|
|
5
|
+
function engineVerify(input, ctx) {
|
|
6
|
+
const verify2 = wasmModule.verify;
|
|
7
|
+
return verify2(input, ctx);
|
|
8
|
+
}
|
|
467
9
|
|
|
468
10
|
// src/engine/adapters/outbound-url-policy.ts
|
|
469
|
-
init_esm_shims();
|
|
470
11
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
|
|
471
12
|
var UnsafeOutboundUrl = class extends Error {
|
|
472
13
|
kind = "UnsafeOutboundUrl";
|
|
@@ -541,19 +82,7 @@ function isBlockedIpv6(hostname) {
|
|
|
541
82
|
(firstSegment & 65280) === 65280;
|
|
542
83
|
}
|
|
543
84
|
|
|
544
|
-
// src/engine/index.ts
|
|
545
|
-
init_esm_shims();
|
|
546
|
-
var wasmModule = __toESM(require_kya_os_engine());
|
|
547
|
-
function engineVerify(input, ctx) {
|
|
548
|
-
const verify2 = wasmModule.verify;
|
|
549
|
-
return verify2(input, ctx);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// src/engine/orchestrator/build-agent-request.ts
|
|
553
|
-
init_esm_shims();
|
|
554
|
-
|
|
555
85
|
// src/engine/adapters/util.ts
|
|
556
|
-
init_esm_shims();
|
|
557
86
|
function base64UrlDecode(input) {
|
|
558
87
|
const padded = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
559
88
|
const padding = padded.length % 4 === 0 ? "" : "=".repeat(4 - padded.length % 4);
|
|
@@ -747,7 +276,6 @@ function bodyAsBytes(body) {
|
|
|
747
276
|
}
|
|
748
277
|
|
|
749
278
|
// src/engine/orchestrator/synthetic-results.ts
|
|
750
|
-
init_esm_shims();
|
|
751
279
|
function hostSynthesizedEngineInfo() {
|
|
752
280
|
return {
|
|
753
281
|
name: "checkpoint-engine-wasm",
|
|
@@ -775,23 +303,27 @@ function parseErrorDetectionDetail(detail) {
|
|
|
775
303
|
|
|
776
304
|
// src/engine/orchestrator/verify-request.ts
|
|
777
305
|
var DEFAULT_REPUTATION_BASELINE = 1;
|
|
778
|
-
function
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
306
|
+
function createVerifyRequestApi(defaultEngine) {
|
|
307
|
+
function verifyRequest2(req, opts) {
|
|
308
|
+
return verifyRequest_internal(req, opts, opts.engineVerifyFn ?? defaultEngine);
|
|
309
|
+
}
|
|
310
|
+
function makeVerifyRequest2(opts) {
|
|
311
|
+
let argusWarningLogged = false;
|
|
312
|
+
const log = opts.logger ?? defaultLogger;
|
|
313
|
+
const engine = opts.engineVerifyFn ?? defaultEngine;
|
|
314
|
+
return async function verifyRequest3(req) {
|
|
315
|
+
if (!argusWarningLogged && !opts.argusUrl) {
|
|
316
|
+
log(
|
|
317
|
+
'[Checkpoint] WARNING: Argus URL not configured; reputation will degrade to baseline 1.0 ("trust by default"). Set ARGUS_API_URL to enable.'
|
|
318
|
+
);
|
|
319
|
+
argusWarningLogged = true;
|
|
320
|
+
}
|
|
321
|
+
return verifyRequest_internal(req, opts, engine);
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return { verifyRequest: verifyRequest2, makeVerifyRequest: makeVerifyRequest2 };
|
|
793
325
|
}
|
|
794
|
-
async function verifyRequest_internal(req, opts) {
|
|
326
|
+
async function verifyRequest_internal(req, opts, engineVerify2) {
|
|
795
327
|
if (hasMalformedJwsBody(req)) {
|
|
796
328
|
return blockWithParseError("malformed JWS body", opts.enforcementMode);
|
|
797
329
|
}
|
|
@@ -838,9 +370,10 @@ async function verifyRequest_internal(req, opts) {
|
|
|
838
370
|
reputation: agentDid ? { [agentDid]: repScore } : {},
|
|
839
371
|
tenantDecision,
|
|
840
372
|
nowUnix: opts.clock.nowUnix(),
|
|
841
|
-
enforcementMode: opts.enforcementMode
|
|
373
|
+
enforcementMode: opts.enforcementMode,
|
|
374
|
+
...opts.engineConfig ? { config: opts.engineConfig } : {}
|
|
842
375
|
};
|
|
843
|
-
return
|
|
376
|
+
return engineVerify2(agentRequest, ctx);
|
|
844
377
|
}
|
|
845
378
|
async function fetchCredentialStatus(credentialStatusUrl, statusListCache) {
|
|
846
379
|
assertSafeHttpsUrl(credentialStatusUrl, "credential status URL");
|
|
@@ -870,7 +403,6 @@ function defaultLogger(msg) {
|
|
|
870
403
|
}
|
|
871
404
|
|
|
872
405
|
// src/engine/orchestrator/render-decision.ts
|
|
873
|
-
init_esm_shims();
|
|
874
406
|
function renderDecisionAsResponse(result) {
|
|
875
407
|
const baseHeaders = buildBaseHeaders(result);
|
|
876
408
|
if (result.enforcementMode === "observe") {
|
|
@@ -1032,4 +564,9 @@ function wouldHaveBeenReasonHeader(result) {
|
|
|
1032
564
|
return {};
|
|
1033
565
|
}
|
|
1034
566
|
|
|
567
|
+
// src/engine/orchestrator/node.ts
|
|
568
|
+
var nodeApi = createVerifyRequestApi(engineVerify);
|
|
569
|
+
var verifyRequest = nodeApi.verifyRequest;
|
|
570
|
+
var makeVerifyRequest = nodeApi.makeVerifyRequest;
|
|
571
|
+
|
|
1035
572
|
export { buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody, makeVerifyRequest, renderDecisionAsResponse, verifyRequest };
|