@kya-os/checkpoint-shared 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +127 -2
  2. package/dist/beacon-types/index.d.mts +441 -432
  3. package/dist/beacon-types/index.d.mts.map +1 -0
  4. package/dist/beacon-types/index.d.ts +441 -432
  5. package/dist/beacon-types/index.d.ts.map +1 -0
  6. package/dist/beacon-types/index.js +198 -182
  7. package/dist/beacon-types/index.mjs +197 -179
  8. package/dist/beacon-types/index.mjs.map +1 -0
  9. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +5 -0
  10. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +1 -0
  11. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +5 -0
  12. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +1 -0
  13. package/dist/browser-posture-cookie.d.mts +2 -0
  14. package/dist/browser-posture-cookie.d.ts +2 -0
  15. package/dist/browser-posture-cookie.js +1 -0
  16. package/dist/browser-posture-cookie.mjs +2 -0
  17. package/dist/browser-posture-cookie.mjs.map +1 -0
  18. package/dist/browser-posture-report.d.mts +50 -82
  19. package/dist/browser-posture-report.d.mts.map +1 -0
  20. package/dist/browser-posture-report.d.ts +50 -82
  21. package/dist/browser-posture-report.d.ts.map +1 -0
  22. package/dist/browser-posture-report.js +1 -1
  23. package/dist/browser-posture-report.mjs +2 -1
  24. package/dist/browser-posture-report.mjs.map +1 -0
  25. package/dist/browser-posture.d.mts +80 -111
  26. package/dist/browser-posture.d.mts.map +1 -0
  27. package/dist/browser-posture.d.ts +80 -111
  28. package/dist/browser-posture.d.ts.map +1 -0
  29. package/dist/browser-posture.js +143 -4164
  30. package/dist/browser-posture.mjs +142 -4161
  31. package/dist/browser-posture.mjs.map +1 -0
  32. package/dist/browser.d.mts +323 -316
  33. package/dist/browser.d.mts.map +1 -0
  34. package/dist/browser.d.ts +323 -316
  35. package/dist/browser.d.ts.map +1 -0
  36. package/dist/browser.js +1 -1
  37. package/dist/browser.mjs +2 -1
  38. package/dist/browser.mjs.map +1 -0
  39. package/dist/canonical-signer/index.d.mts +38 -33
  40. package/dist/canonical-signer/index.d.mts.map +1 -0
  41. package/dist/canonical-signer/index.d.ts +38 -33
  42. package/dist/canonical-signer/index.d.ts.map +1 -0
  43. package/dist/canonical-signer/index.js +411 -181
  44. package/dist/canonical-signer/index.mjs +383 -175
  45. package/dist/canonical-signer/index.mjs.map +1 -0
  46. package/dist/clearance.d.mts +30 -0
  47. package/dist/clearance.d.mts.map +1 -0
  48. package/dist/clearance.d.ts +30 -0
  49. package/dist/clearance.d.ts.map +1 -0
  50. package/dist/clearance.js +120 -0
  51. package/dist/clearance.mjs +112 -0
  52. package/dist/clearance.mjs.map +1 -0
  53. package/dist/client-ip-1y2iXAYW.js +237 -0
  54. package/dist/client-ip-HOfe6ucV.mjs +215 -0
  55. package/dist/client-ip-HOfe6ucV.mjs.map +1 -0
  56. package/dist/deploy/index.d.mts +375 -810
  57. package/dist/deploy/index.d.mts.map +1 -0
  58. package/dist/deploy/index.d.ts +375 -810
  59. package/dist/deploy/index.d.ts.map +1 -0
  60. package/dist/deploy/index.js +505 -413
  61. package/dist/deploy/index.mjs +504 -410
  62. package/dist/deploy/index.mjs.map +1 -0
  63. package/dist/errors/index.d.mts +101 -101
  64. package/dist/errors/index.d.mts.map +1 -0
  65. package/dist/errors/index.d.ts +101 -101
  66. package/dist/errors/index.d.ts.map +1 -0
  67. package/dist/errors/index.js +341 -314
  68. package/dist/errors/index.mjs +340 -311
  69. package/dist/errors/index.mjs.map +1 -0
  70. package/dist/external-jr_S4iSS.d.mts +4187 -0
  71. package/dist/external-jr_S4iSS.d.mts.map +1 -0
  72. package/dist/external-jr_S4iSS.d.ts +4187 -0
  73. package/dist/external-jr_S4iSS.d.ts.map +1 -0
  74. package/dist/gateway/index.d.mts +154 -550
  75. package/dist/gateway/index.d.mts.map +1 -0
  76. package/dist/gateway/index.d.ts +154 -550
  77. package/dist/gateway/index.d.ts.map +1 -0
  78. package/dist/gateway/index.js +117 -81
  79. package/dist/gateway/index.mjs +116 -78
  80. package/dist/gateway/index.mjs.map +1 -0
  81. package/dist/gateway-client-ip.d.mts +59 -0
  82. package/dist/gateway-client-ip.d.mts.map +1 -0
  83. package/dist/gateway-client-ip.d.ts +59 -0
  84. package/dist/gateway-client-ip.d.ts.map +1 -0
  85. package/dist/gateway-client-ip.js +149 -0
  86. package/dist/gateway-client-ip.mjs +139 -0
  87. package/dist/gateway-client-ip.mjs.map +1 -0
  88. package/dist/index.d.mts +15523 -38968
  89. package/dist/index.d.mts.map +1 -0
  90. package/dist/index.d.ts +15523 -38968
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +14950 -16029
  93. package/dist/index.mjs +14846 -15955
  94. package/dist/index.mjs.map +1 -0
  95. package/dist/mcpi/agentshield-api/index.d.mts +45 -44
  96. package/dist/mcpi/agentshield-api/index.d.mts.map +1 -0
  97. package/dist/mcpi/agentshield-api/index.d.ts +45 -44
  98. package/dist/mcpi/agentshield-api/index.d.ts.map +1 -0
  99. package/dist/mcpi/agentshield-api/index.js +0 -2
  100. package/dist/mcpi/agentshield-api/index.mjs +1 -1
  101. package/dist/mcpi/approval-grant/index.d.mts +63 -61
  102. package/dist/mcpi/approval-grant/index.d.mts.map +1 -0
  103. package/dist/mcpi/approval-grant/index.d.ts +63 -61
  104. package/dist/mcpi/approval-grant/index.d.ts.map +1 -0
  105. package/dist/mcpi/approval-grant/index.js +220 -140
  106. package/dist/mcpi/approval-grant/index.mjs +219 -137
  107. package/dist/mcpi/approval-grant/index.mjs.map +1 -0
  108. package/dist/mcpi/dashboard-config/index.d.mts +2395 -13915
  109. package/dist/mcpi/dashboard-config/index.d.mts.map +1 -0
  110. package/dist/mcpi/dashboard-config/index.d.ts +2395 -13915
  111. package/dist/mcpi/dashboard-config/index.d.ts.map +1 -0
  112. package/dist/mcpi/dashboard-config/index.js +605 -458
  113. package/dist/mcpi/dashboard-config/index.mjs +604 -455
  114. package/dist/mcpi/dashboard-config/index.mjs.map +1 -0
  115. package/dist/mcpi/multibase-ed25519.d.mts +10 -8
  116. package/dist/mcpi/multibase-ed25519.d.mts.map +1 -0
  117. package/dist/mcpi/multibase-ed25519.d.ts +10 -8
  118. package/dist/mcpi/multibase-ed25519.d.ts.map +1 -0
  119. package/dist/mcpi/multibase-ed25519.js +182 -106
  120. package/dist/mcpi/multibase-ed25519.mjs +181 -103
  121. package/dist/mcpi/multibase-ed25519.mjs.map +1 -0
  122. package/dist/patterns-CkRVOdtV.js +243 -0
  123. package/dist/patterns-DzkGy_qk.mjs +173 -0
  124. package/dist/patterns-DzkGy_qk.mjs.map +1 -0
  125. package/dist/project-verification-key-C3L5rd8a.js +41 -0
  126. package/dist/project-verification-key-CgSVX9_m.mjs +37 -0
  127. package/dist/project-verification-key-CgSVX9_m.mjs.map +1 -0
  128. package/dist/rolldown-runtime-iY2fYEqi.mjs +19 -0
  129. package/dist/schemas-BmjNLAE7.js +5677 -0
  130. package/dist/schemas-DxY-dk9y.mjs +5511 -0
  131. package/dist/schemas-DxY-dk9y.mjs.map +1 -0
  132. package/dist/signals/index.d.mts +125 -115
  133. package/dist/signals/index.d.mts.map +1 -0
  134. package/dist/signals/index.d.ts +125 -115
  135. package/dist/signals/index.d.ts.map +1 -0
  136. package/dist/signals/index.js +1693 -1536
  137. package/dist/signals/index.mjs +1692 -1533
  138. package/dist/signals/index.mjs.map +1 -0
  139. package/dist/test-fixtures/index.d.mts +124 -119
  140. package/dist/test-fixtures/index.d.mts.map +1 -0
  141. package/dist/test-fixtures/index.d.ts +124 -119
  142. package/dist/test-fixtures/index.d.ts.map +1 -0
  143. package/dist/test-fixtures/index.js +460 -228
  144. package/dist/test-fixtures/index.mjs +459 -225
  145. package/dist/test-fixtures/index.mjs.map +1 -0
  146. package/dist/tool-protection/index.d.mts +368 -1067
  147. package/dist/tool-protection/index.d.mts.map +1 -0
  148. package/dist/tool-protection/index.d.ts +368 -1067
  149. package/dist/tool-protection/index.d.ts.map +1 -0
  150. package/dist/tool-protection/index.js +366 -285
  151. package/dist/tool-protection/index.mjs +365 -282
  152. package/dist/tool-protection/index.mjs.map +1 -0
  153. package/fixtures/bot-signal-resolution.json +142 -0
  154. package/fixtures/browser-posture-claims.json +421 -0
  155. package/fixtures/browser-posture-headers.json +46 -0
  156. package/fixtures/detection/reason-codes.json +10 -1
  157. package/fixtures/kya-http/challenge.delegation.fetcher-200.json +9 -3
  158. package/fixtures/kya-http/challenge.delegation.full.json +9 -3
  159. package/fixtures/kya-http/challenge.delegation.minimal.json +9 -3
  160. package/fixtures/kya-http/error-codes.json +7 -2
  161. package/package.json +21 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,131 @@
