@kya-os/checkpoint-shared 1.7.0 → 1.8.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 (224) hide show
  1. package/CHANGELOG.md +122 -9
  2. package/README.md +24 -7
  3. package/dist/beacon-nonce/index.d.mts +1 -0
  4. package/dist/beacon-nonce/index.d.mts.map +1 -1
  5. package/dist/beacon-nonce/index.d.ts +1 -0
  6. package/dist/beacon-nonce/index.d.ts.map +1 -1
  7. package/dist/beacon-nonce/index.js +9 -3
  8. package/dist/beacon-nonce/index.mjs +9 -4
  9. package/dist/beacon-nonce/index.mjs.map +1 -1
  10. package/dist/beacon-types/index.d.mts +23 -1
  11. package/dist/beacon-types/index.d.mts.map +1 -1
  12. package/dist/beacon-types/index.d.ts +23 -1
  13. package/dist/beacon-types/index.d.ts.map +1 -1
  14. package/dist/beacon-types/index.js +49 -4
  15. package/dist/beacon-types/index.mjs +47 -4
  16. package/dist/beacon-types/index.mjs.map +1 -1
  17. package/dist/{browser-posture-BLhw-MON.d.mts → browser-posture-5fPrsxx7.d.mts} +6 -6
  18. package/dist/{browser-posture-BLhw-MON.d.mts.map → browser-posture-5fPrsxx7.d.mts.map} +1 -1
  19. package/dist/{browser-posture-B8YiPa5c.d.ts → browser-posture-CCR1kh5e.d.ts} +6 -6
  20. package/dist/{browser-posture-B8YiPa5c.d.ts.map → browser-posture-CCR1kh5e.d.ts.map} +1 -1
  21. package/dist/browser-posture-proof.d.mts +16 -2
  22. package/dist/browser-posture-proof.d.mts.map +1 -1
  23. package/dist/browser-posture-proof.d.ts +16 -2
  24. package/dist/browser-posture-proof.d.ts.map +1 -1
  25. package/dist/browser-posture-proof.js +73 -17
  26. package/dist/browser-posture-proof.mjs +71 -17
  27. package/dist/browser-posture-proof.mjs.map +1 -1
  28. package/dist/browser-posture.d.mts +1 -1
  29. package/dist/browser-posture.d.ts +1 -1
  30. package/dist/browser-posture.js +6 -5
  31. package/dist/browser-posture.mjs +4 -3
  32. package/dist/browser-posture.mjs.map +1 -1
  33. package/dist/browser.d.mts +25 -4
  34. package/dist/browser.d.mts.map +1 -1
  35. package/dist/browser.d.ts +25 -4
  36. package/dist/browser.d.ts.map +1 -1
  37. package/dist/browser.js +1 -1
  38. package/dist/browser.mjs +1 -1
  39. package/dist/browser.mjs.map +1 -1
  40. package/dist/canonical-signer/index.js +30 -28
  41. package/dist/canonical-signer/index.mjs +31 -1
  42. package/dist/canonical-signer/index.mjs.map +1 -1
  43. package/dist/clearance.d.mts +1 -1
  44. package/dist/clearance.d.ts +1 -1
  45. package/dist/clearance.js +2 -2
  46. package/dist/clearance.mjs +2 -2
  47. package/dist/client-ip-B7w-uHfS.d.mts +55 -0
  48. package/dist/client-ip-B7w-uHfS.d.mts.map +1 -0
  49. package/dist/client-ip-B7w-uHfS.d.ts +55 -0
  50. package/dist/client-ip-B7w-uHfS.d.ts.map +1 -0
  51. package/dist/{client-ip-CW6pRyLf.js → client-ip-B8wFzJ5f.js} +117 -7
  52. package/dist/{client-ip-B2Xeo-GK.mjs → client-ip-DIJyr6px.mjs} +113 -9
  53. package/dist/client-ip-DIJyr6px.mjs.map +1 -0
  54. package/dist/client-ip.d.mts +2 -2
  55. package/dist/client-ip.d.ts +2 -2
  56. package/dist/client-ip.js +3 -2
  57. package/dist/client-ip.mjs +2 -2
  58. package/dist/detection-reason-mapping-B9RSkOs8.js +277 -0
  59. package/dist/detection-reason-mapping-BGymWIPl.mjs +249 -0
  60. package/dist/detection-reason-mapping-BGymWIPl.mjs.map +1 -0
  61. package/dist/detection-reason-mapping-CQexNvR7.d.mts +52 -0
  62. package/dist/detection-reason-mapping-CQexNvR7.d.mts.map +1 -0
  63. package/dist/detection-reason-mapping-CQexNvR7.d.ts +52 -0
  64. package/dist/detection-reason-mapping-CQexNvR7.d.ts.map +1 -0
  65. package/dist/engine-enforcing-AYEcgNsb.js +39 -0
  66. package/dist/engine-enforcing-B5eNfCpG.mjs +29 -0
  67. package/dist/engine-enforcing-B5eNfCpG.mjs.map +1 -0
  68. package/dist/engine-enforcing-DiOclGqf.d.mts +11 -0
  69. package/dist/engine-enforcing-DiOclGqf.d.mts.map +1 -0
  70. package/dist/engine-enforcing-DiOclGqf.d.ts +11 -0
  71. package/dist/engine-enforcing-DiOclGqf.d.ts.map +1 -0
  72. package/dist/engine-info.d.mts +2 -0
  73. package/dist/engine-info.d.ts +2 -0
  74. package/dist/engine-info.js +4 -0
  75. package/dist/engine-info.mjs +3 -0
  76. package/dist/errors/index.d.mts +5 -0
  77. package/dist/errors/index.d.mts.map +1 -1
  78. package/dist/errors/index.d.ts +5 -0
  79. package/dist/errors/index.d.ts.map +1 -1
  80. package/dist/errors/index.js +23 -4
  81. package/dist/errors/index.mjs +23 -4
  82. package/dist/errors/index.mjs.map +1 -1
  83. package/dist/{external-B7WI9FyQ.d.ts → external-m3Kmafwj.d.mts} +2 -2
  84. package/dist/{external-B7WI9FyQ.d.mts.map → external-m3Kmafwj.d.mts.map} +1 -1
  85. package/dist/{external-B7WI9FyQ.d.mts → external-m3Kmafwj.d.ts} +2 -2
  86. package/dist/{external-B7WI9FyQ.d.ts.map → external-m3Kmafwj.d.ts.map} +1 -1
  87. package/dist/fetcher-CivUCbhL.d.ts +44 -0
  88. package/dist/fetcher-CivUCbhL.d.ts.map +1 -0
  89. package/dist/fetcher-cXQsbm6s.d.mts +44 -0
  90. package/dist/fetcher-cXQsbm6s.d.mts.map +1 -0
  91. package/dist/gateway-client-ip.d.mts +1 -1
  92. package/dist/gateway-client-ip.d.ts +1 -1
  93. package/dist/gateway-client-ip.js +2 -2
  94. package/dist/gateway-client-ip.mjs +2 -2
  95. package/dist/host-adapter/index.d.mts +2 -2
  96. package/dist/host-adapter/index.d.ts +2 -2
  97. package/dist/host-adapter/index.js +2 -1
  98. package/dist/host-adapter/index.mjs +2 -2
  99. package/dist/{host-adapter-CwW9YB0U.js → host-adapter-0F8EpbD6.js} +59 -0
  100. package/dist/{host-adapter-C-4IxmqM.mjs → host-adapter-DHyISsIf.mjs} +55 -2
  101. package/dist/{host-adapter-C-4IxmqM.mjs.map → host-adapter-DHyISsIf.mjs.map} +1 -1
  102. package/dist/index-B3cHxr3O.d.mts +156 -0
  103. package/dist/index-B3cHxr3O.d.mts.map +1 -0
  104. package/dist/index-CXbOY7gB.d.ts +156 -0
  105. package/dist/index-CXbOY7gB.d.ts.map +1 -0
  106. package/dist/index.d.mts +8331 -12630
  107. package/dist/index.d.mts.map +1 -1
  108. package/dist/index.d.ts +8331 -12630
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +2515 -6663
  111. package/dist/index.mjs +2438 -6371
  112. package/dist/index.mjs.map +1 -1
  113. package/dist/kya-http.d.mts +2 -2
  114. package/dist/kya-http.d.ts +2 -2
  115. package/dist/kya-http.js +9 -1
  116. package/dist/kya-http.mjs +3 -2
  117. package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
  118. package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
  119. package/dist/mcpi/status-list/index.d.mts +72 -0
  120. package/dist/mcpi/status-list/index.d.mts.map +1 -0
  121. package/dist/mcpi/status-list/index.d.ts +72 -0
  122. package/dist/mcpi/status-list/index.d.ts.map +1 -0
  123. package/dist/mcpi/status-list/index.js +703 -0
  124. package/dist/mcpi/status-list/index.mjs +684 -0
  125. package/dist/mcpi/status-list/index.mjs.map +1 -0
  126. package/dist/patterns-B2r7M9wR.js +243 -0
  127. package/dist/patterns-B7dQoeE3.mjs +173 -0
  128. package/dist/patterns-B7dQoeE3.mjs.map +1 -0
  129. package/dist/patterns-Bp40cwh2.d.mts +110 -0
  130. package/dist/patterns-Bp40cwh2.d.mts.map +1 -0
  131. package/dist/patterns-Bp40cwh2.d.ts +110 -0
  132. package/dist/patterns-Bp40cwh2.d.ts.map +1 -0
  133. package/dist/patterns.d.mts +2 -0
  134. package/dist/patterns.d.ts +2 -0
  135. package/dist/patterns.js +15 -0
  136. package/dist/patterns.mjs +3 -0
  137. package/dist/policy/enforcement.d.mts +3 -2
  138. package/dist/policy/enforcement.d.ts +3 -2
  139. package/dist/policy/enforcement.js +8 -2
  140. package/dist/policy/enforcement.mjs +3 -2
  141. package/dist/policy/fetcher.d.mts +2 -0
  142. package/dist/policy/fetcher.d.ts +2 -0
  143. package/dist/policy/fetcher.js +240 -0
  144. package/dist/policy/fetcher.mjs +238 -0
  145. package/dist/policy/fetcher.mjs.map +1 -0
  146. package/dist/policy/schemas.d.mts +3 -0
  147. package/dist/policy/schemas.d.ts +3 -0
  148. package/dist/policy/schemas.js +27 -0
  149. package/dist/policy/schemas.mjs +4 -0
  150. package/dist/{posture-origins-Ba83O0cD.mjs → posture-origins-Ci6k4Zh1.js} +24 -173
  151. package/dist/{posture-origins-CdVOdiMT.js → posture-origins-DGyS4Vuk.mjs} +2 -267
  152. package/dist/posture-origins-DGyS4Vuk.mjs.map +1 -0
  153. package/dist/{project-verification-key-BccT12tQ.js → project-verification-key-B-L3D2nC.js} +1 -1
  154. package/dist/{project-verification-key-66N4edKn.mjs → project-verification-key-CWXdu3-n.mjs} +2 -2
  155. package/dist/{project-verification-key-66N4edKn.mjs.map → project-verification-key-CWXdu3-n.mjs.map} +1 -1
  156. package/dist/provider-registry.d.mts +2 -0
  157. package/dist/provider-registry.d.ts +2 -0
  158. package/dist/provider-registry.js +51 -0
  159. package/dist/provider-registry.mjs +3 -0
  160. package/dist/reason-codes.d.mts +2 -0
  161. package/dist/reason-codes.d.ts +2 -0
  162. package/dist/reason-codes.js +8 -0
  163. package/dist/reason-codes.mjs +3 -0
  164. package/dist/{registered-sid-hUl-bvM5.mjs → registered-sid-26hNxp6t.mjs} +11 -2
  165. package/dist/registered-sid-26hNxp6t.mjs.map +1 -0
  166. package/dist/registered-sid-D6KCaT1E.d.mts +33 -0
  167. package/dist/registered-sid-D6KCaT1E.d.mts.map +1 -0
  168. package/dist/registered-sid-D6KCaT1E.d.ts +33 -0
  169. package/dist/registered-sid-D6KCaT1E.d.ts.map +1 -0
  170. package/dist/{registered-sid-eLCNZvIF.js → registered-sid-DVGTSH0L.js} +15 -0
  171. package/dist/ruleset-hash-Cmv8MSO5.js +34 -0
  172. package/dist/ruleset-hash-IRN5eI9H.d.mts +5 -0
  173. package/dist/ruleset-hash-IRN5eI9H.d.mts.map +1 -0
  174. package/dist/ruleset-hash-IRN5eI9H.d.ts +5 -0
  175. package/dist/ruleset-hash-IRN5eI9H.d.ts.map +1 -0
  176. package/dist/ruleset-hash-QQIaLuPi.mjs +30 -0
  177. package/dist/ruleset-hash-QQIaLuPi.mjs.map +1 -0
  178. package/dist/{index-HaqfPtaL.d.ts → schemas-02CI7jgm.d.mts} +11 -183
  179. package/dist/schemas-02CI7jgm.d.mts.map +1 -0
  180. package/dist/{schemas-YhagYDx_.js → schemas-BlScS1it.js} +0 -20
  181. package/dist/{index-B7rTovHa.d.mts → schemas-C_3C72SR.d.ts} +11 -183
  182. package/dist/schemas-C_3C72SR.d.ts.map +1 -0
  183. package/dist/schemas-Cm4C4Z5G.js +703 -0
  184. package/dist/schemas-DPIT8usF.mjs +525 -0
  185. package/dist/schemas-DPIT8usF.mjs.map +1 -0
  186. package/dist/{schemas-7qodsG-Z.mjs → schemas-IHAhH3gV.mjs} +2 -16
  187. package/dist/schemas-IHAhH3gV.mjs.map +1 -0
  188. package/dist/{step-up-COlmWJN8.mjs → step-up-BK0oBi11.mjs} +91 -41
  189. package/dist/step-up-BK0oBi11.mjs.map +1 -0
  190. package/dist/{step-up-C2d8C20x.js → step-up-Bp8RAQwv.js} +117 -55
  191. package/dist/{step-up-BjP--hG-.d.mts → step-up-Bz12gYKT.d.mts} +28 -12
  192. package/dist/step-up-Bz12gYKT.d.mts.map +1 -0
  193. package/dist/{step-up-BjP--hG-.d.ts → step-up-Bz12gYKT.d.ts} +28 -12
  194. package/dist/step-up-Bz12gYKT.d.ts.map +1 -0
  195. package/dist/test-fixtures/index.d.mts +4 -4
  196. package/dist/test-fixtures/index.d.mts.map +1 -1
  197. package/dist/test-fixtures/index.d.ts +4 -4
  198. package/dist/test-fixtures/index.d.ts.map +1 -1
  199. package/dist/test-fixtures/index.js +4 -4
  200. package/dist/test-fixtures/index.mjs +4 -4
  201. package/dist/test-fixtures/index.mjs.map +1 -1
  202. package/dist/verification-BAw9N8Pt.js +181 -0
  203. package/dist/verification-Cvvv86TT.mjs +123 -0
  204. package/dist/verification-Cvvv86TT.mjs.map +1 -0
  205. package/fixtures/client-ip-resolution.n01.json +101 -0
  206. package/fixtures/reviewer-grant-revocation.v1.json +53 -81
  207. package/package.json +37 -2
  208. package/dist/client-ip-B2Xeo-GK.mjs.map +0 -1
  209. package/dist/client-ip-DFamiNoz.d.mts +0 -34
  210. package/dist/client-ip-DFamiNoz.d.mts.map +0 -1
  211. package/dist/client-ip-DFamiNoz.d.ts +0 -34
  212. package/dist/client-ip-DFamiNoz.d.ts.map +0 -1
  213. package/dist/index-B7rTovHa.d.mts.map +0 -1
  214. package/dist/index-HaqfPtaL.d.ts.map +0 -1
  215. package/dist/posture-origins-Ba83O0cD.mjs.map +0 -1
  216. package/dist/registered-sid-D3g-gZQF.d.mts +0 -11
  217. package/dist/registered-sid-D3g-gZQF.d.mts.map +0 -1
  218. package/dist/registered-sid-D3g-gZQF.d.ts +0 -11
  219. package/dist/registered-sid-D3g-gZQF.d.ts.map +0 -1
  220. package/dist/registered-sid-hUl-bvM5.mjs.map +0 -1
  221. package/dist/schemas-7qodsG-Z.mjs.map +0 -1
  222. package/dist/step-up-BjP--hG-.d.mts.map +0 -1
  223. package/dist/step-up-BjP--hG-.d.ts.map +0 -1
  224. package/dist/step-up-COlmWJN8.mjs.map +0 -1
