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