1
1
  # @kya-os/checkpoint-shared
2
2
 
3
- ## Unreleased — error registry single source of truth (#4792)
3
+ ## 1.5.0
4
+
5
+ Two changes below carry breaking content under a minor, the same call as
6
+ 1.4.0 and for the same reason: every npm package depending on this one is
7
+ first-party and republished against it. Read both before upgrading.
8
+
9
+ ### Automation evidence in the browser posture token
10
+
11
+ `BrowserPostureSchema` carries two new required booleans, `automation_disclosed`
12
+ and `automation_corroborated`, signed from the issuing batch's
13
+ `client.webdriver`/`client.headless` evidence. They mirror the Rust engine's
14
+ `ClientHeadlessEscalation` two-tier rule for the Java and .NET SDKs to escalate
15
+ on: disclosed evidence (a direct `navigator.webdriver` self-disclosure)
16
+ escalates a Human/IncompleteData baseline to Bot at confidence 80;
17
+ corroborating-only evidence (CDP/plugin/WebGL-consistency artifacts, no direct
18
+ disclosure) escalates to IncompleteData at confidence 40. The cross-runtime
19
+ posture test vectors gained two new cases covering both tiers.
20
+
21
+ ### Posture config validation and the cookie-name helper
22
+
23
+ `validateBrowserPostureConfig` now refuses a `projectId` that is not the
24
+ project UUID. The issuer signs `project_id` as the UUID and the beacon names
25
+ the posture cookie after that claim, so a reader configured with the
26
+ project's friendly id verified nothing, silently; it now fails at startup
27
+ with the fix in the message. The cross-runtime posture test vectors were
28
+ regenerated with a UUID project id.
29
+ `postureCookieName` applies the same rule and now lives in a dependency-free
30
+ `./browser-posture-cookie` subpath (re-exported from `./browser-posture`) so
31
+ the beacon names the cookie through the one helper every reader uses.
32
+ `BeaconWorkerMessageType` gains `'posture'`, the worker-to-main relay of a
33
+ `202` ingest body.
34
+
35
+ ## 1.4.0, Zod 4
36
+
37
+ Flips the package from Zod 3 to Zod 4.5.4 and removes the public API envelope
38
+ helpers that PR #4853 marked deprecated. Rebuild against the new `.d.ts` and
39
+ re-run any consumer that inspects `issues[].code` before adopting.
40
+
41
+ **Minor release with BREAKING changes.** Per project semver policy (see the
42
+ 1.1.0 entry in `@kya-os/checkpoint`'s changelog for the same call) this ships
43
+ as a minor because the only packages on npm that depend on this one are the
44
+ five first-party SDKs (`@kya-os/checkpoint`, `-nextjs`, `-express`,
45
+ `-beacon`, `-wasm-runtime`), and all of them are republished against 1.4.0 in
46
+ this same release. No third-party package declares a dependency on it. Do not
47
+ read the minor as "safe to take blind": the version number carries no warning
48
+ here, so read the list below before upgrading.
49
+
50
+ ### BREAKING
51
+
52
+ - `zod` moves to `^4.5.4` in `dependencies`. The published `.d.ts` now carry
53
+ Zod 4 types, so consumers still on Zod 3 must upgrade `zod` to `^4.5.4`
54
+ before taking this release.
55
+ - Removed `PUBLIC_API_ERROR_CODES`, `PublicApiErrorCode`,
56
+ `createPublicSuccessResponse`, `createPublicErrorResponse`, and
57
+ `createPublicPaginatedResponse` from `api/public.ts` and both barrels.
58
+ These were marked `@deprecated` in #4853: no consumer outside this repo.
59
+ Error codes live in `ERROR_CODES` (`constants/errors.ts`); response
60
+ envelopes are documented per route.
61
+ - `.uuid()` validation is now RFC 9562 strict (versions 1 through 8, plus the
62
+ nil and max UUIDs) everywhere it appears in this package's schemas. A
63
+ production probe of every id column behind a request-path `.uuid()` check
64
+ found zero non-conforming values, so no schema was relaxed to compensate.
65
+ If you generate ids outside RFC 9562, switch to a compliant generator
66
+ before adopting this release.
67
+ - Validation issue `code` values follow Zod 4's renames: `invalid_string` is
68
+ now `invalid_format`, `invalid_enum_value` and `invalid_literal` are both
69
+ now `invalid_value`, union failures are `invalid_union`, and record key
70
+ failures are `invalid_key`. Update any consumer that switches on
71
+ `issues[].code`.
72
+ - Default validation message text now follows Zod 4's wording (for example
73
+ `Invalid input: expected string, received undefined`, `Invalid UUID`,
74
+ `Invalid URL`). Update any consumer that matches on message text instead
75
+ of `code`.
76
+ - `.min()`, `.max()`, and `.length()` on `z.string()` now count Unicode code
77
+ points instead of UTF-16 code units. `z.string().min(2)` now rejects a
78
+ single emoji that Zod 3 accepted, and `z.string().max(1)` now accepts a
79
+ single emoji that Zod 3 rejected. No schema in this package changed for
80
+ this: it is Zod 4's own counting rule.
81
+ - `.datetime()` now requires seconds. `2024-01-01T00:00Z` is rejected as
82
+ `invalid_format`; `2024-01-01T00:00:00Z` still passes. No schema in this
83
+ package changed for this.
84
+ - `z.number()` and `z.coerce.number()` now reject `Infinity` (Zod 3 accepted
85
+ it, so a query param such as `?limit=1e400` coerced to `Infinity` and
86
+ passed before; it now fails validation with a 400), and `.int()` now
87
+ rejects values beyond `Number.MAX_SAFE_INTEGER`. No schema in this
88
+ package changed for this.
89
+ - `.url()` now trims surrounding whitespace from its parsed output:
90
+ `' https://x.com '` now parses to `'https://x.com'` instead of being
91
+ returned unchanged as it was on Zod 3. Internal whitespace is untouched.
92
+ No schema in this package changed for this.
93
+ - Errors thrown by this package's schemas are Zod 4 `ZodError` instances.
94
+ The `.errors` alias is gone: read `.issues` instead. `.flatten()` and
95
+ `.format()` still work but are deprecated in Zod 4.
96
+
97
+ ### Changed
98
+
99
+ - `ipAddressSchema` is now `z.union([z.ipv4(), z.ipv6()], { error: 'Invalid IP
100
+ address' })`. The accept set changed in both directions: RFC 4007
101
+ zone-scoped IPv6 literals (for example `fe80::1%eth0`) are no longer
102
+ accepted, while uncompressed embedded-IPv4 IPv6 forms (for example
103
+ `0:0:0:0:0:0:13.1.68.3`) are now accepted, where Zod 3's regex rejected
104
+ them. A failing value reports `invalid_union` with message `Invalid IP
105
+ address` instead of `invalid_string` / `Invalid ip`.
106
+ - `ProjectSchema.settings`, `PixelSchema.configuration`,
107
+ `ApiKeySchema.rateLimits`, and `PolicyConfigSchema.thresholds` moved from
108
+ `.default({})` to `.prefault({})` so their nested per-field defaults keep
109
+ filling in the way they did on Zod 3. No behaviour change: this kept the
110
+ Zod 3 fill-in, it did not add one.
111
+ - `CollectedDataSchema.detectionResults.wouldDetectAs` and
112
+ `DetectionTestResultSchema.results` (the two `IntegrationType`-keyed
113
+ records in the fingerprint types) now use `z.partialRecord`. The inferred
114
+ type is unchanged (`Partial<Record<IntegrationType, V>>`), and unknown
115
+ keys are still rejected, now reported as `unrecognized_keys`.
116
+ - The `role` field of `assignmentChangeRequestSchema`
117
+ (`src/types/admin.ts`) moved its custom message from Zod 3's `errorMap`
118
+ option to the Zod 4 `error` param. Message text is unchanged.
119
+ - `errors.mdx` (`apps/web` docs) is generated from this package's
120
+ `ERROR_CODES` registry and documents every emitted code; the registry
121
+ itself did not change in this release.
122
+
123
+ ## 1.3.1
124
+
125
+ Both groups below shipped in 1.3.1. The published 1.3.1 tarball labels them
126
+ `Unreleased` because they were never retitled at publish time.
127
+
128
+ ### Error registry single source of truth (#4792)
4
129
 
5
130
  - Extended the shared `ERROR_CODES` registry with every v1 error code emitted
6
131
  across apps/web routes: `BILLING_ERRORS`, `RESOURCE_ERRORS`,
@@ -12,7 +137,7 @@
12
137
  - Added the `./errors` subpath: a pure entrypoint re-exporting only the
13
138
  registry and picker, with no dependency on the rest of the barrel.
14
139
 
15
- ## Unreleased — client-IP resolution (#4794)
140
+ ### Client-IP resolution (#4794)
16
141
 
17
142
  - Added the runtime-agnostic client-IP normalizer and trust resolver.
18
143
  - Added shared Vercel, Cloudflare, trusted-proxy, direct, and authenticated