@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
package/dist/orchestrator.mjs
CHANGED
|
@@ -1,972 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
1
|
+
import { verify } from '@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-bundler/kya_os_engine.js';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __export = (target, all) => {
|
|
25
|
-
for (var name in all)
|
|
26
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
-
};
|
|
28
|
-
var __copyProps = (to, from, except, desc) => {
|
|
29
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
-
for (let key of __getOwnPropNames(from))
|
|
31
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
-
}
|
|
34
|
-
return to;
|
|
35
|
-
};
|
|
36
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
37
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
38
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
39
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
40
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
41
|
-
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
-
mod
|
|
43
|
-
));
|
|
44
|
-
var getFilename, getDirname, __dirname$1;
|
|
45
|
-
var init_esm_shims = __esm({
|
|
46
|
-
"../../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"() {
|
|
47
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
48
|
-
getDirname = () => path.dirname(getFilename());
|
|
49
|
-
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// wasm/kya-os-engine/kya_os_engine.js
|
|
54
|
-
var require_kya_os_engine = __commonJS({
|
|
55
|
-
"wasm/kya-os-engine/kya_os_engine.js"(exports$1, module) {
|
|
56
|
-
init_esm_shims();
|
|
57
|
-
var imports = {};
|
|
58
|
-
imports["__wbindgen_placeholder__"] = module.exports;
|
|
59
|
-
var cachedUint8ArrayMemory02 = null;
|
|
60
|
-
function getUint8ArrayMemory02() {
|
|
61
|
-
if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
|
|
62
|
-
cachedUint8ArrayMemory02 = new Uint8Array(wasm2.memory.buffer);
|
|
63
|
-
}
|
|
64
|
-
return cachedUint8ArrayMemory02;
|
|
65
|
-
}
|
|
66
|
-
var cachedTextDecoder2 = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
67
|
-
cachedTextDecoder2.decode();
|
|
68
|
-
function decodeText2(ptr, len) {
|
|
69
|
-
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
70
|
-
}
|
|
71
|
-
function getStringFromWasm02(ptr, len) {
|
|
72
|
-
ptr = ptr >>> 0;
|
|
73
|
-
return decodeText2(ptr, len);
|
|
74
|
-
}
|
|
75
|
-
var heap2 = new Array(128).fill(void 0);
|
|
76
|
-
heap2.push(void 0, null, true, false);
|
|
77
|
-
var heap_next2 = heap2.length;
|
|
78
|
-
function addHeapObject2(obj) {
|
|
79
|
-
if (heap_next2 === heap2.length) heap2.push(heap2.length + 1);
|
|
80
|
-
const idx = heap_next2;
|
|
81
|
-
heap_next2 = heap2[idx];
|
|
82
|
-
heap2[idx] = obj;
|
|
83
|
-
return idx;
|
|
84
|
-
}
|
|
85
|
-
function getObject2(idx) {
|
|
86
|
-
return heap2[idx];
|
|
87
|
-
}
|
|
88
|
-
var WASM_VECTOR_LEN2 = 0;
|
|
89
|
-
var cachedTextEncoder2 = new TextEncoder();
|
|
90
|
-
if (!("encodeInto" in cachedTextEncoder2)) {
|
|
91
|
-
cachedTextEncoder2.encodeInto = function(arg, view) {
|
|
92
|
-
const buf = cachedTextEncoder2.encode(arg);
|
|
93
|
-
view.set(buf);
|
|
94
|
-
return {
|
|
95
|
-
read: arg.length,
|
|
96
|
-
written: buf.length
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function passStringToWasm02(arg, malloc, realloc) {
|
|
101
|
-
if (realloc === void 0) {
|
|
102
|
-
const buf = cachedTextEncoder2.encode(arg);
|
|
103
|
-
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
104
|
-
getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
105
|
-
WASM_VECTOR_LEN2 = buf.length;
|
|
106
|
-
return ptr2;
|
|
107
|
-
}
|
|
108
|
-
let len = arg.length;
|
|
109
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
110
|
-
const mem = getUint8ArrayMemory02();
|
|
111
|
-
let offset = 0;
|
|
112
|
-
for (; offset < len; offset++) {
|
|
113
|
-
const code = arg.charCodeAt(offset);
|
|
114
|
-
if (code > 127) break;
|
|
115
|
-
mem[ptr + offset] = code;
|
|
116
|
-
}
|
|
117
|
-
if (offset !== len) {
|
|
118
|
-
if (offset !== 0) {
|
|
119
|
-
arg = arg.slice(offset);
|
|
120
|
-
}
|
|
121
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
122
|
-
const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
|
|
123
|
-
const ret = cachedTextEncoder2.encodeInto(arg, view);
|
|
124
|
-
offset += ret.written;
|
|
125
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
126
|
-
}
|
|
127
|
-
WASM_VECTOR_LEN2 = offset;
|
|
128
|
-
return ptr;
|
|
129
|
-
}
|
|
130
|
-
var cachedDataViewMemory02 = null;
|
|
131
|
-
function getDataViewMemory02() {
|
|
132
|
-
if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
|
|
133
|
-
cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
|
|
134
|
-
}
|
|
135
|
-
return cachedDataViewMemory02;
|
|
136
|
-
}
|
|
137
|
-
function isLikeNone2(x) {
|
|
138
|
-
return x === void 0 || x === null;
|
|
139
|
-
}
|
|
140
|
-
function debugString2(val) {
|
|
141
|
-
const type = typeof val;
|
|
142
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
143
|
-
return `${val}`;
|
|
144
|
-
}
|
|
145
|
-
if (type == "string") {
|
|
146
|
-
return `"${val}"`;
|
|
147
|
-
}
|
|
148
|
-
if (type == "symbol") {
|
|
149
|
-
const description = val.description;
|
|
150
|
-
if (description == null) {
|
|
151
|
-
return "Symbol";
|
|
152
|
-
} else {
|
|
153
|
-
return `Symbol(${description})`;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (type == "function") {
|
|
157
|
-
const name = val.name;
|
|
158
|
-
if (typeof name == "string" && name.length > 0) {
|
|
159
|
-
return `Function(${name})`;
|
|
160
|
-
} else {
|
|
161
|
-
return "Function";
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (Array.isArray(val)) {
|
|
165
|
-
const length = val.length;
|
|
166
|
-
let debug = "[";
|
|
167
|
-
if (length > 0) {
|
|
168
|
-
debug += debugString2(val[0]);
|
|
169
|
-
}
|
|
170
|
-
for (let i = 1; i < length; i++) {
|
|
171
|
-
debug += ", " + debugString2(val[i]);
|
|
172
|
-
}
|
|
173
|
-
debug += "]";
|
|
174
|
-
return debug;
|
|
175
|
-
}
|
|
176
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
177
|
-
let className;
|
|
178
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
179
|
-
className = builtInMatches[1];
|
|
180
|
-
} else {
|
|
181
|
-
return toString.call(val);
|
|
182
|
-
}
|
|
183
|
-
if (className == "Object") {
|
|
184
|
-
try {
|
|
185
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
186
|
-
} catch (_) {
|
|
187
|
-
return "Object";
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (val instanceof Error) {
|
|
191
|
-
return `${val.name}: ${val.message}
|
|
192
|
-
${val.stack}`;
|
|
193
|
-
}
|
|
194
|
-
return className;
|
|
195
|
-
}
|
|
196
|
-
function handleError2(f, args) {
|
|
197
|
-
try {
|
|
198
|
-
return f.apply(this, args);
|
|
199
|
-
} catch (e) {
|
|
200
|
-
wasm2.__wbindgen_export3(addHeapObject2(e));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function getArrayU8FromWasm02(ptr, len) {
|
|
204
|
-
ptr = ptr >>> 0;
|
|
205
|
-
return getUint8ArrayMemory02().subarray(ptr / 1, ptr / 1 + len);
|
|
206
|
-
}
|
|
207
|
-
function dropObject2(idx) {
|
|
208
|
-
if (idx < 132) return;
|
|
209
|
-
heap2[idx] = heap_next2;
|
|
210
|
-
heap_next2 = idx;
|
|
211
|
-
}
|
|
212
|
-
function takeObject2(idx) {
|
|
213
|
-
const ret = getObject2(idx);
|
|
214
|
-
dropObject2(idx);
|
|
215
|
-
return ret;
|
|
216
|
-
}
|
|
217
|
-
exports$1.verify = function(input_js, ctx_js) {
|
|
218
|
-
try {
|
|
219
|
-
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
220
|
-
wasm2.verify(retptr, addHeapObject2(input_js), addHeapObject2(ctx_js));
|
|
221
|
-
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
222
|
-
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
223
|
-
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
224
|
-
if (r2) {
|
|
225
|
-
throw takeObject2(r1);
|
|
226
|
-
}
|
|
227
|
-
return takeObject2(r0);
|
|
228
|
-
} finally {
|
|
229
|
-
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
exports$1.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
233
|
-
const ret = Error(getStringFromWasm02(arg0, arg1));
|
|
234
|
-
return addHeapObject2(ret);
|
|
235
|
-
};
|
|
236
|
-
exports$1.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
237
|
-
const ret = Number(getObject2(arg0));
|
|
238
|
-
return ret;
|
|
239
|
-
};
|
|
240
|
-
exports$1.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
241
|
-
const ret = String(getObject2(arg1));
|
|
242
|
-
const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
243
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
244
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
245
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
246
|
-
};
|
|
247
|
-
exports$1.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
248
|
-
const v = getObject2(arg1);
|
|
249
|
-
const ret = typeof v === "bigint" ? v : void 0;
|
|
250
|
-
getDataViewMemory02().setBigInt64(arg0 + 8 * 1, isLikeNone2(ret) ? BigInt(0) : ret, true);
|
|
251
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
|
|
252
|
-
};
|
|
253
|
-
exports$1.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
254
|
-
const v = getObject2(arg0);
|
|
255
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
256
|
-
return isLikeNone2(ret) ? 16777215 : ret ? 1 : 0;
|
|
257
|
-
};
|
|
258
|
-
exports$1.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
259
|
-
const ret = debugString2(getObject2(arg1));
|
|
260
|
-
const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
261
|
-
const len1 = WASM_VECTOR_LEN2;
|
|
262
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
263
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
264
|
-
};
|
|
265
|
-
exports$1.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
266
|
-
const ret = getObject2(arg0) in getObject2(arg1);
|
|
267
|
-
return ret;
|
|
268
|
-
};
|
|
269
|
-
exports$1.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
270
|
-
const ret = typeof getObject2(arg0) === "bigint";
|
|
271
|
-
return ret;
|
|
272
|
-
};
|
|
273
|
-
exports$1.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
274
|
-
const ret = typeof getObject2(arg0) === "function";
|
|
275
|
-
return ret;
|
|
276
|
-
};
|
|
277
|
-
exports$1.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
278
|
-
const val = getObject2(arg0);
|
|
279
|
-
const ret = typeof val === "object" && val !== null;
|
|
280
|
-
return ret;
|
|
281
|
-
};
|
|
282
|
-
exports$1.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
283
|
-
const ret = typeof getObject2(arg0) === "string";
|
|
284
|
-
return ret;
|
|
285
|
-
};
|
|
286
|
-
exports$1.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
287
|
-
const ret = getObject2(arg0) === void 0;
|
|
288
|
-
return ret;
|
|
289
|
-
};
|
|
290
|
-
exports$1.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
291
|
-
const ret = getObject2(arg0) === getObject2(arg1);
|
|
292
|
-
return ret;
|
|
293
|
-
};
|
|
294
|
-
exports$1.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
295
|
-
const ret = getObject2(arg0) == getObject2(arg1);
|
|
296
|
-
return ret;
|
|
297
|
-
};
|
|
298
|
-
exports$1.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
299
|
-
const obj = getObject2(arg1);
|
|
300
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
301
|
-
getDataViewMemory02().setFloat64(arg0 + 8 * 1, isLikeNone2(ret) ? 0 : ret, true);
|
|
302
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
|
|
303
|
-
};
|
|
304
|
-
exports$1.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
305
|
-
const obj = getObject2(arg1);
|
|
306
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
307
|
-
var ptr1 = isLikeNone2(ret) ? 0 : passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
308
|
-
var len1 = WASM_VECTOR_LEN2;
|
|
309
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
310
|
-
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
311
|
-
};
|
|
312
|
-
exports$1.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
313
|
-
throw new Error(getStringFromWasm02(arg0, arg1));
|
|
314
|
-
};
|
|
315
|
-
exports$1.__wbg_call_e762c39fa8ea36bf = function() {
|
|
316
|
-
return handleError2(function(arg0, arg1) {
|
|
317
|
-
const ret = getObject2(arg0).call(getObject2(arg1));
|
|
318
|
-
return addHeapObject2(ret);
|
|
319
|
-
}, arguments);
|
|
320
|
-
};
|
|
321
|
-
exports$1.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
322
|
-
const ret = getObject2(arg0).done;
|
|
323
|
-
return ret;
|
|
324
|
-
};
|
|
325
|
-
exports$1.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
326
|
-
const ret = Object.entries(getObject2(arg0));
|
|
327
|
-
return addHeapObject2(ret);
|
|
328
|
-
};
|
|
329
|
-
exports$1.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
330
|
-
const ret = getObject2(arg0)[arg1 >>> 0];
|
|
331
|
-
return addHeapObject2(ret);
|
|
332
|
-
};
|
|
333
|
-
exports$1.__wbg_get_efcb449f58ec27c2 = function() {
|
|
334
|
-
return handleError2(function(arg0, arg1) {
|
|
335
|
-
const ret = Reflect.get(getObject2(arg0), getObject2(arg1));
|
|
336
|
-
return addHeapObject2(ret);
|
|
337
|
-
}, arguments);
|
|
338
|
-
};
|
|
339
|
-
exports$1.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
340
|
-
const ret = getObject2(arg0)[getObject2(arg1)];
|
|
341
|
-
return addHeapObject2(ret);
|
|
342
|
-
};
|
|
343
|
-
exports$1.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
344
|
-
let result;
|
|
345
|
-
try {
|
|
346
|
-
result = getObject2(arg0) instanceof ArrayBuffer;
|
|
347
|
-
} catch (_) {
|
|
348
|
-
result = false;
|
|
349
|
-
}
|
|
350
|
-
const ret = result;
|
|
351
|
-
return ret;
|
|
352
|
-
};
|
|
353
|
-
exports$1.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
354
|
-
let result;
|
|
355
|
-
try {
|
|
356
|
-
result = getObject2(arg0) instanceof Map;
|
|
357
|
-
} catch (_) {
|
|
358
|
-
result = false;
|
|
359
|
-
}
|
|
360
|
-
const ret = result;
|
|
361
|
-
return ret;
|
|
362
|
-
};
|
|
363
|
-
exports$1.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
364
|
-
let result;
|
|
365
|
-
try {
|
|
366
|
-
result = getObject2(arg0) instanceof Uint8Array;
|
|
367
|
-
} catch (_) {
|
|
368
|
-
result = false;
|
|
369
|
-
}
|
|
370
|
-
const ret = result;
|
|
371
|
-
return ret;
|
|
372
|
-
};
|
|
373
|
-
exports$1.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
374
|
-
const ret = Array.isArray(getObject2(arg0));
|
|
375
|
-
return ret;
|
|
376
|
-
};
|
|
377
|
-
exports$1.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
378
|
-
const ret = Number.isSafeInteger(getObject2(arg0));
|
|
379
|
-
return ret;
|
|
380
|
-
};
|
|
381
|
-
exports$1.__wbg_iterator_e5822695327a3c39 = function() {
|
|
382
|
-
const ret = Symbol.iterator;
|
|
383
|
-
return addHeapObject2(ret);
|
|
384
|
-
};
|
|
385
|
-
exports$1.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
386
|
-
const ret = getObject2(arg0).length;
|
|
387
|
-
return ret;
|
|
388
|
-
};
|
|
389
|
-
exports$1.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
390
|
-
const ret = getObject2(arg0).length;
|
|
391
|
-
return ret;
|
|
392
|
-
};
|
|
393
|
-
exports$1.__wbg_new_1acc0b6eea89d040 = function() {
|
|
394
|
-
const ret = new Object();
|
|
395
|
-
return addHeapObject2(ret);
|
|
396
|
-
};
|
|
397
|
-
exports$1.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
398
|
-
const ret = new Uint8Array(getObject2(arg0));
|
|
399
|
-
return addHeapObject2(ret);
|
|
400
|
-
};
|
|
401
|
-
exports$1.__wbg_new_68651c719dcda04e = function() {
|
|
402
|
-
const ret = /* @__PURE__ */ new Map();
|
|
403
|
-
return addHeapObject2(ret);
|
|
404
|
-
};
|
|
405
|
-
exports$1.__wbg_new_e17d9f43105b08be = function() {
|
|
406
|
-
const ret = new Array();
|
|
407
|
-
return addHeapObject2(ret);
|
|
408
|
-
};
|
|
409
|
-
exports$1.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
410
|
-
return handleError2(function(arg0) {
|
|
411
|
-
const ret = getObject2(arg0).next();
|
|
412
|
-
return addHeapObject2(ret);
|
|
413
|
-
}, arguments);
|
|
414
|
-
};
|
|
415
|
-
exports$1.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
416
|
-
const ret = getObject2(arg0).next;
|
|
417
|
-
return addHeapObject2(ret);
|
|
418
|
-
};
|
|
419
|
-
exports$1.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
420
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm02(arg0, arg1), getObject2(arg2));
|
|
421
|
-
};
|
|
422
|
-
exports$1.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
423
|
-
getObject2(arg0)[takeObject2(arg1)] = takeObject2(arg2);
|
|
424
|
-
};
|
|
425
|
-
exports$1.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
426
|
-
const ret = getObject2(arg0).set(getObject2(arg1), getObject2(arg2));
|
|
427
|
-
return addHeapObject2(ret);
|
|
428
|
-
};
|
|
429
|
-
exports$1.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
430
|
-
getObject2(arg0)[arg1 >>> 0] = takeObject2(arg2);
|
|
431
|
-
};
|
|
432
|
-
exports$1.__wbg_value_692627309814bb8c = function(arg0) {
|
|
433
|
-
const ret = getObject2(arg0).value;
|
|
434
|
-
return addHeapObject2(ret);
|
|
435
|
-
};
|
|
436
|
-
exports$1.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
437
|
-
const ret = getStringFromWasm02(arg0, arg1);
|
|
438
|
-
return addHeapObject2(ret);
|
|
439
|
-
};
|
|
440
|
-
exports$1.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
441
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
442
|
-
return addHeapObject2(ret);
|
|
443
|
-
};
|
|
444
|
-
exports$1.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
445
|
-
const ret = arg0;
|
|
446
|
-
return addHeapObject2(ret);
|
|
447
|
-
};
|
|
448
|
-
exports$1.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
449
|
-
const ret = arg0;
|
|
450
|
-
return addHeapObject2(ret);
|
|
451
|
-
};
|
|
452
|
-
exports$1.__wbindgen_object_clone_ref = function(arg0) {
|
|
453
|
-
const ret = getObject2(arg0);
|
|
454
|
-
return addHeapObject2(ret);
|
|
455
|
-
};
|
|
456
|
-
exports$1.__wbindgen_object_drop_ref = function(arg0) {
|
|
457
|
-
takeObject2(arg0);
|
|
458
|
-
};
|
|
459
|
-
var wasmPath = `${__dirname$1}/kya_os_engine_bg.wasm`;
|
|
460
|
-
var wasmBytes = __require("fs").readFileSync(wasmPath);
|
|
461
|
-
var wasmModule2 = new WebAssembly.Module(wasmBytes);
|
|
462
|
-
var wasm2 = exports$1.__wasm = new WebAssembly.Instance(wasmModule2, imports).exports;
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
// wasm/kya-os-engine-web/kya_os_engine.js
|
|
467
|
-
var kya_os_engine_exports = {};
|
|
468
|
-
__export(kya_os_engine_exports, {
|
|
469
|
-
default: () => kya_os_engine_default,
|
|
470
|
-
initSync: () => initSync,
|
|
471
|
-
verify: () => verify2
|
|
472
|
-
});
|
|
473
|
-
function getUint8ArrayMemory0() {
|
|
474
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
475
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
476
|
-
}
|
|
477
|
-
return cachedUint8ArrayMemory0;
|
|
478
|
-
}
|
|
479
|
-
function decodeText(ptr, len) {
|
|
480
|
-
numBytesDecoded += len;
|
|
481
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
482
|
-
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
483
|
-
cachedTextDecoder.decode();
|
|
484
|
-
numBytesDecoded = len;
|
|
485
|
-
}
|
|
486
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
487
|
-
}
|
|
488
|
-
function getStringFromWasm0(ptr, len) {
|
|
489
|
-
ptr = ptr >>> 0;
|
|
490
|
-
return decodeText(ptr, len);
|
|
491
|
-
}
|
|
492
|
-
function addHeapObject(obj) {
|
|
493
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
494
|
-
const idx = heap_next;
|
|
495
|
-
heap_next = heap[idx];
|
|
496
|
-
heap[idx] = obj;
|
|
497
|
-
return idx;
|
|
498
|
-
}
|
|
499
|
-
function getObject(idx) {
|
|
500
|
-
return heap[idx];
|
|
501
|
-
}
|
|
502
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
503
|
-
if (realloc === void 0) {
|
|
504
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
505
|
-
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
506
|
-
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
507
|
-
WASM_VECTOR_LEN = buf.length;
|
|
508
|
-
return ptr2;
|
|
509
|
-
}
|
|
510
|
-
let len = arg.length;
|
|
511
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
512
|
-
const mem = getUint8ArrayMemory0();
|
|
513
|
-
let offset = 0;
|
|
514
|
-
for (; offset < len; offset++) {
|
|
515
|
-
const code = arg.charCodeAt(offset);
|
|
516
|
-
if (code > 127) break;
|
|
517
|
-
mem[ptr + offset] = code;
|
|
518
|
-
}
|
|
519
|
-
if (offset !== len) {
|
|
520
|
-
if (offset !== 0) {
|
|
521
|
-
arg = arg.slice(offset);
|
|
522
|
-
}
|
|
523
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
524
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
525
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
526
|
-
offset += ret.written;
|
|
527
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
528
|
-
}
|
|
529
|
-
WASM_VECTOR_LEN = offset;
|
|
530
|
-
return ptr;
|
|
531
|
-
}
|
|
532
|
-
function getDataViewMemory0() {
|
|
533
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
534
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
535
|
-
}
|
|
536
|
-
return cachedDataViewMemory0;
|
|
537
|
-
}
|
|
538
|
-
function isLikeNone(x) {
|
|
539
|
-
return x === void 0 || x === null;
|
|
540
|
-
}
|
|
541
|
-
function debugString(val) {
|
|
542
|
-
const type = typeof val;
|
|
543
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
544
|
-
return `${val}`;
|
|
545
|
-
}
|
|
546
|
-
if (type == "string") {
|
|
547
|
-
return `"${val}"`;
|
|
548
|
-
}
|
|
549
|
-
if (type == "symbol") {
|
|
550
|
-
const description = val.description;
|
|
551
|
-
if (description == null) {
|
|
552
|
-
return "Symbol";
|
|
553
|
-
} else {
|
|
554
|
-
return `Symbol(${description})`;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
if (type == "function") {
|
|
558
|
-
const name = val.name;
|
|
559
|
-
if (typeof name == "string" && name.length > 0) {
|
|
560
|
-
return `Function(${name})`;
|
|
561
|
-
} else {
|
|
562
|
-
return "Function";
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
if (Array.isArray(val)) {
|
|
566
|
-
const length = val.length;
|
|
567
|
-
let debug = "[";
|
|
568
|
-
if (length > 0) {
|
|
569
|
-
debug += debugString(val[0]);
|
|
570
|
-
}
|
|
571
|
-
for (let i = 1; i < length; i++) {
|
|
572
|
-
debug += ", " + debugString(val[i]);
|
|
573
|
-
}
|
|
574
|
-
debug += "]";
|
|
575
|
-
return debug;
|
|
576
|
-
}
|
|
577
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
578
|
-
let className;
|
|
579
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
580
|
-
className = builtInMatches[1];
|
|
581
|
-
} else {
|
|
582
|
-
return toString.call(val);
|
|
583
|
-
}
|
|
584
|
-
if (className == "Object") {
|
|
585
|
-
try {
|
|
586
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
587
|
-
} catch (_) {
|
|
588
|
-
return "Object";
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
if (val instanceof Error) {
|
|
592
|
-
return `${val.name}: ${val.message}
|
|
593
|
-
${val.stack}`;
|
|
594
|
-
}
|
|
595
|
-
return className;
|
|
596
|
-
}
|
|
597
|
-
function handleError(f, args) {
|
|
598
|
-
try {
|
|
599
|
-
return f.apply(this, args);
|
|
600
|
-
} catch (e) {
|
|
601
|
-
wasm.__wbindgen_export3(addHeapObject(e));
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
605
|
-
ptr = ptr >>> 0;
|
|
606
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
607
|
-
}
|
|
608
|
-
function dropObject(idx) {
|
|
609
|
-
if (idx < 132) return;
|
|
610
|
-
heap[idx] = heap_next;
|
|
611
|
-
heap_next = idx;
|
|
612
|
-
}
|
|
613
|
-
function takeObject(idx) {
|
|
614
|
-
const ret = getObject(idx);
|
|
615
|
-
dropObject(idx);
|
|
616
|
-
return ret;
|
|
617
|
-
}
|
|
618
|
-
function verify2(input_js, ctx_js) {
|
|
619
|
-
try {
|
|
620
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
621
|
-
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
622
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
623
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
624
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
625
|
-
if (r2) {
|
|
626
|
-
throw takeObject(r1);
|
|
627
|
-
}
|
|
628
|
-
return takeObject(r0);
|
|
629
|
-
} finally {
|
|
630
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
async function __wbg_load(module, imports) {
|
|
634
|
-
if (typeof Response === "function" && module instanceof Response) {
|
|
635
|
-
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
636
|
-
try {
|
|
637
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
638
|
-
} catch (e) {
|
|
639
|
-
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
640
|
-
if (validResponse && module.headers.get("Content-Type") !== "application/wasm") {
|
|
641
|
-
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);
|
|
642
|
-
} else {
|
|
643
|
-
throw e;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
const bytes = await module.arrayBuffer();
|
|
648
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
649
|
-
} else {
|
|
650
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
651
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
652
|
-
return { instance, module };
|
|
653
|
-
} else {
|
|
654
|
-
return instance;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
function __wbg_get_imports() {
|
|
659
|
-
const imports = {};
|
|
660
|
-
imports.wbg = {};
|
|
661
|
-
imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
662
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
663
|
-
return addHeapObject(ret);
|
|
664
|
-
};
|
|
665
|
-
imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
666
|
-
const ret = Number(getObject(arg0));
|
|
667
|
-
return ret;
|
|
668
|
-
};
|
|
669
|
-
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
670
|
-
const ret = String(getObject(arg1));
|
|
671
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
672
|
-
const len1 = WASM_VECTOR_LEN;
|
|
673
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
674
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
675
|
-
};
|
|
676
|
-
imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
677
|
-
const v = getObject(arg1);
|
|
678
|
-
const ret = typeof v === "bigint" ? v : void 0;
|
|
679
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
680
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
681
|
-
};
|
|
682
|
-
imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
683
|
-
const v = getObject(arg0);
|
|
684
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
685
|
-
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
686
|
-
};
|
|
687
|
-
imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
688
|
-
const ret = debugString(getObject(arg1));
|
|
689
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
690
|
-
const len1 = WASM_VECTOR_LEN;
|
|
691
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
692
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
693
|
-
};
|
|
694
|
-
imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
695
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
696
|
-
return ret;
|
|
697
|
-
};
|
|
698
|
-
imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
699
|
-
const ret = typeof getObject(arg0) === "bigint";
|
|
700
|
-
return ret;
|
|
701
|
-
};
|
|
702
|
-
imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
703
|
-
const ret = typeof getObject(arg0) === "function";
|
|
704
|
-
return ret;
|
|
705
|
-
};
|
|
706
|
-
imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
707
|
-
const val = getObject(arg0);
|
|
708
|
-
const ret = typeof val === "object" && val !== null;
|
|
709
|
-
return ret;
|
|
710
|
-
};
|
|
711
|
-
imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
712
|
-
const ret = typeof getObject(arg0) === "string";
|
|
713
|
-
return ret;
|
|
714
|
-
};
|
|
715
|
-
imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
716
|
-
const ret = getObject(arg0) === void 0;
|
|
717
|
-
return ret;
|
|
718
|
-
};
|
|
719
|
-
imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
720
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
721
|
-
return ret;
|
|
722
|
-
};
|
|
723
|
-
imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
724
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
725
|
-
return ret;
|
|
726
|
-
};
|
|
727
|
-
imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
728
|
-
const obj = getObject(arg1);
|
|
729
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
730
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
731
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
732
|
-
};
|
|
733
|
-
imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
734
|
-
const obj = getObject(arg1);
|
|
735
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
736
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
737
|
-
var len1 = WASM_VECTOR_LEN;
|
|
738
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
739
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
740
|
-
};
|
|
741
|
-
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
742
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
743
|
-
};
|
|
744
|
-
imports.wbg.__wbg_call_e762c39fa8ea36bf = function() {
|
|
745
|
-
return handleError(function(arg0, arg1) {
|
|
746
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
747
|
-
return addHeapObject(ret);
|
|
748
|
-
}, arguments);
|
|
749
|
-
};
|
|
750
|
-
imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
751
|
-
const ret = getObject(arg0).done;
|
|
752
|
-
return ret;
|
|
753
|
-
};
|
|
754
|
-
imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
755
|
-
const ret = Object.entries(getObject(arg0));
|
|
756
|
-
return addHeapObject(ret);
|
|
757
|
-
};
|
|
758
|
-
imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
759
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
760
|
-
return addHeapObject(ret);
|
|
761
|
-
};
|
|
762
|
-
imports.wbg.__wbg_get_efcb449f58ec27c2 = function() {
|
|
763
|
-
return handleError(function(arg0, arg1) {
|
|
764
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
765
|
-
return addHeapObject(ret);
|
|
766
|
-
}, arguments);
|
|
767
|
-
};
|
|
768
|
-
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
769
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
770
|
-
return addHeapObject(ret);
|
|
771
|
-
};
|
|
772
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
773
|
-
let result;
|
|
774
|
-
try {
|
|
775
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
776
|
-
} catch (_) {
|
|
777
|
-
result = false;
|
|
778
|
-
}
|
|
779
|
-
const ret = result;
|
|
780
|
-
return ret;
|
|
781
|
-
};
|
|
782
|
-
imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
783
|
-
let result;
|
|
784
|
-
try {
|
|
785
|
-
result = getObject(arg0) instanceof Map;
|
|
786
|
-
} catch (_) {
|
|
787
|
-
result = false;
|
|
788
|
-
}
|
|
789
|
-
const ret = result;
|
|
790
|
-
return ret;
|
|
791
|
-
};
|
|
792
|
-
imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
793
|
-
let result;
|
|
794
|
-
try {
|
|
795
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
796
|
-
} catch (_) {
|
|
797
|
-
result = false;
|
|
798
|
-
}
|
|
799
|
-
const ret = result;
|
|
800
|
-
return ret;
|
|
801
|
-
};
|
|
802
|
-
imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
803
|
-
const ret = Array.isArray(getObject(arg0));
|
|
804
|
-
return ret;
|
|
805
|
-
};
|
|
806
|
-
imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
807
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
808
|
-
return ret;
|
|
809
|
-
};
|
|
810
|
-
imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
|
|
811
|
-
const ret = Symbol.iterator;
|
|
812
|
-
return addHeapObject(ret);
|
|
813
|
-
};
|
|
814
|
-
imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
815
|
-
const ret = getObject(arg0).length;
|
|
816
|
-
return ret;
|
|
817
|
-
};
|
|
818
|
-
imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
819
|
-
const ret = getObject(arg0).length;
|
|
820
|
-
return ret;
|
|
821
|
-
};
|
|
822
|
-
imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
|
|
823
|
-
const ret = new Object();
|
|
824
|
-
return addHeapObject(ret);
|
|
825
|
-
};
|
|
826
|
-
imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
827
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
828
|
-
return addHeapObject(ret);
|
|
829
|
-
};
|
|
830
|
-
imports.wbg.__wbg_new_68651c719dcda04e = function() {
|
|
831
|
-
const ret = /* @__PURE__ */ new Map();
|
|
832
|
-
return addHeapObject(ret);
|
|
833
|
-
};
|
|
834
|
-
imports.wbg.__wbg_new_e17d9f43105b08be = function() {
|
|
835
|
-
const ret = new Array();
|
|
836
|
-
return addHeapObject(ret);
|
|
837
|
-
};
|
|
838
|
-
imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
839
|
-
return handleError(function(arg0) {
|
|
840
|
-
const ret = getObject(arg0).next();
|
|
841
|
-
return addHeapObject(ret);
|
|
842
|
-
}, arguments);
|
|
843
|
-
};
|
|
844
|
-
imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
845
|
-
const ret = getObject(arg0).next;
|
|
846
|
-
return addHeapObject(ret);
|
|
847
|
-
};
|
|
848
|
-
imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
849
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
850
|
-
};
|
|
851
|
-
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
852
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
853
|
-
};
|
|
854
|
-
imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
855
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
856
|
-
return addHeapObject(ret);
|
|
857
|
-
};
|
|
858
|
-
imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
859
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
860
|
-
};
|
|
861
|
-
imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
|
|
862
|
-
const ret = getObject(arg0).value;
|
|
863
|
-
return addHeapObject(ret);
|
|
864
|
-
};
|
|
865
|
-
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
866
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
867
|
-
return addHeapObject(ret);
|
|
868
|
-
};
|
|
869
|
-
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
870
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
871
|
-
return addHeapObject(ret);
|
|
872
|
-
};
|
|
873
|
-
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
874
|
-
const ret = arg0;
|
|
875
|
-
return addHeapObject(ret);
|
|
876
|
-
};
|
|
877
|
-
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
878
|
-
const ret = arg0;
|
|
879
|
-
return addHeapObject(ret);
|
|
880
|
-
};
|
|
881
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
882
|
-
const ret = getObject(arg0);
|
|
883
|
-
return addHeapObject(ret);
|
|
884
|
-
};
|
|
885
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
886
|
-
takeObject(arg0);
|
|
887
|
-
};
|
|
888
|
-
return imports;
|
|
889
|
-
}
|
|
890
|
-
function __wbg_finalize_init(instance, module) {
|
|
891
|
-
wasm = instance.exports;
|
|
892
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
893
|
-
cachedDataViewMemory0 = null;
|
|
894
|
-
cachedUint8ArrayMemory0 = null;
|
|
895
|
-
return wasm;
|
|
896
|
-
}
|
|
897
|
-
function initSync(module) {
|
|
898
|
-
if (wasm !== void 0) return wasm;
|
|
899
|
-
if (typeof module !== "undefined") {
|
|
900
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
901
|
-
({ module } = module);
|
|
902
|
-
} else {
|
|
903
|
-
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
const imports = __wbg_get_imports();
|
|
907
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
908
|
-
module = new WebAssembly.Module(module);
|
|
909
|
-
}
|
|
910
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
911
|
-
return __wbg_finalize_init(instance, module);
|
|
912
|
-
}
|
|
913
|
-
async function __wbg_init(module_or_path) {
|
|
914
|
-
if (wasm !== void 0) return wasm;
|
|
915
|
-
if (typeof module_or_path !== "undefined") {
|
|
916
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
917
|
-
({ module_or_path } = module_or_path);
|
|
918
|
-
} else {
|
|
919
|
-
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
if (typeof module_or_path === "undefined") {
|
|
923
|
-
module_or_path = new URL("kya_os_engine_bg.wasm", import.meta.url);
|
|
924
|
-
}
|
|
925
|
-
const imports = __wbg_get_imports();
|
|
926
|
-
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
927
|
-
module_or_path = fetch(module_or_path);
|
|
928
|
-
}
|
|
929
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
930
|
-
return __wbg_finalize_init(instance, module);
|
|
3
|
+
// src/engine/index.ts
|
|
4
|
+
function engineVerify(input, ctx) {
|
|
5
|
+
return verify(input, ctx);
|
|
931
6
|
}
|
|
932
|
-
var wasm, cachedUint8ArrayMemory0, cachedTextDecoder, MAX_SAFARI_DECODE_BYTES, numBytesDecoded, heap, heap_next, WASM_VECTOR_LEN, cachedTextEncoder, cachedDataViewMemory0, EXPECTED_RESPONSE_TYPES, kya_os_engine_default;
|
|
933
|
-
var init_kya_os_engine = __esm({
|
|
934
|
-
"wasm/kya-os-engine-web/kya_os_engine.js"() {
|
|
935
|
-
init_esm_shims();
|
|
936
|
-
cachedUint8ArrayMemory0 = null;
|
|
937
|
-
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
938
|
-
cachedTextDecoder.decode();
|
|
939
|
-
MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
940
|
-
numBytesDecoded = 0;
|
|
941
|
-
heap = new Array(128).fill(void 0);
|
|
942
|
-
heap.push(void 0, null, true, false);
|
|
943
|
-
heap_next = heap.length;
|
|
944
|
-
WASM_VECTOR_LEN = 0;
|
|
945
|
-
cachedTextEncoder = new TextEncoder();
|
|
946
|
-
if (!("encodeInto" in cachedTextEncoder)) {
|
|
947
|
-
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
948
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
949
|
-
view.set(buf);
|
|
950
|
-
return {
|
|
951
|
-
read: arg.length,
|
|
952
|
-
written: buf.length
|
|
953
|
-
};
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
cachedDataViewMemory0 = null;
|
|
957
|
-
EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
|
|
958
|
-
kya_os_engine_default = __wbg_init;
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
|
|
962
|
-
// src/engine/orchestrator/index.ts
|
|
963
|
-
init_esm_shims();
|
|
964
|
-
|
|
965
|
-
// src/engine/orchestrator/verify-request.ts
|
|
966
|
-
init_esm_shims();
|
|
967
7
|
|
|
968
8
|
// src/engine/adapters/outbound-url-policy.ts
|
|
969
|
-
init_esm_shims();
|
|
970
9
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
|
|
971
10
|
var UnsafeOutboundUrl = class extends Error {
|
|
972
11
|
kind = "UnsafeOutboundUrl";
|
|
@@ -1041,19 +80,7 @@ function isBlockedIpv6(hostname) {
|
|
|
1041
80
|
(firstSegment & 65280) === 65280;
|
|
1042
81
|
}
|
|
1043
82
|
|
|
1044
|
-
// src/engine/index.ts
|
|
1045
|
-
init_esm_shims();
|
|
1046
|
-
var wasmModule = __toESM(require_kya_os_engine());
|
|
1047
|
-
function engineVerify(input, ctx) {
|
|
1048
|
-
const verify3 = wasmModule.verify;
|
|
1049
|
-
return verify3(input, ctx);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
// src/engine/orchestrator/build-agent-request.ts
|
|
1053
|
-
init_esm_shims();
|
|
1054
|
-
|
|
1055
83
|
// src/engine/adapters/util.ts
|
|
1056
|
-
init_esm_shims();
|
|
1057
84
|
function base64UrlDecode(input) {
|
|
1058
85
|
const padded = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
1059
86
|
const padding = padded.length % 4 === 0 ? "" : "=".repeat(4 - padded.length % 4);
|
|
@@ -1247,7 +274,6 @@ function bodyAsBytes(body) {
|
|
|
1247
274
|
}
|
|
1248
275
|
|
|
1249
276
|
// src/engine/orchestrator/synthetic-results.ts
|
|
1250
|
-
init_esm_shims();
|
|
1251
277
|
function hostSynthesizedEngineInfo() {
|
|
1252
278
|
return {
|
|
1253
279
|
name: "checkpoint-engine-wasm",
|
|
@@ -1275,23 +301,27 @@ function parseErrorDetectionDetail(detail) {
|
|
|
1275
301
|
|
|
1276
302
|
// src/engine/orchestrator/verify-request.ts
|
|
1277
303
|
var DEFAULT_REPUTATION_BASELINE = 1;
|
|
1278
|
-
function
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
304
|
+
function createVerifyRequestApi(defaultEngine) {
|
|
305
|
+
function verifyRequest2(req, opts) {
|
|
306
|
+
return verifyRequest_internal(req, opts, opts.engineVerifyFn ?? defaultEngine);
|
|
307
|
+
}
|
|
308
|
+
function makeVerifyRequest2(opts) {
|
|
309
|
+
let argusWarningLogged = false;
|
|
310
|
+
const log = opts.logger ?? defaultLogger;
|
|
311
|
+
const engine = opts.engineVerifyFn ?? defaultEngine;
|
|
312
|
+
return async function verifyRequest3(req) {
|
|
313
|
+
if (!argusWarningLogged && !opts.argusUrl) {
|
|
314
|
+
log(
|
|
315
|
+
'[Checkpoint] WARNING: Argus URL not configured; reputation will degrade to baseline 1.0 ("trust by default"). Set ARGUS_API_URL to enable.'
|
|
316
|
+
);
|
|
317
|
+
argusWarningLogged = true;
|
|
318
|
+
}
|
|
319
|
+
return verifyRequest_internal(req, opts, engine);
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return { verifyRequest: verifyRequest2, makeVerifyRequest: makeVerifyRequest2 };
|
|
1293
323
|
}
|
|
1294
|
-
async function verifyRequest_internal(req, opts) {
|
|
324
|
+
async function verifyRequest_internal(req, opts, engineVerify2) {
|
|
1295
325
|
if (hasMalformedJwsBody(req)) {
|
|
1296
326
|
return blockWithParseError("malformed JWS body", opts.enforcementMode);
|
|
1297
327
|
}
|
|
@@ -1338,9 +368,10 @@ async function verifyRequest_internal(req, opts) {
|
|
|
1338
368
|
reputation: agentDid ? { [agentDid]: repScore } : {},
|
|
1339
369
|
tenantDecision,
|
|
1340
370
|
nowUnix: opts.clock.nowUnix(),
|
|
1341
|
-
enforcementMode: opts.enforcementMode
|
|
371
|
+
enforcementMode: opts.enforcementMode,
|
|
372
|
+
...opts.engineConfig ? { config: opts.engineConfig } : {}
|
|
1342
373
|
};
|
|
1343
|
-
return
|
|
374
|
+
return engineVerify2(agentRequest, ctx);
|
|
1344
375
|
}
|
|
1345
376
|
async function fetchCredentialStatus(credentialStatusUrl, statusListCache) {
|
|
1346
377
|
assertSafeHttpsUrl(credentialStatusUrl, "credential status URL");
|
|
@@ -1369,11 +400,7 @@ function defaultLogger(msg) {
|
|
|
1369
400
|
console.warn(msg);
|
|
1370
401
|
}
|
|
1371
402
|
|
|
1372
|
-
// src/engine/orchestrator/verify-request-edge.ts
|
|
1373
|
-
init_esm_shims();
|
|
1374
|
-
|
|
1375
403
|
// src/engine/edge.ts
|
|
1376
|
-
init_esm_shims();
|
|
1377
404
|
var initialised = null;
|
|
1378
405
|
function initEngineEdge(moduleOrPath) {
|
|
1379
406
|
return ensureReady(moduleOrPath).then(() => void 0);
|
|
@@ -1381,7 +408,7 @@ function initEngineEdge(moduleOrPath) {
|
|
|
1381
408
|
function ensureReady(moduleOrPath) {
|
|
1382
409
|
if (initialised) return initialised;
|
|
1383
410
|
const pending = (async () => {
|
|
1384
|
-
const mod = await
|
|
411
|
+
const mod = await import('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine.js');
|
|
1385
412
|
await mod.default(moduleOrPath !== void 0 ? { module_or_path: moduleOrPath } : void 0);
|
|
1386
413
|
return mod.verify;
|
|
1387
414
|
})();
|
|
@@ -1394,12 +421,11 @@ function ensureReady(moduleOrPath) {
|
|
|
1394
421
|
return initialised;
|
|
1395
422
|
}
|
|
1396
423
|
async function engineVerifyEdge(input, ctx) {
|
|
1397
|
-
const
|
|
1398
|
-
return
|
|
424
|
+
const verify = await ensureReady();
|
|
425
|
+
return verify(input, ctx);
|
|
1399
426
|
}
|
|
1400
427
|
|
|
1401
428
|
// src/engine/orchestrator/render-decision.ts
|
|
1402
|
-
init_esm_shims();
|
|
1403
429
|
function renderDecisionAsResponse(result) {
|
|
1404
430
|
const baseHeaders = buildBaseHeaders(result);
|
|
1405
431
|
if (result.enforcementMode === "observe") {
|
|
@@ -1627,7 +653,8 @@ async function verifyRequestEdge_internal(req, opts) {
|
|
|
1627
653
|
reputation: agentDid ? { [agentDid]: repScore } : {},
|
|
1628
654
|
tenantDecision,
|
|
1629
655
|
nowUnix: opts.clock.nowUnix(),
|
|
1630
|
-
enforcementMode: opts.enforcementMode
|
|
656
|
+
enforcementMode: opts.enforcementMode,
|
|
657
|
+
...opts.engineConfig ? { config: opts.engineConfig } : {}
|
|
1631
658
|
};
|
|
1632
659
|
return engineVerifyEdge(agentRequest, ctx);
|
|
1633
660
|
}
|
|
@@ -1658,4 +685,9 @@ function defaultLogger2(msg) {
|
|
|
1658
685
|
console.warn(msg);
|
|
1659
686
|
}
|
|
1660
687
|
|
|
688
|
+
// src/engine/orchestrator/index.ts
|
|
689
|
+
var bundlerApi = createVerifyRequestApi(engineVerify);
|
|
690
|
+
var verifyRequest = bundlerApi.verifyRequest;
|
|
691
|
+
var makeVerifyRequest = bundlerApi.makeVerifyRequest;
|
|
692
|
+
|
|
1661
693
|
export { buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody, initEngineEdge, makeVerifyRequest, makeVerifyRequestEdge, renderDecisionAsResponse, verifyRequest, verifyRequestEdge };
|