@kya-os/checkpoint-nextjs 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,110 @@
1
1
  # @kya-os/checkpoint-nextjs
2
2
 
3
+ ## 1.1.1 — 2026-05-17
4
+
5
+ Companion patch to `@kya-os/checkpoint-wasm-runtime@1.1.0`'s
6
+ SDK-WASM-Bundler-Loader-1 fix. **All 1.1.0 users running under Next.js
7
+ Node runtime should upgrade** — `withCheckpoint` couldn't actually be
8
+ deployed under Next.js Node runtime in 1.1.0 due to a Turbopack-
9
+ incompatible URL trick in the wasm-runtime's orchestrator bundle.
10
+
11
+ ### Internal change
12
+
13
+ - `@kya-os/checkpoint-wasm-runtime` dep changed from exact `1.0.0`
14
+ pin (the `workspace:*` default) to `^1.1.0` range (via `workspace:^`).
15
+ Fresh installs now pull `wasm-runtime@1.1.0+`, which adds the
16
+ `"node"` export condition routing Next.js Node-runtime bundlers to
17
+ the bundler-clean `orchestrator-node.mjs` entry.
18
+
19
+ ### No code or config changes
20
+
21
+ Customer middleware.ts call site is unchanged. Verifying envelopes
22
+ under Next.js Node runtime now works end-to-end:
23
+
24
+ ```typescript
25
+ import { withCheckpoint } from '@kya-os/checkpoint-nextjs';
26
+
27
+ export default withCheckpoint({
28
+ tenantHost: 'acme.checkpoint.example',
29
+ legacyEnvelopeFallback: true,
30
+ });
31
+ ```
32
+
33
+ See `@kya-os/checkpoint-wasm-runtime@1.1.0` CHANGELOG for the
34
+ architectural detail.
35
+
36
+ ---
37
+
38
+ ## 1.1.0 — 2026-05-17
39
+
40
+ Closes [SDK-Envelope-Plumbing-1 (#2594)](https://github.com/Know-That-Ai/agent-shield/issues/2594).
41
+ Wires MCP-I envelope verification through Next.js middleware — Bench-Before-After-1's
42
+ `verified_mcp_i` traffic case was provably blocked by SDK glue (not engine
43
+ capability — the engine verifies at 47µs Criterion local p50). All three transports
44
+ the orchestrator supports now work from a Next.js consumer.
45
+
46
+ ### New config (additive — no breaking changes)
47
+
48
+ - `CheckpointConfig.legacyEnvelopeFallback?: boolean` (default `false`) — accept
49
+ envelopes via the legacy `KYA-Delegation` HTTP header alongside the canonical
50
+ body form. Use for agents that pre-date Envelope-1 (#2537).
51
+ - `CheckpointConfig.drainJsonBody?: boolean` (default `true`) — read the request
52
+ body when `content-type` is `application/json` so the orchestrator can extract
53
+ `_meta.proof.jws`. The translator uses `req.clone()` to preserve the original
54
+ stream for downstream handlers. Set `false` for streaming-sensitive routes
55
+ that can't tolerate the clone overhead; in that case route envelopes through
56
+ the `KYA-Delegation` header transport instead.
57
+
58
+ ### New supported transports
59
+
60
+ | Transport | Form | Config required |
61
+ | ------------------------------------- | ------------------------------------------------- | ----------------------------------------- |
62
+ | Canonical body (spec form) | `_meta.proof.jws` field in a JSON request body | none — `drainJsonBody` defaults to `true` |
63
+ | Legacy header (Envelope-1 transition) | `KYA-Delegation` HTTP header carrying compact JWS | `legacyEnvelopeFallback: true` |
64
+
65
+ Both transports work end-to-end against the Rust `kya-os-engine` via WASM,
66
+ including DID resolution (did:web + did:key), Ed25519 signature verification,
67
+ JCS canonicalization, policy + reputation checks. See the engine's Criterion
68
+ suite at `rust/crates/kya-os-engine/benches/bouncer_verify.rs` for the per-stage
69
+ cost breakdown.
70
+
71
+ ### Factory clarity
72
+
73
+ `createCheckpointWasmMiddleware` JSDoc updated to clearly document it as
74
+ **pattern-detection only** (no envelope verification). Customers needing
75
+ verification are pointed to `withCheckpoint` (the orchestrator-capable factory)
76
+ in the JSDoc + example block.
77
+
78
+ ### Bench-Before-After-1 follow-up
79
+
80
+ This release unblocks the verified_mcp_i measurement deferred in
81
+ `docs/benchmarks/bench-before-after-1.md` §3.7. After upgrading
82
+ `sites/nextjs-checkpoint/` to 1.1.0 and redeploying bench-new, sub-phase 3 will
83
+ be re-run with the actual verify-success path exercised. The §3.8 "Verify-success
84
+ measurement" section will then be appended to the report.
85
+
86
+ ### Migration
87
+
88
+ No code changes required for existing 1.0.x consumers — both new fields are
89
+ optional with safe defaults. Consumers wanting envelope verification should:
90
+
91
+ ```diff
92
+ export default withCheckpoint({
93
+ tenantHost: 'acme.checkpoint.example',
94
+ + // Accept legacy KYA-Delegation-header envelopes (Envelope-1 transition)
95
+ + legacyEnvelopeFallback: true,
96
+ // drainJsonBody defaults to true; canonical _meta.proof.jws body works out of the box
97
+ });
98
+ ```
99
+
100
+ The body-drain default of `true` is a meaningful behavior change for streaming
101
+ middlewares — those should explicitly set `drainJsonBody: false`. Reason for
102
+ defaulting on: the alternative (silent fall-through to PlainHttp for every JSON
103
+ request) is the bug `#2594` was filed to fix; a config default that preserves
104
+ the bug isn't a fix.
105
+
106
+ ---
107
+
3
108
  ## 1.0.1 — 2026-05-17
4
109
 
5
110
  Security + rename-completeness patch on top of 1.0.0. **All 1.0.0 users