@vorionsys/contracts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/aci/aci-string.d.ts +539 -0
  2. package/dist/aci/aci-string.d.ts.map +1 -0
  3. package/dist/aci/aci-string.js +563 -0
  4. package/dist/aci/aci-string.js.map +1 -0
  5. package/dist/aci/attestation.d.ts +648 -0
  6. package/dist/aci/attestation.d.ts.map +1 -0
  7. package/dist/aci/attestation.js +289 -0
  8. package/dist/aci/attestation.js.map +1 -0
  9. package/dist/aci/domains.d.ts +260 -0
  10. package/dist/aci/domains.d.ts.map +1 -0
  11. package/dist/aci/domains.js +322 -0
  12. package/dist/aci/domains.js.map +1 -0
  13. package/dist/aci/effective-permission.d.ts +371 -0
  14. package/dist/aci/effective-permission.d.ts.map +1 -0
  15. package/dist/aci/effective-permission.js +351 -0
  16. package/dist/aci/effective-permission.js.map +1 -0
  17. package/dist/aci/identity.d.ts +1100 -0
  18. package/dist/aci/identity.d.ts.map +1 -0
  19. package/dist/aci/identity.js +328 -0
  20. package/dist/aci/identity.js.map +1 -0
  21. package/dist/aci/index.d.ts +67 -0
  22. package/dist/aci/index.d.ts.map +1 -0
  23. package/dist/aci/index.js +157 -0
  24. package/dist/aci/index.js.map +1 -0
  25. package/dist/aci/jwt-claims.d.ts +756 -0
  26. package/dist/aci/jwt-claims.d.ts.map +1 -0
  27. package/dist/aci/jwt-claims.js +335 -0
  28. package/dist/aci/jwt-claims.js.map +1 -0
  29. package/dist/aci/levels.d.ts +279 -0
  30. package/dist/aci/levels.d.ts.map +1 -0
  31. package/dist/aci/levels.js +467 -0
  32. package/dist/aci/levels.js.map +1 -0
  33. package/dist/aci/mapping.d.ts +291 -0
  34. package/dist/aci/mapping.d.ts.map +1 -0
  35. package/dist/aci/mapping.js +427 -0
  36. package/dist/aci/mapping.js.map +1 -0
  37. package/dist/aci/skills.d.ts +314 -0
  38. package/dist/aci/skills.d.ts.map +1 -0
  39. package/dist/aci/skills.js +404 -0
  40. package/dist/aci/skills.js.map +1 -0
  41. package/dist/aci/tiers.d.ts +403 -0
  42. package/dist/aci/tiers.d.ts.map +1 -0
  43. package/dist/aci/tiers.js +659 -0
  44. package/dist/aci/tiers.js.map +1 -0
  45. package/dist/canonical/agent.d.ts +796 -0
  46. package/dist/canonical/agent.d.ts.map +1 -0
  47. package/dist/canonical/agent.js +527 -0
  48. package/dist/canonical/agent.js.map +1 -0
  49. package/dist/canonical/governance.d.ts +905 -0
  50. package/dist/canonical/governance.d.ts.map +1 -0
  51. package/dist/canonical/governance.js +454 -0
  52. package/dist/canonical/governance.js.map +1 -0
  53. package/dist/canonical/index.d.ts +17 -0
  54. package/dist/canonical/index.d.ts.map +1 -0
  55. package/dist/canonical/index.js +21 -0
  56. package/dist/canonical/index.js.map +1 -0
  57. package/dist/canonical/intent.d.ts +727 -0
  58. package/dist/canonical/intent.d.ts.map +1 -0
  59. package/dist/canonical/intent.js +203 -0
  60. package/dist/canonical/intent.js.map +1 -0
  61. package/dist/canonical/risk-level.d.ts +344 -0
  62. package/dist/canonical/risk-level.d.ts.map +1 -0
  63. package/dist/canonical/risk-level.js +472 -0
  64. package/dist/canonical/risk-level.js.map +1 -0
  65. package/dist/canonical/trust-band.d.ts +239 -0
  66. package/dist/canonical/trust-band.d.ts.map +1 -0
  67. package/dist/canonical/trust-band.js +298 -0
  68. package/dist/canonical/trust-band.js.map +1 -0
  69. package/dist/canonical/trust-score.d.ts +301 -0
  70. package/dist/canonical/trust-score.d.ts.map +1 -0
  71. package/dist/canonical/trust-score.js +390 -0
  72. package/dist/canonical/trust-score.js.map +1 -0
  73. package/dist/canonical/trust-signal.d.ts +617 -0
  74. package/dist/canonical/trust-signal.d.ts.map +1 -0
  75. package/dist/canonical/trust-signal.js +355 -0
  76. package/dist/canonical/trust-signal.js.map +1 -0
  77. package/dist/canonical/validation.d.ts +231 -0
  78. package/dist/canonical/validation.d.ts.map +1 -0
  79. package/dist/canonical/validation.js +558 -0
  80. package/dist/canonical/validation.js.map +1 -0
  81. package/dist/common/index.d.ts +7 -0
  82. package/dist/common/index.d.ts.map +1 -0
  83. package/dist/common/index.js +7 -0
  84. package/dist/common/index.js.map +1 -0
  85. package/dist/common/primitives.d.ts +56 -0
  86. package/dist/common/primitives.d.ts.map +1 -0
  87. package/dist/common/primitives.js +70 -0
  88. package/dist/common/primitives.js.map +1 -0
  89. package/dist/index.d.ts +11 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +15 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/v2/canary-probe.d.ts +201 -0
  94. package/dist/v2/canary-probe.d.ts.map +1 -0
  95. package/dist/v2/canary-probe.js +99 -0
  96. package/dist/v2/canary-probe.js.map +1 -0
  97. package/dist/v2/component.d.ts +132 -0
  98. package/dist/v2/component.d.ts.map +1 -0
  99. package/dist/v2/component.js +5 -0
  100. package/dist/v2/component.js.map +1 -0
  101. package/dist/v2/decision.d.ts +310 -0
  102. package/dist/v2/decision.d.ts.map +1 -0
  103. package/dist/v2/decision.js +21 -0
  104. package/dist/v2/decision.js.map +1 -0
  105. package/dist/v2/enums.d.ts +185 -0
  106. package/dist/v2/enums.d.ts.map +1 -0
  107. package/dist/v2/enums.js +203 -0
  108. package/dist/v2/enums.js.map +1 -0
  109. package/dist/v2/evidence.d.ts +368 -0
  110. package/dist/v2/evidence.d.ts.map +1 -0
  111. package/dist/v2/evidence.js +152 -0
  112. package/dist/v2/evidence.js.map +1 -0
  113. package/dist/v2/execution.d.ts +190 -0
  114. package/dist/v2/execution.d.ts.map +1 -0
  115. package/dist/v2/execution.js +5 -0
  116. package/dist/v2/execution.js.map +1 -0
  117. package/dist/v2/index.d.ts +19 -0
  118. package/dist/v2/index.d.ts.map +1 -0
  119. package/dist/v2/index.js +32 -0
  120. package/dist/v2/index.js.map +1 -0
  121. package/dist/v2/intent.d.ts +89 -0
  122. package/dist/v2/intent.d.ts.map +1 -0
  123. package/dist/v2/intent.js +5 -0
  124. package/dist/v2/intent.js.map +1 -0
  125. package/dist/v2/policy-bundle.d.ts +166 -0
  126. package/dist/v2/policy-bundle.d.ts.map +1 -0
  127. package/dist/v2/policy-bundle.js +20 -0
  128. package/dist/v2/policy-bundle.js.map +1 -0
  129. package/dist/v2/pre-action-gate.d.ts +185 -0
  130. package/dist/v2/pre-action-gate.d.ts.map +1 -0
  131. package/dist/v2/pre-action-gate.js +64 -0
  132. package/dist/v2/pre-action-gate.js.map +1 -0
  133. package/dist/v2/proof-event.d.ts +201 -0
  134. package/dist/v2/proof-event.d.ts.map +1 -0
  135. package/dist/v2/proof-event.js +5 -0
  136. package/dist/v2/proof-event.js.map +1 -0
  137. package/dist/v2/retention.d.ts +329 -0
  138. package/dist/v2/retention.d.ts.map +1 -0
  139. package/dist/v2/retention.js +162 -0
  140. package/dist/v2/retention.js.map +1 -0
  141. package/dist/v2/trust-delta.d.ts +119 -0
  142. package/dist/v2/trust-delta.d.ts.map +1 -0
  143. package/dist/v2/trust-delta.js +28 -0
  144. package/dist/v2/trust-delta.js.map +1 -0
  145. package/dist/v2/trust-profile.d.ts +337 -0
  146. package/dist/v2/trust-profile.d.ts.map +1 -0
  147. package/dist/v2/trust-profile.js +96 -0
  148. package/dist/v2/trust-profile.js.map +1 -0
  149. package/dist/validators/decision.d.ts +430 -0
  150. package/dist/validators/decision.d.ts.map +1 -0
  151. package/dist/validators/decision.js +61 -0
  152. package/dist/validators/decision.js.map +1 -0
  153. package/dist/validators/enums.d.ts +24 -0
  154. package/dist/validators/enums.d.ts.map +1 -0
  155. package/dist/validators/enums.js +24 -0
  156. package/dist/validators/enums.js.map +1 -0
  157. package/dist/validators/index.d.ts +30 -0
  158. package/dist/validators/index.d.ts.map +1 -0
  159. package/dist/validators/index.js +42 -0
  160. package/dist/validators/index.js.map +1 -0
  161. package/dist/validators/intent.d.ts +229 -0
  162. package/dist/validators/intent.d.ts.map +1 -0
  163. package/dist/validators/intent.js +47 -0
  164. package/dist/validators/intent.js.map +1 -0
  165. package/dist/validators/proof-event.d.ts +981 -0
  166. package/dist/validators/proof-event.d.ts.map +1 -0
  167. package/dist/validators/proof-event.js +134 -0
  168. package/dist/validators/proof-event.js.map +1 -0
  169. package/dist/validators/trust-profile.d.ts +350 -0
  170. package/dist/validators/trust-profile.d.ts.map +1 -0
  171. package/dist/validators/trust-profile.js +65 -0
  172. package/dist/validators/trust-profile.js.map +1 -0
  173. package/package.json +65 -0
