@kya-os/checkpoint-wasm-runtime 1.4.0 → 1.4.2

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/adapters.d.mts +1 -1
  3. package/dist/adapters.d.ts +1 -1
  4. package/dist/engine-edge.d.mts +2 -2
  5. package/dist/engine-edge.d.ts +2 -2
  6. package/dist/engine-node.d.mts +2 -2
  7. package/dist/engine-node.d.ts +2 -2
  8. package/dist/engine.d.mts +2 -2
  9. package/dist/engine.d.ts +2 -2
  10. package/dist/orchestrator-edge.d.mts +3 -1
  11. package/dist/orchestrator-edge.d.ts +3 -1
  12. package/dist/orchestrator-edge.js +18 -0
  13. package/dist/orchestrator-edge.mjs +18 -0
  14. package/dist/orchestrator-node.d.mts +3 -1
  15. package/dist/orchestrator-node.d.ts +3 -1
  16. package/dist/orchestrator-node.js +18 -0
  17. package/dist/orchestrator-node.mjs +18 -0
  18. package/dist/orchestrator.d.mts +3 -1
  19. package/dist/orchestrator.d.ts +3 -1
  20. package/dist/orchestrator.js +18 -0
  21. package/dist/orchestrator.mjs +18 -0
  22. package/dist/{types-KPEcVvac.d.mts → types-C3RniIOM.d.mts} +28 -0
  23. package/dist/{types-KPEcVvac.d.ts → types-C3RniIOM.d.ts} +28 -0
  24. package/package.json +1 -1
  25. package/wasm/kya-os-engine/README.md +26 -0
  26. package/wasm/kya-os-engine-bundler/kya_os_engine_bg.wasm +0 -0
  27. package/wasm/kya-os-engine-web/README.md +26 -0
  28. package/wasm/kya-os-engine/kya_os_engine.d.ts +0 -24
  29. package/wasm/kya-os-engine/kya_os_engine.js +0 -517
  30. package/wasm/kya-os-engine/kya_os_engine_bg.wasm +0 -0
  31. package/wasm/kya-os-engine/kya_os_engine_bg.wasm.d.ts +0 -8
  32. package/wasm/kya-os-engine/package.json +0 -27
  33. package/wasm/kya-os-engine-web/kya_os_engine.d.ts +0 -56
  34. package/wasm/kya-os-engine-web/kya_os_engine.js +0 -574
  35. package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm +0 -0
  36. package/wasm/kya-os-engine-web/kya_os_engine_bg.wasm.d.ts +0 -8
  37. package/wasm/kya-os-engine-web/package.json +0 -29
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @kya-os/checkpoint-wasm-runtime
2
2
 
3
+ ## 1.4.2 — 2026-05-18
4
+
5
+ **Recovery release. Do NOT use 1.4.1 — it was published with a broken
6
+ tarball that ships only `wasm/kya-os-engine-bundler/*` and is missing
7
+ `wasm/kya-os-engine/*` (nodejs target) + `wasm/kya-os-engine-web/*`
8
+ (web target) entirely. Consumers using the `./engine`,
9
+ `./engine/node`, `./orchestrator`, or `./orchestrator/node` subpaths
10
+ crash on import with `ERR_MODULE_NOT_FOUND` (or
11
+ `FUNCTION_INVOCATION_FAILED` on Vercel).**
12
+
13
+ ### What 1.4.1 should have shipped
14
+
15
+ 1.4.1 was a patch release bundling two fixes on top of 1.4.0:
16
+
17
+ - **#2659** — split anthropic vendor pattern into 3 per-bot entries
18
+ (`anthropic_claude_user`, `anthropic_claudebot`,
19
+ `anthropic_claude_web`). Updates the Tier-3 ruleset hash.
20
+ - **#2663** — `httpStatusForBlockReason` + `blockResponseBody`
21
+ switches gained `Tier3UAMatch` and `AgentAttribution` cases (were
22
+ falling through to `undefined` status → Express default 500
23
+ error page). Adds the matching variants to the TS `BlockReason`
24
+ union (with snake_case `pattern_id` / `pattern_kind` matching the
25
+ Rust serde wire format).
26
+
27
+ ### Root cause of the broken 1.4.1 tarball
28
+
29
+ `prepublishOnly` chains `copy-engine-wasm` (nodejs target) +
30
+ `copy-engine-wasm-web` (web target) + `copy-engine-wasm-bundler`
31
+ (bundler target). Each script `cp`s from `rust/crates/kya-os-engine/
32
+ pkg{,-web,-bundler}/` into `packages/checkpoint-wasm-runtime/wasm/`.
33
+ The publish was invoked from a fresh `git reset --hard origin/main`
34
+ state with **only `wasm-pack build --target bundler`** run before
35
+ publish — `pkg/` (nodejs) and `pkg-web/` (web) were empty. The cp
36
+ commands silently produced empty target dirs (`wasm/kya-os-engine/`
37
+
38
+ - `wasm/kya-os-engine-web/`) populated only with the git-committed
39
+ `README.md` placeholders, and the tarball shipped that state.
40
+
41
+ ### What 1.4.2 ships
42
+
43
+ Identical TS + Rust changes to 1.4.1 (no code regression) but with
44
+ the full wasm artifact set (`wasm/kya-os-engine/`,
45
+ `wasm/kya-os-engine-web/`, `wasm/kya-os-engine-bundler/`) verified
46
+ present before publish.
47
+
48
+ ### Hardening (separate dylan-todo to follow)
49
+
50
+ `prepublishOnly` should fail-fast when any of the three artifact
51
+ dirs is missing rather than producing an empty-but-existing dir.
52
+ Filing as `Engine-WASM-Publish-Sanity-Gate-1` so the next regen
53
+ can't ship the same shape of partial tarball silently.
54
+
55
+ ---
56
+
3
57
  ## 1.4.0 — 2026-05-18
