@kya-os/contracts 1.3.5 → 1.5.1

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 (89) hide show
  1. package/dist/agentshield-api/endpoints.d.ts +50 -0
  2. package/dist/agentshield-api/endpoints.js +46 -0
  3. package/dist/agentshield-api/index.d.ts +13 -0
  4. package/dist/agentshield-api/index.js +38 -0
  5. package/dist/agentshield-api/schemas.d.ts +9914 -0
  6. package/dist/agentshield-api/schemas.js +165 -0
  7. package/dist/agentshield-api/types.d.ts +168 -0
  8. package/dist/agentshield-api/types.js +27 -0
  9. package/dist/cli.d.ts +13 -0
  10. package/dist/cli.js +13 -1
  11. package/dist/config/base.d.ts +96 -0
  12. package/dist/config/base.js +11 -0
  13. package/dist/config/delegation.d.ts +194 -0
  14. package/dist/config/delegation.js +10 -0
  15. package/dist/config/identity.d.ts +117 -0
  16. package/dist/config/identity.js +11 -0
  17. package/dist/config/index.d.ts +33 -0
  18. package/dist/config/index.js +11 -0
  19. package/dist/config/proofing.d.ts +120 -0
  20. package/dist/config/proofing.js +10 -0
  21. package/dist/config/tool-protection.d.ts +139 -0
  22. package/dist/config/tool-protection.js +10 -0
  23. package/dist/dashboard-config/default-config.d.ts +49 -0
  24. package/dist/dashboard-config/default-config.js +225 -0
  25. package/dist/dashboard-config/index.d.ts +10 -0
  26. package/dist/dashboard-config/index.js +35 -0
  27. package/dist/dashboard-config/schemas.d.ts +5847 -0
  28. package/dist/dashboard-config/schemas.js +251 -0
  29. package/dist/dashboard-config/types.d.ts +331 -0
  30. package/dist/dashboard-config/types.js +11 -0
  31. package/dist/delegation/constraints.d.ts +991 -0
  32. package/dist/delegation/constraints.js +209 -0
  33. package/dist/delegation/index.d.ts +7 -0
  34. package/dist/delegation/index.js +23 -0
  35. package/dist/delegation/schemas.d.ts +8381 -0
  36. package/dist/delegation/schemas.js +475 -0
  37. package/dist/did/index.d.ts +8 -0
  38. package/dist/did/index.js +24 -0
  39. package/dist/did/resolve-contract.d.ts +219 -0
  40. package/dist/did/resolve-contract.js +31 -0
  41. package/dist/did/schemas.d.ts +112 -0
  42. package/dist/did/schemas.js +172 -0
  43. package/dist/did/types.d.ts +163 -0
  44. package/dist/did/types.js +70 -0
  45. package/dist/env/constants.d.ts +57 -0
  46. package/dist/env/constants.js +59 -0
  47. package/dist/env/index.d.ts +4 -0
  48. package/dist/env/index.js +20 -0
  49. package/dist/handshake.d.ts +20 -0
  50. package/dist/handshake.js +10 -3
  51. package/dist/index.d.ts +14 -0
  52. package/dist/index.js +28 -0
  53. package/dist/proof/index.d.ts +8 -0
  54. package/dist/proof/index.js +24 -0
  55. package/dist/proof/proof-record.d.ts +837 -0
  56. package/dist/proof/proof-record.js +133 -0
  57. package/dist/proof/signing-spec.d.ts +146 -0
  58. package/dist/proof/signing-spec.js +122 -0
  59. package/dist/proof.d.ts +53 -16
  60. package/dist/proof.js +27 -3
  61. package/dist/registry.d.ts +16 -0
  62. package/dist/registry.js +29 -9
  63. package/dist/runtime/errors.d.ts +347 -0
  64. package/dist/runtime/errors.js +119 -0
  65. package/dist/runtime/headers.d.ts +83 -0
  66. package/dist/runtime/headers.js +81 -0
  67. package/dist/runtime/index.d.ts +5 -0
  68. package/dist/runtime/index.js +21 -0
  69. package/dist/test.d.ts +36 -0
  70. package/dist/test.js +36 -0
  71. package/dist/tlkrc/index.d.ts +4 -0
  72. package/dist/tlkrc/index.js +20 -0
  73. package/dist/tlkrc/rotation.d.ts +245 -0
  74. package/dist/tlkrc/rotation.js +126 -0
  75. package/dist/tool-protection/index.d.ts +227 -0
  76. package/dist/tool-protection/index.js +113 -0
  77. package/dist/utils/validation.d.ts +16 -0
  78. package/dist/utils/validation.js +13 -0
  79. package/dist/vc/index.d.ts +7 -0
  80. package/dist/vc/index.js +23 -0
  81. package/dist/vc/schemas.d.ts +2483 -0
  82. package/dist/vc/schemas.js +224 -0
  83. package/dist/vc/statuslist.d.ts +493 -0
  84. package/dist/vc/statuslist.js +132 -0
  85. package/dist/verifier.d.ts +3 -0
  86. package/dist/verifier.js +7 -0
  87. package/dist/well-known/index.d.ts +308 -0
  88. package/dist/well-known/index.js +134 -0
  89. package/package.json +6 -1
