@kya-os/checkpoint-shared 1.7.0 → 1.9.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 (277) hide show
  1. package/CHANGELOG.md +159 -9
  2. package/README.md +24 -7
  3. package/dist/agent-catalog.d.mts +12 -0
  4. package/dist/agent-catalog.d.mts.map +1 -0
  5. package/dist/agent-catalog.d.ts +12 -0
  6. package/dist/agent-catalog.d.ts.map +1 -0
  7. package/dist/agent-catalog.js +105 -0
  8. package/dist/agent-catalog.mjs +105 -0
  9. package/dist/agent-catalog.mjs.map +1 -0
  10. package/dist/beacon-nonce/index.d.mts +1 -0
  11. package/dist/beacon-nonce/index.d.mts.map +1 -1
  12. package/dist/beacon-nonce/index.d.ts +1 -0
  13. package/dist/beacon-nonce/index.d.ts.map +1 -1
  14. package/dist/beacon-nonce/index.js +9 -3
  15. package/dist/beacon-nonce/index.mjs +9 -4
  16. package/dist/beacon-nonce/index.mjs.map +1 -1
  17. package/dist/beacon-types/index.d.mts +41 -1
  18. package/dist/beacon-types/index.d.mts.map +1 -1
  19. package/dist/beacon-types/index.d.ts +41 -1
  20. package/dist/beacon-types/index.d.ts.map +1 -1
  21. package/dist/beacon-types/index.js +153 -4
  22. package/dist/beacon-types/index.mjs +139 -4
  23. package/dist/beacon-types/index.mjs.map +1 -1
  24. package/dist/{browser-posture-BLhw-MON.d.mts → browser-posture-5fPrsxx7.d.mts} +6 -6
  25. package/dist/{browser-posture-BLhw-MON.d.mts.map → browser-posture-5fPrsxx7.d.mts.map} +1 -1
  26. package/dist/{browser-posture-B8YiPa5c.d.ts → browser-posture-CCR1kh5e.d.ts} +6 -6
  27. package/dist/{browser-posture-B8YiPa5c.d.ts.map → browser-posture-CCR1kh5e.d.ts.map} +1 -1
  28. package/dist/browser-posture-cookie.js +1 -1
  29. package/dist/browser-posture-cookie.mjs +1 -1
  30. package/dist/browser-posture-cookie.mjs.map +1 -1
  31. package/dist/browser-posture-proof-verifier-DvsOmFrM.js +202 -0
  32. package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +180 -0
  33. package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +1 -0
  34. package/dist/browser-posture-proof-verifier.d.mts +25 -0
  35. package/dist/browser-posture-proof-verifier.d.mts.map +1 -0
  36. package/dist/browser-posture-proof-verifier.d.ts +25 -0
  37. package/dist/browser-posture-proof-verifier.d.ts.map +1 -0
  38. package/dist/browser-posture-proof-verifier.js +7 -0
  39. package/dist/browser-posture-proof-verifier.mjs +3 -0
  40. package/dist/browser-posture-proof.d.mts +4 -5
  41. package/dist/browser-posture-proof.d.mts.map +1 -1
  42. package/dist/browser-posture-proof.d.ts +4 -5
  43. package/dist/browser-posture-proof.d.ts.map +1 -1
  44. package/dist/browser-posture-proof.js +10 -79
  45. package/dist/browser-posture-proof.mjs +6 -77
  46. package/dist/browser-posture-proof.mjs.map +1 -1
  47. package/dist/browser-posture.d.mts +1 -1
  48. package/dist/browser-posture.d.ts +1 -1
  49. package/dist/browser-posture.js +6 -5
  50. package/dist/browser-posture.mjs +4 -3
  51. package/dist/browser-posture.mjs.map +1 -1
  52. package/dist/browser.d.mts +25 -286
  53. package/dist/browser.d.mts.map +1 -1
  54. package/dist/browser.d.ts +25 -286
  55. package/dist/browser.d.ts.map +1 -1
  56. package/dist/browser.js +1 -1
  57. package/dist/browser.mjs +1 -1
  58. package/dist/browser.mjs.map +1 -1
  59. package/dist/canonical-signer/index.js +30 -28
  60. package/dist/canonical-signer/index.mjs +31 -1
  61. package/dist/canonical-signer/index.mjs.map +1 -1
  62. package/dist/clearance.d.mts +1 -1
  63. package/dist/clearance.d.ts +1 -1
  64. package/dist/clearance.js +2 -2
  65. package/dist/clearance.mjs +2 -2
  66. package/dist/client-ip-B7w-uHfS.d.mts +55 -0
  67. package/dist/client-ip-B7w-uHfS.d.mts.map +1 -0
  68. package/dist/client-ip-B7w-uHfS.d.ts +55 -0
  69. package/dist/client-ip-B7w-uHfS.d.ts.map +1 -0
  70. package/dist/{client-ip-CW6pRyLf.js → client-ip-B8wFzJ5f.js} +117 -7
  71. package/dist/{client-ip-B2Xeo-GK.mjs → client-ip-DIJyr6px.mjs} +113 -9
  72. package/dist/client-ip-DIJyr6px.mjs.map +1 -0
  73. package/dist/client-ip.d.mts +2 -2
  74. package/dist/client-ip.d.ts +2 -2
  75. package/dist/client-ip.js +3 -2
  76. package/dist/client-ip.mjs +2 -2
  77. package/dist/consent-handoff.d.mts +0 -3
  78. package/dist/consent-handoff.d.mts.map +1 -1
  79. package/dist/consent-handoff.d.ts +0 -3
  80. package/dist/consent-handoff.d.ts.map +1 -1
  81. package/dist/consent-handoff.mjs.map +1 -1
  82. package/dist/default-sign-in-host.d.mts +10 -0
  83. package/dist/default-sign-in-host.d.mts.map +1 -0
  84. package/dist/default-sign-in-host.d.ts +10 -0
  85. package/dist/default-sign-in-host.d.ts.map +1 -0
  86. package/dist/default-sign-in-host.js +72 -0
  87. package/dist/default-sign-in-host.mjs +66 -0
  88. package/dist/default-sign-in-host.mjs.map +1 -0
  89. package/dist/detection-reason-mapping-B9RSkOs8.js +277 -0
  90. package/dist/detection-reason-mapping-BGymWIPl.mjs +249 -0
  91. package/dist/detection-reason-mapping-BGymWIPl.mjs.map +1 -0
  92. package/dist/detection-reason-mapping-CQexNvR7.d.mts +52 -0
  93. package/dist/detection-reason-mapping-CQexNvR7.d.mts.map +1 -0
  94. package/dist/detection-reason-mapping-CQexNvR7.d.ts +52 -0
  95. package/dist/detection-reason-mapping-CQexNvR7.d.ts.map +1 -0
  96. package/dist/engine-enforcing-AYEcgNsb.js +39 -0
  97. package/dist/engine-enforcing-B5eNfCpG.mjs +29 -0
  98. package/dist/engine-enforcing-B5eNfCpG.mjs.map +1 -0
  99. package/dist/engine-enforcing-DiOclGqf.d.mts +11 -0
  100. package/dist/engine-enforcing-DiOclGqf.d.mts.map +1 -0
  101. package/dist/engine-enforcing-DiOclGqf.d.ts +11 -0
  102. package/dist/engine-enforcing-DiOclGqf.d.ts.map +1 -0
  103. package/dist/engine-info.d.mts +2 -0
  104. package/dist/engine-info.d.ts +2 -0
  105. package/dist/engine-info.js +4 -0
  106. package/dist/engine-info.mjs +3 -0
  107. package/dist/errors/index.d.mts +6 -0
  108. package/dist/errors/index.d.mts.map +1 -1
  109. package/dist/errors/index.d.ts +6 -0
  110. package/dist/errors/index.d.ts.map +1 -1
  111. package/dist/errors/index.js +28 -6
  112. package/dist/errors/index.mjs +28 -6
  113. package/dist/errors/index.mjs.map +1 -1
  114. package/dist/{external-B7WI9FyQ.d.ts → external-m3Kmafwj.d.mts} +2 -2
  115. package/dist/{external-B7WI9FyQ.d.mts.map → external-m3Kmafwj.d.mts.map} +1 -1
  116. package/dist/{external-B7WI9FyQ.d.mts → external-m3Kmafwj.d.ts} +2 -2
  117. package/dist/{external-B7WI9FyQ.d.ts.map → external-m3Kmafwj.d.ts.map} +1 -1
  118. package/dist/fetcher-C8qvwdnA.d.ts +44 -0
  119. package/dist/fetcher-C8qvwdnA.d.ts.map +1 -0
  120. package/dist/fetcher-D2vjr7jB.d.mts +44 -0
  121. package/dist/fetcher-D2vjr7jB.d.mts.map +1 -0
  122. package/dist/gateway-client-ip.d.mts +1 -3
  123. package/dist/gateway-client-ip.d.mts.map +1 -1
  124. package/dist/gateway-client-ip.d.ts +1 -3
  125. package/dist/gateway-client-ip.d.ts.map +1 -1
  126. package/dist/gateway-client-ip.js +2 -2
  127. package/dist/gateway-client-ip.mjs +2 -2
  128. package/dist/gateway-client-ip.mjs.map +1 -1
  129. package/dist/host-adapter/index.d.mts +2 -2
  130. package/dist/host-adapter/index.d.ts +2 -2
  131. package/dist/host-adapter/index.js +2 -1
  132. package/dist/host-adapter/index.mjs +2 -2
  133. package/dist/{host-adapter-C-4IxmqM.mjs → host-adapter-BKdQHwbi.mjs} +56 -3
  134. package/dist/{host-adapter-C-4IxmqM.mjs.map → host-adapter-BKdQHwbi.mjs.map} +1 -1
  135. package/dist/{host-adapter-CwW9YB0U.js → host-adapter-bWftXA9T.js} +60 -1
  136. package/dist/index-DnFsmr_o.d.ts +156 -0
  137. package/dist/index-DnFsmr_o.d.ts.map +1 -0
  138. package/dist/index-rvw5Bz-r.d.mts +156 -0
  139. package/dist/index-rvw5Bz-r.d.mts.map +1 -0
  140. package/dist/index.d.mts +6681 -11335
  141. package/dist/index.d.mts.map +1 -1
  142. package/dist/index.d.ts +6681 -11335
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +2322 -6900
  145. package/dist/index.mjs +2236 -6574
  146. package/dist/index.mjs.map +1 -1
  147. package/dist/{kya-http-error-codes-UYb1zpGM.js → kya-http-error-codes-B4rUmUEI.js} +2 -0
  148. package/dist/{kya-http-error-codes-7ewV5RuK.d.ts → kya-http-error-codes-C14E4gi3.d.mts} +2 -1
  149. package/dist/kya-http-error-codes-C14E4gi3.d.mts.map +1 -0
  150. package/dist/{kya-http-error-codes-7ewV5RuK.d.mts → kya-http-error-codes-C14E4gi3.d.ts} +2 -1
  151. package/dist/kya-http-error-codes-C14E4gi3.d.ts.map +1 -0
  152. package/dist/{kya-http-error-codes-C2JiWPsi.mjs → kya-http-error-codes-DSBrxNry.mjs} +3 -1
  153. package/dist/kya-http-error-codes-DSBrxNry.mjs.map +1 -0
  154. package/dist/kya-http.d.mts +3 -3
  155. package/dist/kya-http.d.ts +3 -3
  156. package/dist/kya-http.js +10 -2
  157. package/dist/kya-http.mjs +4 -3
  158. package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
  159. package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
  160. package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
  161. package/dist/mcpi/status-list/index.d.mts +72 -0
  162. package/dist/mcpi/status-list/index.d.mts.map +1 -0
  163. package/dist/mcpi/status-list/index.d.ts +72 -0
  164. package/dist/mcpi/status-list/index.d.ts.map +1 -0
  165. package/dist/mcpi/status-list/index.js +703 -0
  166. package/dist/mcpi/status-list/index.mjs +684 -0
  167. package/dist/mcpi/status-list/index.mjs.map +1 -0
  168. package/dist/patterns-Bp40cwh2.d.mts +110 -0
  169. package/dist/patterns-Bp40cwh2.d.mts.map +1 -0
  170. package/dist/patterns-Bp40cwh2.d.ts +110 -0
  171. package/dist/patterns-Bp40cwh2.d.ts.map +1 -0
  172. package/dist/patterns-CiMpbdAF.js +243 -0
  173. package/dist/patterns-D4OAsNQY.mjs +173 -0
  174. package/dist/patterns-D4OAsNQY.mjs.map +1 -0
  175. package/dist/patterns.d.mts +2 -0
  176. package/dist/patterns.d.ts +2 -0
  177. package/dist/patterns.js +15 -0
  178. package/dist/patterns.mjs +3 -0
  179. package/dist/policy/enforcement.d.mts +3 -2
  180. package/dist/policy/enforcement.d.ts +3 -2
  181. package/dist/policy/enforcement.js +8 -2
  182. package/dist/policy/enforcement.mjs +3 -2
  183. package/dist/policy/fetcher.d.mts +2 -0
  184. package/dist/policy/fetcher.d.ts +2 -0
  185. package/dist/policy/fetcher.js +240 -0
  186. package/dist/policy/fetcher.mjs +238 -0
  187. package/dist/policy/fetcher.mjs.map +1 -0
  188. package/dist/policy/schemas.d.mts +3 -0
  189. package/dist/policy/schemas.d.ts +3 -0
  190. package/dist/policy/schemas.js +27 -0
  191. package/dist/policy/schemas.mjs +4 -0
  192. package/dist/{posture-origins-Ba83O0cD.mjs → posture-origins-Ci6k4Zh1.js} +24 -173
  193. package/dist/{posture-origins-CdVOdiMT.js → posture-origins-DGyS4Vuk.mjs} +2 -267
  194. package/dist/posture-origins-DGyS4Vuk.mjs.map +1 -0
  195. package/dist/{project-verification-key-BccT12tQ.js → project-verification-key-B-L3D2nC.js} +1 -1
  196. package/dist/{project-verification-key-66N4edKn.mjs → project-verification-key-CWXdu3-n.mjs} +2 -2
  197. package/dist/{project-verification-key-66N4edKn.mjs.map → project-verification-key-CWXdu3-n.mjs.map} +1 -1
  198. package/dist/provider-registry.d.mts +2 -0
  199. package/dist/provider-registry.d.ts +2 -0
  200. package/dist/provider-registry.js +51 -0
  201. package/dist/provider-registry.mjs +3 -0
  202. package/dist/reason-codes.d.mts +2 -0
  203. package/dist/reason-codes.d.ts +2 -0
  204. package/dist/reason-codes.js +8 -0
  205. package/dist/reason-codes.mjs +3 -0
  206. package/dist/{registered-sid-hUl-bvM5.mjs → registered-sid-26hNxp6t.mjs} +11 -2
  207. package/dist/registered-sid-26hNxp6t.mjs.map +1 -0
  208. package/dist/registered-sid-D6KCaT1E.d.mts +33 -0
  209. package/dist/registered-sid-D6KCaT1E.d.mts.map +1 -0
  210. package/dist/registered-sid-D6KCaT1E.d.ts +33 -0
  211. package/dist/registered-sid-D6KCaT1E.d.ts.map +1 -0
  212. package/dist/{registered-sid-eLCNZvIF.js → registered-sid-DVGTSH0L.js} +15 -0
  213. package/dist/ruleset-hash-Cmv8MSO5.js +34 -0
  214. package/dist/ruleset-hash-IRN5eI9H.d.mts +5 -0
  215. package/dist/ruleset-hash-IRN5eI9H.d.mts.map +1 -0
  216. package/dist/ruleset-hash-IRN5eI9H.d.ts +5 -0
  217. package/dist/ruleset-hash-IRN5eI9H.d.ts.map +1 -0
  218. package/dist/ruleset-hash-QQIaLuPi.mjs +30 -0
  219. package/dist/ruleset-hash-QQIaLuPi.mjs.map +1 -0
  220. package/dist/{schemas-YhagYDx_.js → schemas-BlScS1it.js} +0 -20
  221. package/dist/{index-HaqfPtaL.d.ts → schemas-CGKHzcMV.d.ts} +23 -195
  222. package/dist/schemas-CGKHzcMV.d.ts.map +1 -0
  223. package/dist/schemas-Cm4C4Z5G.js +703 -0
  224. package/dist/schemas-DPIT8usF.mjs +525 -0
  225. package/dist/schemas-DPIT8usF.mjs.map +1 -0
  226. package/dist/{schemas-7qodsG-Z.mjs → schemas-IHAhH3gV.mjs} +2 -16
  227. package/dist/schemas-IHAhH3gV.mjs.map +1 -0
  228. package/dist/{index-B7rTovHa.d.mts → schemas-m-GqyfyO.d.mts} +23 -195
  229. package/dist/schemas-m-GqyfyO.d.mts.map +1 -0
  230. package/dist/{step-up-COlmWJN8.mjs → step-up-BK0oBi11.mjs} +91 -41
  231. package/dist/step-up-BK0oBi11.mjs.map +1 -0
  232. package/dist/{step-up-C2d8C20x.js → step-up-Bp8RAQwv.js} +117 -55
  233. package/dist/{step-up-BjP--hG-.d.mts → step-up-Bz12gYKT.d.mts} +28 -12
  234. package/dist/step-up-Bz12gYKT.d.mts.map +1 -0
  235. package/dist/{step-up-BjP--hG-.d.ts → step-up-Bz12gYKT.d.ts} +28 -12
  236. package/dist/step-up-Bz12gYKT.d.ts.map +1 -0
  237. package/dist/test-fixtures/index.d.mts +4 -4
  238. package/dist/test-fixtures/index.d.mts.map +1 -1
  239. package/dist/test-fixtures/index.d.ts +4 -4
  240. package/dist/test-fixtures/index.d.ts.map +1 -1
  241. package/dist/test-fixtures/index.js +4 -4
  242. package/dist/test-fixtures/index.mjs +4 -4
  243. package/dist/test-fixtures/index.mjs.map +1 -1
  244. package/dist/tool-protection/index.d.mts +12 -0
  245. package/dist/tool-protection/index.d.mts.map +1 -1
  246. package/dist/tool-protection/index.d.ts +12 -0
  247. package/dist/tool-protection/index.d.ts.map +1 -1
  248. package/dist/tool-protection/index.js +46 -0
  249. package/dist/tool-protection/index.mjs +44 -1
  250. package/dist/tool-protection/index.mjs.map +1 -1
  251. package/dist/verification-BAw9N8Pt.js +181 -0
  252. package/dist/verification-Cvvv86TT.mjs +123 -0
  253. package/dist/verification-Cvvv86TT.mjs.map +1 -0
  254. package/fixtures/client-ip-resolution.n01.json +101 -0
  255. package/fixtures/kya-http/error-codes.json +2 -1
  256. package/fixtures/reviewer-grant-revocation.v1.json +53 -81
  257. package/package.json +55 -4
  258. package/dist/client-ip-B2Xeo-GK.mjs.map +0 -1
  259. package/dist/client-ip-DFamiNoz.d.mts +0 -34
  260. package/dist/client-ip-DFamiNoz.d.mts.map +0 -1
  261. package/dist/client-ip-DFamiNoz.d.ts +0 -34
  262. package/dist/client-ip-DFamiNoz.d.ts.map +0 -1
  263. package/dist/index-B7rTovHa.d.mts.map +0 -1
  264. package/dist/index-HaqfPtaL.d.ts.map +0 -1
  265. package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +0 -1
  266. package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +0 -1
  267. package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +0 -1
  268. package/dist/posture-origins-Ba83O0cD.mjs.map +0 -1
  269. package/dist/registered-sid-D3g-gZQF.d.mts +0 -11
  270. package/dist/registered-sid-D3g-gZQF.d.mts.map +0 -1
  271. package/dist/registered-sid-D3g-gZQF.d.ts +0 -11
  272. package/dist/registered-sid-D3g-gZQF.d.ts.map +0 -1
  273. package/dist/registered-sid-hUl-bvM5.mjs.map +0 -1
  274. package/dist/schemas-7qodsG-Z.mjs.map +0 -1
  275. package/dist/step-up-BjP--hG-.d.mts.map +0 -1
  276. package/dist/step-up-BjP--hG-.d.ts.map +0 -1
  277. package/dist/step-up-COlmWJN8.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/mcpi/org-did.ts","../../../src/mcpi/status-list/wire.ts","../../../src/mcpi/status-list/bits.ts","../../../../../node_modules/.pnpm/canonicalize@3.0.0/node_modules/canonicalize/lib/canonicalize.js","../../../src/mcpi/status-list/verify.ts"],"sourcesContent":["/**\n * Canonical KYA-OS per-organization did:web derivation.\n *\n * The org slug becomes a single path segment in\n * `https://kya.vouched.id/orgs/<slug>/did.json`, so validation here is a\n * security boundary shared by issuers and verifiers.\n */\n\n/** did:web host for org issuer DIDs. */\nexport const MCPI_ORG_DID_HOST = 'kya.vouched.id';\n\nconst ORG_SLUG_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,253}[A-Za-z0-9])?$/;\n\n/**\n * True when `slug` is a valid `did:web` org path segment — i.e. it can be fed\n * to {@link deriveMcpiOrgDid} without throwing. Callers that accept a\n * user-supplied slug MUST gate on this before persisting it, since the org DID\n * is derived from the slug at every mint/publish/verify site; an invalid slug\n * bricks credential issuance for that org.\n */\nexport function isValidMcpiOrgSlug(slug: string): boolean {\n return ORG_SLUG_PATTERN.test(slug);\n}\n\n/** Build the org's `did:web` issuer DID from its slug. Throws on invalid slugs. */\nexport function deriveMcpiOrgDid(slug: string): string {\n if (!ORG_SLUG_PATTERN.test(slug)) {\n throw new Error(`Invalid org slug for did:web derivation: ${JSON.stringify(slug)}`);\n }\n return `did:web:${MCPI_ORG_DID_HOST}:orgs:${slug}`;\n}\n\n/**\n * The verification-method fragment of an org's signing key number `sequence`\n * (`key-<sequence>`). An org's keys are numbered from 1 and a number is never\n * reused, so `<org did>#key-<sequence>` names one key forever; it is that\n * key's verification method in the org DID document and the JWT `kid` of\n * everything it signs. Which key is active is the issuer's business: a\n * verifier takes the key the kid names from the issuer's DID document.\n */\nexport function mcpiOrgKeyFragment(sequence: number): string {\n if (!Number.isSafeInteger(sequence) || sequence < 1) {\n throw new RangeError(`An org key sequence is a positive integer, got ${sequence}`);\n }\n return `key-${sequence}`;\n}\n\nconst ORG_KEY_FRAGMENT_PATTERN = /^key-[1-9]\\d{0,8}$/;\n\n/**\n * True when `kid` names one of the org's signing keys: `<orgDid>#key-<n>`,\n * n ≥ 1. Verifiers pin a credential's `kid` with this before resolving the\n * issuer's DID document, then take the key from the method with that id.\n */\nexport function isMcpiOrgKeyId(orgDid: string, kid: unknown): boolean {\n return (\n typeof kid === 'string' &&\n kid.startsWith(`${orgDid}#`) &&\n ORG_KEY_FRAGMENT_PATTERN.test(kid.slice(orgDid.length + 1))\n );\n}\n\n/**\n * The delegation root DIDs an org trusts — the value the policies route resolves\n * SERVER-SIDE and returns on the policy payload, which each surface forwards into\n * the engine's `ContextSpec.trustedDelegationRoots` allow-list.\n *\n * Option 1 (first-party): an org trusts ONLY delegations rooted at its own DID.\n * This is the single place trust-root composition lives — called server-side in\n * the policies route, never on a surface. Option 2 (configurable partner issuer\n * DIDs) and the #3020 `resolveOrgDid(org)` multi-host generalization extend ONLY\n * this function; the engine, wire format, orchestrator threading, and every\n * surface stay unchanged.\n *\n * Throws on an invalid slug (same boundary as {@link deriveMcpiOrgDid}) rather\n * than returning `[]`: an empty list makes the engine reject every delegation,\n * so an org with a broken slug is a configuration error to surface loudly\n * server-side, not a silent outage of every delegated agent.\n */\nexport function resolveTrustedDelegationRoots(org: { slug: string }): string[] {\n return [deriveMcpiOrgDid(org.slug)];\n}\n","/**\n * The per-issuer status list wire contract: where an org's lists live, and\n * the two credential envelopes one list is published in.\n *\n * One bitstring, two envelopes. The envelope follows the credential's\n * profile: a base-profile VC-JWT (KYA-OS SPEC §6.6) points at the\n * StatusList2021 credential, a card-profile credential (SPEC §6.10) at a\n * Bitstring Status List credential secured with a JwtProof2020 JWS. Both\n * carry the same `encodedList`.\n *\n * Both envelopes are JSON: the credential, plus a `JwtProof2020` proof whose\n * `jwt` is a compact JWS (EdDSA, `typ: JWT`, `kid` = a verification method in\n * the issuer's DID document) over `{ iss, sub, iat, exp, vc }`, where `vc` is\n * the credential exactly as served. A reader that ignores proofs reads the\n * top-level copy; a verifier reads the signed `vc` and rejects the envelope\n * when the two differ (`verifyStatusList`).\n *\n * Pure and runtime-agnostic: no I/O, no signing, no compression.\n */\nimport { deriveMcpiOrgDid } from '../org-did';\n\n/** The two envelopes one bitstring is published in. */\nexport type StatusListEnvelope = 'StatusList2021' | 'BitstringStatusList';\n\n/** The `statusPurpose` values a list may carry. */\nexport type StatusListPurpose = 'revocation' | 'suspension';\n\n/**\n * Longest time a signed list is trusted after its `iat`. The publisher signs\n * each response with `exp = iat + STATUS_LIST_TTL_SECONDS`, and a verifier\n * never extends trust past it whatever the envelope claims.\n */\nexport const STATUS_LIST_TTL_SECONDS = 300;\n\n/** Tolerated verifier clock lag when checking `iat`. */\nexport const STATUS_LIST_CLOCK_SKEW_SECONDS = 60;\n\n/** The `proof.type` both envelopes carry. */\nexport const STATUS_LIST_PROOF_TYPE = 'JwtProof2020';\n\nconst LIST_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nconst BITSTRING_SUFFIX = '/bitstring';\n\n/** True when `listId` has the shape of a list id (a lowercase UUID). */\nexport function isStatusListId(listId: string): boolean {\n return LIST_ID_PATTERN.test(listId);\n}\n\n/**\n * The HTTPS origin and path of an org DID: `did:web:<host>:orgs:<slug>` →\n * `https://<host>/orgs/<slug>`. A list lives under its issuer's DID path, so\n * its host is the issuer DID's did:web host, never a separate literal.\n */\nfunction orgDidBase(issuer: string): string {\n const [, , host, ...path] = issuer.split(':');\n return `https://${host}/${path.join('/')}`;\n}\n\n/**\n * The public URL of one envelope of an org's list:\n * `https://<host>/orgs/<slug>/status-lists/<listId>` for StatusList2021,\n * with `/bitstring` appended for the Bitstring Status List credential.\n * Throws on an invalid slug or list id.\n */\nexport function orgStatusListUrl(\n slug: string,\n listId: string,\n envelope: StatusListEnvelope = 'StatusList2021'\n): string {\n const issuer = deriveMcpiOrgDid(slug);\n if (!isStatusListId(listId)) {\n throw new Error(`Invalid status list id: ${JSON.stringify(listId)}`);\n }\n const base = `${orgDidBase(issuer)}/status-lists/${listId}`;\n return envelope === 'BitstringStatusList' ? base + BITSTRING_SUFFIX : base;\n}\n\n/** What an org status-list URL names. */\nexport interface OrgStatusListLocation {\n slug: string;\n listId: string;\n envelope: StatusListEnvelope;\n /** The org DID that must have signed the list. */\n issuer: string;\n}\n\n/**\n * Parse an org status-list URL produced by {@link orgStatusListUrl}. Returns\n * null for anything else (another host, a query or fragment, a bad slug or\n * list id), so a verifier can refuse a list that is not an org's own. The\n * URL must sit exactly under the DID path of the org its slug names, so the\n * list is bound to that issuer.\n */\nexport function parseOrgStatusListUrl(url: string): OrgStatusListLocation | null {\n const match = /^https:\\/\\/[^/?#]+\\/orgs\\/([^/?#]+)\\/status-lists\\/([^/?#]+)(\\/bitstring)?$/.exec(\n url\n );\n if (!match) return null;\n const [, slug, listId, bitstring] = match;\n let issuer: string;\n try {\n issuer = deriveMcpiOrgDid(slug);\n } catch {\n return null;\n }\n if (!isStatusListId(listId)) return null;\n if (!url.startsWith(`${orgDidBase(issuer)}/status-lists/`)) return null;\n return {\n slug,\n listId,\n envelope: bitstring ? 'BitstringStatusList' : 'StatusList2021',\n issuer,\n };\n}\n\n/** Inputs for one signed envelope. */\nexport interface StatusListCredentialInput {\n envelope: StatusListEnvelope;\n /** The issuer DID; it signs the list and issued every credential on it. */\n issuer: string;\n /** The URL this envelope is served at (see {@link orgStatusListUrl}). */\n url: string;\n purpose: StatusListPurpose;\n /** The multibase (`u`) base64url gzip bitstring (see `encodeStatusBits`). */\n encodedList: string;\n /** Signing time, unix seconds. */\n issuedAt: number;\n}\n\n/** The credential to serve and the JWT claims the issuer signs over it. */\nexport interface StatusListCredentialParts {\n credential: Record<string, unknown>;\n claims: Record<string, unknown>;\n}\n\nconst ENVELOPE_SHAPES = {\n StatusList2021: {\n context: ['https://www.w3.org/2018/credentials/v1', 'https://w3id.org/vc/status-list/2021/v1'],\n credentialType: 'StatusList2021Credential',\n subjectType: 'StatusList2021',\n },\n BitstringStatusList: {\n context: ['https://www.w3.org/ns/credentials/v2'],\n credentialType: 'BitstringStatusListCredential',\n subjectType: 'BitstringStatusList',\n },\n} as const;\n\n/** The credential and subject `type` values of an envelope. */\nexport function statusListTypes(envelope: StatusListEnvelope): {\n credentialType: string;\n subjectType: string;\n} {\n const { credentialType, subjectType } = ENVELOPE_SHAPES[envelope];\n return { credentialType, subjectType };\n}\n\nfunction isoSeconds(seconds: number): string {\n return new Date(seconds * 1000).toISOString().replace('.000Z', 'Z');\n}\n\n/**\n * Build one envelope's credential and the claims to sign. The StatusList2021\n * credential carries `issuanceDate` and `expirationDate`; the Bitstring\n * Status List credential carries `validUntil`. The credential's expiry and the\n * JWT `exp` are the same instant.\n */\nexport function buildStatusListCredential(\n input: StatusListCredentialInput\n): StatusListCredentialParts {\n const shape = ENVELOPE_SHAPES[input.envelope];\n // Both envelopes are secured with JwtProof2020; evaluating VC-JOSE-COSE\n // enveloping before Data Integrity is #5867.\n const expiresAt = input.issuedAt + STATUS_LIST_TTL_SECONDS;\n const listRef = `${input.url}#list`;\n const validity =\n input.envelope === 'StatusList2021'\n ? { issuanceDate: isoSeconds(input.issuedAt), expirationDate: isoSeconds(expiresAt) }\n : { validUntil: isoSeconds(expiresAt) };\n\n const credential = {\n '@context': [...shape.context],\n id: input.url,\n type: ['VerifiableCredential', shape.credentialType],\n issuer: input.issuer,\n ...validity,\n credentialSubject: {\n id: listRef,\n type: shape.subjectType,\n statusPurpose: input.purpose,\n encodedList: input.encodedList,\n },\n };\n\n return {\n credential,\n claims: {\n iss: input.issuer,\n sub: listRef,\n iat: input.issuedAt,\n exp: expiresAt,\n vc: credential,\n },\n };\n}\n\n/** The served envelope: the credential plus its `JwtProof2020` proof. */\nexport function statusListEnvelopeBody(\n credential: Record<string, unknown>,\n jwt: string\n): Record<string, unknown> {\n return { ...credential, proof: { type: STATUS_LIST_PROOF_TYPE, jwt } };\n}\n","/**\n * The status bitstring and its `encodedList` form.\n *\n * Bit order is the W3C status-list one (StatusList2021, Bitstring Status List):\n * index `i` is bit `7 - i % 8` of byte `floor(i / 8)`, most significant bit\n * first. `encodedList` is the multibase base64url (`u` prefix) of the GZIP of\n * the raw bitstring.\n *\n * Decoding is bounded and strict, like the Rust engine's `gzip.rs`: the payload\n * is exactly ONE gzip member (RFC 1952). Its header is parsed here (magic,\n * method, reserved flags, optional fields, header CRC16); only the raw deflate\n * stream goes to the WHATWG `DecompressionStream`, so the same code runs in\n * Node, Workers and browsers. The deflate stream must end exactly where the\n * 8-byte trailer starts (a second member or trailing bytes reject), the\n * inflated output must be exactly `size / 8` bytes (inflation stops at the\n * first byte past that), and the trailer's CRC32 and ISIZE must match.\n */\n\n/**\n * Bits per org status list: 131,072 (16 KiB), the W3C-recommended minimum for\n * herd privacy. Every org list has this size, so a verifier knows exactly how\n * many bytes a list inflates to.\n */\nexport const STATUS_LIST_SIZE = 131_072;\n\nconst MULTIBASE_BASE64URL = 'u';\nconst BASE64URL_PATTERN = /^[A-Za-z0-9_-]*$/;\n\n/** Thrown when a bitstring or `encodedList` cannot be decoded. */\nexport class StatusBitstringError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StatusBitstringError';\n }\n}\n\n/** Byte offset and mask of status index `index`. */\nfunction locate(bits: Uint8Array, index: number): { byte: number; mask: number } {\n if (!Number.isSafeInteger(index) || index < 0 || index >= bits.length * 8) {\n throw new StatusBitstringError(\n `status index ${index} is outside a ${bits.length * 8}-bit list`\n );\n }\n return { byte: index >> 3, mask: 0x80 >> (index & 7) };\n}\n\n/** Whether status index `index` is set. Throws when it is outside the list. */\nexport function isStatusBitSet(bits: Uint8Array, index: number): boolean {\n const { byte, mask } = locate(bits, index);\n return (bits[byte] & mask) !== 0;\n}\n\n/** A copy of `bits` with status index `index` set. */\nexport function withStatusBitSet(bits: Uint8Array, index: number): Uint8Array {\n const { byte, mask } = locate(bits, index);\n const next = new Uint8Array(bits);\n next[byte] |= mask;\n return next;\n}\n\n/** Every set status index, ascending. */\nexport function setStatusIndices(bits: Uint8Array): number[] {\n const indices: number[] = [];\n bits.forEach((value, byte) => {\n for (let bit = 0; bit < 8; bit++) {\n if (value & (0x80 >> bit)) indices.push(byte * 8 + bit);\n }\n });\n return indices;\n}\n\n/** A zeroed bitstring of `size` bits with `indices` set. */\nexport function statusBitsFrom(size: number, indices: Iterable<number>): Uint8Array {\n if (!Number.isSafeInteger(size) || size <= 0 || size % 8 !== 0) {\n throw new StatusBitstringError(`status list size ${size} is not a positive multiple of 8`);\n }\n let bits: Uint8Array = new Uint8Array(size / 8);\n for (const index of indices) bits = withStatusBitSet(bits, index);\n return bits;\n}\n\nfunction toBase64Url(bytes: Uint8Array): string {\n let binary = '';\n for (const byte of bytes) binary += String.fromCharCode(byte);\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\n\nfunction fromBase64Url(text: string): Uint8Array {\n if (!BASE64URL_PATTERN.test(text) || text.length % 4 === 1) {\n throw new StatusBitstringError('encodedList is not base64url');\n }\n const padded =\n text.replace(/-/g, '+').replace(/_/g, '/') + '='.repeat((4 - (text.length % 4)) % 4);\n const binary = atob(padded);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n return bytes;\n}\n\nlet crcTable: Uint32Array | undefined;\n\n/** CRC-32 (IEEE 802.3, the gzip trailer's checksum). */\nfunction crc32(bytes: Uint8Array): number {\n if (!crcTable) {\n crcTable = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n crcTable[n] = c >>> 0;\n }\n }\n let crc = 0xffffffff;\n for (const byte of bytes) crc = crcTable[(crc ^ byte) & 0xff] ^ (crc >>> 8);\n return (crc ^ 0xffffffff) >>> 0;\n}\n\nconst GZIP_FHCRC = 0x02;\nconst GZIP_FEXTRA = 0x04;\nconst GZIP_FNAME = 0x08;\nconst GZIP_FCOMMENT = 0x10;\nconst GZIP_FLAG_RESERVED = 0xe0;\nconst GZIP_FIXED_HEADER_LENGTH = 10;\nconst GZIP_TRAILER_LENGTH = 8;\n\nconst truncatedMember = () => new StatusBitstringError('the gzip member is truncated');\nconst notGzip = () => new StatusBitstringError('not a gzip member');\nconst le16 = (bytes: Uint8Array, at: number) => bytes[at] | (bytes[at + 1] << 8);\nconst le32 = (bytes: Uint8Array, at: number) =>\n (bytes[at] | (bytes[at + 1] << 8) | (bytes[at + 2] << 16) | (bytes[at + 3] << 24)) >>> 0;\n\n/** Length of a gzip member's header (fixed part plus its optional fields), after checking it. */\nfunction gzipHeaderLength(member: Uint8Array): number {\n if (member.length < GZIP_FIXED_HEADER_LENGTH) throw truncatedMember();\n if (member[0] !== 0x1f || member[1] !== 0x8b || member[2] !== 8) throw notGzip();\n const flags = member[3];\n if (flags & GZIP_FLAG_RESERVED) throw notGzip();\n\n let position = GZIP_FIXED_HEADER_LENGTH;\n if (flags & GZIP_FEXTRA) {\n if (position + 2 > member.length) throw truncatedMember();\n position += 2 + le16(member, position);\n if (position > member.length) throw truncatedMember();\n }\n for (const flag of [GZIP_FNAME, GZIP_FCOMMENT]) {\n if (flags & flag) {\n const nul = member.indexOf(0, position);\n if (nul < 0) throw truncatedMember();\n position = nul + 1;\n }\n }\n if (flags & GZIP_FHCRC) {\n if (position + 2 > member.length) throw truncatedMember();\n if (le16(member, position) !== (crc32(member.subarray(0, position)) & 0xffff)) {\n throw new StatusBitstringError('the gzip header CRC does not match');\n }\n position += 2;\n }\n return position;\n}\n\n/** Whether `deflated` inflates as one complete raw deflate stream (within `maxOutputBytes`). */\nasync function inflatesCompletely(deflated: Uint8Array, maxOutputBytes: number): Promise<boolean> {\n try {\n await pipeThrough(deflated, new DecompressionStream('deflate-raw'), maxOutputBytes);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Inflate the single gzip member `member` to exactly `expectedLength` bytes.\n * The deflate stream must end exactly at the trailer: `DecompressionStream`\n * may ignore bytes after a stream's final block, so the stream is also\n * inflated without its last byte, which must then fail. If it still\n * completes, bytes (a second member, junk) sit between the stream and the\n * trailer.\n */\nasync function gunzipExact(member: Uint8Array, expectedLength: number): Promise<Uint8Array> {\n const bodyStart = gzipHeaderLength(member);\n if (member.length - bodyStart < GZIP_TRAILER_LENGTH) throw truncatedMember();\n const trailerStart = member.length - GZIP_TRAILER_LENGTH;\n const deflated = member.subarray(bodyStart, trailerStart);\n\n const bits = await pipeThrough(deflated, new DecompressionStream('deflate-raw'), expectedLength);\n if (deflated.length > 0 && (await inflatesCompletely(deflated.subarray(0, -1), expectedLength))) {\n throw new StatusBitstringError('data follows the deflate stream before the gzip trailer');\n }\n if (le32(member, trailerStart) !== crc32(bits)) {\n throw new StatusBitstringError('the gzip CRC32 does not match');\n }\n // ISIZE is the input length modulo 2^32 (RFC 1952 §2.3.1).\n if (le32(member, trailerStart + 4) !== bits.length >>> 0) {\n throw new StatusBitstringError('the gzip ISIZE does not match');\n }\n return bits;\n}\n\nasync function pipeThrough(\n bytes: Uint8Array,\n transform: CompressionStream | DecompressionStream,\n maxOutputBytes: number\n): Promise<Uint8Array> {\n const reader = new Blob([new Uint8Array(bytes)]).stream().pipeThrough(transform).getReader();\n const chunks: Uint8Array[] = [];\n let total = 0;\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.length;\n if (total > maxOutputBytes) {\n throw new StatusBitstringError(`bitstring inflates past ${maxOutputBytes} bytes`);\n }\n chunks.push(value);\n }\n } catch (error) {\n await reader.cancel().catch(() => undefined);\n if (error instanceof StatusBitstringError) throw error;\n throw new StatusBitstringError(\n `bitstring is not a valid compressed stream: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n const out = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n out.set(chunk, offset);\n offset += chunk.length;\n }\n return out;\n}\n\n/** The `encodedList` of a raw bitstring: `u` + base64url(gzip(bits)). */\nexport async function encodeStatusBits(bits: Uint8Array): Promise<string> {\n const gzipped = await pipeThrough(bits, new CompressionStream('gzip'), Number.MAX_SAFE_INTEGER);\n return MULTIBASE_BASE64URL + toBase64Url(gzipped);\n}\n\n/**\n * Decode an `encodedList` to the raw bitstring of a `size`-bit list. Rejects\n * with {@link StatusBitstringError} unless the payload is multibase base64url\n * of exactly one complete gzip member, nothing after it, whose CRC32 and ISIZE\n * check out and which inflates to exactly `size / 8` bytes (inflation stops at\n * the first byte past that).\n */\nexport async function decodeStatusBits(\n encodedList: string,\n size: number = STATUS_LIST_SIZE\n): Promise<Uint8Array> {\n if (!Number.isSafeInteger(size) || size <= 0 || size % 8 !== 0) {\n throw new StatusBitstringError(`status list size ${size} is not a positive multiple of 8`);\n }\n if (!encodedList.startsWith(MULTIBASE_BASE64URL)) {\n throw new StatusBitstringError('encodedList lacks the multibase base64url prefix');\n }\n const bits = await gunzipExact(fromBase64Url(encodedList.slice(1)), size / 8);\n if (bits.length !== size / 8) {\n throw new StatusBitstringError(`bitstring is ${bits.length} bytes, expected ${size / 8}`);\n }\n return bits;\n}\n","export default function canonicalize (object, seen = new Set()) {\n if (typeof object === 'number' && isNaN(object)) {\n throw new Error('NaN is not allowed');\n }\n\n if (typeof object === 'number' && !isFinite(object)) {\n throw new Error('Infinity is not allowed');\n }\n\n if (object === null || typeof object !== 'object') {\n return JSON.stringify(object);\n }\n\n if (typeof object.toJSON === 'function') {\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n const result = canonicalize(object.toJSON(), seen);\n seen.delete(object);\n return result;\n }\n\n if (seen.has(object)) {\n throw new Error('Circular reference detected');\n }\n seen.add(object);\n\n let result;\n if (Array.isArray(object)) {\n const values = object.map((cv) => {\n const value = cv === undefined || typeof cv === 'symbol' ? null : cv;\n return canonicalize(value, seen);\n });\n result = `[${values.join(',')}]`;\n } else {\n const parts = [];\n for (const key of Object.keys(object).sort()) {\n if (object[key] === undefined || typeof object[key] === 'symbol') {\n continue;\n }\n parts.push(`${canonicalize(key)}:${canonicalize(object[key], seen)}`);\n }\n result = `{${parts.join(',')}}`;\n }\n\n seen.delete(object);\n return result;\n}\n","/**\n * Verify a signed status list before trusting a bit (design §3.5).\n *\n * `verifyStatusList` accepts either envelope (see `./wire`) and returns the\n * bitstring only when every check below passes. It reads the bits from the\n * SIGNED `vc`, never from the unsigned copy beside it, and rejects the\n * envelope when the two differ. Any failure rejects with a\n * {@link StatusListVerificationError}; a caller never treats a rejection as\n * \"not revoked\".\n *\n * The engine's `verify_status_list` (`kya-os-engine` `status_list`, bound as\n * `engineVerifyStatusList` in `@kya-os/checkpoint-wasm-runtime`) is the\n * verifier for every SDK host. This TypeScript verifier is the parity oracle\n * the engine is checked against\n * (`tests/cross-runtime-parity/status-list/fixtures/vectors.json`). Two\n * production callers still use it until they move onto the engine: the Fly\n * gateway (`apps/gateway/src/lib/did-kid-refresh.ts`) and the dashboard's\n * signed-list reader (`apps/web/lib/authz/adapters/signed-status-list-reader.ts`).\n * New callers use the engine's binding.\n *\n * Checks, in order (the shared parity vectors pin the error code of each):\n * 1. `malformed`: the body is an object with `proof.type: JwtProof2020` and a\n * compact JWS of at most 256 KiB whose header is `alg: EdDSA`, `typ: JWT`,\n * a string `kid` and no `crit`.\n * 2. `issuer_mismatch`: the JWT `iss` is the expected issuer (checked before\n * any DID resolution, so a list never makes us resolve a foreign DID).\n * 3. `did_unresolved`: the issuer's DID document resolves and names itself.\n * 4. `unknown_kid`: `kid` is a DID URL under the issuer naming a verification\n * method the document lists for `assertionMethod`, whose `publicKeyJwk` is\n * an Ed25519 key (`publicKeyMultibase` and other encodings are refused).\n * 5. `bad_signature`: the JWS verifies with that key under strict RFC 8032\n * rules (canonical encodings, small-order keys refused), as the Rust\n * engine's `verify_strict` does.\n * 6. `malformed`: `vc` is one of the two envelope credentials.\n * 7. `issuer_mismatch`: `vc.issuer` is the issuer.\n * 8. `url_mismatch`: `vc.id` is the URL the credential named (any\n * `#fragment` stripped), and `sub` and `vc.credentialSubject.id` are that\n * URL + `#list`.\n * 9. `purpose_mismatch`: `statusPurpose` is the expected purpose.\n * 10. `malformed` / `not_yet_valid` / `expired`: `iat` and `exp` are integers\n * with `exp > iat`; every present validity field (`validFrom`,\n * `issuanceDate`, `validUntil`, `expirationDate`) is a strict RFC 3339\n * date-time ({@link parseRfc3339}); the latest of `iat` and the two start\n * fields is at most 60 s ahead of now, and now is before the earliest of\n * `exp`, `iat + 300 s` and the two end fields.\n * 11. `copy_mismatch`: the envelope without `proof` equals the signed `vc`.\n * 12. `decode_failed`: the signed `encodedList` decodes to exactly `size / 8`\n * bytes (multibase, ONE gzip member and nothing after it, CRC32 and ISIZE,\n * no bomb).\n *\n * A signature segment or JWK `x` that is not base64url (e.g. a length of 1 mod\n * 4) is `bad_signature` / `unknown_kid`, never an uncaught decoding error.\n */\nimport canonicalize from 'canonicalize';\nimport { verifyAsync } from '@noble/ed25519';\n\nimport { STATUS_LIST_SIZE, StatusBitstringError, decodeStatusBits } from './bits';\nimport {\n STATUS_LIST_CLOCK_SKEW_SECONDS,\n STATUS_LIST_PROOF_TYPE,\n STATUS_LIST_TTL_SECONDS,\n statusListTypes,\n type StatusListEnvelope,\n type StatusListPurpose,\n} from './wire';\n\n/** Why a status list was rejected. */\nexport type StatusListErrorCode =\n | 'malformed'\n | 'issuer_mismatch'\n | 'did_unresolved'\n | 'unknown_kid'\n | 'bad_signature'\n | 'url_mismatch'\n | 'purpose_mismatch'\n | 'not_yet_valid'\n | 'expired'\n | 'copy_mismatch'\n | 'decode_failed';\n\n/** A rejected status list. `code` names the first check that failed. */\nexport class StatusListVerificationError extends Error {\n constructor(\n readonly code: StatusListErrorCode,\n message: string\n ) {\n super(`status list rejected (${code}): ${message}`);\n this.name = 'StatusListVerificationError';\n }\n}\n\nexport interface VerifyStatusListOptions {\n /**\n * The `statusListCredential` URL the credential named (the URL fetched). A\n * `#fragment` is ignored: the list is compared and keyed by the bare URL.\n */\n url: string;\n /** The issuer of the credential being checked; it must have signed the list. */\n issuer: string;\n /** Resolves a DID to its DID document, or null. Only called for `issuer`. */\n resolveDidDocument(did: string): Promise<unknown>;\n /** Expected `statusPurpose`. Default `revocation`. */\n purpose?: StatusListPurpose;\n /** List size in bits. Default {@link STATUS_LIST_SIZE}. */\n size?: number;\n /** Unix seconds. Default: the current time. */\n now?: number;\n}\n\n/** A list that passed every check. */\nexport interface VerifiedStatusList {\n envelope: StatusListEnvelope;\n /** The bare list URL (no fragment), the key a cache of lists uses. */\n url: string;\n issuer: string;\n /** JWT `iat`, unix seconds. */\n issuedAt: number;\n /** The instant trust in this list ends, unix seconds. */\n expiresAt: number;\n /** The raw bitstring (see `isStatusBitSet`). */\n bits: Uint8Array;\n}\n\nconst MAX_JWS_LENGTH = 256 * 1024;\nconst JWS_SEGMENT = /^[A-Za-z0-9_-]+$/;\n\ntype Json = Record<string, unknown>;\n\nfunction reject(code: StatusListErrorCode, message: string): never {\n throw new StatusListVerificationError(code, message);\n}\n\nfunction isObject(value: unknown): value is Json {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * The bytes of an unpadded base64url string, or null when it is not one (a\n * length of 1 mod 4 encodes no whole byte). Non-zero trailing bits are\n * accepted, as `atob` and the Rust engine's decoder both do.\n */\nfunction base64UrlBytes(segment: string): Uint8Array | null {\n if (!JWS_SEGMENT.test(segment) || segment.length % 4 === 1) return null;\n const padded =\n segment.replace(/-/g, '+').replace(/_/g, '/') + '='.repeat((4 - (segment.length % 4)) % 4);\n let binary: string;\n try {\n binary = atob(padded);\n } catch {\n return null;\n }\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n return bytes;\n}\n\nfunction decodeSegment(segment: string): Json {\n const bytes = base64UrlBytes(segment);\n let parsed: unknown;\n try {\n if (!bytes) throw new Error('not base64url');\n parsed = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));\n } catch {\n return reject('malformed', 'a JWS segment is not base64url JSON');\n }\n if (!isObject(parsed)) reject('malformed', 'a JWS segment is not a JSON object');\n return parsed;\n}\n\nfunction hasType(value: unknown, wanted: string): boolean {\n return Array.isArray(value) && value.includes(wanted);\n}\n\nfunction idOf(value: unknown): unknown {\n return isObject(value) ? value.id : value;\n}\n\n/** Days since 1970-01-01 of a proleptic Gregorian date (H. Hinnant's `days_from_civil`). */\nfunction daysFromCivil(year: number, month: number, day: number): number {\n const y = month <= 2 ? year - 1 : year;\n const era = Math.floor(y / 400);\n const yearOfEra = y - era * 400;\n const dayOfYear = Math.floor((153 * ((month + 9) % 12) + 2) / 5) + day - 1;\n const dayOfEra =\n yearOfEra * 365 + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100) + dayOfYear;\n return era * 146_097 + dayOfEra - 719_468;\n}\n\nconst RFC3339 =\n /^(\\d{4})-(\\d{2})-(\\d{2})[Tt](\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:([Zz])|([+-])(\\d{2}):(\\d{2}))$/;\n\n/**\n * Unix seconds of an RFC 3339 date-time (the `xsd:dateTime` form VC validity\n * fields use), or null. Only the full form is accepted: date, `T`, time, an\n * optional fraction (floored to the second) and `Z` or a `±HH:MM` offset.\n * Impossible dates and times (Feb 29 of a common year, hour 24, second 60) are\n * refused. Matches the Rust engine's `instant::parse_rfc3339` exactly;\n * `Date.parse` is not used because it accepts date-only, offset-less (host\n * local time), rolled-over and RFC 2822 values.\n */\nexport function parseRfc3339(text: string): number | null {\n const match = RFC3339.exec(text);\n if (!match) return null;\n const [year, month, day, hour, minute, second] = match.slice(1, 7).map(Number);\n const leap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n const daysInMonth = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];\n if (\n daysInMonth === undefined ||\n day < 1 ||\n day > daysInMonth ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return null;\n }\n let offset = 0;\n if (!match[7]) {\n const offsetHours = Number(match[9]);\n const offsetMinutes = Number(match[10]);\n if (offsetHours > 23 || offsetMinutes > 59) return null;\n offset = (match[8] === '+' ? 1 : -1) * (offsetHours * 3600 + offsetMinutes * 60);\n }\n return daysFromCivil(year, month, day) * 86_400 + hour * 3600 + minute * 60 + second - offset;\n}\n\n/**\n * The instant in the credential's validity field `field`, or undefined when it\n * is absent or null. A present value that is not an RFC 3339 date-time is\n * `malformed`: a validity bound the verifier cannot read is never ignored.\n */\nfunction validityInstant(vc: Json, field: string): number | undefined {\n const value = vc[field];\n if (value === undefined || value === null) return undefined;\n const instant = typeof value === 'string' ? parseRfc3339(value) : null;\n if (instant === null) reject('malformed', `${field} is not an RFC 3339 date-time`);\n return instant;\n}\n\n/** The Ed25519 public key `kid` names, when the document lists it for assertions. */\nfunction assertionKey(document: Json, issuer: string, kid: string): Uint8Array | null {\n const absolute = (id: unknown) =>\n typeof id === 'string' ? (id.startsWith('#') ? issuer + id : id) : undefined;\n const methods = Array.isArray(document.verificationMethod) ? document.verificationMethod : [];\n const assertions = Array.isArray(document.assertionMethod) ? document.assertionMethod : [];\n\n const listed = assertions.find((entry) => absolute(idOf(entry)) === kid);\n if (listed === undefined) return null;\n const method = isObject(listed)\n ? listed\n : methods.find((m: unknown) => isObject(m) && absolute(m.id) === kid);\n if (!isObject(method)) return null;\n\n // Org keys are published as publicKeyJwk only (DID Core §5.2.1, KYA-OS SPEC\n // §4.4); a method carrying another key encoding names no usable key.\n const jwk = method.publicKeyJwk;\n if (!isObject(jwk) || jwk.kty !== 'OKP' || jwk.crv !== 'Ed25519') return null;\n if (typeof jwk.x !== 'string') return null;\n const key = base64UrlBytes(jwk.x);\n return key?.length === 32 ? key : null;\n}\n\nfunction envelopeOf(vc: Json): StatusListEnvelope {\n const subject = vc.credentialSubject;\n if (!hasType(vc.type, 'VerifiableCredential') || !isObject(subject)) {\n return reject('malformed', 'vc is not a status list credential');\n }\n for (const envelope of ['StatusList2021', 'BitstringStatusList'] as const) {\n const { credentialType, subjectType } = statusListTypes(envelope);\n if (hasType(vc.type, credentialType) && subject.type === subjectType) return envelope;\n }\n return reject(\n 'malformed',\n 'vc is neither a StatusList2021 nor a Bitstring Status List credential'\n );\n}\n\n/**\n * Verify a fetched status-list envelope against its issuer's DID document and\n * return its bits. Rejects with {@link StatusListVerificationError}.\n */\nexport async function verifyStatusList(\n body: unknown,\n options: VerifyStatusListOptions\n): Promise<VerifiedStatusList> {\n const { issuer } = options;\n const fragment = options.url.indexOf('#');\n const url = fragment >= 0 ? options.url.slice(0, fragment) : options.url;\n const purpose = options.purpose ?? 'revocation';\n const size = options.size ?? STATUS_LIST_SIZE;\n const now = options.now ?? Math.floor(Date.now() / 1000);\n\n // 1. Envelope and JWS structure.\n if (!isObject(body) || !isObject(body.proof)) reject('malformed', 'no proof object');\n const { proof, ...unsigned } = body;\n if (proof.type !== STATUS_LIST_PROOF_TYPE || typeof proof.jwt !== 'string') {\n reject('malformed', `proof is not a ${STATUS_LIST_PROOF_TYPE}`);\n }\n const jws = proof.jwt;\n const segments = jws.split('.');\n if (\n jws.length > MAX_JWS_LENGTH ||\n segments.length !== 3 ||\n !segments.every((s) => JWS_SEGMENT.test(s))\n ) {\n reject('malformed', 'proof.jwt is not a compact JWS');\n }\n const [headerSegment, payloadSegment, signatureSegment] = segments;\n const header = decodeSegment(headerSegment);\n const payload = decodeSegment(payloadSegment);\n if (\n header.alg !== 'EdDSA' ||\n header.typ !== 'JWT' ||\n 'crit' in header ||\n typeof header.kid !== 'string'\n ) {\n reject('malformed', 'JWS header must be alg EdDSA, typ JWT, a kid and no crit');\n }\n const kid = header.kid;\n\n // 2. Issuer, before any resolution.\n if (payload.iss !== issuer) reject('issuer_mismatch', 'the list is not signed by the issuer');\n\n // 3–4. The issuer's own key.\n if (!kid.startsWith(`${issuer}#`)) reject('unknown_kid', 'kid is not under the issuer DID');\n let document: unknown;\n try {\n document = await options.resolveDidDocument(issuer);\n } catch {\n document = null;\n }\n if (!isObject(document) || document.id !== issuer) {\n reject('did_unresolved', 'the issuer DID document did not resolve');\n }\n const key = assertionKey(document, issuer, kid);\n if (!key) reject('unknown_kid', 'kid names no Ed25519 assertion key of the issuer');\n\n // 5. Signature.\n const signature = base64UrlBytes(signatureSegment);\n const signingInput = new TextEncoder().encode(`${headerSegment}.${payloadSegment}`);\n let valid = false;\n try {\n valid =\n signature?.length === 64 &&\n (await verifyAsync(signature, signingInput, key, { zip215: false }));\n } catch {\n valid = false;\n }\n if (!valid) reject('bad_signature', 'the JWS signature does not verify');\n\n // 6–9. The signed credential.\n const vc = payload.vc;\n if (!isObject(vc)) return reject('malformed', 'no vc claim');\n const envelope = envelopeOf(vc);\n const subject = vc.credentialSubject as Json;\n if (idOf(vc.issuer) !== issuer) reject('issuer_mismatch', 'vc.issuer is not the issuer');\n if (vc.id !== url || payload.sub !== `${url}#list` || subject.id !== `${url}#list`) {\n reject('url_mismatch', 'the list is not the one the credential names');\n }\n if (subject.statusPurpose !== purpose) {\n reject('purpose_mismatch', `statusPurpose is not ${purpose}`);\n }\n\n // 10. Validity.\n const { iat, exp } = payload;\n if (\n !Number.isSafeInteger(iat) ||\n !Number.isSafeInteger(exp) ||\n (exp as number) <= (iat as number)\n ) {\n reject('malformed', 'iat and exp must be integers with exp after iat');\n }\n const issuedAt = iat as number;\n // Every present validity field must parse, and every one bounds the window.\n const [validFrom, issuanceDate, validUntil, expirationDate] = [\n 'validFrom',\n 'issuanceDate',\n 'validUntil',\n 'expirationDate',\n ].map((field) => validityInstant(vc, field));\n const notBefore = Math.max(issuedAt, validFrom ?? issuedAt, issuanceDate ?? issuedAt);\n if (notBefore > now + STATUS_LIST_CLOCK_SKEW_SECONDS) {\n reject('not_yet_valid', 'the list is not valid yet');\n }\n const expiresAt = Math.min(\n exp as number,\n issuedAt + STATUS_LIST_TTL_SECONDS,\n validUntil ?? Number.MAX_SAFE_INTEGER,\n expirationDate ?? Number.MAX_SAFE_INTEGER\n );\n if (now >= expiresAt) reject('expired', 'the list has expired');\n\n // 11. The unsigned copy must be the signed one.\n if (canonicalize(unsigned) !== canonicalize(vc)) {\n reject('copy_mismatch', 'the unsigned credential differs from the signed one');\n }\n\n // 12. Bits, from the signed credential only.\n if (typeof subject.encodedList !== 'string') reject('malformed', 'no encodedList');\n let bits: Uint8Array;\n try {\n bits = await decodeStatusBits(subject.encodedList, size);\n } catch (error) {\n if (error instanceof StatusBitstringError) reject('decode_failed', error.message);\n throw error;\n }\n\n return { envelope, url, issuer, issuedAt, expiresAt, bits };\n}\n"],"x_google_ignoreList":[3],"mappings":";;;;;;;;;;;AASA,MAAa,oBAAoB;AAEjC,MAAM,mBAAmB;;AAczB,SAAgB,iBAAiB,MAAsB;CACrD,IAAI,CAAC,iBAAiB,KAAK,IAAI,GAC7B,MAAM,IAAI,MAAM,4CAA4C,KAAK,UAAU,IAAI,GAAG;CAEpF,OAAO,WAAW,kBAAkB,QAAQ;AAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEA,MAAa,0BAA0B;;AAGv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,iDAAiD;CAEvE,MAAM,WAAW;CAEjB,MAAM,CAAC,WAAW,cAAc,YAAY,kBAAkB;EAC5D;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,UAAU,gBAAgB,IAAI,KAAK,CAAC;CAE3C,IADkB,KAAK,IAAI,UAAU,aAAa,UAAU,gBAAgB,QAChE,IAAI,UACd,OAAO,iBAAiB,2BAA2B;CAErD,MAAM,YAAY,KAAK,IACrB,KACA,gBACA,cAAc,OAAO,kBACrB,kBAAkB,OAAO,gBAC3B;CACA,IAAI,OAAO,WAAW,OAAO,WAAW,sBAAsB;CAG9D,IAAI,aAAa,QAAQ,MAAM,aAAa,EAAE,GAC5C,OAAO,iBAAiB,qDAAqD;CAI/E,IAAI,OAAO,QAAQ,gBAAgB,UAAU,OAAO,aAAa,gBAAgB;CACjF,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,iBAAiB,QAAQ,aAAa,IAAI;CACzD,SAAS,OAAO;EACd,IAAI,iBAAiB,sBAAsB,OAAO,iBAAiB,MAAM,OAAO;EAChF,MAAM;CACR;CAEA,OAAO;EAAE;EAAU;EAAK;EAAQ;EAAU;EAAW;CAAK;AAC5D"}
@@ -0,0 +1,110 @@
1
+ //#region src/constants/patterns.d.ts
2
+ declare const UUID_PATTERN: RegExp;
3
+ declare const VALIDATION_PATTERNS: {
4
+ readonly UUID: RegExp;
5
+ readonly ULID: RegExp;
6
+ readonly SLUG: RegExp;
7
+ readonly IPV4: RegExp;
8
+ readonly IPV6: RegExp;
9
+ readonly IP: RegExp;
10
+ readonly CIDR: RegExp;
11
+ readonly DOMAIN: RegExp;
12
+ readonly HOSTNAME: RegExp;
13
+ readonly URL: RegExp;
14
+ readonly EMAIL: RegExp;
15
+ readonly PHONE: RegExp;
16
+ readonly JWT: RegExp;
17
+ readonly BASE64: RegExp;
18
+ readonly HEX: RegExp;
19
+ readonly MD5: RegExp;
20
+ readonly SHA1: RegExp;
21
+ readonly SHA256: RegExp;
22
+ readonly SEMVER: RegExp;
23
+ readonly FILENAME: RegExp;
24
+ readonly PATH: RegExp;
25
+ readonly API_KEY: RegExp;
26
+ readonly SECRET_KEY: RegExp;
27
+ readonly PIXEL_ID: RegExp;
28
+ };
29
+ declare const USER_AGENT_PATTERNS: {
30
+ readonly OPENAI: RegExp;
31
+ readonly ANTHROPIC: RegExp;
32
+ readonly PERPLEXITY: RegExp;
33
+ readonly GOOGLE_AI: RegExp;
34
+ readonly MICROSOFT_AI: RegExp;
35
+ readonly GOOGLEBOT: RegExp;
36
+ readonly BINGBOT: RegExp;
37
+ readonly DUCKDUCKBOT: RegExp;
38
+ readonly BAIDUBOT: RegExp;
39
+ readonly YANDEXBOT: RegExp;
40
+ readonly FACEBOOK: RegExp;
41
+ readonly TWITTER: RegExp;
42
+ readonly LINKEDIN: RegExp;
43
+ readonly WHATSAPP: RegExp;
44
+ readonly TELEGRAM: RegExp;
45
+ readonly DISCORD: RegExp;
46
+ readonly SLACK: RegExp;
47
+ readonly GENERIC_BOT: RegExp;
48
+ readonly SCRAPY: RegExp;
49
+ readonly PUPPETEER: RegExp;
50
+ readonly PLAYWRIGHT: RegExp;
51
+ readonly SELENIUM: RegExp;
52
+ readonly POSTMAN: RegExp;
53
+ readonly INSOMNIA: RegExp;
54
+ readonly CURL: RegExp;
55
+ readonly WGET: RegExp;
56
+ readonly HTTPIE: RegExp;
57
+ readonly UPTIMEROBOT: RegExp;
58
+ readonly PINGDOM: RegExp;
59
+ readonly NEWRELIC: RegExp;
60
+ readonly DATADOG: RegExp;
61
+ };
62
+ declare const HEADER_PATTERNS: {
63
+ readonly AI_HEADERS: RegExp;
64
+ readonly AUTOMATION_HEADERS: RegExp;
65
+ readonly MISSING_ACCEPT: RegExp;
66
+ readonly MISSING_ACCEPT_LANGUAGE: RegExp;
67
+ readonly MISSING_ACCEPT_ENCODING: RegExp;
68
+ readonly GENERIC_ACCEPT: RegExp;
69
+ readonly NO_COOKIES: RegExp;
70
+ readonly PROXY_HEADERS: RegExp;
71
+ readonly CLOUD_HEADERS: RegExp;
72
+ };
73
+ declare const BROWSER_PATTERNS: {
74
+ readonly CHROME: RegExp;
75
+ readonly FIREFOX: RegExp;
76
+ readonly SAFARI: RegExp;
77
+ readonly EDGE: RegExp;
78
+ readonly OPERA: RegExp;
79
+ readonly IE: RegExp;
80
+ };
81
+ declare const OS_PATTERNS: {
82
+ readonly WINDOWS: RegExp;
83
+ readonly MACOS: RegExp;
84
+ readonly LINUX: RegExp;
85
+ readonly ANDROID: RegExp;
86
+ readonly IOS: RegExp;
87
+ };
88
+ declare const MOBILE_PATTERNS: {
89
+ readonly MOBILE: RegExp;
90
+ readonly TABLET: RegExp;
91
+ readonly DESKTOP: RegExp;
92
+ };
93
+ declare const SUSPICIOUS_PATTERNS: {
94
+ readonly RAPID_REQUESTS: RegExp;
95
+ readonly SEQUENTIAL_URLS: RegExp;
96
+ readonly API_ENDPOINTS: RegExp;
97
+ readonly DIRECT_POST: RegExp;
98
+ readonly SQL_INJECTION: RegExp;
99
+ readonly XSS_ATTEMPT: RegExp;
100
+ readonly PATH_TRAVERSAL: RegExp;
101
+ readonly URL_ENCODED: RegExp;
102
+ readonly BASE64_DATA: RegExp;
103
+ };
104
+ declare function testPattern(pattern: RegExp, value: string): boolean;
105
+ declare function extractMatch(pattern: RegExp, value: string): string | null;
106
+ declare function testPatterns(patterns: RegExp[], value: string): boolean;
107
+ declare function findMatchingPattern(patterns: Record<string, RegExp>, value: string): string | null;
108
+ //#endregion
109
+ export { SUSPICIOUS_PATTERNS as a, VALIDATION_PATTERNS as c, testPattern as d, testPatterns as f, OS_PATTERNS as i, extractMatch as l, HEADER_PATTERNS as n, USER_AGENT_PATTERNS as o, MOBILE_PATTERNS as r, UUID_PATTERN as s, BROWSER_PATTERNS as t, findMatchingPattern as u };
110
+ //# sourceMappingURL=patterns-Bp40cwh2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns-Bp40cwh2.d.mts","names":[],"sources":["../src/constants/patterns.ts"],"mappings":";cAiBa,cAAY;cAGZ;;;;;;;;;;;;;;;;;;;;;;;;;;cAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgDA;;;;;;;;;;;cA0BA;;;;;;;;cAYA;;;;;;;cAWA;;;;;cASA;;;;;;;;;;;iBAuCG,YAAY,SAAS,QAAQ;iBAS7B,aAAa,SAAS,QAAQ;iBAS9B,aAAa,UAAU,UAAU;iBAOjC,oBACd,UAAU,eAAe,SACzB"}
@@ -0,0 +1,110 @@
1
+ //#region src/constants/patterns.d.ts
2
+ declare const UUID_PATTERN: RegExp;
3
+ declare const VALIDATION_PATTERNS: {
4
+ readonly UUID: RegExp;
5
+ readonly ULID: RegExp;
6
+ readonly SLUG: RegExp;
7
+ readonly IPV4: RegExp;
8
+ readonly IPV6: RegExp;
9
+ readonly IP: RegExp;
10
+ readonly CIDR: RegExp;
11
+ readonly DOMAIN: RegExp;
12
+ readonly HOSTNAME: RegExp;
13
+ readonly URL: RegExp;
14
+ readonly EMAIL: RegExp;
15
+ readonly PHONE: RegExp;
16
+ readonly JWT: RegExp;
17
+ readonly BASE64: RegExp;
18
+ readonly HEX: RegExp;
19
+ readonly MD5: RegExp;
20
+ readonly SHA1: RegExp;
21
+ readonly SHA256: RegExp;
22
+ readonly SEMVER: RegExp;
23
+ readonly FILENAME: RegExp;
24
+ readonly PATH: RegExp;
25
+ readonly API_KEY: RegExp;
26
+ readonly SECRET_KEY: RegExp;
27
+ readonly PIXEL_ID: RegExp;
28
+ };
29
+ declare const USER_AGENT_PATTERNS: {
30
+ readonly OPENAI: RegExp;
31
+ readonly ANTHROPIC: RegExp;
32
+ readonly PERPLEXITY: RegExp;
33
+ readonly GOOGLE_AI: RegExp;
34
+ readonly MICROSOFT_AI: RegExp;
35
+ readonly GOOGLEBOT: RegExp;
36
+ readonly BINGBOT: RegExp;
37
+ readonly DUCKDUCKBOT: RegExp;
38
+ readonly BAIDUBOT: RegExp;
39
+ readonly YANDEXBOT: RegExp;
40
+ readonly FACEBOOK: RegExp;
41
+ readonly TWITTER: RegExp;
42
+ readonly LINKEDIN: RegExp;
43
+ readonly WHATSAPP: RegExp;
44
+ readonly TELEGRAM: RegExp;
45
+ readonly DISCORD: RegExp;
46
+ readonly SLACK: RegExp;
47
+ readonly GENERIC_BOT: RegExp;
48
+ readonly SCRAPY: RegExp;
49
+ readonly PUPPETEER: RegExp;
50
+ readonly PLAYWRIGHT: RegExp;
51
+ readonly SELENIUM: RegExp;
52
+ readonly POSTMAN: RegExp;
53
+ readonly INSOMNIA: RegExp;
54
+ readonly CURL: RegExp;
55
+ readonly WGET: RegExp;
56
+ readonly HTTPIE: RegExp;
57
+ readonly UPTIMEROBOT: RegExp;
58
+ readonly PINGDOM: RegExp;
59
+ readonly NEWRELIC: RegExp;
60
+ readonly DATADOG: RegExp;
61
+ };
62
+ declare const HEADER_PATTERNS: {
63
+ readonly AI_HEADERS: RegExp;
64
+ readonly AUTOMATION_HEADERS: RegExp;
65
+ readonly MISSING_ACCEPT: RegExp;
66
+ readonly MISSING_ACCEPT_LANGUAGE: RegExp;
67
+ readonly MISSING_ACCEPT_ENCODING: RegExp;
68
+ readonly GENERIC_ACCEPT: RegExp;
69
+ readonly NO_COOKIES: RegExp;
70
+ readonly PROXY_HEADERS: RegExp;
71
+ readonly CLOUD_HEADERS: RegExp;
72
+ };
73
+ declare const BROWSER_PATTERNS: {
74
+ readonly CHROME: RegExp;
75
+ readonly FIREFOX: RegExp;
76
+ readonly SAFARI: RegExp;
77
+ readonly EDGE: RegExp;
78
+ readonly OPERA: RegExp;
79
+ readonly IE: RegExp;
80
+ };
81
+ declare const OS_PATTERNS: {
82
+ readonly WINDOWS: RegExp;
83
+ readonly MACOS: RegExp;
84
+ readonly LINUX: RegExp;
85
+ readonly ANDROID: RegExp;
86
+ readonly IOS: RegExp;
87
+ };
88
+ declare const MOBILE_PATTERNS: {
89
+ readonly MOBILE: RegExp;
90
+ readonly TABLET: RegExp;
91
+ readonly DESKTOP: RegExp;
92
+ };
93
+ declare const SUSPICIOUS_PATTERNS: {
94
+ readonly RAPID_REQUESTS: RegExp;
95
+ readonly SEQUENTIAL_URLS: RegExp;
96
+ readonly API_ENDPOINTS: RegExp;
97
+ readonly DIRECT_POST: RegExp;
98
+ readonly SQL_INJECTION: RegExp;
99
+ readonly XSS_ATTEMPT: RegExp;
100
+ readonly PATH_TRAVERSAL: RegExp;
101
+ readonly URL_ENCODED: RegExp;
102
+ readonly BASE64_DATA: RegExp;
103
+ };
104
+ declare function testPattern(pattern: RegExp, value: string): boolean;
105
+ declare function extractMatch(pattern: RegExp, value: string): string | null;
106
+ declare function testPatterns(patterns: RegExp[], value: string): boolean;
107
+ declare function findMatchingPattern(patterns: Record<string, RegExp>, value: string): string | null;
108
+ //#endregion
109
+ export { SUSPICIOUS_PATTERNS as a, VALIDATION_PATTERNS as c, testPattern as d, testPatterns as f, OS_PATTERNS as i, extractMatch as l, HEADER_PATTERNS as n, USER_AGENT_PATTERNS as o, MOBILE_PATTERNS as r, UUID_PATTERN as s, BROWSER_PATTERNS as t, findMatchingPattern as u };
110
+ //# sourceMappingURL=patterns-Bp40cwh2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns-Bp40cwh2.d.ts","names":[],"sources":["../src/constants/patterns.ts"],"mappings":";cAiBa,cAAY;cAGZ;;;;;;;;;;;;;;;;;;;;;;;;;;cAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgDA;;;;;;;;;;;cA0BA;;;;;;;;cAYA;;;;;;;cAWA;;;;;cASA;;;;;;;;;;;iBAuCG,YAAY,SAAS,QAAQ;iBAS7B,aAAa,SAAS,QAAQ;iBAS9B,aAAa,UAAU,UAAU;iBAOjC,oBACd,UAAU,eAAe,SACzB"}
@@ -0,0 +1,243 @@
1
+ //#region src/constants/patterns.ts
2
+ /**
3
+ * Regular Expression Patterns
4
+ *
5
+ * Common regex patterns used for validation and detection
6
+ */
7
+ /**
8
+ * Validation Patterns
9
+ */
10
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
11
+ const VALIDATION_PATTERNS = {
12
+ UUID: UUID_PATTERN,
13
+ ULID: /^[0-9A-HJKMNP-TV-Z]{26}$/,
14
+ SLUG: /^[a-z0-9]+(?:-[a-z0-9]+)*$/,
15
+ IPV4: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
16
+ IPV6: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
17
+ IP: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(([0-9a-f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{4,6}$/,
24
+ JWT: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/,
25
+ BASE64: /^[A-Za-z0-9+\/]*={0,2}$/,
26
+ HEX: /^[0-9a-fA-F]+$/,
27
+ MD5: /^[a-f0-9]{32}$/i,
28
+ SHA1: /^[a-f0-9]{40}$/i,
29
+ SHA256: /^[a-f0-9]{64}$/i,
30
+ SEMVER: /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,
31
+ FILENAME: /^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*[a-zA-Z0-9])?\.[a-zA-Z0-9_-]+$/,
32
+ PATH: /^(\/[^/ ]*)+\/?$/,
33
+ API_KEY: /^[A-Za-z0-9_-]{32,}$/,
34
+ SECRET_KEY: /^[A-Za-z0-9_-]{64,}$/,
35
+ PIXEL_ID: /^px_[A-Za-z0-9]{16}$/
36
+ };
37
+ /**
38
+ * User Agent Patterns for Agent Detection
39
+ */
40
+ const USER_AGENT_PATTERNS = {
41
+ OPENAI: /(?:GPTBot|ChatGPT-User|OpenAI)/i,
42
+ ANTHROPIC: /(?:Claude-Web|Claude-User|anthropic-ai|claude-web|claude-user|ClaudeBot)/i,
43
+ PERPLEXITY: /(?:PerplexityBot|Perplexica)/i,
44
+ GOOGLE_AI: /(?:Bard|Google-InspectionTool)/i,
45
+ MICROSOFT_AI: /(?:BingPreview\/.*ChatGPT|Copilot)/i,
46
+ GOOGLEBOT: /Googlebot/i,
47
+ BINGBOT: /(?:bingbot|BingPreview|msnbot)/i,
48
+ DUCKDUCKBOT: /DuckDuckBot/i,
49
+ BAIDUBOT: /Baiduspider/i,
50
+ YANDEXBOT: /YandexBot/i,
51
+ FACEBOOK: /(?:facebookexternalhit|facebookcatalog)/i,
52
+ TWITTER: /(?:Twitterbot|TwitterImageProxy)/i,
53
+ LINKEDIN: /LinkedInBot/i,
54
+ WHATSAPP: /WhatsApp/i,
55
+ TELEGRAM: /TelegramBot/i,
56
+ DISCORD: /Discordbot/i,
57
+ SLACK: /Slackbot/i,
58
+ GENERIC_BOT: /(?:bot|crawler|spider|scraper|agent)/i,
59
+ SCRAPY: /Scrapy/i,
60
+ PUPPETEER: /(?:HeadlessChrome|Puppeteer)/i,
61
+ PLAYWRIGHT: /Playwright/i,
62
+ SELENIUM: /(?:selenium|webdriver)/i,
63
+ POSTMAN: /PostmanRuntime/i,
64
+ INSOMNIA: /insomnia/i,
65
+ CURL: /curl/i,
66
+ WGET: /Wget/i,
67
+ HTTPIE: /HTTPie/i,
68
+ UPTIMEROBOT: /UptimeRobot/i,
69
+ PINGDOM: /Pingdom/i,
70
+ NEWRELIC: /NewRelicPinger/i,
71
+ DATADOG: /Datadog/i
72
+ };
73
+ /**
74
+ * Header Patterns for Agent Detection
75
+ */
76
+ const HEADER_PATTERNS = {
77
+ AI_HEADERS: /^(?:X-(?:OpenAI|Anthropic|AI|Bot|Agent|LLM))/i,
78
+ AUTOMATION_HEADERS: /^(?:X-(?:Automated|Robot|Crawler|Scraper))/i,
79
+ MISSING_ACCEPT: /^$/,
80
+ MISSING_ACCEPT_LANGUAGE: /^$/,
81
+ MISSING_ACCEPT_ENCODING: /^$/,
82
+ GENERIC_ACCEPT: /^\*\/\*$/,
83
+ NO_COOKIES: /^$/,
84
+ PROXY_HEADERS: /^(?:X-Forwarded-|X-Real-IP|X-Originating-IP|Via|Forwarded)/i,
85
+ CLOUD_HEADERS: /^(?:X-(?:AWS|Azure|GCP|Cloudflare))/i
86
+ };
87
+ /**
88
+ * Browser Patterns
89
+ */
90
+ const BROWSER_PATTERNS = {
91
+ CHROME: /Chrome\/([0-9.]+)/,
92
+ FIREFOX: /Firefox\/([0-9.]+)/,
93
+ SAFARI: /Version\/([0-9.]+).*Safari/,
94
+ EDGE: /Edg\/([0-9.]+)/,
95
+ OPERA: /OPR\/([0-9.]+)/,
96
+ IE: /MSIE ([0-9.]+)/
97
+ };
98
+ /**
99
+ * Operating System Patterns
100
+ */
101
+ const OS_PATTERNS = {
102
+ WINDOWS: /Windows NT ([0-9.]+)/,
103
+ MACOS: /Mac OS X ([0-9_]+)/,
104
+ LINUX: /Linux/,
105
+ ANDROID: /Android ([0-9.]+)/,
106
+ IOS: /OS ([0-9_]+) like Mac OS X/
107
+ };
108
+ /**
109
+ * Mobile Device Patterns
110
+ */
111
+ const MOBILE_PATTERNS = {
112
+ MOBILE: /(?:Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i,
113
+ TABLET: /(?:iPad|Android.*Tablet|Tablet.*Android|Kindle|Silk)/i,
114
+ DESKTOP: /(?:Windows NT|Mac OS X|Linux|CrOS)/i
115
+ };
116
+ /**
117
+ * Suspicious Behavior Patterns
118
+ */
119
+ const SUSPICIOUS_PATTERNS = {
120
+ RAPID_REQUESTS: /^[0-9]{1,3}$/,
121
+ SEQUENTIAL_URLS: /\?(?:page|offset|id)=[0-9]+/,
122
+ API_ENDPOINTS: /\/api\/|\.json$|\.xml$/i,
123
+ DIRECT_POST: /^POST$/,
124
+ SQL_INJECTION: /(?:union|select|insert|update|delete|drop|create|alter|exec|script|javascript|onerror|onload|eval|src=)/i,
125
+ XSS_ATTEMPT: /(?:<script|javascript:|onerror=|onclick=|<iframe|<embed|<object)/i,
126
+ PATH_TRAVERSAL: /(?:\.\.\/|\.\.\\|%2e%2e%2f|%252e%252e%252f)/i,
127
+ URL_ENCODED: /%[0-9a-f]{2}/i,
128
+ BASE64_DATA: /data:[^;]+;base64,/i
129
+ };
130
+ /**
131
+ * Maximum input length for pattern matching. UAs, header values, and
132
+ * detection payloads are bounded in practice (<4KB even for the most
133
+ * verbose Chrome/Firefox UAs). Caps worst-case complexity for any
134
+ * polynomial-shaped pattern an external caller might supply to
135
+ * `testPattern` / `extractMatch`; CodeQL flagged the unbounded path
136
+ * (js/polynomial-redos) on PR #2576.
137
+ */
138
+ const MAX_PATTERN_INPUT_LENGTH = 4096;
139
+ /**
140
+ * Helper function to test a pattern. Returns `false` on inputs longer
141
+ * than {@link MAX_PATTERN_INPUT_LENGTH} — an abuse signal we'd rather
142
+ * reject than process.
143
+ */
144
+ function testPattern(pattern, value) {
145
+ if (value.length > MAX_PATTERN_INPUT_LENGTH) return false;
146
+ return pattern.test(value);
147
+ }
148
+ /**
149
+ * Helper function to extract match from pattern. Returns `null` on
150
+ * over-long inputs (same ReDoS defense as `testPattern`).
151
+ */
152
+ function extractMatch(pattern, value) {
153
+ if (value.length > MAX_PATTERN_INPUT_LENGTH) return null;
154
+ const match = value.match(pattern);
155
+ return match ? match[1] || match[0] : null;
156
+ }
157
+ /**
158
+ * Helper function to test multiple patterns
159
+ */
160
+ function testPatterns(patterns, value) {
161
+ return patterns.some((pattern) => testPattern(pattern, value));
162
+ }
163
+ /**
164
+ * Helper function to find matching pattern
165
+ */
166
+ function findMatchingPattern(patterns, value) {
167
+ for (const [name, pattern] of Object.entries(patterns)) if (testPattern(pattern, value)) return name;
168
+ return null;
169
+ }
170
+
171
+ //#endregion
172
+ Object.defineProperty(exports, 'BROWSER_PATTERNS', {
173
+ enumerable: true,
174
+ get: function () {
175
+ return BROWSER_PATTERNS;
176
+ }
177
+ });
178
+ Object.defineProperty(exports, 'HEADER_PATTERNS', {
179
+ enumerable: true,
180
+ get: function () {
181
+ return HEADER_PATTERNS;
182
+ }
183
+ });
184
+ Object.defineProperty(exports, 'MOBILE_PATTERNS', {
185
+ enumerable: true,
186
+ get: function () {
187
+ return MOBILE_PATTERNS;
188
+ }
189
+ });
190
+ Object.defineProperty(exports, 'OS_PATTERNS', {
191
+ enumerable: true,
192
+ get: function () {
193
+ return OS_PATTERNS;
194
+ }
195
+ });
196
+ Object.defineProperty(exports, 'SUSPICIOUS_PATTERNS', {
197
+ enumerable: true,
198
+ get: function () {
199
+ return SUSPICIOUS_PATTERNS;
200
+ }
201
+ });
202
+ Object.defineProperty(exports, 'USER_AGENT_PATTERNS', {
203
+ enumerable: true,
204
+ get: function () {
205
+ return USER_AGENT_PATTERNS;
206
+ }
207
+ });
208
+ Object.defineProperty(exports, 'UUID_PATTERN', {
209
+ enumerable: true,
210
+ get: function () {
211
+ return UUID_PATTERN;
212
+ }
213
+ });
214
+ Object.defineProperty(exports, 'VALIDATION_PATTERNS', {
215
+ enumerable: true,
216
+ get: function () {
217
+ return VALIDATION_PATTERNS;
218
+ }
219
+ });
220
+ Object.defineProperty(exports, 'extractMatch', {
221
+ enumerable: true,
222
+ get: function () {
223
+ return extractMatch;
224
+ }
225
+ });
226
+ Object.defineProperty(exports, 'findMatchingPattern', {
227
+ enumerable: true,
228
+ get: function () {
229
+ return findMatchingPattern;
230
+ }
231
+ });
232
+ Object.defineProperty(exports, 'testPattern', {
233
+ enumerable: true,
234
+ get: function () {
235
+ return testPattern;
236
+ }
237
+ });
238
+ Object.defineProperty(exports, 'testPatterns', {
239
+ enumerable: true,
240
+ get: function () {
241
+ return testPatterns;
242
+ }
243
+ });