@@ -0,0 +1,756 @@
1
+ /**
2
+ * @fileoverview ACI JWT Claims for OpenID Connect
3
+ *
4
+ * Defines JWT claim structures for ACI-aware authentication and authorization.
5
+ * These claims extend standard OIDC claims with ACI-specific information,
6
+ * enabling capability-based access control in JWT tokens.
7
+ *
8
+ * @module @vorion/contracts/aci/jwt-claims
9
+ */
10
+ import { z } from 'zod';
11
+ import { type DomainCode } from './domains.js';
12
+ import { CapabilityLevel } from './levels.js';
13
+ import { CertificationTier, RuntimeTier } from './tiers.js';
14
+ import { type ParsedACI } from './aci-string.js';
15
+ /**
16
+ * Standard JWT claims (RFC 7519).
17
+ */
18
+ export interface StandardJWTClaims {
19
+ /** Issuer */
20
+ iss?: string;
21
+ /** Subject */
22
+ sub?: string;
23
+ /** Audience */
24
+ aud?: string | string[];
25
+ /** Expiration time (Unix timestamp) */
26
+ exp?: number;
27
+ /** Not before (Unix timestamp) */
28
+ nbf?: number;
29
+ /** Issued at (Unix timestamp) */
30
+ iat?: number;
31
+ /** JWT ID */
32
+ jti?: string;
33
+ }
34
+ /**
35
+ * Zod schema for StandardJWTClaims.
36
+ */
37
+ export declare const standardJWTClaimsSchema: z.ZodObject<{
38
+ iss: z.ZodOptional<z.ZodString>;
39
+ sub: z.ZodOptional<z.ZodString>;
40
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
41
+ exp: z.ZodOptional<z.ZodNumber>;
42
+ nbf: z.ZodOptional<z.ZodNumber>;
43
+ iat: z.ZodOptional<z.ZodNumber>;
44
+ jti: z.ZodOptional<z.ZodString>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ iss?: string | undefined;
47
+ sub?: string | undefined;
48
+ aud?: string | string[] | undefined;
49
+ exp?: number | undefined;
50
+ nbf?: number | undefined;
51
+ iat?: number | undefined;
52
+ jti?: string | undefined;
53
+ }, {
54
+ iss?: string | undefined;
55
+ sub?: string | undefined;
56
+ aud?: string | string[] | undefined;
57
+ exp?: number | undefined;
58
+ nbf?: number | undefined;
59
+ iat?: number | undefined;
60
+ jti?: string | undefined;
61
+ }>;
62
+ /**
63
+ * ACI-specific JWT claims.
64
+ *
65
+ * These claims encode agent capabilities in JWT tokens for use in
66
+ * authentication and authorization flows.
67
+ *
68
+ * NOTE: `aci_trust` is OPTIONAL because trust tier is NOT embedded in the ACI.
69
+ * Trust comes from attestations at runtime. If attestations are included,
70
+ * the highest valid attestation tier should be used for `aci_trust`.
71
+ */
72
+ export interface ACIJWTClaims extends StandardJWTClaims {
73
+ /** Full ACI string (immutable identifier, no trust info) */
74
+ aci: string;
75
+ /** Domain bitmask for efficient validation */
76
+ aci_domains: number;
77
+ /** Domain codes array for readability */
78
+ aci_domains_list: DomainCode[];
79
+ /** Capability level */
80
+ aci_level: CapabilityLevel;
81
+ /**
82
+ * Certification tier from attestations (OPTIONAL).
83
+ * This is NOT from the ACI itself - it comes from valid attestations.
84
+ * Defaults to T0 if no attestations exist.
85
+ */
86
+ aci_trust?: CertificationTier;
87
+ /** Registry */
88
+ aci_registry: string;
89
+ /** Organization */
90
+ aci_org: string;
91
+ /** Agent class */
92
+ aci_class: string;
93
+ /** ACI version */
94
+ aci_version: string;
95
+ /** Agent DID (optional) */
96
+ aci_did?: string;
97
+ /** Runtime tier in current context (optional) */
98
+ aci_runtime_tier?: RuntimeTier;
99
+ /** Attestation summaries - source of aci_trust value */
100
+ aci_attestations?: ACIAttestationClaim[];
101
+ /** Effective permission ceiling (optional) */
102
+ aci_permission_ceiling?: number;
103
+ /** Session-specific constraints (optional) */
104
+ aci_constraints?: ACIConstraintsClaim;
105
+ }
106
+ /**
107
+ * Attestation claim for JWT.
108
+ */
109
+ /**
110
+ * Attestation claim for JWT.
111
+ * Attestations are the SOURCE of trust tier, not the ACI.
112
+ */
113
+ export interface ACIAttestationClaim {
114
+ /** Issuer DID */
115
+ iss: string;
116
+ /** Certified trust tier from this attestation */
117
+ tier: CertificationTier;
118
+ /** Attestation scope (domains covered) */
119
+ scope: string;
120
+ /** Issued at (Unix timestamp) */
121
+ iat: number;
122
+ /** Expiration (Unix timestamp) */
123
+ exp: number;
124
+ /** Evidence URL (optional) */
125
+ evidence?: string;
126
+ }
127
+ /**
128
+ * Constraints claim for session-specific limitations.
129
+ */
130
+ export interface ACIConstraintsClaim {
131
+ /** Maximum operations allowed in this session */
132
+ max_operations?: number;
133
+ /** Allowed resource patterns */
134
+ allowed_resources?: string[];
135
+ /** Blocked resource patterns */
136
+ blocked_resources?: string[];
137
+ /** Time window end (Unix timestamp) */
138
+ valid_until?: number;
139
+ /** Required human approval for actions */
140
+ requires_approval?: boolean;
141
+ /** Custom constraints */
142
+ custom?: Record<string, unknown>;
143
+ }
144
+ /**
145
+ * Zod schema for ACIAttestationClaim.
146
+ */
147
+ export declare const aciAttestationClaimSchema: z.ZodObject<{
148
+ iss: z.ZodString;
149
+ tier: z.ZodNativeEnum<typeof CertificationTier>;
150
+ scope: z.ZodString;
151
+ iat: z.ZodNumber;
152
+ exp: z.ZodNumber;
153
+ evidence: z.ZodOptional<z.ZodString>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ scope: string;
156
+ tier: CertificationTier;
157
+ iss: string;
158
+ exp: number;
159
+ iat: number;
160
+ evidence?: string | undefined;
161
+ }, {
162
+ scope: string;
163
+ tier: CertificationTier;
164
+ iss: string;
165
+ exp: number;
166
+ iat: number;
167
+ evidence?: string | undefined;
168
+ }>;
169
+ /**
170
+ * Zod schema for ACIConstraintsClaim.
171
+ */
172
+ export declare const aciConstraintsClaimSchema: z.ZodObject<{
173
+ max_operations: z.ZodOptional<z.ZodNumber>;
174
+ allowed_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
175
+ blocked_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
176
+ valid_until: z.ZodOptional<z.ZodNumber>;
177
+ requires_approval: z.ZodOptional<z.ZodBoolean>;
178
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ custom?: Record<string, unknown> | undefined;
181
+ max_operations?: number | undefined;
182
+ allowed_resources?: string[] | undefined;
183
+ blocked_resources?: string[] | undefined;
184
+ valid_until?: number | undefined;
185
+ requires_approval?: boolean | undefined;
186
+ }, {
187
+ custom?: Record<string, unknown> | undefined;
188
+ max_operations?: number | undefined;
189
+ allowed_resources?: string[] | undefined;
190
+ blocked_resources?: string[] | undefined;
191
+ valid_until?: number | undefined;
192
+ requires_approval?: boolean | undefined;
193
+ }>;
194
+ /**
195
+ * Zod schema for ACIJWTClaims validation.
196
+ */
197
+ export declare const aciJWTClaimsSchema: z.ZodObject<{
198
+ iss: z.ZodOptional<z.ZodString>;
199
+ sub: z.ZodOptional<z.ZodString>;
200
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
201
+ exp: z.ZodOptional<z.ZodNumber>;
202
+ nbf: z.ZodOptional<z.ZodNumber>;
203
+ iat: z.ZodOptional<z.ZodNumber>;
204
+ jti: z.ZodOptional<z.ZodString>;
205
+ } & {
206
+ aci: z.ZodString;
207
+ aci_domains: z.ZodNumber;
208
+ aci_domains_list: z.ZodArray<z.ZodEnum<["A", "B", "C", "D", "E", "F", "G", "H", "I", "S"]>, "many">;
209
+ aci_level: z.ZodNativeEnum<typeof CapabilityLevel>;
210
+ aci_trust: z.ZodOptional<z.ZodNativeEnum<typeof CertificationTier>>;
211
+ aci_registry: z.ZodString;
212
+ aci_org: z.ZodString;
213
+ aci_class: z.ZodString;
214
+ aci_version: z.ZodString;
215
+ aci_did: z.ZodOptional<z.ZodString>;
216
+ aci_runtime_tier: z.ZodOptional<z.ZodNativeEnum<typeof RuntimeTier>>;
217
+ aci_attestations: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ iss: z.ZodString;
219
+ tier: z.ZodNativeEnum<typeof CertificationTier>;
220
+ scope: z.ZodString;
221
+ iat: z.ZodNumber;
222
+ exp: z.ZodNumber;
223
+ evidence: z.ZodOptional<z.ZodString>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ scope: string;
226
+ tier: CertificationTier;
227
+ iss: string;
228
+ exp: number;
229
+ iat: number;
230
+ evidence?: string | undefined;
231
+ }, {
232
+ scope: string;
233
+ tier: CertificationTier;
234
+ iss: string;
235
+ exp: number;
236
+ iat: number;
237
+ evidence?: string | undefined;
238
+ }>, "many">>;
239
+ aci_permission_ceiling: z.ZodOptional<z.ZodNumber>;
240
+ aci_constraints: z.ZodOptional<z.ZodObject<{
241
+ max_operations: z.ZodOptional<z.ZodNumber>;
242
+ allowed_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
243
+ blocked_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
244
+ valid_until: z.ZodOptional<z.ZodNumber>;
245
+ requires_approval: z.ZodOptional<z.ZodBoolean>;
246
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
247
+ }, "strip", z.ZodTypeAny, {
248
+ custom?: Record<string, unknown> | undefined;
249
+ max_operations?: number | undefined;
250
+ allowed_resources?: string[] | undefined;
251
+ blocked_resources?: string[] | undefined;
252
+ valid_until?: number | undefined;
253
+ requires_approval?: boolean | undefined;
254
+ }, {
255
+ custom?: Record<string, unknown> | undefined;
256
+ max_operations?: number | undefined;
257
+ allowed_resources?: string[] | undefined;
258
+ blocked_resources?: string[] | undefined;
259
+ valid_until?: number | undefined;
260
+ requires_approval?: boolean | undefined;
261
+ }>>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ aci: string;
264
+ aci_domains: number;
265
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
266
+ aci_level: CapabilityLevel;
267
+ aci_registry: string;
268
+ aci_org: string;
269
+ aci_class: string;
270
+ aci_version: string;
271
+ iss?: string | undefined;
272
+ sub?: string | undefined;
273
+ aud?: string | string[] | undefined;
274
+ exp?: number | undefined;
275
+ nbf?: number | undefined;
276
+ iat?: number | undefined;
277
+ jti?: string | undefined;
278
+ aci_trust?: CertificationTier | undefined;
279
+ aci_did?: string | undefined;
280
+ aci_runtime_tier?: RuntimeTier | undefined;
281
+ aci_attestations?: {
282
+ scope: string;
283
+ tier: CertificationTier;
284
+ iss: string;
285
+ exp: number;
286
+ iat: number;
287
+ evidence?: string | undefined;
288
+ }[] | undefined;
289
+ aci_permission_ceiling?: number | undefined;
290
+ aci_constraints?: {
291
+ custom?: Record<string, unknown> | undefined;
292
+ max_operations?: number | undefined;
293
+ allowed_resources?: string[] | undefined;
294
+ blocked_resources?: string[] | undefined;
295
+ valid_until?: number | undefined;
296
+ requires_approval?: boolean | undefined;
297
+ } | undefined;
298
+ }, {
299
+ aci: string;
300
+ aci_domains: number;
301
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
302
+ aci_level: CapabilityLevel;
303
+ aci_registry: string;
304
+ aci_org: string;
305
+ aci_class: string;
306
+ aci_version: string;
307
+ iss?: string | undefined;
308
+ sub?: string | undefined;
309
+ aud?: string | string[] | undefined;
310
+ exp?: number | undefined;
311
+ nbf?: number | undefined;
312
+ iat?: number | undefined;
313
+ jti?: string | undefined;
314
+ aci_trust?: CertificationTier | undefined;
315
+ aci_did?: string | undefined;
316
+ aci_runtime_tier?: RuntimeTier | undefined;
317
+ aci_attestations?: {
318
+ scope: string;
319
+ tier: CertificationTier;
320
+ iss: string;
321
+ exp: number;
322
+ iat: number;
323
+ evidence?: string | undefined;
324
+ }[] | undefined;
325
+ aci_permission_ceiling?: number | undefined;
326
+ aci_constraints?: {
327
+ custom?: Record<string, unknown> | undefined;
328
+ max_operations?: number | undefined;
329
+ allowed_resources?: string[] | undefined;
330
+ blocked_resources?: string[] | undefined;
331
+ valid_until?: number | undefined;
332
+ requires_approval?: boolean | undefined;
333
+ } | undefined;
334
+ }>;
335
+ /**
336
+ * Options for generating JWT claims.
337
+ */
338
+ export interface GenerateJWTClaimsOptions {
339
+ /** Parsed ACI */
340
+ parsed: ParsedACI;
341
+ /** Agent DID (optional) */
342
+ did?: string;
343
+ /** Issuer (optional) */
344
+ issuer?: string;
345
+ /** Audience (optional) */
346
+ audience?: string | string[];
347
+ /** Validity duration in seconds (default: 1 hour) */
348
+ validitySeconds?: number;
349
+ /** Runtime tier (optional) */
350
+ runtimeTier?: RuntimeTier;
351
+ /** Attestation claims (optional) */
352
+ attestations?: ACIAttestationClaim[];
353
+ /** Permission ceiling (optional) */
354
+ permissionCeiling?: number;
355
+ /** Constraints (optional) */
356
+ constraints?: ACIConstraintsClaim;
357
+ }
358
+ /**
359
+ * Generates JWT claims from a parsed ACI.
360
+ *
361
+ * @param options - Generation options
362
+ * @returns ACI JWT claims
363
+ *
364
+ * @example
365
+ * ```typescript
366
+ * const claims = generateJWTClaims({
367
+ * parsed: parseACI('a3i.acme-corp.invoice-bot:ABF-L3@1.0.0'),
368
+ * did: 'did:web:agent.acme.com',
369
+ * issuer: 'did:web:auth.acme.com',
370
+ * validitySeconds: 3600,
371
+ * });
372
+ * ```
373
+ */
374
+ export declare function generateJWTClaims(options: GenerateJWTClaimsOptions): ACIJWTClaims;
375
+ /**
376
+ * Generates minimal JWT claims from a parsed ACI.
377
+ *
378
+ * NOTE: aci_trust is NOT included because trust comes from attestations,
379
+ * not the ACI itself. Use generateJWTClaims with attestations for full claims.
380
+ *
381
+ * @param parsed - Parsed ACI
382
+ * @param did - Optional agent DID
383
+ * @returns Minimal ACI JWT claims (without trust tier)
384
+ */
385
+ export declare function generateMinimalJWTClaims(parsed: ParsedACI, did?: string): ACIJWTClaims;
386
+ /**
387
+ * Validation error for JWT claims.
388
+ */
389
+ export interface JWTClaimsValidationError {
390
+ /** Error code */
391
+ code: JWTClaimsErrorCode;
392
+ /** Human-readable message */
393
+ message: string;
394
+ /** Claim path (if applicable) */
395
+ path?: string;
396
+ }
397
+ /**
398
+ * Error codes for JWT claims validation.
399
+ */
400
+ export type JWTClaimsErrorCode = 'MISSING_ACI' | 'INVALID_ACI' | 'EXPIRED' | 'NOT_YET_VALID' | 'INVALID_DOMAINS' | 'INVALID_LEVEL' | 'INVALID_TIER' | 'DOMAINS_MISMATCH' | 'INVALID_FORMAT';
401
+ /**
402
+ * Result of JWT claims validation.
403
+ */
404
+ export interface JWTClaimsValidationResult {
405
+ /** Whether the claims are valid */
406
+ valid: boolean;
407
+ /** Validation errors */
408
+ errors: JWTClaimsValidationError[];
409
+ /** Validated claims (if valid) */
410
+ claims?: ACIJWTClaims;
411
+ }
412
+ /**
413
+ * Validates ACI JWT claims.
414
+ *
415
+ * @param claims - Claims to validate
416
+ * @param options - Validation options
417
+ * @returns Validation result
418
+ *
419
+ * @example
420
+ * ```typescript
421
+ * const result = validateJWTClaims(claims, {
422
+ * checkExpiry: true,
423
+ * validateDomainsMismatch: true,
424
+ * });
425
+ * ```
426
+ */
427
+ export declare function validateJWTClaims(claims: unknown, options?: {
428
+ checkExpiry?: boolean;
429
+ validateDomainsMismatch?: boolean;
430
+ }): JWTClaimsValidationResult;
431
+ /**
432
+ * Extracts capability information from JWT claims.
433
+ *
434
+ * NOTE: certificationTier is optional because it comes from attestations,
435
+ * not the ACI. If no attestations are present, it will be undefined.
436
+ *
437
+ * @param claims - ACI JWT claims
438
+ * @returns Capability information
439
+ */
440
+ export declare function extractCapabilityFromClaims(claims: ACIJWTClaims): {
441
+ domains: DomainCode[];
442
+ domainsBitmask: number;
443
+ level: CapabilityLevel;
444
+ certificationTier?: CertificationTier;
445
+ runtimeTier?: RuntimeTier;
446
+ };
447
+ /**
448
+ * Extracts identity information from JWT claims.
449
+ *
450
+ * @param claims - ACI JWT claims
451
+ * @returns Identity information
452
+ */
453
+ export declare function extractIdentityFromClaims(claims: ACIJWTClaims): {
454
+ aci: string;
455
+ did?: string;
456
+ registry: string;
457
+ organization: string;
458
+ agentClass: string;
459
+ version: string;
460
+ };
461
+ /**
462
+ * Checks if claims have specific domain capability.
463
+ *
464
+ * @param claims - ACI JWT claims
465
+ * @param domain - Domain to check
466
+ * @returns True if the domain is present
467
+ */
468
+ export declare function claimsHaveDomain(claims: ACIJWTClaims, domain: DomainCode): boolean;
469
+ /**
470
+ * Checks if claims meet minimum capability requirements.
471
+ *
472
+ * @param claims - ACI JWT claims
473
+ * @param requirements - Minimum requirements
474
+ * @returns True if requirements are met
475
+ */
476
+ export declare function claimsMeetRequirements(claims: ACIJWTClaims, requirements: {
477
+ domains?: DomainCode[];
478
+ minLevel?: CapabilityLevel;
479
+ minCertificationTier?: CertificationTier;
480
+ minRuntimeTier?: RuntimeTier;
481
+ }): boolean;
482
+ /**
483
+ * Zod schema for JWT claims validation options.
484
+ */
485
+ export declare const jwtClaimsValidationOptionsSchema: z.ZodObject<{
486
+ checkExpiry: z.ZodOptional<z.ZodBoolean>;
487
+ validateDomainsMismatch: z.ZodOptional<z.ZodBoolean>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ checkExpiry?: boolean | undefined;
490
+ validateDomainsMismatch?: boolean | undefined;
491
+ }, {
492
+ checkExpiry?: boolean | undefined;
493
+ validateDomainsMismatch?: boolean | undefined;
494
+ }>;
495
+ /**
496
+ * Zod schema for JWTClaimsValidationError.
497
+ */
498
+ export declare const jwtClaimsValidationErrorSchema: z.ZodObject<{
499
+ code: z.ZodEnum<["MISSING_ACI", "INVALID_ACI", "EXPIRED", "NOT_YET_VALID", "INVALID_DOMAINS", "INVALID_LEVEL", "INVALID_TIER", "DOMAINS_MISMATCH", "INVALID_FORMAT"]>;
500
+ message: z.ZodString;
501
+ path: z.ZodOptional<z.ZodString>;
502
+ }, "strip", z.ZodTypeAny, {
503
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
504
+ message: string;
505
+ path?: string | undefined;
506
+ }, {
507
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
508
+ message: string;
509
+ path?: string | undefined;
510
+ }>;
511
+ /**
512
+ * Zod schema for JWTClaimsValidationResult.
513
+ */
514
+ export declare const jwtClaimsValidationResultSchema: z.ZodObject<{
515
+ valid: z.ZodBoolean;
516
+ errors: z.ZodArray<z.ZodObject<{
517
+ code: z.ZodEnum<["MISSING_ACI", "INVALID_ACI", "EXPIRED", "NOT_YET_VALID", "INVALID_DOMAINS", "INVALID_LEVEL", "INVALID_TIER", "DOMAINS_MISMATCH", "INVALID_FORMAT"]>;
518
+ message: z.ZodString;
519
+ path: z.ZodOptional<z.ZodString>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
522
+ message: string;
523
+ path?: string | undefined;
524
+ }, {
525
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
526
+ message: string;
527
+ path?: string | undefined;
528
+ }>, "many">;
529
+ claims: z.ZodOptional<z.ZodObject<{
530
+ iss: z.ZodOptional<z.ZodString>;
531
+ sub: z.ZodOptional<z.ZodString>;
532
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
533
+ exp: z.ZodOptional<z.ZodNumber>;
534
+ nbf: z.ZodOptional<z.ZodNumber>;
535
+ iat: z.ZodOptional<z.ZodNumber>;
536
+ jti: z.ZodOptional<z.ZodString>;
537
+ } & {
538
+ aci: z.ZodString;
539
+ aci_domains: z.ZodNumber;
540
+ aci_domains_list: z.ZodArray<z.ZodEnum<["A", "B", "C", "D", "E", "F", "G", "H", "I", "S"]>, "many">;
541
+ aci_level: z.ZodNativeEnum<typeof CapabilityLevel>;
542
+ aci_trust: z.ZodOptional<z.ZodNativeEnum<typeof CertificationTier>>;
543
+ aci_registry: z.ZodString;
544
+ aci_org: z.ZodString;
545
+ aci_class: z.ZodString;
546
+ aci_version: z.ZodString;
547
+ aci_did: z.ZodOptional<z.ZodString>;
548
+ aci_runtime_tier: z.ZodOptional<z.ZodNativeEnum<typeof RuntimeTier>>;
549
+ aci_attestations: z.ZodOptional<z.ZodArray<z.ZodObject<{
550
+ iss: z.ZodString;
551
+ tier: z.ZodNativeEnum<typeof CertificationTier>;
552
+ scope: z.ZodString;
553
+ iat: z.ZodNumber;
554
+ exp: z.ZodNumber;
555
+ evidence: z.ZodOptional<z.ZodString>;
556
+ }, "strip", z.ZodTypeAny, {
557
+ scope: string;
558
+ tier: CertificationTier;
559
+ iss: string;
560
+ exp: number;
561
+ iat: number;
562
+ evidence?: string | undefined;
563
+ }, {
564
+ scope: string;
565
+ tier: CertificationTier;
566
+ iss: string;
567
+ exp: number;
568
+ iat: number;
569
+ evidence?: string | undefined;
570
+ }>, "many">>;
571
+ aci_permission_ceiling: z.ZodOptional<z.ZodNumber>;
572
+ aci_constraints: z.ZodOptional<z.ZodObject<{
573
+ max_operations: z.ZodOptional<z.ZodNumber>;
574
+ allowed_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
575
+ blocked_resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
576
+ valid_until: z.ZodOptional<z.ZodNumber>;
577
+ requires_approval: z.ZodOptional<z.ZodBoolean>;
578
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
579
+ }, "strip", z.ZodTypeAny, {
580
+ custom?: Record<string, unknown> | undefined;
581
+ max_operations?: number | undefined;
582
+ allowed_resources?: string[] | undefined;
583
+ blocked_resources?: string[] | undefined;
584
+ valid_until?: number | undefined;
585
+ requires_approval?: boolean | undefined;
586
+ }, {
587
+ custom?: Record<string, unknown> | undefined;
588
+ max_operations?: number | undefined;
589
+ allowed_resources?: string[] | undefined;
590
+ blocked_resources?: string[] | undefined;
591
+ valid_until?: number | undefined;
592
+ requires_approval?: boolean | undefined;
593
+ }>>;
594
+ }, "strip", z.ZodTypeAny, {
595
+ aci: string;
596
+ aci_domains: number;
597
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
598
+ aci_level: CapabilityLevel;
599
+ aci_registry: string;
600
+ aci_org: string;
601
+ aci_class: string;
602
+ aci_version: string;
603
+ iss?: string | undefined;
604
+ sub?: string | undefined;
605
+ aud?: string | string[] | undefined;
606
+ exp?: number | undefined;
607
+ nbf?: number | undefined;
608
+ iat?: number | undefined;
609
+ jti?: string | undefined;
610
+ aci_trust?: CertificationTier | undefined;
611
+ aci_did?: string | undefined;
612
+ aci_runtime_tier?: RuntimeTier | undefined;
613
+ aci_attestations?: {
614
+ scope: string;
615
+ tier: CertificationTier;
616
+ iss: string;
617
+ exp: number;
618
+ iat: number;
619
+ evidence?: string | undefined;
620
+ }[] | undefined;
621
+ aci_permission_ceiling?: number | undefined;
622
+ aci_constraints?: {
623
+ custom?: Record<string, unknown> | undefined;
624
+ max_operations?: number | undefined;
625
+ allowed_resources?: string[] | undefined;
626
+ blocked_resources?: string[] | undefined;
627
+ valid_until?: number | undefined;
628
+ requires_approval?: boolean | undefined;
629
+ } | undefined;
630
+ }, {
631
+ aci: string;
632
+ aci_domains: number;
633
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
634
+ aci_level: CapabilityLevel;
635
+ aci_registry: string;
636
+ aci_org: string;
637
+ aci_class: string;
638
+ aci_version: string;
639
+ iss?: string | undefined;
640
+ sub?: string | undefined;
641
+ aud?: string | string[] | undefined;
642
+ exp?: number | undefined;
643
+ nbf?: number | undefined;
644
+ iat?: number | undefined;
645
+ jti?: string | undefined;
646
+ aci_trust?: CertificationTier | undefined;
647
+ aci_did?: string | undefined;
648
+ aci_runtime_tier?: RuntimeTier | undefined;
649
+ aci_attestations?: {
650
+ scope: string;
651
+ tier: CertificationTier;
652
+ iss: string;
653
+ exp: number;
654
+ iat: number;
655
+ evidence?: string | undefined;
656
+ }[] | undefined;
657
+ aci_permission_ceiling?: number | undefined;
658
+ aci_constraints?: {
659
+ custom?: Record<string, unknown> | undefined;
660
+ max_operations?: number | undefined;
661
+ allowed_resources?: string[] | undefined;
662
+ blocked_resources?: string[] | undefined;
663
+ valid_until?: number | undefined;
664
+ requires_approval?: boolean | undefined;
665
+ } | undefined;
666
+ }>>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ valid: boolean;
669
+ errors: {
670
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
671
+ message: string;
672
+ path?: string | undefined;
673
+ }[];
674
+ claims?: {
675
+ aci: string;
676
+ aci_domains: number;
677
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
678
+ aci_level: CapabilityLevel;
679
+ aci_registry: string;
680
+ aci_org: string;
681
+ aci_class: string;
682
+ aci_version: string;
683
+ iss?: string | undefined;
684
+ sub?: string | undefined;
685
+ aud?: string | string[] | undefined;
686
+ exp?: number | undefined;
687
+ nbf?: number | undefined;
688
+ iat?: number | undefined;
689
+ jti?: string | undefined;
690
+ aci_trust?: CertificationTier | undefined;
691
+ aci_did?: string | undefined;
692
+ aci_runtime_tier?: RuntimeTier | undefined;
693
+ aci_attestations?: {
694
+ scope: string;
695
+ tier: CertificationTier;
696
+ iss: string;
697
+ exp: number;
698
+ iat: number;
699
+ evidence?: string | undefined;
700
+ }[] | undefined;
701
+ aci_permission_ceiling?: number | undefined;
702
+ aci_constraints?: {
703
+ custom?: Record<string, unknown> | undefined;
704
+ max_operations?: number | undefined;
705
+ allowed_resources?: string[] | undefined;
706
+ blocked_resources?: string[] | undefined;
707
+ valid_until?: number | undefined;
708
+ requires_approval?: boolean | undefined;
709
+ } | undefined;
710
+ } | undefined;
711
+ }, {
712
+ valid: boolean;
713
+ errors: {
714
+ code: "EXPIRED" | "INVALID_FORMAT" | "INVALID_DOMAINS" | "INVALID_LEVEL" | "MISSING_ACI" | "INVALID_ACI" | "NOT_YET_VALID" | "INVALID_TIER" | "DOMAINS_MISMATCH";
715
+ message: string;
716
+ path?: string | undefined;
717
+ }[];
718
+ claims?: {
719
+ aci: string;
720
+ aci_domains: number;
721
+ aci_domains_list: ("A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "S")[];
722
+ aci_level: CapabilityLevel;
723
+ aci_registry: string;
724
+ aci_org: string;
725
+ aci_class: string;
726
+ aci_version: string;
727
+ iss?: string | undefined;
728
+ sub?: string | undefined;
729
+ aud?: string | string[] | undefined;
730
+ exp?: number | undefined;
731
+ nbf?: number | undefined;
732
+ iat?: number | undefined;
733
+ jti?: string | undefined;
734
+ aci_trust?: CertificationTier | undefined;
735
+ aci_did?: string | undefined;
736
+ aci_runtime_tier?: RuntimeTier | undefined;
737
+ aci_attestations?: {
738
+ scope: string;
739
+ tier: CertificationTier;
740
+ iss: string;
741
+ exp: number;
742
+ iat: number;
743
+ evidence?: string | undefined;
744
+ }[] | undefined;
745
+ aci_permission_ceiling?: number | undefined;
746
+ aci_constraints?: {
747
+ custom?: Record<string, unknown> | undefined;
748
+ max_operations?: number | undefined;
749
+ allowed_resources?: string[] | undefined;
750
+ blocked_resources?: string[] | undefined;
751
+ valid_until?: number | undefined;
752
+ requires_approval?: boolean | undefined;
753
+ } | undefined;
754
+ } | undefined;
755
+ }>;
756
+ //# sourceMappingURL=jwt-claims.d.ts.map