@kya-os/contracts 1.3.1-canary.0 → 1.3.1-canary.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 (55) hide show
  1. package/dist/cli.d.ts +48 -10
  2. package/dist/cli.js +18 -6
  3. package/dist/delegation/schemas.d.ts +4330 -29
  4. package/dist/delegation/schemas.js +248 -2
  5. package/dist/did/index.d.ts +1 -0
  6. package/dist/did/index.js +1 -0
  7. package/dist/did/schemas.d.ts +113 -0
  8. package/dist/did/schemas.js +173 -0
  9. package/dist/did/types.d.ts +1 -1
  10. package/dist/handshake.d.ts +2 -2
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.js +3 -0
  13. package/dist/proof.d.ts +238 -0
  14. package/dist/proof.js +32 -1
  15. package/dist/registry.d.ts +15 -15
  16. package/dist/registry.js +3 -2
  17. package/dist/test.d.ts +19 -19
  18. package/dist/test.js +5 -5
  19. package/dist/utils/validation.d.ts +1 -1
  20. package/dist/utils/validation.js +1 -1
  21. package/dist/verifier.d.ts +31 -17
  22. package/dist/verifier.js +18 -2
  23. package/package.json +3 -5
  24. package/dist/cli.d.ts.map +0 -1
  25. package/dist/delegation/constraints.d.ts.map +0 -1
  26. package/dist/delegation/index.d.ts.map +0 -1
  27. package/dist/delegation/schemas.d.ts.map +0 -1
  28. package/dist/did/index.d.ts.map +0 -1
  29. package/dist/did/resolve-contract.d.ts.map +0 -1
  30. package/dist/did/types.d.ts.map +0 -1
  31. package/dist/env/constants.d.ts.map +0 -1
  32. package/dist/env/index.d.ts.map +0 -1
  33. package/dist/handshake.d.ts.map +0 -1
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/proof/index.d.ts.map +0 -1
  36. package/dist/proof/proof-record.d.ts.map +0 -1
  37. package/dist/proof/signing-spec.d.ts.map +0 -1
  38. package/dist/proof.d.ts.map +0 -1
  39. package/dist/registry.d.ts.map +0 -1
  40. package/dist/runtime/errors.d.ts.map +0 -1
  41. package/dist/runtime/headers.d.ts.map +0 -1
  42. package/dist/runtime/index.d.ts.map +0 -1
  43. package/dist/test.d.ts.map +0 -1
  44. package/dist/tlkrc/index.d.ts.map +0 -1
  45. package/dist/tlkrc/rotation.d.ts.map +0 -1
  46. package/dist/utils/validation.d.ts.map +0 -1
  47. package/dist/vc/index.d.ts.map +0 -1
  48. package/dist/vc/schemas.d.ts.map +0 -1
  49. package/dist/vc/statuslist.d.ts.map +0 -1
  50. package/dist/verifier.d.ts.map +0 -1
  51. package/schemas/cli/register-output/v1.0.0.json +0 -69
  52. package/schemas/proof/v1.0.0.json +0 -80
  53. package/schemas/registry/receipt-v1.0.0.json +0 -60
  54. package/schemas/verifier/verify-page/v1.0.0.json +0 -94
  55. package/schemas/well-known/agent/v1.0.0.json +0 -49
@@ -4,10 +4,17 @@
4
4
  * Types and schemas for delegation records that link VCs with CRISP constraints.
5
5
  * Delegations represent the transfer of authority from one DID to another.
6
6
  *
7
- * Related Spec: MCP-I §4.1, §4.2
7
+ * **IMPORTANT**: Per Python POC design (Delegation-Service.md:136-146),
8
+ * delegations SHOULD be issued as W3C Verifiable Credentials, not just reference them.
9
+ * This file provides both:
10
+ * - DelegationRecord: Legacy/internal format (contains delegation data)
11
+ * - DelegationCredential: W3C VC format (delegation as credentialSubject)
12
+ *
13
+ * Related Spec: MCP-I §4.1, §4.2, W3C VC Data Model 1.1
8
14
  * Python Reference: Delegation-Documentation.md, Delegation-Service.md
9
15
  */
10
16
  import { z } from 'zod';
17
+ import { CredentialStatusSchema } from '../vc/schemas.js';
11
18
  /**
12
19
  * Delegation Status
13
20
  *
@@ -1706,6 +1713,9 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
1706
1713
  status: z.ZodEnum<["active", "revoked", "expired"]>;
1707
1714
  }, "strip", z.ZodTypeAny, {
1708
1715
  status: "active" | "revoked" | "expired";
1716
+ issuerDid: string;
1717
+ subjectDid: string;
1718
+ vcId: string;
1709
1719
  constraints: {
1710
1720
  notBefore?: number | undefined;
1711
1721
  notAfter?: number | undefined;
@@ -1756,13 +1766,13 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
1756
1766
  } & {
1757
1767
  [k: string]: unknown;
1758
1768
  };
1759
- issuerDid: string;
1760
- subjectDid: string;
1761
- vcId: string;
1762
1769
  delegationId: string;
1763
1770
  depth: number;
1764
1771
  }, {
1765
1772
  status: "active" | "revoked" | "expired";
1773
+ issuerDid: string;
1774
+ subjectDid: string;
1775
+ vcId: string;
1766
1776
  constraints: {
1767
1777
  notBefore?: number | undefined;
1768
1778
  notAfter?: number | undefined;
@@ -1813,9 +1823,6 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
1813
1823
  } & {
1814
1824
  [k: string]: unknown;
1815
1825
  };
1816
- issuerDid: string;
1817
- subjectDid: string;
1818
- vcId: string;
1819
1826
  delegationId: string;
1820
1827
  depth: number;
1821
1828
  }>;
@@ -2241,6 +2248,9 @@ export declare const DelegationChainSchema: z.ZodObject<{
2241
2248
  status: z.ZodEnum<["active", "revoked", "expired"]>;
2242
2249
  }, "strip", z.ZodTypeAny, {
2243
2250
  status: "active" | "revoked" | "expired";
2251
+ issuerDid: string;
2252
+ subjectDid: string;
2253
+ vcId: string;
2244
2254
  constraints: {
2245
2255
  notBefore?: number | undefined;
2246
2256
  notAfter?: number | undefined;
@@ -2291,13 +2301,13 @@ export declare const DelegationChainSchema: z.ZodObject<{
2291
2301
  } & {
2292
2302
  [k: string]: unknown;
2293
2303
  };
2294
- issuerDid: string;
2295
- subjectDid: string;
2296
- vcId: string;
2297
2304
  delegationId: string;
2298
2305
  depth: number;
2299
2306
  }, {
2300
2307
  status: "active" | "revoked" | "expired";
2308
+ issuerDid: string;
2309
+ subjectDid: string;
2310
+ vcId: string;
2301
2311
  constraints: {
2302
2312
  notBefore?: number | undefined;
2303
2313
  notAfter?: number | undefined;
@@ -2348,9 +2358,6 @@ export declare const DelegationChainSchema: z.ZodObject<{
2348
2358
  } & {
2349
2359
  [k: string]: unknown;
2350
2360
  };
2351
- issuerDid: string;
2352
- subjectDid: string;
2353
- vcId: string;
2354
2361
  delegationId: string;
2355
2362
  depth: number;
2356
2363
  }>, "many">;
@@ -2367,6 +2374,9 @@ export declare const DelegationChainSchema: z.ZodObject<{
2367
2374
  leafSubject: string;
2368
2375
  chain: {
2369
2376
  status: "active" | "revoked" | "expired";
2377
+ issuerDid: string;
2378
+ subjectDid: string;
2379
+ vcId: string;
2370
2380
  constraints: {
2371
2381
  notBefore?: number | undefined;
2372
2382
  notAfter?: number | undefined;
@@ -2417,9 +2427,6 @@ export declare const DelegationChainSchema: z.ZodObject<{
2417
2427
  } & {
2418
2428
  [k: string]: unknown;
2419
2429
  };
2420
- issuerDid: string;
2421
- subjectDid: string;
2422
- vcId: string;
2423
2430
  delegationId: string;
2424
2431
  depth: number;
2425
2432
  }[];
@@ -2431,6 +2438,9 @@ export declare const DelegationChainSchema: z.ZodObject<{
2431
2438
  leafSubject: string;
2432
2439
  chain: {
2433
2440
  status: "active" | "revoked" | "expired";
2441
+ issuerDid: string;
2442
+ subjectDid: string;
2443
+ vcId: string;
2434
2444
  constraints: {
2435
2445
  notBefore?: number | undefined;
2436
2446
  notAfter?: number | undefined;
@@ -2481,9 +2491,6 @@ export declare const DelegationChainSchema: z.ZodObject<{
2481
2491
  } & {
2482
2492
  [k: string]: unknown;
2483
2493
  };
2484
- issuerDid: string;
2485
- subjectDid: string;
2486
- vcId: string;
2487
2494
  delegationId: string;
2488
2495
  depth: number;
2489
2496
  }[];
@@ -2902,6 +2909,8 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
2902
2909
  /** Optional VC ID (if not provided, will be created) */
2903
2910
  vcId: z.ZodOptional<z.ZodString>;
