@kya-os/checkpoint-shared 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/beacon-types/index.d.mts +448 -432
  3. package/dist/beacon-types/index.d.mts.map +1 -0
  4. package/dist/beacon-types/index.d.ts +448 -432
  5. package/dist/beacon-types/index.d.ts.map +1 -0
  6. package/dist/beacon-types/index.js +286 -182
  7. package/dist/beacon-types/index.mjs +284 -180
  8. package/dist/beacon-types/index.mjs.map +1 -0
  9. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +5 -0
  10. package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +1 -0
  11. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +5 -0
  12. package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +1 -0
  13. package/dist/browser-posture-cookie.d.mts +2 -0
  14. package/dist/browser-posture-cookie.d.ts +2 -0
  15. package/dist/browser-posture-cookie.js +1 -0
  16. package/dist/browser-posture-cookie.mjs +2 -0
  17. package/dist/browser-posture-cookie.mjs.map +1 -0
  18. package/dist/browser-posture-report.d.mts +48 -44
  19. package/dist/browser-posture-report.d.mts.map +1 -0
  20. package/dist/browser-posture-report.d.ts +48 -44
  21. package/dist/browser-posture-report.d.ts.map +1 -0
  22. package/dist/browser-posture-report.js +1 -1
  23. package/dist/browser-posture-report.mjs +2 -1
  24. package/dist/browser-posture-report.mjs.map +1 -0
  25. package/dist/browser-posture.d.mts +82 -75
  26. package/dist/browser-posture.d.mts.map +1 -0
  27. package/dist/browser-posture.d.ts +82 -75
  28. package/dist/browser-posture.d.ts.map +1 -0
  29. package/dist/browser-posture.js +167 -18993
  30. package/dist/browser-posture.mjs +166 -18990
  31. package/dist/browser-posture.mjs.map +1 -0
  32. package/dist/browser.d.mts +323 -316
  33. package/dist/browser.d.mts.map +1 -0
  34. package/dist/browser.d.ts +323 -316
  35. package/dist/browser.d.ts.map +1 -0
  36. package/dist/browser.js +1 -1
  37. package/dist/browser.mjs +2 -1
  38. package/dist/browser.mjs.map +1 -0
  39. package/dist/canonical-signer/index.d.mts +38 -33
  40. package/dist/canonical-signer/index.d.mts.map +1 -0
  41. package/dist/canonical-signer/index.d.ts +38 -33
  42. package/dist/canonical-signer/index.d.ts.map +1 -0
  43. package/dist/canonical-signer/index.js +411 -181
  44. package/dist/canonical-signer/index.mjs +383 -175
  45. package/dist/canonical-signer/index.mjs.map +1 -0
  46. package/dist/clearance.d.mts +30 -0
  47. package/dist/clearance.d.mts.map +1 -0
  48. package/dist/clearance.d.ts +30 -0
  49. package/dist/clearance.d.ts.map +1 -0
  50. package/dist/clearance.js +120 -0
  51. package/dist/clearance.mjs +112 -0
  52. package/dist/clearance.mjs.map +1 -0
  53. package/dist/client-ip-1y2iXAYW.js +237 -0
  54. package/dist/client-ip-HOfe6ucV.mjs +215 -0
  55. package/dist/client-ip-HOfe6ucV.mjs.map +1 -0
  56. package/dist/deploy/index.d.mts +339 -339
  57. package/dist/deploy/index.d.mts.map +1 -0
  58. package/dist/deploy/index.d.ts +339 -339
  59. package/dist/deploy/index.d.ts.map +1 -0
  60. package/dist/deploy/index.js +505 -413
  61. package/dist/deploy/index.mjs +504 -410
  62. package/dist/deploy/index.mjs.map +1 -0
  63. package/dist/errors/index.d.mts +101 -101
  64. package/dist/errors/index.d.mts.map +1 -0
  65. package/dist/errors/index.d.ts +101 -101
  66. package/dist/errors/index.d.ts.map +1 -0
  67. package/dist/errors/index.js +341 -314
  68. package/dist/errors/index.mjs +340 -311
  69. package/dist/errors/index.mjs.map +1 -0
  70. package/dist/external-jr_S4iSS.d.mts +4187 -0
  71. package/dist/external-jr_S4iSS.d.mts.map +1 -0
  72. package/dist/external-jr_S4iSS.d.ts +4187 -0
  73. package/dist/external-jr_S4iSS.d.ts.map +1 -0
  74. package/dist/gateway/index.d.mts +138 -132
  75. package/dist/gateway/index.d.mts.map +1 -0
  76. package/dist/gateway/index.d.ts +138 -132
  77. package/dist/gateway/index.d.ts.map +1 -0
  78. package/dist/gateway/index.js +117 -81
  79. package/dist/gateway/index.mjs +116 -78
  80. package/dist/gateway/index.mjs.map +1 -0
  81. package/dist/gateway-client-ip.d.mts +59 -0
  82. package/dist/gateway-client-ip.d.mts.map +1 -0
  83. package/dist/gateway-client-ip.d.ts +59 -0
  84. package/dist/gateway-client-ip.d.ts.map +1 -0
  85. package/dist/gateway-client-ip.js +149 -0
  86. package/dist/gateway-client-ip.mjs +139 -0
  87. package/dist/gateway-client-ip.mjs.map +1 -0
  88. package/dist/index.d.mts +14901 -14246
  89. package/dist/index.d.mts.map +1 -0
  90. package/dist/index.d.ts +14901 -14246
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +15180 -31025
  93. package/dist/index.mjs +15065 -30942
  94. package/dist/index.mjs.map +1 -0
  95. package/dist/mcpi/agentshield-api/index.d.mts +45 -44
  96. package/dist/mcpi/agentshield-api/index.d.mts.map +1 -0
  97. package/dist/mcpi/agentshield-api/index.d.ts +45 -44
  98. package/dist/mcpi/agentshield-api/index.d.ts.map +1 -0
  99. package/dist/mcpi/agentshield-api/index.js +0 -2
  100. package/dist/mcpi/agentshield-api/index.mjs +1 -1
  101. package/dist/mcpi/approval-grant/index.d.mts +63 -61
  102. package/dist/mcpi/approval-grant/index.d.mts.map +1 -0
  103. package/dist/mcpi/approval-grant/index.d.ts +63 -61
  104. package/dist/mcpi/approval-grant/index.d.ts.map +1 -0
  105. package/dist/mcpi/approval-grant/index.js +220 -140
  106. package/dist/mcpi/approval-grant/index.mjs +219 -137
  107. package/dist/mcpi/approval-grant/index.mjs.map +1 -0
  108. package/dist/mcpi/dashboard-config/index.d.mts +2323 -2318
  109. package/dist/mcpi/dashboard-config/index.d.mts.map +1 -0
  110. package/dist/mcpi/dashboard-config/index.d.ts +2323 -2318
  111. package/dist/mcpi/dashboard-config/index.d.ts.map +1 -0
  112. package/dist/mcpi/dashboard-config/index.js +605 -458
  113. package/dist/mcpi/dashboard-config/index.mjs +604 -455
  114. package/dist/mcpi/dashboard-config/index.mjs.map +1 -0
  115. package/dist/mcpi/multibase-ed25519.d.mts +10 -8
  116. package/dist/mcpi/multibase-ed25519.d.mts.map +1 -0
  117. package/dist/mcpi/multibase-ed25519.d.ts +10 -8
  118. package/dist/mcpi/multibase-ed25519.d.ts.map +1 -0
  119. package/dist/mcpi/multibase-ed25519.js +182 -106
  120. package/dist/mcpi/multibase-ed25519.mjs +181 -103
  121. package/dist/mcpi/multibase-ed25519.mjs.map +1 -0
  122. package/dist/patterns-CkRVOdtV.js +243 -0
  123. package/dist/patterns-DzkGy_qk.mjs +173 -0
  124. package/dist/patterns-DzkGy_qk.mjs.map +1 -0
  125. package/dist/project-verification-key-C3L5rd8a.js +41 -0
  126. package/dist/project-verification-key-CgSVX9_m.mjs +37 -0
  127. package/dist/project-verification-key-CgSVX9_m.mjs.map +1 -0
  128. package/dist/rolldown-runtime-iY2fYEqi.mjs +19 -0
  129. package/dist/schemas-BmjNLAE7.js +5677 -0
  130. package/dist/schemas-DxY-dk9y.mjs +5511 -0
  131. package/dist/schemas-DxY-dk9y.mjs.map +1 -0
  132. package/dist/signals/index.d.mts +125 -115
  133. package/dist/signals/index.d.mts.map +1 -0
  134. package/dist/signals/index.d.ts +125 -115
  135. package/dist/signals/index.d.ts.map +1 -0
  136. package/dist/signals/index.js +1693 -1536
  137. package/dist/signals/index.mjs +1692 -1533
  138. package/dist/signals/index.mjs.map +1 -0
  139. package/dist/test-fixtures/index.d.mts +124 -119
  140. package/dist/test-fixtures/index.d.mts.map +1 -0
  141. package/dist/test-fixtures/index.d.ts +124 -119
  142. package/dist/test-fixtures/index.d.ts.map +1 -0
  143. package/dist/test-fixtures/index.js +460 -228
  144. package/dist/test-fixtures/index.mjs +459 -225
  145. package/dist/test-fixtures/index.mjs.map +1 -0
  146. package/dist/tool-protection/index.d.mts +343 -343
  147. package/dist/tool-protection/index.d.mts.map +1 -0
  148. package/dist/tool-protection/index.d.ts +343 -343
  149. package/dist/tool-protection/index.d.ts.map +1 -0
  150. package/dist/tool-protection/index.js +366 -285
  151. package/dist/tool-protection/index.mjs +365 -282
  152. package/dist/tool-protection/index.mjs.map +1 -0
  153. package/fixtures/bot-signal-resolution.json +142 -0
  154. package/fixtures/browser-posture-claims.json +421 -0
  155. package/fixtures/browser-posture-headers.json +46 -0
  156. package/fixtures/detection/reason-codes.json +10 -1
  157. package/fixtures/kya-http/challenge.delegation.fetcher-200.json +9 -3
  158. package/fixtures/kya-http/challenge.delegation.full.json +9 -3
  159. package/fixtures/kya-http/challenge.delegation.minimal.json +9 -3
  160. package/fixtures/kya-http/error-codes.json +7 -2
  161. package/package.json +20 -6
