@kya-os/checkpoint-wasm-runtime 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +176 -0
- package/dist/adapters.d.mts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/engine-edge.d.mts +2 -2
- package/dist/engine-edge.d.ts +2 -2
- package/dist/engine-edge.js +3 -509
- package/dist/engine-edge.mjs +3 -508
- package/dist/engine-node.d.mts +46 -0
- package/dist/engine-node.d.ts +46 -0
- package/dist/engine-node.js +31 -0
- package/dist/engine-node.mjs +10 -0
- package/dist/engine.d.mts +25 -4
- package/dist/engine.d.ts +25 -4
- package/dist/engine.js +2 -457
- package/dist/engine.mjs +2 -464
- package/dist/index.d.mts +531 -3
- package/dist/index.d.ts +531 -3
- package/dist/index.js +2 -28
- package/dist/index.mjs +2 -29
- package/dist/node.d.mts +524 -3
- package/dist/node.d.ts +524 -3
- package/dist/node.js +2 -26
- package/dist/node.mjs +2 -26
- package/dist/orchestrator-edge.d.mts +24 -10
- package/dist/orchestrator-edge.d.ts +24 -10
- package/dist/orchestrator-edge.js +5 -510
- package/dist/orchestrator-edge.mjs +5 -509
- package/dist/orchestrator-node.d.mts +60 -52
- package/dist/orchestrator-node.d.ts +60 -52
- package/dist/orchestrator-node.js +50 -487
- package/dist/orchestrator-node.mjs +34 -497
- package/dist/orchestrator.d.mts +356 -4
- package/dist/orchestrator.d.ts +356 -4
- package/dist/orchestrator.js +37 -1001
- package/dist/orchestrator.mjs +37 -1005
- package/dist/{types-ByrdPLL2.d.ts → types-KPEcVvac.d.mts} +31 -1
- package/dist/{types-ByrdPLL2.d.mts → types-KPEcVvac.d.ts} +31 -1
- package/package.json +13 -2
- package/wasm/agentshield_wasm_bg.wasm +0 -0
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine/package.json +24 -4
- package/wasm/kya-os-engine-bundler/kya_os_engine.d.ts +24 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine.js +4 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.js +522 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm.d.ts +8 -0
- package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-web/package.json +25 -3
- package/dist/kya_os_engine_bg.wasm +0 -0
- package/dist/rules-detector-ZIKHN-_y.d.mts +0 -532
- package/dist/rules-detector-ZIKHN-_y.d.ts +0 -532
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
export { initEngineEdge } from './engine-edge.js';
|
|
2
|
-
import { E as EnforcementMode, A as AgentRequest, V as VerifyResult } from './types-
|
|
2
|
+
import { E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.js';
|
|
3
3
|
import { DidResolverAdapter, StatusListCacheAdapter, ReputationOracleAdapter, PolicyEvaluatorAdapter, ClockAdapter } from './adapters.js';
|
|
4
4
|
import '@kya-os/checkpoint-shared';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Orchestrator-layer types — Phase C, host-side only.
|
|
8
|
-
*
|
|
9
|
-
* Nothing here crosses the WASM boundary. The engine ABI types live
|
|
10
|
-
* in `../types.ts`; the adapter interfaces live in
|
|
11
|
-
* `../adapters/index.ts`. This file is the host-wrapper-facing
|
|
12
|
-
* surface — what Phase D (Next.js) and Phase E (Express) import.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
6
|
/**
|
|
16
7
|
* Framework-agnostic HTTP request shape.
|
|
17
8
|
*
|
|
@@ -68,6 +59,29 @@ interface VerifyRequestOpts {
|
|
|
68
59
|
argusUrl?: string;
|
|
69
60
|
/** Injectable for the once-only Argus configuration warning. */
|
|
70
61
|
logger?: (msg: string) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Override the engine WASM-bridge function used during the sync
|
|
64
|
+
* `verify()` call. Defaults to the wasm-bindgen `--target bundler`
|
|
65
|
+
* variant imported by `./verify-request.ts` from `'../index'`.
|
|
66
|
+
*
|
|
67
|
+
* The `./orchestrator/node` subpath (SDK-Next.js-Integration-Audit-1
|
|
68
|
+
* / #2618 safety net) injects the `--target nodejs` variant here so
|
|
69
|
+
* Webpack-without-asyncWebAssembly consumers don't transitively pull
|
|
70
|
+
* the bundler artifact through the orchestrator's verify call.
|
|
71
|
+
*/
|
|
72
|
+
engineVerifyFn?: (input: AgentRequest, ctx: ContextSpec) => VerifyResult;
|
|
73
|
+
/**
|
|
74
|
+
* Engine-default behaviour knobs forwarded onto every composed
|
|
75
|
+
* `ContextSpec`. Defaults to `{ tier3Action: 'monitor' }` so a host
|
|
76
|
+
* installing `@kya-os/checkpoint-*` with minimal config preserves
|
|
77
|
+
* 1.3.0 behaviour — tenant policy is the arbiter, the engine does
|
|
78
|
+
* not short-circuit known-agent UAs with an engine-default Block.
|
|
79
|
+
*
|
|
80
|
+
* Host wrappers that want the calibrated engine-default block opt
|
|
81
|
+
* into `{ tier3Action: 'block' }`. The bench harness is the
|
|
82
|
+
* canonical opt-in consumer. See the wasm-runtime 1.4.0 CHANGELOG.
|
|
83
|
+
*/
|
|
84
|
+
engineConfig?: EngineConfig;
|
|
71
85
|
}
|
|
72
86
|
/**
|
|
73
87
|
* Transport-agnostic response shape `renderDecisionAsResponse`
|
|
@@ -1,511 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __esm = (fn, res) => function __init() {
|
|
7
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
-
};
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// wasm/kya-os-engine-web/kya_os_engine.js
|
|
15
|
-
var kya_os_engine_exports = {};
|
|
16
|
-
__export(kya_os_engine_exports, {
|
|
17
|
-
default: () => kya_os_engine_default,
|
|
18
|
-
initSync: () => initSync,
|
|
19
|
-
verify: () => verify
|
|
20
|
-
});
|
|
21
|
-
function getUint8ArrayMemory0() {
|
|
22
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
23
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
24
|
-
}
|
|
25
|
-
return cachedUint8ArrayMemory0;
|
|
26
|
-
}
|
|
27
|
-
function decodeText(ptr, len) {
|
|
28
|
-
numBytesDecoded += len;
|
|
29
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
30
|
-
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
31
|
-
cachedTextDecoder.decode();
|
|
32
|
-
numBytesDecoded = len;
|
|
33
|
-
}
|
|
34
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
35
|
-
}
|
|
36
|
-
function getStringFromWasm0(ptr, len) {
|
|
37
|
-
ptr = ptr >>> 0;
|
|
38
|
-
return decodeText(ptr, len);
|
|
39
|
-
}
|
|
40
|
-
function addHeapObject(obj) {
|
|
41
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
42
|
-
const idx = heap_next;
|
|
43
|
-
heap_next = heap[idx];
|
|
44
|
-
heap[idx] = obj;
|
|
45
|
-
return idx;
|
|
46
|
-
}
|
|
47
|
-
function getObject(idx) {
|
|
48
|
-
return heap[idx];
|
|
49
|
-
}
|
|
50
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
51
|
-
if (realloc === void 0) {
|
|
52
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
53
|
-
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
54
|
-
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
55
|
-
WASM_VECTOR_LEN = buf.length;
|
|
56
|
-
return ptr2;
|
|
57
|
-
}
|
|
58
|
-
let len = arg.length;
|
|
59
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
60
|
-
const mem = getUint8ArrayMemory0();
|
|
61
|
-
let offset = 0;
|
|
62
|
-
for (; offset < len; offset++) {
|
|
63
|
-
const code = arg.charCodeAt(offset);
|
|
64
|
-
if (code > 127) break;
|
|
65
|
-
mem[ptr + offset] = code;
|
|
66
|
-
}
|
|
67
|
-
if (offset !== len) {
|
|
68
|
-
if (offset !== 0) {
|
|
69
|
-
arg = arg.slice(offset);
|
|
70
|
-
}
|
|
71
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
72
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
73
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
74
|
-
offset += ret.written;
|
|
75
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
76
|
-
}
|
|
77
|
-
WASM_VECTOR_LEN = offset;
|
|
78
|
-
return ptr;
|
|
79
|
-
}
|
|
80
|
-
function getDataViewMemory0() {
|
|
81
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
82
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
83
|
-
}
|
|
84
|
-
return cachedDataViewMemory0;
|
|
85
|
-
}
|
|
86
|
-
function isLikeNone(x) {
|
|
87
|
-
return x === void 0 || x === null;
|
|
88
|
-
}
|
|
89
|
-
function debugString(val) {
|
|
90
|
-
const type = typeof val;
|
|
91
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
92
|
-
return `${val}`;
|
|
93
|
-
}
|
|
94
|
-
if (type == "string") {
|
|
95
|
-
return `"${val}"`;
|
|
96
|
-
}
|
|
97
|
-
if (type == "symbol") {
|
|
98
|
-
const description = val.description;
|
|
99
|
-
if (description == null) {
|
|
100
|
-
return "Symbol";
|
|
101
|
-
} else {
|
|
102
|
-
return `Symbol(${description})`;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (type == "function") {
|
|
106
|
-
const name = val.name;
|
|
107
|
-
if (typeof name == "string" && name.length > 0) {
|
|
108
|
-
return `Function(${name})`;
|
|
109
|
-
} else {
|
|
110
|
-
return "Function";
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (Array.isArray(val)) {
|
|
114
|
-
const length = val.length;
|
|
115
|
-
let debug = "[";
|
|
116
|
-
if (length > 0) {
|
|
117
|
-
debug += debugString(val[0]);
|
|
118
|
-
}
|
|
119
|
-
for (let i = 1; i < length; i++) {
|
|
120
|
-
debug += ", " + debugString(val[i]);
|
|
121
|
-
}
|
|
122
|
-
debug += "]";
|
|
123
|
-
return debug;
|
|
124
|
-
}
|
|
125
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
126
|
-
let className;
|
|
127
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
128
|
-
className = builtInMatches[1];
|
|
129
|
-
} else {
|
|
130
|
-
return toString.call(val);
|
|
131
|
-
}
|
|
132
|
-
if (className == "Object") {
|
|
133
|
-
try {
|
|
134
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
135
|
-
} catch (_) {
|
|
136
|
-
return "Object";
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (val instanceof Error) {
|
|
140
|
-
return `${val.name}: ${val.message}
|
|
141
|
-
${val.stack}`;
|
|
142
|
-
}
|
|
143
|
-
return className;
|
|
144
|
-
}
|
|
145
|
-
function handleError(f, args) {
|
|
146
|
-
try {
|
|
147
|
-
return f.apply(this, args);
|
|
148
|
-
} catch (e) {
|
|
149
|
-
wasm.__wbindgen_export3(addHeapObject(e));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
153
|
-
ptr = ptr >>> 0;
|
|
154
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
155
|
-
}
|
|
156
|
-
function dropObject(idx) {
|
|
157
|
-
if (idx < 132) return;
|
|
158
|
-
heap[idx] = heap_next;
|
|
159
|
-
heap_next = idx;
|
|
160
|
-
}
|
|
161
|
-
function takeObject(idx) {
|
|
162
|
-
const ret = getObject(idx);
|
|
163
|
-
dropObject(idx);
|
|
164
|
-
return ret;
|
|
165
|
-
}
|
|
166
|
-
function verify(input_js, ctx_js) {
|
|
167
|
-
try {
|
|
168
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
169
|
-
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
170
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
171
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
172
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
173
|
-
if (r2) {
|
|
174
|
-
throw takeObject(r1);
|
|
175
|
-
}
|
|
176
|
-
return takeObject(r0);
|
|
177
|
-
} finally {
|
|
178
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
async function __wbg_load(module, imports) {
|
|
182
|
-
if (typeof Response === "function" && module instanceof Response) {
|
|
183
|
-
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
184
|
-
try {
|
|
185
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
186
|
-
} catch (e) {
|
|
187
|
-
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
188
|
-
if (validResponse && module.headers.get("Content-Type") !== "application/wasm") {
|
|
189
|
-
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);
|
|
190
|
-
} else {
|
|
191
|
-
throw e;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const bytes = await module.arrayBuffer();
|
|
196
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
197
|
-
} else {
|
|
198
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
199
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
200
|
-
return { instance, module };
|
|
201
|
-
} else {
|
|
202
|
-
return instance;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
function __wbg_get_imports() {
|
|
207
|
-
const imports = {};
|
|
208
|
-
imports.wbg = {};
|
|
209
|
-
imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
210
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
211
|
-
return addHeapObject(ret);
|
|
212
|
-
};
|
|
213
|
-
imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
214
|
-
const ret = Number(getObject(arg0));
|
|
215
|
-
return ret;
|
|
216
|
-
};
|
|
217
|
-
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
218
|
-
const ret = String(getObject(arg1));
|
|
219
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
220
|
-
const len1 = WASM_VECTOR_LEN;
|
|
221
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
222
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
223
|
-
};
|
|
224
|
-
imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
225
|
-
const v = getObject(arg1);
|
|
226
|
-
const ret = typeof v === "bigint" ? v : void 0;
|
|
227
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
228
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
229
|
-
};
|
|
230
|
-
imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
231
|
-
const v = getObject(arg0);
|
|
232
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
233
|
-
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
234
|
-
};
|
|
235
|
-
imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
236
|
-
const ret = debugString(getObject(arg1));
|
|
237
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
238
|
-
const len1 = WASM_VECTOR_LEN;
|
|
239
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
240
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
241
|
-
};
|
|
242
|
-
imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
243
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
244
|
-
return ret;
|
|
245
|
-
};
|
|
246
|
-
imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
247
|
-
const ret = typeof getObject(arg0) === "bigint";
|
|
248
|
-
return ret;
|
|
249
|
-
};
|
|
250
|
-
imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
251
|
-
const ret = typeof getObject(arg0) === "function";
|
|
252
|
-
return ret;
|
|
253
|
-
};
|
|
254
|
-
imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
255
|
-
const val = getObject(arg0);
|
|
256
|
-
const ret = typeof val === "object" && val !== null;
|
|
257
|
-
return ret;
|
|
258
|
-
};
|
|
259
|
-
imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
260
|
-
const ret = typeof getObject(arg0) === "string";
|
|
261
|
-
return ret;
|
|
262
|
-
};
|
|
263
|
-
imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
264
|
-
const ret = getObject(arg0) === void 0;
|
|
265
|
-
return ret;
|
|
266
|
-
};
|
|
267
|
-
imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
268
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
269
|
-
return ret;
|
|
270
|
-
};
|
|
271
|
-
imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
272
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
273
|
-
return ret;
|
|
274
|
-
};
|
|
275
|
-
imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
276
|
-
const obj = getObject(arg1);
|
|
277
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
278
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
279
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
280
|
-
};
|
|
281
|
-
imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
282
|
-
const obj = getObject(arg1);
|
|
283
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
284
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
285
|
-
var len1 = WASM_VECTOR_LEN;
|
|
286
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
287
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
288
|
-
};
|
|
289
|
-
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
290
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
291
|
-
};
|
|
292
|
-
imports.wbg.__wbg_call_e762c39fa8ea36bf = function() {
|
|
293
|
-
return handleError(function(arg0, arg1) {
|
|
294
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
295
|
-
return addHeapObject(ret);
|
|
296
|
-
}, arguments);
|
|
297
|
-
};
|
|
298
|
-
imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
299
|
-
const ret = getObject(arg0).done;
|
|
300
|
-
return ret;
|
|
301
|
-
};
|
|
302
|
-
imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
303
|
-
const ret = Object.entries(getObject(arg0));
|
|
304
|
-
return addHeapObject(ret);
|
|
305
|
-
};
|
|
306
|
-
imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
307
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
308
|
-
return addHeapObject(ret);
|
|
309
|
-
};
|
|
310
|
-
imports.wbg.__wbg_get_efcb449f58ec27c2 = function() {
|
|
311
|
-
return handleError(function(arg0, arg1) {
|
|
312
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
313
|
-
return addHeapObject(ret);
|
|
314
|
-
}, arguments);
|
|
315
|
-
};
|
|
316
|
-
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
317
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
318
|
-
return addHeapObject(ret);
|
|
319
|
-
};
|
|
320
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
321
|
-
let result;
|
|
322
|
-
try {
|
|
323
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
324
|
-
} catch (_) {
|
|
325
|
-
result = false;
|
|
326
|
-
}
|
|
327
|
-
const ret = result;
|
|
328
|
-
return ret;
|
|
329
|
-
};
|
|
330
|
-
imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
331
|
-
let result;
|
|
332
|
-
try {
|
|
333
|
-
result = getObject(arg0) instanceof Map;
|
|
334
|
-
} catch (_) {
|
|
335
|
-
result = false;
|
|
336
|
-
}
|
|
337
|
-
const ret = result;
|
|
338
|
-
return ret;
|
|
339
|
-
};
|
|
340
|
-
imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
341
|
-
let result;
|
|
342
|
-
try {
|
|
343
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
344
|
-
} catch (_) {
|
|
345
|
-
result = false;
|
|
346
|
-
}
|
|
347
|
-
const ret = result;
|
|
348
|
-
return ret;
|
|
349
|
-
};
|
|
350
|
-
imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
351
|
-
const ret = Array.isArray(getObject(arg0));
|
|
352
|
-
return ret;
|
|
353
|
-
};
|
|
354
|
-
imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
355
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
356
|
-
return ret;
|
|
357
|
-
};
|
|
358
|
-
imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
|
|
359
|
-
const ret = Symbol.iterator;
|
|
360
|
-
return addHeapObject(ret);
|
|
361
|
-
};
|
|
362
|
-
imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
363
|
-
const ret = getObject(arg0).length;
|
|
364
|
-
return ret;
|
|
365
|
-
};
|
|
366
|
-
imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
367
|
-
const ret = getObject(arg0).length;
|
|
368
|
-
return ret;
|
|
369
|
-
};
|
|
370
|
-
imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
|
|
371
|
-
const ret = new Object();
|
|
372
|
-
return addHeapObject(ret);
|
|
373
|
-
};
|
|
374
|
-
imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
375
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
376
|
-
return addHeapObject(ret);
|
|
377
|
-
};
|
|
378
|
-
imports.wbg.__wbg_new_68651c719dcda04e = function() {
|
|
379
|
-
const ret = /* @__PURE__ */ new Map();
|
|
380
|
-
return addHeapObject(ret);
|
|
381
|
-
};
|
|
382
|
-
imports.wbg.__wbg_new_e17d9f43105b08be = function() {
|
|
383
|
-
const ret = new Array();
|
|
384
|
-
return addHeapObject(ret);
|
|
385
|
-
};
|
|
386
|
-
imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
387
|
-
return handleError(function(arg0) {
|
|
388
|
-
const ret = getObject(arg0).next();
|
|
389
|
-
return addHeapObject(ret);
|
|
390
|
-
}, arguments);
|
|
391
|
-
};
|
|
392
|
-
imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
393
|
-
const ret = getObject(arg0).next;
|
|
394
|
-
return addHeapObject(ret);
|
|
395
|
-
};
|
|
396
|
-
imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
397
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
398
|
-
};
|
|
399
|
-
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
400
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
401
|
-
};
|
|
402
|
-
imports.wbg.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
403
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
404
|
-
return addHeapObject(ret);
|
|
405
|
-
};
|
|
406
|
-
imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
407
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
408
|
-
};
|
|
409
|
-
imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
|
|
410
|
-
const ret = getObject(arg0).value;
|
|
411
|
-
return addHeapObject(ret);
|
|
412
|
-
};
|
|
413
|
-
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
414
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
415
|
-
return addHeapObject(ret);
|
|
416
|
-
};
|
|
417
|
-
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
418
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
419
|
-
return addHeapObject(ret);
|
|
420
|
-
};
|
|
421
|
-
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
422
|
-
const ret = arg0;
|
|
423
|
-
return addHeapObject(ret);
|
|
424
|
-
};
|
|
425
|
-
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
426
|
-
const ret = arg0;
|
|
427
|
-
return addHeapObject(ret);
|
|
428
|
-
};
|
|
429
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
430
|
-
const ret = getObject(arg0);
|
|
431
|
-
return addHeapObject(ret);
|
|
432
|
-
};
|
|
433
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
434
|
-
takeObject(arg0);
|
|
435
|
-
};
|
|
436
|
-
return imports;
|
|
437
|
-
}
|
|
438
|
-
function __wbg_finalize_init(instance, module) {
|
|
439
|
-
wasm = instance.exports;
|
|
440
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
441
|
-
cachedDataViewMemory0 = null;
|
|
442
|
-
cachedUint8ArrayMemory0 = null;
|
|
443
|
-
return wasm;
|
|
444
|
-
}
|
|
445
|
-
function initSync(module) {
|
|
446
|
-
if (wasm !== void 0) return wasm;
|
|
447
|
-
if (typeof module !== "undefined") {
|
|
448
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
449
|
-
({ module } = module);
|
|
450
|
-
} else {
|
|
451
|
-
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
const imports = __wbg_get_imports();
|
|
455
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
456
|
-
module = new WebAssembly.Module(module);
|
|
457
|
-
}
|
|
458
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
459
|
-
return __wbg_finalize_init(instance, module);
|
|
460
|
-
}
|
|
461
|
-
async function __wbg_init(module_or_path) {
|
|
462
|
-
if (wasm !== void 0) return wasm;
|
|
463
|
-
if (typeof module_or_path !== "undefined") {
|
|
464
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
465
|
-
({ module_or_path } = module_or_path);
|
|
466
|
-
} else {
|
|
467
|
-
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
if (typeof module_or_path === "undefined") {
|
|
471
|
-
module_or_path = new URL("kya_os_engine_bg.wasm", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('orchestrator-edge.js', document.baseURI).href)));
|
|
472
|
-
}
|
|
473
|
-
const imports = __wbg_get_imports();
|
|
474
|
-
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
475
|
-
module_or_path = fetch(module_or_path);
|
|
476
|
-
}
|
|
477
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
478
|
-
return __wbg_finalize_init(instance, module);
|
|
479
|
-
}
|
|
480
|
-
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
|
-
var init_kya_os_engine = __esm({
|
|
482
|
-
"wasm/kya-os-engine-web/kya_os_engine.js"() {
|
|
483
|
-
cachedUint8ArrayMemory0 = null;
|
|
484
|
-
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
485
|
-
cachedTextDecoder.decode();
|
|
486
|
-
MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
487
|
-
numBytesDecoded = 0;
|
|
488
|
-
heap = new Array(128).fill(void 0);
|
|
489
|
-
heap.push(void 0, null, true, false);
|
|
490
|
-
heap_next = heap.length;
|
|
491
|
-
WASM_VECTOR_LEN = 0;
|
|
492
|
-
cachedTextEncoder = new TextEncoder();
|
|
493
|
-
if (!("encodeInto" in cachedTextEncoder)) {
|
|
494
|
-
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
495
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
496
|
-
view.set(buf);
|
|
497
|
-
return {
|
|
498
|
-
read: arg.length,
|
|
499
|
-
written: buf.length
|
|
500
|
-
};
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
cachedDataViewMemory0 = null;
|
|
504
|
-
EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
|
|
505
|
-
kya_os_engine_default = __wbg_init;
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
|
|
509
3
|
// src/engine/adapters/outbound-url-policy.ts
|
|
510
4
|
var BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata", "metadata.google.internal"]);
|
|
511
5
|
var UnsafeOutboundUrl = class extends Error {
|
|
@@ -589,7 +83,7 @@ function initEngineEdge(moduleOrPath) {
|
|
|
589
83
|
function ensureReady(moduleOrPath) {
|
|
590
84
|
if (initialised) return initialised;
|
|
591
85
|
const pending = (async () => {
|
|
592
|
-
const mod = await
|
|
86
|
+
const mod = await import('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine.js');
|
|
593
87
|
await mod.default(moduleOrPath !== void 0 ? { module_or_path: moduleOrPath } : void 0);
|
|
594
88
|
return mod.verify;
|
|
595
89
|
})();
|
|
@@ -602,8 +96,8 @@ function ensureReady(moduleOrPath) {
|
|
|
602
96
|
return initialised;
|
|
603
97
|
}
|
|
604
98
|
async function engineVerifyEdge(input, ctx) {
|
|
605
|
-
const
|
|
606
|
-
return
|
|
99
|
+
const verify = await ensureReady();
|
|
100
|
+
return verify(input, ctx);
|
|
607
101
|
}
|
|
608
102
|
|
|
609
103
|
// src/engine/adapters/util.ts
|
|
@@ -1053,7 +547,8 @@ async function verifyRequestEdge_internal(req, opts) {
|
|
|
1053
547
|
reputation: agentDid ? { [agentDid]: repScore } : {},
|
|
1054
548
|
tenantDecision,
|
|
1055
549
|
nowUnix: opts.clock.nowUnix(),
|
|
1056
|
-
enforcementMode: opts.enforcementMode
|
|
550
|
+
enforcementMode: opts.enforcementMode,
|
|
551
|
+
...opts.engineConfig ? { config: opts.engineConfig } : {}
|
|
1057
552
|
};
|
|
1058
553
|
return engineVerifyEdge(agentRequest, ctx);
|
|
1059
554
|
}
|