@@ -1,30 +1,4 @@
1
- import { D as ZodOptional, E as ZodObject, L as output, P as ZodUnion, T as ZodNumber, V as $strip, g as ZodEnum, h as ZodDiscriminatedUnion, j as ZodString, k as ZodPrefault, l as ZodArray, m as ZodDefault, t as external_d_exports, u as ZodBoolean, w as ZodNullable, x as ZodLiteral } from "./external-B7WI9FyQ.mjs";
2
- import { t as KYA_HTTP_ERROR } from "./kya-http-error-codes-7ewV5RuK.mjs";
3
- //#region src/host-adapter/verdict-cookie.d.ts
4
- interface RenderedResponseLike {
5
- status: number | null;
6
- headers: Record<string, string>;
7
- }
8
- declare const VERDICT_COOKIE_NAME = "__checkpoint_verdict";
9
- type Verdict = 'allowed' | 'denied' | 'redirected';
10
- declare function deriveVerdict(rendered: RenderedResponseLike): Verdict;
11
- declare function encodeVerdictCookie(rendered: RenderedResponseLike): string;
12
- //#endregion
13
- //#region src/host-adapter/content-negotiation.d.ts
14
- declare function acceptsHtml(input: Headers | Record<string, string | string[] | undefined> | string | undefined): boolean;
15
- //#endregion
16
- //#region src/host-adapter/decision-mapping.d.ts
17
- declare const BLOCKED_PATH = "/blocked";
18
- type ResponseShape = 'pass-through' | 'redirect' | 'html-block' | 'json-block';
19
- declare function classifyResponseShape(rendered: RenderedResponseLike, clientAcceptsHtml: boolean): ResponseShape;
20
- //#endregion
21
- //#region src/host-adapter/fetcher-envelope.d.ts
22
- type FetcherHeaderInput = Headers | Record<string, string | string[] | undefined> | undefined;
23
- declare const ACCEPT_CHALLENGE_HEADER = "kya-accept-challenge";
24
- declare function serveBodyReadable200(headers: FetcherHeaderInput, detectionClass: unknown, isAgent: boolean): boolean;
25
- type ChallengeEnvelopeMode = 'spec-401' | 'negotiated' | 'always-200';
26
- declare function selectBodyReadable200(mode: ChallengeEnvelopeMode, headers: FetcherHeaderInput, detectionClass: unknown, isAgent: boolean): boolean;
27
- //#endregion
1
+ import { A as ZodString, B as $strip, C as ZodNullable, E as ZodOptional, I as output, N as ZodUnion, O as ZodPrefault, T as ZodObject, g as ZodEnum, h as ZodDiscriminatedUnion, l as ZodArray, m as ZodDefault, t as external_d_exports, u as ZodBoolean, w as ZodNumber, x as ZodLiteral } from "./external-m3Kmafwj.js";
28
2
  //#region src/policy/schemas.d.ts
