@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
|
@@ -1,4 +1,470 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __esm = (fn, res) => function __init() {
|
|
17
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
18
|
+
};
|
|
19
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
20
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
21
|
+
};
|
|
22
|
+
var __copyProps = (to, from, except, desc) => {
|
|
23
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
+
for (let key of __getOwnPropNames(from))
|
|
25
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
+
}
|
|
28
|
+
return to;
|
|
29
|
+
};
|
|
30
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
31
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
32
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
33
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
34
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
35
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
36
|
+
mod
|
|
37
|
+
));
|
|
38
|
+
var getFilename, getDirname, __dirname$1;
|
|
39
|
+
var init_esm_shims = __esm({
|
|
40
|
+
"../../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"() {
|
|
41
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
42
|
+
getDirname = () => path.dirname(getFilename());
|
|
43
|
+
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// wasm/kya-os-engine/kya_os_engine.js
|
|
48
|
+
var require_kya_os_engine = __commonJS({
|
|
49
|
+
"wasm/kya-os-engine/kya_os_engine.js"(exports$1, module) {
|
|
50
|
+
init_esm_shims();
|
|
51
|
+
var imports = {};
|
|
52
|
+
imports["__wbindgen_placeholder__"] = module.exports;
|
|
53
|
+
var cachedUint8ArrayMemory0 = null;
|
|
54
|
+
function getUint8ArrayMemory0() {
|
|
55
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
56
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
57
|
+
}
|
|
58
|
+
return cachedUint8ArrayMemory0;
|
|
59
|
+
}
|
|
60
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
61
|
+
cachedTextDecoder.decode();
|
|
62
|
+
function decodeText(ptr, len) {
|
|
63
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
64
|
+
}
|
|
65
|
+
function getStringFromWasm0(ptr, len) {
|
|
66
|
+
ptr = ptr >>> 0;
|
|
67
|
+
return decodeText(ptr, len);
|
|
68
|
+
}
|
|
69
|
+
var heap = new Array(128).fill(void 0);
|
|
70
|
+
heap.push(void 0, null, true, false);
|
|
71
|
+
var heap_next = heap.length;
|
|
72
|
+
function addHeapObject(obj) {
|
|
73
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
74
|
+
const idx = heap_next;
|
|
75
|
+
heap_next = heap[idx];
|
|
76
|
+
heap[idx] = obj;
|
|
77
|
+
return idx;
|
|
78
|
+
}
|
|
79
|
+
function getObject(idx) {
|
|
80
|
+
return heap[idx];
|
|
81
|
+
}
|
|
82
|
+
var WASM_VECTOR_LEN = 0;
|
|
83
|
+
var cachedTextEncoder = new TextEncoder();
|
|
84
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
85
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
86
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
87
|
+
view.set(buf);
|
|
88
|
+
return {
|
|
89
|
+
read: arg.length,
|
|
90
|
+
written: buf.length
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
95
|
+
if (realloc === void 0) {
|
|
96
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
97
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
98
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
99
|
+
WASM_VECTOR_LEN = buf.length;
|
|
100
|
+
return ptr2;
|
|
101
|
+
}
|
|
102
|
+
let len = arg.length;
|
|
103
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
104
|
+
const mem = getUint8ArrayMemory0();
|
|
105
|
+
let offset = 0;
|
|
106
|
+
for (; offset < len; offset++) {
|
|
107
|
+
const code = arg.charCodeAt(offset);
|
|
108
|
+
if (code > 127) break;
|
|
109
|
+
mem[ptr + offset] = code;
|
|
110
|
+
}
|
|
111
|
+
if (offset !== len) {
|
|
112
|
+
if (offset !== 0) {
|
|
113
|
+
arg = arg.slice(offset);
|
|
114
|
+
}
|
|
115
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
116
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
117
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
118
|
+
offset += ret.written;
|
|
119
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
120
|
+
}
|
|
121
|
+
WASM_VECTOR_LEN = offset;
|
|
122
|
+
return ptr;
|
|
123
|
+
}
|
|
124
|
+
var cachedDataViewMemory0 = null;
|
|
125
|
+
function getDataViewMemory0() {
|
|
126
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
127
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
128
|
+
}
|
|
129
|
+
return cachedDataViewMemory0;
|
|
130
|
+
}
|
|
131
|
+
function isLikeNone(x) {
|
|
132
|
+
return x === void 0 || x === null;
|
|
133
|
+
}
|
|
134
|
+
function debugString(val) {
|
|
135
|
+
const type = typeof val;
|
|
136
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
137
|
+
return `${val}`;
|
|
138
|
+
}
|
|
139
|
+
if (type == "string") {
|
|
140
|
+
return `"${val}"`;
|
|
141
|
+
}
|
|
142
|
+
if (type == "symbol") {
|
|
143
|
+
const description = val.description;
|
|
144
|
+
if (description == null) {
|
|
145
|
+
return "Symbol";
|
|
146
|
+
} else {
|
|
147
|
+
return `Symbol(${description})`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (type == "function") {
|
|
151
|
+
const name = val.name;
|
|
152
|
+
if (typeof name == "string" && name.length > 0) {
|
|
153
|
+
return `Function(${name})`;
|
|
154
|
+
} else {
|
|
155
|
+
return "Function";
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (Array.isArray(val)) {
|
|
159
|
+
const length = val.length;
|
|
160
|
+
let debug = "[";
|
|
161
|
+
if (length > 0) {
|
|
162
|
+
debug += debugString(val[0]);
|
|
163
|
+
}
|
|
164
|
+
for (let i = 1; i < length; i++) {
|
|
165
|
+
debug += ", " + debugString(val[i]);
|
|
166
|
+
}
|
|
167
|
+
debug += "]";
|
|
168
|
+
return debug;
|
|
169
|
+
}
|
|
170
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
171
|
+
let className;
|
|
172
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
173
|
+
className = builtInMatches[1];
|
|
174
|
+
} else {
|
|
175
|
+
return toString.call(val);
|
|
176
|
+
}
|
|
177
|
+
if (className == "Object") {
|
|
178
|
+
try {
|
|
179
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
180
|
+
} catch (_) {
|
|
181
|
+
return "Object";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (val instanceof Error) {
|
|
185
|
+
return `${val.name}: ${val.message}
|
|
186
|
+
${val.stack}`;
|
|
187
|
+
}
|
|
188
|
+
return className;
|
|
189
|
+
}
|
|
190
|
+
function handleError(f, args) {
|
|
191
|
+
try {
|
|
192
|
+
return f.apply(this, args);
|
|
193
|
+
} catch (e) {
|
|
194
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
198
|
+
ptr = ptr >>> 0;
|
|
199
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
200
|
+
}
|
|
201
|
+
function dropObject(idx) {
|
|
202
|
+
if (idx < 132) return;
|
|
203
|
+
heap[idx] = heap_next;
|
|
204
|
+
heap_next = idx;
|
|
205
|
+
}
|
|
206
|
+
function takeObject(idx) {
|
|
207
|
+
const ret = getObject(idx);
|
|
208
|
+
dropObject(idx);
|
|
209
|
+
return ret;
|
|
210
|
+
}
|
|
211
|
+
exports$1.verify = function(input_js, ctx_js) {
|
|
212
|
+
try {
|
|
213
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
214
|
+
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
215
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
216
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
217
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
218
|
+
if (r2) {
|
|
219
|
+
throw takeObject(r1);
|
|
220
|
+
}
|
|
221
|
+
return takeObject(r0);
|
|
222
|
+
} finally {
|
|
223
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
exports$1.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
227
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
228
|
+
return addHeapObject(ret);
|
|
229
|
+
};
|
|
230
|
+
exports$1.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
231
|
+
const ret = Number(getObject(arg0));
|
|
232
|
+
return ret;
|
|
233
|
+
};
|
|
234
|
+
exports$1.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
235
|
+
const ret = String(getObject(arg1));
|
|
236
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
237
|
+
const len1 = WASM_VECTOR_LEN;
|
|
238
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
239
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
240
|
+
};
|
|
241
|
+
exports$1.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
242
|
+
const v = getObject(arg1);
|
|
243
|
+
const ret = typeof v === "bigint" ? v : void 0;
|
|
244
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
245
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
246
|
+
};
|
|
247
|
+
exports$1.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
248
|
+
const v = getObject(arg0);
|
|
249
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
250
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
251
|
+
};
|
|
252
|
+
exports$1.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
253
|
+
const ret = debugString(getObject(arg1));
|
|
254
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
255
|
+
const len1 = WASM_VECTOR_LEN;
|
|
256
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
257
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
258
|
+
};
|
|
259
|
+
exports$1.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
260
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
261
|
+
return ret;
|
|
262
|
+
};
|
|
263
|
+
exports$1.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
264
|
+
const ret = typeof getObject(arg0) === "bigint";
|
|
265
|
+
return ret;
|
|
266
|
+
};
|
|
267
|
+
exports$1.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
268
|
+
const ret = typeof getObject(arg0) === "function";
|
|
269
|
+
return ret;
|
|
270
|
+
};
|
|
271
|
+
exports$1.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
272
|
+
const val = getObject(arg0);
|
|
273
|
+
const ret = typeof val === "object" && val !== null;
|
|
274
|
+
return ret;
|
|
275
|
+
};
|
|
276
|
+
exports$1.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
277
|
+
const ret = typeof getObject(arg0) === "string";
|
|
278
|
+
return ret;
|
|
279
|
+
};
|
|
280
|
+
exports$1.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
281
|
+
const ret = getObject(arg0) === void 0;
|
|
282
|
+
return ret;
|
|
283
|
+
};
|
|
284
|
+
exports$1.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
285
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
286
|
+
return ret;
|
|
287
|
+
};
|
|
288
|
+
exports$1.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
289
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
290
|
+
return ret;
|
|
291
|
+
};
|
|
292
|
+
exports$1.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
293
|
+
const obj = getObject(arg1);
|
|
294
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
295
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
296
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
297
|
+
};
|
|
298
|
+
exports$1.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
299
|
+
const obj = getObject(arg1);
|
|
300
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
301
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
302
|
+
var len1 = WASM_VECTOR_LEN;
|
|
303
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
304
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
305
|
+
};
|
|
306
|
+
exports$1.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
307
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
308
|
+
};
|
|
309
|
+
exports$1.__wbg_call_e762c39fa8ea36bf = function() {
|
|
310
|
+
return handleError(function(arg0, arg1) {
|
|
311
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
312
|
+
return addHeapObject(ret);
|
|
313
|
+
}, arguments);
|
|
314
|
+
};
|
|
315
|
+
exports$1.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
316
|
+
const ret = getObject(arg0).done;
|
|
317
|
+
return ret;
|
|
318
|
+
};
|
|
319
|
+
exports$1.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
320
|
+
const ret = Object.entries(getObject(arg0));
|
|
321
|
+
return addHeapObject(ret);
|
|
322
|
+
};
|
|
323
|
+
exports$1.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
324
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
325
|
+
return addHeapObject(ret);
|
|
326
|
+
};
|
|
327
|
+
exports$1.__wbg_get_efcb449f58ec27c2 = function() {
|
|
328
|
+
return handleError(function(arg0, arg1) {
|
|
329
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
330
|
+
return addHeapObject(ret);
|
|
331
|
+
}, arguments);
|
|
332
|
+
};
|
|
333
|
+
exports$1.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
334
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
335
|
+
return addHeapObject(ret);
|
|
336
|
+
};
|
|
337
|
+
exports$1.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
338
|
+
let result;
|
|
339
|
+
try {
|
|
340
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
341
|
+
} catch (_) {
|
|
342
|
+
result = false;
|
|
343
|
+
}
|
|
344
|
+
const ret = result;
|
|
345
|
+
return ret;
|
|
346
|
+
};
|
|
347
|
+
exports$1.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
348
|
+
let result;
|
|
349
|
+
try {
|
|
350
|
+
result = getObject(arg0) instanceof Map;
|
|
351
|
+
} catch (_) {
|
|
352
|
+
result = false;
|
|
353
|
+
}
|
|
354
|
+
const ret = result;
|
|
355
|
+
return ret;
|
|
356
|
+
};
|
|
357
|
+
exports$1.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
358
|
+
let result;
|
|
359
|
+
try {
|
|
360
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
361
|
+
} catch (_) {
|
|
362
|
+
result = false;
|
|
363
|
+
}
|
|
364
|
+
const ret = result;
|
|
365
|
+
return ret;
|
|
366
|
+
};
|
|
367
|
+
exports$1.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
368
|
+
const ret = Array.isArray(getObject(arg0));
|
|
369
|
+
return ret;
|
|
370
|
+
};
|
|
371
|
+
exports$1.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
372
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
373
|
+
return ret;
|
|
374
|
+
};
|
|
375
|
+
exports$1.__wbg_iterator_e5822695327a3c39 = function() {
|
|
376
|
+
const ret = Symbol.iterator;
|
|
377
|
+
return addHeapObject(ret);
|
|
378
|
+
};
|
|
379
|
+
exports$1.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
380
|
+
const ret = getObject(arg0).length;
|
|
381
|
+
return ret;
|
|
382
|
+
};
|
|
383
|
+
exports$1.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
384
|
+
const ret = getObject(arg0).length;
|
|
385
|
+
return ret;
|
|
386
|
+
};
|
|
387
|
+
exports$1.__wbg_new_1acc0b6eea89d040 = function() {
|
|
388
|
+
const ret = new Object();
|
|
389
|
+
return addHeapObject(ret);
|
|
390
|
+
};
|
|
391
|
+
exports$1.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
392
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
393
|
+
return addHeapObject(ret);
|
|
394
|
+
};
|
|
395
|
+
exports$1.__wbg_new_68651c719dcda04e = function() {
|
|
396
|
+
const ret = /* @__PURE__ */ new Map();
|
|
397
|
+
return addHeapObject(ret);
|
|
398
|
+
};
|
|
399
|
+
exports$1.__wbg_new_e17d9f43105b08be = function() {
|
|
400
|
+
const ret = new Array();
|
|
401
|
+
return addHeapObject(ret);
|
|
402
|
+
};
|
|
403
|
+
exports$1.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
404
|
+
return handleError(function(arg0) {
|
|
405
|
+
const ret = getObject(arg0).next();
|
|
406
|
+
return addHeapObject(ret);
|
|
407
|
+
}, arguments);
|
|
408
|
+
};
|
|
409
|
+
exports$1.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
410
|
+
const ret = getObject(arg0).next;
|
|
411
|
+
return addHeapObject(ret);
|
|
412
|
+
};
|
|
413
|
+
exports$1.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
414
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
415
|
+
};
|
|
416
|
+
exports$1.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
417
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
418
|
+
};
|
|
419
|
+
exports$1.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
420
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
421
|
+
return addHeapObject(ret);
|
|
422
|
+
};
|
|
423
|
+
exports$1.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
424
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
425
|
+
};
|
|
426
|
+
exports$1.__wbg_value_692627309814bb8c = function(arg0) {
|
|
427
|
+
const ret = getObject(arg0).value;
|
|
428
|
+
return addHeapObject(ret);
|
|
429
|
+
};
|
|
430
|
+
exports$1.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
431
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
432
|
+
return addHeapObject(ret);
|
|
433
|
+
};
|
|
434
|
+
exports$1.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
435
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
436
|
+
return addHeapObject(ret);
|
|
437
|
+
};
|
|
438
|
+
exports$1.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
439
|
+
const ret = arg0;
|
|
440
|
+
return addHeapObject(ret);
|
|
441
|
+
};
|
|
442
|
+
exports$1.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
443
|
+
const ret = arg0;
|
|
444
|
+
return addHeapObject(ret);
|
|
445
|
+
};
|
|
446
|
+
exports$1.__wbindgen_object_clone_ref = function(arg0) {
|
|
447
|
+
const ret = getObject(arg0);
|
|
448
|
+
return addHeapObject(ret);
|
|
449
|
+
};
|
|
450
|
+
exports$1.__wbindgen_object_drop_ref = function(arg0) {
|
|
451
|
+
takeObject(arg0);
|
|
452
|
+
};
|
|
453
|
+
var wasmPath = `${__dirname$1}/kya_os_engine_bg.wasm`;
|
|
454
|
+
var wasmBytes = __require("fs").readFileSync(wasmPath);
|
|
455
|
+
var wasmModule2 = new WebAssembly.Module(wasmBytes);
|
|
456
|
+
var wasm = exports$1.__wasm = new WebAssembly.Instance(wasmModule2, imports).exports;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// src/engine/orchestrator/node.ts
|
|
461
|
+
init_esm_shims();
|
|
462
|
+
|
|
463
|
+
// src/engine/orchestrator/verify-request.ts
|
|
464
|
+
init_esm_shims();
|
|
465
|
+
|
|
1
466
|
// src/engine/adapters/outbound-url-policy.ts
|
|
467
|
+
init_esm_shims();
|
|
2
468
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
|
|
3
469
|
var UnsafeOutboundUrl = class extends Error {
|
|
4
470
|
kind = "UnsafeOutboundUrl";
|
|
@@ -74,12 +540,18 @@ function isBlockedIpv6(hostname) {
|
|
|
74
540
|
}
|
|
75
541
|
|
|
76
542
|
// src/engine/index.ts
|
|
543
|
+
init_esm_shims();
|
|
544
|
+
var wasmModule = __toESM(require_kya_os_engine());
|
|
77
545
|
function engineVerify(input, ctx) {
|
|
78
|
-
const
|
|
79
|
-
return
|
|
546
|
+
const verify2 = wasmModule.verify;
|
|
547
|
+
return verify2(input, ctx);
|
|
80
548
|
}
|
|
81
549
|
|
|
550
|
+
// src/engine/orchestrator/build-agent-request.ts
|
|
551
|
+
init_esm_shims();
|
|
552
|
+
|
|
82
553
|
// src/engine/adapters/util.ts
|
|
554
|
+
init_esm_shims();
|
|
83
555
|
function base64UrlDecode(input) {
|
|
84
556
|
const padded = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
85
557
|
const padding = padded.length % 4 === 0 ? "" : "=".repeat(4 - padded.length % 4);
|
|
@@ -374,6 +846,7 @@ function defaultLogger(msg) {
|
|
|
374
846
|
}
|
|
375
847
|
|
|
376
848
|
// src/engine/orchestrator/render-decision.ts
|
|
849
|
+
init_esm_shims();
|
|
377
850
|
function renderDecisionAsResponse(result) {
|
|
378
851
|
const baseHeaders = buildBaseHeaders(result);
|
|
379
852
|
if (result.enforcementMode === "observe") {
|
package/dist/orchestrator.d.mts
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { initEngineEdge } from './engine-edge.mjs';
|
|
5
|
-
import './types-D0j85fF0.mjs';
|
|
1
|
+
import { VerifyRequestOpts, IncomingHttpLike } from './orchestrator-node.mjs';
|
|
2
|
+
export { BuildAgentRequestOpts, RenderedResponse, buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody, makeVerifyRequest, renderDecisionAsResponse, verifyRequest } from './orchestrator-node.mjs';
|
|
3
|
+
import { V as VerifyResult } from './types-D0j85fF0.mjs';
|
|
6
4
|
import '@kya-os/checkpoint-shared';
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `kya-os-engine` WASM bridge for edge runtimes — Edge-WASM-1.
|
|
8
|
+
*
|
|
9
|
+
* The Node target (`./index.ts`) uses `fs.readFileSync` at module
|
|
10
|
+
* load and exposes a sync `engineVerify`. That's incompatible with
|
|
11
|
+
* Vercel Edge / Cloudflare Workers / browser embedding (no `fs`,
|
|
12
|
+
* no sync wasm load).
|
|
13
|
+
*
|
|
14
|
+
* This module loads the `wasm-pack --target web` artifact via the
|
|
15
|
+
* async `__wbg_init` default export, then exposes the same typed
|
|
16
|
+
* `engineVerifyEdge(input, ctx) → Promise<VerifyResult>` shape with
|
|
17
|
+
* a small lazy-init wrapper. First call awaits initialisation;
|
|
18
|
+
* subsequent calls resolve synchronously on the JS side (the
|
|
19
|
+
* underlying wasm `verify` is sync).
|
|
20
|
+
*
|
|
21
|
+
* **Why this matters for the consolidation narrative.** Phase A
|
|
22
|
+
* shipped Node-only. Without an edge build, the first Vercel-edge
|
|
23
|
+
* or Cloudflare-Workers deployment after Phase D would hit the
|
|
24
|
+
* same wasm-bindgen-on-edge wall the Sites-1 F3 workaround was
|
|
25
|
+
* created to dodge — and someone would re-introduce the
|
|
26
|
+
* inline-TS detector that Q10 ratified deleting. Shipping the
|
|
27
|
+
* edge target alongside the Node target keeps Phase D's
|
|
28
|
+
* deletion narrative durable.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialise the edge wasm module. Idempotent — subsequent calls
|
|
33
|
+
* return the same in-flight or resolved promise. Host wrappers can
|
|
34
|
+
* call this at startup to eagerly load the wasm and avoid first-
|
|
35
|
+
* request latency, but it's not required: `engineVerifyEdge`
|
|
36
|
+
* lazily initialises on first call.
|
|
37
|
+
*
|
|
38
|
+
* @param moduleOrPath Optional pre-fetched `WebAssembly.Module` or
|
|
39
|
+
* a URL / Request the wasm-bindgen loader will
|
|
40
|
+
* fetch. Defaults to the bundled artifact via
|
|
41
|
+
* `import.meta.url`. Cloudflare Workers / Vercel
|
|
42
|
+
* Edge typically pass a pre-bundled `Module`.
|
|
43
|
+
*/
|
|
44
|
+
declare function initEngineEdge(moduleOrPath?: WebAssembly.Module | URL | string | Request | BufferSource): Promise<void>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* `verifyRequestEdge` async-init orchestrator — Edge-WASM-2 (folded into
|
|
48
|
+
* Phase D's PR).
|
|
49
|
+
*
|
|
50
|
+
* Mirror of [[./verify-request.ts]] for edge runtimes. Differs in only
|
|
51
|
+
* three places:
|
|
52
|
+
*
|
|
53
|
+
* 1. Imports `engineVerifyEdge` + `initEngineEdge` from `../edge`
|
|
54
|
+
* instead of `engineVerify` from `../index` (Node target).
|
|
55
|
+
* 2. Awaits `initEngineEdge()` before the engine call — async-init
|
|
56
|
+
* pattern required by the `--target web` wasm-bindgen build.
|
|
57
|
+
* 3. The final engine call is `await engineVerifyEdge(...)` rather
|
|
58
|
+
* than the synchronous `engineVerify(...)`.
|
|
59
|
+
*
|
|
60
|
+
* **The two files MUST stay in sync.** Any change to verify-request.ts
|
|
61
|
+
* (new adapter, new error-classification rule, new ContextSpec field)
|
|
62
|
+
* MUST be mirrored here. The cross-target parity test in
|
|
63
|
+
* [[__tests__/verify-request-parity.test.ts]] guards the verdict-shape
|
|
64
|
+
* invariant — both orchestrators must produce identical
|
|
65
|
+
* `VerifyResult.decision` / `engineInfo.name` on identical inputs.
|
|
66
|
+
*
|
|
67
|
+
* Cedar-1 forward-compat: same seam as the Node variant — step (5)
|
|
68
|
+
* (tenant policy eval) is the only place the PolicyEvaluator
|
|
69
|
+
* interface gets exercised. When Cedar-1 swaps implementations, this
|
|
70
|
+
* orchestrator does not change.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Factory — constructs a `verifyRequestEdge` closure that remembers the
|
|
75
|
+
* one-shot Argus-not-configured warning state. Use this when the
|
|
76
|
+
* host wrapper wants the startup log; call `verifyRequestEdge` directly
|
|
77
|
+
* (the loose function below) if you don't.
|
|
78
|
+
*/
|
|
79
|
+
declare function makeVerifyRequestEdge(opts: VerifyRequestOpts): (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Single-shot async entry. Use [`makeVerifyRequestEdge`] in long-lived
|
|
82
|
+
* hosts (so the Argus warning is one-shot per process); use this
|
|
83
|
+
* loose form in tests + one-off invocations.
|
|
84
|
+
*/
|
|
85
|
+
declare function verifyRequestEdge(req: IncomingHttpLike, opts: VerifyRequestOpts): Promise<VerifyResult>;
|
|
86
|
+
|
|
87
|
+
export { IncomingHttpLike, VerifyRequestOpts, initEngineEdge, makeVerifyRequestEdge, verifyRequestEdge };
|
package/dist/orchestrator.d.ts
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export { initEngineEdge } from './engine-edge.js';
|
|
5
|
-
import './types-D0j85fF0.js';
|
|
1
|
+
import { VerifyRequestOpts, IncomingHttpLike } from './orchestrator-node.js';
|
|
2
|
+
export { BuildAgentRequestOpts, RenderedResponse, buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody, makeVerifyRequest, renderDecisionAsResponse, verifyRequest } from './orchestrator-node.js';
|
|
3
|
+
import { V as VerifyResult } from './types-D0j85fF0.js';
|
|
6
4
|
import '@kya-os/checkpoint-shared';
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `kya-os-engine` WASM bridge for edge runtimes — Edge-WASM-1.
|
|
8
|
+
*
|
|
9
|
+
* The Node target (`./index.ts`) uses `fs.readFileSync` at module
|
|
10
|
+
* load and exposes a sync `engineVerify`. That's incompatible with
|
|
11
|
+
* Vercel Edge / Cloudflare Workers / browser embedding (no `fs`,
|
|
12
|
+
* no sync wasm load).
|
|
13
|
+
*
|
|
14
|
+
* This module loads the `wasm-pack --target web` artifact via the
|
|
15
|
+
* async `__wbg_init` default export, then exposes the same typed
|
|
16
|
+
* `engineVerifyEdge(input, ctx) → Promise<VerifyResult>` shape with
|
|
17
|
+
* a small lazy-init wrapper. First call awaits initialisation;
|
|
18
|
+
* subsequent calls resolve synchronously on the JS side (the
|
|
19
|
+
* underlying wasm `verify` is sync).
|
|
20
|
+
*
|
|
21
|
+
* **Why this matters for the consolidation narrative.** Phase A
|
|
22
|
+
* shipped Node-only. Without an edge build, the first Vercel-edge
|
|
23
|
+
* or Cloudflare-Workers deployment after Phase D would hit the
|
|
24
|
+
* same wasm-bindgen-on-edge wall the Sites-1 F3 workaround was
|
|
25
|
+
* created to dodge — and someone would re-introduce the
|
|
26
|
+
* inline-TS detector that Q10 ratified deleting. Shipping the
|
|
27
|
+
* edge target alongside the Node target keeps Phase D's
|
|
28
|
+
* deletion narrative durable.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialise the edge wasm module. Idempotent — subsequent calls
|
|
33
|
+
* return the same in-flight or resolved promise. Host wrappers can
|
|
34
|
+
* call this at startup to eagerly load the wasm and avoid first-
|
|
35
|
+
* request latency, but it's not required: `engineVerifyEdge`
|
|
36
|
+
* lazily initialises on first call.
|
|
37
|
+
*
|
|
38
|
+
* @param moduleOrPath Optional pre-fetched `WebAssembly.Module` or
|
|
39
|
+
* a URL / Request the wasm-bindgen loader will
|
|
40
|
+
* fetch. Defaults to the bundled artifact via
|
|
41
|
+
* `import.meta.url`. Cloudflare Workers / Vercel
|
|
42
|
+
* Edge typically pass a pre-bundled `Module`.
|
|
43
|
+
*/
|
|
44
|
+
declare function initEngineEdge(moduleOrPath?: WebAssembly.Module | URL | string | Request | BufferSource): Promise<void>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* `verifyRequestEdge` async-init orchestrator — Edge-WASM-2 (folded into
|
|
48
|
+
* Phase D's PR).
|
|
49
|
+
*
|
|
50
|
+
* Mirror of [[./verify-request.ts]] for edge runtimes. Differs in only
|
|
51
|
+
* three places:
|
|
52
|
+
*
|
|
53
|
+
* 1. Imports `engineVerifyEdge` + `initEngineEdge` from `../edge`
|
|
54
|
+
* instead of `engineVerify` from `../index` (Node target).
|
|
55
|
+
* 2. Awaits `initEngineEdge()` before the engine call — async-init
|
|
56
|
+
* pattern required by the `--target web` wasm-bindgen build.
|
|
57
|
+
* 3. The final engine call is `await engineVerifyEdge(...)` rather
|
|
58
|
+
* than the synchronous `engineVerify(...)`.
|
|
59
|
+
*
|
|
60
|
+
* **The two files MUST stay in sync.** Any change to verify-request.ts
|
|
61
|
+
* (new adapter, new error-classification rule, new ContextSpec field)
|
|
62
|
+
* MUST be mirrored here. The cross-target parity test in
|
|
63
|
+
* [[__tests__/verify-request-parity.test.ts]] guards the verdict-shape
|
|
64
|
+
* invariant — both orchestrators must produce identical
|
|
65
|
+
* `VerifyResult.decision` / `engineInfo.name` on identical inputs.
|
|
66
|
+
*
|
|
67
|
+
* Cedar-1 forward-compat: same seam as the Node variant — step (5)
|
|
68
|
+
* (tenant policy eval) is the only place the PolicyEvaluator
|
|
69
|
+
* interface gets exercised. When Cedar-1 swaps implementations, this
|
|
70
|
+
* orchestrator does not change.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Factory — constructs a `verifyRequestEdge` closure that remembers the
|
|
75
|
+
* one-shot Argus-not-configured warning state. Use this when the
|
|
76
|
+
* host wrapper wants the startup log; call `verifyRequestEdge` directly
|
|
77
|
+
* (the loose function below) if you don't.
|
|
78
|
+
*/
|
|
79
|
+
declare function makeVerifyRequestEdge(opts: VerifyRequestOpts): (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Single-shot async entry. Use [`makeVerifyRequestEdge`] in long-lived
|
|
82
|
+
* hosts (so the Argus warning is one-shot per process); use this
|
|
83
|
+
* loose form in tests + one-off invocations.
|
|
84
|
+
*/
|
|
85
|
+
declare function verifyRequestEdge(req: IncomingHttpLike, opts: VerifyRequestOpts): Promise<VerifyResult>;
|
|
86
|
+
|
|
87
|
+
export { IncomingHttpLike, VerifyRequestOpts, initEngineEdge, makeVerifyRequestEdge, verifyRequestEdge };
|