@kya-os/checkpoint-wasm-runtime 1.0.0 → 1.1.1
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 +166 -0
- package/dist/adapters.js +0 -2
- package/dist/adapters.mjs +0 -2
- package/dist/edge.js +0 -2
- package/dist/edge.mjs +0 -2
- package/dist/engine-edge.js +0 -2
- package/dist/engine-edge.mjs +0 -2
- package/dist/engine.js +447 -4
- package/dist/engine.mjs +447 -4
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/kya_os_engine_bg.wasm +0 -0
- package/dist/node.js +0 -2
- package/dist/node.mjs +0 -2
- package/dist/orchestrator-edge.d.mts +5 -199
- package/dist/orchestrator-edge.d.ts +5 -199
- package/dist/orchestrator-edge.js +0 -2
- package/dist/orchestrator-edge.mjs +0 -2
- package/dist/orchestrator-node.d.mts +49 -0
- package/dist/orchestrator-node.d.ts +49 -0
- package/dist/orchestrator-node.js +992 -0
- package/dist/orchestrator-node.mjs +983 -0
- package/dist/orchestrator.d.mts +4 -47
- package/dist/orchestrator.d.ts +4 -47
- package/dist/orchestrator.js +448 -8
- package/dist/orchestrator.mjs +448 -8
- package/dist/render-decision-C1a-iuiW.d.mts +200 -0
- package/dist/render-decision-Dsjwt96g.d.ts +200 -0
- package/package.json +14 -2
- package/wasm/kya-os-engine/package.json +7 -0
- package/wasm/kya-os-engine-web/package.json +7 -0
- package/dist/adapters.js.map +0 -1
- package/dist/adapters.mjs.map +0 -1
- package/dist/edge.js.map +0 -1
- package/dist/edge.mjs.map +0 -1
- package/dist/engine-edge.js.map +0 -1
- package/dist/engine-edge.mjs.map +0 -1
- package/dist/engine.js.map +0 -1
- package/dist/engine.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/node.js.map +0 -1
- package/dist/node.mjs.map +0 -1
- package/dist/orchestrator-edge.js.map +0 -1
- package/dist/orchestrator-edge.mjs.map +0 -1
- package/dist/orchestrator.js.map +0 -1
- package/dist/orchestrator.mjs.map +0 -1
package/dist/orchestrator.d.mts
CHANGED
|
@@ -1,50 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { BuildAgentRequestOpts, RenderedResponse, buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody,
|
|
1
|
+
export { makeVerifyRequest, verifyRequest } from './orchestrator-node.mjs';
|
|
2
|
+
export { makeVerifyRequestEdge, verifyRequestEdge } from './orchestrator-edge.mjs';
|
|
3
|
+
export { B as BuildAgentRequestOpts, I as IncomingHttpLike, R as RenderedResponse, V as VerifyRequestOpts, b as buildAgentRequest, e as extractAgentDid, a as extractCredentialStatusUrl, c as extractIssuer, h as hasMalformedJwsBody, r as renderDecisionAsResponse } from './render-decision-C1a-iuiW.mjs';
|
|
4
4
|
export { initEngineEdge } from './engine-edge.mjs';
|
|
5
|
+
import './types-D0j85fF0.mjs';
|
|
5
6
|
import '@kya-os/checkpoint-shared';
|
|
6
7
|
import './adapters.mjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* `verifyRequest` async orchestrator — Phase C.2.
|
|
10
|
-
*
|
|
11
|
-
* The single entry point Phase D (Next.js) and Phase E (Express)
|
|
12
|
-
* compose. Async pre-fetch on the host side; one sync `engineVerify`
|
|
13
|
-
* call across the WASM boundary. Sync-engine / async-host invariant
|
|
14
|
-
* (H-1 § 4.5) preserved.
|
|
15
|
-
*
|
|
16
|
-
* Orchestration:
|
|
17
|
-
* 1. Translate HTTP → AgentRequest (no engine I/O).
|
|
18
|
-
* 2. Extract identifiers (issuer DID, agent DID, status-list URL).
|
|
19
|
-
* 3. Conditional Promise.all over the *applicable* adapters —
|
|
20
|
-
* anonymous PlainHttp gets no network calls; signed MCP-I gets
|
|
21
|
-
* DID + status-list + reputation in parallel.
|
|
22
|
-
* 4. Translate adapter errors to verdicts where the architect-
|
|
23
|
-
* ratified posture says so:
|
|
24
|
-
* - DidResolver throw → Block(ParseError) verdict
|
|
25
|
-
* - StatusListCache throw → re-throw (host renders 503)
|
|
26
|
-
* - Reputation throw → impossible (Phase B § 4.5)
|
|
27
|
-
* 5. Compute the tenant Decision via PolicyEvaluator over the
|
|
28
|
-
* resolved reputation.
|
|
29
|
-
* 6. Build ContextSpec, call `engineVerify`, return VerifyResult.
|
|
30
|
-
*
|
|
31
|
-
* Cedar-1 forward-compat: step (5) is the only place the
|
|
32
|
-
* PolicyEvaluator interface gets exercised. When Cedar-1 swaps
|
|
33
|
-
* implementations, this orchestrator does not change.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Factory — constructs a `verifyRequest` closure that remembers the
|
|
38
|
-
* one-shot Argus-not-configured warning state. Use this when the
|
|
39
|
-
* host wrapper wants the startup log; call `verifyRequest` directly
|
|
40
|
-
* (the loose function below) if you don't.
|
|
41
|
-
*/
|
|
42
|
-
declare function makeVerifyRequest(opts: VerifyRequestOpts): (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
43
|
-
/**
|
|
44
|
-
* Single-shot async entry. Use [`makeVerifyRequest`] in long-lived
|
|
45
|
-
* hosts (so the Argus warning is one-shot per process); use this
|
|
46
|
-
* loose form in tests + one-off invocations.
|
|
47
|
-
*/
|
|
48
|
-
declare function verifyRequest(req: IncomingHttpLike, opts: VerifyRequestOpts): Promise<VerifyResult>;
|
|
49
|
-
|
|
50
|
-
export { IncomingHttpLike, VerifyRequestOpts, makeVerifyRequest, verifyRequest };
|
package/dist/orchestrator.d.ts
CHANGED
|
@@ -1,50 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { BuildAgentRequestOpts, RenderedResponse, buildAgentRequest, extractAgentDid, extractCredentialStatusUrl, extractIssuer, hasMalformedJwsBody,
|
|
1
|
+
export { makeVerifyRequest, verifyRequest } from './orchestrator-node.js';
|
|
2
|
+
export { makeVerifyRequestEdge, verifyRequestEdge } from './orchestrator-edge.js';
|
|
3
|
+
export { B as BuildAgentRequestOpts, I as IncomingHttpLike, R as RenderedResponse, V as VerifyRequestOpts, b as buildAgentRequest, e as extractAgentDid, a as extractCredentialStatusUrl, c as extractIssuer, h as hasMalformedJwsBody, r as renderDecisionAsResponse } from './render-decision-Dsjwt96g.js';
|
|
4
4
|
export { initEngineEdge } from './engine-edge.js';
|
|
5
|
+
import './types-D0j85fF0.js';
|
|
5
6
|
import '@kya-os/checkpoint-shared';
|
|
6
7
|
import './adapters.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* `verifyRequest` async orchestrator — Phase C.2.
|
|
10
|
-
*
|
|
11
|
-
* The single entry point Phase D (Next.js) and Phase E (Express)
|
|
12
|
-
* compose. Async pre-fetch on the host side; one sync `engineVerify`
|
|
13
|
-
* call across the WASM boundary. Sync-engine / async-host invariant
|
|
14
|
-
* (H-1 § 4.5) preserved.
|
|
15
|
-
*
|
|
16
|
-
* Orchestration:
|
|
17
|
-
* 1. Translate HTTP → AgentRequest (no engine I/O).
|
|
18
|
-
* 2. Extract identifiers (issuer DID, agent DID, status-list URL).
|
|
19
|
-
* 3. Conditional Promise.all over the *applicable* adapters —
|
|
20
|
-
* anonymous PlainHttp gets no network calls; signed MCP-I gets
|
|
21
|
-
* DID + status-list + reputation in parallel.
|
|
22
|
-
* 4. Translate adapter errors to verdicts where the architect-
|
|
23
|
-
* ratified posture says so:
|
|
24
|
-
* - DidResolver throw → Block(ParseError) verdict
|
|
25
|
-
* - StatusListCache throw → re-throw (host renders 503)
|
|
26
|
-
* - Reputation throw → impossible (Phase B § 4.5)
|
|
27
|
-
* 5. Compute the tenant Decision via PolicyEvaluator over the
|
|
28
|
-
* resolved reputation.
|
|
29
|
-
* 6. Build ContextSpec, call `engineVerify`, return VerifyResult.
|
|
30
|
-
*
|
|
31
|
-
* Cedar-1 forward-compat: step (5) is the only place the
|
|
32
|
-
* PolicyEvaluator interface gets exercised. When Cedar-1 swaps
|
|
33
|
-
* implementations, this orchestrator does not change.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Factory — constructs a `verifyRequest` closure that remembers the
|
|
38
|
-
* one-shot Argus-not-configured warning state. Use this when the
|
|
39
|
-
* host wrapper wants the startup log; call `verifyRequest` directly
|
|
40
|
-
* (the loose function below) if you don't.
|
|
41
|
-
*/
|
|
42
|
-
declare function makeVerifyRequest(opts: VerifyRequestOpts): (req: IncomingHttpLike) => Promise<VerifyResult>;
|
|
43
|
-
/**
|
|
44
|
-
* Single-shot async entry. Use [`makeVerifyRequest`] in long-lived
|
|
45
|
-
* hosts (so the Argus warning is one-shot per process); use this
|
|
46
|
-
* loose form in tests + one-off invocations.
|
|
47
|
-
*/
|
|
48
|
-
declare function verifyRequest(req: IncomingHttpLike, opts: VerifyRequestOpts): Promise<VerifyResult>;
|
|
49
|
-
|
|
50
|
-
export { IncomingHttpLike, VerifyRequestOpts, makeVerifyRequest, verifyRequest };
|
package/dist/orchestrator.js
CHANGED
|
@@ -1,22 +1,463 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
4
|
+
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
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
|
+
});
|
|
6
16
|
var __esm = (fn, res) => function __init() {
|
|
7
17
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
18
|
};
|
|
19
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
20
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
21
|
+
};
|
|
9
22
|
var __export = (target, all) => {
|
|
10
23
|
for (var name in all)
|
|
11
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
25
|
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
+
mod
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
// wasm/kya-os-engine/kya_os_engine.js
|
|
44
|
+
var require_kya_os_engine = __commonJS({
|
|
45
|
+
"wasm/kya-os-engine/kya_os_engine.js"(exports$1, module) {
|
|
46
|
+
var imports = {};
|
|
47
|
+
imports["__wbindgen_placeholder__"] = module.exports;
|
|
48
|
+
var cachedUint8ArrayMemory02 = null;
|
|
49
|
+
function getUint8ArrayMemory02() {
|
|
50
|
+
if (cachedUint8ArrayMemory02 === null || cachedUint8ArrayMemory02.byteLength === 0) {
|
|
51
|
+
cachedUint8ArrayMemory02 = new Uint8Array(wasm2.memory.buffer);
|
|
52
|
+
}
|
|
53
|
+
return cachedUint8ArrayMemory02;
|
|
54
|
+
}
|
|
55
|
+
var cachedTextDecoder2 = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
56
|
+
cachedTextDecoder2.decode();
|
|
57
|
+
function decodeText2(ptr, len) {
|
|
58
|
+
return cachedTextDecoder2.decode(getUint8ArrayMemory02().subarray(ptr, ptr + len));
|
|
59
|
+
}
|
|
60
|
+
function getStringFromWasm02(ptr, len) {
|
|
61
|
+
ptr = ptr >>> 0;
|
|
62
|
+
return decodeText2(ptr, len);
|
|
63
|
+
}
|
|
64
|
+
var heap2 = new Array(128).fill(void 0);
|
|
65
|
+
heap2.push(void 0, null, true, false);
|
|
66
|
+
var heap_next2 = heap2.length;
|
|
67
|
+
function addHeapObject2(obj) {
|
|
68
|
+
if (heap_next2 === heap2.length) heap2.push(heap2.length + 1);
|
|
69
|
+
const idx = heap_next2;
|
|
70
|
+
heap_next2 = heap2[idx];
|
|
71
|
+
heap2[idx] = obj;
|
|
72
|
+
return idx;
|
|
73
|
+
}
|
|
74
|
+
function getObject2(idx) {
|
|
75
|
+
return heap2[idx];
|
|
76
|
+
}
|
|
77
|
+
var WASM_VECTOR_LEN2 = 0;
|
|
78
|
+
var cachedTextEncoder2 = new TextEncoder();
|
|
79
|
+
if (!("encodeInto" in cachedTextEncoder2)) {
|
|
80
|
+
cachedTextEncoder2.encodeInto = function(arg, view) {
|
|
81
|
+
const buf = cachedTextEncoder2.encode(arg);
|
|
82
|
+
view.set(buf);
|
|
83
|
+
return {
|
|
84
|
+
read: arg.length,
|
|
85
|
+
written: buf.length
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function passStringToWasm02(arg, malloc, realloc) {
|
|
90
|
+
if (realloc === void 0) {
|
|
91
|
+
const buf = cachedTextEncoder2.encode(arg);
|
|
92
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
93
|
+
getUint8ArrayMemory02().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
94
|
+
WASM_VECTOR_LEN2 = buf.length;
|
|
95
|
+
return ptr2;
|
|
96
|
+
}
|
|
97
|
+
let len = arg.length;
|
|
98
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
99
|
+
const mem = getUint8ArrayMemory02();
|
|
100
|
+
let offset = 0;
|
|
101
|
+
for (; offset < len; offset++) {
|
|
102
|
+
const code = arg.charCodeAt(offset);
|
|
103
|
+
if (code > 127) break;
|
|
104
|
+
mem[ptr + offset] = code;
|
|
105
|
+
}
|
|
106
|
+
if (offset !== len) {
|
|
107
|
+
if (offset !== 0) {
|
|
108
|
+
arg = arg.slice(offset);
|
|
109
|
+
}
|
|
110
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
111
|
+
const view = getUint8ArrayMemory02().subarray(ptr + offset, ptr + len);
|
|
112
|
+
const ret = cachedTextEncoder2.encodeInto(arg, view);
|
|
113
|
+
offset += ret.written;
|
|
114
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
115
|
+
}
|
|
116
|
+
WASM_VECTOR_LEN2 = offset;
|
|
117
|
+
return ptr;
|
|
118
|
+
}
|
|
119
|
+
var cachedDataViewMemory02 = null;
|
|
120
|
+
function getDataViewMemory02() {
|
|
121
|
+
if (cachedDataViewMemory02 === null || cachedDataViewMemory02.buffer.detached === true || cachedDataViewMemory02.buffer.detached === void 0 && cachedDataViewMemory02.buffer !== wasm2.memory.buffer) {
|
|
122
|
+
cachedDataViewMemory02 = new DataView(wasm2.memory.buffer);
|
|
123
|
+
}
|
|
124
|
+
return cachedDataViewMemory02;
|
|
125
|
+
}
|
|
126
|
+
function isLikeNone2(x) {
|
|
127
|
+
return x === void 0 || x === null;
|
|
128
|
+
}
|
|
129
|
+
function debugString2(val) {
|
|
130
|
+
const type = typeof val;
|
|
131
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
132
|
+
return `${val}`;
|
|
133
|
+
}
|
|
134
|
+
if (type == "string") {
|
|
135
|
+
return `"${val}"`;
|
|
136
|
+
}
|
|
137
|
+
if (type == "symbol") {
|
|
138
|
+
const description = val.description;
|
|
139
|
+
if (description == null) {
|
|
140
|
+
return "Symbol";
|
|
141
|
+
} else {
|
|
142
|
+
return `Symbol(${description})`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (type == "function") {
|
|
146
|
+
const name = val.name;
|
|
147
|
+
if (typeof name == "string" && name.length > 0) {
|
|
148
|
+
return `Function(${name})`;
|
|
149
|
+
} else {
|
|
150
|
+
return "Function";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (Array.isArray(val)) {
|
|
154
|
+
const length = val.length;
|
|
155
|
+
let debug = "[";
|
|
156
|
+
if (length > 0) {
|
|
157
|
+
debug += debugString2(val[0]);
|
|
158
|
+
}
|
|
159
|
+
for (let i = 1; i < length; i++) {
|
|
160
|
+
debug += ", " + debugString2(val[i]);
|
|
161
|
+
}
|
|
162
|
+
debug += "]";
|
|
163
|
+
return debug;
|
|
164
|
+
}
|
|
165
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
166
|
+
let className;
|
|
167
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
168
|
+
className = builtInMatches[1];
|
|
169
|
+
} else {
|
|
170
|
+
return toString.call(val);
|
|
171
|
+
}
|
|
172
|
+
if (className == "Object") {
|
|
173
|
+
try {
|
|
174
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
175
|
+
} catch (_) {
|
|
176
|
+
return "Object";
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (val instanceof Error) {
|
|
180
|
+
return `${val.name}: ${val.message}
|
|
181
|
+
${val.stack}`;
|
|
182
|
+
}
|
|
183
|
+
return className;
|
|
184
|
+
}
|
|
185
|
+
function handleError2(f, args) {
|
|
186
|
+
try {
|
|
187
|
+
return f.apply(this, args);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
wasm2.__wbindgen_export3(addHeapObject2(e));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function getArrayU8FromWasm02(ptr, len) {
|
|
193
|
+
ptr = ptr >>> 0;
|
|
194
|
+
return getUint8ArrayMemory02().subarray(ptr / 1, ptr / 1 + len);
|
|
195
|
+
}
|
|
196
|
+
function dropObject2(idx) {
|
|
197
|
+
if (idx < 132) return;
|
|
198
|
+
heap2[idx] = heap_next2;
|
|
199
|
+
heap_next2 = idx;
|
|
200
|
+
}
|
|
201
|
+
function takeObject2(idx) {
|
|
202
|
+
const ret = getObject2(idx);
|
|
203
|
+
dropObject2(idx);
|
|
204
|
+
return ret;
|
|
205
|
+
}
|
|
206
|
+
exports$1.verify = function(input_js, ctx_js) {
|
|
207
|
+
try {
|
|
208
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
209
|
+
wasm2.verify(retptr, addHeapObject2(input_js), addHeapObject2(ctx_js));
|
|
210
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
211
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
212
|
+
var r2 = getDataViewMemory02().getInt32(retptr + 4 * 2, true);
|
|
213
|
+
if (r2) {
|
|
214
|
+
throw takeObject2(r1);
|
|
215
|
+
}
|
|
216
|
+
return takeObject2(r0);
|
|
217
|
+
} finally {
|
|
218
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
exports$1.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
222
|
+
const ret = Error(getStringFromWasm02(arg0, arg1));
|
|
223
|
+
return addHeapObject2(ret);
|
|
224
|
+
};
|
|
225
|
+
exports$1.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
226
|
+
const ret = Number(getObject2(arg0));
|
|
227
|
+
return ret;
|
|
228
|
+
};
|
|
229
|
+
exports$1.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
230
|
+
const ret = String(getObject2(arg1));
|
|
231
|
+
const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
232
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
233
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
234
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
235
|
+
};
|
|
236
|
+
exports$1.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
237
|
+
const v = getObject2(arg1);
|
|
238
|
+
const ret = typeof v === "bigint" ? v : void 0;
|
|
239
|
+
getDataViewMemory02().setBigInt64(arg0 + 8 * 1, isLikeNone2(ret) ? BigInt(0) : ret, true);
|
|
240
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
|
|
241
|
+
};
|
|
242
|
+
exports$1.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
243
|
+
const v = getObject2(arg0);
|
|
244
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
245
|
+
return isLikeNone2(ret) ? 16777215 : ret ? 1 : 0;
|
|
246
|
+
};
|
|
247
|
+
exports$1.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
248
|
+
const ret = debugString2(getObject2(arg1));
|
|
249
|
+
const ptr1 = passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
250
|
+
const len1 = WASM_VECTOR_LEN2;
|
|
251
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
252
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
253
|
+
};
|
|
254
|
+
exports$1.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
255
|
+
const ret = getObject2(arg0) in getObject2(arg1);
|
|
256
|
+
return ret;
|
|
257
|
+
};
|
|
258
|
+
exports$1.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
259
|
+
const ret = typeof getObject2(arg0) === "bigint";
|
|
260
|
+
return ret;
|
|
261
|
+
};
|
|
262
|
+
exports$1.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
263
|
+
const ret = typeof getObject2(arg0) === "function";
|
|
264
|
+
return ret;
|
|
265
|
+
};
|
|
266
|
+
exports$1.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
267
|
+
const val = getObject2(arg0);
|
|
268
|
+
const ret = typeof val === "object" && val !== null;
|
|
269
|
+
return ret;
|
|
270
|
+
};
|
|
271
|
+
exports$1.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
272
|
+
const ret = typeof getObject2(arg0) === "string";
|
|
273
|
+
return ret;
|
|
274
|
+
};
|
|
275
|
+
exports$1.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
276
|
+
const ret = getObject2(arg0) === void 0;
|
|
277
|
+
return ret;
|
|
278
|
+
};
|
|
279
|
+
exports$1.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
280
|
+
const ret = getObject2(arg0) === getObject2(arg1);
|
|
281
|
+
return ret;
|
|
282
|
+
};
|
|
283
|
+
exports$1.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
284
|
+
const ret = getObject2(arg0) == getObject2(arg1);
|
|
285
|
+
return ret;
|
|
286
|
+
};
|
|
287
|
+
exports$1.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
288
|
+
const obj = getObject2(arg1);
|
|
289
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
290
|
+
getDataViewMemory02().setFloat64(arg0 + 8 * 1, isLikeNone2(ret) ? 0 : ret, true);
|
|
291
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 0, !isLikeNone2(ret), true);
|
|
292
|
+
};
|
|
293
|
+
exports$1.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
294
|
+
const obj = getObject2(arg1);
|
|
295
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
296
|
+
var ptr1 = isLikeNone2(ret) ? 0 : passStringToWasm02(ret, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
297
|
+
var len1 = WASM_VECTOR_LEN2;
|
|
298
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 1, len1, true);
|
|
299
|
+
getDataViewMemory02().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
300
|
+
};
|
|
301
|
+
exports$1.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
302
|
+
throw new Error(getStringFromWasm02(arg0, arg1));
|
|
303
|
+
};
|
|
304
|
+
exports$1.__wbg_call_e762c39fa8ea36bf = function() {
|
|
305
|
+
return handleError2(function(arg0, arg1) {
|
|
306
|
+
const ret = getObject2(arg0).call(getObject2(arg1));
|
|
307
|
+
return addHeapObject2(ret);
|
|
308
|
+
}, arguments);
|
|
309
|
+
};
|
|
310
|
+
exports$1.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
311
|
+
const ret = getObject2(arg0).done;
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
314
|
+
exports$1.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
315
|
+
const ret = Object.entries(getObject2(arg0));
|
|
316
|
+
return addHeapObject2(ret);
|
|
317
|
+
};
|
|
318
|
+
exports$1.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
319
|
+
const ret = getObject2(arg0)[arg1 >>> 0];
|
|
320
|
+
return addHeapObject2(ret);
|
|
321
|
+
};
|
|
322
|
+
exports$1.__wbg_get_efcb449f58ec27c2 = function() {
|
|
323
|
+
return handleError2(function(arg0, arg1) {
|
|
324
|
+
const ret = Reflect.get(getObject2(arg0), getObject2(arg1));
|
|
325
|
+
return addHeapObject2(ret);
|
|
326
|
+
}, arguments);
|
|
327
|
+
};
|
|
328
|
+
exports$1.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
329
|
+
const ret = getObject2(arg0)[getObject2(arg1)];
|
|
330
|
+
return addHeapObject2(ret);
|
|
331
|
+
};
|
|
332
|
+
exports$1.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
333
|
+
let result;
|
|
334
|
+
try {
|
|
335
|
+
result = getObject2(arg0) instanceof ArrayBuffer;
|
|
336
|
+
} catch (_) {
|
|
337
|
+
result = false;
|
|
338
|
+
}
|
|
339
|
+
const ret = result;
|
|
340
|
+
return ret;
|
|
341
|
+
};
|
|
342
|
+
exports$1.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
343
|
+
let result;
|
|
344
|
+
try {
|
|
345
|
+
result = getObject2(arg0) instanceof Map;
|
|
346
|
+
} catch (_) {
|
|
347
|
+
result = false;
|
|
348
|
+
}
|
|
349
|
+
const ret = result;
|
|
350
|
+
return ret;
|
|
351
|
+
};
|
|
352
|
+
exports$1.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
353
|
+
let result;
|
|
354
|
+
try {
|
|
355
|
+
result = getObject2(arg0) instanceof Uint8Array;
|
|
356
|
+
} catch (_) {
|
|
357
|
+
result = false;
|
|
358
|
+
}
|
|
359
|
+
const ret = result;
|
|
360
|
+
return ret;
|
|
361
|
+
};
|
|
362
|
+
exports$1.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
363
|
+
const ret = Array.isArray(getObject2(arg0));
|
|
364
|
+
return ret;
|
|
365
|
+
};
|
|
366
|
+
exports$1.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
367
|
+
const ret = Number.isSafeInteger(getObject2(arg0));
|
|
368
|
+
return ret;
|
|
369
|
+
};
|
|
370
|
+
exports$1.__wbg_iterator_e5822695327a3c39 = function() {
|
|
371
|
+
const ret = Symbol.iterator;
|
|
372
|
+
return addHeapObject2(ret);
|
|
373
|
+
};
|
|
374
|
+
exports$1.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
375
|
+
const ret = getObject2(arg0).length;
|
|
376
|
+
return ret;
|
|
377
|
+
};
|
|
378
|
+
exports$1.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
379
|
+
const ret = getObject2(arg0).length;
|
|
380
|
+
return ret;
|
|
381
|
+
};
|
|
382
|
+
exports$1.__wbg_new_1acc0b6eea89d040 = function() {
|
|
383
|
+
const ret = new Object();
|
|
384
|
+
return addHeapObject2(ret);
|
|
385
|
+
};
|
|
386
|
+
exports$1.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
387
|
+
const ret = new Uint8Array(getObject2(arg0));
|
|
388
|
+
return addHeapObject2(ret);
|
|
389
|
+
};
|
|
390
|
+
exports$1.__wbg_new_68651c719dcda04e = function() {
|
|
391
|
+
const ret = /* @__PURE__ */ new Map();
|
|
392
|
+
return addHeapObject2(ret);
|
|
393
|
+
};
|
|
394
|
+
exports$1.__wbg_new_e17d9f43105b08be = function() {
|
|
395
|
+
const ret = new Array();
|
|
396
|
+
return addHeapObject2(ret);
|
|
397
|
+
};
|
|
398
|
+
exports$1.__wbg_next_020810e0ae8ebcb0 = function() {
|
|
399
|
+
return handleError2(function(arg0) {
|
|
400
|
+
const ret = getObject2(arg0).next();
|
|
401
|
+
return addHeapObject2(ret);
|
|
402
|
+
}, arguments);
|
|
403
|
+
};
|
|
404
|
+
exports$1.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
405
|
+
const ret = getObject2(arg0).next;
|
|
406
|
+
return addHeapObject2(ret);
|
|
407
|
+
};
|
|
408
|
+
exports$1.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
409
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm02(arg0, arg1), getObject2(arg2));
|
|
410
|
+
};
|
|
411
|
+
exports$1.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
412
|
+
getObject2(arg0)[takeObject2(arg1)] = takeObject2(arg2);
|
|
413
|
+
};
|
|
414
|
+
exports$1.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
415
|
+
const ret = getObject2(arg0).set(getObject2(arg1), getObject2(arg2));
|
|
416
|
+
return addHeapObject2(ret);
|
|
417
|
+
};
|
|
418
|
+
exports$1.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
419
|
+
getObject2(arg0)[arg1 >>> 0] = takeObject2(arg2);
|
|
420
|
+
};
|
|
421
|
+
exports$1.__wbg_value_692627309814bb8c = function(arg0) {
|
|
422
|
+
const ret = getObject2(arg0).value;
|
|
423
|
+
return addHeapObject2(ret);
|
|
424
|
+
};
|
|
425
|
+
exports$1.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
426
|
+
const ret = getStringFromWasm02(arg0, arg1);
|
|
427
|
+
return addHeapObject2(ret);
|
|
428
|
+
};
|
|
429
|
+
exports$1.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
430
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
431
|
+
return addHeapObject2(ret);
|
|
432
|
+
};
|
|
433
|
+
exports$1.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
434
|
+
const ret = arg0;
|
|
435
|
+
return addHeapObject2(ret);
|
|
436
|
+
};
|
|
437
|
+
exports$1.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
438
|
+
const ret = arg0;
|
|
439
|
+
return addHeapObject2(ret);
|
|
440
|
+
};
|
|
441
|
+
exports$1.__wbindgen_object_clone_ref = function(arg0) {
|
|
442
|
+
const ret = getObject2(arg0);
|
|
443
|
+
return addHeapObject2(ret);
|
|
444
|
+
};
|
|
445
|
+
exports$1.__wbindgen_object_drop_ref = function(arg0) {
|
|
446
|
+
takeObject2(arg0);
|
|
447
|
+
};
|
|
448
|
+
var wasmPath = `${__dirname}/kya_os_engine_bg.wasm`;
|
|
449
|
+
var wasmBytes = __require("fs").readFileSync(wasmPath);
|
|
450
|
+
var wasmModule2 = new WebAssembly.Module(wasmBytes);
|
|
451
|
+
var wasm2 = exports$1.__wasm = new WebAssembly.Instance(wasmModule2, imports).exports;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
13
454
|
|
|
14
455
|
// wasm/kya-os-engine-web/kya_os_engine.js
|
|
15
456
|
var kya_os_engine_exports = {};
|
|
16
457
|
__export(kya_os_engine_exports, {
|
|
17
458
|
default: () => kya_os_engine_default,
|
|
18
459
|
initSync: () => initSync,
|
|
19
|
-
verify: () =>
|
|
460
|
+
verify: () => verify2
|
|
20
461
|
});
|
|
21
462
|
function getUint8ArrayMemory0() {
|
|
22
463
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -163,7 +604,7 @@ function takeObject(idx) {
|
|
|
163
604
|
dropObject(idx);
|
|
164
605
|
return ret;
|
|
165
606
|
}
|
|
166
|
-
function
|
|
607
|
+
function verify2(input_js, ctx_js) {
|
|
167
608
|
try {
|
|
168
609
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
169
610
|
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
@@ -582,9 +1023,10 @@ function isBlockedIpv6(hostname) {
|
|
|
582
1023
|
}
|
|
583
1024
|
|
|
584
1025
|
// src/engine/index.ts
|
|
1026
|
+
var wasmModule = __toESM(require_kya_os_engine());
|
|
585
1027
|
function engineVerify(input, ctx) {
|
|
586
|
-
const
|
|
587
|
-
return
|
|
1028
|
+
const verify3 = wasmModule.verify;
|
|
1029
|
+
return verify3(input, ctx);
|
|
588
1030
|
}
|
|
589
1031
|
|
|
590
1032
|
// src/engine/adapters/util.ts
|
|
@@ -902,8 +1344,8 @@ function ensureReady(moduleOrPath) {
|
|
|
902
1344
|
return initialised;
|
|
903
1345
|
}
|
|
904
1346
|
async function engineVerifyEdge(input, ctx) {
|
|
905
|
-
const
|
|
906
|
-
return
|
|
1347
|
+
const verify3 = await ensureReady();
|
|
1348
|
+
return verify3(input, ctx);
|
|
907
1349
|
}
|
|
908
1350
|
|
|
909
1351
|
// src/engine/orchestrator/render-decision.ts
|
|
@@ -1181,5 +1623,3 @@ exports.makeVerifyRequestEdge = makeVerifyRequestEdge;
|
|
|
1181
1623
|
exports.renderDecisionAsResponse = renderDecisionAsResponse;
|
|
1182
1624
|
exports.verifyRequest = verifyRequest;
|
|
1183
1625
|
exports.verifyRequestEdge = verifyRequestEdge;
|
|
1184
|
-
//# sourceMappingURL=orchestrator.js.map
|
|
1185
|
-
//# sourceMappingURL=orchestrator.js.map
|