@kya-os/checkpoint-wasm-runtime 1.0.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 +58 -0
- package/dist/adapters.d.mts +257 -0
- package/dist/adapters.d.ts +257 -0
- package/dist/adapters.js +603 -0
- package/dist/adapters.js.map +1 -0
- package/dist/adapters.mjs +586 -0
- package/dist/adapters.mjs.map +1 -0
- package/dist/dynamic-loader-cS-pUisw.d.ts +65 -0
- package/dist/dynamic-loader-qGJacfEC.d.mts +65 -0
- package/dist/edge.d.mts +22 -0
- package/dist/edge.d.ts +22 -0
- package/dist/edge.js +1403 -0
- package/dist/edge.js.map +1 -0
- package/dist/edge.mjs +1391 -0
- package/dist/edge.mjs.map +1 -0
- package/dist/engine-edge.d.mts +58 -0
- package/dist/engine-edge.d.ts +58 -0
- package/dist/engine-edge.js +537 -0
- package/dist/engine-edge.js.map +1 -0
- package/dist/engine-edge.mjs +533 -0
- package/dist/engine-edge.mjs.map +1 -0
- package/dist/engine.d.mts +34 -0
- package/dist/engine.d.ts +34 -0
- package/dist/engine.js +11 -0
- package/dist/engine.js.map +1 -0
- package/dist/engine.mjs +9 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/index.d.mts +58 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +1652 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1637 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node.d.mts +26 -0
- package/dist/node.d.ts +26 -0
- package/dist/node.js +972 -0
- package/dist/node.js.map +1 -0
- package/dist/node.mjs +960 -0
- package/dist/node.mjs.map +1 -0
- package/dist/orchestrator-edge.d.mts +243 -0
- package/dist/orchestrator-edge.d.ts +243 -0
- package/dist/orchestrator-edge.js +1076 -0
- package/dist/orchestrator-edge.js.map +1 -0
- package/dist/orchestrator-edge.mjs +1065 -0
- package/dist/orchestrator-edge.mjs.map +1 -0
- package/dist/orchestrator.d.mts +50 -0
- package/dist/orchestrator.d.ts +50 -0
- package/dist/orchestrator.js +1185 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/orchestrator.mjs +1172 -0
- package/dist/orchestrator.mjs.map +1 -0
- package/dist/rules-detector-DjbTJ1-Q.d.mts +470 -0
- package/dist/rules-detector-DjbTJ1-Q.d.ts +470 -0
- package/dist/static-loader-C1hUlksK.d.ts +72 -0
- package/dist/static-loader-Ds4iNw7c.d.mts +72 -0
- package/dist/types-D0j85fF0.d.mts +163 -0
- package/dist/types-D0j85fF0.d.ts +163 -0
- package/package.json +141 -0
- package/wasm/agentshield_wasm.d.ts +485 -0
- package/wasm/agentshield_wasm.js +1551 -0
- package/wasm/agentshield_wasm_bg.wasm +0 -0
- package/wasm/agentshield_wasm_bg.wasm.d.ts +97 -0
- package/wasm/kya-os-engine/kya_os_engine.d.ts +24 -0
- package/wasm/kya-os-engine/kya_os_engine.js +517 -0
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm.d.ts +8 -0
- package/wasm/kya-os-engine-web/kya_os_engine.d.ts +56 -0
- package/wasm/kya-os-engine-web/kya_os_engine.js +574 -0
- package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm.d.ts +8 -0
- package/wasm/package.json +30 -0
|
Binary file
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_jsdetectionresult_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_get_jsdetectionresult_is_agent: (a: number) => number;
|
|
6
|
+
export const __wbg_set_jsdetectionresult_is_agent: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_get_jsdetectionresult_is_ai_crawler: (a: number) => number;
|
|
8
|
+
export const __wbg_set_jsdetectionresult_is_ai_crawler: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_get_jsdetectionresult_confidence: (a: number) => number;
|
|
10
|
+
export const __wbg_set_jsdetectionresult_confidence: (a: number, b: number) => void;
|
|
11
|
+
export const jsdetectionresult_agent: (a: number, b: number) => void;
|
|
12
|
+
export const jsdetectionresult_detection_class: (a: number, b: number) => void;
|
|
13
|
+
export const jsdetectionresult_verification_method: (a: number, b: number) => void;
|
|
14
|
+
export const jsdetectionresult_risk_level: (a: number, b: number) => void;
|
|
15
|
+
export const jsdetectionresult_timestamp: (a: number, b: number) => void;
|
|
16
|
+
export const __wbg_jsrequestmetadata_free: (a: number, b: number) => void;
|
|
17
|
+
export const jsrequestmetadata_new: (
|
|
18
|
+
a: number,
|
|
19
|
+
b: number,
|
|
20
|
+
c: number,
|
|
21
|
+
d: number,
|
|
22
|
+
e: number,
|
|
23
|
+
f: number,
|
|
24
|
+
g: number,
|
|
25
|
+
h: number,
|
|
26
|
+
i: number,
|
|
27
|
+
j: number,
|
|
28
|
+
k: number,
|
|
29
|
+
l: number,
|
|
30
|
+
m: number,
|
|
31
|
+
n: number,
|
|
32
|
+
o: number,
|
|
33
|
+
p: number
|
|
34
|
+
) => number;
|
|
35
|
+
export const jsrequestmetadata_user_agent: (a: number, b: number) => void;
|
|
36
|
+
export const jsrequestmetadata_ip_address: (a: number, b: number) => void;
|
|
37
|
+
export const jsrequestmetadata_headers: (a: number, b: number) => void;
|
|
38
|
+
export const jsrequestmetadata_timestamp: (a: number, b: number) => void;
|
|
39
|
+
export const jsrequestmetadata_url: (a: number, b: number) => void;
|
|
40
|
+
export const jsrequestmetadata_method: (a: number, b: number) => void;
|
|
41
|
+
export const jsrequestmetadata_client_fingerprint: (a: number, b: number) => void;
|
|
42
|
+
export const jsrequestmetadata_tls_fingerprint: (a: number, b: number) => void;
|
|
43
|
+
export const init: () => void;
|
|
44
|
+
export const detect_agent: (a: number, b: number) => void;
|
|
45
|
+
export const get_version: (a: number) => void;
|
|
46
|
+
export const get_build_info: (a: number) => void;
|
|
47
|
+
export const __wbg_jsmcpiverificationresult_free: (a: number, b: number) => void;
|
|
48
|
+
export const __wbg_get_jsmcpiverificationresult_verified: (a: number) => number;
|
|
49
|
+
export const __wbg_set_jsmcpiverificationresult_verified: (a: number, b: number) => void;
|
|
50
|
+
export const jsmcpiverificationresult_issuer_did: (a: number, b: number) => void;
|
|
51
|
+
export const jsmcpiverificationresult_subject_did: (a: number, b: number) => void;
|
|
52
|
+
export const jsmcpiverificationresult_error: (a: number, b: number) => void;
|
|
53
|
+
export const verify_mcp_i_proof: (a: number, b: number, c: bigint) => number;
|
|
54
|
+
export const __wbg_jsdidkeyresult_free: (a: number, b: number) => void;
|
|
55
|
+
export const __wbg_get_jsdidkeyresult_success: (a: number) => number;
|
|
56
|
+
export const __wbg_set_jsdidkeyresult_success: (a: number, b: number) => void;
|
|
57
|
+
export const jsdidkeyresult_public_key_hex: (a: number, b: number) => void;
|
|
58
|
+
export const jsdidkeyresult_key_type: (a: number, b: number) => void;
|
|
59
|
+
export const jsdidkeyresult_error: (a: number, b: number) => void;
|
|
60
|
+
export const resolve_did_key_wasm: (a: number, b: number) => number;
|
|
61
|
+
export const __wbg_jsscopecheckresult_free: (a: number, b: number) => void;
|
|
62
|
+
export const jsscopecheckresult_matched_by: (a: number, b: number) => void;
|
|
63
|
+
export const jsscopecheckresult_match_type: (a: number, b: number) => void;
|
|
64
|
+
export const jsscopecheckresult_error: (a: number, b: number) => void;
|
|
65
|
+
export const check_delegation_scope: (a: number, b: number, c: number, d: number) => number;
|
|
66
|
+
export const verify_delegation_scope: (
|
|
67
|
+
a: number,
|
|
68
|
+
b: number,
|
|
69
|
+
c: number,
|
|
70
|
+
d: number,
|
|
71
|
+
e: bigint,
|
|
72
|
+
f: bigint,
|
|
73
|
+
g: bigint
|
|
74
|
+
) => number;
|
|
75
|
+
export const __wbg_jspolicyevaluationresult_free: (a: number, b: number) => void;
|
|
76
|
+
export const jspolicyevaluationresult_action: (a: number, b: number) => void;
|
|
77
|
+
export const jspolicyevaluationresult_reason: (a: number, b: number) => void;
|
|
78
|
+
export const jspolicyevaluationresult_rule_id: (a: number, b: number) => void;
|
|
79
|
+
export const jspolicyevaluationresult_rule_name: (a: number, b: number) => void;
|
|
80
|
+
export const jspolicyevaluationresult_redirect_url: (a: number, b: number) => void;
|
|
81
|
+
export const jspolicyevaluationresult_message: (a: number, b: number) => void;
|
|
82
|
+
export const jspolicyevaluationresult_match_type: (a: number, b: number) => void;
|
|
83
|
+
export const jspolicyevaluationresult_is_allowed: (a: number) => number;
|
|
84
|
+
export const jspolicyevaluationresult_is_blocked: (a: number) => number;
|
|
85
|
+
export const jspolicyevaluationresult_to_json: (a: number, b: number) => void;
|
|
86
|
+
export const evaluate_policy: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
87
|
+
export const policy_allows: (a: number, b: number, c: number, d: number) => number;
|
|
88
|
+
export const version: (a: number) => void;
|
|
89
|
+
export const __wbg_get_jsscopecheckresult_permitted: (a: number) => number;
|
|
90
|
+
export const __wbg_set_jsscopecheckresult_permitted: (a: number, b: number) => void;
|
|
91
|
+
export const __wbg_set_jsmcpiverificationresult_confidence: (a: number, b: number) => void;
|
|
92
|
+
export const __wbg_get_jsmcpiverificationresult_confidence: (a: number) => number;
|
|
93
|
+
export const __wbindgen_export: (a: number, b: number, c: number) => void;
|
|
94
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
95
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
96
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
97
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Cross-boundary `verify` wrapper. The JS host calls `engine.verify(input,
|
|
5
|
+
* ctxSpec)`; on success it gets a [`VerifyResult`] JSON object; on
|
|
6
|
+
* infrastructure failure (or malformed input) it gets a thrown JS error
|
|
7
|
+
* whose message names the failure mode.
|
|
8
|
+
*
|
|
9
|
+
* **Error semantics**:
|
|
10
|
+
*
|
|
11
|
+
* - Verification *verdicts* (Block/Challenge/etc.) surface inside the
|
|
12
|
+
* returned `VerifyResult` — they are not thrown.
|
|
13
|
+
* - Engine [`VerifyError`][crate::error::VerifyError] (resolver / cache /
|
|
14
|
+
* reputation / policy infra failures) surface as thrown JS errors.
|
|
15
|
+
* - Serde deserialisation failures (malformed JS input) surface as thrown
|
|
16
|
+
* JS errors too, mirroring the typed-vs-thrown split.
|
|
17
|
+
*
|
|
18
|
+
* # JS signature
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* function verify(input: AgentRequest, ctx: ContextSpec): VerifyResult;
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function verify(input_js: any, ctx_js: any): any;
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
15
|
+
|
|
16
|
+
cachedTextDecoder.decode();
|
|
17
|
+
|
|
18
|
+
function decodeText(ptr, len) {
|
|
19
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getStringFromWasm0(ptr, len) {
|
|
23
|
+
ptr = ptr >>> 0;
|
|
24
|
+
return decodeText(ptr, len);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let heap = new Array(128).fill(undefined);
|
|
28
|
+
|
|
29
|
+
heap.push(undefined, null, true, false);
|
|
30
|
+
|
|
31
|
+
let heap_next = heap.length;
|
|
32
|
+
|
|
33
|
+
function addHeapObject(obj) {
|
|
34
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
35
|
+
const idx = heap_next;
|
|
36
|
+
heap_next = heap[idx];
|
|
37
|
+
|
|
38
|
+
heap[idx] = obj;
|
|
39
|
+
return idx;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getObject(idx) { return heap[idx]; }
|
|
43
|
+
|
|
44
|
+
let WASM_VECTOR_LEN = 0;
|
|
45
|
+
|
|
46
|
+
const cachedTextEncoder = new TextEncoder();
|
|
47
|
+
|
|
48
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
49
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
50
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
51
|
+
view.set(buf);
|
|
52
|
+
return {
|
|
53
|
+
read: arg.length,
|
|
54
|
+
written: buf.length
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
60
|
+
|
|
61
|
+
if (realloc === undefined) {
|
|
62
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
63
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
64
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
65
|
+
WASM_VECTOR_LEN = buf.length;
|
|
66
|
+
return ptr;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let len = arg.length;
|
|
70
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
71
|
+
|
|
72
|
+
const mem = getUint8ArrayMemory0();
|
|
73
|
+
|
|
74
|
+
let offset = 0;
|
|
75
|
+
|
|
76
|
+
for (; offset < len; offset++) {
|
|
77
|
+
const code = arg.charCodeAt(offset);
|
|
78
|
+
if (code > 0x7F) break;
|
|
79
|
+
mem[ptr + offset] = code;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (offset !== len) {
|
|
83
|
+
if (offset !== 0) {
|
|
84
|
+
arg = arg.slice(offset);
|
|
85
|
+
}
|
|
86
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
87
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
88
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
89
|
+
|
|
90
|
+
offset += ret.written;
|
|
91
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
WASM_VECTOR_LEN = offset;
|
|
95
|
+
return ptr;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let cachedDataViewMemory0 = null;
|
|
99
|
+
|
|
100
|
+
function getDataViewMemory0() {
|
|
101
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
102
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
103
|
+
}
|
|
104
|
+
return cachedDataViewMemory0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function isLikeNone(x) {
|
|
108
|
+
return x === undefined || x === null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function debugString(val) {
|
|
112
|
+
// primitive types
|
|
113
|
+
const type = typeof val;
|
|
114
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
115
|
+
return `${val}`;
|
|
116
|
+
}
|
|
117
|
+
if (type == 'string') {
|
|
118
|
+
return `"${val}"`;
|
|
119
|
+
}
|
|
120
|
+
if (type == 'symbol') {
|
|
121
|
+
const description = val.description;
|
|
122
|
+
if (description == null) {
|
|
123
|
+
return 'Symbol';
|
|
124
|
+
} else {
|
|
125
|
+
return `Symbol(${description})`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (type == 'function') {
|
|
129
|
+
const name = val.name;
|
|
130
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
131
|
+
return `Function(${name})`;
|
|
132
|
+
} else {
|
|
133
|
+
return 'Function';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// objects
|
|
137
|
+
if (Array.isArray(val)) {
|
|
138
|
+
const length = val.length;
|
|
139
|
+
let debug = '[';
|
|
140
|
+
if (length > 0) {
|
|
141
|
+
debug += debugString(val[0]);
|
|
142
|
+
}
|
|
143
|
+
for(let i = 1; i < length; i++) {
|
|
144
|
+
debug += ', ' + debugString(val[i]);
|
|
145
|
+
}
|
|
146
|
+
debug += ']';
|
|
147
|
+
return debug;
|
|
148
|
+
}
|
|
149
|
+
// Test for built-in
|
|
150
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
151
|
+
let className;
|
|
152
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
153
|
+
className = builtInMatches[1];
|
|
154
|
+
} else {
|
|
155
|
+
// Failed to match the standard '[object ClassName]'
|
|
156
|
+
return toString.call(val);
|
|
157
|
+
}
|
|
158
|
+
if (className == 'Object') {
|
|
159
|
+
// we're a user defined class or Object
|
|
160
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
161
|
+
// easier than looping through ownProperties of `val`.
|
|
162
|
+
try {
|
|
163
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
164
|
+
} catch (_) {
|
|
165
|
+
return 'Object';
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// errors
|
|
169
|
+
if (val instanceof Error) {
|
|
170
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
171
|
+
}
|
|
172
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
173
|
+
return className;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function handleError(f, args) {
|
|
177
|
+
try {
|
|
178
|
+
return f.apply(this, args);
|
|
179
|
+
} catch (e) {
|
|
180
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
185
|
+
ptr = ptr >>> 0;
|
|
186
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function dropObject(idx) {
|
|
190
|
+
if (idx < 132) return;
|
|
191
|
+
heap[idx] = heap_next;
|
|
192
|
+
heap_next = idx;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function takeObject(idx) {
|
|
196
|
+
const ret = getObject(idx);
|
|
197
|
+
dropObject(idx);
|
|
198
|
+
return ret;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Cross-boundary `verify` wrapper. The JS host calls `engine.verify(input,
|
|
202
|
+
* ctxSpec)`; on success it gets a [`VerifyResult`] JSON object; on
|
|
203
|
+
* infrastructure failure (or malformed input) it gets a thrown JS error
|
|
204
|
+
* whose message names the failure mode.
|
|
205
|
+
*
|
|
206
|
+
* **Error semantics**:
|
|
207
|
+
*
|
|
208
|
+
* - Verification *verdicts* (Block/Challenge/etc.) surface inside the
|
|
209
|
+
* returned `VerifyResult` — they are not thrown.
|
|
210
|
+
* - Engine [`VerifyError`][crate::error::VerifyError] (resolver / cache /
|
|
211
|
+
* reputation / policy infra failures) surface as thrown JS errors.
|
|
212
|
+
* - Serde deserialisation failures (malformed JS input) surface as thrown
|
|
213
|
+
* JS errors too, mirroring the typed-vs-thrown split.
|
|
214
|
+
*
|
|
215
|
+
* # JS signature
|
|
216
|
+
*
|
|
217
|
+
* ```ts
|
|
218
|
+
* function verify(input: AgentRequest, ctx: ContextSpec): VerifyResult;
|
|
219
|
+
* ```
|
|
220
|
+
* @param {any} input_js
|
|
221
|
+
* @param {any} ctx_js
|
|
222
|
+
* @returns {any}
|
|
223
|
+
*/
|
|
224
|
+
exports.verify = function(input_js, ctx_js) {
|
|
225
|
+
try {
|
|
226
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
227
|
+
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
228
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
229
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
230
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
231
|
+
if (r2) {
|
|
232
|
+
throw takeObject(r1);
|
|
233
|
+
}
|
|
234
|
+
return takeObject(r0);
|
|
235
|
+
} finally {
|
|
236
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
241
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
242
|
+
return addHeapObject(ret);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
exports.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
|
|
246
|
+
const ret = Number(getObject(arg0));
|
|
247
|
+
return ret;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
251
|
+
const ret = String(getObject(arg1));
|
|
252
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
253
|
+
const len1 = WASM_VECTOR_LEN;
|
|
254
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
255
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
exports.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
|
|
259
|
+
const v = getObject(arg1);
|
|
260
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
261
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
262
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
exports.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
|
|
266
|
+
const v = getObject(arg0);
|
|
267
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
268
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
272
|
+
const ret = debugString(getObject(arg1));
|
|
273
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
274
|
+
const len1 = WASM_VECTOR_LEN;
|
|
275
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
276
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
exports.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
|
|
280
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
281
|
+
return ret;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
exports.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
|
|
285
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
286
|
+
return ret;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
exports.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
290
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
291
|
+
return ret;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
exports.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
|
|
295
|
+
const val = getObject(arg0);
|
|
296
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
297
|
+
return ret;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
exports.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
|
|
301
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
302
|
+
return ret;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
exports.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
306
|
+
const ret = getObject(arg0) === undefined;
|
|
307
|
+
return ret;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
exports.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
|
|
311
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
exports.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
|
|
316
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
317
|
+
return ret;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
exports.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
321
|
+
const obj = getObject(arg1);
|
|
322
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
323
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
324
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
exports.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
328
|
+
const obj = getObject(arg1);
|
|
329
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
330
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
331
|
+
var len1 = WASM_VECTOR_LEN;
|
|
332
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
333
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
337
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
exports.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
|
|
341
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
342
|
+
return addHeapObject(ret);
|
|
343
|
+
}, arguments) };
|
|
344
|
+
|
|
345
|
+
exports.__wbg_done_2042aa2670fb1db1 = function(arg0) {
|
|
346
|
+
const ret = getObject(arg0).done;
|
|
347
|
+
return ret;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
exports.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
|
|
351
|
+
const ret = Object.entries(getObject(arg0));
|
|
352
|
+
return addHeapObject(ret);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
exports.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
|
|
356
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
357
|
+
return addHeapObject(ret);
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
exports.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
|
|
361
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
362
|
+
return addHeapObject(ret);
|
|
363
|
+
}, arguments) };
|
|
364
|
+
|
|
365
|
+
exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
366
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
367
|
+
return addHeapObject(ret);
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
exports.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
371
|
+
let result;
|
|
372
|
+
try {
|
|
373
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
374
|
+
} catch (_) {
|
|
375
|
+
result = false;
|
|
376
|
+
}
|
|
377
|
+
const ret = result;
|
|
378
|
+
return ret;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
exports.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
382
|
+
let result;
|
|
383
|
+
try {
|
|
384
|
+
result = getObject(arg0) instanceof Map;
|
|
385
|
+
} catch (_) {
|
|
386
|
+
result = false;
|
|
387
|
+
}
|
|
388
|
+
const ret = result;
|
|
389
|
+
return ret;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
exports.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
393
|
+
let result;
|
|
394
|
+
try {
|
|
395
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
396
|
+
} catch (_) {
|
|
397
|
+
result = false;
|
|
398
|
+
}
|
|
399
|
+
const ret = result;
|
|
400
|
+
return ret;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
exports.__wbg_isArray_96e0af9891d0945d = function(arg0) {
|
|
404
|
+
const ret = Array.isArray(getObject(arg0));
|
|
405
|
+
return ret;
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
exports.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
|
|
409
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
410
|
+
return ret;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
exports.__wbg_iterator_e5822695327a3c39 = function() {
|
|
414
|
+
const ret = Symbol.iterator;
|
|
415
|
+
return addHeapObject(ret);
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
exports.__wbg_length_69bca3cb64fc8748 = function(arg0) {
|
|
419
|
+
const ret = getObject(arg0).length;
|
|
420
|
+
return ret;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
exports.__wbg_length_cdd215e10d9dd507 = function(arg0) {
|
|
424
|
+
const ret = getObject(arg0).length;
|
|
425
|
+
return ret;
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
exports.__wbg_new_1acc0b6eea89d040 = function() {
|
|
429
|
+
const ret = new Object();
|
|
430
|
+
return addHeapObject(ret);
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
exports.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
|
|
434
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
435
|
+
return addHeapObject(ret);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
exports.__wbg_new_68651c719dcda04e = function() {
|
|
439
|
+
const ret = new Map();
|
|
440
|
+
return addHeapObject(ret);
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
exports.__wbg_new_e17d9f43105b08be = function() {
|
|
444
|
+
const ret = new Array();
|
|
445
|
+
return addHeapObject(ret);
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
exports.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
|
|
449
|
+
const ret = getObject(arg0).next();
|
|
450
|
+
return addHeapObject(ret);
|
|
451
|
+
}, arguments) };
|
|
452
|
+
|
|
453
|
+
exports.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
454
|
+
const ret = getObject(arg0).next;
|
|
455
|
+
return addHeapObject(ret);
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
exports.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
|
|
459
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
463
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
exports.__wbg_set_907fb406c34a251d = function(arg0, arg1, arg2) {
|
|
467
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
468
|
+
return addHeapObject(ret);
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
exports.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
|
|
472
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
exports.__wbg_value_692627309814bb8c = function(arg0) {
|
|
476
|
+
const ret = getObject(arg0).value;
|
|
477
|
+
return addHeapObject(ret);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
481
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
482
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
483
|
+
return addHeapObject(ret);
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
487
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
488
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
489
|
+
return addHeapObject(ret);
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
493
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
494
|
+
const ret = arg0;
|
|
495
|
+
return addHeapObject(ret);
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
499
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
500
|
+
const ret = arg0;
|
|
501
|
+
return addHeapObject(ret);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
505
|
+
const ret = getObject(arg0);
|
|
506
|
+
return addHeapObject(ret);
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
510
|
+
takeObject(arg0);
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
const wasmPath = `${__dirname}/kya_os_engine_bg.wasm`;
|
|
514
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
515
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
516
|
+
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
517
|
+
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const verify: (a: number, b: number, c: number) => void;
|
|
5
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
6
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
7
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
8
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|