@kya-os/contracts 1.2.1 → 1.2.2

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 (57) hide show
  1. package/dist/delegation/constraints.d.ts +982 -0
  2. package/dist/delegation/constraints.js +205 -0
  3. package/dist/delegation/index.d.ts +8 -0
  4. package/dist/delegation/index.js +24 -0
  5. package/dist/delegation/schemas.d.ts +3787 -0
  6. package/dist/delegation/schemas.js +230 -0
  7. package/dist/did/index.d.ts +8 -0
  8. package/dist/did/index.js +24 -0
  9. package/dist/did/resolve-contract.d.ts +220 -0
  10. package/dist/did/resolve-contract.js +32 -0
  11. package/dist/did/types.d.ts +164 -0
  12. package/dist/did/types.js +71 -0
  13. package/dist/env/constants.d.ts +58 -0
  14. package/dist/env/constants.js +60 -0
  15. package/dist/env/index.d.ts +5 -0
  16. package/dist/env/index.js +21 -0
  17. package/dist/index.d.ts +9 -1
  18. package/dist/index.js +17 -2
  19. package/dist/proof/index.d.ts +9 -0
  20. package/dist/proof/index.js +25 -0
  21. package/dist/proof/proof-record.d.ts +838 -0
  22. package/dist/proof/proof-record.js +134 -0
  23. package/dist/proof/signing-spec.d.ts +147 -0
  24. package/dist/proof/signing-spec.js +123 -0
  25. package/dist/runtime/errors.d.ts +348 -0
  26. package/dist/runtime/errors.js +120 -0
  27. package/dist/runtime/headers.d.ts +84 -0
  28. package/dist/runtime/headers.js +82 -0
  29. package/dist/runtime/index.d.ts +6 -0
  30. package/dist/runtime/index.js +22 -0
  31. package/dist/tlkrc/index.d.ts +5 -0
  32. package/dist/tlkrc/index.js +21 -0
  33. package/dist/tlkrc/rotation.d.ts +246 -0
  34. package/dist/tlkrc/rotation.js +127 -0
  35. package/dist/vc/index.d.ts +8 -0
  36. package/dist/vc/index.js +24 -0
  37. package/dist/vc/schemas.d.ts +2484 -0
  38. package/dist/vc/schemas.js +225 -0
  39. package/dist/vc/statuslist.d.ts +494 -0
  40. package/dist/vc/statuslist.js +133 -0
  41. package/package.json +51 -6
  42. package/dist/cli.d.ts.map +0 -1
  43. package/dist/cli.js.map +0 -1
  44. package/dist/handshake.d.ts.map +0 -1
  45. package/dist/handshake.js.map +0 -1
  46. package/dist/index.d.ts.map +0 -1
  47. package/dist/index.js.map +0 -1
  48. package/dist/proof.d.ts.map +0 -1
  49. package/dist/proof.js.map +0 -1
  50. package/dist/registry.d.ts.map +0 -1
  51. package/dist/registry.js.map +0 -1
  52. package/dist/test.d.ts.map +0 -1
  53. package/dist/test.js.map +0 -1
  54. package/dist/utils/validation.d.ts.map +0 -1
  55. package/dist/utils/validation.js.map +0 -1
  56. package/dist/verifier.d.ts.map +0 -1
  57. package/dist/verifier.js.map +0 -1