@@ -1,78 +1,85 @@
1
- import { JWK } from 'jose';
2
- export { JWK } from 'jose';
3
- import { z } from 'zod';
4
-
5
- declare const BrowserPostureReportSchema: z.ZodObject<{
6
- projectId: z.ZodString;
7
- sessionId: z.ZodString;
8
- verdict: z.ZodEnum<{
9
- "agent-driven": "agent-driven";
10
- human: "human";
11
- insufficient: "insufficient";
12
- }>;
13
- score: z.ZodNullable<z.ZodNumber>;
14
- scorerVersion: z.ZodNumber;
15
- reasons: z.ZodArray<z.ZodString>;
16
- issuedAt: z.ZodNumber;
17
- expiresAt: z.ZodNumber;
18
- source: z.ZodLiteral<"verified-posture">;
19
- }, z.core.$strip>;
20
- declare function browserPostureReport(posture: BrowserPosture): {
21
- projectId: string;
22
- sessionId: string;
23
- verdict: "agent-driven" | "human" | "insufficient";
24
- score: number | null;
25
- scorerVersion: number;
26
- reasons: string[];
27
- issuedAt: number;
28
- expiresAt: number;
29
- source: "verified-posture";
1
+ import { C as ZodObject, O as ZodString, P as output, R as $strip, S as ZodNumber, b as ZodLiteral, g as ZodGUID, h as ZodEnum, l as ZodArray, p as ZodDefault, t as external_d_exports, u as ZodBoolean, x as ZodNullable } from "./external-jr_S4iSS.js";
2
+ import { JWK, JWK as JWK$1 } from "jose";
3
+ //#region src/browser-posture-cookie.d.ts
4
+ export declare function postureCookieName(projectId: string): string;
5
+ //#endregion
6
+ //#region src/beacon-types/index.d.ts
7
+ export declare const POSTURE_TTL_SECONDS = 120;
8
+ //#endregion
9
+ //#region src/browser-posture-report.d.ts
10
+ export declare const BrowserPostureReportSchema: ZodObject<{
11
+ projectId: ZodString;
12
+ sessionId: ZodGUID;
13
+ verdict: ZodEnum<{
14
+ "agent-driven": "agent-driven";
15
+ human: "human";
16
+ insufficient: "insufficient";
17
+ }>;
18
+ score: ZodNullable<ZodNumber>;
19
+ scorerVersion: ZodNumber;
20
+ reasons: ZodArray<ZodString>;
21
+ issuedAt: ZodNumber;
22
+ expiresAt: ZodNumber;
23
+ source: ZodLiteral<"verified-posture">;
24
+ }, $strip>;
25
+ export declare function browserPostureReport(posture: BrowserPosture): {
26
+ projectId: string;
27
+ sessionId: string;
28
+ verdict: "agent-driven" | "human" | "insufficient";
29
+ score: number | null;
30
+ scorerVersion: number;
31
+ reasons: string[];
32
+ issuedAt: number;
33
+ expiresAt: number;
34
+ source: "verified-posture";
30
35
  };
31
-
32
- declare const UNSIGNED_BROWSER_AGENT: {
33
- readonly agentType: "Browser agent (unsigned)";
34
- readonly detectionClass: "ai_agent";
35
- readonly verificationMethod: "behavioral";
36
+ //#endregion
37
+ //#region src/browser-posture.d.ts
38
+ export declare const UNSIGNED_BROWSER_AGENT: {
39
+ readonly agentType: "Browser agent (unsigned)";
40
+ readonly detectionClass: "ai_agent";
41
+ readonly verificationMethod: "behavioral";
36
42
  };
37
- declare const behavioralConfidence: (score: number | null) => number;
38
- declare const POSTURE_TTL_SECONDS = 120;
39
- declare const POSTURE_ISSUER = "checkpoint:browser-posture:v1";
40
- declare const POSTURE_TYPE = "checkpoint-posture+jwt";
41
- declare const BrowserPostureSchema: z.ZodObject<{
42
- v: z.ZodLiteral<1>;
43
- project_id: z.ZodString;
44
- origin: z.ZodString;
45
- session_id: z.ZodString;
46
- binding: z.ZodString;
47
- verdict: z.ZodEnum<{
48
- "agent-driven": "agent-driven";
49
- human: "human";
50
- insufficient: "insufficient";
51
- }>;
52
- score: z.ZodNullable<z.ZodNumber>;
53
- scorer_version: z.ZodNumber;
54
- reasons: z.ZodArray<z.ZodString>;
55
- iat: z.ZodNumber;
56
- exp: z.ZodNumber;
57
- }, z.core.$strip>;
58
- type BrowserPosture = z.infer<typeof BrowserPostureSchema>;
59
- interface BrowserPostureConfig {
60
- publicKey: JWK;
61
- keyId: string;
62
- origin: string;
63
- sessionCookieName?: string;
64
- protectedRoutes?: Array<{
65
- path: string;
66
- scopes: string[];
67
- }>;
43
+ export declare const behavioralConfidence: (score: number | null) => number;
44
+ export declare const POSTURE_ISSUER = "checkpoint:browser-posture:v1";
45
+ export declare const POSTURE_TYPE = "checkpoint-posture+jwt";
46
+ export declare const BrowserPostureSchema: ZodObject<{
47
+ v: ZodLiteral<1>;
48
+ project_id: ZodString;
49
+ origin: ZodString;
50
+ session_id: ZodGUID;
51
+ binding: ZodString;
52
+ verdict: ZodEnum<{
53
+ "agent-driven": "agent-driven";
54
+ human: "human";
55
+ insufficient: "insufficient";
56
+ }>;
57
+ score: ZodNullable<ZodNumber>;
58
+ scorer_version: ZodNumber;
59
+ reasons: ZodArray<ZodString>;
60
+ automation_disclosed: ZodDefault<ZodBoolean>;
61
+ automation_corroborated: ZodDefault<ZodBoolean>;
62
+ iat: ZodNumber;
63
+ exp: ZodNumber;
64
+ }, $strip>;
65
+ export type BrowserPosture = output<typeof BrowserPostureSchema>;
66
+ export interface BrowserPostureConfig {
67
+ publicKey: JWK$1;
68
+ keyId: string;
69
+ origin: string;
70
+ sessionCookieName?: string;
71
+ protectedRoutes?: Array<{
72
+ path: string;
73
+ scopes: string[];
74
+ }>;
68
75
  }
69
- declare function postureCookieName(projectId: string): string;
70
- declare function readPostureCookie(header: string | null | undefined, name: string): string | undefined;
71
- declare function postureSessionBinding(sessionId: string): Promise<string>;
72
- declare function signBrowserPosture(posture: BrowserPosture, privateKey: JWK, keyId: string): Promise<string>;
73
- declare function verifyBrowserPosture(token: string | undefined, config: BrowserPostureConfig, projectId: string, browserSessionId: string | undefined, now?: number): Promise<BrowserPosture | undefined>;
74
- declare function postureFromCookies(header: string | null | undefined, config: BrowserPostureConfig, projectId: string): Promise<BrowserPosture | undefined>;
75
- declare function postureRequiredScopes(config: BrowserPostureConfig, path: string): string[] | undefined;
76
- declare function validateBrowserPostureConfig(config: BrowserPostureConfig, projectId: string | undefined): void;
77
-
78
- export { type BrowserPosture, type BrowserPostureConfig, BrowserPostureReportSchema, BrowserPostureSchema, POSTURE_ISSUER, POSTURE_TTL_SECONDS, POSTURE_TYPE, UNSIGNED_BROWSER_AGENT, behavioralConfidence, browserPostureReport, postureCookieName, postureFromCookies, postureRequiredScopes, postureSessionBinding, readPostureCookie, signBrowserPosture, validateBrowserPostureConfig, verifyBrowserPosture };
76
+ export declare function readPostureCookie(header: string | null | undefined, name: string): string | undefined;
77
+ export declare function postureSessionBinding(sessionId: string): Promise<string>;
78
+ export declare function signBrowserPosture(posture: BrowserPosture, privateKey: JWK$1, keyId: string): Promise<string>;
79
+ export declare function verifyBrowserPosture(token: string | undefined, config: BrowserPostureConfig, projectId: string, browserSessionId: string | undefined, now?: number): Promise<BrowserPosture | undefined>;
80
+ export declare function postureFromCookies(header: string | null | undefined, config: BrowserPostureConfig, projectId: string): Promise<BrowserPosture | undefined>;
81
+ export declare function postureRequiredScopes(config: BrowserPostureConfig, path: string): string[] | undefined;
82
+ export declare function validateBrowserPostureConfig(config: BrowserPostureConfig, projectId: string | undefined): void;
83
+ //#endregion
84
+ export type { JWK };
85
+ //# sourceMappingURL=browser-posture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-posture.d.ts","names":[],"sources":["../src/browser-posture-cookie.ts","../src/beacon-types/index.ts","../src/browser-posture-report.ts","../src/browser-posture.ts"],"mappings":";;;wBAgBgB,kBAAkB;;;qBC+8CrB;;;qBC39CA,4BAA0B;;;;;;;;;;;;;;GAWrC;wBACc,qBAAqB,SAAS;;;;;;;;;;;;;qBCPjC;;;;;qBAKA,uBAAwB;qBAGxB;qBAGA;qBAEA,sBAAoB;;;;;;;;;;;;;;;;;;GAoB/B;YAGU,iBAAiB,cAAe;iBAC3B;EAEf,WAAW;EACX;EAEA;EACA;EAEA,kBAAkB;IAAQ;IAAc;;;wBAI1B,kBACd,mCACA;wBAcoB,sBAAsB,oBAAoB;wBAc1C,mBACpB,SAAS,gBACT,YAAY,OACZ,gBACC;wBAqBmB,qBACpB,2BACA,QAAQ,sBACR,mBACA,sCACA,eACC,QAAQ;wBAgDW,mBACpB,mCACA,QAAQ,sBACR,oBACC,QAAQ;wBAUK,sBACd,QAAQ,sBACR;wBAmBc,6BACd,QAAQ,sBACR"}