4
58
 
5
59
  **Minor release** consolidating SDK-Next.js-Integration-Audit-1
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision } from './types-KPEcVvac.mjs';
1
+ import { d as DidDocument, D as Decision } from './types-C3RniIOM.mjs';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision } from './types-KPEcVvac.js';
1
+ import { d as DidDocument, D as Decision } from './types-C3RniIOM.js';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.mjs';
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
  /**
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.js';
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
  /**
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.mjs';
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
  /**
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.js';
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.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.mjs';
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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AgentRequest, C as ContextSpec, V as VerifyResult } from './types-KPEcVvac.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-KPEcVvac.js';
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
  /**
@@ -1,5 +1,5 @@
1
1
  export { initEngineEdge } from './engine-edge.mjs';
2
- import { E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.mjs';
2
+ import { E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.mjs';
3
3
  import { DidResolverAdapter, StatusListCacheAdapter, ReputationOracleAdapter, PolicyEvaluatorAdapter, ClockAdapter } from './adapters.mjs';
4
4
  import '@kya-os/checkpoint-shared';
5
5
 
@@ -198,6 +198,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
198
198
  * | Block(LowReputation) | 403 | Body carries score + threshold |
199
199
  * | Block(PolicyDenied) | 403 | Body carries detail |
200
200
  * | Block(ParseError) | 400 | Body carries detail |
201
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
202
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
201
203
  * | Challenge | 401 | Body carries ChallengeParams |
202
204
  * | Redirect | 302 | Location header |
203
205
  * | Instruct | 422 | application/problem+json body |
@@ -1,5 +1,5 @@
1
1
  export { initEngineEdge } from './engine-edge.js';
2
- import { E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.js';
2
+ import { E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.js';
3
3
  import { DidResolverAdapter, StatusListCacheAdapter, ReputationOracleAdapter, PolicyEvaluatorAdapter, ClockAdapter } from './adapters.js';
4
4
  import '@kya-os/checkpoint-shared';
5
5
 
@@ -198,6 +198,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
198
198
  * | Block(LowReputation) | 403 | Body carries score + threshold |
199
199
  * | Block(PolicyDenied) | 403 | Body carries detail |
200
200
  * | Block(ParseError) | 400 | Body carries detail |
201
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
202
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
201
203
  * | Challenge | 401 | Body carries ChallengeParams |
202
204
  * | Redirect | 302 | Location header |
203
205
  * | Instruct | 422 | application/problem+json body |
@@ -418,6 +418,8 @@ function httpStatusForBlockReason(reason) {
418
418
  case "OutOfScope":
419
419
  case "LowReputation":
420
420
  case "PolicyDenied":
421
+ case "AgentAttribution":
422
+ case "Tier3UAMatch":
421
423
  return 403;
422
424
  }
423
425
  }
@@ -460,6 +462,22 @@ function blockResponseBody(reason) {
460
462
  reason: "ParseError",
461
463
  detail: reason.detail
462
464
  };
465
+ case "AgentAttribution":
466
+ return {
467
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
468
+ reason: "AgentAttribution",
469
+ vendor: reason.vendor,
470
+ tier: reason.tier,
471
+ confidence: reason.confidence
472
+ };
473
+ case "Tier3UAMatch":
474
+ return {
475
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
476
+ reason: "Tier3UAMatch",
477
+ pattern_id: reason.pattern_id,
478
+ pattern_kind: reason.pattern_kind,
479
+ confidence: reason.confidence
480
+ };
463
481
  }
464
482
  }
465
483
  function humanError(kind) {
@@ -416,6 +416,8 @@ function httpStatusForBlockReason(reason) {
416
416
  case "OutOfScope":
417
417
  case "LowReputation":
418
418
  case "PolicyDenied":
419
+ case "AgentAttribution":
420
+ case "Tier3UAMatch":
419
421
  return 403;
420
422
  }
421
423
  }
@@ -458,6 +460,22 @@ function blockResponseBody(reason) {
458
460
  reason: "ParseError",
459
461
  detail: reason.detail
460
462
  };
463
+ case "AgentAttribution":
464
+ return {
465
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
466
+ reason: "AgentAttribution",
467
+ vendor: reason.vendor,
468
+ tier: reason.tier,
469
+ confidence: reason.confidence
470
+ };
471
+ case "Tier3UAMatch":
472
+ return {
473
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
474
+ reason: "Tier3UAMatch",
475
+ pattern_id: reason.pattern_id,
476
+ pattern_kind: reason.pattern_kind,
477
+ confidence: reason.confidence
478
+ };
461
479
  }
462
480
  }
463
481
  function humanError(kind) {
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.mjs';
1
+ import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.mjs';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -311,6 +311,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
311
311
  * | Block(LowReputation) | 403 | Body carries score + threshold |
312
312
  * | Block(PolicyDenied) | 403 | Body carries detail |
313
313
  * | Block(ParseError) | 400 | Body carries detail |
314
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
315
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
314
316
  * | Challenge | 401 | Body carries ChallengeParams |
315
317
  * | Redirect | 302 | Location header |
316
318
  * | Instruct | 422 | application/problem+json body |
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.js';
1
+ import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.js';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -311,6 +311,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
311
311
  * | Block(LowReputation) | 403 | Body carries score + threshold |
312
312
  * | Block(PolicyDenied) | 403 | Body carries detail |
313
313
  * | Block(ParseError) | 400 | Body carries detail |
314
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
315
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
314
316
  * | Challenge | 401 | Body carries ChallengeParams |
315
317
  * | Redirect | 302 | Location header |
316
318
  * | Instruct | 422 | application/problem+json body |
@@ -522,6 +522,8 @@ function httpStatusForBlockReason(reason) {
522
522
  case "OutOfScope":
523
523
  case "LowReputation":
524
524
  case "PolicyDenied":
525
+ case "AgentAttribution":
526
+ case "Tier3UAMatch":
525
527
  return 403;
526
528
  }
527
529
  }
@@ -564,6 +566,22 @@ function blockResponseBody(reason) {
564
566
  reason: "ParseError",
565
567
  detail: reason.detail
566
568
  };
569
+ case "AgentAttribution":
570
+ return {
571
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
572
+ reason: "AgentAttribution",
573
+ vendor: reason.vendor,
574
+ tier: reason.tier,
575
+ confidence: reason.confidence
576
+ };
577
+ case "Tier3UAMatch":
578
+ return {
579
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
580
+ reason: "Tier3UAMatch",
581
+ pattern_id: reason.pattern_id,
582
+ pattern_kind: reason.pattern_kind,
583
+ confidence: reason.confidence
584
+ };
567
585
  }
568
586
  }
569
587
  function humanError(kind) {
@@ -501,6 +501,8 @@ function httpStatusForBlockReason(reason) {
501
501
  case "OutOfScope":
502
502
  case "LowReputation":
503
503
  case "PolicyDenied":
504
+ case "AgentAttribution":
505
+ case "Tier3UAMatch":
504
506
  return 403;
505
507
  }
506
508
  }
@@ -543,6 +545,22 @@ function blockResponseBody(reason) {
543
545
  reason: "ParseError",
544
546
  detail: reason.detail
545
547
  };
548
+ case "AgentAttribution":
549
+ return {
550
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
551
+ reason: "AgentAttribution",
552
+ vendor: reason.vendor,
553
+ tier: reason.tier,
554
+ confidence: reason.confidence
555
+ };
556
+ case "Tier3UAMatch":
557
+ return {
558
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
559
+ reason: "Tier3UAMatch",
560
+ pattern_id: reason.pattern_id,
561
+ pattern_kind: reason.pattern_kind,
562
+ confidence: reason.confidence
563
+ };
546
564
  }
547
565
  }
548
566
  function humanError(kind) {
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.mjs';
1
+ import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.mjs';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -351,6 +351,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
351
351
  * | Block(LowReputation) | 403 | Body carries score + threshold |
352
352
  * | Block(PolicyDenied) | 403 | Body carries detail |
353
353
  * | Block(ParseError) | 400 | Body carries detail |
354
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
355
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
354
356
  * | Challenge | 401 | Body carries ChallengeParams |
355
357
  * | Redirect | 302 | Location header |
356
358
  * | Instruct | 422 | application/problem+json body |
@@ -1,4 +1,4 @@
1
- import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-KPEcVvac.js';
1
+ import { d as DidDocument, D as Decision, E as EnforcementMode, A as AgentRequest, C as ContextSpec, V as VerifyResult, e as EngineConfig } from './types-C3RniIOM.js';
2
2
  import '@kya-os/checkpoint-shared';
3
3
 
4
4
  /**
@@ -351,6 +351,8 @@ declare function extractCredentialStatusUrl(request: AgentRequest): string | nul
351
351
  * | Block(LowReputation) | 403 | Body carries score + threshold |
352
352
  * | Block(PolicyDenied) | 403 | Body carries detail |
353
353
  * | Block(ParseError) | 400 | Body carries detail |
354
+ * | Block(AgentAttribution) | 403 | Body carries vendor + tier + confidence |
355
+ * | Block(Tier3UAMatch) | 403 | Body carries pattern_id + kind + conf |
354
356
  * | Challenge | 401 | Body carries ChallengeParams |
355
357
  * | Redirect | 302 | Location header |
356
358
  * | Instruct | 422 | application/problem+json body |
@@ -526,6 +526,8 @@ function httpStatusForBlockReason(reason) {
526
526
  case "OutOfScope":
527
527
  case "LowReputation":
528
528
  case "PolicyDenied":
529
+ case "AgentAttribution":
530
+ case "Tier3UAMatch":
529
531
  return 403;
530
532
  }
531
533
  }
@@ -568,6 +570,22 @@ function blockResponseBody(reason) {
568
570
  reason: "ParseError",
569
571
  detail: reason.detail
570
572
  };
573
+ case "AgentAttribution":
574
+ return {
575
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
576
+ reason: "AgentAttribution",
577
+ vendor: reason.vendor,
578
+ tier: reason.tier,
579
+ confidence: reason.confidence
580
+ };
581
+ case "Tier3UAMatch":
582
+ return {
583
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
584
+ reason: "Tier3UAMatch",
585
+ pattern_id: reason.pattern_id,
586
+ pattern_kind: reason.pattern_kind,
587
+ confidence: reason.confidence
588
+ };
571
589
  }
572
590
  }
573
591
  function humanError(kind) {
@@ -524,6 +524,8 @@ function httpStatusForBlockReason(reason) {
524
524
  case "OutOfScope":
525
525
  case "LowReputation":
526
526
  case "PolicyDenied":
527
+ case "AgentAttribution":
528
+ case "Tier3UAMatch":
527
529
  return 403;
528
530
  }
529
531
  }
@@ -566,6 +568,22 @@ function blockResponseBody(reason) {
566
568
  reason: "ParseError",
567
569
  detail: reason.detail
568
570
  };
571
+ case "AgentAttribution":
572
+ return {
573
+ error: "request identified as agent traffic via Tier-2 IP+UA cross-match",
574
+ reason: "AgentAttribution",
575
+ vendor: reason.vendor,
576
+ tier: reason.tier,
577
+ confidence: reason.confidence
578
+ };
579
+ case "Tier3UAMatch":
580
+ return {
581
+ error: "request identified as agent traffic via Tier-3 UA pattern match",
582
+ reason: "Tier3UAMatch",
583
+ pattern_id: reason.pattern_id,
584
+ pattern_kind: reason.pattern_kind,
585
+ confidence: reason.confidence
586
+ };
569
587
  }
570
588
  }
571
589
  function humanError(kind) {
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/checkpoint-wasm-runtime",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
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",
@@ -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
@@ -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,24 +0,0 @@
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;