@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
|
@@ -80,6 +80,34 @@ type BlockReason = {
|
|
|
80
80
|
} | {
|
|
81
81
|
kind: 'ParseError';
|
|
82
82
|
detail: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Tier-2 IP+UA cross-match against the vendor SSOT (AIVF-1 Path B
|
|
86
|
+
* / agent-shield#2639). Emitted by `TieredPolicy` when the request
|
|
87
|
+
* carries both a vendor-published IP and a matching UA pattern.
|
|
88
|
+
* `tier` is the tier ordinal (`2` for IP+UA cross-match today;
|
|
89
|
+
* reserved for future Tier-1 cryptographic attribution).
|
|
90
|
+
* `confidence` is f32 in `[0.0, 1.0]`.
|
|
91
|
+
*/
|
|
92
|
+
| {
|
|
93
|
+
kind: 'AgentAttribution';
|
|
94
|
+
vendor: string;
|
|
95
|
+
tier: number;
|
|
96
|
+
confidence: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Tier-3 UA-only pattern match short-circuit (Engine-Tier3-
|
|
100
|
+
* Ruleset-Wiring-1 / agent-shield#2641). Emitted at Stage 1b when
|
|
101
|
+
* `EngineConfig.tier3_action == Block` and the request classifies
|
|
102
|
+
* as KnownAiAgent / AiCrawler / HeadlessBrowser. **Field names are
|
|
103
|
+
* snake_case on the wire** (no `rename_all` on the Rust enum) —
|
|
104
|
+
* they mirror the Rust struct field names verbatim.
|
|
105
|
+
*/
|
|
106
|
+
| {
|
|
107
|
+
kind: 'Tier3UAMatch';
|
|
108
|
+
pattern_id: string;
|
|
109
|
+
pattern_kind: string;
|
|
110
|
+
confidence: number;
|
|
83
111
|
};
|
|
84
112
|
interface ChallengeParams {
|
|
85
113
|
nonce: string;
|
|
@@ -159,6 +187,36 @@ interface ContextSpec {
|
|
|
159
187
|
tenantDecision: Decision;
|
|
160
188
|
nowUnix: number;
|
|
161
189
|
enforcementMode: EnforcementMode;
|
|
190
|
+
/**
|
|
191
|
+
* Engine-default behaviour knobs. Omit, or pass `{}`, to take the
|
|
192
|
+
* customer-onboarding-safe defaults (Tier-3 in Monitor mode —
|
|
193
|
+
* tenant policy is the arbiter). See [`EngineConfig`].
|
|
194
|
+
*/
|
|
195
|
+
config?: EngineConfig;
|
|
162
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Engine-default behaviour knobs the host can opt into. Mirrors the
|
|
199
|
+
* Rust `kya_os_engine::EngineConfig` shape; deserialised by the WASM
|
|
200
|
+
* glue with `#[serde(default)]` so an absent / empty `config` resolves
|
|
201
|
+
* to the safe defaults.
|
|
202
|
+
*/
|
|
203
|
+
interface EngineConfig {
|
|
204
|
+
/**
|
|
205
|
+
* Tier-3 (UA-only pattern match) engine-default action. Defaults to
|
|
206
|
+
* `'monitor'` — Stage 1 classification flows through to the tenant
|
|
207
|
+
* policy evaluator, but the engine does NOT short-circuit with its
|
|
208
|
+
* own `Block { Tier3UAMatch }`. Set to `'block'` when the host
|
|
209
|
+
* wants the engine to emit an engine-default block for known-agent
|
|
210
|
+
* UAs before the tenant policy seam (e.g., the bench harness or
|
|
211
|
+
* customers who've reviewed their traffic and want the calibrated
|
|
212
|
+
* block without writing a tenant-policy rule).
|
|
213
|
+
*/
|
|
214
|
+
tier3Action?: Tier3Action;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Tier-3 default action — `'monitor'` (default) lets tenant policy
|
|
218
|
+
* decide; `'block'` opts into the engine-default short-circuit.
|
|
219
|
+
*/
|
|
220
|
+
type Tier3Action = 'monitor' | 'block';
|
|
163
221
|
|
|
164
|
-
export type { AgentRequest as A, BlockReason as B, ContextSpec as C, Decision as D, EnforcementMode as E, HttpSignedRequest as H, InstructPayload as I, KeyType as K, McpIRequest as M, PlainHttpRequest as P, RedirectTarget as R, SuggestedAction as S, VerifyResult as V, A2ARequest as a, A2PRequest as b, ChallengeParams as c, DidDocument as d,
|
|
222
|
+
export type { AgentRequest as A, BlockReason as B, ContextSpec as C, Decision as D, EnforcementMode as E, HttpSignedRequest as H, InstructPayload as I, KeyType as K, McpIRequest as M, PlainHttpRequest as P, RedirectTarget as R, SuggestedAction as S, Tier3Action as T, VerifyResult as V, A2ARequest as a, A2PRequest as b, ChallengeParams as c, DidDocument as d, EngineConfig as e, EngineInfo as f, VerificationMethod as g };
|
|
@@ -80,6 +80,34 @@ type BlockReason = {
|
|
|
80
80
|
} | {
|
|
81
81
|
kind: 'ParseError';
|
|
82
82
|
detail: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Tier-2 IP+UA cross-match against the vendor SSOT (AIVF-1 Path B
|
|
86
|
+
* / agent-shield#2639). Emitted by `TieredPolicy` when the request
|
|
87
|
+
* carries both a vendor-published IP and a matching UA pattern.
|
|
88
|
+
* `tier` is the tier ordinal (`2` for IP+UA cross-match today;
|
|
89
|
+
* reserved for future Tier-1 cryptographic attribution).
|
|
90
|
+
* `confidence` is f32 in `[0.0, 1.0]`.
|
|
91
|
+
*/
|
|
92
|
+
| {
|
|
93
|
+
kind: 'AgentAttribution';
|
|
94
|
+
vendor: string;
|
|
95
|
+
tier: number;
|
|
96
|
+
confidence: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Tier-3 UA-only pattern match short-circuit (Engine-Tier3-
|
|
100
|
+
* Ruleset-Wiring-1 / agent-shield#2641). Emitted at Stage 1b when
|
|
101
|
+
* `EngineConfig.tier3_action == Block` and the request classifies
|
|
102
|
+
* as KnownAiAgent / AiCrawler / HeadlessBrowser. **Field names are
|
|
103
|
+
* snake_case on the wire** (no `rename_all` on the Rust enum) —
|
|
104
|
+
* they mirror the Rust struct field names verbatim.
|
|
105
|
+
*/
|
|
106
|
+
| {
|
|
107
|
+
kind: 'Tier3UAMatch';
|
|
108
|
+
pattern_id: string;
|
|
109
|
+
pattern_kind: string;
|
|
110
|
+
confidence: number;
|
|
83
111
|
};
|
|
84
112
|
interface ChallengeParams {
|
|
85
113
|
nonce: string;
|
|
@@ -159,6 +187,36 @@ interface ContextSpec {
|
|
|
159
187
|
tenantDecision: Decision;
|
|
160
188
|
nowUnix: number;
|
|
161
189
|
enforcementMode: EnforcementMode;
|
|
190
|
+
/**
|
|
191
|
+
* Engine-default behaviour knobs. Omit, or pass `{}`, to take the
|
|
192
|
+
* customer-onboarding-safe defaults (Tier-3 in Monitor mode —
|
|
193
|
+
* tenant policy is the arbiter). See [`EngineConfig`].
|
|
194
|
+
*/
|
|
195
|
+
config?: EngineConfig;
|
|
162
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Engine-default behaviour knobs the host can opt into. Mirrors the
|
|
199
|
+
* Rust `kya_os_engine::EngineConfig` shape; deserialised by the WASM
|
|
200
|
+
* glue with `#[serde(default)]` so an absent / empty `config` resolves
|
|
201
|
+
* to the safe defaults.
|
|
202
|
+
*/
|
|
203
|
+
interface EngineConfig {
|
|
204
|
+
/**
|
|
205
|
+
* Tier-3 (UA-only pattern match) engine-default action. Defaults to
|
|
206
|
+
* `'monitor'` — Stage 1 classification flows through to the tenant
|
|
207
|
+
* policy evaluator, but the engine does NOT short-circuit with its
|
|
208
|
+
* own `Block { Tier3UAMatch }`. Set to `'block'` when the host
|
|
209
|
+
* wants the engine to emit an engine-default block for known-agent
|
|
210
|
+
* UAs before the tenant policy seam (e.g., the bench harness or
|
|
211
|
+
* customers who've reviewed their traffic and want the calibrated
|
|
212
|
+
* block without writing a tenant-policy rule).
|
|
213
|
+
*/
|
|
214
|
+
tier3Action?: Tier3Action;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Tier-3 default action — `'monitor'` (default) lets tenant policy
|
|
218
|
+
* decide; `'block'` opts into the engine-default short-circuit.
|
|
219
|
+
*/
|
|
220
|
+
type Tier3Action = 'monitor' | 'block';
|
|
163
221
|
|
|
164
|
-
export type { AgentRequest as A, BlockReason as B, ContextSpec as C, Decision as D, EnforcementMode as E, HttpSignedRequest as H, InstructPayload as I, KeyType as K, McpIRequest as M, PlainHttpRequest as P, RedirectTarget as R, SuggestedAction as S, VerifyResult as V, A2ARequest as a, A2PRequest as b, ChallengeParams as c, DidDocument as d,
|
|
222
|
+
export type { AgentRequest as A, BlockReason as B, ContextSpec as C, Decision as D, EnforcementMode as E, HttpSignedRequest as H, InstructPayload as I, KeyType as K, McpIRequest as M, PlainHttpRequest as P, RedirectTarget as R, SuggestedAction as S, Tier3Action as T, VerifyResult as V, A2ARequest as a, A2PRequest as b, ChallengeParams as c, DidDocument as d, EngineConfig as e, EngineInfo as f, VerificationMethod as g };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/checkpoint-wasm-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Checkpoint WASM runtime for AI agent detection across all environments (formerly @kya-os/agentshield-wasm-runtime)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -66,6 +66,11 @@
|
|
|
66
66
|
"import": "./dist/engine-edge.mjs",
|
|
67
67
|
"require": "./dist/engine-edge.js"
|
|
68
68
|
},
|
|
69
|
+
"./engine/node": {
|
|
70
|
+
"types": "./dist/engine-node.d.ts",
|
|
71
|
+
"import": "./dist/engine-node.mjs",
|
|
72
|
+
"require": "./dist/engine-node.js"
|
|
73
|
+
},
|
|
69
74
|
"./orchestrator": {
|
|
70
75
|
"edge-runtime": {
|
|
71
76
|
"types": "./dist/orchestrator-edge.d.ts",
|
|
@@ -104,6 +109,8 @@
|
|
|
104
109
|
"./wasm/agentshield_wasm_bg.wasm": "./wasm/agentshield_wasm_bg.wasm",
|
|
105
110
|
"./wasm/kya-os-engine/kya_os_engine_bg.wasm": "./wasm/kya-os-engine/kya_os_engine_bg.wasm",
|
|
106
111
|
"./wasm/kya-os-engine-web/kya_os_engine_bg.wasm": "./wasm/kya-os-engine-web/kya_os_engine_bg.wasm",
|
|
112
|
+
"./wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm": "./wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm",
|
|
113
|
+
"./wasm/*": "./wasm/*",
|
|
107
114
|
"./package.json": "./package.json"
|
|
108
115
|
},
|
|
109
116
|
"files": [
|
|
@@ -125,6 +132,8 @@
|
|
|
125
132
|
"rimraf": "^5.0.5",
|
|
126
133
|
"tsup": "^8.0.2",
|
|
127
134
|
"typescript": "^5.4.2",
|
|
135
|
+
"vite-plugin-top-level-await": "^1.6.0",
|
|
136
|
+
"vite-plugin-wasm": "^3.6.0",
|
|
128
137
|
"vitest": "^1.3.1"
|
|
129
138
|
},
|
|
130
139
|
"publishConfig": {
|
|
@@ -148,6 +157,8 @@
|
|
|
148
157
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,md}\"",
|
|
149
158
|
"copy-wasm": "mkdir -p ./wasm && cp ../../rust/crates/agentshield-wasm/pkg/agentshield_wasm_bg.wasm ./wasm/",
|
|
150
159
|
"copy-engine-wasm": "mkdir -p ./wasm/kya-os-engine && cp ../../rust/crates/kya-os-engine/pkg/kya_os_engine_bg.wasm ../../rust/crates/kya-os-engine/pkg/kya_os_engine_bg.wasm.d.ts ../../rust/crates/kya-os-engine/pkg/kya_os_engine.d.ts ../../rust/crates/kya-os-engine/pkg/kya_os_engine.js ./wasm/kya-os-engine/",
|
|
151
|
-
"copy-engine-wasm-web": "mkdir -p ./wasm/kya-os-engine-web && cp ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine_bg.wasm ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine_bg.wasm.d.ts ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine.d.ts ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine.js ./wasm/kya-os-engine-web/"
|
|
160
|
+
"copy-engine-wasm-web": "mkdir -p ./wasm/kya-os-engine-web && cp ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine_bg.wasm ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine_bg.wasm.d.ts ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine.d.ts ../../rust/crates/kya-os-engine/pkg-web/kya_os_engine.js ./wasm/kya-os-engine-web/",
|
|
161
|
+
"copy-engine-wasm-bundler": "mkdir -p ./wasm/kya-os-engine-bundler && cp ../../rust/crates/kya-os-engine/pkg-bundler/kya_os_engine_bg.wasm ../../rust/crates/kya-os-engine/pkg-bundler/kya_os_engine_bg.wasm.d.ts ../../rust/crates/kya-os-engine/pkg-bundler/kya_os_engine_bg.js ../../rust/crates/kya-os-engine/pkg-bundler/kya_os_engine.d.ts ../../rust/crates/kya-os-engine/pkg-bundler/kya_os_engine.js ./wasm/kya-os-engine-bundler/",
|
|
162
|
+
"wasm:rebuild": "bash ../../rust/scripts/build-engine-wasm.sh"
|
|
152
163
|
}
|
|
153
164
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# kya-os-engine
|
|
2
|
+
|
|
3
|
+
Verification engine for the KYA-OS ecosystem. Every TS / .NET / Go / Python /
|
|
4
|
+
Cloudflare-Workers host wrapper is a thin shim around the WASM or WASI build of
|
|
5
|
+
this crate. ADR-001 (Engine-Centric Consolidation) is the architectural
|
|
6
|
+
decision; the locked public API contract is tracked in D-design
|
|
7
|
+
([issue #2484][issue]) and mirrored at
|
|
8
|
+
[`docs/architecture/D-design-ratification.md`][ratification].
|
|
9
|
+
|
|
10
|
+
`kya-os-engine` is the root of the dependency graph. It depends on
|
|
11
|
+
nothing from `@kya-os/*`, `agentshield-*`, or `checkpoint-*`; the
|
|
12
|
+
direction is the other way.
|
|
13
|
+
|
|
14
|
+
The public surface is one function (`verify`), one decision vocabulary (`Decision`
|
|
15
|
+
with five variants — `Permit`, `Block`, `Challenge`, `Redirect`, `Instruct`),
|
|
16
|
+
five dependency-injection traits (`DidResolver`, `StatusListCache`,
|
|
17
|
+
`ReputationOracle`, `PolicyEvaluator`, `Clock`), and one canonical-signing-payload
|
|
18
|
+
helper (`canonical_signing_payload`, RFC 8785 / JCS).
|
|
19
|
+
|
|
20
|
+
This is the **Layer 1 API lock** (D-design, [issue #2484][issue]). The body of
|
|
21
|
+
`verify()` is `todo!()`; trait methods are stubbed. D-impl
|
|
22
|
+
([issue #2485][impl]) satisfies the contract.
|
|
23
|
+
|
|
24
|
+
[issue]: https://github.com/Know-That-Ai/agent-shield/issues/2484
|
|
25
|
+
[impl]: https://github.com/Know-That-Ai/agent-shield/issues/2485
|
|
26
|
+
[ratification]: ../../../docs/architecture/D-design-ratification.md
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
1
5
|
|
|
2
|
-
let imports = {};
|
|
3
|
-
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
6
|
|
|
5
7
|
let cachedUint8ArrayMemory0 = null;
|
|
6
8
|
|
|
@@ -15,7 +17,15 @@ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true
|
|
|
15
17
|
|
|
16
18
|
cachedTextDecoder.decode();
|
|
17
19
|
|
|
20
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
21
|
+
let numBytesDecoded = 0;
|
|
18
22
|
function decodeText(ptr, len) {
|
|
23
|
+
numBytesDecoded += len;
|
|
24
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
25
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
26
|
+
cachedTextDecoder.decode();
|
|
27
|
+
numBytesDecoded = len;
|
|
28
|
+
}
|
|
19
29
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
20
30
|
}
|
|
21
31
|
|
|
@@ -221,7 +231,7 @@ function takeObject(idx) {
|
|
|
221
231
|
* @param {any} ctx_js
|
|
222
232
|
* @returns {any}
|
|
223
233
|
*/
|
|
224
|
-
|
|
234
|
+
export function verify(input_js, ctx_js) {
|
|
225
235
|
try {
|
|
226
236
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
227
237
|
wasm.verify(retptr, addHeapObject(input_js), addHeapObject(ctx_js));
|
|
@@ -235,19 +245,19 @@ exports.verify = function(input_js, ctx_js) {
|
|
|
235
245
|
} finally {
|
|
236
246
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
237
247
|
}
|
|
238
|
-
}
|
|
248
|
+
}
|
|
239
249
|
|
|
240
|
-
|
|
250
|
+
export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
|
|
241
251
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
242
252
|
return addHeapObject(ret);
|
|
243
253
|
};
|
|
244
254
|
|
|
245
|
-
|
|
255
|
+
export function __wbg_Number_bb48ca12f395cd08(arg0) {
|
|
246
256
|
const ret = Number(getObject(arg0));
|
|
247
257
|
return ret;
|
|
248
258
|
};
|
|
249
259
|
|
|
250
|
-
|
|
260
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
251
261
|
const ret = String(getObject(arg1));
|
|
252
262
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
253
263
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -255,20 +265,20 @@ exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
|
255
265
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
256
266
|
};
|
|
257
267
|
|
|
258
|
-
|
|
268
|
+
export function __wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd(arg0, arg1) {
|
|
259
269
|
const v = getObject(arg1);
|
|
260
270
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
261
271
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
262
272
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
263
273
|
};
|
|
264
274
|
|
|
265
|
-
|
|
275
|
+
export function __wbg___wbindgen_boolean_get_6d5a1ee65bab5f68(arg0) {
|
|
266
276
|
const v = getObject(arg0);
|
|
267
277
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
268
278
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
269
279
|
};
|
|
270
280
|
|
|
271
|
-
|
|
281
|
+
export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
|
|
272
282
|
const ret = debugString(getObject(arg1));
|
|
273
283
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
274
284
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -276,55 +286,55 @@ exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
|
|
|
276
286
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
277
287
|
};
|
|
278
288
|
|
|
279
|
-
|
|
289
|
+
export function __wbg___wbindgen_in_bb933bd9e1b3bc0f(arg0, arg1) {
|
|
280
290
|
const ret = getObject(arg0) in getObject(arg1);
|
|
281
291
|
return ret;
|
|
282
292
|
};
|
|
283
293
|
|
|
284
|
-
|
|
294
|
+
export function __wbg___wbindgen_is_bigint_cb320707dcd35f0b(arg0) {
|
|
285
295
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
286
296
|
return ret;
|
|
287
297
|
};
|
|
288
298
|
|
|
289
|
-
|
|
299
|
+
export function __wbg___wbindgen_is_function_ee8a6c5833c90377(arg0) {
|
|
290
300
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
291
301
|
return ret;
|
|
292
302
|
};
|
|
293
303
|
|
|
294
|
-
|
|
304
|
+
export function __wbg___wbindgen_is_object_c818261d21f283a4(arg0) {
|
|
295
305
|
const val = getObject(arg0);
|
|
296
306
|
const ret = typeof(val) === 'object' && val !== null;
|
|
297
307
|
return ret;
|
|
298
308
|
};
|
|
299
309
|
|
|
300
|
-
|
|
310
|
+
export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
|
|
301
311
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
302
312
|
return ret;
|
|
303
313
|
};
|
|
304
314
|
|
|
305
|
-
|
|
315
|
+
export function __wbg___wbindgen_is_undefined_2d472862bd29a478(arg0) {
|
|
306
316
|
const ret = getObject(arg0) === undefined;
|
|
307
317
|
return ret;
|
|
308
318
|
};
|
|
309
319
|
|
|
310
|
-
|
|
320
|
+
export function __wbg___wbindgen_jsval_eq_6b13ab83478b1c50(arg0, arg1) {
|
|
311
321
|
const ret = getObject(arg0) === getObject(arg1);
|
|
312
322
|
return ret;
|
|
313
323
|
};
|
|
314
324
|
|
|
315
|
-
|
|
325
|
+
export function __wbg___wbindgen_jsval_loose_eq_b664b38a2f582147(arg0, arg1) {
|
|
316
326
|
const ret = getObject(arg0) == getObject(arg1);
|
|
317
327
|
return ret;
|
|
318
328
|
};
|
|
319
329
|
|
|
320
|
-
|
|
330
|
+
export function __wbg___wbindgen_number_get_a20bf9b85341449d(arg0, arg1) {
|
|
321
331
|
const obj = getObject(arg1);
|
|
322
332
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
323
333
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
324
334
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
325
335
|
};
|
|
326
336
|
|
|
327
|
-
|
|
337
|
+
export function __wbg___wbindgen_string_get_e4f06c90489ad01b(arg0, arg1) {
|
|
328
338
|
const obj = getObject(arg1);
|
|
329
339
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
330
340
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -333,41 +343,41 @@ exports.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
|
|
|
333
343
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
334
344
|
};
|
|
335
345
|
|
|
336
|
-
|
|
346
|
+
export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
|
|
337
347
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
338
348
|
};
|
|
339
349
|
|
|
340
|
-
|
|
350
|
+
export function __wbg_call_e762c39fa8ea36bf() { return handleError(function (arg0, arg1) {
|
|
341
351
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
342
352
|
return addHeapObject(ret);
|
|
343
353
|
}, arguments) };
|
|
344
354
|
|
|
345
|
-
|
|
355
|
+
export function __wbg_done_2042aa2670fb1db1(arg0) {
|
|
346
356
|
const ret = getObject(arg0).done;
|
|
347
357
|
return ret;
|
|
348
358
|
};
|
|
349
359
|
|
|
350
|
-
|
|
360
|
+
export function __wbg_entries_e171b586f8f6bdbf(arg0) {
|
|
351
361
|
const ret = Object.entries(getObject(arg0));
|
|
352
362
|
return addHeapObject(ret);
|
|
353
363
|
};
|
|
354
364
|
|
|
355
|
-
|
|
365
|
+
export function __wbg_get_7bed016f185add81(arg0, arg1) {
|
|
356
366
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
357
367
|
return addHeapObject(ret);
|
|
358
368
|
};
|
|
359
369
|
|
|
360
|
-
|
|
370
|
+
export function __wbg_get_efcb449f58ec27c2() { return handleError(function (arg0, arg1) {
|
|
361
371
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
362
372
|
return addHeapObject(ret);
|
|
363
373
|
}, arguments) };
|
|
364
374
|
|
|
365
|
-
|
|
375
|
+
export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
|
|
366
376
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
367
377
|
return addHeapObject(ret);
|
|
368
378
|
};
|
|
369
379
|
|
|
370
|
-
|
|
380
|
+
export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
|
|
371
381
|
let result;
|
|
372
382
|
try {
|
|
373
383
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -378,7 +388,7 @@ exports.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
|
|
|
378
388
|
return ret;
|
|
379
389
|
};
|
|
380
390
|
|
|
381
|
-
|
|
391
|
+
export function __wbg_instanceof_Map_8579b5e2ab5437c7(arg0) {
|
|
382
392
|
let result;
|
|
383
393
|
try {
|
|
384
394
|
result = getObject(arg0) instanceof Map;
|
|
@@ -389,7 +399,7 @@ exports.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
|
|
|
389
399
|
return ret;
|
|
390
400
|
};
|
|
391
401
|
|
|
392
|
-
|
|
402
|
+
export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
|
|
393
403
|
let result;
|
|
394
404
|
try {
|
|
395
405
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -400,118 +410,113 @@ exports.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
|
400
410
|
return ret;
|
|
401
411
|
};
|
|
402
412
|
|
|
403
|
-
|
|
413
|
+
export function __wbg_isArray_96e0af9891d0945d(arg0) {
|
|
404
414
|
const ret = Array.isArray(getObject(arg0));
|
|
405
415
|
return ret;
|
|
406
416
|
};
|
|
407
417
|
|
|
408
|
-
|
|
418
|
+
export function __wbg_isSafeInteger_d216eda7911dde36(arg0) {
|
|
409
419
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
410
420
|
return ret;
|
|
411
421
|
};
|
|
412
422
|
|
|
413
|
-
|
|
423
|
+
export function __wbg_iterator_e5822695327a3c39() {
|
|
414
424
|
const ret = Symbol.iterator;
|
|
415
425
|
return addHeapObject(ret);
|
|
416
426
|
};
|
|
417
427
|
|
|
418
|
-
|
|
428
|
+
export function __wbg_length_69bca3cb64fc8748(arg0) {
|
|
419
429
|
const ret = getObject(arg0).length;
|
|
420
430
|
return ret;
|
|
421
431
|
};
|
|
422
432
|
|
|
423
|
-
|
|
433
|
+
export function __wbg_length_cdd215e10d9dd507(arg0) {
|
|
424
434
|
const ret = getObject(arg0).length;
|
|
425
435
|
return ret;
|
|
426
436
|
};
|
|
427
437
|
|
|
428
|
-
|
|
438
|
+
export function __wbg_new_1acc0b6eea89d040() {
|
|
429
439
|
const ret = new Object();
|
|
430
440
|
return addHeapObject(ret);
|
|
431
441
|
};
|
|
432
442
|
|
|
433
|
-
|
|
443
|
+
export function __wbg_new_5a79be3ab53b8aa5(arg0) {
|
|
434
444
|
const ret = new Uint8Array(getObject(arg0));
|
|
435
445
|
return addHeapObject(ret);
|
|
436
446
|
};
|
|
437
447
|
|
|
438
|
-
|
|
448
|
+
export function __wbg_new_68651c719dcda04e() {
|
|
439
449
|
const ret = new Map();
|
|
440
450
|
return addHeapObject(ret);
|
|
441
451
|
};
|
|
442
452
|
|
|
443
|
-
|
|
453
|
+
export function __wbg_new_e17d9f43105b08be() {
|
|
444
454
|
const ret = new Array();
|
|
445
455
|
return addHeapObject(ret);
|
|
446
456
|
};
|
|
447
457
|
|
|
448
|
-
|
|
458
|
+
export function __wbg_next_020810e0ae8ebcb0() { return handleError(function (arg0) {
|
|
449
459
|
const ret = getObject(arg0).next();
|
|
450
460
|
return addHeapObject(ret);
|
|
451
461
|
}, arguments) };
|
|
452
462
|
|
|
453
|
-
|
|
463
|
+
export function __wbg_next_2c826fe5dfec6b6a(arg0) {
|
|
454
464
|
const ret = getObject(arg0).next;
|
|
455
465
|
return addHeapObject(ret);
|
|
456
466
|
};
|
|
457
467
|
|
|
458
|
-
|
|
468
|
+
export function __wbg_prototypesetcall_2a6620b6922694b2(arg0, arg1, arg2) {
|
|
459
469
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
460
470
|
};
|
|
461
471
|
|
|
462
|
-
|
|
472
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
463
473
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
464
474
|
};
|
|
465
475
|
|
|
466
|
-
|
|
476
|
+
export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
|
|
467
477
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
468
478
|
return addHeapObject(ret);
|
|
469
479
|
};
|
|
470
480
|
|
|
471
|
-
|
|
481
|
+
export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
|
|
472
482
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
473
483
|
};
|
|
474
484
|
|
|
475
|
-
|
|
485
|
+
export function __wbg_value_692627309814bb8c(arg0) {
|
|
476
486
|
const ret = getObject(arg0).value;
|
|
477
487
|
return addHeapObject(ret);
|
|
478
488
|
};
|
|
479
489
|
|
|
480
|
-
|
|
490
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
481
491
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
482
492
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
483
493
|
return addHeapObject(ret);
|
|
484
494
|
};
|
|
485
495
|
|
|
486
|
-
|
|
496
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
487
497
|
// Cast intrinsic for `U64 -> Externref`.
|
|
488
498
|
const ret = BigInt.asUintN(64, arg0);
|
|
489
499
|
return addHeapObject(ret);
|
|
490
500
|
};
|
|
491
501
|
|
|
492
|
-
|
|
502
|
+
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
493
503
|
// Cast intrinsic for `I64 -> Externref`.
|
|
494
504
|
const ret = arg0;
|
|
495
505
|
return addHeapObject(ret);
|
|
496
506
|
};
|
|
497
507
|
|
|
498
|
-
|
|
508
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
499
509
|
// Cast intrinsic for `F64 -> Externref`.
|
|
500
510
|
const ret = arg0;
|
|
501
511
|
return addHeapObject(ret);
|
|
502
512
|
};
|
|
503
513
|
|
|
504
|
-
|
|
514
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
505
515
|
const ret = getObject(arg0);
|
|
506
516
|
return addHeapObject(ret);
|
|
507
517
|
};
|
|
508
518
|
|
|
509
|
-
|
|
519
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
510
520
|
takeObject(arg0);
|
|
511
521
|
};
|
|
512
522
|
|
|
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,26 @@
|
|
|
1
|
+
# kya-os-engine
|
|
2
|
+
|
|
3
|
+
Verification engine for the KYA-OS ecosystem. Every TS / .NET / Go / Python /
|
|
4
|
+
Cloudflare-Workers host wrapper is a thin shim around the WASM or WASI build of
|
|
5
|
+
this crate. ADR-001 (Engine-Centric Consolidation) is the architectural
|
|
6
|
+
decision; the locked public API contract is tracked in D-design
|
|
7
|
+
([issue #2484][issue]) and mirrored at
|
|
8
|
+
[`docs/architecture/D-design-ratification.md`][ratification].
|
|
9
|
+
|
|
10
|
+
`kya-os-engine` is the root of the dependency graph. It depends on
|
|
11
|
+
nothing from `@kya-os/*`, `agentshield-*`, or `checkpoint-*`; the
|
|
12
|
+
direction is the other way.
|
|
13
|
+
|
|
14
|
+
The public surface is one function (`verify`), one decision vocabulary (`Decision`
|
|
15
|
+
with five variants — `Permit`, `Block`, `Challenge`, `Redirect`, `Instruct`),
|
|
16
|
+
five dependency-injection traits (`DidResolver`, `StatusListCache`,
|
|
17
|
+
`ReputationOracle`, `PolicyEvaluator`, `Clock`), and one canonical-signing-payload
|
|
18
|
+
helper (`canonical_signing_payload`, RFC 8785 / JCS).
|
|
19
|
+
|
|
20
|
+
This is the **Layer 1 API lock** (D-design, [issue #2484][issue]). The body of
|
|
21
|
+
`verify()` is `todo!()`; trait methods are stubbed. D-impl
|
|
22
|
+
([issue #2485][impl]) satisfies the contract.
|
|
23
|
+
|
|
24
|
+
[issue]: https://github.com/Know-That-Ai/agent-shield/issues/2484
|
|
25
|
+
[impl]: https://github.com/Know-That-Ai/agent-shield/issues/2485
|
|
26
|
+
[ratification]: ../../../docs/architecture/D-design-ratification.md
|
|
Binary file
|