29
3
  declare const EnforcementActionSchema: ZodEnum<{
30
4
  permit: "permit";
@@ -35,17 +9,11 @@ declare const EnforcementActionSchema: ZodEnum<{
35
9
  log: "log";
36
10
  instruct: "instruct";
37
11
  }>;
38
- declare const StrictEnforcementActionSchema: ZodEnum<{
39
- permit: "permit";
40
- block: "block";
41
- redirect: "redirect";
42
- challenge: "challenge";
43
- instruct: "instruct";
44
- }>;
45
12
  declare const EnforcementModeSchema: ZodEnum<{
46
13
  enforce: "enforce";
47
14
  observe: "observe";
48
15
  }>;
16
+ type EnforcementMode = output<typeof EnforcementModeSchema>;
49
17
  declare const BlockReasonSchema: ZodDiscriminatedUnion<[ZodObject<{
50
18
  kind: ZodLiteral<"Revoked">;
51
19
  }, $strip>, ZodObject<{
@@ -105,7 +73,6 @@ declare const ChallengeParamsSchema: ZodObject<{
105
73
  challengeType: ZodOptional<ZodString>;
106
74
  }, $strip>;
107
75
  type ChallengeParams = output<typeof ChallengeParamsSchema>;
108
- declare function normalizeChallengeType(challengeType: string | undefined): 'delegation' | 'browser_integrity' | 'human_step_up';
109
76
  declare const RedirectTargetSchema: ZodObject<{
110
77
  url: ZodString;
111
78
  reason: ZodString;
@@ -283,7 +250,6 @@ declare const AllowListEntrySchema: ZodObject<{
283
250
  addedBy: ZodOptional<ZodString>;
284
251
  }, $strip>;
285
252
  declare const ConditionOperatorSchema: ZodEnum<{
286
- in: "in";
287
253
  equals: "equals";
288
254
  notEquals: "notEquals";
289
255
  contains: "contains";
@@ -295,6 +261,7 @@ declare const ConditionOperatorSchema: ZodEnum<{
295
261
  greaterThanOrEquals: "greaterThanOrEquals";
296
262
  lessThanOrEquals: "lessThanOrEquals";
297
263
  matches: "matches";
264
+ in: "in";
298
265
  notIn: "notIn";
299
266
  }>;
300
267
  declare const ConditionFieldSchema: ZodEnum<{
@@ -334,7 +301,6 @@ declare const PolicyConditionSchema: ZodObject<{
334
301
  hasValidDelegation: "hasValidDelegation";
335
302
  }>;
336
303
  operator: ZodEnum<{
337
- in: "in";
338
304
  equals: "equals";
339
305
  notEquals: "notEquals";
340
306
  contains: "contains";
@@ -346,6 +312,7 @@ declare const PolicyConditionSchema: ZodObject<{
346
312
  greaterThanOrEquals: "greaterThanOrEquals";
347
313
  lessThanOrEquals: "lessThanOrEquals";
348
314
  matches: "matches";
315
+ in: "in";
349
316
  notIn: "notIn";
350
317
  }>;
351
318
  value: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
@@ -380,7 +347,6 @@ declare const PolicyRuleSchema: ZodObject<{
380
347
  hasValidDelegation: "hasValidDelegation";
381
348
  }>;
382
349
  operator: ZodEnum<{
383
- in: "in";
384
350
  equals: "equals";
385
351
  notEquals: "notEquals";
386
352
  contains: "contains";
@@ -392,6 +358,7 @@ declare const PolicyRuleSchema: ZodObject<{
392
358
  greaterThanOrEquals: "greaterThanOrEquals";
393
359
  lessThanOrEquals: "lessThanOrEquals";
394
360
  matches: "matches";
361
+ in: "in";
395
362
  notIn: "notIn";
396
363
  }>;
397
364
  value: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
@@ -501,7 +468,6 @@ declare const PolicyConfigSchema: ZodObject<{
501
468
  hasValidDelegation: "hasValidDelegation";
502
469
  }>;
503
470
  operator: ZodEnum<{
504
- in: "in";
505
471
  equals: "equals";
506
472
  notEquals: "notEquals";
507
473
  contains: "contains";
@@ -513,6 +479,7 @@ declare const PolicyConfigSchema: ZodObject<{
513
479
  greaterThanOrEquals: "greaterThanOrEquals";
514
480
  lessThanOrEquals: "lessThanOrEquals";
515
481
  matches: "matches";
482
+ in: "in";
516
483
  notIn: "notIn";
517
484
  }>;
518
485
  value: ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>;
@@ -550,158 +517,19 @@ declare const PolicyConfigSchema: ZodObject<{
550
517
  trustedDelegationRoots: ZodOptional<ZodArray<ZodString>>;
551
518
  authorizationServerIssuer: ZodOptional<ZodString>;
552
519
  }, $strip>;
553
- declare const PolicyEvaluationContextSchema: ZodObject<{
554
- agentType: ZodOptional<ZodString>;
555
- agentName: ZodOptional<ZodString>;
556
- agentVendor: ZodOptional<ZodString>;
557
- clientDid: ZodOptional<ZodString>;
558
- agentDid: ZodOptional<ZodString>;
559
- confidence: ZodOptional<ZodNumber>;
560
- reputationScore: ZodOptional<ZodNumber>;
561
- riskLevel: ZodOptional<ZodString>;
562
- path: ZodOptional<ZodString>;
563
- method: ZodOptional<ZodString>;
564
- origin: ZodOptional<ZodString>;
565
- userAgent: ZodOptional<ZodString>;
566
- signatureVerified: ZodDefault<ZodBoolean>;
567
- isAuthenticated: ZodDefault<ZodBoolean>;
568
- hasValidDelegation: ZodDefault<ZodBoolean>;
569
- }, $strip>;
570
- declare const PolicyMatchTypeSchema: ZodEnum<{
571
- default: "default";
572
- threshold: "threshold";
573
- "allow-list": "allow-list";
574
- "deny-list": "deny-list";
575
- rule: "rule";
576
- }>;
577
- declare const PolicyEvaluationResultSchema: ZodObject<{
578
- action: ZodEnum<{
579
- permit: "permit";
580
- allow: "allow";
581
- block: "block";
582
- redirect: "redirect";
583
- challenge: "challenge";
584
- log: "log";
585
- instruct: "instruct";
586
- }>;
587
- reason: ZodString;
588
- ruleId: ZodOptional<ZodString>;
589
- ruleName: ZodOptional<ZodString>;
590
- redirectUrl: ZodOptional<ZodString>;
591
- message: ZodOptional<ZodString>;
592
- matchType: ZodEnum<{
593
- default: "default";
594
- threshold: "threshold";
595
- "allow-list": "allow-list";
596
- "deny-list": "deny-list";
597
- rule: "rule";
598
- }>;
599
- }, $strip>;
520
+ type EnforcementAction = output<typeof EnforcementActionSchema>;
600
521
  type ThresholdConfig = output<typeof ThresholdConfigSchema>;
601
522
  type DenyListEntry = output<typeof DenyListEntrySchema>;
602
523
  type AllowListEntry = output<typeof AllowListEntrySchema>;
524
+ type ConditionOperator = output<typeof ConditionOperatorSchema>;
525
+ type ConditionField = output<typeof ConditionFieldSchema>;
603
526
  type ConditionValue = output<typeof ConditionValueSchema>;
604
527
  type PolicyCondition = output<typeof PolicyConditionSchema>;
605
528
  type RuleMetadata = output<typeof RuleMetadataSchema>;
606
529
  type PolicyRule = output<typeof PolicyRuleSchema>;
607
530
  type PolicyMetadata = output<typeof PolicyMetadataSchema>;
608
531
  type PolicyConfig = output<typeof PolicyConfigSchema>;
609
- type PolicyEvaluationContext = output<typeof PolicyEvaluationContextSchema>;
610
- type PolicyEvaluationResult = output<typeof PolicyEvaluationResultSchema>;
611
- declare function parsePolicyConfig(data: unknown): PolicyConfig;
612
532
  declare function safeParsePolicyConfig(data: unknown): PolicyConfig | null;
613
- declare function parseEvaluationContext(data: unknown): PolicyEvaluationContext;
614
- //#endregion
615
- //#region src/host-adapter/challenge-wire.d.ts
616
- type HeaderEntry = readonly [name: string, value: string];
617
- type ChallengeWireKind = 'delegation' | 'approval_quorum';
618
- interface ChallengeWireInputBase {
619
- realm: string;
620
- sid: string;
621
- consentUri: string;
622
- pickupUri: string;
623
- requiredScopes?: readonly string[];
624
- pollIntervalS?: number;
625
- challengeProof: unknown;
626
- minAssurance?: AssuranceTier;
627
- }
628
- interface DelegationChallengeWireInput extends ChallengeWireInputBase {
629
- kind?: 'delegation';
630
- resourceMetadataUri: string;
631
- }
632
- interface ApprovalQuorumChallengeWireInput extends ChallengeWireInputBase {
633
- kind: 'approval_quorum';
634
- quorum: number;
635
- actionNonce: string;
636
- }
637
- type ChallengeWireInput = DelegationChallengeWireInput | ApprovalQuorumChallengeWireInput;
638
- interface CommonChallengeKyaos {
639
- sid: string;
640
- consent_uri: string;
641
- pickup_uri: string;
642
- required_scopes?: string[];
643
- min_assurance?: AssuranceTier;
644
- poll_interval_s: number;
645
- challenge_proof: unknown;
646
- }
647
- interface DelegationChallengeKyaos extends CommonChallengeKyaos {
648
- action: {
649
- type: 'delegation';
650
- consent_uri: string;
651
- pickup_uri: string;
652
- poll_interval_s: number;
653
- pin: {
654
- header: 'X-KYA-Pickup-Token';
655
- };
656
- retry: {
657
- header: 'Authorization';
658
- scheme: 'Bearer';
659
- value_from: 'delegation';
660
- };
661
- };
662
- }
663
- interface ApprovalQuorumChallengeKyaos extends CommonChallengeKyaos {
664
- kind: 'approval_quorum';
665
- quorum: number;
666
- action_nonce: string;
667
- }
668
- interface DelegationChallengeBody {
669
- error: typeof KYA_HTTP_ERROR.AUTHORIZATION_REQUIRED;
670
- kyaos: DelegationChallengeKyaos | ApprovalQuorumChallengeKyaos;
671
- instructions: string;
672
- }
673
- interface DelegationChallengeEnvelope {
674
- status: 401 | 200;
675
- headers: HeaderEntry[];
676
- body: DelegationChallengeBody;
677
- }
678
- type DelegationChallengeEnvelopeMode = 'spec-401' | 'fetcher-200';
679
- type ChallengeWireErrorCode = 'invalid-realm' | 'invalid-sid' | 'invalid-uri' | 'invalid-scope' | 'invalid-assurance' | 'invalid-interval' | 'invalid-proof' | 'invalid-kind' | 'invalid-quorum' | 'invalid-action-nonce' | 'unsupported-envelope';
680
- declare class ChallengeWireError extends TypeError {
681
- readonly code: ChallengeWireErrorCode;
682
- constructor(code: ChallengeWireErrorCode, message: string);
683
- }
684
- declare function generateDelegationSid(): string;
685
- declare function deriveDelegationPickupUri(consentUri: string, sid: string): string;
686
- declare function buildDelegationChallengeHeader(input: ChallengeWireInput): string;
687
- declare function buildDelegationBearerHeader(realm: string): string;
688
- declare function buildDelegationInstructions(consentUri: string, pickupUri: string, pollIntervalS: number): string;
689
- declare function buildDelegationChallengeBody(input: ChallengeWireInput): DelegationChallengeBody;
690
- declare function buildDelegationChallengeEnvelope(input: ChallengeWireInput, mode?: DelegationChallengeEnvelopeMode): DelegationChallengeEnvelope;
691
- declare const buildChallengeWire: typeof buildDelegationChallengeEnvelope;
692
- //#endregion
693
- //#region src/host-adapter/challenge-context.d.ts
694
- declare const DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS = 3000;
695
- type ChallengeContextFailure = 'timeout' | 'resolver-error' | 'invalid-context';
696
- interface ChallengeContextFailureEvent {
697
- reason: ChallengeContextFailure;
698
- message: string;
699
- }
700
- interface ResolveChallengeContextOptions {
701
- timeoutMs?: number;
702
- onFailure?: (event: ChallengeContextFailureEvent) => void;
703
- }
704
- declare function resolveChallengeContext<TContext>(resolver: ((context: TContext) => ChallengeWireInput | undefined | Promise<ChallengeWireInput | undefined>) | undefined, context: TContext, options?: ResolveChallengeContextOptions): Promise<ChallengeWireInput | undefined>;
705
533
  //#endregion
706
- export { PolicyMetadata as $, ChallengeParams as A, EnforcementActionSchema as B, generateDelegationSid as C, classifyResponseShape as Ct, AssuranceTierSchema as D, Verdict as Dt, AssuranceTier as E, VERDICT_COOKIE_NAME as Et, ConditionValueSchema as F, PolicyConditionSchema as G, InstructPayload as H, Decision as I, PolicyEvaluationContext as J, PolicyConfig as K, DecisionSchema as L, ConditionFieldSchema as M, ConditionOperatorSchema as N, BlockReason as O, deriveVerdict as Ot, ConditionValue as P, PolicyMatchTypeSchema as Q, DenyListEntry as R, deriveDelegationPickupUri as S, ResponseShape as St, AllowListEntrySchema as T, RenderedResponseLike as Tt, InstructPayloadSchema as U, EnforcementModeSchema as V, PolicyCondition as W, PolicyEvaluationResult as X, PolicyEvaluationContextSchema as Y, PolicyEvaluationResultSchema as Z, buildDelegationBearerHeader as _, ChallengeEnvelopeMode as _t, resolveChallengeContext as a, RuleMetadata as at, buildDelegationChallengeHeader as b, serveBodyReadable200 as bt, ChallengeWireErrorCode as c, SuggestedAction as ct, DelegationChallengeBody as d, ThresholdConfigSchema as dt, PolicyMetadataSchema as et, DelegationChallengeEnvelope as f, normalizeChallengeType as ft, buildChallengeWire as g, ACCEPT_CHALLENGE_HEADER as gt, HeaderEntry as h, safeParsePolicyConfig as ht, ResolveChallengeContextOptions as i, RedirectTargetSchema as it, ChallengeParamsSchema as j, BlockReasonSchema as k, encodeVerdictCookie as kt, ChallengeWireInput as l, SuggestedActionSchema as lt, DelegationChallengeWireInput as m, parsePolicyConfig as mt, ChallengeContextFailureEvent as n, PolicyRuleSchema as nt, ApprovalQuorumChallengeWireInput as o, RuleMetadataSchema as ot, DelegationChallengeEnvelopeMode as p, parseEvaluationContext as pt, PolicyConfigSchema as q, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS as r, RedirectTarget as rt, ChallengeWireError as s, StrictEnforcementActionSchema as st, ChallengeContextFailure as t, PolicyRule as tt, ChallengeWireKind as u, ThresholdConfig as ut, buildDelegationChallengeBody as v, FetcherHeaderInput as vt, AllowListEntry as w, acceptsHtml as wt, buildDelegationInstructions as x, BLOCKED_PATH as xt, buildDelegationChallengeEnvelope as y, selectBodyReadable200 as yt, DenyListEntrySchema as z };
707
- //# sourceMappingURL=index-B7rTovHa.d.mts.map
534
+ export { PolicyMetadataSchema as A, ThresholdConfigSchema as B, InstructPayload as C, PolicyConfig as D, PolicyConditionSchema as E, RuleMetadata as F, RuleMetadataSchema as I, SuggestedAction as L, PolicyRuleSchema as M, RedirectTarget as N, PolicyConfigSchema as O, RedirectTargetSchema as P, SuggestedActionSchema as R, EnforcementModeSchema as S, PolicyCondition as T, safeParsePolicyConfig as V, DenyListEntry as _, BlockReason as a, EnforcementActionSchema as b, ChallengeParamsSchema as c, ConditionOperator as d, ConditionOperatorSchema as f, DecisionSchema as g, Decision as h, AssuranceTierSchema as i, PolicyRule as j, PolicyMetadata as k, ConditionField as l, ConditionValueSchema as m, AllowListEntrySchema as n, BlockReasonSchema as o, ConditionValue as p, AssuranceTier as r, ChallengeParams as s, AllowListEntry as t, ConditionFieldSchema as u, DenyListEntrySchema as v, InstructPayloadSchema as w, EnforcementMode as x, EnforcementAction as y, ThresholdConfig as z };
535
+ //# sourceMappingURL=schemas-C_3C72SR.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-C_3C72SR.d.ts","names":[],"sources":["../src/policy/schemas.ts"],"mappings":";;cAiCa,yBAAuB;;;;;;;;;cAgBvB,uBAAqB;;;;KAEtB,kBAAkB,cAAe;cAoBhC,mBAAiB,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C5B;KAEU,cAAc,cAAe;cAS5B,qBAAmB;;;;;;;KASpB,gBAAgB,cAAe;cAQ9B,uBAAqB;;;;;;;;;;;;;;GAsBhC;KAEU,kBAAkB,cAAe;cAIhC,sBAAoB;;;;;GAM/B;KAEU,iBAAiB,cAAe;cAE/B,uBAAqB,uBAAA;;;;;;;;;;;;;;GAShC;KAEU,kBAAkB,cAAe;cAEhC,uBAAqB;;;;;;;;;;;;;;;;;;;GAMhC;KAEU,kBAAkB,cAAe;cAUhC,gBAAc,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASzB;KAEU,WAAW,cAAe;cAMzB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;GAiBhC;cAMW,qBAAmB;;;;;;;;;;GAmB9B;cAEW,sBAAoB;;;;;;;;GAe/B;cAMW,yBAAuB;;;;;;;;;;;;;;;cAgBvB,sBAAoB;;;;;;;;;;;;;;;;;cAsBpB,sBAAoB,mBAAA,WAAA,WAAA,YAAA,SAAA;cAOpB,uBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAShC;cAMW,oBAAkB;;;;GAI7B;cAEW,kBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqB3B;cAMW,sBAAoB;;;;GAI/B;cAEW,oBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsF7B;KAMU,oBAAoB,cAAe;KACnC,kBAAkB,cAAe;KACjC,gBAAgB,cAAe;KAC/B,iBAAiB,cAAe;KAChC,oBAAoB,cAAe;KACnC,iBAAiB,cAAe;KAChC,iBAAiB,cAAe;KAChC,kBAAkB,cAAe;KACjC,eAAe,cAAe;KAC9B,aAAa,cAAe;KAC5B,iBAAiB,cAAe;KAChC,eAAe,cAAe;iBAW1B,sBAAsB,gBAAgB"}