2904
2911
  }, "strip", z.ZodTypeAny, {
2912
+ issuerDid: string;
2913
+ subjectDid: string;
2905
2914
  constraints: {
2906
2915
  notBefore?: number | undefined;
2907
2916
  notAfter?: number | undefined;
@@ -2952,12 +2961,12 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
2952
2961
  } & {
2953
2962
  [k: string]: unknown;
2954
2963
  };
2955
- issuerDid: string;
2956
- subjectDid: string;
2957
2964
  controller?: string | undefined;
2958
2965
  vcId?: string | undefined;
2959
2966
  parentId?: string | undefined;
2960
2967
  }, {
2968
+ issuerDid: string;
2969
+ subjectDid: string;
2961
2970
  constraints: {
2962
2971
  notBefore?: number | undefined;
2963
2972
  notAfter?: number | undefined;
@@ -3008,8 +3017,6 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
3008
3017
  } & {
3009
3018
  [k: string]: unknown;
3010
3019
  };
3011
- issuerDid: string;
3012
- subjectDid: string;
3013
3020
  controller?: string | undefined;
3014
3021
  vcId?: string | undefined;
3015
3022
  parentId?: string | undefined;
@@ -3920,6 +3927,9 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
3920
3927
  leafSubject: string;
3921
3928
  chain: {
3922
3929
  status: "active" | "revoked" | "expired";
3930
+ issuerDid: string;
3931
+ subjectDid: string;
3932
+ vcId: string;
3923
3933
  constraints: {
3924
3934
  notBefore?: number | undefined;
3925
3935
  notAfter?: number | undefined;
@@ -3970,9 +3980,6 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
3970
3980
  } & {
3971
3981
  [k: string]: unknown;
3972
3982
  };
3973
- issuerDid: string;
3974
- subjectDid: string;
3975
- vcId: string;
3976
3983
  delegationId: string;
3977
3984
  depth: number;
3978
3985
  }[];
@@ -3984,6 +3991,9 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
3984
3991
  leafSubject: string;
3985
3992
  chain: {
3986
3993
  status: "active" | "revoked" | "expired";
3994
+ issuerDid: string;
3995
+ subjectDid: string;
3996
+ vcId: string;
3987
3997
  constraints: {
3988
3998
  notBefore?: number | undefined;
3989
3999
  notAfter?: number | undefined;
@@ -4034,9 +4044,6 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
4034
4044
  } & {
4035
4045
  [k: string]: unknown;
4036
4046
  };
4037
- issuerDid: string;
4038
- subjectDid: string;
4039
- vcId: string;
4040
4047
  delegationId: string;
4041
4048
  depth: number;
4042
4049
  }[];
@@ -4078,4 +4085,4298 @@ export declare const DEFAULT_DELEGATION_STATUS: DelegationStatus;
4078
4085
  * Supported delegation statuses
4079
4086
  */
4080
4087
  export declare const DELEGATION_STATUSES: DelegationStatus[];
4088
+ /**
4089
+ * Delegation Credential Context
4090
+ *
4091
+ * Additional JSON-LD context for delegation credentials
4092
+ */
4093
+ export declare const DELEGATION_CREDENTIAL_CONTEXT: "https://schemas.kya-os.ai/xmcp-i/credentials/delegation.v1.0.0.json";
4094
+ /**
4095
+ * Delegation Credential Subject Schema
4096
+ *
4097
+ * The credentialSubject of a DelegationCredential contains:
4098
+ * - id: The delegatee DID (subject of the delegation)
4099
+ * - delegation: The complete delegation record
4100
+ *
4101
+ * Per Python POC (Delegation-Service.md:136-146), delegations are issued AS
4102
+ * W3C VCs, with the delegation data embedded in the credentialSubject.
4103
+ */
4104
+ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
4105
+ /** Subject DID (delegatee) */
4106
+ id: z.ZodString;
4107
+ /** The delegation information */
4108
+ delegation: z.ZodObject<{
4109
+ /** Unique identifier for the delegation */
4110
+ id: z.ZodString;
4111
+ /** DID of the delegator (issuer, e.g., merchant/user) */
4112
+ issuerDid: z.ZodString;
4113
+ /** DID of the delegatee (subject, e.g., agent) */
4114
+ subjectDid: z.ZodString;
4115
+ /** Optional controller (user account ID or DID) */
4116
+ controller: z.ZodOptional<z.ZodString>;
4117
+ /** Optional parent delegation ID for chain tracking */
4118
+ parentId: z.ZodOptional<z.ZodString>;
4119
+ /** CRISP constraints on this delegation */
4120
+ constraints: z.ZodObject<{
4121
+ notBefore: z.ZodOptional<z.ZodNumber>;
4122
+ notAfter: z.ZodOptional<z.ZodNumber>;
4123
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4124
+ crisp: z.ZodOptional<z.ZodObject<{
4125
+ budget: z.ZodOptional<z.ZodObject<{
4126
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4127
+ cap: z.ZodNumber;
4128
+ window: z.ZodOptional<z.ZodObject<{
4129
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4130
+ durationSec: z.ZodNumber;
4131
+ }, "strip", z.ZodTypeAny, {
4132
+ kind: "rolling" | "fixed";
4133
+ durationSec: number;
4134
+ }, {
4135
+ kind: "rolling" | "fixed";
4136
+ durationSec: number;
4137
+ }>>;
4138
+ }, "strip", z.ZodTypeAny, {
4139
+ unit: "USD" | "ops" | "points";
4140
+ cap: number;
4141
+ window?: {
4142
+ kind: "rolling" | "fixed";
4143
+ durationSec: number;
4144
+ } | undefined;
4145
+ }, {
4146
+ unit: "USD" | "ops" | "points";
4147
+ cap: number;
4148
+ window?: {
4149
+ kind: "rolling" | "fixed";
4150
+ durationSec: number;
4151
+ } | undefined;
4152
+ }>>;
4153
+ scopes: z.ZodArray<z.ZodObject<{
4154
+ resource: z.ZodString;
4155
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4156
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4157
+ }, "strip", z.ZodTypeAny, {
4158
+ resource: string;
4159
+ matcher: "exact" | "prefix" | "regex";
4160
+ constraints?: Record<string, any> | undefined;
4161
+ }, {
4162
+ resource: string;
4163
+ matcher: "exact" | "prefix" | "regex";
4164
+ constraints?: Record<string, any> | undefined;
4165
+ }>, "many">;
4166
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4167
+ budget: z.ZodOptional<z.ZodObject<{
4168
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4169
+ cap: z.ZodNumber;
4170
+ window: z.ZodOptional<z.ZodObject<{
4171
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4172
+ durationSec: z.ZodNumber;
4173
+ }, "strip", z.ZodTypeAny, {
4174
+ kind: "rolling" | "fixed";
4175
+ durationSec: number;
4176
+ }, {
4177
+ kind: "rolling" | "fixed";
4178
+ durationSec: number;
4179
+ }>>;
4180
+ }, "strip", z.ZodTypeAny, {
4181
+ unit: "USD" | "ops" | "points";
4182
+ cap: number;
4183
+ window?: {
4184
+ kind: "rolling" | "fixed";
4185
+ durationSec: number;
4186
+ } | undefined;
4187
+ }, {
4188
+ unit: "USD" | "ops" | "points";
4189
+ cap: number;
4190
+ window?: {
4191
+ kind: "rolling" | "fixed";
4192
+ durationSec: number;
4193
+ } | undefined;
4194
+ }>>;
4195
+ scopes: z.ZodArray<z.ZodObject<{
4196
+ resource: z.ZodString;
4197
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4198
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4199
+ }, "strip", z.ZodTypeAny, {
4200
+ resource: string;
4201
+ matcher: "exact" | "prefix" | "regex";
4202
+ constraints?: Record<string, any> | undefined;
4203
+ }, {
4204
+ resource: string;
4205
+ matcher: "exact" | "prefix" | "regex";
4206
+ constraints?: Record<string, any> | undefined;
4207
+ }>, "many">;
4208
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4209
+ budget: z.ZodOptional<z.ZodObject<{
4210
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4211
+ cap: z.ZodNumber;
4212
+ window: z.ZodOptional<z.ZodObject<{
4213
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4214
+ durationSec: z.ZodNumber;
4215
+ }, "strip", z.ZodTypeAny, {
4216
+ kind: "rolling" | "fixed";
4217
+ durationSec: number;
4218
+ }, {
4219
+ kind: "rolling" | "fixed";
4220
+ durationSec: number;
4221
+ }>>;
4222
+ }, "strip", z.ZodTypeAny, {
4223
+ unit: "USD" | "ops" | "points";
4224
+ cap: number;
4225
+ window?: {
4226
+ kind: "rolling" | "fixed";
4227
+ durationSec: number;
4228
+ } | undefined;
4229
+ }, {
4230
+ unit: "USD" | "ops" | "points";
4231
+ cap: number;
4232
+ window?: {
4233
+ kind: "rolling" | "fixed";
4234
+ durationSec: number;
4235
+ } | undefined;
4236
+ }>>;
4237
+ scopes: z.ZodArray<z.ZodObject<{
4238
+ resource: z.ZodString;
4239
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4240
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4241
+ }, "strip", z.ZodTypeAny, {
4242
+ resource: string;
4243
+ matcher: "exact" | "prefix" | "regex";
4244
+ constraints?: Record<string, any> | undefined;
4245
+ }, {
4246
+ resource: string;
4247
+ matcher: "exact" | "prefix" | "regex";
4248
+ constraints?: Record<string, any> | undefined;
4249
+ }>, "many">;
4250
+ }, z.ZodTypeAny, "passthrough">>>;
4251
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4252
+ notBefore: z.ZodOptional<z.ZodNumber>;
4253
+ notAfter: z.ZodOptional<z.ZodNumber>;
4254
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4255
+ crisp: z.ZodOptional<z.ZodObject<{
4256
+ budget: z.ZodOptional<z.ZodObject<{
4257
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4258
+ cap: z.ZodNumber;
4259
+ window: z.ZodOptional<z.ZodObject<{
4260
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4261
+ durationSec: z.ZodNumber;
4262
+ }, "strip", z.ZodTypeAny, {
4263
+ kind: "rolling" | "fixed";
4264
+ durationSec: number;
4265
+ }, {
4266
+ kind: "rolling" | "fixed";
4267
+ durationSec: number;
4268
+ }>>;
4269
+ }, "strip", z.ZodTypeAny, {
4270
+ unit: "USD" | "ops" | "points";
4271
+ cap: number;
4272
+ window?: {
4273
+ kind: "rolling" | "fixed";
4274
+ durationSec: number;
4275
+ } | undefined;
4276
+ }, {
4277
+ unit: "USD" | "ops" | "points";
4278
+ cap: number;
4279
+ window?: {
4280
+ kind: "rolling" | "fixed";
4281
+ durationSec: number;
4282
+ } | undefined;
4283
+ }>>;
4284
+ scopes: z.ZodArray<z.ZodObject<{
4285
+ resource: z.ZodString;
4286
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4287
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4288
+ }, "strip", z.ZodTypeAny, {
4289
+ resource: string;
4290
+ matcher: "exact" | "prefix" | "regex";
4291
+ constraints?: Record<string, any> | undefined;
4292
+ }, {
4293
+ resource: string;
4294
+ matcher: "exact" | "prefix" | "regex";
4295
+ constraints?: Record<string, any> | undefined;
4296
+ }>, "many">;
4297
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4298
+ budget: z.ZodOptional<z.ZodObject<{
4299
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4300
+ cap: z.ZodNumber;
4301
+ window: z.ZodOptional<z.ZodObject<{
4302
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4303
+ durationSec: z.ZodNumber;
4304
+ }, "strip", z.ZodTypeAny, {
4305
+ kind: "rolling" | "fixed";
4306
+ durationSec: number;
4307
+ }, {
4308
+ kind: "rolling" | "fixed";
4309
+ durationSec: number;
4310
+ }>>;
4311
+ }, "strip", z.ZodTypeAny, {
4312
+ unit: "USD" | "ops" | "points";
4313
+ cap: number;
4314
+ window?: {
4315
+ kind: "rolling" | "fixed";
4316
+ durationSec: number;
4317
+ } | undefined;
4318
+ }, {
4319
+ unit: "USD" | "ops" | "points";
4320
+ cap: number;
4321
+ window?: {
4322
+ kind: "rolling" | "fixed";
4323
+ durationSec: number;
4324
+ } | undefined;
4325
+ }>>;
4326
+ scopes: z.ZodArray<z.ZodObject<{
4327
+ resource: z.ZodString;
4328
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4329
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4330
+ }, "strip", z.ZodTypeAny, {
4331
+ resource: string;
4332
+ matcher: "exact" | "prefix" | "regex";
4333
+ constraints?: Record<string, any> | undefined;
4334
+ }, {
4335
+ resource: string;
4336
+ matcher: "exact" | "prefix" | "regex";
4337
+ constraints?: Record<string, any> | undefined;
4338
+ }>, "many">;
4339
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4340
+ budget: z.ZodOptional<z.ZodObject<{
4341
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4342
+ cap: z.ZodNumber;
4343
+ window: z.ZodOptional<z.ZodObject<{
4344
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4345
+ durationSec: z.ZodNumber;
4346
+ }, "strip", z.ZodTypeAny, {
4347
+ kind: "rolling" | "fixed";
4348
+ durationSec: number;
4349
+ }, {
4350
+ kind: "rolling" | "fixed";
4351
+ durationSec: number;
4352
+ }>>;
4353
+ }, "strip", z.ZodTypeAny, {
4354
+ unit: "USD" | "ops" | "points";
4355
+ cap: number;
4356
+ window?: {
4357
+ kind: "rolling" | "fixed";
4358
+ durationSec: number;
4359
+ } | undefined;
4360
+ }, {
4361
+ unit: "USD" | "ops" | "points";
4362
+ cap: number;
4363
+ window?: {
4364
+ kind: "rolling" | "fixed";
4365
+ durationSec: number;
4366
+ } | undefined;
4367
+ }>>;
4368
+ scopes: z.ZodArray<z.ZodObject<{
4369
+ resource: z.ZodString;
4370
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4371
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4372
+ }, "strip", z.ZodTypeAny, {
4373
+ resource: string;
4374
+ matcher: "exact" | "prefix" | "regex";
4375
+ constraints?: Record<string, any> | undefined;
4376
+ }, {
4377
+ resource: string;
4378
+ matcher: "exact" | "prefix" | "regex";
4379
+ constraints?: Record<string, any> | undefined;
4380
+ }>, "many">;
4381
+ }, z.ZodTypeAny, "passthrough">>>;
4382
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4383
+ notBefore: z.ZodOptional<z.ZodNumber>;
4384
+ notAfter: z.ZodOptional<z.ZodNumber>;
4385
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4386
+ crisp: z.ZodOptional<z.ZodObject<{
4387
+ budget: z.ZodOptional<z.ZodObject<{
4388
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4389
+ cap: z.ZodNumber;
4390
+ window: z.ZodOptional<z.ZodObject<{
4391
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4392
+ durationSec: z.ZodNumber;
4393
+ }, "strip", z.ZodTypeAny, {
4394
+ kind: "rolling" | "fixed";
4395
+ durationSec: number;
4396
+ }, {
4397
+ kind: "rolling" | "fixed";
4398
+ durationSec: number;
4399
+ }>>;
4400
+ }, "strip", z.ZodTypeAny, {
4401
+ unit: "USD" | "ops" | "points";
4402
+ cap: number;
4403
+ window?: {
4404
+ kind: "rolling" | "fixed";
4405
+ durationSec: number;
4406
+ } | undefined;
4407
+ }, {
4408
+ unit: "USD" | "ops" | "points";
4409
+ cap: number;
4410
+ window?: {
4411
+ kind: "rolling" | "fixed";
4412
+ durationSec: number;
4413
+ } | undefined;
4414
+ }>>;
4415
+ scopes: z.ZodArray<z.ZodObject<{
4416
+ resource: z.ZodString;
4417
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4418
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4419
+ }, "strip", z.ZodTypeAny, {
4420
+ resource: string;
4421
+ matcher: "exact" | "prefix" | "regex";
4422
+ constraints?: Record<string, any> | undefined;
4423
+ }, {
4424
+ resource: string;
4425
+ matcher: "exact" | "prefix" | "regex";
4426
+ constraints?: Record<string, any> | undefined;
4427
+ }>, "many">;
4428
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4429
+ budget: z.ZodOptional<z.ZodObject<{
4430
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4431
+ cap: z.ZodNumber;
4432
+ window: z.ZodOptional<z.ZodObject<{
4433
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4434
+ durationSec: z.ZodNumber;
4435
+ }, "strip", z.ZodTypeAny, {
4436
+ kind: "rolling" | "fixed";
4437
+ durationSec: number;
4438
+ }, {
4439
+ kind: "rolling" | "fixed";
4440
+ durationSec: number;
4441
+ }>>;
4442
+ }, "strip", z.ZodTypeAny, {
4443
+ unit: "USD" | "ops" | "points";
4444
+ cap: number;
4445
+ window?: {
4446
+ kind: "rolling" | "fixed";
4447
+ durationSec: number;
4448
+ } | undefined;
4449
+ }, {
4450
+ unit: "USD" | "ops" | "points";
4451
+ cap: number;
4452
+ window?: {
4453
+ kind: "rolling" | "fixed";
4454
+ durationSec: number;
4455
+ } | undefined;
4456
+ }>>;
4457
+ scopes: z.ZodArray<z.ZodObject<{
4458
+ resource: z.ZodString;
4459
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4460
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4461
+ }, "strip", z.ZodTypeAny, {
4462
+ resource: string;
4463
+ matcher: "exact" | "prefix" | "regex";
4464
+ constraints?: Record<string, any> | undefined;
4465
+ }, {
4466
+ resource: string;
4467
+ matcher: "exact" | "prefix" | "regex";
4468
+ constraints?: Record<string, any> | undefined;
4469
+ }>, "many">;
4470
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4471
+ budget: z.ZodOptional<z.ZodObject<{
4472
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4473
+ cap: z.ZodNumber;
4474
+ window: z.ZodOptional<z.ZodObject<{
4475
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4476
+ durationSec: z.ZodNumber;
4477
+ }, "strip", z.ZodTypeAny, {
4478
+ kind: "rolling" | "fixed";
4479
+ durationSec: number;
4480
+ }, {
4481
+ kind: "rolling" | "fixed";
4482
+ durationSec: number;
4483
+ }>>;
4484
+ }, "strip", z.ZodTypeAny, {
4485
+ unit: "USD" | "ops" | "points";
4486
+ cap: number;
4487
+ window?: {
4488
+ kind: "rolling" | "fixed";
4489
+ durationSec: number;
4490
+ } | undefined;
4491
+ }, {
4492
+ unit: "USD" | "ops" | "points";
4493
+ cap: number;
4494
+ window?: {
4495
+ kind: "rolling" | "fixed";
4496
+ durationSec: number;
4497
+ } | undefined;
4498
+ }>>;
4499
+ scopes: z.ZodArray<z.ZodObject<{
4500
+ resource: z.ZodString;
4501
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4502
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4503
+ }, "strip", z.ZodTypeAny, {
4504
+ resource: string;
4505
+ matcher: "exact" | "prefix" | "regex";
4506
+ constraints?: Record<string, any> | undefined;
4507
+ }, {
4508
+ resource: string;
4509
+ matcher: "exact" | "prefix" | "regex";
4510
+ constraints?: Record<string, any> | undefined;
4511
+ }>, "many">;
4512
+ }, z.ZodTypeAny, "passthrough">>>;
4513
+ }, z.ZodTypeAny, "passthrough">>;
4514
+ /** Current status of the delegation */
4515
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
4516
+ /** Timestamp when created (milliseconds since epoch) */
4517
+ createdAt: z.ZodOptional<z.ZodNumber>;
4518
+ /** Optional metadata */
4519
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4520
+ }, "strip", z.ZodTypeAny, {
4521
+ status: "active" | "revoked" | "expired";
4522
+ id: string;
4523
+ issuerDid: string;
4524
+ subjectDid: string;
4525
+ constraints: {
4526
+ notBefore?: number | undefined;
4527
+ notAfter?: number | undefined;
4528
+ scopes?: string[] | undefined;
4529
+ crisp?: z.objectOutputType<{
4530
+ budget: z.ZodOptional<z.ZodObject<{
4531
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4532
+ cap: z.ZodNumber;
4533
+ window: z.ZodOptional<z.ZodObject<{
4534
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4535
+ durationSec: z.ZodNumber;
4536
+ }, "strip", z.ZodTypeAny, {
4537
+ kind: "rolling" | "fixed";
4538
+ durationSec: number;
4539
+ }, {
4540
+ kind: "rolling" | "fixed";
4541
+ durationSec: number;
4542
+ }>>;
4543
+ }, "strip", z.ZodTypeAny, {
4544
+ unit: "USD" | "ops" | "points";
4545
+ cap: number;
4546
+ window?: {
4547
+ kind: "rolling" | "fixed";
4548
+ durationSec: number;
4549
+ } | undefined;
4550
+ }, {
4551
+ unit: "USD" | "ops" | "points";
4552
+ cap: number;
4553
+ window?: {
4554
+ kind: "rolling" | "fixed";
4555
+ durationSec: number;
4556
+ } | undefined;
4557
+ }>>;
4558
+ scopes: z.ZodArray<z.ZodObject<{
4559
+ resource: z.ZodString;
4560
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4561
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4562
+ }, "strip", z.ZodTypeAny, {
4563
+ resource: string;
4564
+ matcher: "exact" | "prefix" | "regex";
4565
+ constraints?: Record<string, any> | undefined;
4566
+ }, {
4567
+ resource: string;
4568
+ matcher: "exact" | "prefix" | "regex";
4569
+ constraints?: Record<string, any> | undefined;
4570
+ }>, "many">;
4571
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4572
+ } & {
4573
+ [k: string]: unknown;
4574
+ };
4575
+ controller?: string | undefined;
4576
+ parentId?: string | undefined;
4577
+ createdAt?: number | undefined;
4578
+ metadata?: Record<string, any> | undefined;
4579
+ }, {
4580
+ id: string;
4581
+ issuerDid: string;
4582
+ subjectDid: string;
4583
+ constraints: {
4584
+ notBefore?: number | undefined;
4585
+ notAfter?: number | undefined;
4586
+ scopes?: string[] | undefined;
4587
+ crisp?: z.objectInputType<{
4588
+ budget: z.ZodOptional<z.ZodObject<{
4589
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4590
+ cap: z.ZodNumber;
4591
+ window: z.ZodOptional<z.ZodObject<{
4592
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4593
+ durationSec: z.ZodNumber;
4594
+ }, "strip", z.ZodTypeAny, {
4595
+ kind: "rolling" | "fixed";
4596
+ durationSec: number;
4597
+ }, {
4598
+ kind: "rolling" | "fixed";
4599
+ durationSec: number;
4600
+ }>>;
4601
+ }, "strip", z.ZodTypeAny, {
4602
+ unit: "USD" | "ops" | "points";
4603
+ cap: number;
4604
+ window?: {
4605
+ kind: "rolling" | "fixed";
4606
+ durationSec: number;
4607
+ } | undefined;
4608
+ }, {
4609
+ unit: "USD" | "ops" | "points";
4610
+ cap: number;
4611
+ window?: {
4612
+ kind: "rolling" | "fixed";
4613
+ durationSec: number;
4614
+ } | undefined;
4615
+ }>>;
4616
+ scopes: z.ZodArray<z.ZodObject<{
4617
+ resource: z.ZodString;
4618
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4619
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4620
+ }, "strip", z.ZodTypeAny, {
4621
+ resource: string;
4622
+ matcher: "exact" | "prefix" | "regex";
4623
+ constraints?: Record<string, any> | undefined;
4624
+ }, {
4625
+ resource: string;
4626
+ matcher: "exact" | "prefix" | "regex";
4627
+ constraints?: Record<string, any> | undefined;
4628
+ }>, "many">;
4629
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4630
+ } & {
4631
+ [k: string]: unknown;
4632
+ };
4633
+ status?: "active" | "revoked" | "expired" | undefined;
4634
+ controller?: string | undefined;
4635
+ parentId?: string | undefined;
4636
+ createdAt?: number | undefined;
4637
+ metadata?: Record<string, any> | undefined;
4638
+ }>;
4639
+ }, "strip", z.ZodTypeAny, {
4640
+ id: string;
4641
+ delegation: {
4642
+ status: "active" | "revoked" | "expired";
4643
+ id: string;
4644
+ issuerDid: string;
4645
+ subjectDid: string;
4646
+ constraints: {
4647
+ notBefore?: number | undefined;
4648
+ notAfter?: number | undefined;
4649
+ scopes?: string[] | undefined;
4650
+ crisp?: z.objectOutputType<{
4651
+ budget: z.ZodOptional<z.ZodObject<{
4652
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4653
+ cap: z.ZodNumber;
4654
+ window: z.ZodOptional<z.ZodObject<{
4655
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4656
+ durationSec: z.ZodNumber;
4657
+ }, "strip", z.ZodTypeAny, {
4658
+ kind: "rolling" | "fixed";
4659
+ durationSec: number;
4660
+ }, {
4661
+ kind: "rolling" | "fixed";
4662
+ durationSec: number;
4663
+ }>>;
4664
+ }, "strip", z.ZodTypeAny, {
4665
+ unit: "USD" | "ops" | "points";
4666
+ cap: number;
4667
+ window?: {
4668
+ kind: "rolling" | "fixed";
4669
+ durationSec: number;
4670
+ } | undefined;
4671
+ }, {
4672
+ unit: "USD" | "ops" | "points";
4673
+ cap: number;
4674
+ window?: {
4675
+ kind: "rolling" | "fixed";
4676
+ durationSec: number;
4677
+ } | undefined;
4678
+ }>>;
4679
+ scopes: z.ZodArray<z.ZodObject<{
4680
+ resource: z.ZodString;
4681
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4682
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4683
+ }, "strip", z.ZodTypeAny, {
4684
+ resource: string;
4685
+ matcher: "exact" | "prefix" | "regex";
4686
+ constraints?: Record<string, any> | undefined;
4687
+ }, {
4688
+ resource: string;
4689
+ matcher: "exact" | "prefix" | "regex";
4690
+ constraints?: Record<string, any> | undefined;
4691
+ }>, "many">;
4692
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4693
+ } & {
4694
+ [k: string]: unknown;
4695
+ };
4696
+ controller?: string | undefined;
4697
+ parentId?: string | undefined;
4698
+ createdAt?: number | undefined;
4699
+ metadata?: Record<string, any> | undefined;
4700
+ };
4701
+ }, {
4702
+ id: string;
4703
+ delegation: {
4704
+ id: string;
4705
+ issuerDid: string;
4706
+ subjectDid: string;
4707
+ constraints: {
4708
+ notBefore?: number | undefined;
4709
+ notAfter?: number | undefined;
4710
+ scopes?: string[] | undefined;
4711
+ crisp?: z.objectInputType<{
4712
+ budget: z.ZodOptional<z.ZodObject<{
4713
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4714
+ cap: z.ZodNumber;
4715
+ window: z.ZodOptional<z.ZodObject<{
4716
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4717
+ durationSec: z.ZodNumber;
4718
+ }, "strip", z.ZodTypeAny, {
4719
+ kind: "rolling" | "fixed";
4720
+ durationSec: number;
4721
+ }, {
4722
+ kind: "rolling" | "fixed";
4723
+ durationSec: number;
4724
+ }>>;
4725
+ }, "strip", z.ZodTypeAny, {
4726
+ unit: "USD" | "ops" | "points";
4727
+ cap: number;
4728
+ window?: {
4729
+ kind: "rolling" | "fixed";
4730
+ durationSec: number;
4731
+ } | undefined;
4732
+ }, {
4733
+ unit: "USD" | "ops" | "points";
4734
+ cap: number;
4735
+ window?: {
4736
+ kind: "rolling" | "fixed";
4737
+ durationSec: number;
4738
+ } | undefined;
4739
+ }>>;
4740
+ scopes: z.ZodArray<z.ZodObject<{
4741
+ resource: z.ZodString;
4742
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4743
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4744
+ }, "strip", z.ZodTypeAny, {
4745
+ resource: string;
4746
+ matcher: "exact" | "prefix" | "regex";
4747
+ constraints?: Record<string, any> | undefined;
4748
+ }, {
4749
+ resource: string;
4750
+ matcher: "exact" | "prefix" | "regex";
4751
+ constraints?: Record<string, any> | undefined;
4752
+ }>, "many">;
4753
+ }, z.ZodTypeAny, "passthrough"> | undefined;
4754
+ } & {
4755
+ [k: string]: unknown;
4756
+ };
4757
+ status?: "active" | "revoked" | "expired" | undefined;
4758
+ controller?: string | undefined;
4759
+ parentId?: string | undefined;
4760
+ createdAt?: number | undefined;
4761
+ metadata?: Record<string, any> | undefined;
4762
+ };
4763
+ }>;
4764
+ export type DelegationCredentialSubject = z.infer<typeof DelegationCredentialSubjectSchema>;
4765
+ /**
4766
+ * Delegation Credential Schema
4767
+ *
4768
+ * W3C Verifiable Credential for delegations.
4769
+ * This is the PRIMARY format for delegation issuance and verification.
4770
+ *
4771
+ * Structure:
4772
+ * - @context: [...W3C VC contexts, delegation context]
4773
+ * - type: ['VerifiableCredential', 'DelegationCredential']
4774
+ * - issuer: Delegator DID
4775
+ * - issuanceDate: When delegation was created
4776
+ * - expirationDate: Maps to delegation.constraints.notAfter
4777
+ * - credentialSubject: Contains delegatee DID + delegation data
4778
+ * - credentialStatus: StatusList2021Entry for revocation checking
4779
+ * - proof: Ed25519Signature2020
4780
+ *
4781
+ * Per Python POC design (Delegation-Service.md:136-163):
4782
+ * - Every delegation MUST be issued as a VC
4783
+ * - Verification checks BOTH the VC signature AND delegation constraints
4784
+ * - Revocation updates the StatusList2021
4785
+ *
4786
+ * Related Spec: MCP-I §4.1, §4.2, W3C VC Data Model 1.1
4787
+ */
4788
+ export declare const DelegationCredentialSchema: z.ZodObject<{
4789
+ id: z.ZodOptional<z.ZodString>;
4790
+ } & {
4791
+ '@context': z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>, "many">, (string | Record<string, any>)[], (string | Record<string, any>)[]>;
4792
+ type: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
4793
+ issuer: z.ZodUnion<[z.ZodString, z.ZodObject<{
4794
+ id: z.ZodString;
4795
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4796
+ id: z.ZodString;
4797
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4798
+ id: z.ZodString;
4799
+ }, z.ZodTypeAny, "passthrough">>]>;
4800
+ issuanceDate: z.ZodString;
4801
+ expirationDate: z.ZodOptional<z.ZodString>;
4802
+ credentialSubject: z.ZodObject<{
4803
+ /** Subject DID (delegatee) */
4804
+ id: z.ZodString;
4805
+ /** The delegation information */
4806
+ delegation: z.ZodObject<{
4807
+ /** Unique identifier for the delegation */
4808
+ id: z.ZodString;
4809
+ /** DID of the delegator (issuer, e.g., merchant/user) */
4810
+ issuerDid: z.ZodString;
4811
+ /** DID of the delegatee (subject, e.g., agent) */
4812
+ subjectDid: z.ZodString;
4813
+ /** Optional controller (user account ID or DID) */
4814
+ controller: z.ZodOptional<z.ZodString>;
4815
+ /** Optional parent delegation ID for chain tracking */
4816
+ parentId: z.ZodOptional<z.ZodString>;
4817
+ /** CRISP constraints on this delegation */
4818
+ constraints: z.ZodObject<{
4819
+ notBefore: z.ZodOptional<z.ZodNumber>;
4820
+ notAfter: z.ZodOptional<z.ZodNumber>;
4821
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4822
+ crisp: z.ZodOptional<z.ZodObject<{
4823
+ budget: z.ZodOptional<z.ZodObject<{
4824
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4825
+ cap: z.ZodNumber;
4826
+ window: z.ZodOptional<z.ZodObject<{
4827
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4828
+ durationSec: z.ZodNumber;
4829
+ }, "strip", z.ZodTypeAny, {
4830
+ kind: "rolling" | "fixed";
4831
+ durationSec: number;
4832
+ }, {
4833
+ kind: "rolling" | "fixed";
4834
+ durationSec: number;
4835
+ }>>;
4836
+ }, "strip", z.ZodTypeAny, {
4837
+ unit: "USD" | "ops" | "points";
4838
+ cap: number;
4839
+ window?: {
4840
+ kind: "rolling" | "fixed";
4841
+ durationSec: number;
4842
+ } | undefined;
4843
+ }, {
4844
+ unit: "USD" | "ops" | "points";
4845
+ cap: number;
4846
+ window?: {
4847
+ kind: "rolling" | "fixed";
4848
+ durationSec: number;
4849
+ } | undefined;
4850
+ }>>;
4851
+ scopes: z.ZodArray<z.ZodObject<{
4852
+ resource: z.ZodString;
4853
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4854
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4855
+ }, "strip", z.ZodTypeAny, {
4856
+ resource: string;
4857
+ matcher: "exact" | "prefix" | "regex";
4858
+ constraints?: Record<string, any> | undefined;
4859
+ }, {
4860
+ resource: string;
4861
+ matcher: "exact" | "prefix" | "regex";
4862
+ constraints?: Record<string, any> | undefined;
4863
+ }>, "many">;
4864
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4865
+ budget: z.ZodOptional<z.ZodObject<{
4866
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4867
+ cap: z.ZodNumber;
4868
+ window: z.ZodOptional<z.ZodObject<{
4869
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4870
+ durationSec: z.ZodNumber;
4871
+ }, "strip", z.ZodTypeAny, {
4872
+ kind: "rolling" | "fixed";
4873
+ durationSec: number;
4874
+ }, {
4875
+ kind: "rolling" | "fixed";
4876
+ durationSec: number;
4877
+ }>>;
4878
+ }, "strip", z.ZodTypeAny, {
4879
+ unit: "USD" | "ops" | "points";
4880
+ cap: number;
4881
+ window?: {
4882
+ kind: "rolling" | "fixed";
4883
+ durationSec: number;
4884
+ } | undefined;
4885
+ }, {
4886
+ unit: "USD" | "ops" | "points";
4887
+ cap: number;
4888
+ window?: {
4889
+ kind: "rolling" | "fixed";
4890
+ durationSec: number;
4891
+ } | undefined;
4892
+ }>>;
4893
+ scopes: z.ZodArray<z.ZodObject<{
4894
+ resource: z.ZodString;
4895
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4896
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4897
+ }, "strip", z.ZodTypeAny, {
4898
+ resource: string;
4899
+ matcher: "exact" | "prefix" | "regex";
4900
+ constraints?: Record<string, any> | undefined;
4901
+ }, {
4902
+ resource: string;
4903
+ matcher: "exact" | "prefix" | "regex";
4904
+ constraints?: Record<string, any> | undefined;
4905
+ }>, "many">;
4906
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
4907
+ budget: z.ZodOptional<z.ZodObject<{
4908
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4909
+ cap: z.ZodNumber;
4910
+ window: z.ZodOptional<z.ZodObject<{
4911
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4912
+ durationSec: z.ZodNumber;
4913
+ }, "strip", z.ZodTypeAny, {
4914
+ kind: "rolling" | "fixed";
4915
+ durationSec: number;
4916
+ }, {
4917
+ kind: "rolling" | "fixed";
4918
+ durationSec: number;
4919
+ }>>;
4920
+ }, "strip", z.ZodTypeAny, {
4921
+ unit: "USD" | "ops" | "points";
4922
+ cap: number;
4923
+ window?: {
4924
+ kind: "rolling" | "fixed";
4925
+ durationSec: number;
4926
+ } | undefined;
4927
+ }, {
4928
+ unit: "USD" | "ops" | "points";
4929
+ cap: number;
4930
+ window?: {
4931
+ kind: "rolling" | "fixed";
4932
+ durationSec: number;
4933
+ } | undefined;
4934
+ }>>;
4935
+ scopes: z.ZodArray<z.ZodObject<{
4936
+ resource: z.ZodString;
4937
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4938
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4939
+ }, "strip", z.ZodTypeAny, {
4940
+ resource: string;
4941
+ matcher: "exact" | "prefix" | "regex";
4942
+ constraints?: Record<string, any> | undefined;
4943
+ }, {
4944
+ resource: string;
4945
+ matcher: "exact" | "prefix" | "regex";
4946
+ constraints?: Record<string, any> | undefined;
4947
+ }>, "many">;
4948
+ }, z.ZodTypeAny, "passthrough">>>;
4949
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4950
+ notBefore: z.ZodOptional<z.ZodNumber>;
4951
+ notAfter: z.ZodOptional<z.ZodNumber>;
4952
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4953
+ crisp: z.ZodOptional<z.ZodObject<{
4954
+ budget: z.ZodOptional<z.ZodObject<{
4955
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4956
+ cap: z.ZodNumber;
4957
+ window: z.ZodOptional<z.ZodObject<{
4958
+ kind: z.ZodEnum<["rolling", "fixed"]>;
4959
+ durationSec: z.ZodNumber;
4960
+ }, "strip", z.ZodTypeAny, {
4961
+ kind: "rolling" | "fixed";
4962
+ durationSec: number;
4963
+ }, {
4964
+ kind: "rolling" | "fixed";
4965
+ durationSec: number;
4966
+ }>>;
4967
+ }, "strip", z.ZodTypeAny, {
4968
+ unit: "USD" | "ops" | "points";
4969
+ cap: number;
4970
+ window?: {
4971
+ kind: "rolling" | "fixed";
4972
+ durationSec: number;
4973
+ } | undefined;
4974
+ }, {
4975
+ unit: "USD" | "ops" | "points";
4976
+ cap: number;
4977
+ window?: {
4978
+ kind: "rolling" | "fixed";
4979
+ durationSec: number;
4980
+ } | undefined;
4981
+ }>>;
4982
+ scopes: z.ZodArray<z.ZodObject<{
4983
+ resource: z.ZodString;
4984
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
4985
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4986
+ }, "strip", z.ZodTypeAny, {
4987
+ resource: string;
4988
+ matcher: "exact" | "prefix" | "regex";
4989
+ constraints?: Record<string, any> | undefined;
4990
+ }, {
4991
+ resource: string;
4992
+ matcher: "exact" | "prefix" | "regex";
4993
+ constraints?: Record<string, any> | undefined;
4994
+ }>, "many">;
4995
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
4996
+ budget: z.ZodOptional<z.ZodObject<{
4997
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
4998
+ cap: z.ZodNumber;
4999
+ window: z.ZodOptional<z.ZodObject<{
5000
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5001
+ durationSec: z.ZodNumber;
5002
+ }, "strip", z.ZodTypeAny, {
5003
+ kind: "rolling" | "fixed";
5004
+ durationSec: number;
5005
+ }, {
5006
+ kind: "rolling" | "fixed";
5007
+ durationSec: number;
5008
+ }>>;
5009
+ }, "strip", z.ZodTypeAny, {
5010
+ unit: "USD" | "ops" | "points";
5011
+ cap: number;
5012
+ window?: {
5013
+ kind: "rolling" | "fixed";
5014
+ durationSec: number;
5015
+ } | undefined;
5016
+ }, {
5017
+ unit: "USD" | "ops" | "points";
5018
+ cap: number;
5019
+ window?: {
5020
+ kind: "rolling" | "fixed";
5021
+ durationSec: number;
5022
+ } | undefined;
5023
+ }>>;
5024
+ scopes: z.ZodArray<z.ZodObject<{
5025
+ resource: z.ZodString;
5026
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5027
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5028
+ }, "strip", z.ZodTypeAny, {
5029
+ resource: string;
5030
+ matcher: "exact" | "prefix" | "regex";
5031
+ constraints?: Record<string, any> | undefined;
5032
+ }, {
5033
+ resource: string;
5034
+ matcher: "exact" | "prefix" | "regex";
5035
+ constraints?: Record<string, any> | undefined;
5036
+ }>, "many">;
5037
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5038
+ budget: z.ZodOptional<z.ZodObject<{
5039
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5040
+ cap: z.ZodNumber;
5041
+ window: z.ZodOptional<z.ZodObject<{
5042
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5043
+ durationSec: z.ZodNumber;
5044
+ }, "strip", z.ZodTypeAny, {
5045
+ kind: "rolling" | "fixed";
5046
+ durationSec: number;
5047
+ }, {
5048
+ kind: "rolling" | "fixed";
5049
+ durationSec: number;
5050
+ }>>;
5051
+ }, "strip", z.ZodTypeAny, {
5052
+ unit: "USD" | "ops" | "points";
5053
+ cap: number;
5054
+ window?: {
5055
+ kind: "rolling" | "fixed";
5056
+ durationSec: number;
5057
+ } | undefined;
5058
+ }, {
5059
+ unit: "USD" | "ops" | "points";
5060
+ cap: number;
5061
+ window?: {
5062
+ kind: "rolling" | "fixed";
5063
+ durationSec: number;
5064
+ } | undefined;
5065
+ }>>;
5066
+ scopes: z.ZodArray<z.ZodObject<{
5067
+ resource: z.ZodString;
5068
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5069
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5070
+ }, "strip", z.ZodTypeAny, {
5071
+ resource: string;
5072
+ matcher: "exact" | "prefix" | "regex";
5073
+ constraints?: Record<string, any> | undefined;
5074
+ }, {
5075
+ resource: string;
5076
+ matcher: "exact" | "prefix" | "regex";
5077
+ constraints?: Record<string, any> | undefined;
5078
+ }>, "many">;
5079
+ }, z.ZodTypeAny, "passthrough">>>;
5080
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5081
+ notBefore: z.ZodOptional<z.ZodNumber>;
5082
+ notAfter: z.ZodOptional<z.ZodNumber>;
5083
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5084
+ crisp: z.ZodOptional<z.ZodObject<{
5085
+ budget: z.ZodOptional<z.ZodObject<{
5086
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5087
+ cap: z.ZodNumber;
5088
+ window: z.ZodOptional<z.ZodObject<{
5089
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5090
+ durationSec: z.ZodNumber;
5091
+ }, "strip", z.ZodTypeAny, {
5092
+ kind: "rolling" | "fixed";
5093
+ durationSec: number;
5094
+ }, {
5095
+ kind: "rolling" | "fixed";
5096
+ durationSec: number;
5097
+ }>>;
5098
+ }, "strip", z.ZodTypeAny, {
5099
+ unit: "USD" | "ops" | "points";
5100
+ cap: number;
5101
+ window?: {
5102
+ kind: "rolling" | "fixed";
5103
+ durationSec: number;
5104
+ } | undefined;
5105
+ }, {
5106
+ unit: "USD" | "ops" | "points";
5107
+ cap: number;
5108
+ window?: {
5109
+ kind: "rolling" | "fixed";
5110
+ durationSec: number;
5111
+ } | undefined;
5112
+ }>>;
5113
+ scopes: z.ZodArray<z.ZodObject<{
5114
+ resource: z.ZodString;
5115
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5116
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5117
+ }, "strip", z.ZodTypeAny, {
5118
+ resource: string;
5119
+ matcher: "exact" | "prefix" | "regex";
5120
+ constraints?: Record<string, any> | undefined;
5121
+ }, {
5122
+ resource: string;
5123
+ matcher: "exact" | "prefix" | "regex";
5124
+ constraints?: Record<string, any> | undefined;
5125
+ }>, "many">;
5126
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5127
+ budget: z.ZodOptional<z.ZodObject<{
5128
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5129
+ cap: z.ZodNumber;
5130
+ window: z.ZodOptional<z.ZodObject<{
5131
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5132
+ durationSec: z.ZodNumber;
5133
+ }, "strip", z.ZodTypeAny, {
5134
+ kind: "rolling" | "fixed";
5135
+ durationSec: number;
5136
+ }, {
5137
+ kind: "rolling" | "fixed";
5138
+ durationSec: number;
5139
+ }>>;
5140
+ }, "strip", z.ZodTypeAny, {
5141
+ unit: "USD" | "ops" | "points";
5142
+ cap: number;
5143
+ window?: {
5144
+ kind: "rolling" | "fixed";
5145
+ durationSec: number;
5146
+ } | undefined;
5147
+ }, {
5148
+ unit: "USD" | "ops" | "points";
5149
+ cap: number;
5150
+ window?: {
5151
+ kind: "rolling" | "fixed";
5152
+ durationSec: number;
5153
+ } | undefined;
5154
+ }>>;
5155
+ scopes: z.ZodArray<z.ZodObject<{
5156
+ resource: z.ZodString;
5157
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5158
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5159
+ }, "strip", z.ZodTypeAny, {
5160
+ resource: string;
5161
+ matcher: "exact" | "prefix" | "regex";
5162
+ constraints?: Record<string, any> | undefined;
5163
+ }, {
5164
+ resource: string;
5165
+ matcher: "exact" | "prefix" | "regex";
5166
+ constraints?: Record<string, any> | undefined;
5167
+ }>, "many">;
5168
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5169
+ budget: z.ZodOptional<z.ZodObject<{
5170
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5171
+ cap: z.ZodNumber;
5172
+ window: z.ZodOptional<z.ZodObject<{
5173
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5174
+ durationSec: z.ZodNumber;
5175
+ }, "strip", z.ZodTypeAny, {
5176
+ kind: "rolling" | "fixed";
5177
+ durationSec: number;
5178
+ }, {
5179
+ kind: "rolling" | "fixed";
5180
+ durationSec: number;
5181
+ }>>;
5182
+ }, "strip", z.ZodTypeAny, {
5183
+ unit: "USD" | "ops" | "points";
5184
+ cap: number;
5185
+ window?: {
5186
+ kind: "rolling" | "fixed";
5187
+ durationSec: number;
5188
+ } | undefined;
5189
+ }, {
5190
+ unit: "USD" | "ops" | "points";
5191
+ cap: number;
5192
+ window?: {
5193
+ kind: "rolling" | "fixed";
5194
+ durationSec: number;
5195
+ } | undefined;
5196
+ }>>;
5197
+ scopes: z.ZodArray<z.ZodObject<{
5198
+ resource: z.ZodString;
5199
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5200
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5201
+ }, "strip", z.ZodTypeAny, {
5202
+ resource: string;
5203
+ matcher: "exact" | "prefix" | "regex";
5204
+ constraints?: Record<string, any> | undefined;
5205
+ }, {
5206
+ resource: string;
5207
+ matcher: "exact" | "prefix" | "regex";
5208
+ constraints?: Record<string, any> | undefined;
5209
+ }>, "many">;
5210
+ }, z.ZodTypeAny, "passthrough">>>;
5211
+ }, z.ZodTypeAny, "passthrough">>;
5212
+ /** Current status of the delegation */
5213
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
5214
+ /** Timestamp when created (milliseconds since epoch) */
5215
+ createdAt: z.ZodOptional<z.ZodNumber>;
5216
+ /** Optional metadata */
5217
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5218
+ }, "strip", z.ZodTypeAny, {
5219
+ status: "active" | "revoked" | "expired";
5220
+ id: string;
5221
+ issuerDid: string;
5222
+ subjectDid: string;
5223
+ constraints: {
5224
+ notBefore?: number | undefined;
5225
+ notAfter?: number | undefined;
5226
+ scopes?: string[] | undefined;
5227
+ crisp?: z.objectOutputType<{
5228
+ budget: z.ZodOptional<z.ZodObject<{
5229
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5230
+ cap: z.ZodNumber;
5231
+ window: z.ZodOptional<z.ZodObject<{
5232
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5233
+ durationSec: z.ZodNumber;
5234
+ }, "strip", z.ZodTypeAny, {
5235
+ kind: "rolling" | "fixed";
5236
+ durationSec: number;
5237
+ }, {
5238
+ kind: "rolling" | "fixed";
5239
+ durationSec: number;
5240
+ }>>;
5241
+ }, "strip", z.ZodTypeAny, {
5242
+ unit: "USD" | "ops" | "points";
5243
+ cap: number;
5244
+ window?: {
5245
+ kind: "rolling" | "fixed";
5246
+ durationSec: number;
5247
+ } | undefined;
5248
+ }, {
5249
+ unit: "USD" | "ops" | "points";
5250
+ cap: number;
5251
+ window?: {
5252
+ kind: "rolling" | "fixed";
5253
+ durationSec: number;
5254
+ } | undefined;
5255
+ }>>;
5256
+ scopes: z.ZodArray<z.ZodObject<{
5257
+ resource: z.ZodString;
5258
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5259
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5260
+ }, "strip", z.ZodTypeAny, {
5261
+ resource: string;
5262
+ matcher: "exact" | "prefix" | "regex";
5263
+ constraints?: Record<string, any> | undefined;
5264
+ }, {
5265
+ resource: string;
5266
+ matcher: "exact" | "prefix" | "regex";
5267
+ constraints?: Record<string, any> | undefined;
5268
+ }>, "many">;
5269
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5270
+ } & {
5271
+ [k: string]: unknown;
5272
+ };
5273
+ controller?: string | undefined;
5274
+ parentId?: string | undefined;
5275
+ createdAt?: number | undefined;
5276
+ metadata?: Record<string, any> | undefined;
5277
+ }, {
5278
+ id: string;
5279
+ issuerDid: string;
5280
+ subjectDid: string;
5281
+ constraints: {
5282
+ notBefore?: number | undefined;
5283
+ notAfter?: number | undefined;
5284
+ scopes?: string[] | undefined;
5285
+ crisp?: z.objectInputType<{
5286
+ budget: z.ZodOptional<z.ZodObject<{
5287
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5288
+ cap: z.ZodNumber;
5289
+ window: z.ZodOptional<z.ZodObject<{
5290
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5291
+ durationSec: z.ZodNumber;
5292
+ }, "strip", z.ZodTypeAny, {
5293
+ kind: "rolling" | "fixed";
5294
+ durationSec: number;
5295
+ }, {
5296
+ kind: "rolling" | "fixed";
5297
+ durationSec: number;
5298
+ }>>;
5299
+ }, "strip", z.ZodTypeAny, {
5300
+ unit: "USD" | "ops" | "points";
5301
+ cap: number;
5302
+ window?: {
5303
+ kind: "rolling" | "fixed";
5304
+ durationSec: number;
5305
+ } | undefined;
5306
+ }, {
5307
+ unit: "USD" | "ops" | "points";
5308
+ cap: number;
5309
+ window?: {
5310
+ kind: "rolling" | "fixed";
5311
+ durationSec: number;
5312
+ } | undefined;
5313
+ }>>;
5314
+ scopes: z.ZodArray<z.ZodObject<{
5315
+ resource: z.ZodString;
5316
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5317
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5318
+ }, "strip", z.ZodTypeAny, {
5319
+ resource: string;
5320
+ matcher: "exact" | "prefix" | "regex";
5321
+ constraints?: Record<string, any> | undefined;
5322
+ }, {
5323
+ resource: string;
5324
+ matcher: "exact" | "prefix" | "regex";
5325
+ constraints?: Record<string, any> | undefined;
5326
+ }>, "many">;
5327
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5328
+ } & {
5329
+ [k: string]: unknown;
5330
+ };
5331
+ status?: "active" | "revoked" | "expired" | undefined;
5332
+ controller?: string | undefined;
5333
+ parentId?: string | undefined;
5334
+ createdAt?: number | undefined;
5335
+ metadata?: Record<string, any> | undefined;
5336
+ }>;
5337
+ }, "strip", z.ZodTypeAny, {
5338
+ id: string;
5339
+ delegation: {
5340
+ status: "active" | "revoked" | "expired";
5341
+ id: string;
5342
+ issuerDid: string;
5343
+ subjectDid: string;
5344
+ constraints: {
5345
+ notBefore?: number | undefined;
5346
+ notAfter?: number | undefined;
5347
+ scopes?: string[] | undefined;
5348
+ crisp?: z.objectOutputType<{
5349
+ budget: z.ZodOptional<z.ZodObject<{
5350
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5351
+ cap: z.ZodNumber;
5352
+ window: z.ZodOptional<z.ZodObject<{
5353
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5354
+ durationSec: z.ZodNumber;
5355
+ }, "strip", z.ZodTypeAny, {
5356
+ kind: "rolling" | "fixed";
5357
+ durationSec: number;
5358
+ }, {
5359
+ kind: "rolling" | "fixed";
5360
+ durationSec: number;
5361
+ }>>;
5362
+ }, "strip", z.ZodTypeAny, {
5363
+ unit: "USD" | "ops" | "points";
5364
+ cap: number;
5365
+ window?: {
5366
+ kind: "rolling" | "fixed";
5367
+ durationSec: number;
5368
+ } | undefined;
5369
+ }, {
5370
+ unit: "USD" | "ops" | "points";
5371
+ cap: number;
5372
+ window?: {
5373
+ kind: "rolling" | "fixed";
5374
+ durationSec: number;
5375
+ } | undefined;
5376
+ }>>;
5377
+ scopes: z.ZodArray<z.ZodObject<{
5378
+ resource: z.ZodString;
5379
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5380
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5381
+ }, "strip", z.ZodTypeAny, {
5382
+ resource: string;
5383
+ matcher: "exact" | "prefix" | "regex";
5384
+ constraints?: Record<string, any> | undefined;
5385
+ }, {
5386
+ resource: string;
5387
+ matcher: "exact" | "prefix" | "regex";
5388
+ constraints?: Record<string, any> | undefined;
5389
+ }>, "many">;
5390
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5391
+ } & {
5392
+ [k: string]: unknown;
5393
+ };
5394
+ controller?: string | undefined;
5395
+ parentId?: string | undefined;
5396
+ createdAt?: number | undefined;
5397
+ metadata?: Record<string, any> | undefined;
5398
+ };
5399
+ }, {
5400
+ id: string;
5401
+ delegation: {
5402
+ id: string;
5403
+ issuerDid: string;
5404
+ subjectDid: string;
5405
+ constraints: {
5406
+ notBefore?: number | undefined;
5407
+ notAfter?: number | undefined;
5408
+ scopes?: string[] | undefined;
5409
+ crisp?: z.objectInputType<{
5410
+ budget: z.ZodOptional<z.ZodObject<{
5411
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5412
+ cap: z.ZodNumber;
5413
+ window: z.ZodOptional<z.ZodObject<{
5414
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5415
+ durationSec: z.ZodNumber;
5416
+ }, "strip", z.ZodTypeAny, {
5417
+ kind: "rolling" | "fixed";
5418
+ durationSec: number;
5419
+ }, {
5420
+ kind: "rolling" | "fixed";
5421
+ durationSec: number;
5422
+ }>>;
5423
+ }, "strip", z.ZodTypeAny, {
5424
+ unit: "USD" | "ops" | "points";
5425
+ cap: number;
5426
+ window?: {
5427
+ kind: "rolling" | "fixed";
5428
+ durationSec: number;
5429
+ } | undefined;
5430
+ }, {
5431
+ unit: "USD" | "ops" | "points";
5432
+ cap: number;
5433
+ window?: {
5434
+ kind: "rolling" | "fixed";
5435
+ durationSec: number;
5436
+ } | undefined;
5437
+ }>>;
5438
+ scopes: z.ZodArray<z.ZodObject<{
5439
+ resource: z.ZodString;
5440
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5441
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5442
+ }, "strip", z.ZodTypeAny, {
5443
+ resource: string;
5444
+ matcher: "exact" | "prefix" | "regex";
5445
+ constraints?: Record<string, any> | undefined;
5446
+ }, {
5447
+ resource: string;
5448
+ matcher: "exact" | "prefix" | "regex";
5449
+ constraints?: Record<string, any> | undefined;
5450
+ }>, "many">;
5451
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5452
+ } & {
5453
+ [k: string]: unknown;
5454
+ };
5455
+ status?: "active" | "revoked" | "expired" | undefined;
5456
+ controller?: string | undefined;
5457
+ parentId?: string | undefined;
5458
+ createdAt?: number | undefined;
5459
+ metadata?: Record<string, any> | undefined;
5460
+ };
5461
+ }>;
5462
+ credentialStatus: z.ZodOptional<z.ZodObject<{
5463
+ id: z.ZodString;
5464
+ type: z.ZodLiteral<"StatusList2021Entry">;
5465
+ statusPurpose: z.ZodEnum<["revocation", "suspension"]>;
5466
+ statusListIndex: z.ZodString;
5467
+ statusListCredential: z.ZodString;
5468
+ }, "strip", z.ZodTypeAny, {
5469
+ type: "StatusList2021Entry";
5470
+ id: string;
5471
+ statusPurpose: "revocation" | "suspension";
5472
+ statusListIndex: string;
5473
+ statusListCredential: string;
5474
+ }, {
5475
+ type: "StatusList2021Entry";
5476
+ id: string;
5477
+ statusPurpose: "revocation" | "suspension";
5478
+ statusListIndex: string;
5479
+ statusListCredential: string;
5480
+ }>>;
5481
+ proof: z.ZodOptional<z.ZodObject<{
5482
+ type: z.ZodString;
5483
+ created: z.ZodOptional<z.ZodString>;
5484
+ verificationMethod: z.ZodOptional<z.ZodString>;
5485
+ proofPurpose: z.ZodOptional<z.ZodString>;
5486
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5487
+ type: z.ZodString;
5488
+ created: z.ZodOptional<z.ZodString>;
5489
+ verificationMethod: z.ZodOptional<z.ZodString>;
5490
+ proofPurpose: z.ZodOptional<z.ZodString>;
5491
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5492
+ type: z.ZodString;
5493
+ created: z.ZodOptional<z.ZodString>;
5494
+ verificationMethod: z.ZodOptional<z.ZodString>;
5495
+ proofPurpose: z.ZodOptional<z.ZodString>;
5496
+ }, z.ZodTypeAny, "passthrough">>>;
5497
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5498
+ id: z.ZodOptional<z.ZodString>;
5499
+ } & {
5500
+ '@context': z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>, "many">, (string | Record<string, any>)[], (string | Record<string, any>)[]>;
5501
+ type: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
5502
+ issuer: z.ZodUnion<[z.ZodString, z.ZodObject<{
5503
+ id: z.ZodString;
5504
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5505
+ id: z.ZodString;
5506
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5507
+ id: z.ZodString;
5508
+ }, z.ZodTypeAny, "passthrough">>]>;
5509
+ issuanceDate: z.ZodString;
5510
+ expirationDate: z.ZodOptional<z.ZodString>;
5511
+ credentialSubject: z.ZodObject<{
5512
+ /** Subject DID (delegatee) */
5513
+ id: z.ZodString;
5514
+ /** The delegation information */
5515
+ delegation: z.ZodObject<{
5516
+ /** Unique identifier for the delegation */
5517
+ id: z.ZodString;
5518
+ /** DID of the delegator (issuer, e.g., merchant/user) */
5519
+ issuerDid: z.ZodString;
5520
+ /** DID of the delegatee (subject, e.g., agent) */
5521
+ subjectDid: z.ZodString;
5522
+ /** Optional controller (user account ID or DID) */
5523
+ controller: z.ZodOptional<z.ZodString>;
5524
+ /** Optional parent delegation ID for chain tracking */
5525
+ parentId: z.ZodOptional<z.ZodString>;
5526
+ /** CRISP constraints on this delegation */
5527
+ constraints: z.ZodObject<{
5528
+ notBefore: z.ZodOptional<z.ZodNumber>;
5529
+ notAfter: z.ZodOptional<z.ZodNumber>;
5530
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5531
+ crisp: z.ZodOptional<z.ZodObject<{
5532
+ budget: z.ZodOptional<z.ZodObject<{
5533
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5534
+ cap: z.ZodNumber;
5535
+ window: z.ZodOptional<z.ZodObject<{
5536
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5537
+ durationSec: z.ZodNumber;
5538
+ }, "strip", z.ZodTypeAny, {
5539
+ kind: "rolling" | "fixed";
5540
+ durationSec: number;
5541
+ }, {
5542
+ kind: "rolling" | "fixed";
5543
+ durationSec: number;
5544
+ }>>;
5545
+ }, "strip", z.ZodTypeAny, {
5546
+ unit: "USD" | "ops" | "points";
5547
+ cap: number;
5548
+ window?: {
5549
+ kind: "rolling" | "fixed";
5550
+ durationSec: number;
5551
+ } | undefined;
5552
+ }, {
5553
+ unit: "USD" | "ops" | "points";
5554
+ cap: number;
5555
+ window?: {
5556
+ kind: "rolling" | "fixed";
5557
+ durationSec: number;
5558
+ } | undefined;
5559
+ }>>;
5560
+ scopes: z.ZodArray<z.ZodObject<{
5561
+ resource: z.ZodString;
5562
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5563
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5564
+ }, "strip", z.ZodTypeAny, {
5565
+ resource: string;
5566
+ matcher: "exact" | "prefix" | "regex";
5567
+ constraints?: Record<string, any> | undefined;
5568
+ }, {
5569
+ resource: string;
5570
+ matcher: "exact" | "prefix" | "regex";
5571
+ constraints?: Record<string, any> | undefined;
5572
+ }>, "many">;
5573
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5574
+ budget: z.ZodOptional<z.ZodObject<{
5575
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5576
+ cap: z.ZodNumber;
5577
+ window: z.ZodOptional<z.ZodObject<{
5578
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5579
+ durationSec: z.ZodNumber;
5580
+ }, "strip", z.ZodTypeAny, {
5581
+ kind: "rolling" | "fixed";
5582
+ durationSec: number;
5583
+ }, {
5584
+ kind: "rolling" | "fixed";
5585
+ durationSec: number;
5586
+ }>>;
5587
+ }, "strip", z.ZodTypeAny, {
5588
+ unit: "USD" | "ops" | "points";
5589
+ cap: number;
5590
+ window?: {
5591
+ kind: "rolling" | "fixed";
5592
+ durationSec: number;
5593
+ } | undefined;
5594
+ }, {
5595
+ unit: "USD" | "ops" | "points";
5596
+ cap: number;
5597
+ window?: {
5598
+ kind: "rolling" | "fixed";
5599
+ durationSec: number;
5600
+ } | undefined;
5601
+ }>>;
5602
+ scopes: z.ZodArray<z.ZodObject<{
5603
+ resource: z.ZodString;
5604
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5605
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5606
+ }, "strip", z.ZodTypeAny, {
5607
+ resource: string;
5608
+ matcher: "exact" | "prefix" | "regex";
5609
+ constraints?: Record<string, any> | undefined;
5610
+ }, {
5611
+ resource: string;
5612
+ matcher: "exact" | "prefix" | "regex";
5613
+ constraints?: Record<string, any> | undefined;
5614
+ }>, "many">;
5615
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5616
+ budget: z.ZodOptional<z.ZodObject<{
5617
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5618
+ cap: z.ZodNumber;
5619
+ window: z.ZodOptional<z.ZodObject<{
5620
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5621
+ durationSec: z.ZodNumber;
5622
+ }, "strip", z.ZodTypeAny, {
5623
+ kind: "rolling" | "fixed";
5624
+ durationSec: number;
5625
+ }, {
5626
+ kind: "rolling" | "fixed";
5627
+ durationSec: number;
5628
+ }>>;
5629
+ }, "strip", z.ZodTypeAny, {
5630
+ unit: "USD" | "ops" | "points";
5631
+ cap: number;
5632
+ window?: {
5633
+ kind: "rolling" | "fixed";
5634
+ durationSec: number;
5635
+ } | undefined;
5636
+ }, {
5637
+ unit: "USD" | "ops" | "points";
5638
+ cap: number;
5639
+ window?: {
5640
+ kind: "rolling" | "fixed";
5641
+ durationSec: number;
5642
+ } | undefined;
5643
+ }>>;
5644
+ scopes: z.ZodArray<z.ZodObject<{
5645
+ resource: z.ZodString;
5646
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5647
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5648
+ }, "strip", z.ZodTypeAny, {
5649
+ resource: string;
5650
+ matcher: "exact" | "prefix" | "regex";
5651
+ constraints?: Record<string, any> | undefined;
5652
+ }, {
5653
+ resource: string;
5654
+ matcher: "exact" | "prefix" | "regex";
5655
+ constraints?: Record<string, any> | undefined;
5656
+ }>, "many">;
5657
+ }, z.ZodTypeAny, "passthrough">>>;
5658
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5659
+ notBefore: z.ZodOptional<z.ZodNumber>;
5660
+ notAfter: z.ZodOptional<z.ZodNumber>;
5661
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5662
+ crisp: z.ZodOptional<z.ZodObject<{
5663
+ budget: z.ZodOptional<z.ZodObject<{
5664
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5665
+ cap: z.ZodNumber;
5666
+ window: z.ZodOptional<z.ZodObject<{
5667
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5668
+ durationSec: z.ZodNumber;
5669
+ }, "strip", z.ZodTypeAny, {
5670
+ kind: "rolling" | "fixed";
5671
+ durationSec: number;
5672
+ }, {
5673
+ kind: "rolling" | "fixed";
5674
+ durationSec: number;
5675
+ }>>;
5676
+ }, "strip", z.ZodTypeAny, {
5677
+ unit: "USD" | "ops" | "points";
5678
+ cap: number;
5679
+ window?: {
5680
+ kind: "rolling" | "fixed";
5681
+ durationSec: number;
5682
+ } | undefined;
5683
+ }, {
5684
+ unit: "USD" | "ops" | "points";
5685
+ cap: number;
5686
+ window?: {
5687
+ kind: "rolling" | "fixed";
5688
+ durationSec: number;
5689
+ } | undefined;
5690
+ }>>;
5691
+ scopes: z.ZodArray<z.ZodObject<{
5692
+ resource: z.ZodString;
5693
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5694
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5695
+ }, "strip", z.ZodTypeAny, {
5696
+ resource: string;
5697
+ matcher: "exact" | "prefix" | "regex";
5698
+ constraints?: Record<string, any> | undefined;
5699
+ }, {
5700
+ resource: string;
5701
+ matcher: "exact" | "prefix" | "regex";
5702
+ constraints?: Record<string, any> | undefined;
5703
+ }>, "many">;
5704
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5705
+ budget: z.ZodOptional<z.ZodObject<{
5706
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5707
+ cap: z.ZodNumber;
5708
+ window: z.ZodOptional<z.ZodObject<{
5709
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5710
+ durationSec: z.ZodNumber;
5711
+ }, "strip", z.ZodTypeAny, {
5712
+ kind: "rolling" | "fixed";
5713
+ durationSec: number;
5714
+ }, {
5715
+ kind: "rolling" | "fixed";
5716
+ durationSec: number;
5717
+ }>>;
5718
+ }, "strip", z.ZodTypeAny, {
5719
+ unit: "USD" | "ops" | "points";
5720
+ cap: number;
5721
+ window?: {
5722
+ kind: "rolling" | "fixed";
5723
+ durationSec: number;
5724
+ } | undefined;
5725
+ }, {
5726
+ unit: "USD" | "ops" | "points";
5727
+ cap: number;
5728
+ window?: {
5729
+ kind: "rolling" | "fixed";
5730
+ durationSec: number;
5731
+ } | undefined;
5732
+ }>>;
5733
+ scopes: z.ZodArray<z.ZodObject<{
5734
+ resource: z.ZodString;
5735
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5736
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5737
+ }, "strip", z.ZodTypeAny, {
5738
+ resource: string;
5739
+ matcher: "exact" | "prefix" | "regex";
5740
+ constraints?: Record<string, any> | undefined;
5741
+ }, {
5742
+ resource: string;
5743
+ matcher: "exact" | "prefix" | "regex";
5744
+ constraints?: Record<string, any> | undefined;
5745
+ }>, "many">;
5746
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5747
+ budget: z.ZodOptional<z.ZodObject<{
5748
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5749
+ cap: z.ZodNumber;
5750
+ window: z.ZodOptional<z.ZodObject<{
5751
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5752
+ durationSec: z.ZodNumber;
5753
+ }, "strip", z.ZodTypeAny, {
5754
+ kind: "rolling" | "fixed";
5755
+ durationSec: number;
5756
+ }, {
5757
+ kind: "rolling" | "fixed";
5758
+ durationSec: number;
5759
+ }>>;
5760
+ }, "strip", z.ZodTypeAny, {
5761
+ unit: "USD" | "ops" | "points";
5762
+ cap: number;
5763
+ window?: {
5764
+ kind: "rolling" | "fixed";
5765
+ durationSec: number;
5766
+ } | undefined;
5767
+ }, {
5768
+ unit: "USD" | "ops" | "points";
5769
+ cap: number;
5770
+ window?: {
5771
+ kind: "rolling" | "fixed";
5772
+ durationSec: number;
5773
+ } | undefined;
5774
+ }>>;
5775
+ scopes: z.ZodArray<z.ZodObject<{
5776
+ resource: z.ZodString;
5777
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5778
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5779
+ }, "strip", z.ZodTypeAny, {
5780
+ resource: string;
5781
+ matcher: "exact" | "prefix" | "regex";
5782
+ constraints?: Record<string, any> | undefined;
5783
+ }, {
5784
+ resource: string;
5785
+ matcher: "exact" | "prefix" | "regex";
5786
+ constraints?: Record<string, any> | undefined;
5787
+ }>, "many">;
5788
+ }, z.ZodTypeAny, "passthrough">>>;
5789
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5790
+ notBefore: z.ZodOptional<z.ZodNumber>;
5791
+ notAfter: z.ZodOptional<z.ZodNumber>;
5792
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5793
+ crisp: z.ZodOptional<z.ZodObject<{
5794
+ budget: z.ZodOptional<z.ZodObject<{
5795
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5796
+ cap: z.ZodNumber;
5797
+ window: z.ZodOptional<z.ZodObject<{
5798
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5799
+ durationSec: z.ZodNumber;
5800
+ }, "strip", z.ZodTypeAny, {
5801
+ kind: "rolling" | "fixed";
5802
+ durationSec: number;
5803
+ }, {
5804
+ kind: "rolling" | "fixed";
5805
+ durationSec: number;
5806
+ }>>;
5807
+ }, "strip", z.ZodTypeAny, {
5808
+ unit: "USD" | "ops" | "points";
5809
+ cap: number;
5810
+ window?: {
5811
+ kind: "rolling" | "fixed";
5812
+ durationSec: number;
5813
+ } | undefined;
5814
+ }, {
5815
+ unit: "USD" | "ops" | "points";
5816
+ cap: number;
5817
+ window?: {
5818
+ kind: "rolling" | "fixed";
5819
+ durationSec: number;
5820
+ } | undefined;
5821
+ }>>;
5822
+ scopes: z.ZodArray<z.ZodObject<{
5823
+ resource: z.ZodString;
5824
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5825
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5826
+ }, "strip", z.ZodTypeAny, {
5827
+ resource: string;
5828
+ matcher: "exact" | "prefix" | "regex";
5829
+ constraints?: Record<string, any> | undefined;
5830
+ }, {
5831
+ resource: string;
5832
+ matcher: "exact" | "prefix" | "regex";
5833
+ constraints?: Record<string, any> | undefined;
5834
+ }>, "many">;
5835
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5836
+ budget: z.ZodOptional<z.ZodObject<{
5837
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5838
+ cap: z.ZodNumber;
5839
+ window: z.ZodOptional<z.ZodObject<{
5840
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5841
+ durationSec: z.ZodNumber;
5842
+ }, "strip", z.ZodTypeAny, {
5843
+ kind: "rolling" | "fixed";
5844
+ durationSec: number;
5845
+ }, {
5846
+ kind: "rolling" | "fixed";
5847
+ durationSec: number;
5848
+ }>>;
5849
+ }, "strip", z.ZodTypeAny, {
5850
+ unit: "USD" | "ops" | "points";
5851
+ cap: number;
5852
+ window?: {
5853
+ kind: "rolling" | "fixed";
5854
+ durationSec: number;
5855
+ } | undefined;
5856
+ }, {
5857
+ unit: "USD" | "ops" | "points";
5858
+ cap: number;
5859
+ window?: {
5860
+ kind: "rolling" | "fixed";
5861
+ durationSec: number;
5862
+ } | undefined;
5863
+ }>>;
5864
+ scopes: z.ZodArray<z.ZodObject<{
5865
+ resource: z.ZodString;
5866
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5867
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5868
+ }, "strip", z.ZodTypeAny, {
5869
+ resource: string;
5870
+ matcher: "exact" | "prefix" | "regex";
5871
+ constraints?: Record<string, any> | undefined;
5872
+ }, {
5873
+ resource: string;
5874
+ matcher: "exact" | "prefix" | "regex";
5875
+ constraints?: Record<string, any> | undefined;
5876
+ }>, "many">;
5877
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5878
+ budget: z.ZodOptional<z.ZodObject<{
5879
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5880
+ cap: z.ZodNumber;
5881
+ window: z.ZodOptional<z.ZodObject<{
5882
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5883
+ durationSec: z.ZodNumber;
5884
+ }, "strip", z.ZodTypeAny, {
5885
+ kind: "rolling" | "fixed";
5886
+ durationSec: number;
5887
+ }, {
5888
+ kind: "rolling" | "fixed";
5889
+ durationSec: number;
5890
+ }>>;
5891
+ }, "strip", z.ZodTypeAny, {
5892
+ unit: "USD" | "ops" | "points";
5893
+ cap: number;
5894
+ window?: {
5895
+ kind: "rolling" | "fixed";
5896
+ durationSec: number;
5897
+ } | undefined;
5898
+ }, {
5899
+ unit: "USD" | "ops" | "points";
5900
+ cap: number;
5901
+ window?: {
5902
+ kind: "rolling" | "fixed";
5903
+ durationSec: number;
5904
+ } | undefined;
5905
+ }>>;
5906
+ scopes: z.ZodArray<z.ZodObject<{
5907
+ resource: z.ZodString;
5908
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5909
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5910
+ }, "strip", z.ZodTypeAny, {
5911
+ resource: string;
5912
+ matcher: "exact" | "prefix" | "regex";
5913
+ constraints?: Record<string, any> | undefined;
5914
+ }, {
5915
+ resource: string;
5916
+ matcher: "exact" | "prefix" | "regex";
5917
+ constraints?: Record<string, any> | undefined;
5918
+ }>, "many">;
5919
+ }, z.ZodTypeAny, "passthrough">>>;
5920
+ }, z.ZodTypeAny, "passthrough">>;
5921
+ /** Current status of the delegation */
5922
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
5923
+ /** Timestamp when created (milliseconds since epoch) */
5924
+ createdAt: z.ZodOptional<z.ZodNumber>;
5925
+ /** Optional metadata */
5926
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5927
+ }, "strip", z.ZodTypeAny, {
5928
+ status: "active" | "revoked" | "expired";
5929
+ id: string;
5930
+ issuerDid: string;
5931
+ subjectDid: string;
5932
+ constraints: {
5933
+ notBefore?: number | undefined;
5934
+ notAfter?: number | undefined;
5935
+ scopes?: string[] | undefined;
5936
+ crisp?: z.objectOutputType<{
5937
+ budget: z.ZodOptional<z.ZodObject<{
5938
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5939
+ cap: z.ZodNumber;
5940
+ window: z.ZodOptional<z.ZodObject<{
5941
+ kind: z.ZodEnum<["rolling", "fixed"]>;
5942
+ durationSec: z.ZodNumber;
5943
+ }, "strip", z.ZodTypeAny, {
5944
+ kind: "rolling" | "fixed";
5945
+ durationSec: number;
5946
+ }, {
5947
+ kind: "rolling" | "fixed";
5948
+ durationSec: number;
5949
+ }>>;
5950
+ }, "strip", z.ZodTypeAny, {
5951
+ unit: "USD" | "ops" | "points";
5952
+ cap: number;
5953
+ window?: {
5954
+ kind: "rolling" | "fixed";
5955
+ durationSec: number;
5956
+ } | undefined;
5957
+ }, {
5958
+ unit: "USD" | "ops" | "points";
5959
+ cap: number;
5960
+ window?: {
5961
+ kind: "rolling" | "fixed";
5962
+ durationSec: number;
5963
+ } | undefined;
5964
+ }>>;
5965
+ scopes: z.ZodArray<z.ZodObject<{
5966
+ resource: z.ZodString;
5967
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
5968
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5969
+ }, "strip", z.ZodTypeAny, {
5970
+ resource: string;
5971
+ matcher: "exact" | "prefix" | "regex";
5972
+ constraints?: Record<string, any> | undefined;
5973
+ }, {
5974
+ resource: string;
5975
+ matcher: "exact" | "prefix" | "regex";
5976
+ constraints?: Record<string, any> | undefined;
5977
+ }>, "many">;
5978
+ }, z.ZodTypeAny, "passthrough"> | undefined;
5979
+ } & {
5980
+ [k: string]: unknown;
5981
+ };
5982
+ controller?: string | undefined;
5983
+ parentId?: string | undefined;
5984
+ createdAt?: number | undefined;
5985
+ metadata?: Record<string, any> | undefined;
5986
+ }, {
5987
+ id: string;
5988
+ issuerDid: string;
5989
+ subjectDid: string;
5990
+ constraints: {
5991
+ notBefore?: number | undefined;
5992
+ notAfter?: number | undefined;
5993
+ scopes?: string[] | undefined;
5994
+ crisp?: z.objectInputType<{
5995
+ budget: z.ZodOptional<z.ZodObject<{
5996
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
5997
+ cap: z.ZodNumber;
5998
+ window: z.ZodOptional<z.ZodObject<{
5999
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6000
+ durationSec: z.ZodNumber;
6001
+ }, "strip", z.ZodTypeAny, {
6002
+ kind: "rolling" | "fixed";
6003
+ durationSec: number;
6004
+ }, {
6005
+ kind: "rolling" | "fixed";
6006
+ durationSec: number;
6007
+ }>>;
6008
+ }, "strip", z.ZodTypeAny, {
6009
+ unit: "USD" | "ops" | "points";
6010
+ cap: number;
6011
+ window?: {
6012
+ kind: "rolling" | "fixed";
6013
+ durationSec: number;
6014
+ } | undefined;
6015
+ }, {
6016
+ unit: "USD" | "ops" | "points";
6017
+ cap: number;
6018
+ window?: {
6019
+ kind: "rolling" | "fixed";
6020
+ durationSec: number;
6021
+ } | undefined;
6022
+ }>>;
6023
+ scopes: z.ZodArray<z.ZodObject<{
6024
+ resource: z.ZodString;
6025
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6026
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6027
+ }, "strip", z.ZodTypeAny, {
6028
+ resource: string;
6029
+ matcher: "exact" | "prefix" | "regex";
6030
+ constraints?: Record<string, any> | undefined;
6031
+ }, {
6032
+ resource: string;
6033
+ matcher: "exact" | "prefix" | "regex";
6034
+ constraints?: Record<string, any> | undefined;
6035
+ }>, "many">;
6036
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6037
+ } & {
6038
+ [k: string]: unknown;
6039
+ };
6040
+ status?: "active" | "revoked" | "expired" | undefined;
6041
+ controller?: string | undefined;
6042
+ parentId?: string | undefined;
6043
+ createdAt?: number | undefined;
6044
+ metadata?: Record<string, any> | undefined;
6045
+ }>;
6046
+ }, "strip", z.ZodTypeAny, {
6047
+ id: string;
6048
+ delegation: {
6049
+ status: "active" | "revoked" | "expired";
6050
+ id: string;
6051
+ issuerDid: string;
6052
+ subjectDid: string;
6053
+ constraints: {
6054
+ notBefore?: number | undefined;
6055
+ notAfter?: number | undefined;
6056
+ scopes?: string[] | undefined;
6057
+ crisp?: z.objectOutputType<{
6058
+ budget: z.ZodOptional<z.ZodObject<{
6059
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6060
+ cap: z.ZodNumber;
6061
+ window: z.ZodOptional<z.ZodObject<{
6062
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6063
+ durationSec: z.ZodNumber;
6064
+ }, "strip", z.ZodTypeAny, {
6065
+ kind: "rolling" | "fixed";
6066
+ durationSec: number;
6067
+ }, {
6068
+ kind: "rolling" | "fixed";
6069
+ durationSec: number;
6070
+ }>>;
6071
+ }, "strip", z.ZodTypeAny, {
6072
+ unit: "USD" | "ops" | "points";
6073
+ cap: number;
6074
+ window?: {
6075
+ kind: "rolling" | "fixed";
6076
+ durationSec: number;
6077
+ } | undefined;
6078
+ }, {
6079
+ unit: "USD" | "ops" | "points";
6080
+ cap: number;
6081
+ window?: {
6082
+ kind: "rolling" | "fixed";
6083
+ durationSec: number;
6084
+ } | undefined;
6085
+ }>>;
6086
+ scopes: z.ZodArray<z.ZodObject<{
6087
+ resource: z.ZodString;
6088
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6089
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6090
+ }, "strip", z.ZodTypeAny, {
6091
+ resource: string;
6092
+ matcher: "exact" | "prefix" | "regex";
6093
+ constraints?: Record<string, any> | undefined;
6094
+ }, {
6095
+ resource: string;
6096
+ matcher: "exact" | "prefix" | "regex";
6097
+ constraints?: Record<string, any> | undefined;
6098
+ }>, "many">;
6099
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6100
+ } & {
6101
+ [k: string]: unknown;
6102
+ };
6103
+ controller?: string | undefined;
6104
+ parentId?: string | undefined;
6105
+ createdAt?: number | undefined;
6106
+ metadata?: Record<string, any> | undefined;
6107
+ };
6108
+ }, {
6109
+ id: string;
6110
+ delegation: {
6111
+ id: string;
6112
+ issuerDid: string;
6113
+ subjectDid: string;
6114
+ constraints: {
6115
+ notBefore?: number | undefined;
6116
+ notAfter?: number | undefined;
6117
+ scopes?: string[] | undefined;
6118
+ crisp?: z.objectInputType<{
6119
+ budget: z.ZodOptional<z.ZodObject<{
6120
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6121
+ cap: z.ZodNumber;
6122
+ window: z.ZodOptional<z.ZodObject<{
6123
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6124
+ durationSec: z.ZodNumber;
6125
+ }, "strip", z.ZodTypeAny, {
6126
+ kind: "rolling" | "fixed";
6127
+ durationSec: number;
6128
+ }, {
6129
+ kind: "rolling" | "fixed";
6130
+ durationSec: number;
6131
+ }>>;
6132
+ }, "strip", z.ZodTypeAny, {
6133
+ unit: "USD" | "ops" | "points";
6134
+ cap: number;
6135
+ window?: {
6136
+ kind: "rolling" | "fixed";
6137
+ durationSec: number;
6138
+ } | undefined;
6139
+ }, {
6140
+ unit: "USD" | "ops" | "points";
6141
+ cap: number;
6142
+ window?: {
6143
+ kind: "rolling" | "fixed";
6144
+ durationSec: number;
6145
+ } | undefined;
6146
+ }>>;
6147
+ scopes: z.ZodArray<z.ZodObject<{
6148
+ resource: z.ZodString;
6149
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6150
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6151
+ }, "strip", z.ZodTypeAny, {
6152
+ resource: string;
6153
+ matcher: "exact" | "prefix" | "regex";
6154
+ constraints?: Record<string, any> | undefined;
6155
+ }, {
6156
+ resource: string;
6157
+ matcher: "exact" | "prefix" | "regex";
6158
+ constraints?: Record<string, any> | undefined;
6159
+ }>, "many">;
6160
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6161
+ } & {
6162
+ [k: string]: unknown;
6163
+ };
6164
+ status?: "active" | "revoked" | "expired" | undefined;
6165
+ controller?: string | undefined;
6166
+ parentId?: string | undefined;
6167
+ createdAt?: number | undefined;
6168
+ metadata?: Record<string, any> | undefined;
6169
+ };
6170
+ }>;
6171
+ credentialStatus: z.ZodOptional<z.ZodObject<{
6172
+ id: z.ZodString;
6173
+ type: z.ZodLiteral<"StatusList2021Entry">;
6174
+ statusPurpose: z.ZodEnum<["revocation", "suspension"]>;
6175
+ statusListIndex: z.ZodString;
6176
+ statusListCredential: z.ZodString;
6177
+ }, "strip", z.ZodTypeAny, {
6178
+ type: "StatusList2021Entry";
6179
+ id: string;
6180
+ statusPurpose: "revocation" | "suspension";
6181
+ statusListIndex: string;
6182
+ statusListCredential: string;
6183
+ }, {
6184
+ type: "StatusList2021Entry";
6185
+ id: string;
6186
+ statusPurpose: "revocation" | "suspension";
6187
+ statusListIndex: string;
6188
+ statusListCredential: string;
6189
+ }>>;
6190
+ proof: z.ZodOptional<z.ZodObject<{
6191
+ type: z.ZodString;
6192
+ created: z.ZodOptional<z.ZodString>;
6193
+ verificationMethod: z.ZodOptional<z.ZodString>;
6194
+ proofPurpose: z.ZodOptional<z.ZodString>;
6195
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6196
+ type: z.ZodString;
6197
+ created: z.ZodOptional<z.ZodString>;
6198
+ verificationMethod: z.ZodOptional<z.ZodString>;
6199
+ proofPurpose: z.ZodOptional<z.ZodString>;
6200
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6201
+ type: z.ZodString;
6202
+ created: z.ZodOptional<z.ZodString>;
6203
+ verificationMethod: z.ZodOptional<z.ZodString>;
6204
+ proofPurpose: z.ZodOptional<z.ZodString>;
6205
+ }, z.ZodTypeAny, "passthrough">>>;
6206
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6207
+ id: z.ZodOptional<z.ZodString>;
6208
+ } & {
6209
+ '@context': z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>, "many">, (string | Record<string, any>)[], (string | Record<string, any>)[]>;
6210
+ type: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
6211
+ issuer: z.ZodUnion<[z.ZodString, z.ZodObject<{
6212
+ id: z.ZodString;
6213
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6214
+ id: z.ZodString;
6215
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6216
+ id: z.ZodString;
6217
+ }, z.ZodTypeAny, "passthrough">>]>;
6218
+ issuanceDate: z.ZodString;
6219
+ expirationDate: z.ZodOptional<z.ZodString>;
6220
+ credentialSubject: z.ZodObject<{
6221
+ /** Subject DID (delegatee) */
6222
+ id: z.ZodString;
6223
+ /** The delegation information */
6224
+ delegation: z.ZodObject<{
6225
+ /** Unique identifier for the delegation */
6226
+ id: z.ZodString;
6227
+ /** DID of the delegator (issuer, e.g., merchant/user) */
6228
+ issuerDid: z.ZodString;
6229
+ /** DID of the delegatee (subject, e.g., agent) */
6230
+ subjectDid: z.ZodString;
6231
+ /** Optional controller (user account ID or DID) */
6232
+ controller: z.ZodOptional<z.ZodString>;
6233
+ /** Optional parent delegation ID for chain tracking */
6234
+ parentId: z.ZodOptional<z.ZodString>;
6235
+ /** CRISP constraints on this delegation */
6236
+ constraints: z.ZodObject<{
6237
+ notBefore: z.ZodOptional<z.ZodNumber>;
6238
+ notAfter: z.ZodOptional<z.ZodNumber>;
6239
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6240
+ crisp: z.ZodOptional<z.ZodObject<{
6241
+ budget: z.ZodOptional<z.ZodObject<{
6242
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6243
+ cap: z.ZodNumber;
6244
+ window: z.ZodOptional<z.ZodObject<{
6245
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6246
+ durationSec: z.ZodNumber;
6247
+ }, "strip", z.ZodTypeAny, {
6248
+ kind: "rolling" | "fixed";
6249
+ durationSec: number;
6250
+ }, {
6251
+ kind: "rolling" | "fixed";
6252
+ durationSec: number;
6253
+ }>>;
6254
+ }, "strip", z.ZodTypeAny, {
6255
+ unit: "USD" | "ops" | "points";
6256
+ cap: number;
6257
+ window?: {
6258
+ kind: "rolling" | "fixed";
6259
+ durationSec: number;
6260
+ } | undefined;
6261
+ }, {
6262
+ unit: "USD" | "ops" | "points";
6263
+ cap: number;
6264
+ window?: {
6265
+ kind: "rolling" | "fixed";
6266
+ durationSec: number;
6267
+ } | undefined;
6268
+ }>>;
6269
+ scopes: z.ZodArray<z.ZodObject<{
6270
+ resource: z.ZodString;
6271
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6272
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6273
+ }, "strip", z.ZodTypeAny, {
6274
+ resource: string;
6275
+ matcher: "exact" | "prefix" | "regex";
6276
+ constraints?: Record<string, any> | undefined;
6277
+ }, {
6278
+ resource: string;
6279
+ matcher: "exact" | "prefix" | "regex";
6280
+ constraints?: Record<string, any> | undefined;
6281
+ }>, "many">;
6282
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6283
+ budget: z.ZodOptional<z.ZodObject<{
6284
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6285
+ cap: z.ZodNumber;
6286
+ window: z.ZodOptional<z.ZodObject<{
6287
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6288
+ durationSec: z.ZodNumber;
6289
+ }, "strip", z.ZodTypeAny, {
6290
+ kind: "rolling" | "fixed";
6291
+ durationSec: number;
6292
+ }, {
6293
+ kind: "rolling" | "fixed";
6294
+ durationSec: number;
6295
+ }>>;
6296
+ }, "strip", z.ZodTypeAny, {
6297
+ unit: "USD" | "ops" | "points";
6298
+ cap: number;
6299
+ window?: {
6300
+ kind: "rolling" | "fixed";
6301
+ durationSec: number;
6302
+ } | undefined;
6303
+ }, {
6304
+ unit: "USD" | "ops" | "points";
6305
+ cap: number;
6306
+ window?: {
6307
+ kind: "rolling" | "fixed";
6308
+ durationSec: number;
6309
+ } | undefined;
6310
+ }>>;
6311
+ scopes: z.ZodArray<z.ZodObject<{
6312
+ resource: z.ZodString;
6313
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6314
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6315
+ }, "strip", z.ZodTypeAny, {
6316
+ resource: string;
6317
+ matcher: "exact" | "prefix" | "regex";
6318
+ constraints?: Record<string, any> | undefined;
6319
+ }, {
6320
+ resource: string;
6321
+ matcher: "exact" | "prefix" | "regex";
6322
+ constraints?: Record<string, any> | undefined;
6323
+ }>, "many">;
6324
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6325
+ budget: z.ZodOptional<z.ZodObject<{
6326
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6327
+ cap: z.ZodNumber;
6328
+ window: z.ZodOptional<z.ZodObject<{
6329
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6330
+ durationSec: z.ZodNumber;
6331
+ }, "strip", z.ZodTypeAny, {
6332
+ kind: "rolling" | "fixed";
6333
+ durationSec: number;
6334
+ }, {
6335
+ kind: "rolling" | "fixed";
6336
+ durationSec: number;
6337
+ }>>;
6338
+ }, "strip", z.ZodTypeAny, {
6339
+ unit: "USD" | "ops" | "points";
6340
+ cap: number;
6341
+ window?: {
6342
+ kind: "rolling" | "fixed";
6343
+ durationSec: number;
6344
+ } | undefined;
6345
+ }, {
6346
+ unit: "USD" | "ops" | "points";
6347
+ cap: number;
6348
+ window?: {
6349
+ kind: "rolling" | "fixed";
6350
+ durationSec: number;
6351
+ } | undefined;
6352
+ }>>;
6353
+ scopes: z.ZodArray<z.ZodObject<{
6354
+ resource: z.ZodString;
6355
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6356
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6357
+ }, "strip", z.ZodTypeAny, {
6358
+ resource: string;
6359
+ matcher: "exact" | "prefix" | "regex";
6360
+ constraints?: Record<string, any> | undefined;
6361
+ }, {
6362
+ resource: string;
6363
+ matcher: "exact" | "prefix" | "regex";
6364
+ constraints?: Record<string, any> | undefined;
6365
+ }>, "many">;
6366
+ }, z.ZodTypeAny, "passthrough">>>;
6367
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6368
+ notBefore: z.ZodOptional<z.ZodNumber>;
6369
+ notAfter: z.ZodOptional<z.ZodNumber>;
6370
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6371
+ crisp: z.ZodOptional<z.ZodObject<{
6372
+ budget: z.ZodOptional<z.ZodObject<{
6373
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6374
+ cap: z.ZodNumber;
6375
+ window: z.ZodOptional<z.ZodObject<{
6376
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6377
+ durationSec: z.ZodNumber;
6378
+ }, "strip", z.ZodTypeAny, {
6379
+ kind: "rolling" | "fixed";
6380
+ durationSec: number;
6381
+ }, {
6382
+ kind: "rolling" | "fixed";
6383
+ durationSec: number;
6384
+ }>>;
6385
+ }, "strip", z.ZodTypeAny, {
6386
+ unit: "USD" | "ops" | "points";
6387
+ cap: number;
6388
+ window?: {
6389
+ kind: "rolling" | "fixed";
6390
+ durationSec: number;
6391
+ } | undefined;
6392
+ }, {
6393
+ unit: "USD" | "ops" | "points";
6394
+ cap: number;
6395
+ window?: {
6396
+ kind: "rolling" | "fixed";
6397
+ durationSec: number;
6398
+ } | undefined;
6399
+ }>>;
6400
+ scopes: z.ZodArray<z.ZodObject<{
6401
+ resource: z.ZodString;
6402
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6403
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6404
+ }, "strip", z.ZodTypeAny, {
6405
+ resource: string;
6406
+ matcher: "exact" | "prefix" | "regex";
6407
+ constraints?: Record<string, any> | undefined;
6408
+ }, {
6409
+ resource: string;
6410
+ matcher: "exact" | "prefix" | "regex";
6411
+ constraints?: Record<string, any> | undefined;
6412
+ }>, "many">;
6413
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6414
+ budget: z.ZodOptional<z.ZodObject<{
6415
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6416
+ cap: z.ZodNumber;
6417
+ window: z.ZodOptional<z.ZodObject<{
6418
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6419
+ durationSec: z.ZodNumber;
6420
+ }, "strip", z.ZodTypeAny, {
6421
+ kind: "rolling" | "fixed";
6422
+ durationSec: number;
6423
+ }, {
6424
+ kind: "rolling" | "fixed";
6425
+ durationSec: number;
6426
+ }>>;
6427
+ }, "strip", z.ZodTypeAny, {
6428
+ unit: "USD" | "ops" | "points";
6429
+ cap: number;
6430
+ window?: {
6431
+ kind: "rolling" | "fixed";
6432
+ durationSec: number;
6433
+ } | undefined;
6434
+ }, {
6435
+ unit: "USD" | "ops" | "points";
6436
+ cap: number;
6437
+ window?: {
6438
+ kind: "rolling" | "fixed";
6439
+ durationSec: number;
6440
+ } | undefined;
6441
+ }>>;
6442
+ scopes: z.ZodArray<z.ZodObject<{
6443
+ resource: z.ZodString;
6444
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6445
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6446
+ }, "strip", z.ZodTypeAny, {
6447
+ resource: string;
6448
+ matcher: "exact" | "prefix" | "regex";
6449
+ constraints?: Record<string, any> | undefined;
6450
+ }, {
6451
+ resource: string;
6452
+ matcher: "exact" | "prefix" | "regex";
6453
+ constraints?: Record<string, any> | undefined;
6454
+ }>, "many">;
6455
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6456
+ budget: z.ZodOptional<z.ZodObject<{
6457
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6458
+ cap: z.ZodNumber;
6459
+ window: z.ZodOptional<z.ZodObject<{
6460
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6461
+ durationSec: z.ZodNumber;
6462
+ }, "strip", z.ZodTypeAny, {
6463
+ kind: "rolling" | "fixed";
6464
+ durationSec: number;
6465
+ }, {
6466
+ kind: "rolling" | "fixed";
6467
+ durationSec: number;
6468
+ }>>;
6469
+ }, "strip", z.ZodTypeAny, {
6470
+ unit: "USD" | "ops" | "points";
6471
+ cap: number;
6472
+ window?: {
6473
+ kind: "rolling" | "fixed";
6474
+ durationSec: number;
6475
+ } | undefined;
6476
+ }, {
6477
+ unit: "USD" | "ops" | "points";
6478
+ cap: number;
6479
+ window?: {
6480
+ kind: "rolling" | "fixed";
6481
+ durationSec: number;
6482
+ } | undefined;
6483
+ }>>;
6484
+ scopes: z.ZodArray<z.ZodObject<{
6485
+ resource: z.ZodString;
6486
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6487
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6488
+ }, "strip", z.ZodTypeAny, {
6489
+ resource: string;
6490
+ matcher: "exact" | "prefix" | "regex";
6491
+ constraints?: Record<string, any> | undefined;
6492
+ }, {
6493
+ resource: string;
6494
+ matcher: "exact" | "prefix" | "regex";
6495
+ constraints?: Record<string, any> | undefined;
6496
+ }>, "many">;
6497
+ }, z.ZodTypeAny, "passthrough">>>;
6498
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6499
+ notBefore: z.ZodOptional<z.ZodNumber>;
6500
+ notAfter: z.ZodOptional<z.ZodNumber>;
6501
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6502
+ crisp: z.ZodOptional<z.ZodObject<{
6503
+ budget: z.ZodOptional<z.ZodObject<{
6504
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6505
+ cap: z.ZodNumber;
6506
+ window: z.ZodOptional<z.ZodObject<{
6507
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6508
+ durationSec: z.ZodNumber;
6509
+ }, "strip", z.ZodTypeAny, {
6510
+ kind: "rolling" | "fixed";
6511
+ durationSec: number;
6512
+ }, {
6513
+ kind: "rolling" | "fixed";
6514
+ durationSec: number;
6515
+ }>>;
6516
+ }, "strip", z.ZodTypeAny, {
6517
+ unit: "USD" | "ops" | "points";
6518
+ cap: number;
6519
+ window?: {
6520
+ kind: "rolling" | "fixed";
6521
+ durationSec: number;
6522
+ } | undefined;
6523
+ }, {
6524
+ unit: "USD" | "ops" | "points";
6525
+ cap: number;
6526
+ window?: {
6527
+ kind: "rolling" | "fixed";
6528
+ durationSec: number;
6529
+ } | undefined;
6530
+ }>>;
6531
+ scopes: z.ZodArray<z.ZodObject<{
6532
+ resource: z.ZodString;
6533
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6534
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6535
+ }, "strip", z.ZodTypeAny, {
6536
+ resource: string;
6537
+ matcher: "exact" | "prefix" | "regex";
6538
+ constraints?: Record<string, any> | undefined;
6539
+ }, {
6540
+ resource: string;
6541
+ matcher: "exact" | "prefix" | "regex";
6542
+ constraints?: Record<string, any> | undefined;
6543
+ }>, "many">;
6544
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6545
+ budget: z.ZodOptional<z.ZodObject<{
6546
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6547
+ cap: z.ZodNumber;
6548
+ window: z.ZodOptional<z.ZodObject<{
6549
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6550
+ durationSec: z.ZodNumber;
6551
+ }, "strip", z.ZodTypeAny, {
6552
+ kind: "rolling" | "fixed";
6553
+ durationSec: number;
6554
+ }, {
6555
+ kind: "rolling" | "fixed";
6556
+ durationSec: number;
6557
+ }>>;
6558
+ }, "strip", z.ZodTypeAny, {
6559
+ unit: "USD" | "ops" | "points";
6560
+ cap: number;
6561
+ window?: {
6562
+ kind: "rolling" | "fixed";
6563
+ durationSec: number;
6564
+ } | undefined;
6565
+ }, {
6566
+ unit: "USD" | "ops" | "points";
6567
+ cap: number;
6568
+ window?: {
6569
+ kind: "rolling" | "fixed";
6570
+ durationSec: number;
6571
+ } | undefined;
6572
+ }>>;
6573
+ scopes: z.ZodArray<z.ZodObject<{
6574
+ resource: z.ZodString;
6575
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6576
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6577
+ }, "strip", z.ZodTypeAny, {
6578
+ resource: string;
6579
+ matcher: "exact" | "prefix" | "regex";
6580
+ constraints?: Record<string, any> | undefined;
6581
+ }, {
6582
+ resource: string;
6583
+ matcher: "exact" | "prefix" | "regex";
6584
+ constraints?: Record<string, any> | undefined;
6585
+ }>, "many">;
6586
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6587
+ budget: z.ZodOptional<z.ZodObject<{
6588
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6589
+ cap: z.ZodNumber;
6590
+ window: z.ZodOptional<z.ZodObject<{
6591
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6592
+ durationSec: z.ZodNumber;
6593
+ }, "strip", z.ZodTypeAny, {
6594
+ kind: "rolling" | "fixed";
6595
+ durationSec: number;
6596
+ }, {
6597
+ kind: "rolling" | "fixed";
6598
+ durationSec: number;
6599
+ }>>;
6600
+ }, "strip", z.ZodTypeAny, {
6601
+ unit: "USD" | "ops" | "points";
6602
+ cap: number;
6603
+ window?: {
6604
+ kind: "rolling" | "fixed";
6605
+ durationSec: number;
6606
+ } | undefined;
6607
+ }, {
6608
+ unit: "USD" | "ops" | "points";
6609
+ cap: number;
6610
+ window?: {
6611
+ kind: "rolling" | "fixed";
6612
+ durationSec: number;
6613
+ } | undefined;
6614
+ }>>;
6615
+ scopes: z.ZodArray<z.ZodObject<{
6616
+ resource: z.ZodString;
6617
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6618
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6619
+ }, "strip", z.ZodTypeAny, {
6620
+ resource: string;
6621
+ matcher: "exact" | "prefix" | "regex";
6622
+ constraints?: Record<string, any> | undefined;
6623
+ }, {
6624
+ resource: string;
6625
+ matcher: "exact" | "prefix" | "regex";
6626
+ constraints?: Record<string, any> | undefined;
6627
+ }>, "many">;
6628
+ }, z.ZodTypeAny, "passthrough">>>;
6629
+ }, z.ZodTypeAny, "passthrough">>;
6630
+ /** Current status of the delegation */
6631
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
6632
+ /** Timestamp when created (milliseconds since epoch) */
6633
+ createdAt: z.ZodOptional<z.ZodNumber>;
6634
+ /** Optional metadata */
6635
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6636
+ }, "strip", z.ZodTypeAny, {
6637
+ status: "active" | "revoked" | "expired";
6638
+ id: string;
6639
+ issuerDid: string;
6640
+ subjectDid: string;
6641
+ constraints: {
6642
+ notBefore?: number | undefined;
6643
+ notAfter?: number | undefined;
6644
+ scopes?: string[] | undefined;
6645
+ crisp?: z.objectOutputType<{
6646
+ budget: z.ZodOptional<z.ZodObject<{
6647
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6648
+ cap: z.ZodNumber;
6649
+ window: z.ZodOptional<z.ZodObject<{
6650
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6651
+ durationSec: z.ZodNumber;
6652
+ }, "strip", z.ZodTypeAny, {
6653
+ kind: "rolling" | "fixed";
6654
+ durationSec: number;
6655
+ }, {
6656
+ kind: "rolling" | "fixed";
6657
+ durationSec: number;
6658
+ }>>;
6659
+ }, "strip", z.ZodTypeAny, {
6660
+ unit: "USD" | "ops" | "points";
6661
+ cap: number;
6662
+ window?: {
6663
+ kind: "rolling" | "fixed";
6664
+ durationSec: number;
6665
+ } | undefined;
6666
+ }, {
6667
+ unit: "USD" | "ops" | "points";
6668
+ cap: number;
6669
+ window?: {
6670
+ kind: "rolling" | "fixed";
6671
+ durationSec: number;
6672
+ } | undefined;
6673
+ }>>;
6674
+ scopes: z.ZodArray<z.ZodObject<{
6675
+ resource: z.ZodString;
6676
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6677
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6678
+ }, "strip", z.ZodTypeAny, {
6679
+ resource: string;
6680
+ matcher: "exact" | "prefix" | "regex";
6681
+ constraints?: Record<string, any> | undefined;
6682
+ }, {
6683
+ resource: string;
6684
+ matcher: "exact" | "prefix" | "regex";
6685
+ constraints?: Record<string, any> | undefined;
6686
+ }>, "many">;
6687
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6688
+ } & {
6689
+ [k: string]: unknown;
6690
+ };
6691
+ controller?: string | undefined;
6692
+ parentId?: string | undefined;
6693
+ createdAt?: number | undefined;
6694
+ metadata?: Record<string, any> | undefined;
6695
+ }, {
6696
+ id: string;
6697
+ issuerDid: string;
6698
+ subjectDid: string;
6699
+ constraints: {
6700
+ notBefore?: number | undefined;
6701
+ notAfter?: number | undefined;
6702
+ scopes?: string[] | undefined;
6703
+ crisp?: z.objectInputType<{
6704
+ budget: z.ZodOptional<z.ZodObject<{
6705
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6706
+ cap: z.ZodNumber;
6707
+ window: z.ZodOptional<z.ZodObject<{
6708
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6709
+ durationSec: z.ZodNumber;
6710
+ }, "strip", z.ZodTypeAny, {
6711
+ kind: "rolling" | "fixed";
6712
+ durationSec: number;
6713
+ }, {
6714
+ kind: "rolling" | "fixed";
6715
+ durationSec: number;
6716
+ }>>;
6717
+ }, "strip", z.ZodTypeAny, {
6718
+ unit: "USD" | "ops" | "points";
6719
+ cap: number;
6720
+ window?: {
6721
+ kind: "rolling" | "fixed";
6722
+ durationSec: number;
6723
+ } | undefined;
6724
+ }, {
6725
+ unit: "USD" | "ops" | "points";
6726
+ cap: number;
6727
+ window?: {
6728
+ kind: "rolling" | "fixed";
6729
+ durationSec: number;
6730
+ } | undefined;
6731
+ }>>;
6732
+ scopes: z.ZodArray<z.ZodObject<{
6733
+ resource: z.ZodString;
6734
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6735
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6736
+ }, "strip", z.ZodTypeAny, {
6737
+ resource: string;
6738
+ matcher: "exact" | "prefix" | "regex";
6739
+ constraints?: Record<string, any> | undefined;
6740
+ }, {
6741
+ resource: string;
6742
+ matcher: "exact" | "prefix" | "regex";
6743
+ constraints?: Record<string, any> | undefined;
6744
+ }>, "many">;
6745
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6746
+ } & {
6747
+ [k: string]: unknown;
6748
+ };
6749
+ status?: "active" | "revoked" | "expired" | undefined;
6750
+ controller?: string | undefined;
6751
+ parentId?: string | undefined;
6752
+ createdAt?: number | undefined;
6753
+ metadata?: Record<string, any> | undefined;
6754
+ }>;
6755
+ }, "strip", z.ZodTypeAny, {
6756
+ id: string;
6757
+ delegation: {
6758
+ status: "active" | "revoked" | "expired";
6759
+ id: string;
6760
+ issuerDid: string;
6761
+ subjectDid: string;
6762
+ constraints: {
6763
+ notBefore?: number | undefined;
6764
+ notAfter?: number | undefined;
6765
+ scopes?: string[] | undefined;
6766
+ crisp?: z.objectOutputType<{
6767
+ budget: z.ZodOptional<z.ZodObject<{
6768
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6769
+ cap: z.ZodNumber;
6770
+ window: z.ZodOptional<z.ZodObject<{
6771
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6772
+ durationSec: z.ZodNumber;
6773
+ }, "strip", z.ZodTypeAny, {
6774
+ kind: "rolling" | "fixed";
6775
+ durationSec: number;
6776
+ }, {
6777
+ kind: "rolling" | "fixed";
6778
+ durationSec: number;
6779
+ }>>;
6780
+ }, "strip", z.ZodTypeAny, {
6781
+ unit: "USD" | "ops" | "points";
6782
+ cap: number;
6783
+ window?: {
6784
+ kind: "rolling" | "fixed";
6785
+ durationSec: number;
6786
+ } | undefined;
6787
+ }, {
6788
+ unit: "USD" | "ops" | "points";
6789
+ cap: number;
6790
+ window?: {
6791
+ kind: "rolling" | "fixed";
6792
+ durationSec: number;
6793
+ } | undefined;
6794
+ }>>;
6795
+ scopes: z.ZodArray<z.ZodObject<{
6796
+ resource: z.ZodString;
6797
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6798
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6799
+ }, "strip", z.ZodTypeAny, {
6800
+ resource: string;
6801
+ matcher: "exact" | "prefix" | "regex";
6802
+ constraints?: Record<string, any> | undefined;
6803
+ }, {
6804
+ resource: string;
6805
+ matcher: "exact" | "prefix" | "regex";
6806
+ constraints?: Record<string, any> | undefined;
6807
+ }>, "many">;
6808
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6809
+ } & {
6810
+ [k: string]: unknown;
6811
+ };
6812
+ controller?: string | undefined;
6813
+ parentId?: string | undefined;
6814
+ createdAt?: number | undefined;
6815
+ metadata?: Record<string, any> | undefined;
6816
+ };
6817
+ }, {
6818
+ id: string;
6819
+ delegation: {
6820
+ id: string;
6821
+ issuerDid: string;
6822
+ subjectDid: string;
6823
+ constraints: {
6824
+ notBefore?: number | undefined;
6825
+ notAfter?: number | undefined;
6826
+ scopes?: string[] | undefined;
6827
+ crisp?: z.objectInputType<{
6828
+ budget: z.ZodOptional<z.ZodObject<{
6829
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6830
+ cap: z.ZodNumber;
6831
+ window: z.ZodOptional<z.ZodObject<{
6832
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6833
+ durationSec: z.ZodNumber;
6834
+ }, "strip", z.ZodTypeAny, {
6835
+ kind: "rolling" | "fixed";
6836
+ durationSec: number;
6837
+ }, {
6838
+ kind: "rolling" | "fixed";
6839
+ durationSec: number;
6840
+ }>>;
6841
+ }, "strip", z.ZodTypeAny, {
6842
+ unit: "USD" | "ops" | "points";
6843
+ cap: number;
6844
+ window?: {
6845
+ kind: "rolling" | "fixed";
6846
+ durationSec: number;
6847
+ } | undefined;
6848
+ }, {
6849
+ unit: "USD" | "ops" | "points";
6850
+ cap: number;
6851
+ window?: {
6852
+ kind: "rolling" | "fixed";
6853
+ durationSec: number;
6854
+ } | undefined;
6855
+ }>>;
6856
+ scopes: z.ZodArray<z.ZodObject<{
6857
+ resource: z.ZodString;
6858
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6859
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6860
+ }, "strip", z.ZodTypeAny, {
6861
+ resource: string;
6862
+ matcher: "exact" | "prefix" | "regex";
6863
+ constraints?: Record<string, any> | undefined;
6864
+ }, {
6865
+ resource: string;
6866
+ matcher: "exact" | "prefix" | "regex";
6867
+ constraints?: Record<string, any> | undefined;
6868
+ }>, "many">;
6869
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6870
+ } & {
6871
+ [k: string]: unknown;
6872
+ };
6873
+ status?: "active" | "revoked" | "expired" | undefined;
6874
+ controller?: string | undefined;
6875
+ parentId?: string | undefined;
6876
+ createdAt?: number | undefined;
6877
+ metadata?: Record<string, any> | undefined;
6878
+ };
6879
+ }>;
6880
+ credentialStatus: z.ZodOptional<z.ZodObject<{
6881
+ id: z.ZodString;
6882
+ type: z.ZodLiteral<"StatusList2021Entry">;
6883
+ statusPurpose: z.ZodEnum<["revocation", "suspension"]>;
6884
+ statusListIndex: z.ZodString;
6885
+ statusListCredential: z.ZodString;
6886
+ }, "strip", z.ZodTypeAny, {
6887
+ type: "StatusList2021Entry";
6888
+ id: string;
6889
+ statusPurpose: "revocation" | "suspension";
6890
+ statusListIndex: string;
6891
+ statusListCredential: string;
6892
+ }, {
6893
+ type: "StatusList2021Entry";
6894
+ id: string;
6895
+ statusPurpose: "revocation" | "suspension";
6896
+ statusListIndex: string;
6897
+ statusListCredential: string;
6898
+ }>>;
6899
+ proof: z.ZodOptional<z.ZodObject<{
6900
+ type: z.ZodString;
6901
+ created: z.ZodOptional<z.ZodString>;
6902
+ verificationMethod: z.ZodOptional<z.ZodString>;
6903
+ proofPurpose: z.ZodOptional<z.ZodString>;
6904
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6905
+ type: z.ZodString;
6906
+ created: z.ZodOptional<z.ZodString>;
6907
+ verificationMethod: z.ZodOptional<z.ZodString>;
6908
+ proofPurpose: z.ZodOptional<z.ZodString>;
6909
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6910
+ type: z.ZodString;
6911
+ created: z.ZodOptional<z.ZodString>;
6912
+ verificationMethod: z.ZodOptional<z.ZodString>;
6913
+ proofPurpose: z.ZodOptional<z.ZodString>;
6914
+ }, z.ZodTypeAny, "passthrough">>>;
6915
+ }, z.ZodTypeAny, "passthrough">>;
6916
+ export type DelegationCredential = z.infer<typeof DelegationCredentialSchema>;
6917
+ /**
6918
+ * Validate a delegation credential
6919
+ *
6920
+ * @param credential - The delegation credential to validate
6921
+ * @returns Validation result
6922
+ */
6923
+ export declare function validateDelegationCredential(credential: unknown): z.SafeParseReturnType<z.objectInputType<{
6924
+ id: z.ZodOptional<z.ZodString>;
6925
+ } & {
6926
+ '@context': z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>, "many">, (string | Record<string, any>)[], (string | Record<string, any>)[]>;
6927
+ type: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
6928
+ issuer: z.ZodUnion<[z.ZodString, z.ZodObject<{
6929
+ id: z.ZodString;
6930
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6931
+ id: z.ZodString;
6932
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6933
+ id: z.ZodString;
6934
+ }, z.ZodTypeAny, "passthrough">>]>;
6935
+ issuanceDate: z.ZodString;
6936
+ expirationDate: z.ZodOptional<z.ZodString>;
6937
+ credentialSubject: z.ZodObject<{
6938
+ /** Subject DID (delegatee) */
6939
+ id: z.ZodString;
6940
+ /** The delegation information */
6941
+ delegation: z.ZodObject<{
6942
+ /** Unique identifier for the delegation */
6943
+ id: z.ZodString;
6944
+ /** DID of the delegator (issuer, e.g., merchant/user) */
6945
+ issuerDid: z.ZodString;
6946
+ /** DID of the delegatee (subject, e.g., agent) */
6947
+ subjectDid: z.ZodString;
6948
+ /** Optional controller (user account ID or DID) */
6949
+ controller: z.ZodOptional<z.ZodString>;
6950
+ /** Optional parent delegation ID for chain tracking */
6951
+ parentId: z.ZodOptional<z.ZodString>;
6952
+ /** CRISP constraints on this delegation */
6953
+ constraints: z.ZodObject<{
6954
+ notBefore: z.ZodOptional<z.ZodNumber>;
6955
+ notAfter: z.ZodOptional<z.ZodNumber>;
6956
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6957
+ crisp: z.ZodOptional<z.ZodObject<{
6958
+ budget: z.ZodOptional<z.ZodObject<{
6959
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
6960
+ cap: z.ZodNumber;
6961
+ window: z.ZodOptional<z.ZodObject<{
6962
+ kind: z.ZodEnum<["rolling", "fixed"]>;
6963
+ durationSec: z.ZodNumber;
6964
+ }, "strip", z.ZodTypeAny, {
6965
+ kind: "rolling" | "fixed";
6966
+ durationSec: number;
6967
+ }, {
6968
+ kind: "rolling" | "fixed";
6969
+ durationSec: number;
6970
+ }>>;
6971
+ }, "strip", z.ZodTypeAny, {
6972
+ unit: "USD" | "ops" | "points";
6973
+ cap: number;
6974
+ window?: {
6975
+ kind: "rolling" | "fixed";
6976
+ durationSec: number;
6977
+ } | undefined;
6978
+ }, {
6979
+ unit: "USD" | "ops" | "points";
6980
+ cap: number;
6981
+ window?: {
6982
+ kind: "rolling" | "fixed";
6983
+ durationSec: number;
6984
+ } | undefined;
6985
+ }>>;
6986
+ scopes: z.ZodArray<z.ZodObject<{
6987
+ resource: z.ZodString;
6988
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
6989
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6990
+ }, "strip", z.ZodTypeAny, {
6991
+ resource: string;
6992
+ matcher: "exact" | "prefix" | "regex";
6993
+ constraints?: Record<string, any> | undefined;
6994
+ }, {
6995
+ resource: string;
6996
+ matcher: "exact" | "prefix" | "regex";
6997
+ constraints?: Record<string, any> | undefined;
6998
+ }>, "many">;
6999
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7000
+ budget: z.ZodOptional<z.ZodObject<{
7001
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7002
+ cap: z.ZodNumber;
7003
+ window: z.ZodOptional<z.ZodObject<{
7004
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7005
+ durationSec: z.ZodNumber;
7006
+ }, "strip", z.ZodTypeAny, {
7007
+ kind: "rolling" | "fixed";
7008
+ durationSec: number;
7009
+ }, {
7010
+ kind: "rolling" | "fixed";
7011
+ durationSec: number;
7012
+ }>>;
7013
+ }, "strip", z.ZodTypeAny, {
7014
+ unit: "USD" | "ops" | "points";
7015
+ cap: number;
7016
+ window?: {
7017
+ kind: "rolling" | "fixed";
7018
+ durationSec: number;
7019
+ } | undefined;
7020
+ }, {
7021
+ unit: "USD" | "ops" | "points";
7022
+ cap: number;
7023
+ window?: {
7024
+ kind: "rolling" | "fixed";
7025
+ durationSec: number;
7026
+ } | undefined;
7027
+ }>>;
7028
+ scopes: z.ZodArray<z.ZodObject<{
7029
+ resource: z.ZodString;
7030
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7031
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7032
+ }, "strip", z.ZodTypeAny, {
7033
+ resource: string;
7034
+ matcher: "exact" | "prefix" | "regex";
7035
+ constraints?: Record<string, any> | undefined;
7036
+ }, {
7037
+ resource: string;
7038
+ matcher: "exact" | "prefix" | "regex";
7039
+ constraints?: Record<string, any> | undefined;
7040
+ }>, "many">;
7041
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7042
+ budget: z.ZodOptional<z.ZodObject<{
7043
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7044
+ cap: z.ZodNumber;
7045
+ window: z.ZodOptional<z.ZodObject<{
7046
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7047
+ durationSec: z.ZodNumber;
7048
+ }, "strip", z.ZodTypeAny, {
7049
+ kind: "rolling" | "fixed";
7050
+ durationSec: number;
7051
+ }, {
7052
+ kind: "rolling" | "fixed";
7053
+ durationSec: number;
7054
+ }>>;
7055
+ }, "strip", z.ZodTypeAny, {
7056
+ unit: "USD" | "ops" | "points";
7057
+ cap: number;
7058
+ window?: {
7059
+ kind: "rolling" | "fixed";
7060
+ durationSec: number;
7061
+ } | undefined;
7062
+ }, {
7063
+ unit: "USD" | "ops" | "points";
7064
+ cap: number;
7065
+ window?: {
7066
+ kind: "rolling" | "fixed";
7067
+ durationSec: number;
7068
+ } | undefined;
7069
+ }>>;
7070
+ scopes: z.ZodArray<z.ZodObject<{
7071
+ resource: z.ZodString;
7072
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7073
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7074
+ }, "strip", z.ZodTypeAny, {
7075
+ resource: string;
7076
+ matcher: "exact" | "prefix" | "regex";
7077
+ constraints?: Record<string, any> | undefined;
7078
+ }, {
7079
+ resource: string;
7080
+ matcher: "exact" | "prefix" | "regex";
7081
+ constraints?: Record<string, any> | undefined;
7082
+ }>, "many">;
7083
+ }, z.ZodTypeAny, "passthrough">>>;
7084
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7085
+ notBefore: z.ZodOptional<z.ZodNumber>;
7086
+ notAfter: z.ZodOptional<z.ZodNumber>;
7087
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7088
+ crisp: z.ZodOptional<z.ZodObject<{
7089
+ budget: z.ZodOptional<z.ZodObject<{
7090
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7091
+ cap: z.ZodNumber;
7092
+ window: z.ZodOptional<z.ZodObject<{
7093
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7094
+ durationSec: z.ZodNumber;
7095
+ }, "strip", z.ZodTypeAny, {
7096
+ kind: "rolling" | "fixed";
7097
+ durationSec: number;
7098
+ }, {
7099
+ kind: "rolling" | "fixed";
7100
+ durationSec: number;
7101
+ }>>;
7102
+ }, "strip", z.ZodTypeAny, {
7103
+ unit: "USD" | "ops" | "points";
7104
+ cap: number;
7105
+ window?: {
7106
+ kind: "rolling" | "fixed";
7107
+ durationSec: number;
7108
+ } | undefined;
7109
+ }, {
7110
+ unit: "USD" | "ops" | "points";
7111
+ cap: number;
7112
+ window?: {
7113
+ kind: "rolling" | "fixed";
7114
+ durationSec: number;
7115
+ } | undefined;
7116
+ }>>;
7117
+ scopes: z.ZodArray<z.ZodObject<{
7118
+ resource: z.ZodString;
7119
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7120
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7121
+ }, "strip", z.ZodTypeAny, {
7122
+ resource: string;
7123
+ matcher: "exact" | "prefix" | "regex";
7124
+ constraints?: Record<string, any> | undefined;
7125
+ }, {
7126
+ resource: string;
7127
+ matcher: "exact" | "prefix" | "regex";
7128
+ constraints?: Record<string, any> | undefined;
7129
+ }>, "many">;
7130
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7131
+ budget: z.ZodOptional<z.ZodObject<{
7132
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7133
+ cap: z.ZodNumber;
7134
+ window: z.ZodOptional<z.ZodObject<{
7135
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7136
+ durationSec: z.ZodNumber;
7137
+ }, "strip", z.ZodTypeAny, {
7138
+ kind: "rolling" | "fixed";
7139
+ durationSec: number;
7140
+ }, {
7141
+ kind: "rolling" | "fixed";
7142
+ durationSec: number;
7143
+ }>>;
7144
+ }, "strip", z.ZodTypeAny, {
7145
+ unit: "USD" | "ops" | "points";
7146
+ cap: number;
7147
+ window?: {
7148
+ kind: "rolling" | "fixed";
7149
+ durationSec: number;
7150
+ } | undefined;
7151
+ }, {
7152
+ unit: "USD" | "ops" | "points";
7153
+ cap: number;
7154
+ window?: {
7155
+ kind: "rolling" | "fixed";
7156
+ durationSec: number;
7157
+ } | undefined;
7158
+ }>>;
7159
+ scopes: z.ZodArray<z.ZodObject<{
7160
+ resource: z.ZodString;
7161
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7162
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7163
+ }, "strip", z.ZodTypeAny, {
7164
+ resource: string;
7165
+ matcher: "exact" | "prefix" | "regex";
7166
+ constraints?: Record<string, any> | undefined;
7167
+ }, {
7168
+ resource: string;
7169
+ matcher: "exact" | "prefix" | "regex";
7170
+ constraints?: Record<string, any> | undefined;
7171
+ }>, "many">;
7172
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7173
+ budget: z.ZodOptional<z.ZodObject<{
7174
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7175
+ cap: z.ZodNumber;
7176
+ window: z.ZodOptional<z.ZodObject<{
7177
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7178
+ durationSec: z.ZodNumber;
7179
+ }, "strip", z.ZodTypeAny, {
7180
+ kind: "rolling" | "fixed";
7181
+ durationSec: number;
7182
+ }, {
7183
+ kind: "rolling" | "fixed";
7184
+ durationSec: number;
7185
+ }>>;
7186
+ }, "strip", z.ZodTypeAny, {
7187
+ unit: "USD" | "ops" | "points";
7188
+ cap: number;
7189
+ window?: {
7190
+ kind: "rolling" | "fixed";
7191
+ durationSec: number;
7192
+ } | undefined;
7193
+ }, {
7194
+ unit: "USD" | "ops" | "points";
7195
+ cap: number;
7196
+ window?: {
7197
+ kind: "rolling" | "fixed";
7198
+ durationSec: number;
7199
+ } | undefined;
7200
+ }>>;
7201
+ scopes: z.ZodArray<z.ZodObject<{
7202
+ resource: z.ZodString;
7203
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7204
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7205
+ }, "strip", z.ZodTypeAny, {
7206
+ resource: string;
7207
+ matcher: "exact" | "prefix" | "regex";
7208
+ constraints?: Record<string, any> | undefined;
7209
+ }, {
7210
+ resource: string;
7211
+ matcher: "exact" | "prefix" | "regex";
7212
+ constraints?: Record<string, any> | undefined;
7213
+ }>, "many">;
7214
+ }, z.ZodTypeAny, "passthrough">>>;
7215
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7216
+ notBefore: z.ZodOptional<z.ZodNumber>;
7217
+ notAfter: z.ZodOptional<z.ZodNumber>;
7218
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7219
+ crisp: z.ZodOptional<z.ZodObject<{
7220
+ budget: z.ZodOptional<z.ZodObject<{
7221
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7222
+ cap: z.ZodNumber;
7223
+ window: z.ZodOptional<z.ZodObject<{
7224
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7225
+ durationSec: z.ZodNumber;
7226
+ }, "strip", z.ZodTypeAny, {
7227
+ kind: "rolling" | "fixed";
7228
+ durationSec: number;
7229
+ }, {
7230
+ kind: "rolling" | "fixed";
7231
+ durationSec: number;
7232
+ }>>;
7233
+ }, "strip", z.ZodTypeAny, {
7234
+ unit: "USD" | "ops" | "points";
7235
+ cap: number;
7236
+ window?: {
7237
+ kind: "rolling" | "fixed";
7238
+ durationSec: number;
7239
+ } | undefined;
7240
+ }, {
7241
+ unit: "USD" | "ops" | "points";
7242
+ cap: number;
7243
+ window?: {
7244
+ kind: "rolling" | "fixed";
7245
+ durationSec: number;
7246
+ } | undefined;
7247
+ }>>;
7248
+ scopes: z.ZodArray<z.ZodObject<{
7249
+ resource: z.ZodString;
7250
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7251
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7252
+ }, "strip", z.ZodTypeAny, {
7253
+ resource: string;
7254
+ matcher: "exact" | "prefix" | "regex";
7255
+ constraints?: Record<string, any> | undefined;
7256
+ }, {
7257
+ resource: string;
7258
+ matcher: "exact" | "prefix" | "regex";
7259
+ constraints?: Record<string, any> | undefined;
7260
+ }>, "many">;
7261
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7262
+ budget: z.ZodOptional<z.ZodObject<{
7263
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7264
+ cap: z.ZodNumber;
7265
+ window: z.ZodOptional<z.ZodObject<{
7266
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7267
+ durationSec: z.ZodNumber;
7268
+ }, "strip", z.ZodTypeAny, {
7269
+ kind: "rolling" | "fixed";
7270
+ durationSec: number;
7271
+ }, {
7272
+ kind: "rolling" | "fixed";
7273
+ durationSec: number;
7274
+ }>>;
7275
+ }, "strip", z.ZodTypeAny, {
7276
+ unit: "USD" | "ops" | "points";
7277
+ cap: number;
7278
+ window?: {
7279
+ kind: "rolling" | "fixed";
7280
+ durationSec: number;
7281
+ } | undefined;
7282
+ }, {
7283
+ unit: "USD" | "ops" | "points";
7284
+ cap: number;
7285
+ window?: {
7286
+ kind: "rolling" | "fixed";
7287
+ durationSec: number;
7288
+ } | undefined;
7289
+ }>>;
7290
+ scopes: z.ZodArray<z.ZodObject<{
7291
+ resource: z.ZodString;
7292
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7293
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7294
+ }, "strip", z.ZodTypeAny, {
7295
+ resource: string;
7296
+ matcher: "exact" | "prefix" | "regex";
7297
+ constraints?: Record<string, any> | undefined;
7298
+ }, {
7299
+ resource: string;
7300
+ matcher: "exact" | "prefix" | "regex";
7301
+ constraints?: Record<string, any> | undefined;
7302
+ }>, "many">;
7303
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7304
+ budget: z.ZodOptional<z.ZodObject<{
7305
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7306
+ cap: z.ZodNumber;
7307
+ window: z.ZodOptional<z.ZodObject<{
7308
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7309
+ durationSec: z.ZodNumber;
7310
+ }, "strip", z.ZodTypeAny, {
7311
+ kind: "rolling" | "fixed";
7312
+ durationSec: number;
7313
+ }, {
7314
+ kind: "rolling" | "fixed";
7315
+ durationSec: number;
7316
+ }>>;
7317
+ }, "strip", z.ZodTypeAny, {
7318
+ unit: "USD" | "ops" | "points";
7319
+ cap: number;
7320
+ window?: {
7321
+ kind: "rolling" | "fixed";
7322
+ durationSec: number;
7323
+ } | undefined;
7324
+ }, {
7325
+ unit: "USD" | "ops" | "points";
7326
+ cap: number;
7327
+ window?: {
7328
+ kind: "rolling" | "fixed";
7329
+ durationSec: number;
7330
+ } | undefined;
7331
+ }>>;
7332
+ scopes: z.ZodArray<z.ZodObject<{
7333
+ resource: z.ZodString;
7334
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7335
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7336
+ }, "strip", z.ZodTypeAny, {
7337
+ resource: string;
7338
+ matcher: "exact" | "prefix" | "regex";
7339
+ constraints?: Record<string, any> | undefined;
7340
+ }, {
7341
+ resource: string;
7342
+ matcher: "exact" | "prefix" | "regex";
7343
+ constraints?: Record<string, any> | undefined;
7344
+ }>, "many">;
7345
+ }, z.ZodTypeAny, "passthrough">>>;
7346
+ }, z.ZodTypeAny, "passthrough">>;
7347
+ /** Current status of the delegation */
7348
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
7349
+ /** Timestamp when created (milliseconds since epoch) */
7350
+ createdAt: z.ZodOptional<z.ZodNumber>;
7351
+ /** Optional metadata */
7352
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7353
+ }, "strip", z.ZodTypeAny, {
7354
+ status: "active" | "revoked" | "expired";
7355
+ id: string;
7356
+ issuerDid: string;
7357
+ subjectDid: string;
7358
+ constraints: {
7359
+ notBefore?: number | undefined;
7360
+ notAfter?: number | undefined;
7361
+ scopes?: string[] | undefined;
7362
+ crisp?: z.objectOutputType<{
7363
+ budget: z.ZodOptional<z.ZodObject<{
7364
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7365
+ cap: z.ZodNumber;
7366
+ window: z.ZodOptional<z.ZodObject<{
7367
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7368
+ durationSec: z.ZodNumber;
7369
+ }, "strip", z.ZodTypeAny, {
7370
+ kind: "rolling" | "fixed";
7371
+ durationSec: number;
7372
+ }, {
7373
+ kind: "rolling" | "fixed";
7374
+ durationSec: number;
7375
+ }>>;
7376
+ }, "strip", z.ZodTypeAny, {
7377
+ unit: "USD" | "ops" | "points";
7378
+ cap: number;
7379
+ window?: {
7380
+ kind: "rolling" | "fixed";
7381
+ durationSec: number;
7382
+ } | undefined;
7383
+ }, {
7384
+ unit: "USD" | "ops" | "points";
7385
+ cap: number;
7386
+ window?: {
7387
+ kind: "rolling" | "fixed";
7388
+ durationSec: number;
7389
+ } | undefined;
7390
+ }>>;
7391
+ scopes: z.ZodArray<z.ZodObject<{
7392
+ resource: z.ZodString;
7393
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7394
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7395
+ }, "strip", z.ZodTypeAny, {
7396
+ resource: string;
7397
+ matcher: "exact" | "prefix" | "regex";
7398
+ constraints?: Record<string, any> | undefined;
7399
+ }, {
7400
+ resource: string;
7401
+ matcher: "exact" | "prefix" | "regex";
7402
+ constraints?: Record<string, any> | undefined;
7403
+ }>, "many">;
7404
+ }, z.ZodTypeAny, "passthrough"> | undefined;
7405
+ } & {
7406
+ [k: string]: unknown;
7407
+ };
7408
+ controller?: string | undefined;
7409
+ parentId?: string | undefined;
7410
+ createdAt?: number | undefined;
7411
+ metadata?: Record<string, any> | undefined;
7412
+ }, {
7413
+ id: string;
7414
+ issuerDid: string;
7415
+ subjectDid: string;
7416
+ constraints: {
7417
+ notBefore?: number | undefined;
7418
+ notAfter?: number | undefined;
7419
+ scopes?: string[] | undefined;
7420
+ crisp?: z.objectInputType<{
7421
+ budget: z.ZodOptional<z.ZodObject<{
7422
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7423
+ cap: z.ZodNumber;
7424
+ window: z.ZodOptional<z.ZodObject<{
7425
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7426
+ durationSec: z.ZodNumber;
7427
+ }, "strip", z.ZodTypeAny, {
7428
+ kind: "rolling" | "fixed";
7429
+ durationSec: number;
7430
+ }, {
7431
+ kind: "rolling" | "fixed";
7432
+ durationSec: number;
7433
+ }>>;
7434
+ }, "strip", z.ZodTypeAny, {
7435
+ unit: "USD" | "ops" | "points";
7436
+ cap: number;
7437
+ window?: {
7438
+ kind: "rolling" | "fixed";
7439
+ durationSec: number;
7440
+ } | undefined;
7441
+ }, {
7442
+ unit: "USD" | "ops" | "points";
7443
+ cap: number;
7444
+ window?: {
7445
+ kind: "rolling" | "fixed";
7446
+ durationSec: number;
7447
+ } | undefined;
7448
+ }>>;
7449
+ scopes: z.ZodArray<z.ZodObject<{
7450
+ resource: z.ZodString;
7451
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7452
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7453
+ }, "strip", z.ZodTypeAny, {
7454
+ resource: string;
7455
+ matcher: "exact" | "prefix" | "regex";
7456
+ constraints?: Record<string, any> | undefined;
7457
+ }, {
7458
+ resource: string;
7459
+ matcher: "exact" | "prefix" | "regex";
7460
+ constraints?: Record<string, any> | undefined;
7461
+ }>, "many">;
7462
+ }, z.ZodTypeAny, "passthrough"> | undefined;
7463
+ } & {
7464
+ [k: string]: unknown;
7465
+ };
7466
+ status?: "active" | "revoked" | "expired" | undefined;
7467
+ controller?: string | undefined;
7468
+ parentId?: string | undefined;
7469
+ createdAt?: number | undefined;
7470
+ metadata?: Record<string, any> | undefined;
7471
+ }>;
7472
+ }, "strip", z.ZodTypeAny, {
7473
+ id: string;
7474
+ delegation: {
7475
+ status: "active" | "revoked" | "expired";
7476
+ id: string;
7477
+ issuerDid: string;
7478
+ subjectDid: string;
7479
+ constraints: {
7480
+ notBefore?: number | undefined;
7481
+ notAfter?: number | undefined;
7482
+ scopes?: string[] | undefined;
7483
+ crisp?: z.objectOutputType<{
7484
+ budget: z.ZodOptional<z.ZodObject<{
7485
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7486
+ cap: z.ZodNumber;
7487
+ window: z.ZodOptional<z.ZodObject<{
7488
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7489
+ durationSec: z.ZodNumber;
7490
+ }, "strip", z.ZodTypeAny, {
7491
+ kind: "rolling" | "fixed";
7492
+ durationSec: number;
7493
+ }, {
7494
+ kind: "rolling" | "fixed";
7495
+ durationSec: number;
7496
+ }>>;
7497
+ }, "strip", z.ZodTypeAny, {
7498
+ unit: "USD" | "ops" | "points";
7499
+ cap: number;
7500
+ window?: {
7501
+ kind: "rolling" | "fixed";
7502
+ durationSec: number;
7503
+ } | undefined;
7504
+ }, {
7505
+ unit: "USD" | "ops" | "points";
7506
+ cap: number;
7507
+ window?: {
7508
+ kind: "rolling" | "fixed";
7509
+ durationSec: number;
7510
+ } | undefined;
7511
+ }>>;
7512
+ scopes: z.ZodArray<z.ZodObject<{
7513
+ resource: z.ZodString;
7514
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7515
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7516
+ }, "strip", z.ZodTypeAny, {
7517
+ resource: string;
7518
+ matcher: "exact" | "prefix" | "regex";
7519
+ constraints?: Record<string, any> | undefined;
7520
+ }, {
7521
+ resource: string;
7522
+ matcher: "exact" | "prefix" | "regex";
7523
+ constraints?: Record<string, any> | undefined;
7524
+ }>, "many">;
7525
+ }, z.ZodTypeAny, "passthrough"> | undefined;
7526
+ } & {
7527
+ [k: string]: unknown;
7528
+ };
7529
+ controller?: string | undefined;
7530
+ parentId?: string | undefined;
7531
+ createdAt?: number | undefined;
7532
+ metadata?: Record<string, any> | undefined;
7533
+ };
7534
+ }, {
7535
+ id: string;
7536
+ delegation: {
7537
+ id: string;
7538
+ issuerDid: string;
7539
+ subjectDid: string;
7540
+ constraints: {
7541
+ notBefore?: number | undefined;
7542
+ notAfter?: number | undefined;
7543
+ scopes?: string[] | undefined;
7544
+ crisp?: z.objectInputType<{
7545
+ budget: z.ZodOptional<z.ZodObject<{
7546
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7547
+ cap: z.ZodNumber;
7548
+ window: z.ZodOptional<z.ZodObject<{
7549
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7550
+ durationSec: z.ZodNumber;
7551
+ }, "strip", z.ZodTypeAny, {
7552
+ kind: "rolling" | "fixed";
7553
+ durationSec: number;
7554
+ }, {
7555
+ kind: "rolling" | "fixed";
7556
+ durationSec: number;
7557
+ }>>;
7558
+ }, "strip", z.ZodTypeAny, {
7559
+ unit: "USD" | "ops" | "points";
7560
+ cap: number;
7561
+ window?: {
7562
+ kind: "rolling" | "fixed";
7563
+ durationSec: number;
7564
+ } | undefined;
7565
+ }, {
7566
+ unit: "USD" | "ops" | "points";
7567
+ cap: number;
7568
+ window?: {
7569
+ kind: "rolling" | "fixed";
7570
+ durationSec: number;
7571
+ } | undefined;
7572
+ }>>;
7573
+ scopes: z.ZodArray<z.ZodObject<{
7574
+ resource: z.ZodString;
7575
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7576
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7577
+ }, "strip", z.ZodTypeAny, {
7578
+ resource: string;
7579
+ matcher: "exact" | "prefix" | "regex";
7580
+ constraints?: Record<string, any> | undefined;
7581
+ }, {
7582
+ resource: string;
7583
+ matcher: "exact" | "prefix" | "regex";
7584
+ constraints?: Record<string, any> | undefined;
7585
+ }>, "many">;
7586
+ }, z.ZodTypeAny, "passthrough"> | undefined;
7587
+ } & {
7588
+ [k: string]: unknown;
7589
+ };
7590
+ status?: "active" | "revoked" | "expired" | undefined;
7591
+ controller?: string | undefined;
7592
+ parentId?: string | undefined;
7593
+ createdAt?: number | undefined;
7594
+ metadata?: Record<string, any> | undefined;
7595
+ };
7596
+ }>;
7597
+ credentialStatus: z.ZodOptional<z.ZodObject<{
7598
+ id: z.ZodString;
7599
+ type: z.ZodLiteral<"StatusList2021Entry">;
7600
+ statusPurpose: z.ZodEnum<["revocation", "suspension"]>;
7601
+ statusListIndex: z.ZodString;
7602
+ statusListCredential: z.ZodString;
7603
+ }, "strip", z.ZodTypeAny, {
7604
+ type: "StatusList2021Entry";
7605
+ id: string;
7606
+ statusPurpose: "revocation" | "suspension";
7607
+ statusListIndex: string;
7608
+ statusListCredential: string;
7609
+ }, {
7610
+ type: "StatusList2021Entry";
7611
+ id: string;
7612
+ statusPurpose: "revocation" | "suspension";
7613
+ statusListIndex: string;
7614
+ statusListCredential: string;
7615
+ }>>;
7616
+ proof: z.ZodOptional<z.ZodObject<{
7617
+ type: z.ZodString;
7618
+ created: z.ZodOptional<z.ZodString>;
7619
+ verificationMethod: z.ZodOptional<z.ZodString>;
7620
+ proofPurpose: z.ZodOptional<z.ZodString>;
7621
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7622
+ type: z.ZodString;
7623
+ created: z.ZodOptional<z.ZodString>;
7624
+ verificationMethod: z.ZodOptional<z.ZodString>;
7625
+ proofPurpose: z.ZodOptional<z.ZodString>;
7626
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7627
+ type: z.ZodString;
7628
+ created: z.ZodOptional<z.ZodString>;
7629
+ verificationMethod: z.ZodOptional<z.ZodString>;
7630
+ proofPurpose: z.ZodOptional<z.ZodString>;
7631
+ }, z.ZodTypeAny, "passthrough">>>;
7632
+ }, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
7633
+ id: z.ZodOptional<z.ZodString>;
7634
+ } & {
7635
+ '@context': z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>, "many">, (string | Record<string, any>)[], (string | Record<string, any>)[]>;
7636
+ type: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
7637
+ issuer: z.ZodUnion<[z.ZodString, z.ZodObject<{
7638
+ id: z.ZodString;
7639
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7640
+ id: z.ZodString;
7641
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7642
+ id: z.ZodString;
7643
+ }, z.ZodTypeAny, "passthrough">>]>;
7644
+ issuanceDate: z.ZodString;
7645
+ expirationDate: z.ZodOptional<z.ZodString>;
7646
+ credentialSubject: z.ZodObject<{
7647
+ /** Subject DID (delegatee) */
7648
+ id: z.ZodString;
7649
+ /** The delegation information */
7650
+ delegation: z.ZodObject<{
7651
+ /** Unique identifier for the delegation */
7652
+ id: z.ZodString;
7653
+ /** DID of the delegator (issuer, e.g., merchant/user) */
7654
+ issuerDid: z.ZodString;
7655
+ /** DID of the delegatee (subject, e.g., agent) */
7656
+ subjectDid: z.ZodString;
7657
+ /** Optional controller (user account ID or DID) */
7658
+ controller: z.ZodOptional<z.ZodString>;
7659
+ /** Optional parent delegation ID for chain tracking */
7660
+ parentId: z.ZodOptional<z.ZodString>;
7661
+ /** CRISP constraints on this delegation */
7662
+ constraints: z.ZodObject<{
7663
+ notBefore: z.ZodOptional<z.ZodNumber>;
7664
+ notAfter: z.ZodOptional<z.ZodNumber>;
7665
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7666
+ crisp: z.ZodOptional<z.ZodObject<{
7667
+ budget: z.ZodOptional<z.ZodObject<{
7668
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7669
+ cap: z.ZodNumber;
7670
+ window: z.ZodOptional<z.ZodObject<{
7671
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7672
+ durationSec: z.ZodNumber;
7673
+ }, "strip", z.ZodTypeAny, {
7674
+ kind: "rolling" | "fixed";
7675
+ durationSec: number;
7676
+ }, {
7677
+ kind: "rolling" | "fixed";
7678
+ durationSec: number;
7679
+ }>>;
7680
+ }, "strip", z.ZodTypeAny, {
7681
+ unit: "USD" | "ops" | "points";
7682
+ cap: number;
7683
+ window?: {
7684
+ kind: "rolling" | "fixed";
7685
+ durationSec: number;
7686
+ } | undefined;
7687
+ }, {
7688
+ unit: "USD" | "ops" | "points";
7689
+ cap: number;
7690
+ window?: {
7691
+ kind: "rolling" | "fixed";
7692
+ durationSec: number;
7693
+ } | undefined;
7694
+ }>>;
7695
+ scopes: z.ZodArray<z.ZodObject<{
7696
+ resource: z.ZodString;
7697
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7698
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7699
+ }, "strip", z.ZodTypeAny, {
7700
+ resource: string;
7701
+ matcher: "exact" | "prefix" | "regex";
7702
+ constraints?: Record<string, any> | undefined;
7703
+ }, {
7704
+ resource: string;
7705
+ matcher: "exact" | "prefix" | "regex";
7706
+ constraints?: Record<string, any> | undefined;
7707
+ }>, "many">;
7708
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7709
+ budget: z.ZodOptional<z.ZodObject<{
7710
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7711
+ cap: z.ZodNumber;
7712
+ window: z.ZodOptional<z.ZodObject<{
7713
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7714
+ durationSec: z.ZodNumber;
7715
+ }, "strip", z.ZodTypeAny, {
7716
+ kind: "rolling" | "fixed";
7717
+ durationSec: number;
7718
+ }, {
7719
+ kind: "rolling" | "fixed";
7720
+ durationSec: number;
7721
+ }>>;
7722
+ }, "strip", z.ZodTypeAny, {
7723
+ unit: "USD" | "ops" | "points";
7724
+ cap: number;
7725
+ window?: {
7726
+ kind: "rolling" | "fixed";
7727
+ durationSec: number;
7728
+ } | undefined;
7729
+ }, {
7730
+ unit: "USD" | "ops" | "points";
7731
+ cap: number;
7732
+ window?: {
7733
+ kind: "rolling" | "fixed";
7734
+ durationSec: number;
7735
+ } | undefined;
7736
+ }>>;
7737
+ scopes: z.ZodArray<z.ZodObject<{
7738
+ resource: z.ZodString;
7739
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7740
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7741
+ }, "strip", z.ZodTypeAny, {
7742
+ resource: string;
7743
+ matcher: "exact" | "prefix" | "regex";
7744
+ constraints?: Record<string, any> | undefined;
7745
+ }, {
7746
+ resource: string;
7747
+ matcher: "exact" | "prefix" | "regex";
7748
+ constraints?: Record<string, any> | undefined;
7749
+ }>, "many">;
7750
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7751
+ budget: z.ZodOptional<z.ZodObject<{
7752
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7753
+ cap: z.ZodNumber;
7754
+ window: z.ZodOptional<z.ZodObject<{
7755
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7756
+ durationSec: z.ZodNumber;
7757
+ }, "strip", z.ZodTypeAny, {
7758
+ kind: "rolling" | "fixed";
7759
+ durationSec: number;
7760
+ }, {
7761
+ kind: "rolling" | "fixed";
7762
+ durationSec: number;
7763
+ }>>;
7764
+ }, "strip", z.ZodTypeAny, {
7765
+ unit: "USD" | "ops" | "points";
7766
+ cap: number;
7767
+ window?: {
7768
+ kind: "rolling" | "fixed";
7769
+ durationSec: number;
7770
+ } | undefined;
7771
+ }, {
7772
+ unit: "USD" | "ops" | "points";
7773
+ cap: number;
7774
+ window?: {
7775
+ kind: "rolling" | "fixed";
7776
+ durationSec: number;
7777
+ } | undefined;
7778
+ }>>;
7779
+ scopes: z.ZodArray<z.ZodObject<{
7780
+ resource: z.ZodString;
7781
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7782
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7783
+ }, "strip", z.ZodTypeAny, {
7784
+ resource: string;
7785
+ matcher: "exact" | "prefix" | "regex";
7786
+ constraints?: Record<string, any> | undefined;
7787
+ }, {
7788
+ resource: string;
7789
+ matcher: "exact" | "prefix" | "regex";
7790
+ constraints?: Record<string, any> | undefined;
7791
+ }>, "many">;
7792
+ }, z.ZodTypeAny, "passthrough">>>;
7793
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7794
+ notBefore: z.ZodOptional<z.ZodNumber>;
7795
+ notAfter: z.ZodOptional<z.ZodNumber>;
7796
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7797
+ crisp: z.ZodOptional<z.ZodObject<{
7798
+ budget: z.ZodOptional<z.ZodObject<{
7799
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7800
+ cap: z.ZodNumber;
7801
+ window: z.ZodOptional<z.ZodObject<{
7802
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7803
+ durationSec: z.ZodNumber;
7804
+ }, "strip", z.ZodTypeAny, {
7805
+ kind: "rolling" | "fixed";
7806
+ durationSec: number;
7807
+ }, {
7808
+ kind: "rolling" | "fixed";
7809
+ durationSec: number;
7810
+ }>>;
7811
+ }, "strip", z.ZodTypeAny, {
7812
+ unit: "USD" | "ops" | "points";
7813
+ cap: number;
7814
+ window?: {
7815
+ kind: "rolling" | "fixed";
7816
+ durationSec: number;
7817
+ } | undefined;
7818
+ }, {
7819
+ unit: "USD" | "ops" | "points";
7820
+ cap: number;
7821
+ window?: {
7822
+ kind: "rolling" | "fixed";
7823
+ durationSec: number;
7824
+ } | undefined;
7825
+ }>>;
7826
+ scopes: z.ZodArray<z.ZodObject<{
7827
+ resource: z.ZodString;
7828
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7829
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7830
+ }, "strip", z.ZodTypeAny, {
7831
+ resource: string;
7832
+ matcher: "exact" | "prefix" | "regex";
7833
+ constraints?: Record<string, any> | undefined;
7834
+ }, {
7835
+ resource: string;
7836
+ matcher: "exact" | "prefix" | "regex";
7837
+ constraints?: Record<string, any> | undefined;
7838
+ }>, "many">;
7839
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7840
+ budget: z.ZodOptional<z.ZodObject<{
7841
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7842
+ cap: z.ZodNumber;
7843
+ window: z.ZodOptional<z.ZodObject<{
7844
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7845
+ durationSec: z.ZodNumber;
7846
+ }, "strip", z.ZodTypeAny, {
7847
+ kind: "rolling" | "fixed";
7848
+ durationSec: number;
7849
+ }, {
7850
+ kind: "rolling" | "fixed";
7851
+ durationSec: number;
7852
+ }>>;
7853
+ }, "strip", z.ZodTypeAny, {
7854
+ unit: "USD" | "ops" | "points";
7855
+ cap: number;
7856
+ window?: {
7857
+ kind: "rolling" | "fixed";
7858
+ durationSec: number;
7859
+ } | undefined;
7860
+ }, {
7861
+ unit: "USD" | "ops" | "points";
7862
+ cap: number;
7863
+ window?: {
7864
+ kind: "rolling" | "fixed";
7865
+ durationSec: number;
7866
+ } | undefined;
7867
+ }>>;
7868
+ scopes: z.ZodArray<z.ZodObject<{
7869
+ resource: z.ZodString;
7870
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7871
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7872
+ }, "strip", z.ZodTypeAny, {
7873
+ resource: string;
7874
+ matcher: "exact" | "prefix" | "regex";
7875
+ constraints?: Record<string, any> | undefined;
7876
+ }, {
7877
+ resource: string;
7878
+ matcher: "exact" | "prefix" | "regex";
7879
+ constraints?: Record<string, any> | undefined;
7880
+ }>, "many">;
7881
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7882
+ budget: z.ZodOptional<z.ZodObject<{
7883
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7884
+ cap: z.ZodNumber;
7885
+ window: z.ZodOptional<z.ZodObject<{
7886
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7887
+ durationSec: z.ZodNumber;
7888
+ }, "strip", z.ZodTypeAny, {
7889
+ kind: "rolling" | "fixed";
7890
+ durationSec: number;
7891
+ }, {
7892
+ kind: "rolling" | "fixed";
7893
+ durationSec: number;
7894
+ }>>;
7895
+ }, "strip", z.ZodTypeAny, {
7896
+ unit: "USD" | "ops" | "points";
7897
+ cap: number;
7898
+ window?: {
7899
+ kind: "rolling" | "fixed";
7900
+ durationSec: number;
7901
+ } | undefined;
7902
+ }, {
7903
+ unit: "USD" | "ops" | "points";
7904
+ cap: number;
7905
+ window?: {
7906
+ kind: "rolling" | "fixed";
7907
+ durationSec: number;
7908
+ } | undefined;
7909
+ }>>;
7910
+ scopes: z.ZodArray<z.ZodObject<{
7911
+ resource: z.ZodString;
7912
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7913
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7914
+ }, "strip", z.ZodTypeAny, {
7915
+ resource: string;
7916
+ matcher: "exact" | "prefix" | "regex";
7917
+ constraints?: Record<string, any> | undefined;
7918
+ }, {
7919
+ resource: string;
7920
+ matcher: "exact" | "prefix" | "regex";
7921
+ constraints?: Record<string, any> | undefined;
7922
+ }>, "many">;
7923
+ }, z.ZodTypeAny, "passthrough">>>;
7924
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
7925
+ notBefore: z.ZodOptional<z.ZodNumber>;
7926
+ notAfter: z.ZodOptional<z.ZodNumber>;
7927
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7928
+ crisp: z.ZodOptional<z.ZodObject<{
7929
+ budget: z.ZodOptional<z.ZodObject<{
7930
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7931
+ cap: z.ZodNumber;
7932
+ window: z.ZodOptional<z.ZodObject<{
7933
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7934
+ durationSec: z.ZodNumber;
7935
+ }, "strip", z.ZodTypeAny, {
7936
+ kind: "rolling" | "fixed";
7937
+ durationSec: number;
7938
+ }, {
7939
+ kind: "rolling" | "fixed";
7940
+ durationSec: number;
7941
+ }>>;
7942
+ }, "strip", z.ZodTypeAny, {
7943
+ unit: "USD" | "ops" | "points";
7944
+ cap: number;
7945
+ window?: {
7946
+ kind: "rolling" | "fixed";
7947
+ durationSec: number;
7948
+ } | undefined;
7949
+ }, {
7950
+ unit: "USD" | "ops" | "points";
7951
+ cap: number;
7952
+ window?: {
7953
+ kind: "rolling" | "fixed";
7954
+ durationSec: number;
7955
+ } | undefined;
7956
+ }>>;
7957
+ scopes: z.ZodArray<z.ZodObject<{
7958
+ resource: z.ZodString;
7959
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
7960
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7961
+ }, "strip", z.ZodTypeAny, {
7962
+ resource: string;
7963
+ matcher: "exact" | "prefix" | "regex";
7964
+ constraints?: Record<string, any> | undefined;
7965
+ }, {
7966
+ resource: string;
7967
+ matcher: "exact" | "prefix" | "regex";
7968
+ constraints?: Record<string, any> | undefined;
7969
+ }>, "many">;
7970
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7971
+ budget: z.ZodOptional<z.ZodObject<{
7972
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
7973
+ cap: z.ZodNumber;
7974
+ window: z.ZodOptional<z.ZodObject<{
7975
+ kind: z.ZodEnum<["rolling", "fixed"]>;
7976
+ durationSec: z.ZodNumber;
7977
+ }, "strip", z.ZodTypeAny, {
7978
+ kind: "rolling" | "fixed";
7979
+ durationSec: number;
7980
+ }, {
7981
+ kind: "rolling" | "fixed";
7982
+ durationSec: number;
7983
+ }>>;
7984
+ }, "strip", z.ZodTypeAny, {
7985
+ unit: "USD" | "ops" | "points";
7986
+ cap: number;
7987
+ window?: {
7988
+ kind: "rolling" | "fixed";
7989
+ durationSec: number;
7990
+ } | undefined;
7991
+ }, {
7992
+ unit: "USD" | "ops" | "points";
7993
+ cap: number;
7994
+ window?: {
7995
+ kind: "rolling" | "fixed";
7996
+ durationSec: number;
7997
+ } | undefined;
7998
+ }>>;
7999
+ scopes: z.ZodArray<z.ZodObject<{
8000
+ resource: z.ZodString;
8001
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8002
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8003
+ }, "strip", z.ZodTypeAny, {
8004
+ resource: string;
8005
+ matcher: "exact" | "prefix" | "regex";
8006
+ constraints?: Record<string, any> | undefined;
8007
+ }, {
8008
+ resource: string;
8009
+ matcher: "exact" | "prefix" | "regex";
8010
+ constraints?: Record<string, any> | undefined;
8011
+ }>, "many">;
8012
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
8013
+ budget: z.ZodOptional<z.ZodObject<{
8014
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
8015
+ cap: z.ZodNumber;
8016
+ window: z.ZodOptional<z.ZodObject<{
8017
+ kind: z.ZodEnum<["rolling", "fixed"]>;
8018
+ durationSec: z.ZodNumber;
8019
+ }, "strip", z.ZodTypeAny, {
8020
+ kind: "rolling" | "fixed";
8021
+ durationSec: number;
8022
+ }, {
8023
+ kind: "rolling" | "fixed";
8024
+ durationSec: number;
8025
+ }>>;
8026
+ }, "strip", z.ZodTypeAny, {
8027
+ unit: "USD" | "ops" | "points";
8028
+ cap: number;
8029
+ window?: {
8030
+ kind: "rolling" | "fixed";
8031
+ durationSec: number;
8032
+ } | undefined;
8033
+ }, {
8034
+ unit: "USD" | "ops" | "points";
8035
+ cap: number;
8036
+ window?: {
8037
+ kind: "rolling" | "fixed";
8038
+ durationSec: number;
8039
+ } | undefined;
8040
+ }>>;
8041
+ scopes: z.ZodArray<z.ZodObject<{
8042
+ resource: z.ZodString;
8043
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8044
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8045
+ }, "strip", z.ZodTypeAny, {
8046
+ resource: string;
8047
+ matcher: "exact" | "prefix" | "regex";
8048
+ constraints?: Record<string, any> | undefined;
8049
+ }, {
8050
+ resource: string;
8051
+ matcher: "exact" | "prefix" | "regex";
8052
+ constraints?: Record<string, any> | undefined;
8053
+ }>, "many">;
8054
+ }, z.ZodTypeAny, "passthrough">>>;
8055
+ }, z.ZodTypeAny, "passthrough">>;
8056
+ /** Current status of the delegation */
8057
+ status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
8058
+ /** Timestamp when created (milliseconds since epoch) */
8059
+ createdAt: z.ZodOptional<z.ZodNumber>;
8060
+ /** Optional metadata */
8061
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8062
+ }, "strip", z.ZodTypeAny, {
8063
+ status: "active" | "revoked" | "expired";
8064
+ id: string;
8065
+ issuerDid: string;
8066
+ subjectDid: string;
8067
+ constraints: {
8068
+ notBefore?: number | undefined;
8069
+ notAfter?: number | undefined;
8070
+ scopes?: string[] | undefined;
8071
+ crisp?: z.objectOutputType<{
8072
+ budget: z.ZodOptional<z.ZodObject<{
8073
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
8074
+ cap: z.ZodNumber;
8075
+ window: z.ZodOptional<z.ZodObject<{
8076
+ kind: z.ZodEnum<["rolling", "fixed"]>;
8077
+ durationSec: z.ZodNumber;
8078
+ }, "strip", z.ZodTypeAny, {
8079
+ kind: "rolling" | "fixed";
8080
+ durationSec: number;
8081
+ }, {
8082
+ kind: "rolling" | "fixed";
8083
+ durationSec: number;
8084
+ }>>;
8085
+ }, "strip", z.ZodTypeAny, {
8086
+ unit: "USD" | "ops" | "points";
8087
+ cap: number;
8088
+ window?: {
8089
+ kind: "rolling" | "fixed";
8090
+ durationSec: number;
8091
+ } | undefined;
8092
+ }, {
8093
+ unit: "USD" | "ops" | "points";
8094
+ cap: number;
8095
+ window?: {
8096
+ kind: "rolling" | "fixed";
8097
+ durationSec: number;
8098
+ } | undefined;
8099
+ }>>;
8100
+ scopes: z.ZodArray<z.ZodObject<{
8101
+ resource: z.ZodString;
8102
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8103
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8104
+ }, "strip", z.ZodTypeAny, {
8105
+ resource: string;
8106
+ matcher: "exact" | "prefix" | "regex";
8107
+ constraints?: Record<string, any> | undefined;
8108
+ }, {
8109
+ resource: string;
8110
+ matcher: "exact" | "prefix" | "regex";
8111
+ constraints?: Record<string, any> | undefined;
8112
+ }>, "many">;
8113
+ }, z.ZodTypeAny, "passthrough"> | undefined;
8114
+ } & {
8115
+ [k: string]: unknown;
8116
+ };
8117
+ controller?: string | undefined;
8118
+ parentId?: string | undefined;
8119
+ createdAt?: number | undefined;
8120
+ metadata?: Record<string, any> | undefined;
8121
+ }, {
8122
+ id: string;
8123
+ issuerDid: string;
8124
+ subjectDid: string;
8125
+ constraints: {
8126
+ notBefore?: number | undefined;
8127
+ notAfter?: number | undefined;
8128
+ scopes?: string[] | undefined;
8129
+ crisp?: z.objectInputType<{
8130
+ budget: z.ZodOptional<z.ZodObject<{
8131
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
8132
+ cap: z.ZodNumber;
8133
+ window: z.ZodOptional<z.ZodObject<{
8134
+ kind: z.ZodEnum<["rolling", "fixed"]>;
8135
+ durationSec: z.ZodNumber;
8136
+ }, "strip", z.ZodTypeAny, {
8137
+ kind: "rolling" | "fixed";
8138
+ durationSec: number;
8139
+ }, {
8140
+ kind: "rolling" | "fixed";
8141
+ durationSec: number;
8142
+ }>>;
8143
+ }, "strip", z.ZodTypeAny, {
8144
+ unit: "USD" | "ops" | "points";
8145
+ cap: number;
8146
+ window?: {
8147
+ kind: "rolling" | "fixed";
8148
+ durationSec: number;
8149
+ } | undefined;
8150
+ }, {
8151
+ unit: "USD" | "ops" | "points";
8152
+ cap: number;
8153
+ window?: {
8154
+ kind: "rolling" | "fixed";
8155
+ durationSec: number;
8156
+ } | undefined;
8157
+ }>>;
8158
+ scopes: z.ZodArray<z.ZodObject<{
8159
+ resource: z.ZodString;
8160
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8161
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8162
+ }, "strip", z.ZodTypeAny, {
8163
+ resource: string;
8164
+ matcher: "exact" | "prefix" | "regex";
8165
+ constraints?: Record<string, any> | undefined;
8166
+ }, {
8167
+ resource: string;
8168
+ matcher: "exact" | "prefix" | "regex";
8169
+ constraints?: Record<string, any> | undefined;
8170
+ }>, "many">;
8171
+ }, z.ZodTypeAny, "passthrough"> | undefined;
8172
+ } & {
8173
+ [k: string]: unknown;
8174
+ };
8175
+ status?: "active" | "revoked" | "expired" | undefined;
8176
+ controller?: string | undefined;
8177
+ parentId?: string | undefined;
8178
+ createdAt?: number | undefined;
8179
+ metadata?: Record<string, any> | undefined;
8180
+ }>;
8181
+ }, "strip", z.ZodTypeAny, {
8182
+ id: string;
8183
+ delegation: {
8184
+ status: "active" | "revoked" | "expired";
8185
+ id: string;
8186
+ issuerDid: string;
8187
+ subjectDid: string;
8188
+ constraints: {
8189
+ notBefore?: number | undefined;
8190
+ notAfter?: number | undefined;
8191
+ scopes?: string[] | undefined;
8192
+ crisp?: z.objectOutputType<{
8193
+ budget: z.ZodOptional<z.ZodObject<{
8194
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
8195
+ cap: z.ZodNumber;
8196
+ window: z.ZodOptional<z.ZodObject<{
8197
+ kind: z.ZodEnum<["rolling", "fixed"]>;
8198
+ durationSec: z.ZodNumber;
8199
+ }, "strip", z.ZodTypeAny, {
8200
+ kind: "rolling" | "fixed";
8201
+ durationSec: number;
8202
+ }, {
8203
+ kind: "rolling" | "fixed";
8204
+ durationSec: number;
8205
+ }>>;
8206
+ }, "strip", z.ZodTypeAny, {
8207
+ unit: "USD" | "ops" | "points";
8208
+ cap: number;
8209
+ window?: {
8210
+ kind: "rolling" | "fixed";
8211
+ durationSec: number;
8212
+ } | undefined;
8213
+ }, {
8214
+ unit: "USD" | "ops" | "points";
8215
+ cap: number;
8216
+ window?: {
8217
+ kind: "rolling" | "fixed";
8218
+ durationSec: number;
8219
+ } | undefined;
8220
+ }>>;
8221
+ scopes: z.ZodArray<z.ZodObject<{
8222
+ resource: z.ZodString;
8223
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8224
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8225
+ }, "strip", z.ZodTypeAny, {
8226
+ resource: string;
8227
+ matcher: "exact" | "prefix" | "regex";
8228
+ constraints?: Record<string, any> | undefined;
8229
+ }, {
8230
+ resource: string;
8231
+ matcher: "exact" | "prefix" | "regex";
8232
+ constraints?: Record<string, any> | undefined;
8233
+ }>, "many">;
8234
+ }, z.ZodTypeAny, "passthrough"> | undefined;
8235
+ } & {
8236
+ [k: string]: unknown;
8237
+ };
8238
+ controller?: string | undefined;
8239
+ parentId?: string | undefined;
8240
+ createdAt?: number | undefined;
8241
+ metadata?: Record<string, any> | undefined;
8242
+ };
8243
+ }, {
8244
+ id: string;
8245
+ delegation: {
8246
+ id: string;
8247
+ issuerDid: string;
8248
+ subjectDid: string;
8249
+ constraints: {
8250
+ notBefore?: number | undefined;
8251
+ notAfter?: number | undefined;
8252
+ scopes?: string[] | undefined;
8253
+ crisp?: z.objectInputType<{
8254
+ budget: z.ZodOptional<z.ZodObject<{
8255
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
8256
+ cap: z.ZodNumber;
8257
+ window: z.ZodOptional<z.ZodObject<{
8258
+ kind: z.ZodEnum<["rolling", "fixed"]>;
8259
+ durationSec: z.ZodNumber;
8260
+ }, "strip", z.ZodTypeAny, {
8261
+ kind: "rolling" | "fixed";
8262
+ durationSec: number;
8263
+ }, {
8264
+ kind: "rolling" | "fixed";
8265
+ durationSec: number;
8266
+ }>>;
8267
+ }, "strip", z.ZodTypeAny, {
8268
+ unit: "USD" | "ops" | "points";
8269
+ cap: number;
8270
+ window?: {
8271
+ kind: "rolling" | "fixed";
8272
+ durationSec: number;
8273
+ } | undefined;
8274
+ }, {
8275
+ unit: "USD" | "ops" | "points";
8276
+ cap: number;
8277
+ window?: {
8278
+ kind: "rolling" | "fixed";
8279
+ durationSec: number;
8280
+ } | undefined;
8281
+ }>>;
8282
+ scopes: z.ZodArray<z.ZodObject<{
8283
+ resource: z.ZodString;
8284
+ matcher: z.ZodEnum<["exact", "prefix", "regex"]>;
8285
+ constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8286
+ }, "strip", z.ZodTypeAny, {
8287
+ resource: string;
8288
+ matcher: "exact" | "prefix" | "regex";
8289
+ constraints?: Record<string, any> | undefined;
8290
+ }, {
8291
+ resource: string;
8292
+ matcher: "exact" | "prefix" | "regex";
8293
+ constraints?: Record<string, any> | undefined;
8294
+ }>, "many">;
8295
+ }, z.ZodTypeAny, "passthrough"> | undefined;
8296
+ } & {
8297
+ [k: string]: unknown;
8298
+ };
8299
+ status?: "active" | "revoked" | "expired" | undefined;
8300
+ controller?: string | undefined;
8301
+ parentId?: string | undefined;
8302
+ createdAt?: number | undefined;
8303
+ metadata?: Record<string, any> | undefined;
8304
+ };
8305
+ }>;
8306
+ credentialStatus: z.ZodOptional<z.ZodObject<{
8307
+ id: z.ZodString;
8308
+ type: z.ZodLiteral<"StatusList2021Entry">;
8309
+ statusPurpose: z.ZodEnum<["revocation", "suspension"]>;
8310
+ statusListIndex: z.ZodString;
8311
+ statusListCredential: z.ZodString;
8312
+ }, "strip", z.ZodTypeAny, {
8313
+ type: "StatusList2021Entry";
8314
+ id: string;
8315
+ statusPurpose: "revocation" | "suspension";
8316
+ statusListIndex: string;
8317
+ statusListCredential: string;
8318
+ }, {
8319
+ type: "StatusList2021Entry";
8320
+ id: string;
8321
+ statusPurpose: "revocation" | "suspension";
8322
+ statusListIndex: string;
8323
+ statusListCredential: string;
8324
+ }>>;
8325
+ proof: z.ZodOptional<z.ZodObject<{
8326
+ type: z.ZodString;
8327
+ created: z.ZodOptional<z.ZodString>;
8328
+ verificationMethod: z.ZodOptional<z.ZodString>;
8329
+ proofPurpose: z.ZodOptional<z.ZodString>;
8330
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
8331
+ type: z.ZodString;
8332
+ created: z.ZodOptional<z.ZodString>;
8333
+ verificationMethod: z.ZodOptional<z.ZodString>;
8334
+ proofPurpose: z.ZodOptional<z.ZodString>;
8335
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
8336
+ type: z.ZodString;
8337
+ created: z.ZodOptional<z.ZodString>;
8338
+ verificationMethod: z.ZodOptional<z.ZodString>;
8339
+ proofPurpose: z.ZodOptional<z.ZodString>;
8340
+ }, z.ZodTypeAny, "passthrough">>>;
8341
+ }, z.ZodTypeAny, "passthrough">>;
8342
+ /**
8343
+ * Extract DelegationRecord from DelegationCredential
8344
+ *
8345
+ * Utility to extract the legacy DelegationRecord format from a W3C VC.
8346
+ * Useful for backward compatibility and internal processing.
8347
+ *
8348
+ * @param vc - The delegation credential
8349
+ * @returns DelegationRecord
8350
+ */
8351
+ export declare function extractDelegationFromVC(vc: DelegationCredential): DelegationRecord;
8352
+ /**
8353
+ * Create DelegationCredential from DelegationRecord (unsigned)
8354
+ *
8355
+ * Wraps a DelegationRecord in a W3C VC structure (without proof).
8356
+ * The caller must sign this to create a valid DelegationCredential.
8357
+ *
8358
+ * @param delegation - The delegation record
8359
+ * @param options - Optional VC options (id, issuanceDate, etc.)
8360
+ * @returns Unsigned DelegationCredential
8361
+ */
8362
+ export declare function wrapDelegationAsVC(delegation: DelegationRecord, options?: {
8363
+ id?: string;
8364
+ issuanceDate?: string;
8365
+ expirationDate?: string;
8366
+ credentialStatus?: z.infer<typeof CredentialStatusSchema>;
8367
+ }): Omit<DelegationCredential, 'proof'>;
8368
+ /**
8369
+ * Check if a delegation credential is expired
8370
+ *
8371
+ * @param vc - The delegation credential
8372
+ * @returns true if expired
8373
+ */
8374
+ export declare function isDelegationCredentialExpired(vc: DelegationCredential): boolean;
8375
+ /**
8376
+ * Check if a delegation credential is not yet valid
8377
+ *
8378
+ * @param vc - The delegation credential
8379
+ * @returns true if not yet valid
8380
+ */
8381
+ export declare function isDelegationCredentialNotYetValid(vc: DelegationCredential): boolean;
4081
8382
  //# sourceMappingURL=schemas.d.ts.map