@kya-os/checkpoint-shared 1.6.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.
- package/CHANGELOG.md +122 -9
- package/README.md +24 -7
- 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 +23 -1
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +23 -1
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +49 -4
- package/dist/beacon-types/index.mjs +47 -4
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/{browser-posture-BuChqmH5.d.mts → browser-posture-5fPrsxx7.d.mts} +2 -2
- package/dist/{browser-posture-BuChqmH5.d.mts.map → browser-posture-5fPrsxx7.d.mts.map} +1 -1
- package/dist/{browser-posture-DIaVLuW3.d.ts → browser-posture-CCR1kh5e.d.ts} +2 -2
- package/dist/{browser-posture-DIaVLuW3.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.d.mts +16 -2
- package/dist/browser-posture-proof.d.mts.map +1 -1
- package/dist/browser-posture-proof.d.ts +16 -2
- package/dist/browser-posture-proof.d.ts.map +1 -1
- package/dist/browser-posture-proof.js +114 -17
- package/dist/browser-posture-proof.mjs +112 -17
- 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 -4
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +25 -4
- 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.d.mts.map +1 -1
- package/dist/canonical-signer/index.d.ts.map +1 -1
- package/dist/canonical-signer/index.js +116 -79
- package/dist/canonical-signer/index.mjs +117 -52
- 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 -0
- package/dist/client-ip.d.ts +2 -0
- package/dist/client-ip.js +8 -0
- package/dist/client-ip.mjs +3 -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 +5 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +23 -4
- package/dist/errors/index.mjs +23 -4
- 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-CivUCbhL.d.ts +44 -0
- package/dist/fetcher-CivUCbhL.d.ts.map +1 -0
- package/dist/fetcher-cXQsbm6s.d.mts +44 -0
- package/dist/fetcher-cXQsbm6s.d.mts.map +1 -0
- package/dist/gateway-client-ip.d.mts +1 -1
- package/dist/gateway-client-ip.d.ts +1 -1
- package/dist/gateway-client-ip.js +2 -2
- package/dist/gateway-client-ip.mjs +2 -2
- package/dist/host-adapter/index.d.mts +2 -0
- package/dist/host-adapter/index.d.ts +2 -0
- package/dist/host-adapter/index.js +24 -0
- package/dist/host-adapter/index.mjs +3 -0
- package/dist/host-adapter-0F8EpbD6.js +753 -0
- package/dist/host-adapter-DHyISsIf.mjs +593 -0
- package/dist/host-adapter-DHyISsIf.mjs.map +1 -0
- package/dist/index-B3cHxr3O.d.mts +156 -0
- package/dist/index-B3cHxr3O.d.mts.map +1 -0
- package/dist/index-CXbOY7gB.d.ts +156 -0
- package/dist/index-CXbOY7gB.d.ts.map +1 -0
- package/dist/index.d.mts +6997 -12170
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +6997 -12170
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2510 -8893
- package/dist/index.mjs +2366 -8534
- package/dist/index.mjs.map +1 -1
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts +29 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.mts.map +1 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts +29 -0
- package/dist/kya-http-error-codes-7ewV5RuK.d.ts.map +1 -0
- package/dist/kya-http-error-codes-C2JiWPsi.mjs +73 -0
- package/dist/kya-http-error-codes-C2JiWPsi.mjs.map +1 -0
- package/dist/kya-http-error-codes-UYb1zpGM.js +83 -0
- package/dist/kya-http.d.mts +3 -0
- package/dist/kya-http.d.ts +3 -0
- package/dist/kya-http.js +19 -0
- package/dist/kya-http.mjs +5 -0
- 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/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-B2r7M9wR.js +243 -0
- package/dist/patterns-B7dQoeE3.mjs +173 -0
- package/dist/patterns-B7dQoeE3.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.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 -0
- package/dist/policy/enforcement.d.ts +3 -0
- package/dist/policy/enforcement.js +21 -0
- package/dist/policy/enforcement.mjs +4 -0
- 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-Pn-ii-Pp.mjs → posture-origins-Ci6k4Zh1.js} +24 -173
- package/dist/{posture-origins-LFkX80oF.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-26hNxp6t.mjs +151 -0
- 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-DVGTSH0L.js +185 -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-02CI7jgm.d.mts +535 -0
- package/dist/schemas-02CI7jgm.d.mts.map +1 -0
- package/dist/{schemas-YhagYDx_.js → schemas-BlScS1it.js} +0 -20
- package/dist/schemas-C_3C72SR.d.ts +535 -0
- package/dist/schemas-C_3C72SR.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/step-up-BK0oBi11.mjs +1563 -0
- package/dist/step-up-BK0oBi11.mjs.map +1 -0
- package/dist/step-up-Bp8RAQwv.js +1759 -0
- package/dist/step-up-Bz12gYKT.d.mts +130 -0
- package/dist/step-up-Bz12gYKT.d.mts.map +1 -0
- package/dist/step-up-Bz12gYKT.d.ts +130 -0
- 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/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/reviewer-grant-revocation.v1.json +53 -81
- package/package.json +59 -2
- package/dist/client-ip-B2Xeo-GK.mjs.map +0 -1
- package/dist/posture-origins-Pn-ii-Pp.mjs.map +0 -1
- package/dist/schemas-7qodsG-Z.mjs.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//#region src/policy/fail-closed-response.d.ts
|
|
2
|
+
declare const FAIL_CLOSED_STATUS = 503;
|
|
3
|
+
declare const FAIL_CLOSED_BODY: {
|
|
4
|
+
readonly error: "Service temporarily unavailable";
|
|
5
|
+
readonly source: "checkpoint-middleware";
|
|
6
|
+
};
|
|
7
|
+
declare const FAIL_CLOSED_HEADERS: Readonly<Record<string, string>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/policy/match-path.d.ts
|
|
10
|
+
declare function matchPath(path: string, pattern: string): boolean;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/policy/legacy-carve-out.d.ts
|
|
13
|
+
declare const NO_EVIDENCE_CATEGORY = "no_evidence";
|
|
14
|
+
declare const NO_EVIDENCE_EXCLUSION_TERM = "principal.category != \"no_evidence\"";
|
|
15
|
+
declare const NO_EVIDENCE_EQUALITY_TERM = "principal.category == \"no_evidence\"";
|
|
16
|
+
declare function withNoEvidenceExclusion(cedar: string): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/policy/cedar-principal-scope.d.ts
|
|
19
|
+
type ProbeClass = 'human' | typeof NO_EVIDENCE_CATEGORY;
|
|
20
|
+
interface CedarCondition {
|
|
21
|
+
kind: 'when' | 'unless';
|
|
22
|
+
body: string;
|
|
23
|
+
}
|
|
24
|
+
interface CedarStatement {
|
|
25
|
+
effect: 'forbid' | 'permit';
|
|
26
|
+
blockStart: number;
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
text: string;
|
|
30
|
+
scope: string;
|
|
31
|
+
conditions: CedarCondition[];
|
|
32
|
+
annotations: string;
|
|
33
|
+
}
|
|
34
|
+
interface Facts {
|
|
35
|
+
category: string;
|
|
36
|
+
path?: string;
|
|
37
|
+
discountNaming?: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare function parseCedarStatements(cedar: string): CedarStatement[];
|
|
40
|
+
declare function statementApplies(statement: CedarStatement, facts: Facts): boolean;
|
|
41
|
+
declare function statementId(statement: CedarStatement): string | undefined;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/policy/cedar-rule-match.d.ts
|
|
44
|
+
interface RequestFacts {
|
|
45
|
+
path?: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
category?: string;
|
|
48
|
+
}
|
|
49
|
+
declare function pathLiteralsInBlock(block: string): string[];
|
|
50
|
+
declare function splitCedarBlocks(cedar: string): string[];
|
|
51
|
+
declare function blockEqualityLiterals(block: string, attr: string): string[];
|
|
52
|
+
interface PolicyHazardAnalysis {
|
|
53
|
+
unnarrowedDenyFor(path: string, probe: ProbeClass): boolean;
|
|
54
|
+
explicitDenyFor(path: string, probe: ProbeClass): boolean;
|
|
55
|
+
humanHazard(path: string): boolean;
|
|
56
|
+
noEvidenceHazard(path: string): boolean;
|
|
57
|
+
noEvidenceNamed(path: string): boolean;
|
|
58
|
+
}
|
|
59
|
+
declare function analyzePolicySource(cedar: string): PolicyHazardAnalysis;
|
|
60
|
+
declare function pathHasUnnarrowedDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/policy/required-scopes.d.ts
|
|
63
|
+
declare function requiredScopesForRequest(policySource: string | null | undefined, request?: RequestFacts): string[];
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/policy/byte-bounded-memo.d.ts
|
|
66
|
+
declare class ByteBoundedMemo<V> {
|
|
67
|
+
private readonly budgetBytes;
|
|
68
|
+
private readonly entries;
|
|
69
|
+
private used;
|
|
70
|
+
constructor(budgetBytes: number);
|
|
71
|
+
remember(key: string, bytes: number, make: () => V): V;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/policy/decision-policy-id.d.ts
|
|
75
|
+
interface DecisionLike {
|
|
76
|
+
kind: string;
|
|
77
|
+
policyId?: string;
|
|
78
|
+
reason?: {
|
|
79
|
+
kind: string;
|
|
80
|
+
policyId?: string;
|
|
81
|
+
};
|
|
82
|
+
params?: {
|
|
83
|
+
policyId?: string;
|
|
84
|
+
};
|
|
85
|
+
target?: {
|
|
86
|
+
policyId?: string;
|
|
87
|
+
};
|
|
88
|
+
payload?: {
|
|
89
|
+
policyId?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
declare function decisionPolicyId(decision: DecisionLike): string | undefined;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/policy/bespoke-policy.d.ts
|
|
95
|
+
declare const BESPOKE_POLICY_IDS: {
|
|
96
|
+
readonly denyList: "bespoke-deny-list";
|
|
97
|
+
readonly allowList: "bespoke-allow-list";
|
|
98
|
+
readonly pathRule: "bespoke-path-rule";
|
|
99
|
+
readonly threshold: "bespoke-threshold";
|
|
100
|
+
};
|
|
101
|
+
type BespokePolicyId = (typeof BESPOKE_POLICY_IDS)[keyof typeof BESPOKE_POLICY_IDS];
|
|
102
|
+
declare function isBespokePolicyId(policyId: string | null | undefined): boolean;
|
|
103
|
+
declare function bespokePolicyLabel(policyId: string): string | null;
|
|
104
|
+
declare const BASELINE_ALLOW_POLICY_ID = "baseline-allow";
|
|
105
|
+
declare function isNonNavigablePolicyId(policyId: string | null | undefined): boolean;
|
|
106
|
+
declare function nonNavigablePolicyLabel(policyId: string | null | undefined): string | null;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/policy/approval-quorum.d.ts
|
|
109
|
+
interface ApprovalQuorum {
|
|
110
|
+
n: number;
|
|
111
|
+
approvers: string[];
|
|
112
|
+
}
|
|
113
|
+
declare function approvalQuorumForRequest(policySource: string | null | undefined, request?: RequestFacts): ApprovalQuorum | null;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/policy/step-up.d.ts
|
|
116
|
+
interface StepUpQuorumLike {
|
|
117
|
+
n: number;
|
|
118
|
+
approvers: string[];
|
|
119
|
+
}
|
|
120
|
+
type InvalidStepUpReason = 'invalid_step_up_quorum' | 'step_up_no_approvers';
|
|
121
|
+
type StepUpQuorumCheck = {
|
|
122
|
+
ok: true;
|
|
123
|
+
} | {
|
|
124
|
+
ok: false;
|
|
125
|
+
reason: InvalidStepUpReason;
|
|
126
|
+
};
|
|
127
|
+
declare function validateStepUpQuorum(quorum: StepUpQuorumLike): StepUpQuorumCheck;
|
|
128
|
+
//#endregion
|
|
129
|
+
export { NO_EVIDENCE_EQUALITY_TERM as A, pathLiteralsInBlock as C, statementApplies as D, parseCedarStatements as E, FAIL_CLOSED_HEADERS as F, FAIL_CLOSED_STATUS as I, withNoEvidenceExclusion as M, matchPath as N, statementId as O, FAIL_CLOSED_BODY as P, pathHasUnnarrowedDenyRuleFor as S, ProbeClass as T, requiredScopesForRequest as _, ApprovalQuorum as a, analyzePolicySource as b, BESPOKE_POLICY_IDS as c, isBespokePolicyId as d, isNonNavigablePolicyId as f, ByteBoundedMemo as g, decisionPolicyId as h, validateStepUpQuorum as i, NO_EVIDENCE_EXCLUSION_TERM as j, NO_EVIDENCE_CATEGORY as k, BespokePolicyId as l, DecisionLike as m, StepUpQuorumCheck as n, approvalQuorumForRequest as o, nonNavigablePolicyLabel as p, StepUpQuorumLike as r, BASELINE_ALLOW_POLICY_ID as s, InvalidStepUpReason as t, bespokePolicyLabel as u, PolicyHazardAnalysis as v, splitCedarBlocks as w, blockEqualityLiterals as x, RequestFacts as y };
|
|
130
|
+
//# sourceMappingURL=step-up-Bz12gYKT.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-Bz12gYKT.d.mts","names":[],"sources":["../src/policy/fail-closed-response.ts","../src/policy/match-path.ts","../src/policy/legacy-carve-out.ts","../src/policy/cedar-principal-scope.ts","../src/policy/cedar-rule-match.ts","../src/policy/required-scopes.ts","../src/policy/byte-bounded-memo.ts","../src/policy/decision-policy-id.ts","../src/policy/bespoke-policy.ts","../src/policy/approval-quorum.ts","../src/policy/step-up.ts"],"mappings":";cAAa;cAIA;WAAA;WAAA;;cAKA,qBAAqB,SAAS;;;iBCF3B,UAAU,cAAc;;;cCH3B;cACA;cACA;iBAiPG,wBAAwB;;;KCvO5B,8BAA8B;UAIzB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;UAGQ;EACR;EACA;EACA;;iBA6Cc,qBAAqB,gBAAgB;iBA0HrC,iBAAiB,WAAW,gBAAgB,OAAO;iBA+BnD,YAAY,WAAW;;;UCtNtB;EACf;EAEA;EAEA;;iBAgDc,oBAAoB;iBAiEpB,iBAAiB;iBAWjB,sBAAsB,eAAe;UA2CpC;EACf,kBAAkB,cAAc,OAAO;EACvC,gBAAgB,cAAc,OAAO;EACrC,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;;iBAGF,oBAAoB,gBAAgB;iBAcpC,6BACd,eACA,cACA,OAAO;;;iBC9LO,yBACd,yCACA,UAAU;;;cChCC,gBAAgB;mBAIE;mBAHZ;UACT;EAEqB,YAAA;EAE7B,SAAS,aAAa,eAAe,YAAY,IAAI;;;;UCetC;EACf;EACA;EACA;IAAW;IAAc;;EACzB;IAAW;;EACX;IAAW;;EACX;IAAY;;;iBAGE,iBAAiB,UAAU;;;cCF9B;;;;;;KAOD,0BAA0B,iCAAiC;iBAiBvD,kBAAkB;iBAQlB,mBAAmB;cActB;iBAOG,uBAAuB;iBASvB,wBAAwB;;;UCpDvB;EAEf;EAEA;;iBAGc,yBACd,yCACA,UAAU,eACT;;;UCZc;EACf;EACA;;KAOU;KAGA;EAAsB;;EAAe;EAAW,QAAQ;;iBAWpD,qBAAqB,QAAQ,mBAAmB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//#region src/policy/fail-closed-response.d.ts
|
|
2
|
+
declare const FAIL_CLOSED_STATUS = 503;
|
|
3
|
+
declare const FAIL_CLOSED_BODY: {
|
|
4
|
+
readonly error: "Service temporarily unavailable";
|
|
5
|
+
readonly source: "checkpoint-middleware";
|
|
6
|
+
};
|
|
7
|
+
declare const FAIL_CLOSED_HEADERS: Readonly<Record<string, string>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/policy/match-path.d.ts
|
|
10
|
+
declare function matchPath(path: string, pattern: string): boolean;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/policy/legacy-carve-out.d.ts
|
|
13
|
+
declare const NO_EVIDENCE_CATEGORY = "no_evidence";
|
|
14
|
+
declare const NO_EVIDENCE_EXCLUSION_TERM = "principal.category != \"no_evidence\"";
|
|
15
|
+
declare const NO_EVIDENCE_EQUALITY_TERM = "principal.category == \"no_evidence\"";
|
|
16
|
+
declare function withNoEvidenceExclusion(cedar: string): string;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/policy/cedar-principal-scope.d.ts
|
|
19
|
+
type ProbeClass = 'human' | typeof NO_EVIDENCE_CATEGORY;
|
|
20
|
+
interface CedarCondition {
|
|
21
|
+
kind: 'when' | 'unless';
|
|
22
|
+
body: string;
|
|
23
|
+
}
|
|
24
|
+
interface CedarStatement {
|
|
25
|
+
effect: 'forbid' | 'permit';
|
|
26
|
+
blockStart: number;
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
text: string;
|
|
30
|
+
scope: string;
|
|
31
|
+
conditions: CedarCondition[];
|
|
32
|
+
annotations: string;
|
|
33
|
+
}
|
|
34
|
+
interface Facts {
|
|
35
|
+
category: string;
|
|
36
|
+
path?: string;
|
|
37
|
+
discountNaming?: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare function parseCedarStatements(cedar: string): CedarStatement[];
|
|
40
|
+
declare function statementApplies(statement: CedarStatement, facts: Facts): boolean;
|
|
41
|
+
declare function statementId(statement: CedarStatement): string | undefined;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/policy/cedar-rule-match.d.ts
|
|
44
|
+
interface RequestFacts {
|
|
45
|
+
path?: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
category?: string;
|
|
48
|
+
}
|
|
49
|
+
declare function pathLiteralsInBlock(block: string): string[];
|
|
50
|
+
declare function splitCedarBlocks(cedar: string): string[];
|
|
51
|
+
declare function blockEqualityLiterals(block: string, attr: string): string[];
|
|
52
|
+
interface PolicyHazardAnalysis {
|
|
53
|
+
unnarrowedDenyFor(path: string, probe: ProbeClass): boolean;
|
|
54
|
+
explicitDenyFor(path: string, probe: ProbeClass): boolean;
|
|
55
|
+
humanHazard(path: string): boolean;
|
|
56
|
+
noEvidenceHazard(path: string): boolean;
|
|
57
|
+
noEvidenceNamed(path: string): boolean;
|
|
58
|
+
}
|
|
59
|
+
declare function analyzePolicySource(cedar: string): PolicyHazardAnalysis;
|
|
60
|
+
declare function pathHasUnnarrowedDenyRuleFor(cedar: string, path: string, probe: ProbeClass): boolean;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/policy/required-scopes.d.ts
|
|
63
|
+
declare function requiredScopesForRequest(policySource: string | null | undefined, request?: RequestFacts): string[];
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/policy/byte-bounded-memo.d.ts
|
|
66
|
+
declare class ByteBoundedMemo<V> {
|
|
67
|
+
private readonly budgetBytes;
|
|
68
|
+
private readonly entries;
|
|
69
|
+
private used;
|
|
70
|
+
constructor(budgetBytes: number);
|
|
71
|
+
remember(key: string, bytes: number, make: () => V): V;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/policy/decision-policy-id.d.ts
|
|
75
|
+
interface DecisionLike {
|
|
76
|
+
kind: string;
|
|
77
|
+
policyId?: string;
|
|
78
|
+
reason?: {
|
|
79
|
+
kind: string;
|
|
80
|
+
policyId?: string;
|
|
81
|
+
};
|
|
82
|
+
params?: {
|
|
83
|
+
policyId?: string;
|
|
84
|
+
};
|
|
85
|
+
target?: {
|
|
86
|
+
policyId?: string;
|
|
87
|
+
};
|
|
88
|
+
payload?: {
|
|
89
|
+
policyId?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
declare function decisionPolicyId(decision: DecisionLike): string | undefined;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/policy/bespoke-policy.d.ts
|
|
95
|
+
declare const BESPOKE_POLICY_IDS: {
|
|
96
|
+
readonly denyList: "bespoke-deny-list";
|
|
97
|
+
readonly allowList: "bespoke-allow-list";
|
|
98
|
+
readonly pathRule: "bespoke-path-rule";
|
|
99
|
+
readonly threshold: "bespoke-threshold";
|
|
100
|
+
};
|
|
101
|
+
type BespokePolicyId = (typeof BESPOKE_POLICY_IDS)[keyof typeof BESPOKE_POLICY_IDS];
|
|
102
|
+
declare function isBespokePolicyId(policyId: string | null | undefined): boolean;
|
|
103
|
+
declare function bespokePolicyLabel(policyId: string): string | null;
|
|
104
|
+
declare const BASELINE_ALLOW_POLICY_ID = "baseline-allow";
|
|
105
|
+
declare function isNonNavigablePolicyId(policyId: string | null | undefined): boolean;
|
|
106
|
+
declare function nonNavigablePolicyLabel(policyId: string | null | undefined): string | null;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/policy/approval-quorum.d.ts
|
|
109
|
+
interface ApprovalQuorum {
|
|
110
|
+
n: number;
|
|
111
|
+
approvers: string[];
|
|
112
|
+
}
|
|
113
|
+
declare function approvalQuorumForRequest(policySource: string | null | undefined, request?: RequestFacts): ApprovalQuorum | null;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/policy/step-up.d.ts
|
|
116
|
+
interface StepUpQuorumLike {
|
|
117
|
+
n: number;
|
|
118
|
+
approvers: string[];
|
|
119
|
+
}
|
|
120
|
+
type InvalidStepUpReason = 'invalid_step_up_quorum' | 'step_up_no_approvers';
|
|
121
|
+
type StepUpQuorumCheck = {
|
|
122
|
+
ok: true;
|
|
123
|
+
} | {
|
|
124
|
+
ok: false;
|
|
125
|
+
reason: InvalidStepUpReason;
|
|
126
|
+
};
|
|
127
|
+
declare function validateStepUpQuorum(quorum: StepUpQuorumLike): StepUpQuorumCheck;
|
|
128
|
+
//#endregion
|
|
129
|
+
export { NO_EVIDENCE_EQUALITY_TERM as A, pathLiteralsInBlock as C, statementApplies as D, parseCedarStatements as E, FAIL_CLOSED_HEADERS as F, FAIL_CLOSED_STATUS as I, withNoEvidenceExclusion as M, matchPath as N, statementId as O, FAIL_CLOSED_BODY as P, pathHasUnnarrowedDenyRuleFor as S, ProbeClass as T, requiredScopesForRequest as _, ApprovalQuorum as a, analyzePolicySource as b, BESPOKE_POLICY_IDS as c, isBespokePolicyId as d, isNonNavigablePolicyId as f, ByteBoundedMemo as g, decisionPolicyId as h, validateStepUpQuorum as i, NO_EVIDENCE_EXCLUSION_TERM as j, NO_EVIDENCE_CATEGORY as k, BespokePolicyId as l, DecisionLike as m, StepUpQuorumCheck as n, approvalQuorumForRequest as o, nonNavigablePolicyLabel as p, StepUpQuorumLike as r, BASELINE_ALLOW_POLICY_ID as s, InvalidStepUpReason as t, bespokePolicyLabel as u, PolicyHazardAnalysis as v, splitCedarBlocks as w, blockEqualityLiterals as x, RequestFacts as y };
|
|
130
|
+
//# sourceMappingURL=step-up-Bz12gYKT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-up-Bz12gYKT.d.ts","names":[],"sources":["../src/policy/fail-closed-response.ts","../src/policy/match-path.ts","../src/policy/legacy-carve-out.ts","../src/policy/cedar-principal-scope.ts","../src/policy/cedar-rule-match.ts","../src/policy/required-scopes.ts","../src/policy/byte-bounded-memo.ts","../src/policy/decision-policy-id.ts","../src/policy/bespoke-policy.ts","../src/policy/approval-quorum.ts","../src/policy/step-up.ts"],"mappings":";cAAa;cAIA;WAAA;WAAA;;cAKA,qBAAqB,SAAS;;;iBCF3B,UAAU,cAAc;;;cCH3B;cACA;cACA;iBAiPG,wBAAwB;;;KCvO5B,8BAA8B;UAIzB;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;UAGQ;EACR;EACA;EACA;;iBA6Cc,qBAAqB,gBAAgB;iBA0HrC,iBAAiB,WAAW,gBAAgB,OAAO;iBA+BnD,YAAY,WAAW;;;UCtNtB;EACf;EAEA;EAEA;;iBAgDc,oBAAoB;iBAiEpB,iBAAiB;iBAWjB,sBAAsB,eAAe;UA2CpC;EACf,kBAAkB,cAAc,OAAO;EACvC,gBAAgB,cAAc,OAAO;EACrC,YAAY;EACZ,iBAAiB;EACjB,gBAAgB;;iBAGF,oBAAoB,gBAAgB;iBAcpC,6BACd,eACA,cACA,OAAO;;;iBC9LO,yBACd,yCACA,UAAU;;;cChCC,gBAAgB;mBAIE;mBAHZ;UACT;EAEqB,YAAA;EAE7B,SAAS,aAAa,eAAe,YAAY,IAAI;;;;UCetC;EACf;EACA;EACA;IAAW;IAAc;;EACzB;IAAW;;EACX;IAAW;;EACX;IAAY;;;iBAGE,iBAAiB,UAAU;;;cCF9B;;;;;;KAOD,0BAA0B,iCAAiC;iBAiBvD,kBAAkB;iBAQlB,mBAAmB;cActB;iBAOG,uBAAuB;iBASvB,wBAAwB;;;UCpDvB;EAEf;EAEA;;iBAGc,yBACd,yCACA,UAAU,eACT;;;UCZc;EACf;EACA;;KAOU;KAGA;EAAsB;;EAAe;EAAW,QAAQ;;iBAWpD,qBAAqB,QAAQ,mBAAmB"}
|
|
@@ -37,7 +37,7 @@ export declare const MCPI_DELEGATION_ISSUER_DID = "did:web:kya.vouched.id:orgs:t
|
|
|
37
37
|
export declare const MCPI_DELEGATION_ISSUER_KID = "did:web:kya.vouched.id:orgs:test-org#key-1";
|
|
38
38
|
export declare const MCPI_DELEGATION_AGENT_DID = "did:key:z6MkTestAgent123";
|
|
39
39
|
export declare const MCPI_DELEGATION_USER_DID = "did:key:z6MkTestUser456";
|
|
40
|
-
export declare const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/
|
|
40
|
+
export declare const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
41
41
|
export declare const MCPI_DELEGATION_AUDIENCE = "https://gateway.knowthat.ai";
|
|
42
42
|
export declare const MCPI_DELEGATION_CANONICAL_PAYLOAD: {
|
|
43
43
|
readonly iss: "did:web:kya.vouched.id:orgs:test-org";
|
|
@@ -70,11 +70,11 @@ export declare const MCPI_DELEGATION_CANONICAL_PAYLOAD: {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
readonly credentialStatus: {
|
|
73
|
-
readonly id: "https://kya.vouched.id/
|
|
73
|
+
readonly id: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b#42";
|
|
74
74
|
readonly type: "StatusList2021Entry";
|
|
75
75
|
readonly statusPurpose: "revocation";
|
|
76
76
|
readonly statusListIndex: "42";
|
|
77
|
-
readonly statusListCredential: "https://kya.vouched.id/
|
|
77
|
+
readonly statusListCredential: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
readonly orgId: "00000000-0000-0000-0000-000000000010";
|
|
@@ -86,7 +86,7 @@ export declare const MCPI_DELEGATION_EXPECTED_HEADER: {
|
|
|
86
86
|
readonly typ: "JWT";
|
|
87
87
|
readonly kid: "did:web:kya.vouched.id:orgs:test-org#key-1";
|
|
88
88
|
};
|
|
89
|
-
export declare const MCPI_DELEGATION_EXPECTED_JWT = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDp3ZWI6a3lhLnZvdWNoZWQuaWQ6b3Jnczp0ZXN0LW9yZyNrZXktMSJ9.
|
|
89
|
+
export declare const MCPI_DELEGATION_EXPECTED_JWT = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDp3ZWI6a3lhLnZvdWNoZWQuaWQ6b3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WZvcmUiOjE3MTI5NzU5NDAsIm5vdEFmdGVyIjoxNzEyOTc5NTQwLCJzY29wZXMiOlsibWNwIl0sImF1ZGllbmNlIjoiaHR0cHM6Ly9nYXRld2F5Lmtub3d0aGF0LmFpIn0sInN0YXR1cyI6ImFjdGl2ZSJ9fSwiY3JlZGVudGlhbFN0YXR1cyI6eyJpZCI6Imh0dHBzOi8va3lhLnZvdWNoZWQuaWQvb3Jncy90ZXN0LW9yZy9zdGF0dXMtbGlzdHMvN2YxYzJhOWUtNGIzZC00ZTVmLThhNmItMWMyZDNlNGY1YTZiIzQyIiwidHlwZSI6IlN0YXR1c0xpc3QyMDIxRW50cnkiLCJzdGF0dXNQdXJwb3NlIjoicmV2b2NhdGlvbiIsInN0YXR1c0xpc3RJbmRleCI6IjQyIiwic3RhdHVzTGlzdENyZWRlbnRpYWwiOiJodHRwczovL2t5YS52b3VjaGVkLmlkL29yZ3MvdGVzdC1vcmcvc3RhdHVzLWxpc3RzLzdmMWMyYTllLTRiM2QtNGU1Zi04YTZiLTFjMmQzZTRmNWE2YiJ9fSwib3JnSWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMTAiLCJvcmdTbHVnIjoidGVzdC1vcmciLCJzZXNzaW9uSWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMjAifQ.A8FI0qQPYxOF_Jo7YVoY88Q6n3X8DKfln6Ak_HxpUH089z9HQjX1PKBJjDsFVyO0ma2Yf_2Mgg6wm7TiEav2DA";
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/test-fixtures/fetcher-200-predicate.d.ts
|
|
92
92
|
export type FetcherPredicateDetectionClass = 'human' | 'ai_agent' | 'bot' | 'incomplete_data' | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"mappings":";qBAgEa;WAAA;WAAA;;qBAYA;;;;;qBAYA;;;;;;;;;;qBA+BA;qBAWA;;;;;;;qBAwBA;;;qBC/GA;WAAA;WAAA;;qBAYA;qBASA;qBAGA;qBAGA;qBAGA;qBAIA;qBAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"mappings":";qBAgEa;WAAA;WAAA;;qBAYA;;;;;qBAYA;;;;;;;;;;qBA+BA;qBAWA;;;;;;;qBAwBA;;;qBC/GA;WAAA;WAAA;;qBAYA;qBASA;qBAGA;qBAGA;qBAGA;qBAIA;qBAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0DA;;;;;qBAoBA;;;YCtJD;iBAOK;EAEf;EAEA,SAAS;EAET,gBAAgB;EAQhB;EAEA;;qBAOW,wCAAwC;;;YCMzC;YAEA;iBAEK;EACf,MAAM;;iBAGS;EACf,MAAM;EACN,QAAQ;;wBA2CM,mBAAmB,wBAAwB;wBAY3C,2BAA2B;wBAK3B,uBAAuB,wBAAwB;;;wBCzF/C,uBACd,YAAW;EACT;EACA;EACA;EACA;EACA;;EAJY;EACA;EACJ;EACA;EACK;;qBAkBJ;EAtBG;EACA;EACJ;EACA;EACK;;qBAmCJ"}
|
|
@@ -37,7 +37,7 @@ export declare const MCPI_DELEGATION_ISSUER_DID = "did:web:kya.vouched.id:orgs:t
|
|
|
37
37
|
export declare const MCPI_DELEGATION_ISSUER_KID = "did:web:kya.vouched.id:orgs:test-org#key-1";
|
|
38
38
|
export declare const MCPI_DELEGATION_AGENT_DID = "did:key:z6MkTestAgent123";
|
|
39
39
|
export declare const MCPI_DELEGATION_USER_DID = "did:key:z6MkTestUser456";
|
|
40
|
-
export declare const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/
|
|
40
|
+
export declare const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
41
41
|
export declare const MCPI_DELEGATION_AUDIENCE = "https://gateway.knowthat.ai";
|
|
42
42
|
export declare const MCPI_DELEGATION_CANONICAL_PAYLOAD: {
|
|
43
43
|
readonly iss: "did:web:kya.vouched.id:orgs:test-org";
|
|
@@ -70,11 +70,11 @@ export declare const MCPI_DELEGATION_CANONICAL_PAYLOAD: {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
readonly credentialStatus: {
|
|
73
|
-
readonly id: "https://kya.vouched.id/
|
|
73
|
+
readonly id: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b#42";
|
|
74
74
|
readonly type: "StatusList2021Entry";
|
|
75
75
|
readonly statusPurpose: "revocation";
|
|
76
76
|
readonly statusListIndex: "42";
|
|
77
|
-
readonly statusListCredential: "https://kya.vouched.id/
|
|
77
|
+
readonly statusListCredential: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
readonly orgId: "00000000-0000-0000-0000-000000000010";
|
|
@@ -86,7 +86,7 @@ export declare const MCPI_DELEGATION_EXPECTED_HEADER: {
|
|
|
86
86
|
readonly typ: "JWT";
|
|
87
87
|
readonly kid: "did:web:kya.vouched.id:orgs:test-org#key-1";
|
|
88
88
|
};
|
|
89
|
-
export declare const MCPI_DELEGATION_EXPECTED_JWT = "eyJhbGciOiJFZERTQSIsInR5cCI6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#region src/test-fixtures/fetcher-200-predicate.d.ts
|
|
92
92
|
export type FetcherPredicateDetectionClass = 'human' | 'ai_agent' | 'bot' | 'incomplete_data' | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"mappings":";qBAgEa;WAAA;WAAA;;qBAYA;;;;;qBAYA;;;;;;;;;;qBA+BA;qBAWA;;;;;;;qBAwBA;;;qBC/GA;WAAA;WAAA;;qBAYA;qBASA;qBAGA;qBAGA;qBAGA;qBAIA;qBAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"mappings":";qBAgEa;WAAA;WAAA;;qBAYA;;;;;qBAYA;;;;;;;;;;qBA+BA;qBAWA;;;;;;;qBAwBA;;;qBC/GA;WAAA;WAAA;;qBAYA;qBASA;qBAGA;qBAGA;qBAGA;qBAIA;qBAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0DA;;;;;qBAoBA;;;YCtJD;iBAOK;EAEf;EAEA,SAAS;EAET,gBAAgB;EAQhB;EAEA;;qBAOW,wCAAwC;;;YCMzC;YAEA;iBAEK;EACf,MAAM;;iBAGS;EACf,MAAM;EACN,QAAQ;;wBA2CM,mBAAmB,wBAAwB;wBAY3C,2BAA2B;wBAK3B,uBAAuB,wBAAwB;;;wBCzF/C,uBACd,YAAW;EACT;EACA;EACA;EACA;EACA;;EAJY;EACA;EACJ;EACA;EACK;;qBAkBJ;EAtBG;EACA;EACJ;EACA;EACK;;qBAmCJ"}
|
|
@@ -210,7 +210,7 @@ const MCPI_DELEGATION_AGENT_DID = "did:key:z6MkTestAgent123";
|
|
|
210
210
|
/** DID of the authorizing user. */
|
|
211
211
|
const MCPI_DELEGATION_USER_DID = "did:key:z6MkTestUser456";
|
|
212
212
|
/** StatusList2021 endpoint URL. */
|
|
213
|
-
const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/
|
|
213
|
+
const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
214
214
|
/** Audience claim — the gateway's HTTPS origin. */
|
|
215
215
|
const MCPI_DELEGATION_AUDIENCE = "https://gateway.knowthat.ai";
|
|
216
216
|
/**
|
|
@@ -249,11 +249,11 @@ const MCPI_DELEGATION_CANONICAL_PAYLOAD = {
|
|
|
249
249
|
}
|
|
250
250
|
},
|
|
251
251
|
credentialStatus: {
|
|
252
|
-
id: "https://kya.vouched.id/
|
|
252
|
+
id: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b#42",
|
|
253
253
|
type: "StatusList2021Entry",
|
|
254
254
|
statusPurpose: "revocation",
|
|
255
255
|
statusListIndex: "42",
|
|
256
|
-
statusListCredential: "https://kya.vouched.id/
|
|
256
|
+
statusListCredential: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b"
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
orgId: "00000000-0000-0000-0000-000000000010",
|
|
@@ -275,7 +275,7 @@ const MCPI_DELEGATION_EXPECTED_HEADER = {
|
|
|
275
275
|
*
|
|
276
276
|
* Size: ~1.8KB — well within the 8KB HTTP header budget.
|
|
277
277
|
*/
|
|
278
|
-
const MCPI_DELEGATION_EXPECTED_J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
|
279
279
|
|
|
280
280
|
//#endregion
|
|
281
281
|
//#region src/test-fixtures/fetcher-200-predicate.ts
|
|
@@ -209,7 +209,7 @@ const MCPI_DELEGATION_AGENT_DID = "did:key:z6MkTestAgent123";
|
|
|
209
209
|
/** DID of the authorizing user. */
|
|
210
210
|
const MCPI_DELEGATION_USER_DID = "did:key:z6MkTestUser456";
|
|
211
211
|
/** StatusList2021 endpoint URL. */
|
|
212
|
-
const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/
|
|
212
|
+
const MCPI_DELEGATION_STATUS_LIST_URL = "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b";
|
|
213
213
|
/** Audience claim — the gateway's HTTPS origin. */
|
|
214
214
|
const MCPI_DELEGATION_AUDIENCE = "https://gateway.knowthat.ai";
|
|
215
215
|
/**
|
|
@@ -248,11 +248,11 @@ const MCPI_DELEGATION_CANONICAL_PAYLOAD = {
|
|
|
248
248
|
}
|
|
249
249
|
},
|
|
250
250
|
credentialStatus: {
|
|
251
|
-
id: "https://kya.vouched.id/
|
|
251
|
+
id: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b#42",
|
|
252
252
|
type: "StatusList2021Entry",
|
|
253
253
|
statusPurpose: "revocation",
|
|
254
254
|
statusListIndex: "42",
|
|
255
|
-
statusListCredential: "https://kya.vouched.id/
|
|
255
|
+
statusListCredential: "https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b"
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
258
|
orgId: "00000000-0000-0000-0000-000000000010",
|
|
@@ -274,7 +274,7 @@ const MCPI_DELEGATION_EXPECTED_HEADER = {
|
|
|
274
274
|
*
|
|
275
275
|
* Size: ~1.8KB — well within the 8KB HTTP header budget.
|
|
276
276
|
*/
|
|
277
|
-
const MCPI_DELEGATION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iEav2DA";
|
|
278
278
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/test-fixtures/fetcher-200-predicate.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"sourcesContent":["/**\n * Shared test fixture for the #1532 gateway ↔ vault wire contract.\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** This file is exposed only via\n * the `@kya-os/checkpoint-shared/test-fixtures` subpath export so\n * production bundles that import from the root package entry point\n * can't reach it — the tree-shaker has no path to these symbols unless\n * a caller explicitly imports from the test-fixtures subpath.\n *\n * ## Purpose\n *\n * #1532 spans two services that must agree byte-for-byte on:\n *\n * 1. The shape of the JWT assertion the gateway signs\n * 2. The HTTP request body the gateway POSTs to the vault endpoint\n * 3. The claims the vault endpoint extracts after verifying the JWT\n *\n * This fixture pins a known-good input/output pair that both sides'\n * unit tests import. If either side's implementation drifts from the\n * contract (wrong field order, wrong base64url encoding, wrong key\n * derivation, etc), the test against this fixture fails loudly without\n * requiring a live end-to-end test.\n *\n * The fixture values below were generated ONCE by running the gateway\n * side's `signAssertion` function against a deterministic seed + the\n * canonical claims. Ed25519 is deterministic per RFC 8032 §5.1.6, so\n * the same inputs ALWAYS produce the same signature — which is what\n * lets us commit `expectedJwt` as a string literal and assert equality\n * across both sides' test runs.\n *\n * ## Test keypair (NOT PRODUCTION)\n *\n * The private key below is 32 bytes of `0x01` — the simplest possible\n * deterministic seed. It is NOT a real private key and must NEVER be\n * used to sign any real vault assertion. Its only purpose is to produce\n * reproducible fixture bytes that both engineers can check against.\n *\n * The corresponding public key was derived via Node's\n * `createPublicKey(privateKey)` and is included here for Engineer 2's\n * vault-side verification tests — vault tests don't need to reconstruct\n * the private half, only to verify signatures against this public key.\n *\n * ## Claim fixture\n *\n * The `canonicalPayload` matches the wire contract §2.2 sample verbatim:\n * eight claims in the exact order `iss, projectId, userDid, toolName,\n * sessionId, nonce, iat, exp`. Field order is load-bearing because\n * `JSON.stringify` preserves insertion order in V8 and the resulting\n * byte sequence is what Ed25519 signs over — reordering would produce\n * a different signature, breaking cross-service determinism.\n *\n * The `iat`/`exp` timestamps are frozen at `1712975940` / `1712976000`\n * (60-second window ending 2024-04-13T01:20:00Z-ish). Tests that run\n * against this fixture must either (a) not validate `exp` against wall\n * clock time, or (b) use `vi.useFakeTimers({ now: 1712975940000 })` to\n * freeze the clock inside the fixture window.\n */\n\n/**\n * Test keypair for the wire-contract fixture. Ed25519 private seed is\n * 32 bytes of `0x01`; public key is derived from it.\n *\n * **DO NOT USE IN PRODUCTION.**\n */\nexport const VAULT_WIRE_CONTRACT_TEST_KEYPAIR = {\n /** 32 bytes of 0x01, base64-encoded. Load into the signer via `loadSigningKey`. */\n privateKeyBase64: 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=',\n /** Raw 32-byte Ed25519 public key derived from the private seed, base64-encoded. */\n publicKeyBase64: 'iojj3XQJ8ZX9UtstPLpdcspnCb8dlBIb83SIAbQPb1w=',\n} as const;\n\n/**\n * The canonical JWT header both sides expect. Wire contract §2.1:\n * `alg` is `EdDSA` (NOT `Ed25519` — common mistake), `typ` is `JWT`,\n * `crv` is included for disambiguation per RFC 8037 §3.1.\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_HEADER = {\n alg: 'EdDSA',\n typ: 'JWT',\n crv: 'Ed25519',\n} as const;\n\n/**\n * The canonical payload both sides assert against. Wire contract §2.2\n * order is load-bearing — rearranging these fields will produce a\n * different `expectedJwt` because `JSON.stringify` preserves insertion\n * order.\n */\nexport const VAULT_WIRE_CONTRACT_CANONICAL_PAYLOAD = {\n iss: 'did:web:gateway.knowthat.ai',\n projectId: '00000000-0000-0000-0000-000000000001',\n userDid: 'alice@example.test',\n toolName: 'create_issue',\n sessionId: 'gateway-oauth-test-sess-01',\n nonce: '0123456789abcdef',\n iat: 1712975940,\n exp: 1712976000,\n} as const;\n\n/**\n * The deterministic JWT produced by signing\n * {@link VAULT_WIRE_CONTRACT_CANONICAL_PAYLOAD} with the private half of\n * {@link VAULT_WIRE_CONTRACT_TEST_KEYPAIR}, via the gateway-side\n * `signAssertion` helper.\n *\n * Generated ONCE by running:\n *\n * ```\n * pnpm --filter @kya-os/checkpoint-gateway exec tsx -e \"...\"\n * ```\n *\n * and committed as a string literal. DO NOT regenerate this value\n * without understanding that both sides of the contract will need to\n * re-validate. If your implementation produces a different JWT for the\n * same canonical inputs, the bug is in YOUR code, not the fixture.\n *\n * Ed25519's deterministic signing property (RFC 8032 §5.1.6) is what\n * makes this string stable across runs, machines, and invocations.\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_JWT =\n 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImNydiI6IkVkMjU1MTkifQ.eyJpc3MiOiJkaWQ6d2ViOmdhdGV3YXkua25vd3RoYXQuYWkiLCJwcm9qZWN0SWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDEiLCJ1c2VyRGlkIjoiYWxpY2VAZXhhbXBsZS50ZXN0IiwidG9vbE5hbWUiOiJjcmVhdGVfaXNzdWUiLCJzZXNzaW9uSWQiOiJnYXRld2F5LW9hdXRoLXRlc3Qtc2Vzcy0wMSIsIm5vbmNlIjoiMDEyMzQ1Njc4OWFiY2RlZiIsImlhdCI6MTcxMjk3NTk0MCwiZXhwIjoxNzEyOTc2MDAwfQ.i-7vlvhLiohx6Qg0pXjfmllaDoZ_Fiu8KYW7vovHlQOPw9gsDrOECtM5qymv8bTf__hZKQeU8PyxBHtDusTDAg';\n\n/**\n * The expected HTTP request body the gateway sends to the vault\n * endpoint for the canonical payload. Wire contract §2.4 — all 5\n * fields are required, `assertion` is the full JWT from\n * {@link VAULT_WIRE_CONTRACT_EXPECTED_JWT}, and `userDid` MUST match\n * the assertion's `userDid` claim (the vault side rejects mismatches\n * with a 403).\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_REQUEST_BODY = {\n userDid: 'alice@example.test',\n envVarNames: ['GITHUB_TOKEN'],\n toolName: 'create_issue',\n sessionId: 'gateway-oauth-test-sess-01',\n assertion: VAULT_WIRE_CONTRACT_EXPECTED_JWT,\n} as const;\n\n/**\n * The canonical vault endpoint URL path for the fixture's projectId.\n * Both sides use this to verify their URL construction logic. Base URL\n * is NOT included — this is the path portion only.\n *\n * Path note: the gateway's vault endpoint lives under\n * `/api/v1/gateway/vault/...`, NOT `/api/v1/vault/...`. The unprefixed\n * `/api/v1/vault/{projectId}/resolve` path is owned by the #1299\n * (VAULT-5) KYA-OS worker flow, which uses `X-API-Key` auth and is\n * architecturally incompatible with #1532's Ed25519-only model per\n * #1542 Decision 1 = B. The gateway gets its own parallel namespace\n * under `/api/v1/gateway/vault/*` so the two flows can coexist\n * without the KYA-OS handler needing auth-branching logic.\n *\n * See the corrected wire contract §2.4 on issue #1532.\n */\nexport const VAULT_WIRE_CONTRACT_URL_PATH =\n '/api/v1/gateway/vault/00000000-0000-0000-0000-000000000001/resolve';\n","/**\n * Shared test fixture for #1531 gateway OAuth ↔ KYA-OS delegation credential contract.\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** Exposed only via the\n * `@kya-os/checkpoint-shared/test-fixtures` subpath export.\n *\n * ## Purpose\n *\n * #1531 spans two services that must agree on the VC-JWT wire format:\n *\n * 1. Engineer 2's authorization server (Vercel) — issues the VC-JWT\n * 2. Engineer 1's gateway resolver (Fly) — verifies the VC-JWT\n *\n * This fixture pins a known-good VC-JWT that both sides' tests import.\n * If either side drifts from the contract, the test against this fixture\n * fails loudly.\n *\n * ## Test keypair (NOT PRODUCTION)\n *\n * Reuses the #1532 convention: private key is 32 bytes of `0x01`.\n * Ed25519 is deterministic (RFC 8032 §5.1.6), so same inputs always\n * produce the same signature — which is what makes the expected JWT\n * string stable across runs.\n *\n * ## VC-JWT structure\n *\n * The JWT follows the KYA-OS §6.2 DelegationCredential as W3C VC pattern:\n * - Header: { alg: \"EdDSA\", typ: \"JWT\", kid: \"<issuer-key-id>\" }\n * - Payload: { iss, sub, aud, iat, exp, vc: { ... W3C VC ... }, orgId, orgSlug, sessionId }\n * - vc.credentialSubject.delegation contains the KYA-OS delegation record\n * - vc.credentialStatus contains StatusList2021 revocation reference\n *\n * ## Clock note\n *\n * Timestamps are frozen at iat=1712975940 (April 2024). Tests that validate\n * expiry must use vi.useFakeTimers({ now: 1712975940000 }).\n */\n\n// ---------------------------------------------------------------------------\n// Test keypair (32 bytes of 0x01 — same convention as #1532 vault fixture)\n// ---------------------------------------------------------------------------\n\n/** Ed25519 test keypair. DO NOT USE IN PRODUCTION. */\nexport const MCPI_DELEGATION_TEST_KEYPAIR = {\n /** 32 bytes of 0x01, base64-encoded. */\n privateKeyBase64: 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=',\n /** Raw 32-byte Ed25519 public key derived from the private seed, base64-encoded. */\n publicKeyBase64: 'iojj3XQJ8ZX9UtstPLpdcspnCb8dlBIb83SIAbQPb1w=',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Canonical constants\n// ---------------------------------------------------------------------------\n\n/** DID of the org issuer (signs the VC-JWT). */\nexport const MCPI_DELEGATION_ISSUER_DID = 'did:web:kya.vouched.id:orgs:test-org';\n\n/**\n * Key ID of the OAuth signing key in the DID document.\n *\n * DR-1 / E1-P1 moved delegation issuance from the gateway operational DID\n * to per-org issuer DIDs. The verifier resolves the org DID document and\n * looks up that org's `#key-1` method.\n */\nexport const MCPI_DELEGATION_ISSUER_KID = 'did:web:kya.vouched.id:orgs:test-org#key-1';\n\n/** DID of the test MCP client (agent). */\nexport const MCPI_DELEGATION_AGENT_DID = 'did:key:z6MkTestAgent123';\n\n/** DID of the authorizing user. */\nexport const MCPI_DELEGATION_USER_DID = 'did:key:z6MkTestUser456';\n\n/** StatusList2021 endpoint URL. */\nexport const MCPI_DELEGATION_STATUS_LIST_URL =\n 'https://kya.vouched.id/api/v1/gateway/oauth/status-list';\n\n/** Audience claim — the gateway's HTTPS origin. */\nexport const MCPI_DELEGATION_AUDIENCE = 'https://gateway.knowthat.ai';\n\n// ---------------------------------------------------------------------------\n// Canonical payload (decoded JWT claims)\n// ---------------------------------------------------------------------------\n\n/**\n * The canonical JWT payload. Field order is load-bearing because\n * JSON.stringify preserves insertion order and Ed25519 signs over\n * the resulting bytes.\n */\nexport const MCPI_DELEGATION_CANONICAL_PAYLOAD = {\n iss: 'did:web:kya.vouched.id:orgs:test-org',\n sub: 'did:key:z6MkTestAgent123',\n aud: 'https://gateway.knowthat.ai',\n iat: 1712975940,\n exp: 1712979540,\n vc: {\n // Pinned to the legacy `modelcontextprotocol-identity.io` host ON PURPOSE.\n // This array is signed over by MCPI_DELEGATION_EXPECTED_JWT (below) and must\n // byte-match it, and it must agree with the counterparty's pinned context in\n // xmcp-i (`packages/contracts/src/delegation/schemas.ts`). The live minter's\n // host migration (`vc-jwt.service.ts` → `schema.kya-os.org`) deliberately does\n // NOT move this vector — that requires re-signing both sides of the #1531\n // contract in lockstep. Do not \"fix\" this URL without regenerating the JWT.\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://schema.modelcontextprotocol-identity.io/xmcp-i/credentials/delegation.v1.0.0.json',\n ],\n type: ['VerifiableCredential', 'DelegationCredential'],\n issuer: 'did:web:kya.vouched.id:orgs:test-org',\n issuanceDate: '2024-04-13T02:39:00.000Z',\n expirationDate: '2024-04-13T03:39:00.000Z',\n credentialSubject: {\n id: 'did:key:z6MkTestAgent123',\n delegation: {\n id: 'del-test-001',\n issuerDid: 'did:web:kya.vouched.id:orgs:test-org',\n subjectDid: 'did:key:z6MkTestAgent123',\n userDid: 'did:key:z6MkTestUser456',\n userIdentifier: 'alice@vouched.id',\n scopes: ['mcp'],\n constraints: {\n notBefore: 1712975940,\n notAfter: 1712979540,\n scopes: ['mcp'],\n audience: 'https://gateway.knowthat.ai',\n },\n status: 'active',\n },\n },\n credentialStatus: {\n id: 'https://kya.vouched.id/api/v1/gateway/oauth/status-list#42',\n type: 'StatusList2021Entry',\n statusPurpose: 'revocation',\n statusListIndex: '42',\n statusListCredential: 'https://kya.vouched.id/api/v1/gateway/oauth/status-list',\n },\n },\n orgId: '00000000-0000-0000-0000-000000000010',\n orgSlug: 'test-org',\n sessionId: '00000000-0000-0000-0000-000000000020',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Canonical header\n// ---------------------------------------------------------------------------\n\nexport const MCPI_DELEGATION_EXPECTED_HEADER = {\n alg: 'EdDSA',\n typ: 'JWT',\n kid: 'did:web:kya.vouched.id:orgs:test-org#key-1',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Expected VC-JWT (deterministic — Ed25519 + frozen claims)\n// ---------------------------------------------------------------------------\n\n/**\n * The deterministic VC-JWT produced by signing\n * {@link MCPI_DELEGATION_CANONICAL_PAYLOAD} with the private half of\n * {@link MCPI_DELEGATION_TEST_KEYPAIR}.\n *\n * Generated ONCE. DO NOT regenerate without understanding that both\n * sides of the #1531 contract will need to re-validate.\n *\n * Size: ~1.8KB — well within the 8KB HTTP header budget.\n */\nexport const MCPI_DELEGATION_EXPECTED_JWT =\n 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDp3ZWI6a3lhLnZvdWNoZWQuaWQ6b3Jnczp0ZXN0LW9yZyNrZXktMSJ9.eyJpc3MiOiJkaWQ6d2ViOmt5YS52b3VjaGVkLmlkOm9yZ3M6dGVzdC1vcmciLCJzdWIiOiJkaWQ6a2V5Ono2TWtUZXN0QWdlbnQxMjMiLCJhdWQiOiJodHRwczovL2dhdGV3YXkua25vd3RoYXQuYWkiLCJpYXQiOjE3MTI5NzU5NDAsImV4cCI6MTcxMjk3OTU0MCwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzM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jNDIiLCJ0eXBlIjoiU3RhdHVzTGlzdDIwMjFFbnRyeSIsInN0YXR1c1B1cnBvc2UiOiJyZXZvY2F0aW9uIiwic3RhdHVzTGlzdEluZGV4IjoiNDIiLCJzdGF0dXNMaXN0Q3JlZGVudGlhbCI6Imh0dHBzOi8va3lhLnZvdWNoZWQuaWQvYXBpL3YxL2dhdGV3YXkvb2F1dGgvc3RhdHVzLWxpc3QifX0sIm9yZ0lkIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDEwIiwib3JnU2x1ZyI6InRlc3Qtb3JnIiwic2Vzc2lvbklkIjoiMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDIwIn0.KEF-cDuLUb-OTJHAXhK2A7VGWpGzdIRY0v4jK-0OXoPqKEadPOHAw1EaEl2V_1NeGyw69V3CRtKug_gx9ZIUBA';\n","/**\n * Shared selection-predicate vectors for the §8.1 fetcher-200 dual envelope.\n *\n * The `kya-http/challenge.delegation.fetcher-200.json` fixture freezes the\n * envelope BYTES; these vectors freeze the SELECTION — the decision of WHICH\n * envelope (body-readable 200 vs spec 401/422) a `negotiated`-mode PEP serves\n * for a given request. Because every PEP re-implements its own wiring (TS\n * shared impl here, plus .NET and the gateway worker), a single shared vector\n * set is the only thing that keeps the choice from drifting across them.\n *\n * The canonical TS predicate is `serveBodyReadable200` (host-adapter). Every\n * PEP MUST agree with these vectors. Selection is a cooperative-UX bridge,\n * NOT an access control: a non-cooperative caller simply gets the spec 401.\n */\n\n/** Detection class in its wire form, or `null` when detection is absent. */\nexport type FetcherPredicateDetectionClass =\n | 'human'\n | 'ai_agent'\n | 'bot'\n | 'incomplete_data'\n | null;\n\nexport interface FetcherEnvelopePredicateVector {\n /** Human-readable description of the case. */\n description: string;\n /** Request headers (lowercase keys), e.g. the `kya-accept-challenge` opt-in. */\n headers: Record<string, string>;\n /** The caller's detection class (wire form), or `null` if absent. */\n detectionClass: FetcherPredicateDetectionClass;\n /**\n * The engine's `isAgent` verdict for the caller. The transitional UA heuristic\n * fires ONLY when `isAgent` AND `detectionClass === 'ai_agent'` agree — matching\n * .NET `IsInteractiveAiAgent` (`IsAgent && DetectionClass.Type == AiAgent`) and the\n * gateway worker. A class/`isAgent` disagreement is treated as non-cooperative\n * (spec 401), so an `ai_agent` class with `isAgent: false` does NOT get the 200.\n */\n isAgent: boolean;\n /** Expected predicate result: `true` → body-readable 200; `false` → spec 401/422. */\n expected: boolean;\n}\n\n/**\n * The frozen cross-PEP predicate vectors. Keep additions semantic (a new\n * distinct case), never a re-statement of an existing one.\n */\nexport const FETCHER_200_PREDICATE_VECTORS: readonly FetcherEnvelopePredicateVector[] = [\n {\n description: 'opt-in header present, non-agent detection → 200 (header is the primary signal)',\n headers: { 'kya-accept-challenge': 'delegation' },\n detectionClass: 'human',\n isAgent: false,\n expected: true,\n },\n {\n description: 'opt-in header present, detection absent → 200',\n headers: { 'kya-accept-challenge': 'delegation' },\n detectionClass: null,\n isAgent: false,\n expected: true,\n },\n {\n description: 'detected ai_agent (isAgent agrees), no opt-in → 200 (transitional UA heuristic)',\n headers: {},\n detectionClass: 'ai_agent',\n isAgent: true,\n expected: true,\n },\n {\n description: 'Accept: text/html on a detected agent → 200 (Accept MUST NOT branch the body)',\n headers: { accept: 'text/markdown, text/html, */*' },\n detectionClass: 'ai_agent',\n isAgent: true,\n expected: true,\n },\n {\n description:\n 'ai_agent class but isAgent=false (signals disagree) → 401 (require both, matches .NET + worker)',\n headers: {},\n detectionClass: 'ai_agent',\n isAgent: false,\n expected: false,\n },\n {\n description: 'human, no opt-in → 401 (spec path)',\n headers: {},\n detectionClass: 'human',\n isAgent: false,\n expected: false,\n },\n {\n description: 'bot, no opt-in → 401 (non-cooperative / spoofer lands on spec path)',\n headers: {},\n detectionClass: 'bot',\n isAgent: false,\n expected: false,\n },\n {\n description: 'incomplete_data, no opt-in → 401',\n headers: {},\n detectionClass: 'incomplete_data',\n isAgent: false,\n expected: false,\n },\n {\n description: 'no signals at all → 401',\n headers: {},\n detectionClass: null,\n isAgent: false,\n expected: false,\n },\n {\n description: 'empty opt-in value is ignored, human → 401',\n headers: { 'kya-accept-challenge': '' },\n detectionClass: 'human',\n isAgent: false,\n expected: false,\n },\n];\n","/**\n * Common delegation-verdict shape (verifier/engine unification series).\n *\n * The `delegation` cross-runtime-parity track\n * (`tests/cross-runtime-parity/delegation/`) checks multiple independent\n * delegation-verify implementations — the Fly gateway (`apps/gateway/src/lib/\n * mcpi-auth-resolver.ts` + `dashboard-delegation-verifier.ts`, both engine-\n * backed as of PR6/PR7) and `rust/crates/kya-os-engine`'s `verify_delegation`\n * — against one canonical vector set. Every emitter normalizes its runtime's\n * result to this shape before writing `runtime-outputs/<name>.json`. Lives\n * under the package's main entrypoint (not `test-fixtures`) because the\n * parity-harness test imports it as production infrastructure;\n * `test-fixtures/delegation-verdict.ts` re-exports it for the existing\n * parity-harness imports.\n *\n * Deliberately verdict-only (`kind` + coarse `reason.kind`), not the full\n * delegation record: the gateway's audit extractions (`delegationId`,\n * `clientDid`, `orgId`, `accountableAdminDid`) are deterministic claim reads,\n * not verification decisions, so they don't belong in a cross-implementation\n * agreement check — their correctness is covered by the gateway's own unit\n * tests (`mcpi-auth-resolver.test.ts`, `dashboard-delegation-verifier.test.ts`),\n * which is their natural home. Keeping this shape to exactly what\n * `scripts/assert-cross-runtime-parity.ts` already matches on (`kind`,\n * `reason.kind`, `reason.kindStartsWith`, `oneOf`) means that script needs no\n * per-track special-casing.\n *\n * `reason.kind` is deliberately coarse — a structural reason CLASS, not a\n * fine-grained cause. Each runtime's native vocabulary is many-to-one mapped\n * onto this fixed set via `toCoarseReasonKind`:\n *\n * - `signature` — bad/absent cryptographic signature\n * - `claim` — any issuer / audience / subject / orgId / other claim or\n * authorization mismatch (including \"no identity material\n * presented at all\")\n * - `time` — expired OR not-yet-valid\n * - `revocation` — revoked, or status-unavailable (fail-closed)\n * - `scope` — delegation doesn't grant the requested scope\n * - `resolve` — DID / context could not be resolved\n *\n * This is the coarsest granularity both the gateway (whose own top-level\n * verifier already folds iss/aud/orgId/sub into one `claim_invalid` /\n * `claim_mismatch`) and the engine (whose `BlockReason` has no\n * audience/issuer/not-yet-valid-specific variants) can already express\n * without changing either side's production reason taxonomy. Fine-grained\n * reason parity is an observability nice-to-have, not a security property —\n * the gate's job is to catch security-relevant WHY-drift (a different\n * structural reason class, or accept-vs-reject), not whether both sides spell\n * a claim rejection the same way. If per-cause parity is ever wanted, extend\n * each runtime's own reason vocabulary deliberately on its own timeline —\n * never bundle it with this track's blocking gate.\n */\n\nexport type DelegationVerdictKind = 'Permit' | 'Block';\n\nexport type CoarseReasonKind = 'signature' | 'claim' | 'time' | 'revocation' | 'scope' | 'resolve';\n\nexport interface DelegationVerdictReason {\n kind: CoarseReasonKind;\n}\n\nexport interface DelegationVerdict {\n kind: DelegationVerdictKind;\n reason: DelegationVerdictReason | null;\n}\n\n/**\n * Every raw reason discriminator either runtime can natively emit for the\n * delegation path, mapped onto the coarse taxonomy above.\n *\n * Gateway (`McpiAuthErrorReason` in `mcpi-auth-resolver.ts`,\n * `DashboardVerifyFailure['reason']` in `dashboard-delegation-verifier.ts`):\n * snake_case. Engine (`BlockReason` in `rust/crates/kya-os-engine/src/types.rs`):\n * PascalCase variant names. Unrecognized input is a harness bug (an emitter\n * started producing a reason string neither side has ever emitted before) —\n * `toCoarseReasonKind` throws rather than silently defaulting, so a new raw\n * reason gets a deliberate classification instead of landing in the wrong\n * bucket unnoticed.\n */\nconst REASON_KIND_MAP: Record<string, CoarseReasonKind> = {\n // --- gateway: apps/gateway/src/lib/mcpi-auth-resolver.ts ---\n missing_bearer_token: 'claim',\n parse_error: 'claim',\n did_resolve_failed: 'resolve',\n signature_invalid: 'signature',\n audience_mismatch: 'claim',\n expired: 'time',\n not_yet_valid: 'time',\n revoked: 'revocation',\n delegation_inactive: 'revocation',\n missing_claim: 'claim',\n claim_invalid: 'claim',\n // --- gateway: apps/gateway/src/lib/dashboard-delegation-verifier.ts ---\n not_configured: 'claim',\n header_missing: 'claim',\n claim_mismatch: 'claim',\n malformed: 'claim',\n // --- engine-rust: rust/crates/kya-os-engine/src/types.rs BlockReason ---\n Revoked: 'revocation',\n InvalidSignature: 'signature',\n Unauthenticated: 'claim',\n Expired: 'time',\n OutOfScope: 'scope',\n};\n\n/** Map a runtime's native reason discriminator onto the coarse taxonomy. */\nexport function toCoarseReasonKind(rawReasonKind: string): CoarseReasonKind {\n const coarse = REASON_KIND_MAP[rawReasonKind];\n if (!coarse) {\n throw new Error(\n `toCoarseReasonKind: unrecognized raw reason kind ${JSON.stringify(rawReasonKind)} — ` +\n `add it to REASON_KIND_MAP in delegation-verdict.ts with a deliberate coarse classification`\n );\n }\n return coarse;\n}\n\n/** Build a `Permit` verdict. */\nexport function permitDelegationVerdict(): DelegationVerdict {\n return { kind: 'Permit', reason: null };\n}\n\n/** Build a `Block` verdict from a runtime-native reason discriminator. */\nexport function blockDelegationVerdict(rawReasonKind: string): DelegationVerdict {\n return { kind: 'Block', reason: { kind: toCoarseReasonKind(rawReasonKind) } };\n}\n","/**\n * Shared test fixture for P20 verdict-evidence tests (`buildVerdictEvidence`,\n * `reconstructConfidenceFromEvidence` — see `../core/verdict-evidence.ts`).\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** Exposed only via the\n * `@kya-os/checkpoint-shared/test-fixtures` subpath export.\n *\n * ## Purpose\n *\n * Four independent test suites each need \"one signal, minimal defaults\" and\n * \"two independent signals whose Noisy-Or reconstruction is a known,\n * hand-verified number\" — checkpoint-shared's own unit tests, the\n * enforcement-metadata envelope tests, the activity-log read-side tests, and\n * the pixel-route persistence test. Before this fixture existed, all four\n * hardcoded the SAME two fixtures and the SAME derivation comment\n * independently — a change to one could silently drift from the others.\n * This is the one place that number is computed; every test imports it\n * rather than re-deriving it.\n *\n * ## The known reconstruction\n *\n * `TWO_SIGNAL_EVIDENCE_FIXTURE`'s Noisy-Or confidence, by hand — INCLUDING\n * the `UNCALIBRATED_NOISY_OR_PRIOR` (0.10) leak term every live verdict\n * folds in (bestbrian, PR #4747 review — the earlier version of this\n * fixture omitted it and asserted the wrong number, 94.2):\n *\n * 1 - (1 - 0.10) * (1 - 1.0*0.9) * (1 - 0.6*0.7)\n * = 1 - 0.9 * 0.1 * 0.58\n * = 1 - 0.0522\n * = 0.9478 -> 94.78 (0-100 scale)\n */\n\n/** A minimal, valid `DetectionSignal`-shaped wire object with sane defaults. */\nexport function detectionSignalFixture(\n overrides: Partial<{\n signalType: 'signature' | 'pattern' | 'behavioral' | 'network' | 'fingerprint';\n confidence: number;\n weight: number;\n source: string;\n explanation: string;\n }> = {}\n) {\n return {\n signalType: 'pattern' as const,\n confidence: 80,\n weight: 0.4,\n source: 'tier3_ua_pattern',\n explanation: 'Matches a known agent UA pattern',\n ...overrides,\n };\n}\n\n/**\n * Two independent signals (a pattern match at weight 1.0/confidence 90, a\n * network match at weight 0.6/confidence 70) whose combined Noisy-Or\n * confidence is the hand-verified 94.78 — see the module doc above.\n */\nexport const TWO_SIGNAL_EVIDENCE_FIXTURE = [\n detectionSignalFixture({\n source: 'known_scraper_ua',\n signalType: 'pattern',\n weight: 1.0,\n confidence: 90,\n }),\n detectionSignalFixture({\n source: 'datacenter_ip',\n signalType: 'network',\n weight: 0.6,\n confidence: 70,\n }),\n];\n\n/** The confidence (0-100 scale) `TWO_SIGNAL_EVIDENCE_FIXTURE` reconstructs to,\n * including the Noisy-Or prior — see the module doc above. */\nexport const TWO_SIGNAL_EVIDENCE_EXPECTED_CONFIDENCE = 94.78;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,mCAAmC;;CAE9C,kBAAkB;;CAElB,iBAAiB;AACnB;;;;;;AAOA,MAAa,sCAAsC;CACjD,KAAK;CACL,KAAK;CACL,KAAK;AACP;;;;;;;AAQA,MAAa,wCAAwC;CACnD,KAAK;CACL,WAAW;CAC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AAO;EAAE,MAAM;EAAU,QAAQ;CAAK;AACxC;;AAGA,SAAgB,uBAAuB,eAA0C;CAC/E,OAAO;EAAE,MAAM;EAAS,QAAQ,EAAE,MAAM,mBAAmB,aAAa,EAAE;CAAE;AAC9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3FA,SAAgB,uBACd,YAMK,CAAC,GACN;CACA,OAAO;EACL,YAAY;EACZ,YAAY;EACZ,QAAQ;EACR,QAAQ;EACR,aAAa;EACb,GAAG;CACL;AACF;;;;;;AAOA,MAAa,8BAA8B,CACzC,uBAAuB;CACrB,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,YAAY;AACd,CAAC,GACD,uBAAuB;CACrB,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,YAAY;AACd,CAAC,CACH;;;AAIA,MAAa,0CAA0C"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/test-fixtures/vault-wire-contract.ts","../../src/test-fixtures/mcpi-delegation-fixture.ts","../../src/test-fixtures/fetcher-200-predicate.ts","../../src/mcpi/delegation-verdict.ts","../../src/test-fixtures/verdict-evidence-fixture.ts"],"sourcesContent":["/**\n * Shared test fixture for the #1532 gateway ↔ vault wire contract.\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** This file is exposed only via\n * the `@kya-os/checkpoint-shared/test-fixtures` subpath export so\n * production bundles that import from the root package entry point\n * can't reach it — the tree-shaker has no path to these symbols unless\n * a caller explicitly imports from the test-fixtures subpath.\n *\n * ## Purpose\n *\n * #1532 spans two services that must agree byte-for-byte on:\n *\n * 1. The shape of the JWT assertion the gateway signs\n * 2. The HTTP request body the gateway POSTs to the vault endpoint\n * 3. The claims the vault endpoint extracts after verifying the JWT\n *\n * This fixture pins a known-good input/output pair that both sides'\n * unit tests import. If either side's implementation drifts from the\n * contract (wrong field order, wrong base64url encoding, wrong key\n * derivation, etc), the test against this fixture fails loudly without\n * requiring a live end-to-end test.\n *\n * The fixture values below were generated ONCE by running the gateway\n * side's `signAssertion` function against a deterministic seed + the\n * canonical claims. Ed25519 is deterministic per RFC 8032 §5.1.6, so\n * the same inputs ALWAYS produce the same signature — which is what\n * lets us commit `expectedJwt` as a string literal and assert equality\n * across both sides' test runs.\n *\n * ## Test keypair (NOT PRODUCTION)\n *\n * The private key below is 32 bytes of `0x01` — the simplest possible\n * deterministic seed. It is NOT a real private key and must NEVER be\n * used to sign any real vault assertion. Its only purpose is to produce\n * reproducible fixture bytes that both engineers can check against.\n *\n * The corresponding public key was derived via Node's\n * `createPublicKey(privateKey)` and is included here for Engineer 2's\n * vault-side verification tests — vault tests don't need to reconstruct\n * the private half, only to verify signatures against this public key.\n *\n * ## Claim fixture\n *\n * The `canonicalPayload` matches the wire contract §2.2 sample verbatim:\n * eight claims in the exact order `iss, projectId, userDid, toolName,\n * sessionId, nonce, iat, exp`. Field order is load-bearing because\n * `JSON.stringify` preserves insertion order in V8 and the resulting\n * byte sequence is what Ed25519 signs over — reordering would produce\n * a different signature, breaking cross-service determinism.\n *\n * The `iat`/`exp` timestamps are frozen at `1712975940` / `1712976000`\n * (60-second window ending 2024-04-13T01:20:00Z-ish). Tests that run\n * against this fixture must either (a) not validate `exp` against wall\n * clock time, or (b) use `vi.useFakeTimers({ now: 1712975940000 })` to\n * freeze the clock inside the fixture window.\n */\n\n/**\n * Test keypair for the wire-contract fixture. Ed25519 private seed is\n * 32 bytes of `0x01`; public key is derived from it.\n *\n * **DO NOT USE IN PRODUCTION.**\n */\nexport const VAULT_WIRE_CONTRACT_TEST_KEYPAIR = {\n /** 32 bytes of 0x01, base64-encoded. Load into the signer via `loadSigningKey`. */\n privateKeyBase64: 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=',\n /** Raw 32-byte Ed25519 public key derived from the private seed, base64-encoded. */\n publicKeyBase64: 'iojj3XQJ8ZX9UtstPLpdcspnCb8dlBIb83SIAbQPb1w=',\n} as const;\n\n/**\n * The canonical JWT header both sides expect. Wire contract §2.1:\n * `alg` is `EdDSA` (NOT `Ed25519` — common mistake), `typ` is `JWT`,\n * `crv` is included for disambiguation per RFC 8037 §3.1.\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_HEADER = {\n alg: 'EdDSA',\n typ: 'JWT',\n crv: 'Ed25519',\n} as const;\n\n/**\n * The canonical payload both sides assert against. Wire contract §2.2\n * order is load-bearing — rearranging these fields will produce a\n * different `expectedJwt` because `JSON.stringify` preserves insertion\n * order.\n */\nexport const VAULT_WIRE_CONTRACT_CANONICAL_PAYLOAD = {\n iss: 'did:web:gateway.knowthat.ai',\n projectId: '00000000-0000-0000-0000-000000000001',\n userDid: 'alice@example.test',\n toolName: 'create_issue',\n sessionId: 'gateway-oauth-test-sess-01',\n nonce: '0123456789abcdef',\n iat: 1712975940,\n exp: 1712976000,\n} as const;\n\n/**\n * The deterministic JWT produced by signing\n * {@link VAULT_WIRE_CONTRACT_CANONICAL_PAYLOAD} with the private half of\n * {@link VAULT_WIRE_CONTRACT_TEST_KEYPAIR}, via the gateway-side\n * `signAssertion` helper.\n *\n * Generated ONCE by running:\n *\n * ```\n * pnpm --filter @kya-os/checkpoint-gateway exec tsx -e \"...\"\n * ```\n *\n * and committed as a string literal. DO NOT regenerate this value\n * without understanding that both sides of the contract will need to\n * re-validate. If your implementation produces a different JWT for the\n * same canonical inputs, the bug is in YOUR code, not the fixture.\n *\n * Ed25519's deterministic signing property (RFC 8032 §5.1.6) is what\n * makes this string stable across runs, machines, and invocations.\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_JWT =\n 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImNydiI6IkVkMjU1MTkifQ.eyJpc3MiOiJkaWQ6d2ViOmdhdGV3YXkua25vd3RoYXQuYWkiLCJwcm9qZWN0SWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDEiLCJ1c2VyRGlkIjoiYWxpY2VAZXhhbXBsZS50ZXN0IiwidG9vbE5hbWUiOiJjcmVhdGVfaXNzdWUiLCJzZXNzaW9uSWQiOiJnYXRld2F5LW9hdXRoLXRlc3Qtc2Vzcy0wMSIsIm5vbmNlIjoiMDEyMzQ1Njc4OWFiY2RlZiIsImlhdCI6MTcxMjk3NTk0MCwiZXhwIjoxNzEyOTc2MDAwfQ.i-7vlvhLiohx6Qg0pXjfmllaDoZ_Fiu8KYW7vovHlQOPw9gsDrOECtM5qymv8bTf__hZKQeU8PyxBHtDusTDAg';\n\n/**\n * The expected HTTP request body the gateway sends to the vault\n * endpoint for the canonical payload. Wire contract §2.4 — all 5\n * fields are required, `assertion` is the full JWT from\n * {@link VAULT_WIRE_CONTRACT_EXPECTED_JWT}, and `userDid` MUST match\n * the assertion's `userDid` claim (the vault side rejects mismatches\n * with a 403).\n */\nexport const VAULT_WIRE_CONTRACT_EXPECTED_REQUEST_BODY = {\n userDid: 'alice@example.test',\n envVarNames: ['GITHUB_TOKEN'],\n toolName: 'create_issue',\n sessionId: 'gateway-oauth-test-sess-01',\n assertion: VAULT_WIRE_CONTRACT_EXPECTED_JWT,\n} as const;\n\n/**\n * The canonical vault endpoint URL path for the fixture's projectId.\n * Both sides use this to verify their URL construction logic. Base URL\n * is NOT included — this is the path portion only.\n *\n * Path note: the gateway's vault endpoint lives under\n * `/api/v1/gateway/vault/...`, NOT `/api/v1/vault/...`. The unprefixed\n * `/api/v1/vault/{projectId}/resolve` path is owned by the #1299\n * (VAULT-5) KYA-OS worker flow, which uses `X-API-Key` auth and is\n * architecturally incompatible with #1532's Ed25519-only model per\n * #1542 Decision 1 = B. The gateway gets its own parallel namespace\n * under `/api/v1/gateway/vault/*` so the two flows can coexist\n * without the KYA-OS handler needing auth-branching logic.\n *\n * See the corrected wire contract §2.4 on issue #1532.\n */\nexport const VAULT_WIRE_CONTRACT_URL_PATH =\n '/api/v1/gateway/vault/00000000-0000-0000-0000-000000000001/resolve';\n","/**\n * Shared test fixture for #1531 gateway OAuth ↔ KYA-OS delegation credential contract.\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** Exposed only via the\n * `@kya-os/checkpoint-shared/test-fixtures` subpath export.\n *\n * ## Purpose\n *\n * #1531 spans two services that must agree on the VC-JWT wire format:\n *\n * 1. Engineer 2's authorization server (Vercel) — issues the VC-JWT\n * 2. Engineer 1's gateway resolver (Fly) — verifies the VC-JWT\n *\n * This fixture pins a known-good VC-JWT that both sides' tests import.\n * If either side drifts from the contract, the test against this fixture\n * fails loudly.\n *\n * ## Test keypair (NOT PRODUCTION)\n *\n * Reuses the #1532 convention: private key is 32 bytes of `0x01`.\n * Ed25519 is deterministic (RFC 8032 §5.1.6), so same inputs always\n * produce the same signature — which is what makes the expected JWT\n * string stable across runs.\n *\n * ## VC-JWT structure\n *\n * The JWT follows the KYA-OS §6.2 DelegationCredential as W3C VC pattern:\n * - Header: { alg: \"EdDSA\", typ: \"JWT\", kid: \"<issuer-key-id>\" }\n * - Payload: { iss, sub, aud, iat, exp, vc: { ... W3C VC ... }, orgId, orgSlug, sessionId }\n * - vc.credentialSubject.delegation contains the KYA-OS delegation record\n * - vc.credentialStatus contains StatusList2021 revocation reference\n *\n * ## Clock note\n *\n * Timestamps are frozen at iat=1712975940 (April 2024). Tests that validate\n * expiry must use vi.useFakeTimers({ now: 1712975940000 }).\n */\n\n// ---------------------------------------------------------------------------\n// Test keypair (32 bytes of 0x01 — same convention as #1532 vault fixture)\n// ---------------------------------------------------------------------------\n\n/** Ed25519 test keypair. DO NOT USE IN PRODUCTION. */\nexport const MCPI_DELEGATION_TEST_KEYPAIR = {\n /** 32 bytes of 0x01, base64-encoded. */\n privateKeyBase64: 'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=',\n /** Raw 32-byte Ed25519 public key derived from the private seed, base64-encoded. */\n publicKeyBase64: 'iojj3XQJ8ZX9UtstPLpdcspnCb8dlBIb83SIAbQPb1w=',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Canonical constants\n// ---------------------------------------------------------------------------\n\n/** DID of the org issuer (signs the VC-JWT). */\nexport const MCPI_DELEGATION_ISSUER_DID = 'did:web:kya.vouched.id:orgs:test-org';\n\n/**\n * Key ID of the OAuth signing key in the DID document.\n *\n * DR-1 / E1-P1 moved delegation issuance from the gateway operational DID\n * to per-org issuer DIDs. The verifier resolves the org DID document and\n * looks up that org's `#key-1` method.\n */\nexport const MCPI_DELEGATION_ISSUER_KID = 'did:web:kya.vouched.id:orgs:test-org#key-1';\n\n/** DID of the test MCP client (agent). */\nexport const MCPI_DELEGATION_AGENT_DID = 'did:key:z6MkTestAgent123';\n\n/** DID of the authorizing user. */\nexport const MCPI_DELEGATION_USER_DID = 'did:key:z6MkTestUser456';\n\n/** StatusList2021 endpoint URL. */\nexport const MCPI_DELEGATION_STATUS_LIST_URL =\n 'https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b';\n\n/** Audience claim — the gateway's HTTPS origin. */\nexport const MCPI_DELEGATION_AUDIENCE = 'https://gateway.knowthat.ai';\n\n// ---------------------------------------------------------------------------\n// Canonical payload (decoded JWT claims)\n// ---------------------------------------------------------------------------\n\n/**\n * The canonical JWT payload. Field order is load-bearing because\n * JSON.stringify preserves insertion order and Ed25519 signs over\n * the resulting bytes.\n */\nexport const MCPI_DELEGATION_CANONICAL_PAYLOAD = {\n iss: 'did:web:kya.vouched.id:orgs:test-org',\n sub: 'did:key:z6MkTestAgent123',\n aud: 'https://gateway.knowthat.ai',\n iat: 1712975940,\n exp: 1712979540,\n vc: {\n // Pinned to the legacy `modelcontextprotocol-identity.io` host ON PURPOSE.\n // This array is signed over by MCPI_DELEGATION_EXPECTED_JWT (below) and must\n // byte-match it, and it must agree with the counterparty's pinned context in\n // xmcp-i (`packages/contracts/src/delegation/schemas.ts`). The live minter's\n // host migration (`vc-jwt.service.ts` → `schema.kya-os.org`) deliberately does\n // NOT move this vector — that requires re-signing both sides of the #1531\n // contract in lockstep. Do not \"fix\" this URL without regenerating the JWT.\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://schema.modelcontextprotocol-identity.io/xmcp-i/credentials/delegation.v1.0.0.json',\n ],\n type: ['VerifiableCredential', 'DelegationCredential'],\n issuer: 'did:web:kya.vouched.id:orgs:test-org',\n issuanceDate: '2024-04-13T02:39:00.000Z',\n expirationDate: '2024-04-13T03:39:00.000Z',\n credentialSubject: {\n id: 'did:key:z6MkTestAgent123',\n delegation: {\n id: 'del-test-001',\n issuerDid: 'did:web:kya.vouched.id:orgs:test-org',\n subjectDid: 'did:key:z6MkTestAgent123',\n userDid: 'did:key:z6MkTestUser456',\n userIdentifier: 'alice@vouched.id',\n scopes: ['mcp'],\n constraints: {\n notBefore: 1712975940,\n notAfter: 1712979540,\n scopes: ['mcp'],\n audience: 'https://gateway.knowthat.ai',\n },\n status: 'active',\n },\n },\n credentialStatus: {\n id: 'https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b#42',\n type: 'StatusList2021Entry',\n statusPurpose: 'revocation',\n statusListIndex: '42',\n statusListCredential:\n 'https://kya.vouched.id/orgs/test-org/status-lists/7f1c2a9e-4b3d-4e5f-8a6b-1c2d3e4f5a6b',\n },\n },\n orgId: '00000000-0000-0000-0000-000000000010',\n orgSlug: 'test-org',\n sessionId: '00000000-0000-0000-0000-000000000020',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Canonical header\n// ---------------------------------------------------------------------------\n\nexport const MCPI_DELEGATION_EXPECTED_HEADER = {\n alg: 'EdDSA',\n typ: 'JWT',\n kid: 'did:web:kya.vouched.id:orgs:test-org#key-1',\n} as const;\n\n// ---------------------------------------------------------------------------\n// Expected VC-JWT (deterministic — Ed25519 + frozen claims)\n// ---------------------------------------------------------------------------\n\n/**\n * The deterministic VC-JWT produced by signing\n * {@link MCPI_DELEGATION_CANONICAL_PAYLOAD} with the private half of\n * {@link MCPI_DELEGATION_TEST_KEYPAIR}.\n *\n * Generated ONCE. DO NOT regenerate without understanding that both\n * sides of the #1531 contract will need to re-validate.\n *\n * Size: ~1.8KB — well within the 8KB HTTP header budget.\n */\nexport const MCPI_DELEGATION_EXPECTED_JWT =\n 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDp3ZWI6a3lhLnZvdWNoZWQuaWQ6b3Jnczp0ZXN0LW9yZyNrZXktMSJ9.eyJpc3MiOiJkaWQ6d2ViOmt5YS52b3VjaGVkLmlkOm9yZ3M6dGVzdC1vcmciLCJzdWIiOiJkaWQ6a2V5Ono2TWtUZXN0QWdlbnQxMjMiLCJhdWQiOiJodHRwczovL2dhdGV3YXkua25vd3RoYXQuYWkiLCJpYXQiOjE3MTI5NzU5NDAsImV4cCI6MTcxMjk3OTU0MCwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5tb2RlbGNvbnRleHRwcm90b2NvbC1pZGVudGl0eS5pby94bWNwLWkvY3JlZGVudGlhbHMvZGVsZWdhdGlvbi52MS4wLjAuanNvbiJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRGVsZWdhdGlvbkNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOndlYjpreWEudm91Y2hlZC5pZDpvcmdzOnRlc3Qtb3JnIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wNC0xM1QwMjozOTowMC4wMDBaIiwiZXhwaXJhdGlvbkRhdGUiOiIyMDI0LTA0LTEzVDAzOjM5OjAwLjAwMFoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDprZXk6ejZNa1Rlc3RBZ2VudDEyMyIsImRlbGVnYXRpb24iOnsiaWQiOiJkZWwtdGVzdC0wMDEiLCJpc3N1ZXJEaWQiOiJkaWQ6d2ViOmt5YS52b3VjaGVkLmlkOm9yZ3M6dGVzdC1vcmci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 dual envelope.\n *\n * The `kya-http/challenge.delegation.fetcher-200.json` fixture freezes the\n * envelope BYTES; these vectors freeze the SELECTION — the decision of WHICH\n * envelope (body-readable 200 vs spec 401/422) a `negotiated`-mode PEP serves\n * for a given request. Because every PEP re-implements its own wiring (TS\n * shared impl here, plus .NET and the gateway worker), a single shared vector\n * set is the only thing that keeps the choice from drifting across them.\n *\n * The canonical TS predicate is `serveBodyReadable200` (host-adapter). Every\n * PEP MUST agree with these vectors. Selection is a cooperative-UX bridge,\n * NOT an access control: a non-cooperative caller simply gets the spec 401.\n */\n\n/** Detection class in its wire form, or `null` when detection is absent. */\nexport type FetcherPredicateDetectionClass =\n | 'human'\n | 'ai_agent'\n | 'bot'\n | 'incomplete_data'\n | null;\n\nexport interface FetcherEnvelopePredicateVector {\n /** Human-readable description of the case. */\n description: string;\n /** Request headers (lowercase keys), e.g. the `kya-accept-challenge` opt-in. */\n headers: Record<string, string>;\n /** The caller's detection class (wire form), or `null` if absent. */\n detectionClass: FetcherPredicateDetectionClass;\n /**\n * The engine's `isAgent` verdict for the caller. The transitional UA heuristic\n * fires ONLY when `isAgent` AND `detectionClass === 'ai_agent'` agree — matching\n * .NET `IsInteractiveAiAgent` (`IsAgent && DetectionClass.Type == AiAgent`) and the\n * gateway worker. A class/`isAgent` disagreement is treated as non-cooperative\n * (spec 401), so an `ai_agent` class with `isAgent: false` does NOT get the 200.\n */\n isAgent: boolean;\n /** Expected predicate result: `true` → body-readable 200; `false` → spec 401/422. */\n expected: boolean;\n}\n\n/**\n * The frozen cross-PEP predicate vectors. Keep additions semantic (a new\n * distinct case), never a re-statement of an existing one.\n */\nexport const FETCHER_200_PREDICATE_VECTORS: readonly FetcherEnvelopePredicateVector[] = [\n {\n description: 'opt-in header present, non-agent detection → 200 (header is the primary signal)',\n headers: { 'kya-accept-challenge': 'delegation' },\n detectionClass: 'human',\n isAgent: false,\n expected: true,\n },\n {\n description: 'opt-in header present, detection absent → 200',\n headers: { 'kya-accept-challenge': 'delegation' },\n detectionClass: null,\n isAgent: false,\n expected: true,\n },\n {\n description: 'detected ai_agent (isAgent agrees), no opt-in → 200 (transitional UA heuristic)',\n headers: {},\n detectionClass: 'ai_agent',\n isAgent: true,\n expected: true,\n },\n {\n description: 'Accept: text/html on a detected agent → 200 (Accept MUST NOT branch the body)',\n headers: { accept: 'text/markdown, text/html, */*' },\n detectionClass: 'ai_agent',\n isAgent: true,\n expected: true,\n },\n {\n description:\n 'ai_agent class but isAgent=false (signals disagree) → 401 (require both, matches .NET + worker)',\n headers: {},\n detectionClass: 'ai_agent',\n isAgent: false,\n expected: false,\n },\n {\n description: 'human, no opt-in → 401 (spec path)',\n headers: {},\n detectionClass: 'human',\n isAgent: false,\n expected: false,\n },\n {\n description: 'bot, no opt-in → 401 (non-cooperative / spoofer lands on spec path)',\n headers: {},\n detectionClass: 'bot',\n isAgent: false,\n expected: false,\n },\n {\n description: 'incomplete_data, no opt-in → 401',\n headers: {},\n detectionClass: 'incomplete_data',\n isAgent: false,\n expected: false,\n },\n {\n description: 'no signals at all → 401',\n headers: {},\n detectionClass: null,\n isAgent: false,\n expected: false,\n },\n {\n description: 'empty opt-in value is ignored, human → 401',\n headers: { 'kya-accept-challenge': '' },\n detectionClass: 'human',\n isAgent: false,\n expected: false,\n },\n];\n","/**\n * Common delegation-verdict shape (verifier/engine unification series).\n *\n * The `delegation` cross-runtime-parity track\n * (`tests/cross-runtime-parity/delegation/`) checks multiple independent\n * delegation-verify implementations — the Fly gateway (`apps/gateway/src/lib/\n * mcpi-auth-resolver.ts` + `dashboard-delegation-verifier.ts`, both engine-\n * backed as of PR6/PR7) and `rust/crates/kya-os-engine`'s `verify_delegation`\n * — against one canonical vector set. Every emitter normalizes its runtime's\n * result to this shape before writing `runtime-outputs/<name>.json`. Lives\n * under the package's main entrypoint (not `test-fixtures`) because the\n * parity-harness test imports it as production infrastructure;\n * `test-fixtures/delegation-verdict.ts` re-exports it for the existing\n * parity-harness imports.\n *\n * Deliberately verdict-only (`kind` + coarse `reason.kind`), not the full\n * delegation record: the gateway's audit extractions (`delegationId`,\n * `clientDid`, `orgId`, `accountableAdminDid`) are deterministic claim reads,\n * not verification decisions, so they don't belong in a cross-implementation\n * agreement check — their correctness is covered by the gateway's own unit\n * tests (`mcpi-auth-resolver.test.ts`, `dashboard-delegation-verifier.test.ts`),\n * which is their natural home. Keeping this shape to exactly what\n * `scripts/assert-cross-runtime-parity.ts` already matches on (`kind`,\n * `reason.kind`, `reason.kindStartsWith`, `oneOf`) means that script needs no\n * per-track special-casing.\n *\n * `reason.kind` is deliberately coarse — a structural reason CLASS, not a\n * fine-grained cause. Each runtime's native vocabulary is many-to-one mapped\n * onto this fixed set via `toCoarseReasonKind`:\n *\n * - `signature` — bad/absent cryptographic signature\n * - `claim` — any issuer / audience / subject / orgId / other claim or\n * authorization mismatch (including \"no identity material\n * presented at all\")\n * - `time` — expired OR not-yet-valid\n * - `revocation` — revoked, or status-unavailable (fail-closed)\n * - `scope` — delegation doesn't grant the requested scope\n * - `resolve` — DID / context could not be resolved\n *\n * This is the coarsest granularity both the gateway (whose own top-level\n * verifier already folds iss/aud/orgId/sub into one `claim_invalid` /\n * `claim_mismatch`) and the engine (whose `BlockReason` has no\n * audience/issuer/not-yet-valid-specific variants) can already express\n * without changing either side's production reason taxonomy. Fine-grained\n * reason parity is an observability nice-to-have, not a security property —\n * the gate's job is to catch security-relevant WHY-drift (a different\n * structural reason class, or accept-vs-reject), not whether both sides spell\n * a claim rejection the same way. If per-cause parity is ever wanted, extend\n * each runtime's own reason vocabulary deliberately on its own timeline —\n * never bundle it with this track's blocking gate.\n */\n\nexport type DelegationVerdictKind = 'Permit' | 'Block';\n\nexport type CoarseReasonKind = 'signature' | 'claim' | 'time' | 'revocation' | 'scope' | 'resolve';\n\nexport interface DelegationVerdictReason {\n kind: CoarseReasonKind;\n}\n\nexport interface DelegationVerdict {\n kind: DelegationVerdictKind;\n reason: DelegationVerdictReason | null;\n}\n\n/**\n * Every raw reason discriminator either runtime can natively emit for the\n * delegation path, mapped onto the coarse taxonomy above.\n *\n * Gateway (`McpiAuthErrorReason` in `mcpi-auth-resolver.ts`,\n * `DashboardVerifyFailure['reason']` in `dashboard-delegation-verifier.ts`):\n * snake_case. Engine (`BlockReason` in `rust/crates/kya-os-engine/src/types.rs`):\n * PascalCase variant names. Unrecognized input is a harness bug (an emitter\n * started producing a reason string neither side has ever emitted before) —\n * `toCoarseReasonKind` throws rather than silently defaulting, so a new raw\n * reason gets a deliberate classification instead of landing in the wrong\n * bucket unnoticed.\n */\nconst REASON_KIND_MAP: Record<string, CoarseReasonKind> = {\n // --- gateway: apps/gateway/src/lib/mcpi-auth-resolver.ts ---\n missing_bearer_token: 'claim',\n parse_error: 'claim',\n did_resolve_failed: 'resolve',\n signature_invalid: 'signature',\n audience_mismatch: 'claim',\n expired: 'time',\n not_yet_valid: 'time',\n revoked: 'revocation',\n delegation_inactive: 'revocation',\n missing_claim: 'claim',\n claim_invalid: 'claim',\n // --- gateway: apps/gateway/src/lib/dashboard-delegation-verifier.ts ---\n not_configured: 'claim',\n header_missing: 'claim',\n claim_mismatch: 'claim',\n malformed: 'claim',\n // --- engine-rust: rust/crates/kya-os-engine/src/types.rs BlockReason ---\n Revoked: 'revocation',\n InvalidSignature: 'signature',\n Unauthenticated: 'claim',\n Expired: 'time',\n OutOfScope: 'scope',\n};\n\n/** Map a runtime's native reason discriminator onto the coarse taxonomy. */\nexport function toCoarseReasonKind(rawReasonKind: string): CoarseReasonKind {\n const coarse = REASON_KIND_MAP[rawReasonKind];\n if (!coarse) {\n throw new Error(\n `toCoarseReasonKind: unrecognized raw reason kind ${JSON.stringify(rawReasonKind)} — ` +\n `add it to REASON_KIND_MAP in delegation-verdict.ts with a deliberate coarse classification`\n );\n }\n return coarse;\n}\n\n/** Build a `Permit` verdict. */\nexport function permitDelegationVerdict(): DelegationVerdict {\n return { kind: 'Permit', reason: null };\n}\n\n/** Build a `Block` verdict from a runtime-native reason discriminator. */\nexport function blockDelegationVerdict(rawReasonKind: string): DelegationVerdict {\n return { kind: 'Block', reason: { kind: toCoarseReasonKind(rawReasonKind) } };\n}\n","/**\n * Shared test fixture for P20 verdict-evidence tests (`buildVerdictEvidence`,\n * `reconstructConfidenceFromEvidence` — see `../core/verdict-evidence.ts`).\n *\n * **DO NOT IMPORT FROM PRODUCTION CODE.** Exposed only via the\n * `@kya-os/checkpoint-shared/test-fixtures` subpath export.\n *\n * ## Purpose\n *\n * Four independent test suites each need \"one signal, minimal defaults\" and\n * \"two independent signals whose Noisy-Or reconstruction is a known,\n * hand-verified number\" — checkpoint-shared's own unit tests, the\n * enforcement-metadata envelope tests, the activity-log read-side tests, and\n * the pixel-route persistence test. Before this fixture existed, all four\n * hardcoded the SAME two fixtures and the SAME derivation comment\n * independently — a change to one could silently drift from the others.\n * This is the one place that number is computed; every test imports it\n * rather than re-deriving it.\n *\n * ## The known reconstruction\n *\n * `TWO_SIGNAL_EVIDENCE_FIXTURE`'s Noisy-Or confidence, by hand — INCLUDING\n * the `UNCALIBRATED_NOISY_OR_PRIOR` (0.10) leak term every live verdict\n * folds in (bestbrian, PR #4747 review — the earlier version of this\n * fixture omitted it and asserted the wrong number, 94.2):\n *\n * 1 - (1 - 0.10) * (1 - 1.0*0.9) * (1 - 0.6*0.7)\n * = 1 - 0.9 * 0.1 * 0.58\n * = 1 - 0.0522\n * = 0.9478 -> 94.78 (0-100 scale)\n */\n\n/** A minimal, valid `DetectionSignal`-shaped wire object with sane defaults. */\nexport function detectionSignalFixture(\n overrides: Partial<{\n signalType: 'signature' | 'pattern' | 'behavioral' | 'network' | 'fingerprint';\n confidence: number;\n weight: number;\n source: string;\n explanation: string;\n }> = {}\n) {\n return {\n signalType: 'pattern' as const,\n confidence: 80,\n weight: 0.4,\n source: 'tier3_ua_pattern',\n explanation: 'Matches a known agent UA pattern',\n ...overrides,\n };\n}\n\n/**\n * Two independent signals (a pattern match at weight 1.0/confidence 90, a\n * network match at weight 0.6/confidence 70) whose combined Noisy-Or\n * confidence is the hand-verified 94.78 — see the module doc above.\n */\nexport const TWO_SIGNAL_EVIDENCE_FIXTURE = [\n detectionSignalFixture({\n source: 'known_scraper_ua',\n signalType: 'pattern',\n weight: 1.0,\n confidence: 90,\n }),\n detectionSignalFixture({\n source: 'datacenter_ip',\n signalType: 'network',\n weight: 0.6,\n confidence: 70,\n }),\n];\n\n/** The confidence (0-100 scale) `TWO_SIGNAL_EVIDENCE_FIXTURE` reconstructs to,\n * including the Noisy-Or prior — see the module doc above. */\nexport const TWO_SIGNAL_EVIDENCE_EXPECTED_CONFIDENCE = 94.78;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,mCAAmC;;CAE9C,kBAAkB;;CAElB,iBAAiB;AACnB;;;;;;AAOA,MAAa,sCAAsC;CACjD,KAAK;CACL,KAAK;CACL,KAAK;AACP;;;;;;;AAQA,MAAa,wCAAwC;CACnD,KAAK;CACL,WAAW;CACX,SAAS;CACT,UAAU;CACV,WAAW;CACX,OAAO;CACP,KAAK;CACL,KAAK;AACP;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,mCACX;;;;;;;;;AAUF,MAAa,4CAA4C;CACvD,SAAS;CACT,aAAa,CAAC,cAAc;CAC5B,UAAU;CACV,WAAW;CACX,WAAW;AACb;;;;;;;;;;;;;;;;;AAkBA,MAAa,+BACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChHF,MAAa,+BAA+B;;CAE1C,kBAAkB;;CAElB,iBAAiB;AACnB;;AAOA,MAAa,6BAA6B;;;;;;;;AAS1C,MAAa,6BAA6B;;AAG1C,MAAa,4BAA4B;;AAGzC,MAAa,2BAA2B;;AAGxC,MAAa,kCACX;;AAGF,MAAa,2BAA2B;;;;;;AAWxC,MAAa,oCAAoC;CAC/C,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,IAAI;EAQ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