@@ -0,0 +1,837 @@
1
+ /**
2
+ * Proof Record (Archive)
3
+ *
4
+ * Schema for proof records stored in KV/archive for audit trails
5
+ *
6
+ * Related Spec: MCP-I §5
7
+ * Python Reference: Edge-Delegation-Verification.md
8
+ */
9
+ import { z } from 'zod';
10
+ /**
11
+ * Request Info Schema
12
+ *
13
+ * Information about the request that was proven
14
+ */
15
+ export declare const RequestInfoSchema: z.ZodObject<{
16
+ method: z.ZodString;
17
+ url: z.ZodString;
18
+ bodyHash: z.ZodOptional<z.ZodString>;
19
+ headersHash: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ url: string;
22
+ method: string;
23
+ bodyHash?: string | undefined;
24
+ headersHash?: string | undefined;
25
+ }, {
26
+ url: string;
27
+ method: string;
28
+ bodyHash?: string | undefined;
29
+ headersHash?: string | undefined;
30
+ }>;
31
+ export type RequestInfo = z.infer<typeof RequestInfoSchema>;
32
+ /**
33
+ * Response Info Schema
34
+ *
35
+ * Information about the response
36
+ */
37
+ export declare const ResponseInfoSchema: z.ZodObject<{
38
+ status: z.ZodNumber;
39
+ bodyHash: z.ZodOptional<z.ZodString>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ status: number;
42
+ bodyHash?: string | undefined;
43
+ }, {
44
+ status: number;
45
+ bodyHash?: string | undefined;
46
+ }>;
47
+ export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
48
+ /**
49
+ * Proof Details Schema
50
+ *
51
+ * Core proof information
52
+ */
53
+ export declare const ProofDetailsSchema: z.ZodObject<{
54
+ timestamp: z.ZodNumber;
55
+ nonce: z.ZodString;
56
+ did: z.ZodString;
57
+ signature: z.ZodString;
58
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
59
+ sessionId: z.ZodString;
60
+ audience: z.ZodString;
61
+ request: z.ZodOptional<z.ZodObject<{
62
+ method: z.ZodString;
63
+ url: z.ZodString;
64
+ bodyHash: z.ZodOptional<z.ZodString>;
65
+ headersHash: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ url: string;
68
+ method: string;
69
+ bodyHash?: string | undefined;
70
+ headersHash?: string | undefined;
71
+ }, {
72
+ url: string;
73
+ method: string;
74
+ bodyHash?: string | undefined;
75
+ headersHash?: string | undefined;
76
+ }>>;
77
+ response: z.ZodOptional<z.ZodObject<{
78
+ status: z.ZodNumber;
79
+ bodyHash: z.ZodOptional<z.ZodString>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ status: number;
82
+ bodyHash?: string | undefined;
83
+ }, {
84
+ status: number;
85
+ bodyHash?: string | undefined;
86
+ }>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ did: string;
89
+ nonce: string;
90
+ audience: string;
91
+ timestamp: number;
92
+ sessionId: string;
93
+ signature: string;
94
+ algorithm: "Ed25519" | "ES256";
95
+ request?: {
96
+ url: string;
97
+ method: string;
98
+ bodyHash?: string | undefined;
99
+ headersHash?: string | undefined;
100
+ } | undefined;
101
+ response?: {
102
+ status: number;
103
+ bodyHash?: string | undefined;
104
+ } | undefined;
105
+ }, {
106
+ did: string;
107
+ nonce: string;
108
+ audience: string;
109
+ timestamp: number;
110
+ sessionId: string;
111
+ signature: string;
112
+ algorithm: "Ed25519" | "ES256";
113
+ request?: {
114
+ url: string;
115
+ method: string;
116
+ bodyHash?: string | undefined;
117
+ headersHash?: string | undefined;
118
+ } | undefined;
119
+ response?: {
120
+ status: number;
121
+ bodyHash?: string | undefined;
122
+ } | undefined;
123
+ }>;
124
+ export type ProofDetails = z.infer<typeof ProofDetailsSchema>;
125
+ /**
126
+ * Linkage Info Schema
127
+ *
128
+ * Links to delegations and credentials
129
+ */
130
+ export declare const LinkageInfoSchema: z.ZodObject<{
131
+ delegationId: z.ZodOptional<z.ZodString>;
132
+ credentialId: z.ZodOptional<z.ZodString>;
133
+ chainDepth: z.ZodOptional<z.ZodNumber>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ delegationId?: string | undefined;
136
+ credentialId?: string | undefined;
137
+ chainDepth?: number | undefined;
138
+ }, {
139
+ delegationId?: string | undefined;
140
+ credentialId?: string | undefined;
141
+ chainDepth?: number | undefined;
142
+ }>;
143
+ export type LinkageInfo = z.infer<typeof LinkageInfoSchema>;
144
+ /**
145
+ * CRISP Info Schema
146
+ *
147
+ * CRISP spending information
148
+ */
149
+ export declare const CrispInfoSchema: z.ZodObject<{
150
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
151
+ delta: z.ZodOptional<z.ZodNumber>;
152
+ remaining: z.ZodOptional<z.ZodNumber>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ unit: "USD" | "ops" | "points";
155
+ delta?: number | undefined;
156
+ remaining?: number | undefined;
157
+ }, {
158
+ unit: "USD" | "ops" | "points";
159
+ delta?: number | undefined;
160
+ remaining?: number | undefined;
161
+ }>;
162
+ export type CrispInfo = z.infer<typeof CrispInfoSchema>;
163
+ /**
164
+ * Verification Info Schema
165
+ *
166
+ * Verification result for the proof
167
+ */
168
+ export declare const VerificationInfoSchema: z.ZodObject<{
169
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
170
+ reason: z.ZodOptional<z.ZodString>;
171
+ checkedAt: z.ZodOptional<z.ZodNumber>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ result: "pending" | "pass" | "fail";
174
+ reason?: string | undefined;
175
+ checkedAt?: number | undefined;
176
+ }, {
177
+ result: "pending" | "pass" | "fail";
178
+ reason?: string | undefined;
179
+ checkedAt?: number | undefined;
180
+ }>;
181
+ export type VerificationInfo = z.infer<typeof VerificationInfoSchema>;
182
+ /**
183
+ * Proof Record Schema
184
+ *
185
+ * Complete proof record for archive/KV storage
186
+ */
187
+ export declare const ProofRecordSchema: z.ZodObject<{
188
+ /** Unique identifier for the proof record */
189
+ id: z.ZodString;
190
+ /** Tool/service name that created the proof */
191
+ toolName: z.ZodString;
192
+ /** Timestamp when stored (milliseconds since epoch) */
193
+ storedAt: z.ZodNumber;
194
+ /** Expiration timestamp (milliseconds since epoch) */
195
+ expiresAt: z.ZodNumber;
196
+ /** Core proof details */
197
+ proof: z.ZodObject<{
198
+ timestamp: z.ZodNumber;
199
+ nonce: z.ZodString;
200
+ did: z.ZodString;
201
+ signature: z.ZodString;
202
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
203
+ sessionId: z.ZodString;
204
+ audience: z.ZodString;
205
+ request: z.ZodOptional<z.ZodObject<{
206
+ method: z.ZodString;
207
+ url: z.ZodString;
208
+ bodyHash: z.ZodOptional<z.ZodString>;
209
+ headersHash: z.ZodOptional<z.ZodString>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ url: string;
212
+ method: string;
213
+ bodyHash?: string | undefined;
214
+ headersHash?: string | undefined;
215
+ }, {
216
+ url: string;
217
+ method: string;
218
+ bodyHash?: string | undefined;
219
+ headersHash?: string | undefined;
220
+ }>>;
221
+ response: z.ZodOptional<z.ZodObject<{
222
+ status: z.ZodNumber;
223
+ bodyHash: z.ZodOptional<z.ZodString>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ status: number;
226
+ bodyHash?: string | undefined;
227
+ }, {
228
+ status: number;
229
+ bodyHash?: string | undefined;
230
+ }>>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ did: string;
233
+ nonce: string;
234
+ audience: string;
235
+ timestamp: number;
236
+ sessionId: string;
237
+ signature: string;
238
+ algorithm: "Ed25519" | "ES256";
239
+ request?: {
240
+ url: string;
241
+ method: string;
242
+ bodyHash?: string | undefined;
243
+ headersHash?: string | undefined;
244
+ } | undefined;
245
+ response?: {
246
+ status: number;
247
+ bodyHash?: string | undefined;
248
+ } | undefined;
249
+ }, {
250
+ did: string;
251
+ nonce: string;
252
+ audience: string;
253
+ timestamp: number;
254
+ sessionId: string;
255
+ signature: string;
256
+ algorithm: "Ed25519" | "ES256";
257
+ request?: {
258
+ url: string;
259
+ method: string;
260
+ bodyHash?: string | undefined;
261
+ headersHash?: string | undefined;
262
+ } | undefined;
263
+ response?: {
264
+ status: number;
265
+ bodyHash?: string | undefined;
266
+ } | undefined;
267
+ }>;
268
+ /** Optional linkage to delegations/credentials */
269
+ linkage: z.ZodOptional<z.ZodObject<{
270
+ delegationId: z.ZodOptional<z.ZodString>;
271
+ credentialId: z.ZodOptional<z.ZodString>;
272
+ chainDepth: z.ZodOptional<z.ZodNumber>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ delegationId?: string | undefined;
275
+ credentialId?: string | undefined;
276
+ chainDepth?: number | undefined;
277
+ }, {
278
+ delegationId?: string | undefined;
279
+ credentialId?: string | undefined;
280
+ chainDepth?: number | undefined;
281
+ }>>;
282
+ /** Optional CRISP spending info */
283
+ crisp: z.ZodOptional<z.ZodObject<{
284
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
285
+ delta: z.ZodOptional<z.ZodNumber>;
286
+ remaining: z.ZodOptional<z.ZodNumber>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ unit: "USD" | "ops" | "points";
289
+ delta?: number | undefined;
290
+ remaining?: number | undefined;
291
+ }, {
292
+ unit: "USD" | "ops" | "points";
293
+ delta?: number | undefined;
294
+ remaining?: number | undefined;
295
+ }>>;
296
+ /** Optional verification info */
297
+ verification: z.ZodOptional<z.ZodObject<{
298
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
299
+ reason: z.ZodOptional<z.ZodString>;
300
+ checkedAt: z.ZodOptional<z.ZodNumber>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ result: "pending" | "pass" | "fail";
303
+ reason?: string | undefined;
304
+ checkedAt?: number | undefined;
305
+ }, {
306
+ result: "pending" | "pass" | "fail";
307
+ reason?: string | undefined;
308
+ checkedAt?: number | undefined;
309
+ }>>;
310
+ /** Optional metadata */
311
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
312
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
313
+ /** Unique identifier for the proof record */
314
+ id: z.ZodString;
315
+ /** Tool/service name that created the proof */
316
+ toolName: z.ZodString;
317
+ /** Timestamp when stored (milliseconds since epoch) */
318
+ storedAt: z.ZodNumber;
319
+ /** Expiration timestamp (milliseconds since epoch) */
320
+ expiresAt: z.ZodNumber;
321
+ /** Core proof details */
322
+ proof: z.ZodObject<{
323
+ timestamp: z.ZodNumber;
324
+ nonce: z.ZodString;
325
+ did: z.ZodString;
326
+ signature: z.ZodString;
327
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
328
+ sessionId: z.ZodString;
329
+ audience: z.ZodString;
330
+ request: z.ZodOptional<z.ZodObject<{
331
+ method: z.ZodString;
332
+ url: z.ZodString;
333
+ bodyHash: z.ZodOptional<z.ZodString>;
334
+ headersHash: z.ZodOptional<z.ZodString>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ url: string;
337
+ method: string;
338
+ bodyHash?: string | undefined;
339
+ headersHash?: string | undefined;
340
+ }, {
341
+ url: string;
342
+ method: string;
343
+ bodyHash?: string | undefined;
344
+ headersHash?: string | undefined;
345
+ }>>;
346
+ response: z.ZodOptional<z.ZodObject<{
347
+ status: z.ZodNumber;
348
+ bodyHash: z.ZodOptional<z.ZodString>;
349
+ }, "strip", z.ZodTypeAny, {
350
+ status: number;
351
+ bodyHash?: string | undefined;
352
+ }, {
353
+ status: number;
354
+ bodyHash?: string | undefined;
355
+ }>>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ did: string;
358
+ nonce: string;
359
+ audience: string;
360
+ timestamp: number;
361
+ sessionId: string;
362
+ signature: string;
363
+ algorithm: "Ed25519" | "ES256";
364
+ request?: {
365
+ url: string;
366
+ method: string;
367
+ bodyHash?: string | undefined;
368
+ headersHash?: string | undefined;
369
+ } | undefined;
370
+ response?: {
371
+ status: number;
372
+ bodyHash?: string | undefined;
373
+ } | undefined;
374
+ }, {
375
+ did: string;
376
+ nonce: string;
377
+ audience: string;
378
+ timestamp: number;
379
+ sessionId: string;
380
+ signature: string;
381
+ algorithm: "Ed25519" | "ES256";
382
+ request?: {
383
+ url: string;
384
+ method: string;
385
+ bodyHash?: string | undefined;
386
+ headersHash?: string | undefined;
387
+ } | undefined;
388
+ response?: {
389
+ status: number;
390
+ bodyHash?: string | undefined;
391
+ } | undefined;
392
+ }>;
393
+ /** Optional linkage to delegations/credentials */
394
+ linkage: z.ZodOptional<z.ZodObject<{
395
+ delegationId: z.ZodOptional<z.ZodString>;
396
+ credentialId: z.ZodOptional<z.ZodString>;
397
+ chainDepth: z.ZodOptional<z.ZodNumber>;
398
+ }, "strip", z.ZodTypeAny, {
399
+ delegationId?: string | undefined;
400
+ credentialId?: string | undefined;
401
+ chainDepth?: number | undefined;
402
+ }, {
403
+ delegationId?: string | undefined;
404
+ credentialId?: string | undefined;
405
+ chainDepth?: number | undefined;
406
+ }>>;
407
+ /** Optional CRISP spending info */
408
+ crisp: z.ZodOptional<z.ZodObject<{
409
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
410
+ delta: z.ZodOptional<z.ZodNumber>;
411
+ remaining: z.ZodOptional<z.ZodNumber>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ unit: "USD" | "ops" | "points";
414
+ delta?: number | undefined;
415
+ remaining?: number | undefined;
416
+ }, {
417
+ unit: "USD" | "ops" | "points";
418
+ delta?: number | undefined;
419
+ remaining?: number | undefined;
420
+ }>>;
421
+ /** Optional verification info */
422
+ verification: z.ZodOptional<z.ZodObject<{
423
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
424
+ reason: z.ZodOptional<z.ZodString>;
425
+ checkedAt: z.ZodOptional<z.ZodNumber>;
426
+ }, "strip", z.ZodTypeAny, {
427
+ result: "pending" | "pass" | "fail";
428
+ reason?: string | undefined;
429
+ checkedAt?: number | undefined;
430
+ }, {
431
+ result: "pending" | "pass" | "fail";
432
+ reason?: string | undefined;
433
+ checkedAt?: number | undefined;
434
+ }>>;
435
+ /** Optional metadata */
436
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
437
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
438
+ /** Unique identifier for the proof record */
439
+ id: z.ZodString;
440
+ /** Tool/service name that created the proof */
441
+ toolName: z.ZodString;
442
+ /** Timestamp when stored (milliseconds since epoch) */
443
+ storedAt: z.ZodNumber;
444
+ /** Expiration timestamp (milliseconds since epoch) */
445
+ expiresAt: z.ZodNumber;
446
+ /** Core proof details */
447
+ proof: z.ZodObject<{
448
+ timestamp: z.ZodNumber;
449
+ nonce: z.ZodString;
450
+ did: z.ZodString;
451
+ signature: z.ZodString;
452
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
453
+ sessionId: z.ZodString;
454
+ audience: z.ZodString;
455
+ request: z.ZodOptional<z.ZodObject<{
456
+ method: z.ZodString;
457
+ url: z.ZodString;
458
+ bodyHash: z.ZodOptional<z.ZodString>;
459
+ headersHash: z.ZodOptional<z.ZodString>;
460
+ }, "strip", z.ZodTypeAny, {
461
+ url: string;
462
+ method: string;
463
+ bodyHash?: string | undefined;
464
+ headersHash?: string | undefined;
465
+ }, {
466
+ url: string;
467
+ method: string;
468
+ bodyHash?: string | undefined;
469
+ headersHash?: string | undefined;
470
+ }>>;
471
+ response: z.ZodOptional<z.ZodObject<{
472
+ status: z.ZodNumber;
473
+ bodyHash: z.ZodOptional<z.ZodString>;
474
+ }, "strip", z.ZodTypeAny, {
475
+ status: number;
476
+ bodyHash?: string | undefined;
477
+ }, {
478
+ status: number;
479
+ bodyHash?: string | undefined;
480
+ }>>;
481
+ }, "strip", z.ZodTypeAny, {
482
+ did: string;
483
+ nonce: string;
484
+ audience: string;
485
+ timestamp: number;
486
+ sessionId: string;
487
+ signature: string;
488
+ algorithm: "Ed25519" | "ES256";
489
+ request?: {
490
+ url: string;
491
+ method: string;
492
+ bodyHash?: string | undefined;
493
+ headersHash?: string | undefined;
494
+ } | undefined;
495
+ response?: {
496
+ status: number;
497
+ bodyHash?: string | undefined;
498
+ } | undefined;
499
+ }, {
500
+ did: string;
501
+ nonce: string;
502
+ audience: string;
503
+ timestamp: number;
504
+ sessionId: string;
505
+ signature: string;
506
+ algorithm: "Ed25519" | "ES256";
507
+ request?: {
508
+ url: string;
509
+ method: string;
510
+ bodyHash?: string | undefined;
511
+ headersHash?: string | undefined;
512
+ } | undefined;
513
+ response?: {
514
+ status: number;
515
+ bodyHash?: string | undefined;
516
+ } | undefined;
517
+ }>;
518
+ /** Optional linkage to delegations/credentials */
519
+ linkage: z.ZodOptional<z.ZodObject<{
520
+ delegationId: z.ZodOptional<z.ZodString>;
521
+ credentialId: z.ZodOptional<z.ZodString>;
522
+ chainDepth: z.ZodOptional<z.ZodNumber>;
523
+ }, "strip", z.ZodTypeAny, {
524
+ delegationId?: string | undefined;
525
+ credentialId?: string | undefined;
526
+ chainDepth?: number | undefined;
527
+ }, {
528
+ delegationId?: string | undefined;
529
+ credentialId?: string | undefined;
530
+ chainDepth?: number | undefined;
531
+ }>>;
532
+ /** Optional CRISP spending info */
533
+ crisp: z.ZodOptional<z.ZodObject<{
534
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
535
+ delta: z.ZodOptional<z.ZodNumber>;
536
+ remaining: z.ZodOptional<z.ZodNumber>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ unit: "USD" | "ops" | "points";
539
+ delta?: number | undefined;
540
+ remaining?: number | undefined;
541
+ }, {
542
+ unit: "USD" | "ops" | "points";
543
+ delta?: number | undefined;
544
+ remaining?: number | undefined;
545
+ }>>;
546
+ /** Optional verification info */
547
+ verification: z.ZodOptional<z.ZodObject<{
548
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
549
+ reason: z.ZodOptional<z.ZodString>;
550
+ checkedAt: z.ZodOptional<z.ZodNumber>;
551
+ }, "strip", z.ZodTypeAny, {
552
+ result: "pending" | "pass" | "fail";
553
+ reason?: string | undefined;
554
+ checkedAt?: number | undefined;
555
+ }, {
556
+ result: "pending" | "pass" | "fail";
557
+ reason?: string | undefined;
558
+ checkedAt?: number | undefined;
559
+ }>>;
560
+ /** Optional metadata */
561
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
562
+ }, z.ZodTypeAny, "passthrough">>;
563
+ export type ProofRecord = z.infer<typeof ProofRecordSchema>;
564
+ /**
565
+ * Validation Helpers
566
+ */
567
+ /**
568
+ * Validate a proof record
569
+ *
570
+ * @param record - The record to validate
571
+ * @returns Validation result
572
+ */
573
+ export declare function validateProofRecord(record: unknown): z.SafeParseReturnType<z.objectInputType<{
574
+ /** Unique identifier for the proof record */
575
+ id: z.ZodString;
576
+ /** Tool/service name that created the proof */
577
+ toolName: z.ZodString;
578
+ /** Timestamp when stored (milliseconds since epoch) */
579
+ storedAt: z.ZodNumber;
580
+ /** Expiration timestamp (milliseconds since epoch) */
581
+ expiresAt: z.ZodNumber;
582
+ /** Core proof details */
583
+ proof: z.ZodObject<{
584
+ timestamp: z.ZodNumber;
585
+ nonce: z.ZodString;
586
+ did: z.ZodString;
587
+ signature: z.ZodString;
588
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
589
+ sessionId: z.ZodString;
590
+ audience: z.ZodString;
591
+ request: z.ZodOptional<z.ZodObject<{
592
+ method: z.ZodString;
593
+ url: z.ZodString;
594
+ bodyHash: z.ZodOptional<z.ZodString>;
595
+ headersHash: z.ZodOptional<z.ZodString>;
596
+ }, "strip", z.ZodTypeAny, {
597
+ url: string;
598
+ method: string;
599
+ bodyHash?: string | undefined;
600
+ headersHash?: string | undefined;
601
+ }, {
602
+ url: string;
603
+ method: string;
604
+ bodyHash?: string | undefined;
605
+ headersHash?: string | undefined;
606
+ }>>;
607
+ response: z.ZodOptional<z.ZodObject<{
608
+ status: z.ZodNumber;
609
+ bodyHash: z.ZodOptional<z.ZodString>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ status: number;
612
+ bodyHash?: string | undefined;
613
+ }, {
614
+ status: number;
615
+ bodyHash?: string | undefined;
616
+ }>>;
617
+ }, "strip", z.ZodTypeAny, {
618
+ did: string;
619
+ nonce: string;
620
+ audience: string;
621
+ timestamp: number;
622
+ sessionId: string;
623
+ signature: string;
624
+ algorithm: "Ed25519" | "ES256";
625
+ request?: {
626
+ url: string;
627
+ method: string;
628
+ bodyHash?: string | undefined;
629
+ headersHash?: string | undefined;
630
+ } | undefined;
631
+ response?: {
632
+ status: number;
633
+ bodyHash?: string | undefined;
634
+ } | undefined;
635
+ }, {
636
+ did: string;
637
+ nonce: string;
638
+ audience: string;
639
+ timestamp: number;
640
+ sessionId: string;
641
+ signature: string;
642
+ algorithm: "Ed25519" | "ES256";
643
+ request?: {
644
+ url: string;
645
+ method: string;
646
+ bodyHash?: string | undefined;
647
+ headersHash?: string | undefined;
648
+ } | undefined;
649
+ response?: {
650
+ status: number;
651
+ bodyHash?: string | undefined;
652
+ } | undefined;
653
+ }>;
654
+ /** Optional linkage to delegations/credentials */
655
+ linkage: z.ZodOptional<z.ZodObject<{
656
+ delegationId: z.ZodOptional<z.ZodString>;
657
+ credentialId: z.ZodOptional<z.ZodString>;
658
+ chainDepth: z.ZodOptional<z.ZodNumber>;
659
+ }, "strip", z.ZodTypeAny, {
660
+ delegationId?: string | undefined;
661
+ credentialId?: string | undefined;
662
+ chainDepth?: number | undefined;
663
+ }, {
664
+ delegationId?: string | undefined;
665
+ credentialId?: string | undefined;
666
+ chainDepth?: number | undefined;
667
+ }>>;
668
+ /** Optional CRISP spending info */
669
+ crisp: z.ZodOptional<z.ZodObject<{
670
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
671
+ delta: z.ZodOptional<z.ZodNumber>;
672
+ remaining: z.ZodOptional<z.ZodNumber>;
673
+ }, "strip", z.ZodTypeAny, {
674
+ unit: "USD" | "ops" | "points";
675
+ delta?: number | undefined;
676
+ remaining?: number | undefined;
677
+ }, {
678
+ unit: "USD" | "ops" | "points";
679
+ delta?: number | undefined;
680
+ remaining?: number | undefined;
681
+ }>>;
682
+ /** Optional verification info */
683
+ verification: z.ZodOptional<z.ZodObject<{
684
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
685
+ reason: z.ZodOptional<z.ZodString>;
686
+ checkedAt: z.ZodOptional<z.ZodNumber>;
687
+ }, "strip", z.ZodTypeAny, {
688
+ result: "pending" | "pass" | "fail";
689
+ reason?: string | undefined;
690
+ checkedAt?: number | undefined;
691
+ }, {
692
+ result: "pending" | "pass" | "fail";
693
+ reason?: string | undefined;
694
+ checkedAt?: number | undefined;
695
+ }>>;
696
+ /** Optional metadata */
697
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
698
+ }, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
699
+ /** Unique identifier for the proof record */
700
+ id: z.ZodString;
701
+ /** Tool/service name that created the proof */
702
+ toolName: z.ZodString;
703
+ /** Timestamp when stored (milliseconds since epoch) */
704
+ storedAt: z.ZodNumber;
705
+ /** Expiration timestamp (milliseconds since epoch) */
706
+ expiresAt: z.ZodNumber;
707
+ /** Core proof details */
708
+ proof: z.ZodObject<{
709
+ timestamp: z.ZodNumber;
710
+ nonce: z.ZodString;
711
+ did: z.ZodString;
712
+ signature: z.ZodString;
713
+ algorithm: z.ZodEnum<["Ed25519", "ES256"]>;
714
+ sessionId: z.ZodString;
715
+ audience: z.ZodString;
716
+ request: z.ZodOptional<z.ZodObject<{
717
+ method: z.ZodString;
718
+ url: z.ZodString;
719
+ bodyHash: z.ZodOptional<z.ZodString>;
720
+ headersHash: z.ZodOptional<z.ZodString>;
721
+ }, "strip", z.ZodTypeAny, {
722
+ url: string;
723
+ method: string;
724
+ bodyHash?: string | undefined;
725
+ headersHash?: string | undefined;
726
+ }, {
727
+ url: string;
728
+ method: string;
729
+ bodyHash?: string | undefined;
730
+ headersHash?: string | undefined;
731
+ }>>;
732
+ response: z.ZodOptional<z.ZodObject<{
733
+ status: z.ZodNumber;
734
+ bodyHash: z.ZodOptional<z.ZodString>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ status: number;
737
+ bodyHash?: string | undefined;
738
+ }, {
739
+ status: number;
740
+ bodyHash?: string | undefined;
741
+ }>>;
742
+ }, "strip", z.ZodTypeAny, {
743
+ did: string;
744
+ nonce: string;
745
+ audience: string;
746
+ timestamp: number;
747
+ sessionId: string;
748
+ signature: string;
749
+ algorithm: "Ed25519" | "ES256";
750
+ request?: {
751
+ url: string;
752
+ method: string;
753
+ bodyHash?: string | undefined;
754
+ headersHash?: string | undefined;
755
+ } | undefined;
756
+ response?: {
757
+ status: number;
758
+ bodyHash?: string | undefined;
759
+ } | undefined;
760
+ }, {
761
+ did: string;
762
+ nonce: string;
763
+ audience: string;
764
+ timestamp: number;
765
+ sessionId: string;
766
+ signature: string;
767
+ algorithm: "Ed25519" | "ES256";
768
+ request?: {
769
+ url: string;
770
+ method: string;
771
+ bodyHash?: string | undefined;
772
+ headersHash?: string | undefined;
773
+ } | undefined;
774
+ response?: {
775
+ status: number;
776
+ bodyHash?: string | undefined;
777
+ } | undefined;
778
+ }>;
779
+ /** Optional linkage to delegations/credentials */
780
+ linkage: z.ZodOptional<z.ZodObject<{
781
+ delegationId: z.ZodOptional<z.ZodString>;
782
+ credentialId: z.ZodOptional<z.ZodString>;
783
+ chainDepth: z.ZodOptional<z.ZodNumber>;
784
+ }, "strip", z.ZodTypeAny, {
785
+ delegationId?: string | undefined;
786
+ credentialId?: string | undefined;
787
+ chainDepth?: number | undefined;
788
+ }, {
789
+ delegationId?: string | undefined;
790
+ credentialId?: string | undefined;
791
+ chainDepth?: number | undefined;
792
+ }>>;
793
+ /** Optional CRISP spending info */
794
+ crisp: z.ZodOptional<z.ZodObject<{
795
+ unit: z.ZodEnum<["USD", "ops", "points"]>;
796
+ delta: z.ZodOptional<z.ZodNumber>;
797
+ remaining: z.ZodOptional<z.ZodNumber>;
798
+ }, "strip", z.ZodTypeAny, {
799
+ unit: "USD" | "ops" | "points";
800
+ delta?: number | undefined;
801
+ remaining?: number | undefined;
802
+ }, {
803
+ unit: "USD" | "ops" | "points";
804
+ delta?: number | undefined;
805
+ remaining?: number | undefined;
806
+ }>>;
807
+ /** Optional verification info */
808
+ verification: z.ZodOptional<z.ZodObject<{
809
+ result: z.ZodEnum<["pending", "pass", "fail"]>;
810
+ reason: z.ZodOptional<z.ZodString>;
811
+ checkedAt: z.ZodOptional<z.ZodNumber>;
812
+ }, "strip", z.ZodTypeAny, {
813
+ result: "pending" | "pass" | "fail";
814
+ reason?: string | undefined;
815
+ checkedAt?: number | undefined;
816
+ }, {
817
+ result: "pending" | "pass" | "fail";
818
+ reason?: string | undefined;
819
+ checkedAt?: number | undefined;
820
+ }>>;
821
+ /** Optional metadata */
822
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
823
+ }, z.ZodTypeAny, "passthrough">>;
824
+ /**
825
+ * Check if proof record is expired
826
+ *
827
+ * @param record - The record to check
828
+ * @returns true if expired
829
+ */
830
+ export declare function isProofRecordExpired(record: ProofRecord): boolean;
831
+ /**
832
+ * Constants
833
+ */
834
+ /**
835
+ * Default proof record TTL (30 days in milliseconds)
836
+ */
837
+ export declare const DEFAULT_PROOF_RECORD_TTL_MS: number;