@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.
- package/CHANGELOG.md +159 -9
- package/README.md +24 -7
- package/dist/agent-catalog.d.mts +12 -0
- package/dist/agent-catalog.d.mts.map +1 -0
- package/dist/agent-catalog.d.ts +12 -0
- package/dist/agent-catalog.d.ts.map +1 -0
- package/dist/agent-catalog.js +105 -0
- package/dist/agent-catalog.mjs +105 -0
- package/dist/agent-catalog.mjs.map +1 -0
- package/dist/beacon-nonce/index.d.mts +1 -0
- package/dist/beacon-nonce/index.d.mts.map +1 -1
- package/dist/beacon-nonce/index.d.ts +1 -0
- package/dist/beacon-nonce/index.d.ts.map +1 -1
- package/dist/beacon-nonce/index.js +9 -3
- package/dist/beacon-nonce/index.mjs +9 -4
- package/dist/beacon-nonce/index.mjs.map +1 -1
- package/dist/beacon-types/index.d.mts +41 -1
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +41 -1
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +153 -4
- package/dist/beacon-types/index.mjs +139 -4
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/{browser-posture-BLhw-MON.d.mts → browser-posture-5fPrsxx7.d.mts} +6 -6
- package/dist/{browser-posture-BLhw-MON.d.mts.map → browser-posture-5fPrsxx7.d.mts.map} +1 -1
- package/dist/{browser-posture-B8YiPa5c.d.ts → browser-posture-CCR1kh5e.d.ts} +6 -6
- package/dist/{browser-posture-B8YiPa5c.d.ts.map → browser-posture-CCR1kh5e.d.ts.map} +1 -1
- package/dist/browser-posture-cookie.js +1 -1
- package/dist/browser-posture-cookie.mjs +1 -1
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof-verifier-DvsOmFrM.js +202 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs +180 -0
- package/dist/browser-posture-proof-verifier-I0HP2Ics.mjs.map +1 -0
- package/dist/browser-posture-proof-verifier.d.mts +25 -0
- package/dist/browser-posture-proof-verifier.d.mts.map +1 -0
- package/dist/browser-posture-proof-verifier.d.ts +25 -0
- package/dist/browser-posture-proof-verifier.d.ts.map +1 -0
- package/dist/browser-posture-proof-verifier.js +7 -0
- package/dist/browser-posture-proof-verifier.mjs +3 -0
- package/dist/browser-posture-proof.d.mts +4 -5
- package/dist/browser-posture-proof.d.mts.map +1 -1
- package/dist/browser-posture-proof.d.ts +4 -5
- package/dist/browser-posture-proof.d.ts.map +1 -1
- package/dist/browser-posture-proof.js +10 -79
- package/dist/browser-posture-proof.mjs +6 -77
- package/dist/browser-posture-proof.mjs.map +1 -1
- package/dist/browser-posture.d.mts +1 -1
- package/dist/browser-posture.d.ts +1 -1
- package/dist/browser-posture.js +6 -5
- package/dist/browser-posture.mjs +4 -3
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/browser.d.mts +25 -286
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +25 -286
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/canonical-signer/index.js +30 -28
- package/dist/canonical-signer/index.mjs +31 -1
- package/dist/canonical-signer/index.mjs.map +1 -1
- package/dist/clearance.d.mts +1 -1
- package/dist/clearance.d.ts +1 -1
- package/dist/clearance.js +2 -2
- package/dist/clearance.mjs +2 -2
- package/dist/client-ip-B7w-uHfS.d.mts +55 -0
- package/dist/client-ip-B7w-uHfS.d.mts.map +1 -0
- package/dist/client-ip-B7w-uHfS.d.ts +55 -0
- package/dist/client-ip-B7w-uHfS.d.ts.map +1 -0
- package/dist/{client-ip-CW6pRyLf.js → client-ip-B8wFzJ5f.js} +117 -7
- package/dist/{client-ip-B2Xeo-GK.mjs → client-ip-DIJyr6px.mjs} +113 -9
- package/dist/client-ip-DIJyr6px.mjs.map +1 -0
- package/dist/client-ip.d.mts +2 -2
- package/dist/client-ip.d.ts +2 -2
- package/dist/client-ip.js +3 -2
- package/dist/client-ip.mjs +2 -2
- package/dist/consent-handoff.d.mts +0 -3
- package/dist/consent-handoff.d.mts.map +1 -1
- package/dist/consent-handoff.d.ts +0 -3
- package/dist/consent-handoff.d.ts.map +1 -1
- package/dist/consent-handoff.mjs.map +1 -1
- package/dist/default-sign-in-host.d.mts +10 -0
- package/dist/default-sign-in-host.d.mts.map +1 -0
- package/dist/default-sign-in-host.d.ts +10 -0
- package/dist/default-sign-in-host.d.ts.map +1 -0
- package/dist/default-sign-in-host.js +72 -0
- package/dist/default-sign-in-host.mjs +66 -0
- package/dist/default-sign-in-host.mjs.map +1 -0
- package/dist/detection-reason-mapping-B9RSkOs8.js +277 -0
- package/dist/detection-reason-mapping-BGymWIPl.mjs +249 -0
- package/dist/detection-reason-mapping-BGymWIPl.mjs.map +1 -0
- package/dist/detection-reason-mapping-CQexNvR7.d.mts +52 -0
- package/dist/detection-reason-mapping-CQexNvR7.d.mts.map +1 -0
- package/dist/detection-reason-mapping-CQexNvR7.d.ts +52 -0
- package/dist/detection-reason-mapping-CQexNvR7.d.ts.map +1 -0
- package/dist/engine-enforcing-AYEcgNsb.js +39 -0
- package/dist/engine-enforcing-B5eNfCpG.mjs +29 -0
- package/dist/engine-enforcing-B5eNfCpG.mjs.map +1 -0
- package/dist/engine-enforcing-DiOclGqf.d.mts +11 -0
- package/dist/engine-enforcing-DiOclGqf.d.mts.map +1 -0
- package/dist/engine-enforcing-DiOclGqf.d.ts +11 -0
- package/dist/engine-enforcing-DiOclGqf.d.ts.map +1 -0
- package/dist/engine-info.d.mts +2 -0
- package/dist/engine-info.d.ts +2 -0
- package/dist/engine-info.js +4 -0
- package/dist/engine-info.mjs +3 -0
- package/dist/errors/index.d.mts +6 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +28 -6
- package/dist/errors/index.mjs +28 -6
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{external-B7WI9FyQ.d.ts → external-m3Kmafwj.d.mts} +2 -2
- package/dist/{external-B7WI9FyQ.d.mts.map → external-m3Kmafwj.d.mts.map} +1 -1
- package/dist/{external-B7WI9FyQ.d.mts → external-m3Kmafwj.d.ts} +2 -2
- package/dist/{external-B7WI9FyQ.d.ts.map → external-m3Kmafwj.d.ts.map} +1 -1
- package/dist/fetcher-C8qvwdnA.d.ts +44 -0
- package/dist/fetcher-C8qvwdnA.d.ts.map +1 -0
- package/dist/fetcher-D2vjr7jB.d.mts +44 -0
- package/dist/fetcher-D2vjr7jB.d.mts.map +1 -0
- package/dist/gateway-client-ip.d.mts +1 -3
- package/dist/gateway-client-ip.d.mts.map +1 -1
- package/dist/gateway-client-ip.d.ts +1 -3
- package/dist/gateway-client-ip.d.ts.map +1 -1
- package/dist/gateway-client-ip.js +2 -2
- package/dist/gateway-client-ip.mjs +2 -2
- package/dist/gateway-client-ip.mjs.map +1 -1
- package/dist/host-adapter/index.d.mts +2 -2
- package/dist/host-adapter/index.d.ts +2 -2
- package/dist/host-adapter/index.js +2 -1
- package/dist/host-adapter/index.mjs +2 -2
- package/dist/{host-adapter-C-4IxmqM.mjs → host-adapter-BKdQHwbi.mjs} +56 -3
- package/dist/{host-adapter-C-4IxmqM.mjs.map → host-adapter-BKdQHwbi.mjs.map} +1 -1
- package/dist/{host-adapter-CwW9YB0U.js → host-adapter-bWftXA9T.js} +60 -1
- package/dist/index-DnFsmr_o.d.ts +156 -0
- package/dist/index-DnFsmr_o.d.ts.map +1 -0
- package/dist/index-rvw5Bz-r.d.mts +156 -0
- package/dist/index-rvw5Bz-r.d.mts.map +1 -0
- package/dist/index.d.mts +6681 -11335
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +6681 -11335
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2322 -6900
- package/dist/index.mjs +2236 -6574
- package/dist/index.mjs.map +1 -1
- package/dist/{kya-http-error-codes-UYb1zpGM.js → kya-http-error-codes-B4rUmUEI.js} +2 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.ts → kya-http-error-codes-C14E4gi3.d.mts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.mts.map +1 -0
- package/dist/{kya-http-error-codes-7ewV5RuK.d.mts → kya-http-error-codes-C14E4gi3.d.ts} +2 -1
- package/dist/kya-http-error-codes-C14E4gi3.d.ts.map +1 -0
- package/dist/{kya-http-error-codes-C2JiWPsi.mjs → kya-http-error-codes-DSBrxNry.mjs} +3 -1
- package/dist/kya-http-error-codes-DSBrxNry.mjs.map +1 -0
- package/dist/kya-http.d.mts +3 -3
- package/dist/kya-http.d.ts +3 -3
- package/dist/kya-http.js +10 -2
- package/dist/kya-http.mjs +4 -3
- package/dist/mcpi/dashboard-config/index.d.mts.map +1 -1
- package/dist/mcpi/dashboard-config/index.d.ts.map +1 -1
- package/dist/mcpi/dashboard-config/index.mjs.map +1 -1
- package/dist/mcpi/status-list/index.d.mts +72 -0
- package/dist/mcpi/status-list/index.d.mts.map +1 -0
- package/dist/mcpi/status-list/index.d.ts +72 -0
- package/dist/mcpi/status-list/index.d.ts.map +1 -0
- package/dist/mcpi/status-list/index.js +703 -0
- package/dist/mcpi/status-list/index.mjs +684 -0
- package/dist/mcpi/status-list/index.mjs.map +1 -0
- package/dist/patterns-Bp40cwh2.d.mts +110 -0
- package/dist/patterns-Bp40cwh2.d.mts.map +1 -0
- package/dist/patterns-Bp40cwh2.d.ts +110 -0
- package/dist/patterns-Bp40cwh2.d.ts.map +1 -0
- package/dist/patterns-CiMpbdAF.js +243 -0
- package/dist/patterns-D4OAsNQY.mjs +173 -0
- package/dist/patterns-D4OAsNQY.mjs.map +1 -0
- package/dist/patterns.d.mts +2 -0
- package/dist/patterns.d.ts +2 -0
- package/dist/patterns.js +15 -0
- package/dist/patterns.mjs +3 -0
- package/dist/policy/enforcement.d.mts +3 -2
- package/dist/policy/enforcement.d.ts +3 -2
- package/dist/policy/enforcement.js +8 -2
- package/dist/policy/enforcement.mjs +3 -2
- package/dist/policy/fetcher.d.mts +2 -0
- package/dist/policy/fetcher.d.ts +2 -0
- package/dist/policy/fetcher.js +240 -0
- package/dist/policy/fetcher.mjs +238 -0
- package/dist/policy/fetcher.mjs.map +1 -0
- package/dist/policy/schemas.d.mts +3 -0
- package/dist/policy/schemas.d.ts +3 -0
- package/dist/policy/schemas.js +27 -0
- package/dist/policy/schemas.mjs +4 -0
- package/dist/{posture-origins-Ba83O0cD.mjs → posture-origins-Ci6k4Zh1.js} +24 -173
- package/dist/{posture-origins-CdVOdiMT.js → posture-origins-DGyS4Vuk.mjs} +2 -267
- package/dist/posture-origins-DGyS4Vuk.mjs.map +1 -0
- package/dist/{project-verification-key-BccT12tQ.js → project-verification-key-B-L3D2nC.js} +1 -1
- package/dist/{project-verification-key-66N4edKn.mjs → project-verification-key-CWXdu3-n.mjs} +2 -2
- package/dist/{project-verification-key-66N4edKn.mjs.map → project-verification-key-CWXdu3-n.mjs.map} +1 -1
- package/dist/provider-registry.d.mts +2 -0
- package/dist/provider-registry.d.ts +2 -0
- package/dist/provider-registry.js +51 -0
- package/dist/provider-registry.mjs +3 -0
- package/dist/reason-codes.d.mts +2 -0
- package/dist/reason-codes.d.ts +2 -0
- package/dist/reason-codes.js +8 -0
- package/dist/reason-codes.mjs +3 -0
- package/dist/{registered-sid-hUl-bvM5.mjs → registered-sid-26hNxp6t.mjs} +11 -2
- package/dist/registered-sid-26hNxp6t.mjs.map +1 -0
- package/dist/registered-sid-D6KCaT1E.d.mts +33 -0
- package/dist/registered-sid-D6KCaT1E.d.mts.map +1 -0
- package/dist/registered-sid-D6KCaT1E.d.ts +33 -0
- package/dist/registered-sid-D6KCaT1E.d.ts.map +1 -0
- package/dist/{registered-sid-eLCNZvIF.js → registered-sid-DVGTSH0L.js} +15 -0
- package/dist/ruleset-hash-Cmv8MSO5.js +34 -0
- package/dist/ruleset-hash-IRN5eI9H.d.mts +5 -0
- package/dist/ruleset-hash-IRN5eI9H.d.mts.map +1 -0
- package/dist/ruleset-hash-IRN5eI9H.d.ts +5 -0
- package/dist/ruleset-hash-IRN5eI9H.d.ts.map +1 -0
- package/dist/ruleset-hash-QQIaLuPi.mjs +30 -0
- package/dist/ruleset-hash-QQIaLuPi.mjs.map +1 -0
- package/dist/{schemas-YhagYDx_.js → schemas-BlScS1it.js} +0 -20
- package/dist/{index-HaqfPtaL.d.ts → schemas-CGKHzcMV.d.ts} +23 -195
- package/dist/schemas-CGKHzcMV.d.ts.map +1 -0
- package/dist/schemas-Cm4C4Z5G.js +703 -0
- package/dist/schemas-DPIT8usF.mjs +525 -0
- package/dist/schemas-DPIT8usF.mjs.map +1 -0
- package/dist/{schemas-7qodsG-Z.mjs → schemas-IHAhH3gV.mjs} +2 -16
- package/dist/schemas-IHAhH3gV.mjs.map +1 -0
- package/dist/{index-B7rTovHa.d.mts → schemas-m-GqyfyO.d.mts} +23 -195
- package/dist/schemas-m-GqyfyO.d.mts.map +1 -0
- package/dist/{step-up-COlmWJN8.mjs → step-up-BK0oBi11.mjs} +91 -41
- package/dist/step-up-BK0oBi11.mjs.map +1 -0
- package/dist/{step-up-C2d8C20x.js → step-up-Bp8RAQwv.js} +117 -55
- package/dist/{step-up-BjP--hG-.d.mts → step-up-Bz12gYKT.d.mts} +28 -12
- package/dist/step-up-Bz12gYKT.d.mts.map +1 -0
- package/dist/{step-up-BjP--hG-.d.ts → step-up-Bz12gYKT.d.ts} +28 -12
- package/dist/step-up-Bz12gYKT.d.ts.map +1 -0
- package/dist/test-fixtures/index.d.mts +4 -4
- package/dist/test-fixtures/index.d.mts.map +1 -1
- package/dist/test-fixtures/index.d.ts +4 -4
- package/dist/test-fixtures/index.d.ts.map +1 -1
- package/dist/test-fixtures/index.js +4 -4
- package/dist/test-fixtures/index.mjs +4 -4
- package/dist/test-fixtures/index.mjs.map +1 -1
- package/dist/tool-protection/index.d.mts +12 -0
- package/dist/tool-protection/index.d.mts.map +1 -1
- package/dist/tool-protection/index.d.ts +12 -0
- package/dist/tool-protection/index.d.ts.map +1 -1
- package/dist/tool-protection/index.js +46 -0
- package/dist/tool-protection/index.mjs +44 -1
- package/dist/tool-protection/index.mjs.map +1 -1
- package/dist/verification-BAw9N8Pt.js +181 -0
- package/dist/verification-Cvvv86TT.mjs +123 -0
- package/dist/verification-Cvvv86TT.mjs.map +1 -0
- package/fixtures/client-ip-resolution.n01.json +101 -0
- package/fixtures/kya-http/error-codes.json +2 -1
- package/fixtures/reviewer-grant-revocation.v1.json +53 -81
- package/package.json +55 -4
- package/dist/client-ip-B2Xeo-GK.mjs.map +0 -1
- package/dist/client-ip-DFamiNoz.d.mts +0 -34
- package/dist/client-ip-DFamiNoz.d.mts.map +0 -1
- package/dist/client-ip-DFamiNoz.d.ts +0 -34
- package/dist/client-ip-DFamiNoz.d.ts.map +0 -1
- package/dist/index-B7rTovHa.d.mts.map +0 -1
- package/dist/index-HaqfPtaL.d.ts.map +0 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +0 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +0 -1
- package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +0 -1
- package/dist/posture-origins-Ba83O0cD.mjs.map +0 -1
- package/dist/registered-sid-D3g-gZQF.d.mts +0 -11
- package/dist/registered-sid-D3g-gZQF.d.mts.map +0 -1
- package/dist/registered-sid-D3g-gZQF.d.ts +0 -11
- package/dist/registered-sid-D3g-gZQF.d.ts.map +0 -1
- package/dist/registered-sid-hUl-bvM5.mjs.map +0 -1
- package/dist/schemas-7qodsG-Z.mjs.map +0 -1
- package/dist/step-up-BjP--hG-.d.mts.map +0 -1
- package/dist/step-up-BjP--hG-.d.ts.map +0 -1
- package/dist/step-up-COlmWJN8.mjs.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region src/utils/client-ip.d.ts
|
|
2
|
-
type ClientIpSource = 'explicit' | 'cf-connecting-ip' | 'x-vercel-forwarded-for' | 'x-forwarded-for' | 'x-real-ip' | 'framework' | 'socket' | 'none';
|
|
3
|
-
interface ClientIpResolution {
|
|
4
|
-
ip: string | null;
|
|
5
|
-
source: ClientIpSource;
|
|
6
|
-
trusted: boolean;
|
|
7
|
-
}
|
|
8
|
-
type ClientIpTrustPolicy = {
|
|
9
|
-
platform: 'vercel';
|
|
10
|
-
} | {
|
|
11
|
-
platform: 'cloudflare';
|
|
12
|
-
} | {
|
|
13
|
-
platform: 'trusted-proxy';
|
|
14
|
-
trustedHops: number;
|
|
15
|
-
} | {
|
|
16
|
-
platform: 'direct';
|
|
17
|
-
};
|
|
18
|
-
type ClientIpHeaderValue = string | readonly string[] | undefined;
|
|
19
|
-
type ClientIpHeaders = Headers | Record<string, ClientIpHeaderValue>;
|
|
20
|
-
interface ResolveClientIpInput {
|
|
21
|
-
headers: ClientIpHeaders;
|
|
22
|
-
directAddress?: string | null;
|
|
23
|
-
frameworkAddress?: string | null;
|
|
24
|
-
explicitAddress?: string | null;
|
|
25
|
-
explicitAddressTrusted?: boolean;
|
|
26
|
-
policy: ClientIpTrustPolicy;
|
|
27
|
-
}
|
|
28
|
-
declare function parseIpv6(value: string): number[] | null;
|
|
29
|
-
declare function compressIpv6(groups: number[]): string;
|
|
30
|
-
declare function normalizeClientIp(raw: string | null | undefined): string | null;
|
|
31
|
-
declare function resolveClientIp(input: ResolveClientIpInput): ClientIpResolution;
|
|
32
|
-
//#endregion
|
|
33
|
-
export { ClientIpTrustPolicy as a, normalizeClientIp as c, ClientIpSource as i, parseIpv6 as l, ClientIpHeaders as n, ResolveClientIpInput as o, ClientIpResolution as r, compressIpv6 as s, ClientIpHeaderValue as t, resolveClientIp as u };
|
|
34
|
-
//# sourceMappingURL=client-ip-DFamiNoz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-ip-DFamiNoz.d.ts","names":[],"sources":["../src/utils/client-ip.ts"],"mappings":";KAQY;UAUK;EACf;EACA,QAAQ;EACR;;KAGU;EACN;;EACA;;EACA;EAA2B;;EAC3B;;KAEM;KACA,kBAAkB,UAAU,eAAe;UAEtC;EACf,SAAS;EACT;EACA;EACA;EAEA;EACA,QAAQ;;iBAuCM,UAAU;iBA2CV,aAAa;iBA8Db,kBAAkB;iBAyHlB,gBAAgB,OAAO,uBAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-B7rTovHa.d.mts","names":[],"sources":["../src/host-adapter/verdict-cookie.ts","../src/host-adapter/content-negotiation.ts","../src/host-adapter/decision-mapping.ts","../src/host-adapter/fetcher-envelope.ts","../src/policy/schemas.ts","../src/host-adapter/challenge-wire.ts","../src/host-adapter/challenge-context.ts"],"mappings":";;;UA4BiB;EAEf;EAEA,SAAS;;cAOE;KAWD;iBAKI,cAAc,UAAU,uBAAuB;iBAiB/C,oBAAoB,UAAU;;;iBC7C9B,YACd,OAAO,UAAU;;;cCNN;KAOD;iBAeI,sBACd,UAAU,sBACV,6BACC;;;KCfS,qBACR,UACA;cASS;iBAiDG,qBACd,SAAS,oBACT,yBACA;KA2BU;iBAQI,sBACd,MAAM,uBACN,SAAS,oBACT,yBACA;;;cC7FW,yBAAuB;;;;;;;;;cAkBvB,+BAA6B;;;;;;;cAY7B,uBAAqB;;;;cAsBrB,mBAAiB,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C5B;KAEU,cAAc,cAAe;cAS5B,qBAAmB;;;;;;;KASpB,gBAAgB,cAAe;cAQ9B,uBAAqB;;;;;;;;;;;;;;GAsBhC;KAEU,kBAAkB,cAAe;iBAQ7B,uBACd;cAOW,sBAAoB;;;;;GAM/B;KAEU,iBAAiB,cAAe;cAE/B,uBAAqB,uBAAA;;;;;;;;;;;;;;GAShC;KAEU,kBAAkB,cAAe;cAEhC,uBAAqB;;;;;;;;;;;;;;;;;;;GAMhC;KAEU,kBAAkB,cAAe;cAUhC,gBAAc,uBAAA;;;;;;;;;;;;;;;;;;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C;EACpD;EAEA;;UAIe,yCAAyC;EACxD;EACA;EACA;;KAGU,qBAAqB,+BAA+B;UAEtD;EACR;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;;UAGQ,iCAAiC;EACzC;IACE;IACA;IACA;IACA;IACA;MAAO;;IACP;MAAS;MAAyB;MAAkB;;;;UAI9C,qCAAqC;EAC7C;EACA;EACA;;UAIe;EACf,cAAc,eAAe;EAC7B,OAAO,2BAA2B;EAClC;;UAGe;EACf;EACA,SAAS;EACT,MAAM;;KAGI;KAEA;cAcC,2BAA2B;WAC7B,MAAM;EAEH,YAAA,MAAM,wBAAwB;;iBAQ5B;iBASA,0BAA0B,oBAAoB;iBAO9C,+BAA+B,OAAO;iBAuBtC,4BAA4B;iBAM5B,4BACd,oBACA,mBACA;iBAYc,6BAA6B,OAAO,qBAAqB;iBAuDzD,iCACd,OAAO,oBACP,OAAM,kCACL;cAgDU,2BAAkB;;;cCxSlB;KAED;UAEK;EACf,QAAQ;EACR;;UAGe;EACf;EACA,aAAa,OAAO;;iBASA,wBAAwB,UAC5C,YAEM,SAAS,aACN,iCAAiC,QAAQ,8CAElD,SAAS,UACT,UAAS,iCACR,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-HaqfPtaL.d.ts","names":[],"sources":["../src/host-adapter/verdict-cookie.ts","../src/host-adapter/content-negotiation.ts","../src/host-adapter/decision-mapping.ts","../src/host-adapter/fetcher-envelope.ts","../src/policy/schemas.ts","../src/host-adapter/challenge-wire.ts","../src/host-adapter/challenge-context.ts"],"mappings":";;;UA4BiB;EAEf;EAEA,SAAS;;cAOE;KAWD;iBAKI,cAAc,UAAU,uBAAuB;iBAiB/C,oBAAoB,UAAU;;;iBC7C9B,YACd,OAAO,UAAU;;;cCNN;KAOD;iBAeI,sBACd,UAAU,sBACV,6BACC;;;KCfS,qBACR,UACA;cASS;iBAiDG,qBACd,SAAS,oBACT,yBACA;KA2BU;iBAQI,sBACd,MAAM,u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,UACT,UAAS,iCACR,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kya-http-error-codes-7ewV5RuK.d.mts","names":[],"sources":["../src/mcpi/kya-http-error-codes.ts"],"mappings":";cAiBa;;;;;;;;;;;;;;;;;;;;;;;KA0CD,2BAA2B,6BAA6B;cAOvD,uBAAuB,SAAS,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kya-http-error-codes-7ewV5RuK.d.ts","names":[],"sources":["../src/mcpi/kya-http-error-codes.ts"],"mappings":";cAiBa;;;;;;;;;;;;;;;;;;;;;;;KA0CD,2BAA2B,6BAA6B;cAOvD,uBAAuB,SAAS,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kya-http-error-codes-C2JiWPsi.mjs","names":[],"sources":["../src/mcpi/kya-http-error-codes.ts"],"sourcesContent":["/**\n * KYA-HTTP error code registry — draft-kya-http-02 §9 / H1.2 (#3245).\n *\n * The `kyaos/*` strings are wire constants returned in the `error` field of a\n * KYA-HTTP failure response (and mapped to an HTTP status). Emitters MUST use\n * these EXACT bytes; consumers MAY additionally accept the legacy `kya/*`\n * spellings for one transition cycle.\n *\n * The single source of truth is the golden fixture\n * `packages/checkpoint-shared/fixtures/kya-http/error-codes.json`; the parity\n * test in `__tests__/kya-http-error-codes.test.ts` reads that JSON via `fs` and\n * asserts this map is byte-exact against it (no drift, no omissions).\n *\n * `as const satisfies Record<string, \\`kyaos/${string}\\`>` keeps the narrow\n * literal value types (so consumers get autocomplete and a compile error on a\n * typo'd code) while still proving every value is a well-formed `kyaos/…` string.\n */\nexport const KYA_HTTP_ERROR = {\n // ── 401 (identity / signature) ──────────────────────────────────────────\n MISSING_SIGNATURE: 'kyaos/missing-signature',\n INVALID_SIGNATURE: 'kyaos/invalid-signature',\n EXPIRED: 'kyaos/expired',\n REPLAY: 'kyaos/replay',\n DID_UNRESOLVABLE: 'kyaos/did-unresolvable',\n AUTHORIZATION_REQUIRED: 'kyaos/authorization-required',\n\n // ── 403 (delegation / profile) ──────────────────────────────────────────\n PROFILE_VIOLATION: 'kyaos/profile-violation',\n DELEGATION_REVOKED: 'kyaos/delegation-revoked',\n SCOPE_INSUFFICIENT: 'kyaos/scope-insufficient',\n CHAIN_BROKEN: 'kyaos/chain-broken',\n HOLDER_MISMATCH: 'kyaos/holder-mismatch',\n AUDIENCE_MISMATCH: 'kyaos/audience-mismatch',\n SESSION_MISMATCH: 'kyaos/session-mismatch',\n PICKUP_PINNED: 'kyaos/pickup-pinned',\n // Credential verified but its achieved assurance tier is below the\n // determining policy's opt-in `@min_assurance` floor (trust-gap G3) — a\n // bearer credential (attested-bearer, no proof-of-possession) cannot satisfy\n // a key-bound+ floor. Recovery: a key-bound signed request, not a new\n // credential.\n ASSURANCE_INSUFFICIENT: 'kyaos/assurance-insufficient',\n\n // ── 503 (revocation status unverifiable — RETRYABLE) ─────────────────────\n // Emitted when a credential DECLARES a `credentialStatus` but its status list\n // was not supplied / could not be fetched (cold cache, past the 300s status\n // cap). Fail-closed but retryable: a warmed list may yet verify (#3345 / #3446).\n STATUS_PENDING: 'kyaos/status-pending',\n AUTHORIZATION_HOST_UNAVAILABLE: 'kyaos/authorization-host-unavailable',\n REPLAY_STATE_UNAVAILABLE: 'kyaos/replay-state-unavailable',\n\n // Live replay entries are retained when admission capacity is exhausted.\n REPLAY_CAPACITY: 'kyaos/replay-capacity',\n\n // ── pickup flow (404 / 410) ─────────────────────────────────────────────\n INVALID_SESSION: 'kyaos/invalid-session',\n PICKUP_EXPIRED: 'kyaos/pickup-expired',\n} as const satisfies Record<string, `kyaos/${string}`>;\n\n/** A `kyaos/*` registry code (the value side of {@link KYA_HTTP_ERROR}). */\nexport type KyaHttpErrorCode = (typeof KYA_HTTP_ERROR)[keyof typeof KYA_HTTP_ERROR];\n\n/**\n * The HTTP status the registry assigns each code (draft-kya-http-02 §9).\n * Mirrors `error-codes.json` exactly, pinned by `__tests__/kya-http-error-codes.test.ts`,\n * and matches the engine's own table (`rust/crates/kya-os-engine/src/render/kya_error.rs`).\n */\nexport const KYA_HTTP_ERROR_STATUS: Readonly<Record<KyaHttpErrorCode, number>> = {\n [KYA_HTTP_ERROR.MISSING_SIGNATURE]: 401,\n [KYA_HTTP_ERROR.INVALID_SIGNATURE]: 401,\n [KYA_HTTP_ERROR.EXPIRED]: 401,\n [KYA_HTTP_ERROR.REPLAY]: 401,\n [KYA_HTTP_ERROR.DID_UNRESOLVABLE]: 401,\n [KYA_HTTP_ERROR.AUTHORIZATION_REQUIRED]: 401,\n [KYA_HTTP_ERROR.PROFILE_VIOLATION]: 403,\n [KYA_HTTP_ERROR.DELEGATION_REVOKED]: 403,\n [KYA_HTTP_ERROR.SCOPE_INSUFFICIENT]: 403,\n [KYA_HTTP_ERROR.CHAIN_BROKEN]: 403,\n [KYA_HTTP_ERROR.HOLDER_MISMATCH]: 403,\n [KYA_HTTP_ERROR.AUDIENCE_MISMATCH]: 403,\n [KYA_HTTP_ERROR.SESSION_MISMATCH]: 403,\n [KYA_HTTP_ERROR.PICKUP_PINNED]: 403,\n [KYA_HTTP_ERROR.ASSURANCE_INSUFFICIENT]: 403,\n [KYA_HTTP_ERROR.STATUS_PENDING]: 503,\n [KYA_HTTP_ERROR.AUTHORIZATION_HOST_UNAVAILABLE]: 503,\n [KYA_HTTP_ERROR.REPLAY_STATE_UNAVAILABLE]: 503,\n [KYA_HTTP_ERROR.REPLAY_CAPACITY]: 429,\n [KYA_HTTP_ERROR.INVALID_SESSION]: 404,\n [KYA_HTTP_ERROR.PICKUP_EXPIRED]: 410,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAa,iBAAiB;CAE5B,mBAAmB;CACnB,mBAAmB;CACnB,SAAS;CACT,QAAQ;CACR,kBAAkB;CAClB,wBAAwB;CAGxB,mBAAmB;CACnB,oBAAoB;CACpB,oBAAoB;CACpB,cAAc;CACd,iBAAiB;CACjB,mBAAmB;CACnB,kBAAkB;CAClB,eAAe;CAMf,wBAAwB;CAMxB,gBAAgB;CAChB,gCAAgC;CAChC,0BAA0B;CAG1B,iBAAiB;CAGjB,iBAAiB;CACjB,gBAAgB;AAClB;;;;;;AAUA,MAAa,wBAAoE;EAC9E,eAAe,oBAAoB;EACnC,eAAe,oBAAoB;EACnC,eAAe,UAAU;EACzB,eAAe,SAAS;EACxB,eAAe,mBAAmB;EAClC,eAAe,yBAAyB;EACxC,eAAe,oBAAoB;EACnC,eAAe,qBAAqB;EACpC,eAAe,qBAAqB;EACpC,eAAe,eAAe;EAC9B,eAAe,kBAAkB;EACjC,eAAe,oBAAoB;EACnC,eAAe,mBAAmB;EAClC,eAAe,gBAAgB;EAC/B,eAAe,yBAAyB;EACxC,eAAe,iBAAiB;EAChC,eAAe,iCAAiC;EAChD,eAAe,2BAA2B;EAC1C,eAAe,kBAAkB;EACjC,eAAe,kBAAkB;EACjC,eAAe,iBAAiB;AACnC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posture-origins-Ba83O0cD.mjs","names":[],"sources":["../src/constants/patterns.ts","../src/posture-origins/index.ts"],"sourcesContent":["/**\n * Regular Expression Patterns\n *\n * Common regex patterns used for validation and detection\n */\n\n/**\n * Validation Patterns\n */\n// Hoisted out of the object literal below so bundle-size-critical leaves can\n// import JUST this one pattern. `VALIDATION_PATTERNS` re-exports it, so there\n// is still exactly one definition and no drift.\n//\n// Why it matters: rolldown (via tsdown) does not do property-level DCE on a\n// const object literal the way esbuild did. `browser-posture-cookie.ts` uses\n// only `.UUID`, but importing the whole object dragged every pattern —\n// ULID, SLUG, IPV4, IPV6 — into that leaf, taking it from 272 to 2,870 bytes.\nexport const UUID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\nexport const VALIDATION_PATTERNS = {\n // Identifiers\n UUID: UUID_PATTERN,\n ULID: /^[0-9A-HJKM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-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}|:))$/,\n // eslint-disable-next-line no-useless-escape\n // CIDR pattern: uses IPV4 pattern and restricts mask to 0-32\n CIDR: /^(?:(?: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-9]|[12][0-9]|3[0-2])$/,\n // eslint-disable-next-line no-useless-escape\n DOMAIN: /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,\n HOSTNAME:\n /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,\n // eslint-disable-next-line no-useless-escape\n URL: /^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/,\n\n // Contact\n // Email pattern: stricter validation (rejects consecutive dots, requires TLD)\n // Local part: alphanumeric start/end, dots allowed but not consecutive\n EMAIL:\n /^[a-zA-Z0-9](?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]|\\.(?!\\.))*[a-zA-Z0-9]?@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,\n PHONE: /^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$/,\n\n // Security\n // JWT pattern: requires 3 parts (header.payload.signature) - signature cannot be empty\n JWT: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+$/,\n // eslint-disable-next-line no-useless-escape\n BASE64: /^[A-Za-z0-9+\\/]*={0,2}$/,\n HEX: /^[0-9a-fA-F]+$/,\n MD5: /^[a-f0-9]{32}$/i,\n SHA1: /^[a-f0-9]{40}$/i,\n SHA256: /^[a-f0-9]{64}$/i,\n\n // Versions\n SEMVER:\n /^(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-]+)*))?$/,\n\n // Files\n FILENAME: /^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*[a-zA-Z0-9])?\\.[a-zA-Z0-9_-]+$/,\n PATH: /^(\\/[^/ ]*)+\\/?$/,\n\n // Keys\n API_KEY: /^[A-Za-z0-9_-]{32,}$/,\n SECRET_KEY: /^[A-Za-z0-9_-]{64,}$/,\n PIXEL_ID: /^px_[A-Za-z0-9]{16}$/,\n} as const;\n\n/**\n * User Agent Patterns for Agent Detection\n */\nexport const USER_AGENT_PATTERNS = {\n // AI Agents\n OPENAI: /(?:GPTBot|ChatGPT-User|OpenAI)/i,\n ANTHROPIC: /(?:Claude-Web|Claude-User|anthropic-ai|claude-web|claude-user|ClaudeBot)/i,\n PERPLEXITY: /(?:PerplexityBot|Perplexica)/i,\n GOOGLE_AI: /(?:Bard|Google-InspectionTool)/i,\n MICROSOFT_AI: /(?:BingPreview\\/.*ChatGPT|Copilot)/i,\n\n // Search Bots\n GOOGLEBOT: /Googlebot/i,\n BINGBOT: /(?:bingbot|BingPreview|msnbot)/i,\n DUCKDUCKBOT: /DuckDuckBot/i,\n BAIDUBOT: /Baiduspider/i,\n YANDEXBOT: /YandexBot/i,\n\n // Social Media Bots\n FACEBOOK: /(?:facebookexternalhit|facebookcatalog)/i,\n TWITTER: /(?:Twitterbot|TwitterImageProxy)/i,\n LINKEDIN: /LinkedInBot/i,\n WHATSAPP: /WhatsApp/i,\n TELEGRAM: /TelegramBot/i,\n DISCORD: /Discordbot/i,\n SLACK: /Slackbot/i,\n\n // Crawlers and Scrapers\n GENERIC_BOT: /(?:bot|crawler|spider|scraper|agent)/i,\n SCRAPY: /Scrapy/i,\n PUPPETEER: /(?:HeadlessChrome|Puppeteer)/i,\n PLAYWRIGHT: /Playwright/i,\n SELENIUM: /(?:selenium|webdriver)/i,\n\n // Development Tools\n POSTMAN: /PostmanRuntime/i,\n INSOMNIA: /insomnia/i,\n CURL: /curl/i,\n WGET: /Wget/i,\n HTTPIE: /HTTPie/i,\n\n // Monitoring Services\n UPTIMEROBOT: /UptimeRobot/i,\n PINGDOM: /Pingdom/i,\n NEWRELIC: /NewRelicPinger/i,\n DATADOG: /Datadog/i,\n} as const;\n\n/**\n * Header Patterns for Agent Detection\n */\nexport const HEADER_PATTERNS = {\n // AI-specific headers\n AI_HEADERS: /^(?:X-(?:OpenAI|Anthropic|AI|Bot|Agent|LLM))/i,\n\n // Automation headers\n AUTOMATION_HEADERS: /^(?:X-(?:Automated|Robot|Crawler|Scraper))/i,\n\n // Missing standard headers\n MISSING_ACCEPT: /^$/,\n MISSING_ACCEPT_LANGUAGE: /^$/,\n MISSING_ACCEPT_ENCODING: /^$/,\n\n // Suspicious patterns\n GENERIC_ACCEPT: /^\\*\\/\\*$/,\n NO_COOKIES: /^$/,\n\n // Known proxy headers\n PROXY_HEADERS: /^(?:X-Forwarded-|X-Real-IP|X-Originating-IP|Via|Forwarded)/i,\n\n // Cloud provider headers\n CLOUD_HEADERS: /^(?:X-(?:AWS|Azure|GCP|Cloudflare))/i,\n} as const;\n\n/**\n * Browser Patterns\n */\nexport const BROWSER_PATTERNS = {\n CHROME: /Chrome\\/([0-9.]+)/,\n FIREFOX: /Firefox\\/([0-9.]+)/,\n SAFARI: /Version\\/([0-9.]+).*Safari/,\n EDGE: /Edg\\/([0-9.]+)/,\n OPERA: /OPR\\/([0-9.]+)/,\n IE: /MSIE ([0-9.]+)/,\n} as const;\n\n/**\n * Operating System Patterns\n */\nexport const OS_PATTERNS = {\n WINDOWS: /Windows NT ([0-9.]+)/,\n MACOS: /Mac OS X ([0-9_]+)/,\n LINUX: /Linux/,\n ANDROID: /Android ([0-9.]+)/,\n IOS: /OS ([0-9_]+) like Mac OS X/,\n} as const;\n\n/**\n * Mobile Device Patterns\n */\nexport const MOBILE_PATTERNS = {\n MOBILE: /(?:Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i,\n TABLET: /(?:iPad|Android.*Tablet|Tablet.*Android|Kindle|Silk)/i,\n DESKTOP: /(?:Windows NT|Mac OS X|Linux|CrOS)/i,\n} as const;\n\n/**\n * Suspicious Behavior Patterns\n */\nexport const SUSPICIOUS_PATTERNS = {\n // Rapid requests\n RAPID_REQUESTS: /^[0-9]{1,3}$/,\n\n // Sequential access\n SEQUENTIAL_URLS: /\\?(?:page|offset|id)=[0-9]+/,\n\n // Data extraction\n API_ENDPOINTS: /\\/api\\/|\\.json$|\\.xml$/i,\n\n // Form submission without interaction\n DIRECT_POST: /^POST$/,\n\n // Known attack patterns\n SQL_INJECTION:\n /(?:union|select|insert|update|delete|drop|create|alter|exec|script|javascript|onerror|onload|eval|src=)/i,\n XSS_ATTEMPT: /(?:<script|javascript:|onerror=|onclick=|<iframe|<embed|<object)/i,\n PATH_TRAVERSAL: /(?:\\.\\.\\/|\\.\\.\\\\|%2e%2e%2f|%252e%252e%252f)/i,\n\n // Encoding attempts\n URL_ENCODED: /%[0-9a-f]{2}/i,\n BASE64_DATA: /data:[^;]+;base64,/i,\n} as const;\n\n/**\n * Maximum input length for pattern matching. UAs, header values, and\n * detection payloads are bounded in practice (<4KB even for the most\n * verbose Chrome/Firefox UAs). Caps worst-case complexity for any\n * polynomial-shaped pattern an external caller might supply to\n * `testPattern` / `extractMatch`; CodeQL flagged the unbounded path\n * (js/polynomial-redos) on PR #2576.\n */\nconst MAX_PATTERN_INPUT_LENGTH = 4096;\n\n/**\n * Helper function to test a pattern. Returns `false` on inputs longer\n * than {@link MAX_PATTERN_INPUT_LENGTH} — an abuse signal we'd rather\n * reject than process.\n */\nexport function testPattern(pattern: RegExp, value: string): boolean {\n if (value.length > MAX_PATTERN_INPUT_LENGTH) return false;\n return pattern.test(value);\n}\n\n/**\n * Helper function to extract match from pattern. Returns `null` on\n * over-long inputs (same ReDoS defense as `testPattern`).\n */\nexport function extractMatch(pattern: RegExp, value: string): string | null {\n if (value.length > MAX_PATTERN_INPUT_LENGTH) return null;\n const match = value.match(pattern);\n return match ? match[1] || match[0] : null;\n}\n\n/**\n * Helper function to test multiple patterns\n */\nexport function testPatterns(patterns: RegExp[], value: string): boolean {\n return patterns.some((pattern) => testPattern(pattern, value));\n}\n\n/**\n * Helper function to find matching pattern\n */\nexport function findMatchingPattern(\n patterns: Record<string, RegExp>,\n value: string\n): string | null {\n for (const [name, pattern] of Object.entries(patterns)) {\n if (testPattern(pattern, value)) {\n return name;\n }\n }\n return null;\n}\n","/**\n * Posture origins: which page origins a project's browser posture token may\n * be issued for (and, at the edge gateway, accepted on).\n *\n * The primary origin is derived from `project.domain`. A project can add up\n * to {@link MAX_POSTURE_ORIGINS} more in `settings.postureOrigins`, for the\n * installs a single varchar cannot describe: a Shopify store whose shoppers\n * browse a custom domain while `project.domain` is the myshopify host, `www`\n * next to the apex, a staging host, several storefront domains.\n *\n * One resolver, used by every caller (the beacon issuer, the settings APIs,\n * the dashboard editor, the gateway verifier, the beacon-ingest Worker), so\n * what the dashboard accepts, what the issuer signs and what the gateway\n * verifies can never drift apart.\n *\n * Pure, dependency-free, Web-standard `URL` only: safe in Node, the browser\n * and Cloudflare Workers. `URL` also gives consistent IDN handling: a\n * Unicode host is converted to its punycode (`xn--`) form everywhere, which\n * is exactly how a browser serializes the `Origin` header.\n *\n * Pattern rules (the stored form is always normalized):\n * - `https://host[:port]`: an exact origin. HTTPS only, with no localhost\n * exception, because the posture signer (`signBrowserPosture`) refuses any\n * non-HTTPS audience anyway.\n * - A bare `host` is read as `https://host`. Paths, a trailing slash, query\n * and fragment are stripped; userinfo (`user@host`) is rejected.\n * - `https://*.example.com`: matches any origin ONE OR MORE labels below\n * `example.com` (`a.example.com`, `a.b.example.com`), same scheme and port.\n * It never matches the apex `example.com`; list that separately. The\n * wildcard is allowed only as the whole leftmost label.\n * - A wildcard over a public or multi-tenant suffix is rejected\n * (`*.com`, `*.co.uk`, `*.myshopify.com`, `*.vercel.app`, ...): it would\n * let any tenant of that platform mint posture for this project.\n *\n * @example\n * const allowed = resolveProjectAllowedOrigins({\n * domain: 'checkpoint-rebrand.myshopify.com',\n * settings: { postureOrigins: ['https://www.brand.com', 'https://*.brand.com'] },\n * });\n * matchAllowedOrigin('https://shop.brand.com', allowed); // 'https://shop.brand.com'\n * matchAllowedOrigin('https://brand.com', allowed); // undefined (apex not listed)\n */\n\nexport const MAX_POSTURE_ORIGINS = 20;\n/** Longest accepted entry: `https://` + a 253-char host + `:65535`, with headroom. */\nexport const MAX_POSTURE_ORIGIN_LENGTH = 300;\n\n/**\n * Multi-tenant hosting suffixes a customer does not control the siblings of.\n * A wildcard AT or anywhere BELOW one of these is refused, because platforms\n * nest tenant namespaces (`*.s3.us-east-1.amazonaws.com`, `*.a.run.app`,\n * `*.blob.core.windows.net`). An exact tenant host (`https://brand.myshopify.com`)\n * is still accepted.\n *\n * The public-suffix list is not a dependency of this package (it would ship\n * to the dashboard bundle and both Workers), so this is a curated list plus\n * the structural checks in {@link isPublicSuffixLike}. It is not complete:\n * adopting the PSL private section (e.g. `tldts`) is the full fix.\n */\nexport const MULTI_TENANT_SUFFIXES: ReadonlySet<string> = new Set([\n // Commerce and site builders\n 'myshopify.com',\n 'shopifypreview.com',\n 'myshopline.com',\n 'mybigcommerce.com',\n 'bigcartel.com',\n 'company.site',\n 'square.site',\n 'wixsite.com',\n 'wixstudio.io',\n 'squarespace.com',\n 'webflow.io',\n 'framer.app',\n 'framer.website',\n 'carrd.co',\n 'weebly.com',\n 'godaddysites.com',\n 'mystrikingly.com',\n 'hs-sites.com',\n 'hubspotpagebuilder.com',\n 'myportfolio.com',\n 'notion.site',\n 'ghost.io',\n 'substack.com',\n 'tumblr.com',\n 'blogspot.com',\n 'wordpress.com',\n 'wpengine.com',\n 'wpenginepowered.com',\n 'pantheonsite.io',\n 'kinsta.cloud',\n 'gitbook.io',\n 'bubbleapps.io',\n 'neocities.org',\n // App and AI builders\n 'lovable.app',\n 'lovable.dev',\n 'replit.app',\n 'replit.dev',\n 'repl.co',\n 'glitch.me',\n 'vusercontent.net',\n 'csb.app',\n 'codesandbox.io',\n 'stackblitz.io',\n 'webcontainer.io',\n 'streamlit.app',\n 'hf.space',\n 'gradio.live',\n 'pythonanywhere.com',\n // Hosting platforms\n 'vercel.app',\n 'now.sh',\n 'netlify.app',\n 'netlify.com',\n 'pages.dev',\n 'workers.dev',\n 'r2.dev',\n 'github.io',\n 'github.dev',\n 'gitlab.io',\n 'herokuapp.com',\n 'onrender.com',\n 'fly.dev',\n 'railway.app',\n 'koyeb.app',\n 'deno.dev',\n 'surge.sh',\n 'ondigitalocean.app',\n 'digitaloceanspaces.com',\n 'gitpod.io',\n // Cloud providers and CDNs\n 'amazonaws.com',\n 'amplifyapp.com',\n 'awsapprunner.com',\n 'elasticbeanstalk.com',\n 'cloudfront.net',\n 'azurewebsites.net',\n 'azurestaticapps.net',\n 'azurecontainerapps.io',\n 'azureedge.net',\n 'azurefd.net',\n 'azure-api.net',\n 'cloudapp.net',\n 'cloudapp.azure.com',\n 'windows.net',\n 'run.app',\n 'web.app',\n 'firebaseapp.com',\n 'firebasestorage.app',\n 'appspot.com',\n 'googleapis.com',\n 'googleusercontent.com',\n 'translate.goog',\n 'fastly.net',\n 'akamaized.net',\n 'akamaihd.net',\n 'edgekey.net',\n 'edgesuite.net',\n 'b-cdn.net',\n 'cloudflarestorage.com',\n 'supabase.co',\n // Tunnels\n 'ngrok.io',\n 'ngrok.app',\n 'ngrok.dev',\n 'ngrok-free.app',\n 'ngrok-free.dev',\n 'trycloudflare.com',\n 'loca.lt',\n]);\n\n/** Common second-level labels under a two-letter country TLD (`co.uk`, `com.au`, `ne.jp`). */\nconst CCTLD_SECOND_LEVEL_LABELS: ReadonlySet<string> = new Set([\n 'ac',\n 'biz',\n 'co',\n 'com',\n 'edu',\n 'gen',\n 'go',\n 'gob',\n 'gov',\n 'info',\n 'ltd',\n 'me',\n 'mil',\n 'ne',\n 'net',\n 'nic',\n 'or',\n 'org',\n 'plc',\n 'sch',\n]);\n\nconst WILDCARD_PROBE_LABEL = 'posture-origin-wildcard-probe';\n\nexport interface ParsedOriginPattern {\n /** The normalized stored form, e.g. `https://*.example.com` or `https://a.example.com:8443`. */\n pattern: string;\n wildcard: boolean;\n /** Lowercased, punycoded host WITHOUT the `*.` prefix. */\n host: string;\n /** Explicit port, or '' for the scheme default. */\n port: string;\n}\n\nexport type OriginPatternResult =\n | { ok: true; value: ParsedOriginPattern }\n | { ok: false; error: string };\n\n/**\n * True when a wildcard directly over `host` would cover sites the customer\n * does not control: a single label (`com`), a common ccTLD second level\n * (`co.uk`, `com.au`), or a known multi-tenant platform suffix or any host\n * below one (`myshopify.com`, `s3.us-east-1.amazonaws.com`). A heuristic,\n * not the full PSL.\n */\nexport function isPublicSuffixLike(host: string): boolean {\n const labels = host.split('.');\n if (labels.length < 2) return true;\n for (let index = 0; index < labels.length - 1; index++) {\n if (MULTI_TENANT_SUFFIXES.has(labels.slice(index).join('.'))) return true;\n }\n if (labels.length === 2) {\n const [second, top] = labels;\n if (top.length === 2 && CCTLD_SECOND_LEVEL_LABELS.has(second)) return true;\n }\n return false;\n}\n\nfunction isIpLiteral(host: string): boolean {\n return host.startsWith('[') || /^\\d+(\\.\\d+){3}$/.test(host);\n}\n\n/**\n * Validates and normalizes one allowlist entry. Returns a human-readable\n * error for the settings API's 400 and the dashboard editor.\n */\nexport function parseOriginPattern(input: string): OriginPatternResult {\n const trimmed = typeof input === 'string' ? input.trim() : '';\n if (!trimmed) return { ok: false, error: 'Enter an origin such as https://www.example.com' };\n if (trimmed.length > MAX_POSTURE_ORIGIN_LENGTH) {\n return { ok: false, error: `Must be at most ${MAX_POSTURE_ORIGIN_LENGTH} characters` };\n }\n const schemeMatch = /^([a-z][a-z0-9+.-]*):\\/\\//i.exec(trimmed);\n if (schemeMatch && schemeMatch[1].toLowerCase() !== 'https') {\n return { ok: false, error: 'Only https:// origins are supported' };\n }\n const rest = schemeMatch ? trimmed.slice(schemeMatch[0].length) : trimmed;\n const wildcard = rest.startsWith('*.');\n const withoutWildcard = wildcard ? rest.slice(2) : rest;\n if (withoutWildcard.includes('*')) {\n return {\n ok: false,\n error: 'A wildcard is only allowed as the whole first label, e.g. https://*.example.com',\n };\n }\n let url: URL;\n try {\n url = new URL(`https://${wildcard ? `${WILDCARD_PROBE_LABEL}.` : ''}${withoutWildcard}`);\n } catch {\n return { ok: false, error: 'Not a valid origin' };\n }\n if (url.username || url.password) {\n return { ok: false, error: 'Origins cannot contain a username or password' };\n }\n let host = url.hostname;\n if (wildcard) host = host.slice(WILDCARD_PROBE_LABEL.length + 1);\n if (!host || host.endsWith('.') || host.startsWith('.')) {\n return { ok: false, error: 'Not a valid host name' };\n }\n if (isIpLiteral(host)) {\n return { ok: false, error: 'Use a domain name, not an IP address' };\n }\n if (wildcard && isPublicSuffixLike(host)) {\n return {\n ok: false,\n error: `*.${host} would include sites you do not control; list your own hosts instead`,\n };\n }\n if (!host.includes('.')) {\n return { ok: false, error: 'Use a fully qualified domain, e.g. www.example.com' };\n }\n const port = url.port;\n // Port 0 is not a connectable port, so no page is ever served from it.\n if (port === '0') return { ok: false, error: 'Not a valid port' };\n const pattern = `https://${wildcard ? '*.' : ''}${host}${port ? `:${port}` : ''}`;\n return { ok: true, value: { pattern, wildcard, host, port } };\n}\n\nexport type PostureOriginsValidation =\n | { ok: true; origins: string[] }\n | { ok: false; errors: Array<{ index: number; message: string }> };\n\n/**\n * Validates a full allowlist from an API body or the editor: every entry\n * must parse, the list is capped, and duplicates (after normalization) are\n * removed while keeping first-seen order.\n */\nexport function validatePostureOrigins(input: unknown): PostureOriginsValidation {\n if (!Array.isArray(input)) {\n return { ok: false, errors: [{ index: -1, message: 'Expected a list of origins' }] };\n }\n if (input.length > MAX_POSTURE_ORIGINS) {\n return {\n ok: false,\n errors: [{ index: -1, message: `At most ${MAX_POSTURE_ORIGINS} additional origins` }],\n };\n }\n const errors: Array<{ index: number; message: string }> = [];\n const origins: string[] = [];\n input.forEach((entry, index) => {\n if (typeof entry !== 'string') {\n errors.push({ index, message: 'Each origin must be a string' });\n return;\n }\n const parsed = parseOriginPattern(entry);\n if (!parsed.ok) {\n errors.push({ index, message: parsed.error });\n return;\n }\n if (!origins.includes(parsed.value.pattern)) origins.push(parsed.value.pattern);\n });\n return errors.length > 0 ? { ok: false, errors } : { ok: true, origins };\n}\n\n/**\n * The primary origin from `project.domain`: an exact HTTPS origin, or\n * undefined when the domain is unset or carries a path, query, fragment or\n * userinfo. A bare host is read as `https://host`.\n */\nexport function primaryPostureOrigin(domain: string | null | undefined): string | undefined {\n if (!domain) return undefined;\n try {\n const url = new URL(domain.includes('://') ? domain : `https://${domain}`);\n if (\n url.protocol !== 'https:' ||\n url.username ||\n url.password ||\n url.pathname !== '/' ||\n url.search ||\n url.hash\n )\n return undefined;\n return url.origin;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Reads `settings.postureOrigins` defensively: settings is a jsonb column,\n * so anything written before validation existed (or by hand) is re-parsed\n * and invalid entries are dropped rather than trusted.\n */\nexport function postureKeysUrl(base: string, projectId: string): string {\n return `${base}/api/v1/beacon/keys?projectId=${projectId}`;\n}\n\nexport function readPostureOriginsSetting(settings: unknown): string[] {\n if (!settings || typeof settings !== 'object') return [];\n const raw = (settings as { postureOrigins?: unknown }).postureOrigins;\n if (!Array.isArray(raw)) return [];\n const origins: string[] = [];\n for (const entry of raw.slice(0, MAX_POSTURE_ORIGINS)) {\n if (typeof entry !== 'string') continue;\n const parsed = parseOriginPattern(entry);\n if (parsed.ok && !origins.includes(parsed.value.pattern)) origins.push(parsed.value.pattern);\n }\n return origins;\n}\n\n/**\n * Every origin pattern a project's posture may be issued for: the primary\n * (from `project.domain`) first, then the additional allowlist. Empty when\n * neither exists, which the issuer reports as `domain-unset`.\n */\nexport function resolveProjectAllowedOrigins(project: {\n domain: string | null | undefined;\n settings?: unknown;\n}): string[] {\n const allowed: string[] = [];\n const primary = primaryPostureOrigin(project.domain);\n if (primary) allowed.push(primary);\n for (const pattern of readPostureOriginsSetting(project.settings)) {\n if (!allowed.includes(pattern)) allowed.push(pattern);\n }\n return allowed;\n}\n\n/**\n * Returns the page origin when it matches one of `allowed`, else undefined.\n * The page origin must already be in the browser's serialized form\n * (`https://host[:port]`, lowercase, no path); anything else, including the\n * opaque `null` origin, never matches. The value returned is the page origin\n * itself, never a pattern, so a signed audience is always a concrete origin.\n */\nexport function matchAllowedOrigin(\n pageOrigin: string | null | undefined,\n allowed: readonly string[]\n): string | undefined {\n if (!pageOrigin || allowed.length === 0) return undefined;\n let url: URL;\n try {\n url = new URL(pageOrigin);\n } catch {\n return undefined;\n }\n if (url.protocol !== 'https:' || url.origin !== pageOrigin) return undefined;\n const host = url.hostname;\n if (host.includes('*')) return undefined;\n for (const entry of allowed) {\n const parsed = parseOriginPattern(entry);\n if (!parsed.ok || parsed.value.port !== url.port) continue;\n const { wildcard, host: patternHost } = parsed.value;\n if (!wildcard) {\n if (host === patternHost) return pageOrigin;\n continue;\n }\n if (host.length > patternHost.length + 1 && host.endsWith(`.${patternHost}`)) {\n return pageOrigin;\n }\n }\n return undefined;\n}\n\n/**\n * The page origin for an ingest request: the browser-set `Origin` header,\n * or, ONLY when that header is absent, the origin of `Referer`. Both are\n * set by the browser and equally forgeable by a non-browser client, so the\n * fallback adds no trust; it recovers installs whose proxy or request mode\n * drops `Origin`. A present-but-opaque `Origin: null` is kept as is (and\n * never matches), so a sandboxed frame cannot fall back to its Referer.\n * Never read `X-Forwarded-Host`, `X-Forwarded-Origin` or any custom header\n * here: those are caller-controlled.\n */\nexport function pageOriginFromHeaders(\n origin: string | null | undefined,\n referer: string | null | undefined\n): string | null {\n // Present means present: an empty `Origin:` is kept (and never matches)\n // rather than falling back to Referer.\n if (origin !== null && origin !== undefined) return origin;\n if (!referer) return null;\n try {\n const url = new URL(referer);\n if (url.protocol !== 'https:' || url.username || url.password) return null;\n return url.origin;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,MAAa,eACX;AAEF,MAAa,sBAAsB;CAEjC,MAAM;CACN,MAAM;CACN,MAAM;CAGN,MAAM;CACN,MAAM;CACN,IAAI;CAGJ,MAAM;CAEN,QAAQ;CACR,UACE;CAEF,KAAK;CAKL,OACE;CACF,OAAO;CAIP,KAAK;CAEL,QAAQ;CACR,KAAK;CACL,KAAK;CACL,MAAM;CACN,QAAQ;CAGR,QACE;CAGF,UAAU;CACV,MAAM;CAGN,SAAS;CACT,YAAY;CACZ,UAAU;AACZ;;;;AAKA,MAAa,sBAAsB;CAEjC,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,WAAW;CACX,cAAc;CAGd,WAAW;CACX,SAAS;CACT,aAAa;CACb,UAAU;CACV,WAAW;CAGX,UAAU;CACV,SAAS;CACT,UAAU;CACV,UAAU;CACV,UAAU;CACV,SAAS;CACT,OAAO;CAGP,aAAa;CACb,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,UAAU;CAGV,SAAS;CACT,UAAU;CACV,MAAM;CACN,MAAM;CACN,QAAQ;CAGR,aAAa;CACb,SAAS;CACT,UAAU;CACV,SAAS;AACX;;;;AAKA,MAAa,kBAAkB;CAE7B,YAAY;CAGZ,oBAAoB;CAGpB,gB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ACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAM,4CAAiD,IAAI,IAAI;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,uBAAuB;;;;;;;;AAuB7B,SAAgB,mBAAmB,MAAuB;CACxD,MAAM,SAAS,KAAK,MAAM,GAAG;CAC7B,IAAI,OAAO,SAAS,GAAG,OAAO;CAC9B,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,SAAS,GAAG,SAC7C,IAAI,sBAAsB,IAAI,OAAO,MAAM,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,OAAO;CAEvE,IAAI,OAAO,WAAW,GAAG;EACvB,MAAM,CAAC,QAAQ,OAAO;EACtB,IAAI,IAAI,WAAW,KAAK,0BAA0B,IAAI,MAAM,GAAG,OAAO;CACxE;CACA,OAAO;AACT;AAEA,SAAS,YAAY,MAAuB;CAC1C,OAAO,KAAK,WAAW,GAAG,KAAK,kBAAkB,KAAK,IAAI;AAC5D;;;;;AAMA,SAAgB,mBAAmB,OAAoC;CACrE,MAAM,UAAU,OAAO,UAAU,WAAW,MAAM,KAAK,IAAI;CAC3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I,CAAC,OAAO,MAAM,OAAO,MAAM,SAAS,IAAI,MAAM;EAClD,MAAM,EAAE,UAAU,MAAM,gBAAgB,OAAO;EAC/C,IAAI,CAAC,UAAU;GACb,IAAI,SAAS,aAAa,OAAO;GACjC;EACF;EACA,IAAI,KAAK,SAAS,YAAY,SAAS,KAAK,KAAK,SAAS,IAAI,aAAa,GACzE,OAAO;CAEX;AAEF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/mcpi/delegation-headers.d.ts
|
|
2
|
-
declare const DELEGATION_PROOF_HEADERS: readonly ["kya-os-delegation-credential", "kya-delegation"];
|
|
3
|
-
declare function requestCarriesDelegationProof(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
4
|
-
declare function requestPresentedCredential(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/mcpi/registered-sid.d.ts
|
|
7
|
-
declare const REGISTERED_SID_MAX_LENGTH = 100;
|
|
8
|
-
declare const SID_ATTRIBUTABLE_RESULT: "verified";
|
|
9
|
-
//#endregion
|
|
10
|
-
export { requestPresentedCredential as a, requestCarriesDelegationProof as i, SID_ATTRIBUTABLE_RESULT as n, DELEGATION_PROOF_HEADERS as r, REGISTERED_SID_MAX_LENGTH as t };
|
|
11
|
-
//# sourceMappingURL=registered-sid-D3g-gZQF.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registered-sid-D3g-gZQF.d.mts","names":[],"sources":["../src/mcpi/delegation-headers.ts","../src/mcpi/registered-sid.ts"],"mappings":";cAmBa;iBAgBG,8BACd,SAAS,UAAU;iBA4FL,2BACd,SAAS,UAAU;;;cClHR;cAUA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/mcpi/delegation-headers.d.ts
|
|
2
|
-
declare const DELEGATION_PROOF_HEADERS: readonly ["kya-os-delegation-credential", "kya-delegation"];
|
|
3
|
-
declare function requestCarriesDelegationProof(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
4
|
-
declare function requestPresentedCredential(headers: Headers | Record<string, unknown> | null | undefined): boolean;
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/mcpi/registered-sid.d.ts
|
|
7
|
-
declare const REGISTERED_SID_MAX_LENGTH = 100;
|
|
8
|
-
declare const SID_ATTRIBUTABLE_RESULT: "verified";
|
|
9
|
-
//#endregion
|
|
10
|
-
export { requestPresentedCredential as a, requestCarriesDelegationProof as i, SID_ATTRIBUTABLE_RESULT as n, DELEGATION_PROOF_HEADERS as r, REGISTERED_SID_MAX_LENGTH as t };
|
|
11
|
-
//# sourceMappingURL=registered-sid-D3g-gZQF.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registered-sid-D3g-gZQF.d.ts","names":[],"sources":["../src/mcpi/delegation-headers.ts","../src/mcpi/registered-sid.ts"],"mappings":";cAmBa;iBAgBG,8BACd,SAAS,UAAU;iBA4FL,2BACd,SAAS,UAAU;;;cClHR;cAUA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registered-sid-hUl-bvM5.mjs","names":[],"sources":["../src/mcpi/delegation-headers.ts","../src/mcpi/registered-sid.ts"],"sourcesContent":["/**\n * Delegation-proof request detection (P2 / DR-1).\n *\n * The engine's L2 delegation-root pinning (`ContextSpec.trustedDelegationRoots`)\n * is consulted for every credential the engine verifies: the delegation-proof\n * headers below AND an `Authorization: Bearer` VC-JWT. Consumers gate root\n * resolution on `requestPresentedCredential`, so the human / no-credential hot\n * path stays a precise no-op.\n *\n * Keeping the header set here (rather than re-listing the literals at each site)\n * is the whole point: a new delegation transport header is added in one place\n * and every verifier surface agrees.\n */\n\n/**\n * Lowercased delegation-proof header names. `kya-os-delegation-credential` is the\n * canonical KYA-OS transport; `kya-delegation` is the legacy envelope form still\n * accepted via `legacyEnvelopeFallback`.\n */\nexport const DELEGATION_PROOF_HEADERS = ['kya-os-delegation-credential', 'kya-delegation'] as const;\n\n/** A header value is \"present\" when it is a non-empty string (or non-empty list). */\nfunction isPresent(value: unknown): boolean {\n if (Array.isArray(value)) return value.length > 0;\n return typeof value === 'string' && value.length > 0;\n}\n\n/**\n * Does the request carry a KYA-OS delegation-proof header?\n *\n * Accepts either a `Headers` instance (Next.js / fetch — case-insensitive\n * lookup) or a plain header record (raw Node/Express headers, gateway worker's\n * lowercased map). Record keys are matched case-insensitively, so callers do not\n * need to pre-normalize. Returns `false` for `null`/`undefined`.\n */\nexport function requestCarriesDelegationProof(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n\n if (typeof (headers as Headers).get === 'function') {\n const h = headers as Headers;\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(h.get(name)));\n }\n\n const record = headers as Record<string, unknown>;\n const lowerKeyed = new Map<string, unknown>();\n for (const key of Object.keys(record)) {\n lowerKeyed.set(key.toLowerCase(), record[key]);\n }\n return DELEGATION_PROOF_HEADERS.some((name) => isPresent(lowerKeyed.get(name)));\n}\n\nconst MAX_VC_JWT_PAYLOAD_CHARS = 16 * 1024;\n\nfunction headerText(headers: Headers | Record<string, unknown>, name: string): string | undefined {\n if (typeof (headers as Headers).get === 'function') {\n return (headers as Headers).get(name) ?? undefined;\n }\n for (const [key, value] of Object.entries(headers as Record<string, unknown>)) {\n if (key.toLowerCase() !== name) continue;\n if (Array.isArray(value)) return value.join(', ');\n return typeof value === 'string' ? value : undefined;\n }\n return undefined;\n}\n\nfunction isMemberDelimiter(c: string): boolean {\n return c === '=' || c === ';' || c === ',' || c === ' ' || c === '\\t';\n}\n\n// Quote-aware member scan; the engine owns the authoritative parse.\nfunction hasKyaMember(value: string): boolean {\n let memberStart = true;\n let quoted = false;\n let escaped = false;\n for (let i = 0; i < value.length; i++) {\n const c = value[i];\n if (quoted) {\n if (escaped) escaped = false;\n else if (c === '\\\\') escaped = true;\n else if (c === '\"') quoted = false;\n continue;\n }\n if (memberStart) {\n if (c === ' ' || c === '\\t') continue;\n if (\n value.startsWith('kya', i) &&\n (i + 3 === value.length || isMemberDelimiter(value[i + 3]))\n ) {\n return true;\n }\n memberStart = false;\n }\n if (c === '\"') quoted = true;\n else if (c === ',') memberStart = true;\n }\n return false;\n}\n\nfunction decodeBase64UrlJson(segment: string): unknown {\n const padded = segment.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(padded + '='.repeat((4 - (padded.length % 4)) % 4));\n const bytes = Uint8Array.from(binary, (ch) => ch.charCodeAt(0));\n return JSON.parse(new TextDecoder().decode(bytes));\n}\n\nfunction isDelegationCredentialPayload(payload: unknown): boolean {\n if (typeof payload !== 'object' || payload === null) return false;\n if ('vc' in payload) return true;\n const type = (payload as { type?: unknown }).type;\n return Array.isArray(type) && type.includes('DelegationCredential');\n}\n\n// Must equal the orchestrator's delegation routing (`vc` claim OR flat `type`\n// DelegationCredential); an oversized payload counts as presented.\nfunction looksLikeVcJwt(token: string): boolean {\n const parts = token.split('.');\n if (parts.length !== 3 || parts.some((part) => part.length === 0)) return false;\n if (parts[1].length > MAX_VC_JWT_PAYLOAD_CHARS) return true;\n try {\n return isDelegationCredentialPayload(decodeBase64UrlJson(parts[1]));\n } catch {\n return false;\n }\n}\n\n/** Same definition as the .NET / Java `IsCredentialPresented`. */\nexport function requestPresentedCredential(\n headers: Headers | Record<string, unknown> | null | undefined\n): boolean {\n if (!headers) return false;\n for (const name of ['signature-input', 'signature']) {\n const value = headerText(headers, name);\n if (value && hasKyaMember(value)) return true;\n }\n if (requestCarriesDelegationProof(headers)) return true;\n const authorization = headerText(headers, 'authorization');\n const bearer = authorization?.match(/^bearer\\s+(\\S+)/i);\n return bearer !== null && bearer !== undefined && looksLikeVcJwt(bearer[1]);\n}\n","/**\n * The registered session anchor (`sid`) contract between a reporter and\n * Checkpoint ingest. Kept apart from `reported-identity.ts`, which builds Zod\n * schemas when it loads, so the runtime and the `./kya-http` entry can read\n * these values without loading Zod.\n */\n\n/**\n * Max length of a registered session anchor (`sid`) accepted on the wire and\n * enforced again at the customer route. The join partner\n * `bouncer_sessions.id` is `varchar(100)`; `detections.registered_sid` stays\n * `text` (converting a live column to `varchar` would take an ACCESS EXCLUSIVE\n * rewrite of the hottest table), so this constant is the width contract\n * instead of the column type.\n */\nexport const REGISTERED_SID_MAX_LENGTH = 100;\n\n/**\n * The one delegation result that may attribute a `sid` to a session timeline.\n * A rejected presentation carries no engine-emitted sid, and a sid on a\n * `failed` / `not_presented` report is attacker-shaped, so ingest stamps\n * `registered_sid` only for this result and nulls it otherwise (D4 / D15).\n * One member on purpose: Section 13 of the plan records how an explicitly\n * unverified-labeled `failed` could join it later.\n */\nexport const SID_ATTRIBUTABLE_RESULT = 'verified' as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAa,2BAA2B,CAAC,gCAAgC,gBAAgB;;AAGzF,SAAS,UAAU,OAAyB;CAC1C,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS;CAChD,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;;;;;;;;;AAUA,SAAgB,8BACd,SACS;CACT,IAAI,CAAC,SAAS,OAAO;CAErB,IAAI,OAAQ,QAAoB,QAAQ,YAAY;EAClD,MAAM,IAAI;EACV,OAAO,yBAAyB,MAAM,SAAS,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC;CACvE;CAEA,MAAM,SAAS;CACf,MAAM,6BAAa,IAAI,IAAqB;CAC5C,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAClC,WAAW,IAAI,IAAI,YAAY,GAAG,OAAO,IAAI;CAE/C,OAAO,yBAAyB,MAAM,SAAS,UAAU,WAAW,IAAI,IAAI,CAAC,CAAC;AAChF;AAEA,MAAM,2BAA2B;AAEjC,SAAS,WAAW,SAA4C,MAAkC;CAChG,IAAI,OAAQ,QAAoB,QAAQ,YACtC,OAAQ,QAAoB,IAAI,IAAI,KAAK;CAE3C,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAA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