@@ -0,0 +1,3787 @@
1
+ /**
2
+ * Delegation Record Schemas
3
+ *
4
+ * Types and schemas for delegation records that link VCs with CRISP constraints.
5
+ * Delegations represent the transfer of authority from one DID to another.
6
+ *
7
+ * Related Spec: MCP-I §4.1, §4.2
8
+ * Python Reference: Delegation-Documentation.md, Delegation-Service.md
9
+ */
10
+ import { z } from 'zod';
11
+ /**
12
+ * Delegation Status
13
+ *
14
+ * Lifecycle status of a delegation
15
+ */
16
+ export declare const DelegationStatusSchema: z.ZodEnum<["active", "revoked", "expired"]>;
17
+ export type DelegationStatus = z.infer<typeof DelegationStatusSchema>;
18
+ /**
19
+ * Delegation Record Schema
20
+ *
21
+ * Complete delegation record linking issuer (delegator) to subject (delegatee)
22
+ * with backing VC and CRISP constraints.
23
+ *
24
+ * **Key Invariants:**
25
+ * - Delegation MUST reference a live VC via `vcId`
26
+ * - Revocation of VC invalidates all linked delegations
27
+ * - Chain: no cycles allowed
28
+ * - Child `notAfter` ≤ parent `notAfter`
29
+ * - Child scopes ⊆ parent scopes
30
+ * - Child budgets ≤ parent budgets (same unit)
31
+ */
32
+ export declare const DelegationRecordSchema: z.ZodObject<{
33
+ /** Unique identifier for the delegation */
34
+ id: z.ZodString;
35
+ /** DID of the delegator (issuer, e.g., merchant/user) */
36
+ issuerDid: z.ZodString;
37
+ /** DID of the delegatee (subject, e.g., agent) */
38
+ subjectDid: z.ZodString;
39
+ /** Optional controller (user account ID or DID) */
40
+ controller: z.ZodOptional<z.ZodString>;
41
+ /** ID of the backing Verifiable Credential */
42
+ vcId: z.ZodString;
43
+ /** Optional parent delegation ID for chain tracking */
44
+ parentId: z.ZodOptional<z.ZodString>;
45
+ /** CRISP constraints on this delegation */
46
+ constraints: z.ZodObject<{
47
+ notBefore: z.ZodOptional<z.ZodNumber>;
48
+ notAfter: z.ZodOptional<z.ZodNumber>;
49
+ crisp: z.ZodObject<{
50
+ budget: z.ZodOptional<z.ZodObject<{
51
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
52
+ cap: z.ZodNumber;
53
+ window: z.ZodOptional<z.ZodObject<{
54
+ kind: z.ZodEnum<["rolling", "fixed"]>;
55
+ durationSec: z.ZodNumber;
56
+ }, "strip", z.ZodTypeAny, {
57
+ kind: "rolling" | "fixed";
58
+ durationSec: number;
59
+ }, {
60
+ kind: "rolling" | "fixed";
61
+ durationSec: number;
62
+ }>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ unit: "USD" | "ops" | "points";
65
+ cap: number;
66
+ window?: {
67
+ kind: "rolling" | "fixed";
68
+ durationSec: number;
69
+ } | undefined;
70
+ }, {
71
+ unit: "USD" | "ops" | "points";
72
+ cap: number;
73
+ window?: {
74
+ kind: "rolling" | "fixed";
75
+ durationSec: number;
76
+ } | undefined;
77
+ }>>;
78
+ scopes: z.ZodArray<z.ZodObject<{
79
+ resource: z.ZodString;
80
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
81
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ resource: string;
84
+ matcher: "exact" | "prefix" | "regex";
85
+ constraints?: Record<string, any> | undefined;
86
+ }, {
87
+ resource: string;
88
+ matcher: "exact" | "prefix" | "regex";
89
+ constraints?: Record<string, any> | undefined;
90
+ }>, "many">;
91
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
92
+ budget: z.ZodOptional<z.ZodObject<{
93
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
94
+ cap: z.ZodNumber;
95
+ window: z.ZodOptional<z.ZodObject<{
96
+ kind: z.ZodEnum<["rolling", "fixed"]>;
97
+ durationSec: z.ZodNumber;
98
+ }, "strip", z.ZodTypeAny, {
99
+ kind: "rolling" | "fixed";
100
+ durationSec: number;
101
+ }, {
102
+ kind: "rolling" | "fixed";
103
+ durationSec: number;
104
+ }>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ unit: "USD" | "ops" | "points";
107
+ cap: number;
108
+ window?: {
109
+ kind: "rolling" | "fixed";
110
+ durationSec: number;
111
+ } | undefined;
112
+ }, {
113
+ unit: "USD" | "ops" | "points";
114
+ cap: number;
115
+ window?: {
116
+ kind: "rolling" | "fixed";
117
+ durationSec: number;
118
+ } | undefined;
119
+ }>>;
120
+ scopes: z.ZodArray<z.ZodObject<{
121
+ resource: z.ZodString;
122
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
123
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ resource: string;
126
+ matcher: "exact" | "prefix" | "regex";
127
+ constraints?: Record<string, any> | undefined;
128
+ }, {
129
+ resource: string;
130
+ matcher: "exact" | "prefix" | "regex";
131
+ constraints?: Record<string, any> | undefined;
132
+ }>, "many">;
133
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
134
+ budget: z.ZodOptional<z.ZodObject<{
135
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
136
+ cap: z.ZodNumber;
137
+ window: z.ZodOptional<z.ZodObject<{
138
+ kind: z.ZodEnum<["rolling", "fixed"]>;
139
+ durationSec: z.ZodNumber;
140
+ }, "strip", z.ZodTypeAny, {
141
+ kind: "rolling" | "fixed";
142
+ durationSec: number;
143
+ }, {
144
+ kind: "rolling" | "fixed";
145
+ durationSec: number;
146
+ }>>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ unit: "USD" | "ops" | "points";
149
+ cap: number;
150
+ window?: {
151
+ kind: "rolling" | "fixed";
152
+ durationSec: number;
153
+ } | undefined;
154
+ }, {
155
+ unit: "USD" | "ops" | "points";
156
+ cap: number;
157
+ window?: {
158
+ kind: "rolling" | "fixed";
159
+ durationSec: number;
160
+ } | undefined;
161
+ }>>;
162
+ scopes: z.ZodArray<z.ZodObject<{
163
+ resource: z.ZodString;
164
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
165
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ resource: string;
168
+ matcher: "exact" | "prefix" | "regex";
169
+ constraints?: Record<string, any> | undefined;
170
+ }, {
171
+ resource: string;
172
+ matcher: "exact" | "prefix" | "regex";
173
+ constraints?: Record<string, any> | undefined;
174
+ }>, "many">;
175
+ }, z.ZodTypeAny, "passthrough">>;
176
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
177
+ notBefore: z.ZodOptional<z.ZodNumber>;
178
+ notAfter: z.ZodOptional<z.ZodNumber>;
179
+ crisp: z.ZodObject<{
180
+ budget: z.ZodOptional<z.ZodObject<{
181
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
182
+ cap: z.ZodNumber;
183
+ window: z.ZodOptional<z.ZodObject<{
184
+ kind: z.ZodEnum<["rolling", "fixed"]>;
185
+ durationSec: z.ZodNumber;
186
+ }, "strip", z.ZodTypeAny, {
187
+ kind: "rolling" | "fixed";
188
+ durationSec: number;
189
+ }, {
190
+ kind: "rolling" | "fixed";
191
+ durationSec: number;
192
+ }>>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ unit: "USD" | "ops" | "points";
195
+ cap: number;
196
+ window?: {
197
+ kind: "rolling" | "fixed";
198
+ durationSec: number;
199
+ } | undefined;
200
+ }, {
201
+ unit: "USD" | "ops" | "points";
202
+ cap: number;
203
+ window?: {
204
+ kind: "rolling" | "fixed";
205
+ durationSec: number;
206
+ } | undefined;
207
+ }>>;
208
+ scopes: z.ZodArray<z.ZodObject<{
209
+ resource: z.ZodString;
210
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
211
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ resource: string;
214
+ matcher: "exact" | "prefix" | "regex";
215
+ constraints?: Record<string, any> | undefined;
216
+ }, {
217
+ resource: string;
218
+ matcher: "exact" | "prefix" | "regex";
219
+ constraints?: Record<string, any> | undefined;
220
+ }>, "many">;
221
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
222
+ budget: z.ZodOptional<z.ZodObject<{
223
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
224
+ cap: z.ZodNumber;
225
+ window: z.ZodOptional<z.ZodObject<{
226
+ kind: z.ZodEnum<["rolling", "fixed"]>;
227
+ durationSec: z.ZodNumber;
228
+ }, "strip", z.ZodTypeAny, {
229
+ kind: "rolling" | "fixed";
230
+ durationSec: number;
231
+ }, {
232
+ kind: "rolling" | "fixed";
233
+ durationSec: number;
234
+ }>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ unit: "USD" | "ops" | "points";
237
+ cap: number;
238
+ window?: {
239
+ kind: "rolling" | "fixed";
240
+ durationSec: number;
241
+ } | undefined;
242
+ }, {
243
+ unit: "USD" | "ops" | "points";
244
+ cap: number;
245
+ window?: {
246
+ kind: "rolling" | "fixed";
247
+ durationSec: number;
248
+ } | undefined;
249
+ }>>;
250
+ scopes: z.ZodArray<z.ZodObject<{
251
+ resource: z.ZodString;
252
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
253
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ resource: string;
256
+ matcher: "exact" | "prefix" | "regex";
257
+ constraints?: Record<string, any> | undefined;
258
+ }, {
259
+ resource: string;
260
+ matcher: "exact" | "prefix" | "regex";
261
+ constraints?: Record<string, any> | undefined;
262
+ }>, "many">;
263
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
264
+ budget: z.ZodOptional<z.ZodObject<{
265
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
266
+ cap: z.ZodNumber;
267
+ window: z.ZodOptional<z.ZodObject<{
268
+ kind: z.ZodEnum<["rolling", "fixed"]>;
269
+ durationSec: z.ZodNumber;
270
+ }, "strip", z.ZodTypeAny, {
271
+ kind: "rolling" | "fixed";
272
+ durationSec: number;
273
+ }, {
274
+ kind: "rolling" | "fixed";
275
+ durationSec: number;
276
+ }>>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ unit: "USD" | "ops" | "points";
279
+ cap: number;
280
+ window?: {
281
+ kind: "rolling" | "fixed";
282
+ durationSec: number;
283
+ } | undefined;
284
+ }, {
285
+ unit: "USD" | "ops" | "points";
286
+ cap: number;
287
+ window?: {
288
+ kind: "rolling" | "fixed";
289
+ durationSec: number;
290
+ } | undefined;
291
+ }>>;
292
+ scopes: z.ZodArray<z.ZodObject<{
293
+ resource: z.ZodString;
294
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
295
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
296
+ }, "strip", z.ZodTypeAny, {
297
+ resource: string;
298
+ matcher: "exact" | "prefix" | "regex";
299
+ constraints?: Record<string, any> | undefined;
300
+ }, {
301
+ resource: string;
302
+ matcher: "exact" | "prefix" | "regex";
303
+ constraints?: Record<string, any> | undefined;
304
+ }>, "many">;
305
+ }, z.ZodTypeAny, "passthrough">>;
306
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
307
+ notBefore: z.ZodOptional<z.ZodNumber>;
308
+ notAfter: z.ZodOptional<z.ZodNumber>;
309
+ crisp: z.ZodObject<{
310
+ budget: z.ZodOptional<z.ZodObject<{
311
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
312
+ cap: z.ZodNumber;
313
+ window: z.ZodOptional<z.ZodObject<{
314
+ kind: z.ZodEnum<["rolling", "fixed"]>;
315
+ durationSec: z.ZodNumber;
316
+ }, "strip", z.ZodTypeAny, {
317
+ kind: "rolling" | "fixed";
318
+ durationSec: number;
319
+ }, {
320
+ kind: "rolling" | "fixed";
321
+ durationSec: number;
322
+ }>>;
323
+ }, "strip", z.ZodTypeAny, {
324
+ unit: "USD" | "ops" | "points";
325
+ cap: number;
326
+ window?: {
327
+ kind: "rolling" | "fixed";
328
+ durationSec: number;
329
+ } | undefined;
330
+ }, {
331
+ unit: "USD" | "ops" | "points";
332
+ cap: number;
333
+ window?: {
334
+ kind: "rolling" | "fixed";
335
+ durationSec: number;
336
+ } | undefined;
337
+ }>>;
338
+ scopes: z.ZodArray<z.ZodObject<{
339
+ resource: z.ZodString;
340
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
341
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ resource: string;
344
+ matcher: "exact" | "prefix" | "regex";
345
+ constraints?: Record<string, any> | undefined;
346
+ }, {
347
+ resource: string;
348
+ matcher: "exact" | "prefix" | "regex";
349
+ constraints?: Record<string, any> | undefined;
350
+ }>, "many">;
351
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
352
+ budget: z.ZodOptional<z.ZodObject<{
353
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
354
+ cap: z.ZodNumber;
355
+ window: z.ZodOptional<z.ZodObject<{
356
+ kind: z.ZodEnum<["rolling", "fixed"]>;
357
+ durationSec: z.ZodNumber;
358
+ }, "strip", z.ZodTypeAny, {
359
+ kind: "rolling" | "fixed";
360
+ durationSec: number;
361
+ }, {
362
+ kind: "rolling" | "fixed";
363
+ durationSec: number;
364
+ }>>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ unit: "USD" | "ops" | "points";
367
+ cap: number;
368
+ window?: {
369
+ kind: "rolling" | "fixed";
370
+ durationSec: number;
371
+ } | undefined;
372
+ }, {
373
+ unit: "USD" | "ops" | "points";
374
+ cap: number;
375
+ window?: {
376
+ kind: "rolling" | "fixed";
377
+ durationSec: number;
378
+ } | undefined;
379
+ }>>;
380
+ scopes: z.ZodArray<z.ZodObject<{
381
+ resource: z.ZodString;
382
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
383
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
384
+ }, "strip", z.ZodTypeAny, {
385
+ resource: string;
386
+ matcher: "exact" | "prefix" | "regex";
387
+ constraints?: Record<string, any> | undefined;
388
+ }, {
389
+ resource: string;
390
+ matcher: "exact" | "prefix" | "regex";
391
+ constraints?: Record<string, any> | undefined;
392
+ }>, "many">;
393
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
394
+ budget: z.ZodOptional<z.ZodObject<{
395
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
396
+ cap: z.ZodNumber;
397
+ window: z.ZodOptional<z.ZodObject<{
398
+ kind: z.ZodEnum<["rolling", "fixed"]>;
399
+ durationSec: z.ZodNumber;
400
+ }, "strip", z.ZodTypeAny, {
401
+ kind: "rolling" | "fixed";
402
+ durationSec: number;
403
+ }, {
404
+ kind: "rolling" | "fixed";
405
+ durationSec: number;
406
+ }>>;
407
+ }, "strip", z.ZodTypeAny, {
408
+ unit: "USD" | "ops" | "points";
409
+ cap: number;
410
+ window?: {
411
+ kind: "rolling" | "fixed";
412
+ durationSec: number;
413
+ } | undefined;
414
+ }, {
415
+ unit: "USD" | "ops" | "points";
416
+ cap: number;
417
+ window?: {
418
+ kind: "rolling" | "fixed";
419
+ durationSec: number;
420
+ } | undefined;
421
+ }>>;
422
+ scopes: z.ZodArray<z.ZodObject<{
423
+ resource: z.ZodString;
424
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
425
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ resource: string;
428
+ matcher: "exact" | "prefix" | "regex";
429
+ constraints?: Record<string, any> | undefined;
430
+ }, {
431
+ resource: string;
432
+ matcher: "exact" | "prefix" | "regex";
433
+ constraints?: Record<string, any> | undefined;
434
+ }>, "many">;
435
+ }, z.ZodTypeAny, "passthrough">>;
436
+ }, z.ZodTypeAny, "passthrough">>;
437
+ /** Detached JWS signature over canonical delegation document */
438
+ signature: z.ZodString;
439
+ /** Current status of the delegation */
440
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
441
+ /** Timestamp when created (milliseconds since epoch) */
442
+ createdAt: z.ZodOptional<z.ZodNumber>;
443
+ /** Timestamp when revoked (if status is revoked) */
444
+ revokedAt: z.ZodOptional<z.ZodNumber>;
445
+ /** Optional reason for revocation */
446
+ revokedReason: z.ZodOptional<z.ZodString>;
447
+ /** Optional metadata */
448
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
449
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
450
+ /** Unique identifier for the delegation */
451
+ id: z.ZodString;
452
+ /** DID of the delegator (issuer, e.g., merchant/user) */
453
+ issuerDid: z.ZodString;
454
+ /** DID of the delegatee (subject, e.g., agent) */
455
+ subjectDid: z.ZodString;
456
+ /** Optional controller (user account ID or DID) */
457
+ controller: z.ZodOptional<z.ZodString>;
458
+ /** ID of the backing Verifiable Credential */
459
+ vcId: z.ZodString;
460
+ /** Optional parent delegation ID for chain tracking */
461
+ parentId: z.ZodOptional<z.ZodString>;
462
+ /** CRISP constraints on this delegation */
463
+ constraints: z.ZodObject<{
464
+ notBefore: z.ZodOptional<z.ZodNumber>;
465
+ notAfter: z.ZodOptional<z.ZodNumber>;
466
+ crisp: z.ZodObject<{
467
+ budget: z.ZodOptional<z.ZodObject<{
468
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
469
+ cap: z.ZodNumber;
470
+ window: z.ZodOptional<z.ZodObject<{
471
+ kind: z.ZodEnum<["rolling", "fixed"]>;
472
+ durationSec: z.ZodNumber;
473
+ }, "strip", z.ZodTypeAny, {
474
+ kind: "rolling" | "fixed";
475
+ durationSec: number;
476
+ }, {
477
+ kind: "rolling" | "fixed";
478
+ durationSec: number;
479
+ }>>;
480
+ }, "strip", z.ZodTypeAny, {
481
+ unit: "USD" | "ops" | "points";
482
+ cap: number;
483
+ window?: {
484
+ kind: "rolling" | "fixed";
485
+ durationSec: number;
486
+ } | undefined;
487
+ }, {
488
+ unit: "USD" | "ops" | "points";
489
+ cap: number;
490
+ window?: {
491
+ kind: "rolling" | "fixed";
492
+ durationSec: number;
493
+ } | undefined;
494
+ }>>;
495
+ scopes: z.ZodArray<z.ZodObject<{
496
+ resource: z.ZodString;
497
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
498
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ resource: string;
501
+ matcher: "exact" | "prefix" | "regex";
502
+ constraints?: Record<string, any> | undefined;
503
+ }, {
504
+ resource: string;
505
+ matcher: "exact" | "prefix" | "regex";
506
+ constraints?: Record<string, any> | undefined;
507
+ }>, "many">;
508
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
509
+ budget: z.ZodOptional<z.ZodObject<{
510
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
511
+ cap: z.ZodNumber;
512
+ window: z.ZodOptional<z.ZodObject<{
513
+ kind: z.ZodEnum<["rolling", "fixed"]>;
514
+ durationSec: z.ZodNumber;
515
+ }, "strip", z.ZodTypeAny, {
516
+ kind: "rolling" | "fixed";
517
+ durationSec: number;
518
+ }, {
519
+ kind: "rolling" | "fixed";
520
+ durationSec: number;
521
+ }>>;
522
+ }, "strip", z.ZodTypeAny, {
523
+ unit: "USD" | "ops" | "points";
524
+ cap: number;
525
+ window?: {
526
+ kind: "rolling" | "fixed";
527
+ durationSec: number;
528
+ } | undefined;
529
+ }, {
530
+ unit: "USD" | "ops" | "points";
531
+ cap: number;
532
+ window?: {
533
+ kind: "rolling" | "fixed";
534
+ durationSec: number;
535
+ } | undefined;
536
+ }>>;
537
+ scopes: z.ZodArray<z.ZodObject<{
538
+ resource: z.ZodString;
539
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
540
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
541
+ }, "strip", z.ZodTypeAny, {
542
+ resource: string;
543
+ matcher: "exact" | "prefix" | "regex";
544
+ constraints?: Record<string, any> | undefined;
545
+ }, {
546
+ resource: string;
547
+ matcher: "exact" | "prefix" | "regex";
548
+ constraints?: Record<string, any> | undefined;
549
+ }>, "many">;
550
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
551
+ budget: z.ZodOptional<z.ZodObject<{
552
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
553
+ cap: z.ZodNumber;
554
+ window: z.ZodOptional<z.ZodObject<{
555
+ kind: z.ZodEnum<["rolling", "fixed"]>;
556
+ durationSec: z.ZodNumber;
557
+ }, "strip", z.ZodTypeAny, {
558
+ kind: "rolling" | "fixed";
559
+ durationSec: number;
560
+ }, {
561
+ kind: "rolling" | "fixed";
562
+ durationSec: number;
563
+ }>>;
564
+ }, "strip", z.ZodTypeAny, {
565
+ unit: "USD" | "ops" | "points";
566
+ cap: number;
567
+ window?: {
568
+ kind: "rolling" | "fixed";
569
+ durationSec: number;
570
+ } | undefined;
571
+ }, {
572
+ unit: "USD" | "ops" | "points";
573
+ cap: number;
574
+ window?: {
575
+ kind: "rolling" | "fixed";
576
+ durationSec: number;
577
+ } | undefined;
578
+ }>>;
579
+ scopes: z.ZodArray<z.ZodObject<{
580
+ resource: z.ZodString;
581
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
582
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
583
+ }, "strip", z.ZodTypeAny, {
584
+ resource: string;
585
+ matcher: "exact" | "prefix" | "regex";
586
+ constraints?: Record<string, any> | undefined;
587
+ }, {
588
+ resource: string;
589
+ matcher: "exact" | "prefix" | "regex";
590
+ constraints?: Record<string, any> | undefined;
591
+ }>, "many">;
592
+ }, z.ZodTypeAny, "passthrough">>;
593
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
594
+ notBefore: z.ZodOptional<z.ZodNumber>;
595
+ notAfter: z.ZodOptional<z.ZodNumber>;
596
+ crisp: z.ZodObject<{
597
+ budget: z.ZodOptional<z.ZodObject<{
598
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
599
+ cap: z.ZodNumber;
600
+ window: z.ZodOptional<z.ZodObject<{
601
+ kind: z.ZodEnum<["rolling", "fixed"]>;
602
+ durationSec: z.ZodNumber;
603
+ }, "strip", z.ZodTypeAny, {
604
+ kind: "rolling" | "fixed";
605
+ durationSec: number;
606
+ }, {
607
+ kind: "rolling" | "fixed";
608
+ durationSec: number;
609
+ }>>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ unit: "USD" | "ops" | "points";
612
+ cap: number;
613
+ window?: {
614
+ kind: "rolling" | "fixed";
615
+ durationSec: number;
616
+ } | undefined;
617
+ }, {
618
+ unit: "USD" | "ops" | "points";
619
+ cap: number;
620
+ window?: {
621
+ kind: "rolling" | "fixed";
622
+ durationSec: number;
623
+ } | undefined;
624
+ }>>;
625
+ scopes: z.ZodArray<z.ZodObject<{
626
+ resource: z.ZodString;
627
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
628
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
629
+ }, "strip", z.ZodTypeAny, {
630
+ resource: string;
631
+ matcher: "exact" | "prefix" | "regex";
632
+ constraints?: Record<string, any> | undefined;
633
+ }, {
634
+ resource: string;
635
+ matcher: "exact" | "prefix" | "regex";
636
+ constraints?: Record<string, any> | undefined;
637
+ }>, "many">;
638
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
639
+ budget: z.ZodOptional<z.ZodObject<{
640
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
641
+ cap: z.ZodNumber;
642
+ window: z.ZodOptional<z.ZodObject<{
643
+ kind: z.ZodEnum<["rolling", "fixed"]>;
644
+ durationSec: z.ZodNumber;
645
+ }, "strip", z.ZodTypeAny, {
646
+ kind: "rolling" | "fixed";
647
+ durationSec: number;
648
+ }, {
649
+ kind: "rolling" | "fixed";
650
+ durationSec: number;
651
+ }>>;
652
+ }, "strip", z.ZodTypeAny, {
653
+ unit: "USD" | "ops" | "points";
654
+ cap: number;
655
+ window?: {
656
+ kind: "rolling" | "fixed";
657
+ durationSec: number;
658
+ } | undefined;
659
+ }, {
660
+ unit: "USD" | "ops" | "points";
661
+ cap: number;
662
+ window?: {
663
+ kind: "rolling" | "fixed";
664
+ durationSec: number;
665
+ } | undefined;
666
+ }>>;
667
+ scopes: z.ZodArray<z.ZodObject<{
668
+ resource: z.ZodString;
669
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
670
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ resource: string;
673
+ matcher: "exact" | "prefix" | "regex";
674
+ constraints?: Record<string, any> | undefined;
675
+ }, {
676
+ resource: string;
677
+ matcher: "exact" | "prefix" | "regex";
678
+ constraints?: Record<string, any> | undefined;
679
+ }>, "many">;
680
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
681
+ budget: z.ZodOptional<z.ZodObject<{
682
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
683
+ cap: z.ZodNumber;
684
+ window: z.ZodOptional<z.ZodObject<{
685
+ kind: z.ZodEnum<["rolling", "fixed"]>;
686
+ durationSec: z.ZodNumber;
687
+ }, "strip", z.ZodTypeAny, {
688
+ kind: "rolling" | "fixed";
689
+ durationSec: number;
690
+ }, {
691
+ kind: "rolling" | "fixed";
692
+ durationSec: number;
693
+ }>>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ unit: "USD" | "ops" | "points";
696
+ cap: number;
697
+ window?: {
698
+ kind: "rolling" | "fixed";
699
+ durationSec: number;
700
+ } | undefined;
701
+ }, {
702
+ unit: "USD" | "ops" | "points";
703
+ cap: number;
704
+ window?: {
705
+ kind: "rolling" | "fixed";
706
+ durationSec: number;
707
+ } | undefined;
708
+ }>>;
709
+ scopes: z.ZodArray<z.ZodObject<{
710
+ resource: z.ZodString;
711
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
712
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
713
+ }, "strip", z.ZodTypeAny, {
714
+ resource: string;
715
+ matcher: "exact" | "prefix" | "regex";
716
+ constraints?: Record<string, any> | undefined;
717
+ }, {
718
+ resource: string;
719
+ matcher: "exact" | "prefix" | "regex";
720
+ constraints?: Record<string, any> | undefined;
721
+ }>, "many">;
722
+ }, z.ZodTypeAny, "passthrough">>;
723
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
724
+ notBefore: z.ZodOptional<z.ZodNumber>;
725
+ notAfter: z.ZodOptional<z.ZodNumber>;
726
+ crisp: z.ZodObject<{
727
+ budget: z.ZodOptional<z.ZodObject<{
728
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
729
+ cap: z.ZodNumber;
730
+ window: z.ZodOptional<z.ZodObject<{
731
+ kind: z.ZodEnum<["rolling", "fixed"]>;
732
+ durationSec: z.ZodNumber;
733
+ }, "strip", z.ZodTypeAny, {
734
+ kind: "rolling" | "fixed";
735
+ durationSec: number;
736
+ }, {
737
+ kind: "rolling" | "fixed";
738
+ durationSec: number;
739
+ }>>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ unit: "USD" | "ops" | "points";
742
+ cap: number;
743
+ window?: {
744
+ kind: "rolling" | "fixed";
745
+ durationSec: number;
746
+ } | undefined;
747
+ }, {
748
+ unit: "USD" | "ops" | "points";
749
+ cap: number;
750
+ window?: {
751
+ kind: "rolling" | "fixed";
752
+ durationSec: number;
753
+ } | undefined;
754
+ }>>;
755
+ scopes: z.ZodArray<z.ZodObject<{
756
+ resource: z.ZodString;
757
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
758
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
759
+ }, "strip", z.ZodTypeAny, {
760
+ resource: string;
761
+ matcher: "exact" | "prefix" | "regex";
762
+ constraints?: Record<string, any> | undefined;
763
+ }, {
764
+ resource: string;
765
+ matcher: "exact" | "prefix" | "regex";
766
+ constraints?: Record<string, any> | undefined;
767
+ }>, "many">;
768
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
769
+ budget: z.ZodOptional<z.ZodObject<{
770
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
771
+ cap: z.ZodNumber;
772
+ window: z.ZodOptional<z.ZodObject<{
773
+ kind: z.ZodEnum<["rolling", "fixed"]>;
774
+ durationSec: z.ZodNumber;
775
+ }, "strip", z.ZodTypeAny, {
776
+ kind: "rolling" | "fixed";
777
+ durationSec: number;
778
+ }, {
779
+ kind: "rolling" | "fixed";
780
+ durationSec: number;
781
+ }>>;
782
+ }, "strip", z.ZodTypeAny, {
783
+ unit: "USD" | "ops" | "points";
784
+ cap: number;
785
+ window?: {
786
+ kind: "rolling" | "fixed";
787
+ durationSec: number;
788
+ } | undefined;
789
+ }, {
790
+ unit: "USD" | "ops" | "points";
791
+ cap: number;
792
+ window?: {
793
+ kind: "rolling" | "fixed";
794
+ durationSec: number;
795
+ } | undefined;
796
+ }>>;
797
+ scopes: z.ZodArray<z.ZodObject<{
798
+ resource: z.ZodString;
799
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
800
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
801
+ }, "strip", z.ZodTypeAny, {
802
+ resource: string;
803
+ matcher: "exact" | "prefix" | "regex";
804
+ constraints?: Record<string, any> | undefined;
805
+ }, {
806
+ resource: string;
807
+ matcher: "exact" | "prefix" | "regex";
808
+ constraints?: Record<string, any> | undefined;
809
+ }>, "many">;
810
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
811
+ budget: z.ZodOptional<z.ZodObject<{
812
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
813
+ cap: z.ZodNumber;
814
+ window: z.ZodOptional<z.ZodObject<{
815
+ kind: z.ZodEnum<["rolling", "fixed"]>;
816
+ durationSec: z.ZodNumber;
817
+ }, "strip", z.ZodTypeAny, {
818
+ kind: "rolling" | "fixed";
819
+ durationSec: number;
820
+ }, {
821
+ kind: "rolling" | "fixed";
822
+ durationSec: number;
823
+ }>>;
824
+ }, "strip", z.ZodTypeAny, {
825
+ unit: "USD" | "ops" | "points";
826
+ cap: number;
827
+ window?: {
828
+ kind: "rolling" | "fixed";
829
+ durationSec: number;
830
+ } | undefined;
831
+ }, {
832
+ unit: "USD" | "ops" | "points";
833
+ cap: number;
834
+ window?: {
835
+ kind: "rolling" | "fixed";
836
+ durationSec: number;
837
+ } | undefined;
838
+ }>>;
839
+ scopes: z.ZodArray<z.ZodObject<{
840
+ resource: z.ZodString;
841
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
842
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
843
+ }, "strip", z.ZodTypeAny, {
844
+ resource: string;
845
+ matcher: "exact" | "prefix" | "regex";
846
+ constraints?: Record<string, any> | undefined;
847
+ }, {
848
+ resource: string;
849
+ matcher: "exact" | "prefix" | "regex";
850
+ constraints?: Record<string, any> | undefined;
851
+ }>, "many">;
852
+ }, z.ZodTypeAny, "passthrough">>;
853
+ }, z.ZodTypeAny, "passthrough">>;
854
+ /** Detached JWS signature over canonical delegation document */
855
+ signature: z.ZodString;
856
+ /** Current status of the delegation */
857
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
858
+ /** Timestamp when created (milliseconds since epoch) */
859
+ createdAt: z.ZodOptional<z.ZodNumber>;
860
+ /** Timestamp when revoked (if status is revoked) */
861
+ revokedAt: z.ZodOptional<z.ZodNumber>;
862
+ /** Optional reason for revocation */
863
+ revokedReason: z.ZodOptional<z.ZodString>;
864
+ /** Optional metadata */
865
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
866
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
867
+ /** Unique identifier for the delegation */
868
+ id: z.ZodString;
869
+ /** DID of the delegator (issuer, e.g., merchant/user) */
870
+ issuerDid: z.ZodString;
871
+ /** DID of the delegatee (subject, e.g., agent) */
872
+ subjectDid: z.ZodString;
873
+ /** Optional controller (user account ID or DID) */
874
+ controller: z.ZodOptional<z.ZodString>;
875
+ /** ID of the backing Verifiable Credential */
876
+ vcId: z.ZodString;
877
+ /** Optional parent delegation ID for chain tracking */
878
+ parentId: z.ZodOptional<z.ZodString>;
879
+ /** CRISP constraints on this delegation */
880
+ constraints: z.ZodObject<{
881
+ notBefore: z.ZodOptional<z.ZodNumber>;
882
+ notAfter: z.ZodOptional<z.ZodNumber>;
883
+ crisp: z.ZodObject<{
884
+ budget: z.ZodOptional<z.ZodObject<{
885
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
886
+ cap: z.ZodNumber;
887
+ window: z.ZodOptional<z.ZodObject<{
888
+ kind: z.ZodEnum<["rolling", "fixed"]>;
889
+ durationSec: z.ZodNumber;
890
+ }, "strip", z.ZodTypeAny, {
891
+ kind: "rolling" | "fixed";
892
+ durationSec: number;
893
+ }, {
894
+ kind: "rolling" | "fixed";
895
+ durationSec: number;
896
+ }>>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ unit: "USD" | "ops" | "points";
899
+ cap: number;
900
+ window?: {
901
+ kind: "rolling" | "fixed";
902
+ durationSec: number;
903
+ } | undefined;
904
+ }, {
905
+ unit: "USD" | "ops" | "points";
906
+ cap: number;
907
+ window?: {
908
+ kind: "rolling" | "fixed";
909
+ durationSec: number;
910
+ } | undefined;
911
+ }>>;
912
+ scopes: z.ZodArray<z.ZodObject<{
913
+ resource: z.ZodString;
914
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
915
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
916
+ }, "strip", z.ZodTypeAny, {
917
+ resource: string;
918
+ matcher: "exact" | "prefix" | "regex";
919
+ constraints?: Record<string, any> | undefined;
920
+ }, {
921
+ resource: string;
922
+ matcher: "exact" | "prefix" | "regex";
923
+ constraints?: Record<string, any> | undefined;
924
+ }>, "many">;
925
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
926
+ budget: z.ZodOptional<z.ZodObject<{
927
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
928
+ cap: z.ZodNumber;
929
+ window: z.ZodOptional<z.ZodObject<{
930
+ kind: z.ZodEnum<["rolling", "fixed"]>;
931
+ durationSec: z.ZodNumber;
932
+ }, "strip", z.ZodTypeAny, {
933
+ kind: "rolling" | "fixed";
934
+ durationSec: number;
935
+ }, {
936
+ kind: "rolling" | "fixed";
937
+ durationSec: number;
938
+ }>>;
939
+ }, "strip", z.ZodTypeAny, {
940
+ unit: "USD" | "ops" | "points";
941
+ cap: number;
942
+ window?: {
943
+ kind: "rolling" | "fixed";
944
+ durationSec: number;
945
+ } | undefined;
946
+ }, {
947
+ unit: "USD" | "ops" | "points";
948
+ cap: number;
949
+ window?: {
950
+ kind: "rolling" | "fixed";
951
+ durationSec: number;
952
+ } | undefined;
953
+ }>>;
954
+ scopes: z.ZodArray<z.ZodObject<{
955
+ resource: z.ZodString;
956
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
957
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
958
+ }, "strip", z.ZodTypeAny, {
959
+ resource: string;
960
+ matcher: "exact" | "prefix" | "regex";
961
+ constraints?: Record<string, any> | undefined;
962
+ }, {
963
+ resource: string;
964
+ matcher: "exact" | "prefix" | "regex";
965
+ constraints?: Record<string, any> | undefined;
966
+ }>, "many">;
967
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
968
+ budget: z.ZodOptional<z.ZodObject<{
969
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
970
+ cap: z.ZodNumber;
971
+ window: z.ZodOptional<z.ZodObject<{
972
+ kind: z.ZodEnum<["rolling", "fixed"]>;
973
+ durationSec: z.ZodNumber;
974
+ }, "strip", z.ZodTypeAny, {
975
+ kind: "rolling" | "fixed";
976
+ durationSec: number;
977
+ }, {
978
+ kind: "rolling" | "fixed";
979
+ durationSec: number;
980
+ }>>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ unit: "USD" | "ops" | "points";
983
+ cap: number;
984
+ window?: {
985
+ kind: "rolling" | "fixed";
986
+ durationSec: number;
987
+ } | undefined;
988
+ }, {
989
+ unit: "USD" | "ops" | "points";
990
+ cap: number;
991
+ window?: {
992
+ kind: "rolling" | "fixed";
993
+ durationSec: number;
994
+ } | undefined;
995
+ }>>;
996
+ scopes: z.ZodArray<z.ZodObject<{
997
+ resource: z.ZodString;
998
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
999
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ resource: string;
1002
+ matcher: "exact" | "prefix" | "regex";
1003
+ constraints?: Record<string, any> | undefined;
1004
+ }, {
1005
+ resource: string;
1006
+ matcher: "exact" | "prefix" | "regex";
1007
+ constraints?: Record<string, any> | undefined;
1008
+ }>, "many">;
1009
+ }, z.ZodTypeAny, "passthrough">>;
1010
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1011
+ notBefore: z.ZodOptional<z.ZodNumber>;
1012
+ notAfter: z.ZodOptional<z.ZodNumber>;
1013
+ crisp: z.ZodObject<{
1014
+ budget: z.ZodOptional<z.ZodObject<{
1015
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1016
+ cap: z.ZodNumber;
1017
+ window: z.ZodOptional<z.ZodObject<{
1018
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1019
+ durationSec: z.ZodNumber;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ kind: "rolling" | "fixed";
1022
+ durationSec: number;
1023
+ }, {
1024
+ kind: "rolling" | "fixed";
1025
+ durationSec: number;
1026
+ }>>;
1027
+ }, "strip", z.ZodTypeAny, {
1028
+ unit: "USD" | "ops" | "points";
1029
+ cap: number;
1030
+ window?: {
1031
+ kind: "rolling" | "fixed";
1032
+ durationSec: number;
1033
+ } | undefined;
1034
+ }, {
1035
+ unit: "USD" | "ops" | "points";
1036
+ cap: number;
1037
+ window?: {
1038
+ kind: "rolling" | "fixed";
1039
+ durationSec: number;
1040
+ } | undefined;
1041
+ }>>;
1042
+ scopes: z.ZodArray<z.ZodObject<{
1043
+ resource: z.ZodString;
1044
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1045
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1046
+ }, "strip", z.ZodTypeAny, {
1047
+ resource: string;
1048
+ matcher: "exact" | "prefix" | "regex";
1049
+ constraints?: Record<string, any> | undefined;
1050
+ }, {
1051
+ resource: string;
1052
+ matcher: "exact" | "prefix" | "regex";
1053
+ constraints?: Record<string, any> | undefined;
1054
+ }>, "many">;
1055
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1056
+ budget: z.ZodOptional<z.ZodObject<{
1057
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1058
+ cap: z.ZodNumber;
1059
+ window: z.ZodOptional<z.ZodObject<{
1060
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1061
+ durationSec: z.ZodNumber;
1062
+ }, "strip", z.ZodTypeAny, {
1063
+ kind: "rolling" | "fixed";
1064
+ durationSec: number;
1065
+ }, {
1066
+ kind: "rolling" | "fixed";
1067
+ durationSec: number;
1068
+ }>>;
1069
+ }, "strip", z.ZodTypeAny, {
1070
+ unit: "USD" | "ops" | "points";
1071
+ cap: number;
1072
+ window?: {
1073
+ kind: "rolling" | "fixed";
1074
+ durationSec: number;
1075
+ } | undefined;
1076
+ }, {
1077
+ unit: "USD" | "ops" | "points";
1078
+ cap: number;
1079
+ window?: {
1080
+ kind: "rolling" | "fixed";
1081
+ durationSec: number;
1082
+ } | undefined;
1083
+ }>>;
1084
+ scopes: z.ZodArray<z.ZodObject<{
1085
+ resource: z.ZodString;
1086
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1087
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1088
+ }, "strip", z.ZodTypeAny, {
1089
+ resource: string;
1090
+ matcher: "exact" | "prefix" | "regex";
1091
+ constraints?: Record<string, any> | undefined;
1092
+ }, {
1093
+ resource: string;
1094
+ matcher: "exact" | "prefix" | "regex";
1095
+ constraints?: Record<string, any> | undefined;
1096
+ }>, "many">;
1097
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1098
+ budget: z.ZodOptional<z.ZodObject<{
1099
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1100
+ cap: z.ZodNumber;
1101
+ window: z.ZodOptional<z.ZodObject<{
1102
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1103
+ durationSec: z.ZodNumber;
1104
+ }, "strip", z.ZodTypeAny, {
1105
+ kind: "rolling" | "fixed";
1106
+ durationSec: number;
1107
+ }, {
1108
+ kind: "rolling" | "fixed";
1109
+ durationSec: number;
1110
+ }>>;
1111
+ }, "strip", z.ZodTypeAny, {
1112
+ unit: "USD" | "ops" | "points";
1113
+ cap: number;
1114
+ window?: {
1115
+ kind: "rolling" | "fixed";
1116
+ durationSec: number;
1117
+ } | undefined;
1118
+ }, {
1119
+ unit: "USD" | "ops" | "points";
1120
+ cap: number;
1121
+ window?: {
1122
+ kind: "rolling" | "fixed";
1123
+ durationSec: number;
1124
+ } | undefined;
1125
+ }>>;
1126
+ scopes: z.ZodArray<z.ZodObject<{
1127
+ resource: z.ZodString;
1128
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1129
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ resource: string;
1132
+ matcher: "exact" | "prefix" | "regex";
1133
+ constraints?: Record<string, any> | undefined;
1134
+ }, {
1135
+ resource: string;
1136
+ matcher: "exact" | "prefix" | "regex";
1137
+ constraints?: Record<string, any> | undefined;
1138
+ }>, "many">;
1139
+ }, z.ZodTypeAny, "passthrough">>;
1140
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1141
+ notBefore: z.ZodOptional<z.ZodNumber>;
1142
+ notAfter: z.ZodOptional<z.ZodNumber>;
1143
+ crisp: z.ZodObject<{
1144
+ budget: z.ZodOptional<z.ZodObject<{
1145
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1146
+ cap: z.ZodNumber;
1147
+ window: z.ZodOptional<z.ZodObject<{
1148
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1149
+ durationSec: z.ZodNumber;
1150
+ }, "strip", z.ZodTypeAny, {
1151
+ kind: "rolling" | "fixed";
1152
+ durationSec: number;
1153
+ }, {
1154
+ kind: "rolling" | "fixed";
1155
+ durationSec: number;
1156
+ }>>;
1157
+ }, "strip", z.ZodTypeAny, {
1158
+ unit: "USD" | "ops" | "points";
1159
+ cap: number;
1160
+ window?: {
1161
+ kind: "rolling" | "fixed";
1162
+ durationSec: number;
1163
+ } | undefined;
1164
+ }, {
1165
+ unit: "USD" | "ops" | "points";
1166
+ cap: number;
1167
+ window?: {
1168
+ kind: "rolling" | "fixed";
1169
+ durationSec: number;
1170
+ } | undefined;
1171
+ }>>;
1172
+ scopes: z.ZodArray<z.ZodObject<{
1173
+ resource: z.ZodString;
1174
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1175
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1176
+ }, "strip", z.ZodTypeAny, {
1177
+ resource: string;
1178
+ matcher: "exact" | "prefix" | "regex";
1179
+ constraints?: Record<string, any> | undefined;
1180
+ }, {
1181
+ resource: string;
1182
+ matcher: "exact" | "prefix" | "regex";
1183
+ constraints?: Record<string, any> | undefined;
1184
+ }>, "many">;
1185
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1186
+ budget: z.ZodOptional<z.ZodObject<{
1187
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1188
+ cap: z.ZodNumber;
1189
+ window: z.ZodOptional<z.ZodObject<{
1190
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1191
+ durationSec: z.ZodNumber;
1192
+ }, "strip", z.ZodTypeAny, {
1193
+ kind: "rolling" | "fixed";
1194
+ durationSec: number;
1195
+ }, {
1196
+ kind: "rolling" | "fixed";
1197
+ durationSec: number;
1198
+ }>>;
1199
+ }, "strip", z.ZodTypeAny, {
1200
+ unit: "USD" | "ops" | "points";
1201
+ cap: number;
1202
+ window?: {
1203
+ kind: "rolling" | "fixed";
1204
+ durationSec: number;
1205
+ } | undefined;
1206
+ }, {
1207
+ unit: "USD" | "ops" | "points";
1208
+ cap: number;
1209
+ window?: {
1210
+ kind: "rolling" | "fixed";
1211
+ durationSec: number;
1212
+ } | undefined;
1213
+ }>>;
1214
+ scopes: z.ZodArray<z.ZodObject<{
1215
+ resource: z.ZodString;
1216
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1217
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1218
+ }, "strip", z.ZodTypeAny, {
1219
+ resource: string;
1220
+ matcher: "exact" | "prefix" | "regex";
1221
+ constraints?: Record<string, any> | undefined;
1222
+ }, {
1223
+ resource: string;
1224
+ matcher: "exact" | "prefix" | "regex";
1225
+ constraints?: Record<string, any> | undefined;
1226
+ }>, "many">;
1227
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1228
+ budget: z.ZodOptional<z.ZodObject<{
1229
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1230
+ cap: z.ZodNumber;
1231
+ window: z.ZodOptional<z.ZodObject<{
1232
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1233
+ durationSec: z.ZodNumber;
1234
+ }, "strip", z.ZodTypeAny, {
1235
+ kind: "rolling" | "fixed";
1236
+ durationSec: number;
1237
+ }, {
1238
+ kind: "rolling" | "fixed";
1239
+ durationSec: number;
1240
+ }>>;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ unit: "USD" | "ops" | "points";
1243
+ cap: number;
1244
+ window?: {
1245
+ kind: "rolling" | "fixed";
1246
+ durationSec: number;
1247
+ } | undefined;
1248
+ }, {
1249
+ unit: "USD" | "ops" | "points";
1250
+ cap: number;
1251
+ window?: {
1252
+ kind: "rolling" | "fixed";
1253
+ durationSec: number;
1254
+ } | undefined;
1255
+ }>>;
1256
+ scopes: z.ZodArray<z.ZodObject<{
1257
+ resource: z.ZodString;
1258
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1259
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1260
+ }, "strip", z.ZodTypeAny, {
1261
+ resource: string;
1262
+ matcher: "exact" | "prefix" | "regex";
1263
+ constraints?: Record<string, any> | undefined;
1264
+ }, {
1265
+ resource: string;
1266
+ matcher: "exact" | "prefix" | "regex";
1267
+ constraints?: Record<string, any> | undefined;
1268
+ }>, "many">;
1269
+ }, z.ZodTypeAny, "passthrough">>;
1270
+ }, z.ZodTypeAny, "passthrough">>;
1271
+ /** Detached JWS signature over canonical delegation document */
1272
+ signature: z.ZodString;
1273
+ /** Current status of the delegation */
1274
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
1275
+ /** Timestamp when created (milliseconds since epoch) */
1276
+ createdAt: z.ZodOptional<z.ZodNumber>;
1277
+ /** Timestamp when revoked (if status is revoked) */
1278
+ revokedAt: z.ZodOptional<z.ZodNumber>;
1279
+ /** Optional reason for revocation */
1280
+ revokedReason: z.ZodOptional<z.ZodString>;
1281
+ /** Optional metadata */
1282
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1283
+ }, z.ZodTypeAny, "passthrough">>;
1284
+ export type DelegationRecord = z.infer<typeof DelegationRecordSchema>;
1285
+ /**
1286
+ * Delegation Chain Entry
1287
+ *
1288
+ * Represents a single link in a delegation chain
1289
+ */
1290
+ export declare const DelegationChainEntrySchema: z.ZodObject<{
1291
+ /** Delegation ID */
1292
+ delegationId: z.ZodString;
1293
+ /** Issuer DID */
1294
+ issuerDid: z.ZodString;
1295
+ /** Subject DID */
1296
+ subjectDid: z.ZodString;
1297
+ /** VC ID */
1298
+ vcId: z.ZodString;
1299
+ /** Depth in chain (0 = root) */
1300
+ depth: z.ZodNumber;
1301
+ /** Constraints */
1302
+ constraints: z.ZodObject<{
1303
+ notBefore: z.ZodOptional<z.ZodNumber>;
1304
+ notAfter: z.ZodOptional<z.ZodNumber>;
1305
+ crisp: z.ZodObject<{
1306
+ budget: z.ZodOptional<z.ZodObject<{
1307
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1308
+ cap: z.ZodNumber;
1309
+ window: z.ZodOptional<z.ZodObject<{
1310
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1311
+ durationSec: z.ZodNumber;
1312
+ }, "strip", z.ZodTypeAny, {
1313
+ kind: "rolling" | "fixed";
1314
+ durationSec: number;
1315
+ }, {
1316
+ kind: "rolling" | "fixed";
1317
+ durationSec: number;
1318
+ }>>;
1319
+ }, "strip", z.ZodTypeAny, {
1320
+ unit: "USD" | "ops" | "points";
1321
+ cap: number;
1322
+ window?: {
1323
+ kind: "rolling" | "fixed";
1324
+ durationSec: number;
1325
+ } | undefined;
1326
+ }, {
1327
+ unit: "USD" | "ops" | "points";
1328
+ cap: number;
1329
+ window?: {
1330
+ kind: "rolling" | "fixed";
1331
+ durationSec: number;
1332
+ } | undefined;
1333
+ }>>;
1334
+ scopes: z.ZodArray<z.ZodObject<{
1335
+ resource: z.ZodString;
1336
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1337
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1338
+ }, "strip", z.ZodTypeAny, {
1339
+ resource: string;
1340
+ matcher: "exact" | "prefix" | "regex";
1341
+ constraints?: Record<string, any> | undefined;
1342
+ }, {
1343
+ resource: string;
1344
+ matcher: "exact" | "prefix" | "regex";
1345
+ constraints?: Record<string, any> | undefined;
1346
+ }>, "many">;
1347
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1348
+ budget: z.ZodOptional<z.ZodObject<{
1349
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1350
+ cap: z.ZodNumber;
1351
+ window: z.ZodOptional<z.ZodObject<{
1352
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1353
+ durationSec: z.ZodNumber;
1354
+ }, "strip", z.ZodTypeAny, {
1355
+ kind: "rolling" | "fixed";
1356
+ durationSec: number;
1357
+ }, {
1358
+ kind: "rolling" | "fixed";
1359
+ durationSec: number;
1360
+ }>>;
1361
+ }, "strip", z.ZodTypeAny, {
1362
+ unit: "USD" | "ops" | "points";
1363
+ cap: number;
1364
+ window?: {
1365
+ kind: "rolling" | "fixed";
1366
+ durationSec: number;
1367
+ } | undefined;
1368
+ }, {
1369
+ unit: "USD" | "ops" | "points";
1370
+ cap: number;
1371
+ window?: {
1372
+ kind: "rolling" | "fixed";
1373
+ durationSec: number;
1374
+ } | undefined;
1375
+ }>>;
1376
+ scopes: z.ZodArray<z.ZodObject<{
1377
+ resource: z.ZodString;
1378
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1379
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1380
+ }, "strip", z.ZodTypeAny, {
1381
+ resource: string;
1382
+ matcher: "exact" | "prefix" | "regex";
1383
+ constraints?: Record<string, any> | undefined;
1384
+ }, {
1385
+ resource: string;
1386
+ matcher: "exact" | "prefix" | "regex";
1387
+ constraints?: Record<string, any> | undefined;
1388
+ }>, "many">;
1389
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1390
+ budget: z.ZodOptional<z.ZodObject<{
1391
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1392
+ cap: z.ZodNumber;
1393
+ window: z.ZodOptional<z.ZodObject<{
1394
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1395
+ durationSec: z.ZodNumber;
1396
+ }, "strip", z.ZodTypeAny, {
1397
+ kind: "rolling" | "fixed";
1398
+ durationSec: number;
1399
+ }, {
1400
+ kind: "rolling" | "fixed";
1401
+ durationSec: number;
1402
+ }>>;
1403
+ }, "strip", z.ZodTypeAny, {
1404
+ unit: "USD" | "ops" | "points";
1405
+ cap: number;
1406
+ window?: {
1407
+ kind: "rolling" | "fixed";
1408
+ durationSec: number;
1409
+ } | undefined;
1410
+ }, {
1411
+ unit: "USD" | "ops" | "points";
1412
+ cap: number;
1413
+ window?: {
1414
+ kind: "rolling" | "fixed";
1415
+ durationSec: number;
1416
+ } | undefined;
1417
+ }>>;
1418
+ scopes: z.ZodArray<z.ZodObject<{
1419
+ resource: z.ZodString;
1420
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1421
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1422
+ }, "strip", z.ZodTypeAny, {
1423
+ resource: string;
1424
+ matcher: "exact" | "prefix" | "regex";
1425
+ constraints?: Record<string, any> | undefined;
1426
+ }, {
1427
+ resource: string;
1428
+ matcher: "exact" | "prefix" | "regex";
1429
+ constraints?: Record<string, any> | undefined;
1430
+ }>, "many">;
1431
+ }, z.ZodTypeAny, "passthrough">>;
1432
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1433
+ notBefore: z.ZodOptional<z.ZodNumber>;
1434
+ notAfter: z.ZodOptional<z.ZodNumber>;
1435
+ crisp: z.ZodObject<{
1436
+ budget: z.ZodOptional<z.ZodObject<{
1437
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1438
+ cap: z.ZodNumber;
1439
+ window: z.ZodOptional<z.ZodObject<{
1440
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1441
+ durationSec: z.ZodNumber;
1442
+ }, "strip", z.ZodTypeAny, {
1443
+ kind: "rolling" | "fixed";
1444
+ durationSec: number;
1445
+ }, {
1446
+ kind: "rolling" | "fixed";
1447
+ durationSec: number;
1448
+ }>>;
1449
+ }, "strip", z.ZodTypeAny, {
1450
+ unit: "USD" | "ops" | "points";
1451
+ cap: number;
1452
+ window?: {
1453
+ kind: "rolling" | "fixed";
1454
+ durationSec: number;
1455
+ } | undefined;
1456
+ }, {
1457
+ unit: "USD" | "ops" | "points";
1458
+ cap: number;
1459
+ window?: {
1460
+ kind: "rolling" | "fixed";
1461
+ durationSec: number;
1462
+ } | undefined;
1463
+ }>>;
1464
+ scopes: z.ZodArray<z.ZodObject<{
1465
+ resource: z.ZodString;
1466
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1467
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1468
+ }, "strip", z.ZodTypeAny, {
1469
+ resource: string;
1470
+ matcher: "exact" | "prefix" | "regex";
1471
+ constraints?: Record<string, any> | undefined;
1472
+ }, {
1473
+ resource: string;
1474
+ matcher: "exact" | "prefix" | "regex";
1475
+ constraints?: Record<string, any> | undefined;
1476
+ }>, "many">;
1477
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1478
+ budget: z.ZodOptional<z.ZodObject<{
1479
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1480
+ cap: z.ZodNumber;
1481
+ window: z.ZodOptional<z.ZodObject<{
1482
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1483
+ durationSec: z.ZodNumber;
1484
+ }, "strip", z.ZodTypeAny, {
1485
+ kind: "rolling" | "fixed";
1486
+ durationSec: number;
1487
+ }, {
1488
+ kind: "rolling" | "fixed";
1489
+ durationSec: number;
1490
+ }>>;
1491
+ }, "strip", z.ZodTypeAny, {
1492
+ unit: "USD" | "ops" | "points";
1493
+ cap: number;
1494
+ window?: {
1495
+ kind: "rolling" | "fixed";
1496
+ durationSec: number;
1497
+ } | undefined;
1498
+ }, {
1499
+ unit: "USD" | "ops" | "points";
1500
+ cap: number;
1501
+ window?: {
1502
+ kind: "rolling" | "fixed";
1503
+ durationSec: number;
1504
+ } | undefined;
1505
+ }>>;
1506
+ scopes: z.ZodArray<z.ZodObject<{
1507
+ resource: z.ZodString;
1508
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1509
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1510
+ }, "strip", z.ZodTypeAny, {
1511
+ resource: string;
1512
+ matcher: "exact" | "prefix" | "regex";
1513
+ constraints?: Record<string, any> | undefined;
1514
+ }, {
1515
+ resource: string;
1516
+ matcher: "exact" | "prefix" | "regex";
1517
+ constraints?: Record<string, any> | undefined;
1518
+ }>, "many">;
1519
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1520
+ budget: z.ZodOptional<z.ZodObject<{
1521
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1522
+ cap: z.ZodNumber;
1523
+ window: z.ZodOptional<z.ZodObject<{
1524
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1525
+ durationSec: z.ZodNumber;
1526
+ }, "strip", z.ZodTypeAny, {
1527
+ kind: "rolling" | "fixed";
1528
+ durationSec: number;
1529
+ }, {
1530
+ kind: "rolling" | "fixed";
1531
+ durationSec: number;
1532
+ }>>;
1533
+ }, "strip", z.ZodTypeAny, {
1534
+ unit: "USD" | "ops" | "points";
1535
+ cap: number;
1536
+ window?: {
1537
+ kind: "rolling" | "fixed";
1538
+ durationSec: number;
1539
+ } | undefined;
1540
+ }, {
1541
+ unit: "USD" | "ops" | "points";
1542
+ cap: number;
1543
+ window?: {
1544
+ kind: "rolling" | "fixed";
1545
+ durationSec: number;
1546
+ } | undefined;
1547
+ }>>;
1548
+ scopes: z.ZodArray<z.ZodObject<{
1549
+ resource: z.ZodString;
1550
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1551
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1552
+ }, "strip", z.ZodTypeAny, {
1553
+ resource: string;
1554
+ matcher: "exact" | "prefix" | "regex";
1555
+ constraints?: Record<string, any> | undefined;
1556
+ }, {
1557
+ resource: string;
1558
+ matcher: "exact" | "prefix" | "regex";
1559
+ constraints?: Record<string, any> | undefined;
1560
+ }>, "many">;
1561
+ }, z.ZodTypeAny, "passthrough">>;
1562
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1563
+ notBefore: z.ZodOptional<z.ZodNumber>;
1564
+ notAfter: z.ZodOptional<z.ZodNumber>;
1565
+ crisp: z.ZodObject<{
1566
+ budget: z.ZodOptional<z.ZodObject<{
1567
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1568
+ cap: z.ZodNumber;
1569
+ window: z.ZodOptional<z.ZodObject<{
1570
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1571
+ durationSec: z.ZodNumber;
1572
+ }, "strip", z.ZodTypeAny, {
1573
+ kind: "rolling" | "fixed";
1574
+ durationSec: number;
1575
+ }, {
1576
+ kind: "rolling" | "fixed";
1577
+ durationSec: number;
1578
+ }>>;
1579
+ }, "strip", z.ZodTypeAny, {
1580
+ unit: "USD" | "ops" | "points";
1581
+ cap: number;
1582
+ window?: {
1583
+ kind: "rolling" | "fixed";
1584
+ durationSec: number;
1585
+ } | undefined;
1586
+ }, {
1587
+ unit: "USD" | "ops" | "points";
1588
+ cap: number;
1589
+ window?: {
1590
+ kind: "rolling" | "fixed";
1591
+ durationSec: number;
1592
+ } | undefined;
1593
+ }>>;
1594
+ scopes: z.ZodArray<z.ZodObject<{
1595
+ resource: z.ZodString;
1596
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1597
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1598
+ }, "strip", z.ZodTypeAny, {
1599
+ resource: string;
1600
+ matcher: "exact" | "prefix" | "regex";
1601
+ constraints?: Record<string, any> | undefined;
1602
+ }, {
1603
+ resource: string;
1604
+ matcher: "exact" | "prefix" | "regex";
1605
+ constraints?: Record<string, any> | undefined;
1606
+ }>, "many">;
1607
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1608
+ budget: z.ZodOptional<z.ZodObject<{
1609
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1610
+ cap: z.ZodNumber;
1611
+ window: z.ZodOptional<z.ZodObject<{
1612
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1613
+ durationSec: z.ZodNumber;
1614
+ }, "strip", z.ZodTypeAny, {
1615
+ kind: "rolling" | "fixed";
1616
+ durationSec: number;
1617
+ }, {
1618
+ kind: "rolling" | "fixed";
1619
+ durationSec: number;
1620
+ }>>;
1621
+ }, "strip", z.ZodTypeAny, {
1622
+ unit: "USD" | "ops" | "points";
1623
+ cap: number;
1624
+ window?: {
1625
+ kind: "rolling" | "fixed";
1626
+ durationSec: number;
1627
+ } | undefined;
1628
+ }, {
1629
+ unit: "USD" | "ops" | "points";
1630
+ cap: number;
1631
+ window?: {
1632
+ kind: "rolling" | "fixed";
1633
+ durationSec: number;
1634
+ } | undefined;
1635
+ }>>;
1636
+ scopes: z.ZodArray<z.ZodObject<{
1637
+ resource: z.ZodString;
1638
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1639
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1640
+ }, "strip", z.ZodTypeAny, {
1641
+ resource: string;
1642
+ matcher: "exact" | "prefix" | "regex";
1643
+ constraints?: Record<string, any> | undefined;
1644
+ }, {
1645
+ resource: string;
1646
+ matcher: "exact" | "prefix" | "regex";
1647
+ constraints?: Record<string, any> | undefined;
1648
+ }>, "many">;
1649
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1650
+ budget: z.ZodOptional<z.ZodObject<{
1651
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1652
+ cap: z.ZodNumber;
1653
+ window: z.ZodOptional<z.ZodObject<{
1654
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1655
+ durationSec: z.ZodNumber;
1656
+ }, "strip", z.ZodTypeAny, {
1657
+ kind: "rolling" | "fixed";
1658
+ durationSec: number;
1659
+ }, {
1660
+ kind: "rolling" | "fixed";
1661
+ durationSec: number;
1662
+ }>>;
1663
+ }, "strip", z.ZodTypeAny, {
1664
+ unit: "USD" | "ops" | "points";
1665
+ cap: number;
1666
+ window?: {
1667
+ kind: "rolling" | "fixed";
1668
+ durationSec: number;
1669
+ } | undefined;
1670
+ }, {
1671
+ unit: "USD" | "ops" | "points";
1672
+ cap: number;
1673
+ window?: {
1674
+ kind: "rolling" | "fixed";
1675
+ durationSec: number;
1676
+ } | undefined;
1677
+ }>>;
1678
+ scopes: z.ZodArray<z.ZodObject<{
1679
+ resource: z.ZodString;
1680
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1681
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1682
+ }, "strip", z.ZodTypeAny, {
1683
+ resource: string;
1684
+ matcher: "exact" | "prefix" | "regex";
1685
+ constraints?: Record<string, any> | undefined;
1686
+ }, {
1687
+ resource: string;
1688
+ matcher: "exact" | "prefix" | "regex";
1689
+ constraints?: Record<string, any> | undefined;
1690
+ }>, "many">;
1691
+ }, z.ZodTypeAny, "passthrough">>;
1692
+ }, z.ZodTypeAny, "passthrough">>;
1693
+ /** Status */
1694
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
1695
+ }, "strip", z.ZodTypeAny, {
1696
+ issuerDid: string;
1697
+ subjectDid: string;
1698
+ vcId: string;
1699
+ status: "active" | "revoked" | "expired";
1700
+ constraints: {
1701
+ crisp: {
1702
+ scopes: {
1703
+ resource: string;
1704
+ matcher: "exact" | "prefix" | "regex";
1705
+ constraints?: Record<string, any> | undefined;
1706
+ }[];
1707
+ budget?: {
1708
+ unit: "USD" | "ops" | "points";
1709
+ cap: number;
1710
+ window?: {
1711
+ kind: "rolling" | "fixed";
1712
+ durationSec: number;
1713
+ } | undefined;
1714
+ } | undefined;
1715
+ } & {
1716
+ [k: string]: unknown;
1717
+ };
1718
+ notBefore?: number | undefined;
1719
+ notAfter?: number | undefined;
1720
+ } & {
1721
+ [k: string]: unknown;
1722
+ };
1723
+ delegationId: string;
1724
+ depth: number;
1725
+ }, {
1726
+ issuerDid: string;
1727
+ subjectDid: string;
1728
+ vcId: string;
1729
+ status: "active" | "revoked" | "expired";
1730
+ constraints: {
1731
+ crisp: {
1732
+ scopes: {
1733
+ resource: string;
1734
+ matcher: "exact" | "prefix" | "regex";
1735
+ constraints?: Record<string, any> | undefined;
1736
+ }[];
1737
+ budget?: {
1738
+ unit: "USD" | "ops" | "points";
1739
+ cap: number;
1740
+ window?: {
1741
+ kind: "rolling" | "fixed";
1742
+ durationSec: number;
1743
+ } | undefined;
1744
+ } | undefined;
1745
+ } & {
1746
+ [k: string]: unknown;
1747
+ };
1748
+ notBefore?: number | undefined;
1749
+ notAfter?: number | undefined;
1750
+ } & {
1751
+ [k: string]: unknown;
1752
+ };
1753
+ delegationId: string;
1754
+ depth: number;
1755
+ }>;
1756
+ export type DelegationChainEntry = z.infer<typeof DelegationChainEntrySchema>;
1757
+ /**
1758
+ * Delegation Chain
1759
+ *
1760
+ * Represents a complete delegation chain from root to leaf
1761
+ */
1762
+ export declare const DelegationChainSchema: z.ZodObject<{
1763
+ /** Root issuer DID */
1764
+ rootIssuer: z.ZodString;
1765
+ /** Leaf subject DID */
1766
+ leafSubject: z.ZodString;
1767
+ /** All delegations in the chain, ordered root to leaf */
1768
+ chain: z.ZodArray<z.ZodObject<{
1769
+ /** Delegation ID */
1770
+ delegationId: z.ZodString;
1771
+ /** Issuer DID */
1772
+ issuerDid: z.ZodString;
1773
+ /** Subject DID */
1774
+ subjectDid: z.ZodString;
1775
+ /** VC ID */
1776
+ vcId: z.ZodString;
1777
+ /** Depth in chain (0 = root) */
1778
+ depth: z.ZodNumber;
1779
+ /** Constraints */
1780
+ constraints: z.ZodObject<{
1781
+ notBefore: z.ZodOptional<z.ZodNumber>;
1782
+ notAfter: z.ZodOptional<z.ZodNumber>;
1783
+ crisp: z.ZodObject<{
1784
+ budget: z.ZodOptional<z.ZodObject<{
1785
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1786
+ cap: z.ZodNumber;
1787
+ window: z.ZodOptional<z.ZodObject<{
1788
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1789
+ durationSec: z.ZodNumber;
1790
+ }, "strip", z.ZodTypeAny, {
1791
+ kind: "rolling" | "fixed";
1792
+ durationSec: number;
1793
+ }, {
1794
+ kind: "rolling" | "fixed";
1795
+ durationSec: number;
1796
+ }>>;
1797
+ }, "strip", z.ZodTypeAny, {
1798
+ unit: "USD" | "ops" | "points";
1799
+ cap: number;
1800
+ window?: {
1801
+ kind: "rolling" | "fixed";
1802
+ durationSec: number;
1803
+ } | undefined;
1804
+ }, {
1805
+ unit: "USD" | "ops" | "points";
1806
+ cap: number;
1807
+ window?: {
1808
+ kind: "rolling" | "fixed";
1809
+ durationSec: number;
1810
+ } | undefined;
1811
+ }>>;
1812
+ scopes: z.ZodArray<z.ZodObject<{
1813
+ resource: z.ZodString;
1814
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1815
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1816
+ }, "strip", z.ZodTypeAny, {
1817
+ resource: string;
1818
+ matcher: "exact" | "prefix" | "regex";
1819
+ constraints?: Record<string, any> | undefined;
1820
+ }, {
1821
+ resource: string;
1822
+ matcher: "exact" | "prefix" | "regex";
1823
+ constraints?: Record<string, any> | undefined;
1824
+ }>, "many">;
1825
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1826
+ budget: z.ZodOptional<z.ZodObject<{
1827
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1828
+ cap: z.ZodNumber;
1829
+ window: z.ZodOptional<z.ZodObject<{
1830
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1831
+ durationSec: z.ZodNumber;
1832
+ }, "strip", z.ZodTypeAny, {
1833
+ kind: "rolling" | "fixed";
1834
+ durationSec: number;
1835
+ }, {
1836
+ kind: "rolling" | "fixed";
1837
+ durationSec: number;
1838
+ }>>;
1839
+ }, "strip", z.ZodTypeAny, {
1840
+ unit: "USD" | "ops" | "points";
1841
+ cap: number;
1842
+ window?: {
1843
+ kind: "rolling" | "fixed";
1844
+ durationSec: number;
1845
+ } | undefined;
1846
+ }, {
1847
+ unit: "USD" | "ops" | "points";
1848
+ cap: number;
1849
+ window?: {
1850
+ kind: "rolling" | "fixed";
1851
+ durationSec: number;
1852
+ } | undefined;
1853
+ }>>;
1854
+ scopes: z.ZodArray<z.ZodObject<{
1855
+ resource: z.ZodString;
1856
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1857
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1858
+ }, "strip", z.ZodTypeAny, {
1859
+ resource: string;
1860
+ matcher: "exact" | "prefix" | "regex";
1861
+ constraints?: Record<string, any> | undefined;
1862
+ }, {
1863
+ resource: string;
1864
+ matcher: "exact" | "prefix" | "regex";
1865
+ constraints?: Record<string, any> | undefined;
1866
+ }>, "many">;
1867
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1868
+ budget: z.ZodOptional<z.ZodObject<{
1869
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1870
+ cap: z.ZodNumber;
1871
+ window: z.ZodOptional<z.ZodObject<{
1872
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1873
+ durationSec: z.ZodNumber;
1874
+ }, "strip", z.ZodTypeAny, {
1875
+ kind: "rolling" | "fixed";
1876
+ durationSec: number;
1877
+ }, {
1878
+ kind: "rolling" | "fixed";
1879
+ durationSec: number;
1880
+ }>>;
1881
+ }, "strip", z.ZodTypeAny, {
1882
+ unit: "USD" | "ops" | "points";
1883
+ cap: number;
1884
+ window?: {
1885
+ kind: "rolling" | "fixed";
1886
+ durationSec: number;
1887
+ } | undefined;
1888
+ }, {
1889
+ unit: "USD" | "ops" | "points";
1890
+ cap: number;
1891
+ window?: {
1892
+ kind: "rolling" | "fixed";
1893
+ durationSec: number;
1894
+ } | undefined;
1895
+ }>>;
1896
+ scopes: z.ZodArray<z.ZodObject<{
1897
+ resource: z.ZodString;
1898
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1899
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1900
+ }, "strip", z.ZodTypeAny, {
1901
+ resource: string;
1902
+ matcher: "exact" | "prefix" | "regex";
1903
+ constraints?: Record<string, any> | undefined;
1904
+ }, {
1905
+ resource: string;
1906
+ matcher: "exact" | "prefix" | "regex";
1907
+ constraints?: Record<string, any> | undefined;
1908
+ }>, "many">;
1909
+ }, z.ZodTypeAny, "passthrough">>;
1910
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1911
+ notBefore: z.ZodOptional<z.ZodNumber>;
1912
+ notAfter: z.ZodOptional<z.ZodNumber>;
1913
+ crisp: z.ZodObject<{
1914
+ budget: z.ZodOptional<z.ZodObject<{
1915
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1916
+ cap: z.ZodNumber;
1917
+ window: z.ZodOptional<z.ZodObject<{
1918
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1919
+ durationSec: z.ZodNumber;
1920
+ }, "strip", z.ZodTypeAny, {
1921
+ kind: "rolling" | "fixed";
1922
+ durationSec: number;
1923
+ }, {
1924
+ kind: "rolling" | "fixed";
1925
+ durationSec: number;
1926
+ }>>;
1927
+ }, "strip", z.ZodTypeAny, {
1928
+ unit: "USD" | "ops" | "points";
1929
+ cap: number;
1930
+ window?: {
1931
+ kind: "rolling" | "fixed";
1932
+ durationSec: number;
1933
+ } | undefined;
1934
+ }, {
1935
+ unit: "USD" | "ops" | "points";
1936
+ cap: number;
1937
+ window?: {
1938
+ kind: "rolling" | "fixed";
1939
+ durationSec: number;
1940
+ } | undefined;
1941
+ }>>;
1942
+ scopes: z.ZodArray<z.ZodObject<{
1943
+ resource: z.ZodString;
1944
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1945
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1946
+ }, "strip", z.ZodTypeAny, {
1947
+ resource: string;
1948
+ matcher: "exact" | "prefix" | "regex";
1949
+ constraints?: Record<string, any> | undefined;
1950
+ }, {
1951
+ resource: string;
1952
+ matcher: "exact" | "prefix" | "regex";
1953
+ constraints?: Record<string, any> | undefined;
1954
+ }>, "many">;
1955
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1956
+ budget: z.ZodOptional<z.ZodObject<{
1957
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
1958
+ cap: z.ZodNumber;
1959
+ window: z.ZodOptional<z.ZodObject<{
1960
+ kind: z.ZodEnum<["rolling", "fixed"]>;
1961
+ durationSec: z.ZodNumber;
1962
+ }, "strip", z.ZodTypeAny, {
1963
+ kind: "rolling" | "fixed";
1964
+ durationSec: number;
1965
+ }, {
1966
+ kind: "rolling" | "fixed";
1967
+ durationSec: number;
1968
+ }>>;
1969
+ }, "strip", z.ZodTypeAny, {
1970
+ unit: "USD" | "ops" | "points";
1971
+ cap: number;
1972
+ window?: {
1973
+ kind: "rolling" | "fixed";
1974
+ durationSec: number;
1975
+ } | undefined;
1976
+ }, {
1977
+ unit: "USD" | "ops" | "points";
1978
+ cap: number;
1979
+ window?: {
1980
+ kind: "rolling" | "fixed";
1981
+ durationSec: number;
1982
+ } | undefined;
1983
+ }>>;
1984
+ scopes: z.ZodArray<z.ZodObject<{
1985
+ resource: z.ZodString;
1986
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
1987
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1988
+ }, "strip", z.ZodTypeAny, {
1989
+ resource: string;
1990
+ matcher: "exact" | "prefix" | "regex";
1991
+ constraints?: Record<string, any> | undefined;
1992
+ }, {
1993
+ resource: string;
1994
+ matcher: "exact" | "prefix" | "regex";
1995
+ constraints?: Record<string, any> | undefined;
1996
+ }>, "many">;
1997
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1998
+ budget: z.ZodOptional<z.ZodObject<{
1999
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2000
+ cap: z.ZodNumber;
2001
+ window: z.ZodOptional<z.ZodObject<{
2002
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2003
+ durationSec: z.ZodNumber;
2004
+ }, "strip", z.ZodTypeAny, {
2005
+ kind: "rolling" | "fixed";
2006
+ durationSec: number;
2007
+ }, {
2008
+ kind: "rolling" | "fixed";
2009
+ durationSec: number;
2010
+ }>>;
2011
+ }, "strip", z.ZodTypeAny, {
2012
+ unit: "USD" | "ops" | "points";
2013
+ cap: number;
2014
+ window?: {
2015
+ kind: "rolling" | "fixed";
2016
+ durationSec: number;
2017
+ } | undefined;
2018
+ }, {
2019
+ unit: "USD" | "ops" | "points";
2020
+ cap: number;
2021
+ window?: {
2022
+ kind: "rolling" | "fixed";
2023
+ durationSec: number;
2024
+ } | undefined;
2025
+ }>>;
2026
+ scopes: z.ZodArray<z.ZodObject<{
2027
+ resource: z.ZodString;
2028
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2029
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2030
+ }, "strip", z.ZodTypeAny, {
2031
+ resource: string;
2032
+ matcher: "exact" | "prefix" | "regex";
2033
+ constraints?: Record<string, any> | undefined;
2034
+ }, {
2035
+ resource: string;
2036
+ matcher: "exact" | "prefix" | "regex";
2037
+ constraints?: Record<string, any> | undefined;
2038
+ }>, "many">;
2039
+ }, z.ZodTypeAny, "passthrough">>;
2040
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2041
+ notBefore: z.ZodOptional<z.ZodNumber>;
2042
+ notAfter: z.ZodOptional<z.ZodNumber>;
2043
+ crisp: z.ZodObject<{
2044
+ budget: z.ZodOptional<z.ZodObject<{
2045
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2046
+ cap: z.ZodNumber;
2047
+ window: z.ZodOptional<z.ZodObject<{
2048
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2049
+ durationSec: z.ZodNumber;
2050
+ }, "strip", z.ZodTypeAny, {
2051
+ kind: "rolling" | "fixed";
2052
+ durationSec: number;
2053
+ }, {
2054
+ kind: "rolling" | "fixed";
2055
+ durationSec: number;
2056
+ }>>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ unit: "USD" | "ops" | "points";
2059
+ cap: number;
2060
+ window?: {
2061
+ kind: "rolling" | "fixed";
2062
+ durationSec: number;
2063
+ } | undefined;
2064
+ }, {
2065
+ unit: "USD" | "ops" | "points";
2066
+ cap: number;
2067
+ window?: {
2068
+ kind: "rolling" | "fixed";
2069
+ durationSec: number;
2070
+ } | undefined;
2071
+ }>>;
2072
+ scopes: z.ZodArray<z.ZodObject<{
2073
+ resource: z.ZodString;
2074
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2075
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2076
+ }, "strip", z.ZodTypeAny, {
2077
+ resource: string;
2078
+ matcher: "exact" | "prefix" | "regex";
2079
+ constraints?: Record<string, any> | undefined;
2080
+ }, {
2081
+ resource: string;
2082
+ matcher: "exact" | "prefix" | "regex";
2083
+ constraints?: Record<string, any> | undefined;
2084
+ }>, "many">;
2085
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2086
+ budget: z.ZodOptional<z.ZodObject<{
2087
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2088
+ cap: z.ZodNumber;
2089
+ window: z.ZodOptional<z.ZodObject<{
2090
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2091
+ durationSec: z.ZodNumber;
2092
+ }, "strip", z.ZodTypeAny, {
2093
+ kind: "rolling" | "fixed";
2094
+ durationSec: number;
2095
+ }, {
2096
+ kind: "rolling" | "fixed";
2097
+ durationSec: number;
2098
+ }>>;
2099
+ }, "strip", z.ZodTypeAny, {
2100
+ unit: "USD" | "ops" | "points";
2101
+ cap: number;
2102
+ window?: {
2103
+ kind: "rolling" | "fixed";
2104
+ durationSec: number;
2105
+ } | undefined;
2106
+ }, {
2107
+ unit: "USD" | "ops" | "points";
2108
+ cap: number;
2109
+ window?: {
2110
+ kind: "rolling" | "fixed";
2111
+ durationSec: number;
2112
+ } | undefined;
2113
+ }>>;
2114
+ scopes: z.ZodArray<z.ZodObject<{
2115
+ resource: z.ZodString;
2116
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2117
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2118
+ }, "strip", z.ZodTypeAny, {
2119
+ resource: string;
2120
+ matcher: "exact" | "prefix" | "regex";
2121
+ constraints?: Record<string, any> | undefined;
2122
+ }, {
2123
+ resource: string;
2124
+ matcher: "exact" | "prefix" | "regex";
2125
+ constraints?: Record<string, any> | undefined;
2126
+ }>, "many">;
2127
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2128
+ budget: z.ZodOptional<z.ZodObject<{
2129
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2130
+ cap: z.ZodNumber;
2131
+ window: z.ZodOptional<z.ZodObject<{
2132
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2133
+ durationSec: z.ZodNumber;
2134
+ }, "strip", z.ZodTypeAny, {
2135
+ kind: "rolling" | "fixed";
2136
+ durationSec: number;
2137
+ }, {
2138
+ kind: "rolling" | "fixed";
2139
+ durationSec: number;
2140
+ }>>;
2141
+ }, "strip", z.ZodTypeAny, {
2142
+ unit: "USD" | "ops" | "points";
2143
+ cap: number;
2144
+ window?: {
2145
+ kind: "rolling" | "fixed";
2146
+ durationSec: number;
2147
+ } | undefined;
2148
+ }, {
2149
+ unit: "USD" | "ops" | "points";
2150
+ cap: number;
2151
+ window?: {
2152
+ kind: "rolling" | "fixed";
2153
+ durationSec: number;
2154
+ } | undefined;
2155
+ }>>;
2156
+ scopes: z.ZodArray<z.ZodObject<{
2157
+ resource: z.ZodString;
2158
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2159
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2160
+ }, "strip", z.ZodTypeAny, {
2161
+ resource: string;
2162
+ matcher: "exact" | "prefix" | "regex";
2163
+ constraints?: Record<string, any> | undefined;
2164
+ }, {
2165
+ resource: string;
2166
+ matcher: "exact" | "prefix" | "regex";
2167
+ constraints?: Record<string, any> | undefined;
2168
+ }>, "many">;
2169
+ }, z.ZodTypeAny, "passthrough">>;
2170
+ }, z.ZodTypeAny, "passthrough">>;
2171
+ /** Status */
2172
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
2173
+ }, "strip", z.ZodTypeAny, {
2174
+ issuerDid: string;
2175
+ subjectDid: string;
2176
+ vcId: string;
2177
+ status: "active" | "revoked" | "expired";
2178
+ constraints: {
2179
+ crisp: {
2180
+ scopes: {
2181
+ resource: string;
2182
+ matcher: "exact" | "prefix" | "regex";
2183
+ constraints?: Record<string, any> | undefined;
2184
+ }[];
2185
+ budget?: {
2186
+ unit: "USD" | "ops" | "points";
2187
+ cap: number;
2188
+ window?: {
2189
+ kind: "rolling" | "fixed";
2190
+ durationSec: number;
2191
+ } | undefined;
2192
+ } | undefined;
2193
+ } & {
2194
+ [k: string]: unknown;
2195
+ };
2196
+ notBefore?: number | undefined;
2197
+ notAfter?: number | undefined;
2198
+ } & {
2199
+ [k: string]: unknown;
2200
+ };
2201
+ delegationId: string;
2202
+ depth: number;
2203
+ }, {
2204
+ issuerDid: string;
2205
+ subjectDid: string;
2206
+ vcId: string;
2207
+ status: "active" | "revoked" | "expired";
2208
+ constraints: {
2209
+ crisp: {
2210
+ scopes: {
2211
+ resource: string;
2212
+ matcher: "exact" | "prefix" | "regex";
2213
+ constraints?: Record<string, any> | undefined;
2214
+ }[];
2215
+ budget?: {
2216
+ unit: "USD" | "ops" | "points";
2217
+ cap: number;
2218
+ window?: {
2219
+ kind: "rolling" | "fixed";
2220
+ durationSec: number;
2221
+ } | undefined;
2222
+ } | undefined;
2223
+ } & {
2224
+ [k: string]: unknown;
2225
+ };
2226
+ notBefore?: number | undefined;
2227
+ notAfter?: number | undefined;
2228
+ } & {
2229
+ [k: string]: unknown;
2230
+ };
2231
+ delegationId: string;
2232
+ depth: number;
2233
+ }>, "many">;
2234
+ /** Total chain depth */
2235
+ depth: z.ZodNumber;
2236
+ /** Whether the entire chain is valid */
2237
+ valid: z.ZodBoolean;
2238
+ /** Optional validation errors */
2239
+ errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2240
+ }, "strip", z.ZodTypeAny, {
2241
+ valid: boolean;
2242
+ depth: number;
2243
+ rootIssuer: string;
2244
+ leafSubject: string;
2245
+ chain: {
2246
+ issuerDid: string;
2247
+ subjectDid: string;
2248
+ vcId: string;
2249
+ status: "active" | "revoked" | "expired";
2250
+ constraints: {
2251
+ crisp: {
2252
+ scopes: {
2253
+ resource: string;
2254
+ matcher: "exact" | "prefix" | "regex";
2255
+ constraints?: Record<string, any> | undefined;
2256
+ }[];
2257
+ budget?: {
2258
+ unit: "USD" | "ops" | "points";
2259
+ cap: number;
2260
+ window?: {
2261
+ kind: "rolling" | "fixed";
2262
+ durationSec: number;
2263
+ } | undefined;
2264
+ } | undefined;
2265
+ } & {
2266
+ [k: string]: unknown;
2267
+ };
2268
+ notBefore?: number | undefined;
2269
+ notAfter?: number | undefined;
2270
+ } & {
2271
+ [k: string]: unknown;
2272
+ };
2273
+ delegationId: string;
2274
+ depth: number;
2275
+ }[];
2276
+ errors?: string[] | undefined;
2277
+ }, {
2278
+ valid: boolean;
2279
+ depth: number;
2280
+ rootIssuer: string;
2281
+ leafSubject: string;
2282
+ chain: {
2283
+ issuerDid: string;
2284
+ subjectDid: string;
2285
+ vcId: string;
2286
+ status: "active" | "revoked" | "expired";
2287
+ constraints: {
2288
+ crisp: {
2289
+ scopes: {
2290
+ resource: string;
2291
+ matcher: "exact" | "prefix" | "regex";
2292
+ constraints?: Record<string, any> | undefined;
2293
+ }[];
2294
+ budget?: {
2295
+ unit: "USD" | "ops" | "points";
2296
+ cap: number;
2297
+ window?: {
2298
+ kind: "rolling" | "fixed";
2299
+ durationSec: number;
2300
+ } | undefined;
2301
+ } | undefined;
2302
+ } & {
2303
+ [k: string]: unknown;
2304
+ };
2305
+ notBefore?: number | undefined;
2306
+ notAfter?: number | undefined;
2307
+ } & {
2308
+ [k: string]: unknown;
2309
+ };
2310
+ delegationId: string;
2311
+ depth: number;
2312
+ }[];
2313
+ errors?: string[] | undefined;
2314
+ }>;
2315
+ export type DelegationChain = z.infer<typeof DelegationChainSchema>;
2316
+ /**
2317
+ * Delegation Creation Request
2318
+ *
2319
+ * Input for creating a new delegation
2320
+ */
2321
+ export declare const DelegationCreationRequestSchema: z.ZodObject<{
2322
+ /** Delegator DID */
2323
+ issuerDid: z.ZodString;
2324
+ /** Delegatee DID */
2325
+ subjectDid: z.ZodString;
2326
+ /** Optional controller */
2327
+ controller: z.ZodOptional<z.ZodString>;
2328
+ /** Constraints */
2329
+ constraints: z.ZodObject<{
2330
+ notBefore: z.ZodOptional<z.ZodNumber>;
2331
+ notAfter: z.ZodOptional<z.ZodNumber>;
2332
+ crisp: z.ZodObject<{
2333
+ budget: z.ZodOptional<z.ZodObject<{
2334
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2335
+ cap: z.ZodNumber;
2336
+ window: z.ZodOptional<z.ZodObject<{
2337
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2338
+ durationSec: z.ZodNumber;
2339
+ }, "strip", z.ZodTypeAny, {
2340
+ kind: "rolling" | "fixed";
2341
+ durationSec: number;
2342
+ }, {
2343
+ kind: "rolling" | "fixed";
2344
+ durationSec: number;
2345
+ }>>;
2346
+ }, "strip", z.ZodTypeAny, {
2347
+ unit: "USD" | "ops" | "points";
2348
+ cap: number;
2349
+ window?: {
2350
+ kind: "rolling" | "fixed";
2351
+ durationSec: number;
2352
+ } | undefined;
2353
+ }, {
2354
+ unit: "USD" | "ops" | "points";
2355
+ cap: number;
2356
+ window?: {
2357
+ kind: "rolling" | "fixed";
2358
+ durationSec: number;
2359
+ } | undefined;
2360
+ }>>;
2361
+ scopes: z.ZodArray<z.ZodObject<{
2362
+ resource: z.ZodString;
2363
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2364
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2365
+ }, "strip", z.ZodTypeAny, {
2366
+ resource: string;
2367
+ matcher: "exact" | "prefix" | "regex";
2368
+ constraints?: Record<string, any> | undefined;
2369
+ }, {
2370
+ resource: string;
2371
+ matcher: "exact" | "prefix" | "regex";
2372
+ constraints?: Record<string, any> | undefined;
2373
+ }>, "many">;
2374
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2375
+ budget: z.ZodOptional<z.ZodObject<{
2376
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2377
+ cap: z.ZodNumber;
2378
+ window: z.ZodOptional<z.ZodObject<{
2379
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2380
+ durationSec: z.ZodNumber;
2381
+ }, "strip", z.ZodTypeAny, {
2382
+ kind: "rolling" | "fixed";
2383
+ durationSec: number;
2384
+ }, {
2385
+ kind: "rolling" | "fixed";
2386
+ durationSec: number;
2387
+ }>>;
2388
+ }, "strip", z.ZodTypeAny, {
2389
+ unit: "USD" | "ops" | "points";
2390
+ cap: number;
2391
+ window?: {
2392
+ kind: "rolling" | "fixed";
2393
+ durationSec: number;
2394
+ } | undefined;
2395
+ }, {
2396
+ unit: "USD" | "ops" | "points";
2397
+ cap: number;
2398
+ window?: {
2399
+ kind: "rolling" | "fixed";
2400
+ durationSec: number;
2401
+ } | undefined;
2402
+ }>>;
2403
+ scopes: z.ZodArray<z.ZodObject<{
2404
+ resource: z.ZodString;
2405
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2406
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2407
+ }, "strip", z.ZodTypeAny, {
2408
+ resource: string;
2409
+ matcher: "exact" | "prefix" | "regex";
2410
+ constraints?: Record<string, any> | undefined;
2411
+ }, {
2412
+ resource: string;
2413
+ matcher: "exact" | "prefix" | "regex";
2414
+ constraints?: Record<string, any> | undefined;
2415
+ }>, "many">;
2416
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2417
+ budget: z.ZodOptional<z.ZodObject<{
2418
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2419
+ cap: z.ZodNumber;
2420
+ window: z.ZodOptional<z.ZodObject<{
2421
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2422
+ durationSec: z.ZodNumber;
2423
+ }, "strip", z.ZodTypeAny, {
2424
+ kind: "rolling" | "fixed";
2425
+ durationSec: number;
2426
+ }, {
2427
+ kind: "rolling" | "fixed";
2428
+ durationSec: number;
2429
+ }>>;
2430
+ }, "strip", z.ZodTypeAny, {
2431
+ unit: "USD" | "ops" | "points";
2432
+ cap: number;
2433
+ window?: {
2434
+ kind: "rolling" | "fixed";
2435
+ durationSec: number;
2436
+ } | undefined;
2437
+ }, {
2438
+ unit: "USD" | "ops" | "points";
2439
+ cap: number;
2440
+ window?: {
2441
+ kind: "rolling" | "fixed";
2442
+ durationSec: number;
2443
+ } | undefined;
2444
+ }>>;
2445
+ scopes: z.ZodArray<z.ZodObject<{
2446
+ resource: z.ZodString;
2447
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2448
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2449
+ }, "strip", z.ZodTypeAny, {
2450
+ resource: string;
2451
+ matcher: "exact" | "prefix" | "regex";
2452
+ constraints?: Record<string, any> | undefined;
2453
+ }, {
2454
+ resource: string;
2455
+ matcher: "exact" | "prefix" | "regex";
2456
+ constraints?: Record<string, any> | undefined;
2457
+ }>, "many">;
2458
+ }, z.ZodTypeAny, "passthrough">>;
2459
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2460
+ notBefore: z.ZodOptional<z.ZodNumber>;
2461
+ notAfter: z.ZodOptional<z.ZodNumber>;
2462
+ crisp: z.ZodObject<{
2463
+ budget: z.ZodOptional<z.ZodObject<{
2464
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2465
+ cap: z.ZodNumber;
2466
+ window: z.ZodOptional<z.ZodObject<{
2467
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2468
+ durationSec: z.ZodNumber;
2469
+ }, "strip", z.ZodTypeAny, {
2470
+ kind: "rolling" | "fixed";
2471
+ durationSec: number;
2472
+ }, {
2473
+ kind: "rolling" | "fixed";
2474
+ durationSec: number;
2475
+ }>>;
2476
+ }, "strip", z.ZodTypeAny, {
2477
+ unit: "USD" | "ops" | "points";
2478
+ cap: number;
2479
+ window?: {
2480
+ kind: "rolling" | "fixed";
2481
+ durationSec: number;
2482
+ } | undefined;
2483
+ }, {
2484
+ unit: "USD" | "ops" | "points";
2485
+ cap: number;
2486
+ window?: {
2487
+ kind: "rolling" | "fixed";
2488
+ durationSec: number;
2489
+ } | undefined;
2490
+ }>>;
2491
+ scopes: z.ZodArray<z.ZodObject<{
2492
+ resource: z.ZodString;
2493
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2494
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2495
+ }, "strip", z.ZodTypeAny, {
2496
+ resource: string;
2497
+ matcher: "exact" | "prefix" | "regex";
2498
+ constraints?: Record<string, any> | undefined;
2499
+ }, {
2500
+ resource: string;
2501
+ matcher: "exact" | "prefix" | "regex";
2502
+ constraints?: Record<string, any> | undefined;
2503
+ }>, "many">;
2504
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2505
+ budget: z.ZodOptional<z.ZodObject<{
2506
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2507
+ cap: z.ZodNumber;
2508
+ window: z.ZodOptional<z.ZodObject<{
2509
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2510
+ durationSec: z.ZodNumber;
2511
+ }, "strip", z.ZodTypeAny, {
2512
+ kind: "rolling" | "fixed";
2513
+ durationSec: number;
2514
+ }, {
2515
+ kind: "rolling" | "fixed";
2516
+ durationSec: number;
2517
+ }>>;
2518
+ }, "strip", z.ZodTypeAny, {
2519
+ unit: "USD" | "ops" | "points";
2520
+ cap: number;
2521
+ window?: {
2522
+ kind: "rolling" | "fixed";
2523
+ durationSec: number;
2524
+ } | undefined;
2525
+ }, {
2526
+ unit: "USD" | "ops" | "points";
2527
+ cap: number;
2528
+ window?: {
2529
+ kind: "rolling" | "fixed";
2530
+ durationSec: number;
2531
+ } | undefined;
2532
+ }>>;
2533
+ scopes: z.ZodArray<z.ZodObject<{
2534
+ resource: z.ZodString;
2535
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2536
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2537
+ }, "strip", z.ZodTypeAny, {
2538
+ resource: string;
2539
+ matcher: "exact" | "prefix" | "regex";
2540
+ constraints?: Record<string, any> | undefined;
2541
+ }, {
2542
+ resource: string;
2543
+ matcher: "exact" | "prefix" | "regex";
2544
+ constraints?: Record<string, any> | undefined;
2545
+ }>, "many">;
2546
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2547
+ budget: z.ZodOptional<z.ZodObject<{
2548
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2549
+ cap: z.ZodNumber;
2550
+ window: z.ZodOptional<z.ZodObject<{
2551
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2552
+ durationSec: z.ZodNumber;
2553
+ }, "strip", z.ZodTypeAny, {
2554
+ kind: "rolling" | "fixed";
2555
+ durationSec: number;
2556
+ }, {
2557
+ kind: "rolling" | "fixed";
2558
+ durationSec: number;
2559
+ }>>;
2560
+ }, "strip", z.ZodTypeAny, {
2561
+ unit: "USD" | "ops" | "points";
2562
+ cap: number;
2563
+ window?: {
2564
+ kind: "rolling" | "fixed";
2565
+ durationSec: number;
2566
+ } | undefined;
2567
+ }, {
2568
+ unit: "USD" | "ops" | "points";
2569
+ cap: number;
2570
+ window?: {
2571
+ kind: "rolling" | "fixed";
2572
+ durationSec: number;
2573
+ } | undefined;
2574
+ }>>;
2575
+ scopes: z.ZodArray<z.ZodObject<{
2576
+ resource: z.ZodString;
2577
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2578
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2579
+ }, "strip", z.ZodTypeAny, {
2580
+ resource: string;
2581
+ matcher: "exact" | "prefix" | "regex";
2582
+ constraints?: Record<string, any> | undefined;
2583
+ }, {
2584
+ resource: string;
2585
+ matcher: "exact" | "prefix" | "regex";
2586
+ constraints?: Record<string, any> | undefined;
2587
+ }>, "many">;
2588
+ }, z.ZodTypeAny, "passthrough">>;
2589
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2590
+ notBefore: z.ZodOptional<z.ZodNumber>;
2591
+ notAfter: z.ZodOptional<z.ZodNumber>;
2592
+ crisp: z.ZodObject<{
2593
+ budget: z.ZodOptional<z.ZodObject<{
2594
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2595
+ cap: z.ZodNumber;
2596
+ window: z.ZodOptional<z.ZodObject<{
2597
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2598
+ durationSec: z.ZodNumber;
2599
+ }, "strip", z.ZodTypeAny, {
2600
+ kind: "rolling" | "fixed";
2601
+ durationSec: number;
2602
+ }, {
2603
+ kind: "rolling" | "fixed";
2604
+ durationSec: number;
2605
+ }>>;
2606
+ }, "strip", z.ZodTypeAny, {
2607
+ unit: "USD" | "ops" | "points";
2608
+ cap: number;
2609
+ window?: {
2610
+ kind: "rolling" | "fixed";
2611
+ durationSec: number;
2612
+ } | undefined;
2613
+ }, {
2614
+ unit: "USD" | "ops" | "points";
2615
+ cap: number;
2616
+ window?: {
2617
+ kind: "rolling" | "fixed";
2618
+ durationSec: number;
2619
+ } | undefined;
2620
+ }>>;
2621
+ scopes: z.ZodArray<z.ZodObject<{
2622
+ resource: z.ZodString;
2623
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2624
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2625
+ }, "strip", z.ZodTypeAny, {
2626
+ resource: string;
2627
+ matcher: "exact" | "prefix" | "regex";
2628
+ constraints?: Record<string, any> | undefined;
2629
+ }, {
2630
+ resource: string;
2631
+ matcher: "exact" | "prefix" | "regex";
2632
+ constraints?: Record<string, any> | undefined;
2633
+ }>, "many">;
2634
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2635
+ budget: z.ZodOptional<z.ZodObject<{
2636
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2637
+ cap: z.ZodNumber;
2638
+ window: z.ZodOptional<z.ZodObject<{
2639
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2640
+ durationSec: z.ZodNumber;
2641
+ }, "strip", z.ZodTypeAny, {
2642
+ kind: "rolling" | "fixed";
2643
+ durationSec: number;
2644
+ }, {
2645
+ kind: "rolling" | "fixed";
2646
+ durationSec: number;
2647
+ }>>;
2648
+ }, "strip", z.ZodTypeAny, {
2649
+ unit: "USD" | "ops" | "points";
2650
+ cap: number;
2651
+ window?: {
2652
+ kind: "rolling" | "fixed";
2653
+ durationSec: number;
2654
+ } | undefined;
2655
+ }, {
2656
+ unit: "USD" | "ops" | "points";
2657
+ cap: number;
2658
+ window?: {
2659
+ kind: "rolling" | "fixed";
2660
+ durationSec: number;
2661
+ } | undefined;
2662
+ }>>;
2663
+ scopes: z.ZodArray<z.ZodObject<{
2664
+ resource: z.ZodString;
2665
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2666
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2667
+ }, "strip", z.ZodTypeAny, {
2668
+ resource: string;
2669
+ matcher: "exact" | "prefix" | "regex";
2670
+ constraints?: Record<string, any> | undefined;
2671
+ }, {
2672
+ resource: string;
2673
+ matcher: "exact" | "prefix" | "regex";
2674
+ constraints?: Record<string, any> | undefined;
2675
+ }>, "many">;
2676
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2677
+ budget: z.ZodOptional<z.ZodObject<{
2678
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2679
+ cap: z.ZodNumber;
2680
+ window: z.ZodOptional<z.ZodObject<{
2681
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2682
+ durationSec: z.ZodNumber;
2683
+ }, "strip", z.ZodTypeAny, {
2684
+ kind: "rolling" | "fixed";
2685
+ durationSec: number;
2686
+ }, {
2687
+ kind: "rolling" | "fixed";
2688
+ durationSec: number;
2689
+ }>>;
2690
+ }, "strip", z.ZodTypeAny, {
2691
+ unit: "USD" | "ops" | "points";
2692
+ cap: number;
2693
+ window?: {
2694
+ kind: "rolling" | "fixed";
2695
+ durationSec: number;
2696
+ } | undefined;
2697
+ }, {
2698
+ unit: "USD" | "ops" | "points";
2699
+ cap: number;
2700
+ window?: {
2701
+ kind: "rolling" | "fixed";
2702
+ durationSec: number;
2703
+ } | undefined;
2704
+ }>>;
2705
+ scopes: z.ZodArray<z.ZodObject<{
2706
+ resource: z.ZodString;
2707
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2708
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2709
+ }, "strip", z.ZodTypeAny, {
2710
+ resource: string;
2711
+ matcher: "exact" | "prefix" | "regex";
2712
+ constraints?: Record<string, any> | undefined;
2713
+ }, {
2714
+ resource: string;
2715
+ matcher: "exact" | "prefix" | "regex";
2716
+ constraints?: Record<string, any> | undefined;
2717
+ }>, "many">;
2718
+ }, z.ZodTypeAny, "passthrough">>;
2719
+ }, z.ZodTypeAny, "passthrough">>;
2720
+ /** Optional parent delegation ID */
2721
+ parentId: z.ZodOptional<z.ZodString>;
2722
+ /** Optional VC ID (if not provided, will be created) */
2723
+ vcId: z.ZodOptional<z.ZodString>;
2724
+ }, "strip", z.ZodTypeAny, {
2725
+ issuerDid: string;
2726
+ subjectDid: string;
2727
+ constraints: {
2728
+ crisp: {
2729
+ scopes: {
2730
+ resource: string;
2731
+ matcher: "exact" | "prefix" | "regex";
2732
+ constraints?: Record<string, any> | undefined;
2733
+ }[];
2734
+ budget?: {
2735
+ unit: "USD" | "ops" | "points";
2736
+ cap: number;
2737
+ window?: {
2738
+ kind: "rolling" | "fixed";
2739
+ durationSec: number;
2740
+ } | undefined;
2741
+ } | undefined;
2742
+ } & {
2743
+ [k: string]: unknown;
2744
+ };
2745
+ notBefore?: number | undefined;
2746
+ notAfter?: number | undefined;
2747
+ } & {
2748
+ [k: string]: unknown;
2749
+ };
2750
+ controller?: string | undefined;
2751
+ vcId?: string | undefined;
2752
+ parentId?: string | undefined;
2753
+ }, {
2754
+ issuerDid: string;
2755
+ subjectDid: string;
2756
+ constraints: {
2757
+ crisp: {
2758
+ scopes: {
2759
+ resource: string;
2760
+ matcher: "exact" | "prefix" | "regex";
2761
+ constraints?: Record<string, any> | undefined;
2762
+ }[];
2763
+ budget?: {
2764
+ unit: "USD" | "ops" | "points";
2765
+ cap: number;
2766
+ window?: {
2767
+ kind: "rolling" | "fixed";
2768
+ durationSec: number;
2769
+ } | undefined;
2770
+ } | undefined;
2771
+ } & {
2772
+ [k: string]: unknown;
2773
+ };
2774
+ notBefore?: number | undefined;
2775
+ notAfter?: number | undefined;
2776
+ } & {
2777
+ [k: string]: unknown;
2778
+ };
2779
+ controller?: string | undefined;
2780
+ vcId?: string | undefined;
2781
+ parentId?: string | undefined;
2782
+ }>;
2783
+ export type DelegationCreationRequest = z.infer<typeof DelegationCreationRequestSchema>;
2784
+ /**
2785
+ * Delegation Verification Result
2786
+ *
2787
+ * Result of delegation verification
2788
+ */
2789
+ export declare const DelegationVerificationResultSchema: z.ZodObject<{
2790
+ /** Whether delegation is valid */
2791
+ valid: z.ZodBoolean;
2792
+ /** Delegation ID */
2793
+ delegationId: z.ZodString;
2794
+ /** Status */
2795
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
2796
+ /** Optional reason for invalid status */
2797
+ reason: z.ZodOptional<z.ZodString>;
2798
+ /** Whether backing VC is valid */
2799
+ credentialValid: z.ZodOptional<z.ZodBoolean>;
2800
+ /** Whether chain is valid (if part of chain) */
2801
+ chainValid: z.ZodOptional<z.ZodBoolean>;
2802
+ /** Timestamp of verification */
2803
+ verifiedAt: z.ZodNumber;
2804
+ /** Optional verification details */
2805
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2806
+ }, "strip", z.ZodTypeAny, {
2807
+ valid: boolean;
2808
+ status: "active" | "revoked" | "expired";
2809
+ delegationId: string;
2810
+ verifiedAt: number;
2811
+ reason?: string | undefined;
2812
+ credentialValid?: boolean | undefined;
2813
+ chainValid?: boolean | undefined;
2814
+ details?: Record<string, any> | undefined;
2815
+ }, {
2816
+ valid: boolean;
2817
+ status: "active" | "revoked" | "expired";
2818
+ delegationId: string;
2819
+ verifiedAt: number;
2820
+ reason?: string | undefined;
2821
+ credentialValid?: boolean | undefined;
2822
+ chainValid?: boolean | undefined;
2823
+ details?: Record<string, any> | undefined;
2824
+ }>;
2825
+ export type DelegationVerificationResult = z.infer<typeof DelegationVerificationResultSchema>;
2826
+ /**
2827
+ * Validation Helpers
2828
+ */
2829
+ /**
2830
+ * Validate a delegation record
2831
+ *
2832
+ * @param record - The delegation record to validate
2833
+ * @returns Validation result
2834
+ */
2835
+ export declare function validateDelegationRecord(record: unknown): z.SafeParseReturnType<z.objectInputType<{
2836
+ /** Unique identifier for the delegation */
2837
+ id: z.ZodString;
2838
+ /** DID of the delegator (issuer, e.g., merchant/user) */
2839
+ issuerDid: z.ZodString;
2840
+ /** DID of the delegatee (subject, e.g., agent) */
2841
+ subjectDid: z.ZodString;
2842
+ /** Optional controller (user account ID or DID) */
2843
+ controller: z.ZodOptional<z.ZodString>;
2844
+ /** ID of the backing Verifiable Credential */
2845
+ vcId: z.ZodString;
2846
+ /** Optional parent delegation ID for chain tracking */
2847
+ parentId: z.ZodOptional<z.ZodString>;
2848
+ /** CRISP constraints on this delegation */
2849
+ constraints: z.ZodObject<{
2850
+ notBefore: z.ZodOptional<z.ZodNumber>;
2851
+ notAfter: z.ZodOptional<z.ZodNumber>;
2852
+ crisp: z.ZodObject<{
2853
+ budget: z.ZodOptional<z.ZodObject<{
2854
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2855
+ cap: z.ZodNumber;
2856
+ window: z.ZodOptional<z.ZodObject<{
2857
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2858
+ durationSec: z.ZodNumber;
2859
+ }, "strip", z.ZodTypeAny, {
2860
+ kind: "rolling" | "fixed";
2861
+ durationSec: number;
2862
+ }, {
2863
+ kind: "rolling" | "fixed";
2864
+ durationSec: number;
2865
+ }>>;
2866
+ }, "strip", z.ZodTypeAny, {
2867
+ unit: "USD" | "ops" | "points";
2868
+ cap: number;
2869
+ window?: {
2870
+ kind: "rolling" | "fixed";
2871
+ durationSec: number;
2872
+ } | undefined;
2873
+ }, {
2874
+ unit: "USD" | "ops" | "points";
2875
+ cap: number;
2876
+ window?: {
2877
+ kind: "rolling" | "fixed";
2878
+ durationSec: number;
2879
+ } | undefined;
2880
+ }>>;
2881
+ scopes: z.ZodArray<z.ZodObject<{
2882
+ resource: z.ZodString;
2883
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2884
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2885
+ }, "strip", z.ZodTypeAny, {
2886
+ resource: string;
2887
+ matcher: "exact" | "prefix" | "regex";
2888
+ constraints?: Record<string, any> | undefined;
2889
+ }, {
2890
+ resource: string;
2891
+ matcher: "exact" | "prefix" | "regex";
2892
+ constraints?: Record<string, any> | undefined;
2893
+ }>, "many">;
2894
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2895
+ budget: z.ZodOptional<z.ZodObject<{
2896
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2897
+ cap: z.ZodNumber;
2898
+ window: z.ZodOptional<z.ZodObject<{
2899
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2900
+ durationSec: z.ZodNumber;
2901
+ }, "strip", z.ZodTypeAny, {
2902
+ kind: "rolling" | "fixed";
2903
+ durationSec: number;
2904
+ }, {
2905
+ kind: "rolling" | "fixed";
2906
+ durationSec: number;
2907
+ }>>;
2908
+ }, "strip", z.ZodTypeAny, {
2909
+ unit: "USD" | "ops" | "points";
2910
+ cap: number;
2911
+ window?: {
2912
+ kind: "rolling" | "fixed";
2913
+ durationSec: number;
2914
+ } | undefined;
2915
+ }, {
2916
+ unit: "USD" | "ops" | "points";
2917
+ cap: number;
2918
+ window?: {
2919
+ kind: "rolling" | "fixed";
2920
+ durationSec: number;
2921
+ } | undefined;
2922
+ }>>;
2923
+ scopes: z.ZodArray<z.ZodObject<{
2924
+ resource: z.ZodString;
2925
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2926
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2927
+ }, "strip", z.ZodTypeAny, {
2928
+ resource: string;
2929
+ matcher: "exact" | "prefix" | "regex";
2930
+ constraints?: Record<string, any> | undefined;
2931
+ }, {
2932
+ resource: string;
2933
+ matcher: "exact" | "prefix" | "regex";
2934
+ constraints?: Record<string, any> | undefined;
2935
+ }>, "many">;
2936
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2937
+ budget: z.ZodOptional<z.ZodObject<{
2938
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2939
+ cap: z.ZodNumber;
2940
+ window: z.ZodOptional<z.ZodObject<{
2941
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2942
+ durationSec: z.ZodNumber;
2943
+ }, "strip", z.ZodTypeAny, {
2944
+ kind: "rolling" | "fixed";
2945
+ durationSec: number;
2946
+ }, {
2947
+ kind: "rolling" | "fixed";
2948
+ durationSec: number;
2949
+ }>>;
2950
+ }, "strip", z.ZodTypeAny, {
2951
+ unit: "USD" | "ops" | "points";
2952
+ cap: number;
2953
+ window?: {
2954
+ kind: "rolling" | "fixed";
2955
+ durationSec: number;
2956
+ } | undefined;
2957
+ }, {
2958
+ unit: "USD" | "ops" | "points";
2959
+ cap: number;
2960
+ window?: {
2961
+ kind: "rolling" | "fixed";
2962
+ durationSec: number;
2963
+ } | undefined;
2964
+ }>>;
2965
+ scopes: z.ZodArray<z.ZodObject<{
2966
+ resource: z.ZodString;
2967
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
2968
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2969
+ }, "strip", z.ZodTypeAny, {
2970
+ resource: string;
2971
+ matcher: "exact" | "prefix" | "regex";
2972
+ constraints?: Record<string, any> | undefined;
2973
+ }, {
2974
+ resource: string;
2975
+ matcher: "exact" | "prefix" | "regex";
2976
+ constraints?: Record<string, any> | undefined;
2977
+ }>, "many">;
2978
+ }, z.ZodTypeAny, "passthrough">>;
2979
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2980
+ notBefore: z.ZodOptional<z.ZodNumber>;
2981
+ notAfter: z.ZodOptional<z.ZodNumber>;
2982
+ crisp: z.ZodObject<{
2983
+ budget: z.ZodOptional<z.ZodObject<{
2984
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
2985
+ cap: z.ZodNumber;
2986
+ window: z.ZodOptional<z.ZodObject<{
2987
+ kind: z.ZodEnum<["rolling", "fixed"]>;
2988
+ durationSec: z.ZodNumber;
2989
+ }, "strip", z.ZodTypeAny, {
2990
+ kind: "rolling" | "fixed";
2991
+ durationSec: number;
2992
+ }, {
2993
+ kind: "rolling" | "fixed";
2994
+ durationSec: number;
2995
+ }>>;
2996
+ }, "strip", z.ZodTypeAny, {
2997
+ unit: "USD" | "ops" | "points";
2998
+ cap: number;
2999
+ window?: {
3000
+ kind: "rolling" | "fixed";
3001
+ durationSec: number;
3002
+ } | undefined;
3003
+ }, {
3004
+ unit: "USD" | "ops" | "points";
3005
+ cap: number;
3006
+ window?: {
3007
+ kind: "rolling" | "fixed";
3008
+ durationSec: number;
3009
+ } | undefined;
3010
+ }>>;
3011
+ scopes: z.ZodArray<z.ZodObject<{
3012
+ resource: z.ZodString;
3013
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3014
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3015
+ }, "strip", z.ZodTypeAny, {
3016
+ resource: string;
3017
+ matcher: "exact" | "prefix" | "regex";
3018
+ constraints?: Record<string, any> | undefined;
3019
+ }, {
3020
+ resource: string;
3021
+ matcher: "exact" | "prefix" | "regex";
3022
+ constraints?: Record<string, any> | undefined;
3023
+ }>, "many">;
3024
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3025
+ budget: z.ZodOptional<z.ZodObject<{
3026
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3027
+ cap: z.ZodNumber;
3028
+ window: z.ZodOptional<z.ZodObject<{
3029
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3030
+ durationSec: z.ZodNumber;
3031
+ }, "strip", z.ZodTypeAny, {
3032
+ kind: "rolling" | "fixed";
3033
+ durationSec: number;
3034
+ }, {
3035
+ kind: "rolling" | "fixed";
3036
+ durationSec: number;
3037
+ }>>;
3038
+ }, "strip", z.ZodTypeAny, {
3039
+ unit: "USD" | "ops" | "points";
3040
+ cap: number;
3041
+ window?: {
3042
+ kind: "rolling" | "fixed";
3043
+ durationSec: number;
3044
+ } | undefined;
3045
+ }, {
3046
+ unit: "USD" | "ops" | "points";
3047
+ cap: number;
3048
+ window?: {
3049
+ kind: "rolling" | "fixed";
3050
+ durationSec: number;
3051
+ } | undefined;
3052
+ }>>;
3053
+ scopes: z.ZodArray<z.ZodObject<{
3054
+ resource: z.ZodString;
3055
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3056
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3057
+ }, "strip", z.ZodTypeAny, {
3058
+ resource: string;
3059
+ matcher: "exact" | "prefix" | "regex";
3060
+ constraints?: Record<string, any> | undefined;
3061
+ }, {
3062
+ resource: string;
3063
+ matcher: "exact" | "prefix" | "regex";
3064
+ constraints?: Record<string, any> | undefined;
3065
+ }>, "many">;
3066
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3067
+ budget: z.ZodOptional<z.ZodObject<{
3068
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3069
+ cap: z.ZodNumber;
3070
+ window: z.ZodOptional<z.ZodObject<{
3071
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3072
+ durationSec: z.ZodNumber;
3073
+ }, "strip", z.ZodTypeAny, {
3074
+ kind: "rolling" | "fixed";
3075
+ durationSec: number;
3076
+ }, {
3077
+ kind: "rolling" | "fixed";
3078
+ durationSec: number;
3079
+ }>>;
3080
+ }, "strip", z.ZodTypeAny, {
3081
+ unit: "USD" | "ops" | "points";
3082
+ cap: number;
3083
+ window?: {
3084
+ kind: "rolling" | "fixed";
3085
+ durationSec: number;
3086
+ } | undefined;
3087
+ }, {
3088
+ unit: "USD" | "ops" | "points";
3089
+ cap: number;
3090
+ window?: {
3091
+ kind: "rolling" | "fixed";
3092
+ durationSec: number;
3093
+ } | undefined;
3094
+ }>>;
3095
+ scopes: z.ZodArray<z.ZodObject<{
3096
+ resource: z.ZodString;
3097
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3098
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3099
+ }, "strip", z.ZodTypeAny, {
3100
+ resource: string;
3101
+ matcher: "exact" | "prefix" | "regex";
3102
+ constraints?: Record<string, any> | undefined;
3103
+ }, {
3104
+ resource: string;
3105
+ matcher: "exact" | "prefix" | "regex";
3106
+ constraints?: Record<string, any> | undefined;
3107
+ }>, "many">;
3108
+ }, z.ZodTypeAny, "passthrough">>;
3109
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3110
+ notBefore: z.ZodOptional<z.ZodNumber>;
3111
+ notAfter: z.ZodOptional<z.ZodNumber>;
3112
+ crisp: z.ZodObject<{
3113
+ budget: z.ZodOptional<z.ZodObject<{
3114
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3115
+ cap: z.ZodNumber;
3116
+ window: z.ZodOptional<z.ZodObject<{
3117
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3118
+ durationSec: z.ZodNumber;
3119
+ }, "strip", z.ZodTypeAny, {
3120
+ kind: "rolling" | "fixed";
3121
+ durationSec: number;
3122
+ }, {
3123
+ kind: "rolling" | "fixed";
3124
+ durationSec: number;
3125
+ }>>;
3126
+ }, "strip", z.ZodTypeAny, {
3127
+ unit: "USD" | "ops" | "points";
3128
+ cap: number;
3129
+ window?: {
3130
+ kind: "rolling" | "fixed";
3131
+ durationSec: number;
3132
+ } | undefined;
3133
+ }, {
3134
+ unit: "USD" | "ops" | "points";
3135
+ cap: number;
3136
+ window?: {
3137
+ kind: "rolling" | "fixed";
3138
+ durationSec: number;
3139
+ } | undefined;
3140
+ }>>;
3141
+ scopes: z.ZodArray<z.ZodObject<{
3142
+ resource: z.ZodString;
3143
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3144
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3145
+ }, "strip", z.ZodTypeAny, {
3146
+ resource: string;
3147
+ matcher: "exact" | "prefix" | "regex";
3148
+ constraints?: Record<string, any> | undefined;
3149
+ }, {
3150
+ resource: string;
3151
+ matcher: "exact" | "prefix" | "regex";
3152
+ constraints?: Record<string, any> | undefined;
3153
+ }>, "many">;
3154
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3155
+ budget: z.ZodOptional<z.ZodObject<{
3156
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3157
+ cap: z.ZodNumber;
3158
+ window: z.ZodOptional<z.ZodObject<{
3159
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3160
+ durationSec: z.ZodNumber;
3161
+ }, "strip", z.ZodTypeAny, {
3162
+ kind: "rolling" | "fixed";
3163
+ durationSec: number;
3164
+ }, {
3165
+ kind: "rolling" | "fixed";
3166
+ durationSec: number;
3167
+ }>>;
3168
+ }, "strip", z.ZodTypeAny, {
3169
+ unit: "USD" | "ops" | "points";
3170
+ cap: number;
3171
+ window?: {
3172
+ kind: "rolling" | "fixed";
3173
+ durationSec: number;
3174
+ } | undefined;
3175
+ }, {
3176
+ unit: "USD" | "ops" | "points";
3177
+ cap: number;
3178
+ window?: {
3179
+ kind: "rolling" | "fixed";
3180
+ durationSec: number;
3181
+ } | undefined;
3182
+ }>>;
3183
+ scopes: z.ZodArray<z.ZodObject<{
3184
+ resource: z.ZodString;
3185
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3186
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3187
+ }, "strip", z.ZodTypeAny, {
3188
+ resource: string;
3189
+ matcher: "exact" | "prefix" | "regex";
3190
+ constraints?: Record<string, any> | undefined;
3191
+ }, {
3192
+ resource: string;
3193
+ matcher: "exact" | "prefix" | "regex";
3194
+ constraints?: Record<string, any> | undefined;
3195
+ }>, "many">;
3196
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3197
+ budget: z.ZodOptional<z.ZodObject<{
3198
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3199
+ cap: z.ZodNumber;
3200
+ window: z.ZodOptional<z.ZodObject<{
3201
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3202
+ durationSec: z.ZodNumber;
3203
+ }, "strip", z.ZodTypeAny, {
3204
+ kind: "rolling" | "fixed";
3205
+ durationSec: number;
3206
+ }, {
3207
+ kind: "rolling" | "fixed";
3208
+ durationSec: number;
3209
+ }>>;
3210
+ }, "strip", z.ZodTypeAny, {
3211
+ unit: "USD" | "ops" | "points";
3212
+ cap: number;
3213
+ window?: {
3214
+ kind: "rolling" | "fixed";
3215
+ durationSec: number;
3216
+ } | undefined;
3217
+ }, {
3218
+ unit: "USD" | "ops" | "points";
3219
+ cap: number;
3220
+ window?: {
3221
+ kind: "rolling" | "fixed";
3222
+ durationSec: number;
3223
+ } | undefined;
3224
+ }>>;
3225
+ scopes: z.ZodArray<z.ZodObject<{
3226
+ resource: z.ZodString;
3227
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3228
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3229
+ }, "strip", z.ZodTypeAny, {
3230
+ resource: string;
3231
+ matcher: "exact" | "prefix" | "regex";
3232
+ constraints?: Record<string, any> | undefined;
3233
+ }, {
3234
+ resource: string;
3235
+ matcher: "exact" | "prefix" | "regex";
3236
+ constraints?: Record<string, any> | undefined;
3237
+ }>, "many">;
3238
+ }, z.ZodTypeAny, "passthrough">>;
3239
+ }, z.ZodTypeAny, "passthrough">>;
3240
+ /** Detached JWS signature over canonical delegation document */
3241
+ signature: z.ZodString;
3242
+ /** Current status of the delegation */
3243
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
3244
+ /** Timestamp when created (milliseconds since epoch) */
3245
+ createdAt: z.ZodOptional<z.ZodNumber>;
3246
+ /** Timestamp when revoked (if status is revoked) */
3247
+ revokedAt: z.ZodOptional<z.ZodNumber>;
3248
+ /** Optional reason for revocation */
3249
+ revokedReason: z.ZodOptional<z.ZodString>;
3250
+ /** Optional metadata */
3251
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3252
+ }, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
3253
+ /** Unique identifier for the delegation */
3254
+ id: z.ZodString;
3255
+ /** DID of the delegator (issuer, e.g., merchant/user) */
3256
+ issuerDid: z.ZodString;
3257
+ /** DID of the delegatee (subject, e.g., agent) */
3258
+ subjectDid: z.ZodString;
3259
+ /** Optional controller (user account ID or DID) */
3260
+ controller: z.ZodOptional<z.ZodString>;
3261
+ /** ID of the backing Verifiable Credential */
3262
+ vcId: z.ZodString;
3263
+ /** Optional parent delegation ID for chain tracking */
3264
+ parentId: z.ZodOptional<z.ZodString>;
3265
+ /** CRISP constraints on this delegation */
3266
+ constraints: z.ZodObject<{
3267
+ notBefore: z.ZodOptional<z.ZodNumber>;
3268
+ notAfter: z.ZodOptional<z.ZodNumber>;
3269
+ crisp: z.ZodObject<{
3270
+ budget: z.ZodOptional<z.ZodObject<{
3271
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3272
+ cap: z.ZodNumber;
3273
+ window: z.ZodOptional<z.ZodObject<{
3274
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3275
+ durationSec: z.ZodNumber;
3276
+ }, "strip", z.ZodTypeAny, {
3277
+ kind: "rolling" | "fixed";
3278
+ durationSec: number;
3279
+ }, {
3280
+ kind: "rolling" | "fixed";
3281
+ durationSec: number;
3282
+ }>>;
3283
+ }, "strip", z.ZodTypeAny, {
3284
+ unit: "USD" | "ops" | "points";
3285
+ cap: number;
3286
+ window?: {
3287
+ kind: "rolling" | "fixed";
3288
+ durationSec: number;
3289
+ } | undefined;
3290
+ }, {
3291
+ unit: "USD" | "ops" | "points";
3292
+ cap: number;
3293
+ window?: {
3294
+ kind: "rolling" | "fixed";
3295
+ durationSec: number;
3296
+ } | undefined;
3297
+ }>>;
3298
+ scopes: z.ZodArray<z.ZodObject<{
3299
+ resource: z.ZodString;
3300
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3301
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3302
+ }, "strip", z.ZodTypeAny, {
3303
+ resource: string;
3304
+ matcher: "exact" | "prefix" | "regex";
3305
+ constraints?: Record<string, any> | undefined;
3306
+ }, {
3307
+ resource: string;
3308
+ matcher: "exact" | "prefix" | "regex";
3309
+ constraints?: Record<string, any> | undefined;
3310
+ }>, "many">;
3311
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3312
+ budget: z.ZodOptional<z.ZodObject<{
3313
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3314
+ cap: z.ZodNumber;
3315
+ window: z.ZodOptional<z.ZodObject<{
3316
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3317
+ durationSec: z.ZodNumber;
3318
+ }, "strip", z.ZodTypeAny, {
3319
+ kind: "rolling" | "fixed";
3320
+ durationSec: number;
3321
+ }, {
3322
+ kind: "rolling" | "fixed";
3323
+ durationSec: number;
3324
+ }>>;
3325
+ }, "strip", z.ZodTypeAny, {
3326
+ unit: "USD" | "ops" | "points";
3327
+ cap: number;
3328
+ window?: {
3329
+ kind: "rolling" | "fixed";
3330
+ durationSec: number;
3331
+ } | undefined;
3332
+ }, {
3333
+ unit: "USD" | "ops" | "points";
3334
+ cap: number;
3335
+ window?: {
3336
+ kind: "rolling" | "fixed";
3337
+ durationSec: number;
3338
+ } | undefined;
3339
+ }>>;
3340
+ scopes: z.ZodArray<z.ZodObject<{
3341
+ resource: z.ZodString;
3342
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3343
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3344
+ }, "strip", z.ZodTypeAny, {
3345
+ resource: string;
3346
+ matcher: "exact" | "prefix" | "regex";
3347
+ constraints?: Record<string, any> | undefined;
3348
+ }, {
3349
+ resource: string;
3350
+ matcher: "exact" | "prefix" | "regex";
3351
+ constraints?: Record<string, any> | undefined;
3352
+ }>, "many">;
3353
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3354
+ budget: z.ZodOptional<z.ZodObject<{
3355
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3356
+ cap: z.ZodNumber;
3357
+ window: z.ZodOptional<z.ZodObject<{
3358
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3359
+ durationSec: z.ZodNumber;
3360
+ }, "strip", z.ZodTypeAny, {
3361
+ kind: "rolling" | "fixed";
3362
+ durationSec: number;
3363
+ }, {
3364
+ kind: "rolling" | "fixed";
3365
+ durationSec: number;
3366
+ }>>;
3367
+ }, "strip", z.ZodTypeAny, {
3368
+ unit: "USD" | "ops" | "points";
3369
+ cap: number;
3370
+ window?: {
3371
+ kind: "rolling" | "fixed";
3372
+ durationSec: number;
3373
+ } | undefined;
3374
+ }, {
3375
+ unit: "USD" | "ops" | "points";
3376
+ cap: number;
3377
+ window?: {
3378
+ kind: "rolling" | "fixed";
3379
+ durationSec: number;
3380
+ } | undefined;
3381
+ }>>;
3382
+ scopes: z.ZodArray<z.ZodObject<{
3383
+ resource: z.ZodString;
3384
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3385
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3386
+ }, "strip", z.ZodTypeAny, {
3387
+ resource: string;
3388
+ matcher: "exact" | "prefix" | "regex";
3389
+ constraints?: Record<string, any> | undefined;
3390
+ }, {
3391
+ resource: string;
3392
+ matcher: "exact" | "prefix" | "regex";
3393
+ constraints?: Record<string, any> | undefined;
3394
+ }>, "many">;
3395
+ }, z.ZodTypeAny, "passthrough">>;
3396
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3397
+ notBefore: z.ZodOptional<z.ZodNumber>;
3398
+ notAfter: z.ZodOptional<z.ZodNumber>;
3399
+ crisp: z.ZodObject<{
3400
+ budget: z.ZodOptional<z.ZodObject<{
3401
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3402
+ cap: z.ZodNumber;
3403
+ window: z.ZodOptional<z.ZodObject<{
3404
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3405
+ durationSec: z.ZodNumber;
3406
+ }, "strip", z.ZodTypeAny, {
3407
+ kind: "rolling" | "fixed";
3408
+ durationSec: number;
3409
+ }, {
3410
+ kind: "rolling" | "fixed";
3411
+ durationSec: number;
3412
+ }>>;
3413
+ }, "strip", z.ZodTypeAny, {
3414
+ unit: "USD" | "ops" | "points";
3415
+ cap: number;
3416
+ window?: {
3417
+ kind: "rolling" | "fixed";
3418
+ durationSec: number;
3419
+ } | undefined;
3420
+ }, {
3421
+ unit: "USD" | "ops" | "points";
3422
+ cap: number;
3423
+ window?: {
3424
+ kind: "rolling" | "fixed";
3425
+ durationSec: number;
3426
+ } | undefined;
3427
+ }>>;
3428
+ scopes: z.ZodArray<z.ZodObject<{
3429
+ resource: z.ZodString;
3430
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3431
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3432
+ }, "strip", z.ZodTypeAny, {
3433
+ resource: string;
3434
+ matcher: "exact" | "prefix" | "regex";
3435
+ constraints?: Record<string, any> | undefined;
3436
+ }, {
3437
+ resource: string;
3438
+ matcher: "exact" | "prefix" | "regex";
3439
+ constraints?: Record<string, any> | undefined;
3440
+ }>, "many">;
3441
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3442
+ budget: z.ZodOptional<z.ZodObject<{
3443
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3444
+ cap: z.ZodNumber;
3445
+ window: z.ZodOptional<z.ZodObject<{
3446
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3447
+ durationSec: z.ZodNumber;
3448
+ }, "strip", z.ZodTypeAny, {
3449
+ kind: "rolling" | "fixed";
3450
+ durationSec: number;
3451
+ }, {
3452
+ kind: "rolling" | "fixed";
3453
+ durationSec: number;
3454
+ }>>;
3455
+ }, "strip", z.ZodTypeAny, {
3456
+ unit: "USD" | "ops" | "points";
3457
+ cap: number;
3458
+ window?: {
3459
+ kind: "rolling" | "fixed";
3460
+ durationSec: number;
3461
+ } | undefined;
3462
+ }, {
3463
+ unit: "USD" | "ops" | "points";
3464
+ cap: number;
3465
+ window?: {
3466
+ kind: "rolling" | "fixed";
3467
+ durationSec: number;
3468
+ } | undefined;
3469
+ }>>;
3470
+ scopes: z.ZodArray<z.ZodObject<{
3471
+ resource: z.ZodString;
3472
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3473
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3474
+ }, "strip", z.ZodTypeAny, {
3475
+ resource: string;
3476
+ matcher: "exact" | "prefix" | "regex";
3477
+ constraints?: Record<string, any> | undefined;
3478
+ }, {
3479
+ resource: string;
3480
+ matcher: "exact" | "prefix" | "regex";
3481
+ constraints?: Record<string, any> | undefined;
3482
+ }>, "many">;
3483
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3484
+ budget: z.ZodOptional<z.ZodObject<{
3485
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3486
+ cap: z.ZodNumber;
3487
+ window: z.ZodOptional<z.ZodObject<{
3488
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3489
+ durationSec: z.ZodNumber;
3490
+ }, "strip", z.ZodTypeAny, {
3491
+ kind: "rolling" | "fixed";
3492
+ durationSec: number;
3493
+ }, {
3494
+ kind: "rolling" | "fixed";
3495
+ durationSec: number;
3496
+ }>>;
3497
+ }, "strip", z.ZodTypeAny, {
3498
+ unit: "USD" | "ops" | "points";
3499
+ cap: number;
3500
+ window?: {
3501
+ kind: "rolling" | "fixed";
3502
+ durationSec: number;
3503
+ } | undefined;
3504
+ }, {
3505
+ unit: "USD" | "ops" | "points";
3506
+ cap: number;
3507
+ window?: {
3508
+ kind: "rolling" | "fixed";
3509
+ durationSec: number;
3510
+ } | undefined;
3511
+ }>>;
3512
+ scopes: z.ZodArray<z.ZodObject<{
3513
+ resource: z.ZodString;
3514
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3515
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3516
+ }, "strip", z.ZodTypeAny, {
3517
+ resource: string;
3518
+ matcher: "exact" | "prefix" | "regex";
3519
+ constraints?: Record<string, any> | undefined;
3520
+ }, {
3521
+ resource: string;
3522
+ matcher: "exact" | "prefix" | "regex";
3523
+ constraints?: Record<string, any> | undefined;
3524
+ }>, "many">;
3525
+ }, z.ZodTypeAny, "passthrough">>;
3526
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3527
+ notBefore: z.ZodOptional<z.ZodNumber>;
3528
+ notAfter: z.ZodOptional<z.ZodNumber>;
3529
+ crisp: z.ZodObject<{
3530
+ budget: z.ZodOptional<z.ZodObject<{
3531
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3532
+ cap: z.ZodNumber;
3533
+ window: z.ZodOptional<z.ZodObject<{
3534
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3535
+ durationSec: z.ZodNumber;
3536
+ }, "strip", z.ZodTypeAny, {
3537
+ kind: "rolling" | "fixed";
3538
+ durationSec: number;
3539
+ }, {
3540
+ kind: "rolling" | "fixed";
3541
+ durationSec: number;
3542
+ }>>;
3543
+ }, "strip", z.ZodTypeAny, {
3544
+ unit: "USD" | "ops" | "points";
3545
+ cap: number;
3546
+ window?: {
3547
+ kind: "rolling" | "fixed";
3548
+ durationSec: number;
3549
+ } | undefined;
3550
+ }, {
3551
+ unit: "USD" | "ops" | "points";
3552
+ cap: number;
3553
+ window?: {
3554
+ kind: "rolling" | "fixed";
3555
+ durationSec: number;
3556
+ } | undefined;
3557
+ }>>;
3558
+ scopes: z.ZodArray<z.ZodObject<{
3559
+ resource: z.ZodString;
3560
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3561
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3562
+ }, "strip", z.ZodTypeAny, {
3563
+ resource: string;
3564
+ matcher: "exact" | "prefix" | "regex";
3565
+ constraints?: Record<string, any> | undefined;
3566
+ }, {
3567
+ resource: string;
3568
+ matcher: "exact" | "prefix" | "regex";
3569
+ constraints?: Record<string, any> | undefined;
3570
+ }>, "many">;
3571
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3572
+ budget: z.ZodOptional<z.ZodObject<{
3573
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3574
+ cap: z.ZodNumber;
3575
+ window: z.ZodOptional<z.ZodObject<{
3576
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3577
+ durationSec: z.ZodNumber;
3578
+ }, "strip", z.ZodTypeAny, {
3579
+ kind: "rolling" | "fixed";
3580
+ durationSec: number;
3581
+ }, {
3582
+ kind: "rolling" | "fixed";
3583
+ durationSec: number;
3584
+ }>>;
3585
+ }, "strip", z.ZodTypeAny, {
3586
+ unit: "USD" | "ops" | "points";
3587
+ cap: number;
3588
+ window?: {
3589
+ kind: "rolling" | "fixed";
3590
+ durationSec: number;
3591
+ } | undefined;
3592
+ }, {
3593
+ unit: "USD" | "ops" | "points";
3594
+ cap: number;
3595
+ window?: {
3596
+ kind: "rolling" | "fixed";
3597
+ durationSec: number;
3598
+ } | undefined;
3599
+ }>>;
3600
+ scopes: z.ZodArray<z.ZodObject<{
3601
+ resource: z.ZodString;
3602
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3603
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3604
+ }, "strip", z.ZodTypeAny, {
3605
+ resource: string;
3606
+ matcher: "exact" | "prefix" | "regex";
3607
+ constraints?: Record<string, any> | undefined;
3608
+ }, {
3609
+ resource: string;
3610
+ matcher: "exact" | "prefix" | "regex";
3611
+ constraints?: Record<string, any> | undefined;
3612
+ }>, "many">;
3613
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3614
+ budget: z.ZodOptional<z.ZodObject<{
3615
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
3616
+ cap: z.ZodNumber;
3617
+ window: z.ZodOptional<z.ZodObject<{
3618
+ kind: z.ZodEnum<["rolling", "fixed"]>;
3619
+ durationSec: z.ZodNumber;
3620
+ }, "strip", z.ZodTypeAny, {
3621
+ kind: "rolling" | "fixed";
3622
+ durationSec: number;
3623
+ }, {
3624
+ kind: "rolling" | "fixed";
3625
+ durationSec: number;
3626
+ }>>;
3627
+ }, "strip", z.ZodTypeAny, {
3628
+ unit: "USD" | "ops" | "points";
3629
+ cap: number;
3630
+ window?: {
3631
+ kind: "rolling" | "fixed";
3632
+ durationSec: number;
3633
+ } | undefined;
3634
+ }, {
3635
+ unit: "USD" | "ops" | "points";
3636
+ cap: number;
3637
+ window?: {
3638
+ kind: "rolling" | "fixed";
3639
+ durationSec: number;
3640
+ } | undefined;
3641
+ }>>;
3642
+ scopes: z.ZodArray<z.ZodObject<{
3643
+ resource: z.ZodString;
3644
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
3645
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3646
+ }, "strip", z.ZodTypeAny, {
3647
+ resource: string;
3648
+ matcher: "exact" | "prefix" | "regex";
3649
+ constraints?: Record<string, any> | undefined;
3650
+ }, {
3651
+ resource: string;
3652
+ matcher: "exact" | "prefix" | "regex";
3653
+ constraints?: Record<string, any> | undefined;
3654
+ }>, "many">;
3655
+ }, z.ZodTypeAny, "passthrough">>;
3656
+ }, z.ZodTypeAny, "passthrough">>;
3657
+ /** Detached JWS signature over canonical delegation document */
3658
+ signature: z.ZodString;
3659
+ /** Current status of the delegation */
3660
+ status: z.ZodEnum<["active", "revoked", "expired"]>;
3661
+ /** Timestamp when created (milliseconds since epoch) */
3662
+ createdAt: z.ZodOptional<z.ZodNumber>;
3663
+ /** Timestamp when revoked (if status is revoked) */
3664
+ revokedAt: z.ZodOptional<z.ZodNumber>;
3665
+ /** Optional reason for revocation */
3666
+ revokedReason: z.ZodOptional<z.ZodString>;
3667
+ /** Optional metadata */
3668
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3669
+ }, z.ZodTypeAny, "passthrough">>;
3670
+ /**
3671
+ * Validate a delegation chain
3672
+ *
3673
+ * @param chain - The delegation chain to validate
3674
+ * @returns Validation result
3675
+ */
3676
+ export declare function validateDelegationChain(chain: unknown): z.SafeParseReturnType<{
3677
+ valid: boolean;
3678
+ depth: number;
3679
+ rootIssuer: string;
3680
+ leafSubject: string;
3681
+ chain: {
3682
+ issuerDid: string;
3683
+ subjectDid: string;
3684
+ vcId: string;
3685
+ status: "active" | "revoked" | "expired";
3686
+ constraints: {
3687
+ crisp: {
3688
+ scopes: {
3689
+ resource: string;
3690
+ matcher: "exact" | "prefix" | "regex";
3691
+ constraints?: Record<string, any> | undefined;
3692
+ }[];
3693
+ budget?: {
3694
+ unit: "USD" | "ops" | "points";
3695
+ cap: number;
3696
+ window?: {
3697
+ kind: "rolling" | "fixed";
3698
+ durationSec: number;
3699
+ } | undefined;
3700
+ } | undefined;
3701
+ } & {
3702
+ [k: string]: unknown;
3703
+ };
3704
+ notBefore?: number | undefined;
3705
+ notAfter?: number | undefined;
3706
+ } & {
3707
+ [k: string]: unknown;
3708
+ };
3709
+ delegationId: string;
3710
+ depth: number;
3711
+ }[];
3712
+ errors?: string[] | undefined;
3713
+ }, {
3714
+ valid: boolean;
3715
+ depth: number;
3716
+ rootIssuer: string;
3717
+ leafSubject: string;
3718
+ chain: {
3719
+ issuerDid: string;
3720
+ subjectDid: string;
3721
+ vcId: string;
3722
+ status: "active" | "revoked" | "expired";
3723
+ constraints: {
3724
+ crisp: {
3725
+ scopes: {
3726
+ resource: string;
3727
+ matcher: "exact" | "prefix" | "regex";
3728
+ constraints?: Record<string, any> | undefined;
3729
+ }[];
3730
+ budget?: {
3731
+ unit: "USD" | "ops" | "points";
3732
+ cap: number;
3733
+ window?: {
3734
+ kind: "rolling" | "fixed";
3735
+ durationSec: number;
3736
+ } | undefined;
3737
+ } | undefined;
3738
+ } & {
3739
+ [k: string]: unknown;
3740
+ };
3741
+ notBefore?: number | undefined;
3742
+ notAfter?: number | undefined;
3743
+ } & {
3744
+ [k: string]: unknown;
3745
+ };
3746
+ delegationId: string;
3747
+ depth: number;
3748
+ }[];
3749
+ errors?: string[] | undefined;
3750
+ }>;
3751
+ /**
3752
+ * Check if a delegation is expired based on constraints
3753
+ *
3754
+ * @param delegation - The delegation to check
3755
+ * @returns true if expired
3756
+ */
3757
+ export declare function isDelegationExpired(delegation: DelegationRecord): boolean;
3758
+ /**
3759
+ * Check if a delegation is not yet valid based on constraints
3760
+ *
3761
+ * @param delegation - The delegation to check
3762
+ * @returns true if not yet valid
3763
+ */
3764
+ export declare function isDelegationNotYetValid(delegation: DelegationRecord): boolean;
3765
+ /**
3766
+ * Check if a delegation is currently valid (active and within time bounds)
3767
+ *
3768
+ * @param delegation - The delegation to check
3769
+ * @returns true if currently valid
3770
+ */
3771
+ export declare function isDelegationCurrentlyValid(delegation: DelegationRecord): boolean;
3772
+ /**
3773
+ * Constants
3774
+ */
3775
+ /**
3776
+ * Maximum reasonable delegation chain depth
3777
+ */
3778
+ export declare const MAX_DELEGATION_CHAIN_DEPTH = 10;
3779
+ /**
3780
+ * Default delegation status for new delegations
3781
+ */
3782
+ export declare const DEFAULT_DELEGATION_STATUS: DelegationStatus;
3783
+ /**
3784
+ * Supported delegation statuses
3785
+ */
3786
+ export declare const DELEGATION_STATUSES: DelegationStatus[];
3787
+ //# sourceMappingURL=schemas.d.ts.map