@kya-os/checkpoint-wasm-runtime 1.3.0 → 1.4.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 +110 -1
- 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 +26 -10
- package/dist/orchestrator-edge.d.ts +26 -10
- package/dist/orchestrator-edge.js +23 -510
- package/dist/orchestrator-edge.mjs +23 -509
- package/dist/orchestrator-node.d.mts +62 -52
- package/dist/orchestrator-node.d.ts +62 -52
- package/dist/orchestrator-node.js +68 -487
- package/dist/orchestrator-node.mjs +52 -497
- package/dist/orchestrator.d.mts +358 -4
- package/dist/orchestrator.d.ts +358 -4
- package/dist/orchestrator.js +55 -1001
- package/dist/orchestrator.mjs +55 -1005
- package/dist/{types-ByrdPLL2.d.ts → types-C3RniIOM.d.mts} +59 -1
- package/dist/{types-ByrdPLL2.d.mts → types-C3RniIOM.d.ts} +59 -1
- package/package.json +13 -2
- package/wasm/kya-os-engine/README.md +26 -0
- package/wasm/kya-os-engine-bundler/kya_os_engine.js +4 -0
- package/wasm/{kya-os-engine/kya_os_engine.js → kya-os-engine-bundler/kya_os_engine_bg.js} +62 -57
- package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-web/README.md +26 -0
- 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
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine/kya_os_engine_bg.wasm.d.ts +0 -8
- package/wasm/kya-os-engine/package.json +0 -7
- package/wasm/kya-os-engine-web/kya_os_engine.d.ts +0 -56
- package/wasm/kya-os-engine-web/kya_os_engine.js +0 -574
- package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
- package/wasm/kya-os-engine-web/package.json +0 -7
- /package/wasm/{kya-os-engine → kya-os-engine-bundler}/kya_os_engine.d.ts +0 -0
- /package/wasm/{kya-os-engine-web → kya-os-engine-bundler}/kya_os_engine_bg.wasm.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,115 @@
|
|
|
1
1
|
# @kya-os/checkpoint-wasm-runtime
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.4.0 — 2026-05-18
|
|
4
|
+
|
|
5
|
+
**Minor release** consolidating SDK-Next.js-Integration-Audit-1
|
|
6
|
+
([#2640](https://github.com/Know-That-Ai/agent-shield/pull/2640)) and
|
|
7
|
+
Engine-Tier3-Monitor-Default
|
|
8
|
+
([#2653](https://github.com/Know-That-Ai/agent-shield/pull/2653)).
|
|
9
|
+
|
|
10
|
+
### Behavioral defaults — Tier-3 now Monitor by default
|
|
11
|
+
|
|
12
|
+
**`EngineConfig.tier3_action` defaults to `'monitor'`.** Engine emits
|
|
13
|
+
Stage 1 classification signals but does NOT short-circuit known-agent
|
|
14
|
+
UAs with `Block { Tier3UAMatch }` of its own — the tenant
|
|
15
|
+
`PolicyEvaluator` is the arbiter. Preserves the 1.3.0 behaviour
|
|
16
|
+
(tenant policy decides). Prevents the day-1 customer-onboarding
|
|
17
|
+
regression a 1.3.1-style hard-coded Block would have caused.
|
|
18
|
+
|
|
19
|
+
**Opt into Block via `tier3_action: 'block'`** when the host wants
|
|
20
|
+
the engine-default block before the tenant policy seam (the bench
|
|
21
|
+
harness + customers who've reviewed their traffic):
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { engineVerify } from '@kya-os/checkpoint-wasm-runtime/engine';
|
|
25
|
+
|
|
26
|
+
const result = engineVerify(input, {
|
|
27
|
+
...ctxSpec,
|
|
28
|
+
config: { tier3Action: 'block' },
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**No breaking change from 1.3.0.** The new `BlockReason::Tier3UAMatch`
|
|
33
|
+
variant + the `EngineConfig` / `Tier3Action` API are additive. The
|
|
34
|
+
1.3.1 patch shipped the Block-default behaviour; 1.4.0 replaces that
|
|
35
|
+
default with Monitor + adds the explicit opt-in. **Do not use 1.3.0
|
|
36
|
+
or 1.3.1; upgrade to 1.4.0.**
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- wasm-bindgen `--target bundler` artifact at
|
|
41
|
+
`wasm/kya-os-engine-bundler/` for Turbopack / Vite / esbuild
|
|
42
|
+
consumers. Exposed via `./engine` (default) + `./orchestrator`.
|
|
43
|
+
- `./engine/node` subpath — explicit nodejs-target safety net for
|
|
44
|
+
Webpack-without-`asyncWebAssembly` consumers. Companion to the
|
|
45
|
+
existing `./orchestrator/node`.
|
|
46
|
+
- `EngineConfig` + `Tier3Action` TS types exported from `./engine`.
|
|
47
|
+
- `wasm:rebuild` npm script that runs the canonical
|
|
48
|
+
`rust/scripts/build-engine-wasm.sh` regen flow.
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- `verify-request.ts` is engine-agnostic — exports
|
|
53
|
+
`createVerifyRequestApi(defaultEngine)` factory; the two entry
|
|
54
|
+
barrels (`./orchestrator/index.ts`, `./orchestrator/node.ts`)
|
|
55
|
+
inject their own engine bridges so `orchestrator-node.mjs` no
|
|
56
|
+
longer transitively imports the bundler artifact's `.wasm`.
|
|
57
|
+
- WASM artifacts (nodejs + web + bundler) rebuilt from post-#2653
|
|
58
|
+
engine source.
|
|
59
|
+
|
|
60
|
+
### Removed
|
|
61
|
+
|
|
62
|
+
- Dead `onSuccess` wasm-copy in `tsup.config.ts`'s
|
|
63
|
+
`nodeFallbackEntries` — the nodejs glue is now an external import.
|
|
64
|
+
- `dynamic-loader.ts` `eval()` runtime-detection probes — the
|
|
65
|
+
bundler-target artifact handles runtime detection natively.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 1.3.1 — 2026-05-18
|
|
70
|
+
|
|
71
|
+
**Patch release on top of 1.3.0** — do NOT use 1.3.0; it was published
|
|
72
|
+
during Engine-Tier3-Ruleset-Wiring-1 review and shipped with three
|
|
73
|
+
issues caught in CI:
|
|
74
|
+
|
|
75
|
+
1. **Hash format pre-coordination.** 1.3.0 shipped a 2-slot
|
|
76
|
+
`sha256:<t2-data-version>:<t3-pattern-sha256>` placeholder
|
|
77
|
+
convention. Engineer A's [#2639](https://github.com/Know-That-Ai/agent-shield/pull/2639)
|
|
78
|
+
merged on main with the canonical 4-slot
|
|
79
|
+
`sha256:t1:<slot>:t2:<slot>:t3:<slot>:t4:<slot>` format. 1.3.1 is
|
|
80
|
+
rebased on that merge — drops this PR's own `TIER3_PATTERN_SHA256`
|
|
81
|
+
const + `tier3_pattern_sha_matches_file` test and consumes
|
|
82
|
+
Engineer A's `build.rs`-emitted `AIVF1_TIER3_PATTERNS_SHA256` env
|
|
83
|
+
var via `TIER3_RULESET_HASH = env!(...)`. Today's value (1.3.1):
|
|
84
|
+
`sha256:t1:unset:t2:<yaml-sha>:t3:<patterns-sha>:t4:unset`.
|
|
85
|
+
|
|
86
|
+
2. **`sfv = "0.14"` leaked into `kya-os-engine`'s `[dependencies]`**
|
|
87
|
+
(literally with a "Temporary measurement dep — DO NOT COMMIT"
|
|
88
|
+
comment), carried in from an unrelated HTTP-Sig-Verifier-1 work
|
|
89
|
+
tree via a stash apply. The crate is not referenced in source, so
|
|
90
|
+
the WASM binary is unaffected, but it adds an unused transitive
|
|
91
|
+
to the dependency graph. Removed in 1.3.1.
|
|
92
|
+
3. **`BlockReason::Tier3UAMatch.confidence` was `f32`**, which round-
|
|
93
|
+
trips through JS `Number` (always f64) with rounding error —
|
|
94
|
+
Rust serialized `0.95` while WASM serialized `0.949999988079071`.
|
|
95
|
+
The cross-runtime parity gate caught this as JSON-string
|
|
96
|
+
divergence even though the underlying f32 bit pattern was
|
|
97
|
+
identical. Fixed in 1.3.1 by quantizing to `u32` percent (0–100)
|
|
98
|
+
at the engine boundary, matching the existing
|
|
99
|
+
`DetectionDetail.confidence` convention.
|
|
100
|
+
|
|
101
|
+
**Wire-format change between 1.3.0 and 1.3.1:**
|
|
102
|
+
|
|
103
|
+
```diff
|
|
104
|
+
- { "kind": "Tier3UAMatch", "confidence": 0.95 }
|
|
105
|
+
+ { "kind": "Tier3UAMatch", "confidence": 95 }
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Any consumer that pinned 1.3.0 must update — `confidence` is now a
|
|
109
|
+
percent integer, not a float. The cross-runtime stability is the
|
|
110
|
+
load-bearing reason; see the Tier3UAMatch docstring.
|
|
111
|
+
|
|
112
|
+
## 1.3.0 — 2026-05-18 (DEPRECATED — see 1.3.1)
|
|
4
113
|
|
|
5
114
|
**Engine-Tier3-Ruleset-Wiring-1.** Replaces the
|
|
6
115
|
`phase-1-d-impl-placeholder` ruleset hash with a real Tier 3 UA
|
package/dist/adapters.d.mts
CHANGED
package/dist/adapters.d.ts
CHANGED
package/dist/engine-edge.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-
|
|
2
|
-
export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction,
|
|
1
|
+
import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-C3RniIOM.mjs';
|
|
2
|
+
export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineConfig, f as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction, T as Tier3Action, g as VerificationMethod } from './types-C3RniIOM.mjs';
|
|
3
3
|
export { DetectionDetail, McpIPayload } from '@kya-os/checkpoint-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/engine-edge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-
|
|
2
|
-
export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction,
|
|
1
|
+
import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-C3RniIOM.js';
|
|
2
|
+
export { a as A2ARequest, b as A2PRequest, B as BlockReason, c as ChallengeParams, D as Decision, d as DidDocument, E as EnforcementMode, e as EngineConfig, f as EngineInfo, H as HttpSignedRequest, I as InstructPayload, K as KeyType, M as McpIRequest, P as PlainHttpRequest, R as RedirectTarget, S as SuggestedAction, T as Tier3Action, g as VerificationMethod } from './types-C3RniIOM.js';
|
|
3
3
|
export { DetectionDetail, McpIPayload } from '@kya-os/checkpoint-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/engine-edge.js
CHANGED
|
@@ -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('engine-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/edge.ts
|
|
510
4
|
var initialised = null;
|
|
511
5
|
function initEngineEdge(moduleOrPath) {
|
|
@@ -514,7 +8,7 @@ function initEngineEdge(moduleOrPath) {
|
|
|
514
8
|
function ensureReady(moduleOrPath) {
|
|
515
9
|
if (initialised) return initialised;
|
|
516
10
|
const pending = (async () => {
|
|
517
|
-
const mod = await
|
|
11
|
+
const mod = await import('@kya-os/checkpoint-wasm-runtime/wasm/kya-os-engine-web/kya_os_engine.js');
|
|
518
12
|
await mod.default(moduleOrPath !== void 0 ? { module_or_path: moduleOrPath } : void 0);
|
|
519
13
|
return mod.verify;
|
|
520
14
|
})();
|
|
@@ -527,8 +21,8 @@ function ensureReady(moduleOrPath) {
|
|
|
527
21
|
return initialised;
|
|
528
22
|
}
|
|
529
23
|
async function engineVerifyEdge(input, ctx) {
|
|
530
|
-
const
|
|
531
|
-
return
|
|
24
|
+
const verify = await ensureReady();
|
|
25
|
+
return verify(input, ctx);
|
|
532
26
|
}
|
|
533
27
|
|
|
534
28
|
exports.engineVerifyEdge = engineVerifyEdge;
|