@kya-os/contracts 1.5.2-canary.4 → 1.5.2-canary.6

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 (101) hide show
  1. package/dist/agentshield-api/admin-schemas.d.ts +49 -0
  2. package/dist/agentshield-api/admin-schemas.js +30 -0
  3. package/dist/agentshield-api/admin-types.d.ts +37 -0
  4. package/dist/agentshield-api/admin-types.js +10 -0
  5. package/dist/agentshield-api/endpoints.d.ts +50 -0
  6. package/dist/agentshield-api/endpoints.js +46 -0
  7. package/dist/agentshield-api/index.d.ts +15 -0
  8. package/dist/agentshield-api/index.js +40 -0
  9. package/dist/agentshield-api/schemas.d.ts +6032 -0
  10. package/dist/agentshield-api/schemas.js +240 -0
  11. package/dist/agentshield-api/types.d.ts +231 -0
  12. package/dist/agentshield-api/types.js +26 -0
  13. package/dist/cli.d.ts +388 -0
  14. package/dist/cli.js +121 -0
  15. package/dist/config/base.d.ts +96 -0
  16. package/dist/config/base.js +11 -0
  17. package/dist/config/builder.d.ts +33 -0
  18. package/dist/config/builder.js +74 -0
  19. package/dist/config/delegation.d.ts +194 -0
  20. package/dist/config/delegation.js +10 -0
  21. package/dist/config/identity.d.ts +116 -0
  22. package/dist/config/identity.js +10 -0
  23. package/dist/config/index.d.ts +34 -0
  24. package/dist/config/index.js +14 -0
  25. package/dist/config/proofing.d.ts +120 -0
  26. package/dist/config/proofing.js +10 -0
  27. package/dist/config/tool-protection.d.ts +139 -0
  28. package/dist/config/tool-protection.js +10 -0
  29. package/dist/consent/index.d.ts +6 -0
  30. package/dist/consent/index.js +23 -0
  31. package/dist/consent/schemas.d.ts +845 -0
  32. package/dist/consent/schemas.js +241 -0
  33. package/dist/consent/types.d.ts +155 -0
  34. package/dist/consent/types.js +10 -0
  35. package/dist/dashboard-config/default-config.d.ts +49 -0
  36. package/dist/dashboard-config/default-config.js +240 -0
  37. package/dist/dashboard-config/index.d.ts +10 -0
  38. package/dist/dashboard-config/index.js +35 -0
  39. package/dist/dashboard-config/schemas.d.ts +5904 -0
  40. package/dist/dashboard-config/schemas.js +254 -0
  41. package/dist/dashboard-config/types.d.ts +337 -0
  42. package/dist/dashboard-config/types.js +10 -0
  43. package/dist/delegation/constraints.d.ts +1021 -0
  44. package/dist/delegation/constraints.js +218 -0
  45. package/dist/delegation/index.d.ts +7 -0
  46. package/dist/delegation/index.js +23 -0
  47. package/dist/delegation/schemas.d.ts +8457 -0
  48. package/dist/delegation/schemas.js +475 -0
  49. package/dist/did/index.d.ts +8 -0
  50. package/dist/did/index.js +24 -0
  51. package/dist/did/resolve-contract.d.ts +219 -0
  52. package/dist/did/resolve-contract.js +31 -0
  53. package/dist/did/schemas.d.ts +112 -0
  54. package/dist/did/schemas.js +172 -0
  55. package/dist/did/types.d.ts +163 -0
  56. package/dist/did/types.js +70 -0
  57. package/dist/env/constants.d.ts +57 -0
  58. package/dist/env/constants.js +59 -0
  59. package/dist/env/index.d.ts +4 -0
  60. package/dist/env/index.js +20 -0
  61. package/dist/handshake.d.ts +335 -0
  62. package/dist/handshake.js +81 -0
  63. package/dist/index.d.ts +25 -0
  64. package/dist/index.js +55 -0
  65. package/dist/proof/index.d.ts +9 -0
  66. package/dist/proof/index.js +38 -0
  67. package/dist/proof/proof-record.d.ts +837 -0
  68. package/dist/proof/proof-record.js +133 -0
  69. package/dist/proof/signing-spec.d.ts +146 -0
  70. package/dist/proof/signing-spec.js +122 -0
  71. package/dist/proof.d.ts +414 -0
  72. package/dist/proof.js +82 -0
  73. package/dist/registry.d.ts +342 -0
  74. package/dist/registry.js +118 -0
  75. package/dist/runtime/errors.d.ts +347 -0
  76. package/dist/runtime/errors.js +119 -0
  77. package/dist/runtime/headers.d.ts +83 -0
  78. package/dist/runtime/headers.js +81 -0
  79. package/dist/runtime/index.d.ts +5 -0
  80. package/dist/runtime/index.js +21 -0
  81. package/dist/test.d.ts +251 -0
  82. package/dist/test.js +119 -0
  83. package/dist/tlkrc/index.d.ts +4 -0
  84. package/dist/tlkrc/index.js +20 -0
  85. package/dist/tlkrc/rotation.d.ts +245 -0
  86. package/dist/tlkrc/rotation.js +126 -0
  87. package/dist/tool-protection/index.d.ts +227 -0
  88. package/dist/tool-protection/index.js +113 -0
  89. package/dist/utils/validation.d.ts +30 -0
  90. package/dist/utils/validation.js +69 -0
  91. package/dist/vc/index.d.ts +7 -0
  92. package/dist/vc/index.js +23 -0
  93. package/dist/vc/schemas.d.ts +2483 -0
  94. package/dist/vc/schemas.js +224 -0
  95. package/dist/vc/statuslist.d.ts +493 -0
  96. package/dist/vc/statuslist.js +132 -0
  97. package/dist/verifier.d.ts +205 -0
  98. package/dist/verifier.js +83 -0
  99. package/dist/well-known/index.d.ts +308 -0
  100. package/dist/well-known/index.js +134 -0
  101. package/package.json +1 -1
@@ -0,0 +1,845 @@
1
+ /**
2
+ * Consent Schemas
3
+ *
4
+ * Zod schemas for runtime validation of consent-related data structures.
5
+ * All types are derived from these schemas using z.infer.
6
+ *
7
+ * Related Spec: MCP-I Phase 0 Implementation Plan
8
+ */
9
+ import { z } from 'zod';
10
+ /**
11
+ * Consent Branding Schema
12
+ */
13
+ export declare const consentBrandingSchema: z.ZodObject<{
14
+ primaryColor: z.ZodOptional<z.ZodString>;
15
+ logoUrl: z.ZodOptional<z.ZodString>;
16
+ companyName: z.ZodOptional<z.ZodString>;
17
+ theme: z.ZodOptional<z.ZodEnum<["light", "dark", "auto"]>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ primaryColor?: string | undefined;
20
+ logoUrl?: string | undefined;
21
+ companyName?: string | undefined;
22
+ theme?: "light" | "dark" | "auto" | undefined;
23
+ }, {
24
+ primaryColor?: string | undefined;
25
+ logoUrl?: string | undefined;
26
+ companyName?: string | undefined;
27
+ theme?: "light" | "dark" | "auto" | undefined;
28
+ }>;
29
+ export type ConsentBranding = z.infer<typeof consentBrandingSchema>;
30
+ /**
31
+ * Consent Terms Schema
32
+ */
33
+ export declare const consentTermsSchema: z.ZodObject<{
34
+ text: z.ZodOptional<z.ZodString>;
35
+ url: z.ZodOptional<z.ZodString>;
36
+ version: z.ZodOptional<z.ZodString>;
37
+ required: z.ZodDefault<z.ZodBoolean>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ required: boolean;
40
+ version?: string | undefined;
41
+ url?: string | undefined;
42
+ text?: string | undefined;
43
+ }, {
44
+ version?: string | undefined;
45
+ url?: string | undefined;
46
+ text?: string | undefined;
47
+ required?: boolean | undefined;
48
+ }>;
49
+ export type ConsentTerms = z.infer<typeof consentTermsSchema>;
50
+ /**
51
+ * Consent Custom Field Option Schema
52
+ */
53
+ export declare const consentCustomFieldOptionSchema: z.ZodObject<{
54
+ value: z.ZodString;
55
+ label: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ value: string;
58
+ label: string;
59
+ }, {
60
+ value: string;
61
+ label: string;
62
+ }>;
63
+ /**
64
+ * Consent Custom Field Schema
65
+ */
66
+ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
67
+ name: z.ZodString;
68
+ label: z.ZodString;
69
+ type: z.ZodEnum<["text", "textarea", "checkbox", "select"]>;
70
+ required: z.ZodBoolean;
71
+ placeholder: z.ZodOptional<z.ZodString>;
72
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ value: z.ZodString;
74
+ label: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ value: string;
77
+ label: string;
78
+ }, {
79
+ value: string;
80
+ label: string;
81
+ }>, "many">>;
82
+ pattern: z.ZodOptional<z.ZodString>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ name: string;
85
+ type: "text" | "textarea" | "checkbox" | "select";
86
+ required: boolean;
87
+ label: string;
88
+ options?: {
89
+ value: string;
90
+ label: string;
91
+ }[] | undefined;
92
+ placeholder?: string | undefined;
93
+ pattern?: string | undefined;
94
+ }, {
95
+ name: string;
96
+ type: "text" | "textarea" | "checkbox" | "select";
97
+ required: boolean;
98
+ label: string;
99
+ options?: {
100
+ value: string;
101
+ label: string;
102
+ }[] | undefined;
103
+ placeholder?: string | undefined;
104
+ pattern?: string | undefined;
105
+ }>, {
106
+ name: string;
107
+ type: "text" | "textarea" | "checkbox" | "select";
108
+ required: boolean;
109
+ label: string;
110
+ options?: {
111
+ value: string;
112
+ label: string;
113
+ }[] | undefined;
114
+ placeholder?: string | undefined;
115
+ pattern?: string | undefined;
116
+ }, {
117
+ name: string;
118
+ type: "text" | "textarea" | "checkbox" | "select";
119
+ required: boolean;
120
+ label: string;
121
+ options?: {
122
+ value: string;
123
+ label: string;
124
+ }[] | undefined;
125
+ placeholder?: string | undefined;
126
+ pattern?: string | undefined;
127
+ }>;
128
+ export type ConsentCustomField = z.infer<typeof consentCustomFieldSchema>;
129
+ /**
130
+ * OAuth Identity Schema
131
+ *
132
+ * Represents a user's OAuth provider account information.
133
+ * Used in Phase 4 to link OAuth accounts to persistent User DIDs.
134
+ */
135
+ export declare const oauthIdentitySchema: z.ZodObject<{
136
+ /**
137
+ * OAuth provider name (e.g., "google", "github", "microsoft")
138
+ */
139
+ provider: z.ZodString;
140
+ /**
141
+ * OAuth subject identifier (unique user ID from provider)
142
+ * @example "123456789" (Google), "github-user-id" (GitHub)
143
+ */
144
+ subject: z.ZodString;
145
+ /**
146
+ * User's email address from OAuth provider (optional)
147
+ */
148
+ email: z.ZodOptional<z.ZodString>;
149
+ /**
150
+ * User's display name from OAuth provider (optional)
151
+ */
152
+ name: z.ZodOptional<z.ZodString>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ provider: string;
155
+ subject: string;
156
+ name?: string | undefined;
157
+ email?: string | undefined;
158
+ }, {
159
+ provider: string;
160
+ subject: string;
161
+ name?: string | undefined;
162
+ email?: string | undefined;
163
+ }>;
164
+ export type OAuthIdentity = z.infer<typeof oauthIdentitySchema>;
165
+ /**
166
+ * Consent Page Config Schema
167
+ */
168
+ export declare const consentPageConfigSchema: z.ZodObject<{
169
+ tool: z.ZodString;
170
+ toolDescription: z.ZodString;
171
+ scopes: z.ZodArray<z.ZodString, "many">;
172
+ agentDid: z.ZodString;
173
+ sessionId: z.ZodString;
174
+ projectId: z.ZodString;
175
+ branding: z.ZodOptional<z.ZodObject<{
176
+ primaryColor: z.ZodOptional<z.ZodString>;
177
+ logoUrl: z.ZodOptional<z.ZodString>;
178
+ companyName: z.ZodOptional<z.ZodString>;
179
+ theme: z.ZodOptional<z.ZodEnum<["light", "dark", "auto"]>>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ primaryColor?: string | undefined;
182
+ logoUrl?: string | undefined;
183
+ companyName?: string | undefined;
184
+ theme?: "light" | "dark" | "auto" | undefined;
185
+ }, {
186
+ primaryColor?: string | undefined;
187
+ logoUrl?: string | undefined;
188
+ companyName?: string | undefined;
189
+ theme?: "light" | "dark" | "auto" | undefined;
190
+ }>>;
191
+ terms: z.ZodOptional<z.ZodObject<{
192
+ text: z.ZodOptional<z.ZodString>;
193
+ url: z.ZodOptional<z.ZodString>;
194
+ version: z.ZodOptional<z.ZodString>;
195
+ required: z.ZodDefault<z.ZodBoolean>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ required: boolean;
198
+ version?: string | undefined;
199
+ url?: string | undefined;
200
+ text?: string | undefined;
201
+ }, {
202
+ version?: string | undefined;
203
+ url?: string | undefined;
204
+ text?: string | undefined;
205
+ required?: boolean | undefined;
206
+ }>>;
207
+ customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
208
+ name: z.ZodString;
209
+ label: z.ZodString;
210
+ type: z.ZodEnum<["text", "textarea", "checkbox", "select"]>;
211
+ required: z.ZodBoolean;
212
+ placeholder: z.ZodOptional<z.ZodString>;
213
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
+ value: z.ZodString;
215
+ label: z.ZodString;
216
+ }, "strip", z.ZodTypeAny, {
217
+ value: string;
218
+ label: string;
219
+ }, {
220
+ value: string;
221
+ label: string;
222
+ }>, "many">>;
223
+ pattern: z.ZodOptional<z.ZodString>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ name: string;
226
+ type: "text" | "textarea" | "checkbox" | "select";
227
+ required: boolean;
228
+ label: string;
229
+ options?: {
230
+ value: string;
231
+ label: string;
232
+ }[] | undefined;
233
+ placeholder?: string | undefined;
234
+ pattern?: string | undefined;
235
+ }, {
236
+ name: string;
237
+ type: "text" | "textarea" | "checkbox" | "select";
238
+ required: boolean;
239
+ label: string;
240
+ options?: {
241
+ value: string;
242
+ label: string;
243
+ }[] | undefined;
244
+ placeholder?: string | undefined;
245
+ pattern?: string | undefined;
246
+ }>, {
247
+ name: string;
248
+ type: "text" | "textarea" | "checkbox" | "select";
249
+ required: boolean;
250
+ label: string;
251
+ options?: {
252
+ value: string;
253
+ label: string;
254
+ }[] | undefined;
255
+ placeholder?: string | undefined;
256
+ pattern?: string | undefined;
257
+ }, {
258
+ name: string;
259
+ type: "text" | "textarea" | "checkbox" | "select";
260
+ required: boolean;
261
+ label: string;
262
+ options?: {
263
+ value: string;
264
+ label: string;
265
+ }[] | undefined;
266
+ placeholder?: string | undefined;
267
+ pattern?: string | undefined;
268
+ }>, "many">>;
269
+ serverUrl: z.ZodString;
270
+ autoClose: z.ZodOptional<z.ZodBoolean>;
271
+ }, "strip", z.ZodTypeAny, {
272
+ agentDid: string;
273
+ sessionId: string;
274
+ tool: string;
275
+ toolDescription: string;
276
+ scopes: string[];
277
+ projectId: string;
278
+ serverUrl: string;
279
+ branding?: {
280
+ primaryColor?: string | undefined;
281
+ logoUrl?: string | undefined;
282
+ companyName?: string | undefined;
283
+ theme?: "light" | "dark" | "auto" | undefined;
284
+ } | undefined;
285
+ terms?: {
286
+ required: boolean;
287
+ version?: string | undefined;
288
+ url?: string | undefined;
289
+ text?: string | undefined;
290
+ } | undefined;
291
+ customFields?: {
292
+ name: string;
293
+ type: "text" | "textarea" | "checkbox" | "select";
294
+ required: boolean;
295
+ label: string;
296
+ options?: {
297
+ value: string;
298
+ label: string;
299
+ }[] | undefined;
300
+ placeholder?: string | undefined;
301
+ pattern?: string | undefined;
302
+ }[] | undefined;
303
+ autoClose?: boolean | undefined;
304
+ }, {
305
+ agentDid: string;
306
+ sessionId: string;
307
+ tool: string;
308
+ toolDescription: string;
309
+ scopes: string[];
310
+ projectId: string;
311
+ serverUrl: string;
312
+ branding?: {
313
+ primaryColor?: string | undefined;
314
+ logoUrl?: string | undefined;
315
+ companyName?: string | undefined;
316
+ theme?: "light" | "dark" | "auto" | undefined;
317
+ } | undefined;
318
+ terms?: {
319
+ version?: string | undefined;
320
+ url?: string | undefined;
321
+ text?: string | undefined;
322
+ required?: boolean | undefined;
323
+ } | undefined;
324
+ customFields?: {
325
+ name: string;
326
+ type: "text" | "textarea" | "checkbox" | "select";
327
+ required: boolean;
328
+ label: string;
329
+ options?: {
330
+ value: string;
331
+ label: string;
332
+ }[] | undefined;
333
+ placeholder?: string | undefined;
334
+ pattern?: string | undefined;
335
+ }[] | undefined;
336
+ autoClose?: boolean | undefined;
337
+ }>;
338
+ export type ConsentPageConfig = z.infer<typeof consentPageConfigSchema>;
339
+ /**
340
+ * Consent Approval Request Schema
341
+ *
342
+ * Note: Uses snake_case for API compatibility (agent_did, session_id, project_id)
343
+ *
344
+ * Phase 4 additions:
345
+ * - oauth_identity: Optional OAuth provider information for identity linking
346
+ * - user_did: Optional User DID for persistent identity (if already known)
347
+ */
348
+ export declare const consentApprovalRequestSchema: z.ZodObject<{
349
+ tool: z.ZodString;
350
+ scopes: z.ZodArray<z.ZodString, "many">;
351
+ agent_did: z.ZodString;
352
+ session_id: z.ZodString;
353
+ project_id: z.ZodString;
354
+ termsAccepted: z.ZodBoolean;
355
+ termsVersion: z.ZodOptional<z.ZodString>;
356
+ customFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean]>>>;
357
+ /**
358
+ * OAuth provider identity information (optional)
359
+ * Used to link OAuth accounts to persistent User DIDs
360
+ */
361
+ oauth_identity: z.ZodOptional<z.ZodObject<{
362
+ /**
363
+ * OAuth provider name (e.g., "google", "github", "microsoft")
364
+ */
365
+ provider: z.ZodString;
366
+ /**
367
+ * OAuth subject identifier (unique user ID from provider)
368
+ * @example "123456789" (Google), "github-user-id" (GitHub)
369
+ */
370
+ subject: z.ZodString;
371
+ /**
372
+ * User's email address from OAuth provider (optional)
373
+ */
374
+ email: z.ZodOptional<z.ZodString>;
375
+ /**
376
+ * User's display name from OAuth provider (optional)
377
+ */
378
+ name: z.ZodOptional<z.ZodString>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ provider: string;
381
+ subject: string;
382
+ name?: string | undefined;
383
+ email?: string | undefined;
384
+ }, {
385
+ provider: string;
386
+ subject: string;
387
+ name?: string | undefined;
388
+ email?: string | undefined;
389
+ }>>;
390
+ /**
391
+ * User DID (optional)
392
+ * If provided, represents the persistent User DID for this user
393
+ * Format: did:key:... or did:web:...
394
+ */
395
+ user_did: z.ZodOptional<z.ZodString>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ tool: string;
398
+ scopes: string[];
399
+ agent_did: string;
400
+ session_id: string;
401
+ project_id: string;
402
+ termsAccepted: boolean;
403
+ customFields?: Record<string, string | boolean> | undefined;
404
+ termsVersion?: string | undefined;
405
+ oauth_identity?: {
406
+ provider: string;
407
+ subject: string;
408
+ name?: string | undefined;
409
+ email?: string | undefined;
410
+ } | undefined;
411
+ user_did?: string | undefined;
412
+ }, {
413
+ tool: string;
414
+ scopes: string[];
415
+ agent_did: string;
416
+ session_id: string;
417
+ project_id: string;
418
+ termsAccepted: boolean;
419
+ customFields?: Record<string, string | boolean> | undefined;
420
+ termsVersion?: string | undefined;
421
+ oauth_identity?: {
422
+ provider: string;
423
+ subject: string;
424
+ name?: string | undefined;
425
+ email?: string | undefined;
426
+ } | undefined;
427
+ user_did?: string | undefined;
428
+ }>;
429
+ export type ConsentApprovalRequest = z.infer<typeof consentApprovalRequestSchema>;
430
+ /**
431
+ * Consent Approval Response Schema
432
+ */
433
+ export declare const consentApprovalResponseSchema: z.ZodEffects<z.ZodObject<{
434
+ success: z.ZodBoolean;
435
+ delegation_id: z.ZodOptional<z.ZodString>;
436
+ delegation_token: z.ZodOptional<z.ZodString>;
437
+ error: z.ZodOptional<z.ZodString>;
438
+ error_code: z.ZodOptional<z.ZodString>;
439
+ }, "strip", z.ZodTypeAny, {
440
+ success: boolean;
441
+ delegation_id?: string | undefined;
442
+ delegation_token?: string | undefined;
443
+ error?: string | undefined;
444
+ error_code?: string | undefined;
445
+ }, {
446
+ success: boolean;
447
+ delegation_id?: string | undefined;
448
+ delegation_token?: string | undefined;
449
+ error?: string | undefined;
450
+ error_code?: string | undefined;
451
+ }>, {
452
+ success: boolean;
453
+ delegation_id?: string | undefined;
454
+ delegation_token?: string | undefined;
455
+ error?: string | undefined;
456
+ error_code?: string | undefined;
457
+ }, {
458
+ success: boolean;
459
+ delegation_id?: string | undefined;
460
+ delegation_token?: string | undefined;
461
+ error?: string | undefined;
462
+ error_code?: string | undefined;
463
+ }>;
464
+ export type ConsentApprovalResponse = z.infer<typeof consentApprovalResponseSchema>;
465
+ /**
466
+ * Consent Config Schema
467
+ */
468
+ export declare const consentConfigSchema: z.ZodObject<{
469
+ branding: z.ZodOptional<z.ZodObject<{
470
+ primaryColor: z.ZodOptional<z.ZodString>;
471
+ logoUrl: z.ZodOptional<z.ZodString>;
472
+ companyName: z.ZodOptional<z.ZodString>;
473
+ theme: z.ZodOptional<z.ZodEnum<["light", "dark", "auto"]>>;
474
+ }, "strip", z.ZodTypeAny, {
475
+ primaryColor?: string | undefined;
476
+ logoUrl?: string | undefined;
477
+ companyName?: string | undefined;
478
+ theme?: "light" | "dark" | "auto" | undefined;
479
+ }, {
480
+ primaryColor?: string | undefined;
481
+ logoUrl?: string | undefined;
482
+ companyName?: string | undefined;
483
+ theme?: "light" | "dark" | "auto" | undefined;
484
+ }>>;
485
+ terms: z.ZodOptional<z.ZodObject<{
486
+ text: z.ZodOptional<z.ZodString>;
487
+ url: z.ZodOptional<z.ZodString>;
488
+ version: z.ZodOptional<z.ZodString>;
489
+ required: z.ZodDefault<z.ZodBoolean>;
490
+ }, "strip", z.ZodTypeAny, {
491
+ required: boolean;
492
+ version?: string | undefined;
493
+ url?: string | undefined;
494
+ text?: string | undefined;
495
+ }, {
496
+ version?: string | undefined;
497
+ url?: string | undefined;
498
+ text?: string | undefined;
499
+ required?: boolean | undefined;
500
+ }>>;
501
+ customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
502
+ name: z.ZodString;
503
+ label: z.ZodString;
504
+ type: z.ZodEnum<["text", "textarea", "checkbox", "select"]>;
505
+ required: z.ZodBoolean;
506
+ placeholder: z.ZodOptional<z.ZodString>;
507
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
508
+ value: z.ZodString;
509
+ label: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ value: string;
512
+ label: string;
513
+ }, {
514
+ value: string;
515
+ label: string;
516
+ }>, "many">>;
517
+ pattern: z.ZodOptional<z.ZodString>;
518
+ }, "strip", z.ZodTypeAny, {
519
+ name: string;
520
+ type: "text" | "textarea" | "checkbox" | "select";
521
+ required: boolean;
522
+ label: string;
523
+ options?: {
524
+ value: string;
525
+ label: string;
526
+ }[] | undefined;
527
+ placeholder?: string | undefined;
528
+ pattern?: string | undefined;
529
+ }, {
530
+ name: string;
531
+ type: "text" | "textarea" | "checkbox" | "select";
532
+ required: boolean;
533
+ label: string;
534
+ options?: {
535
+ value: string;
536
+ label: string;
537
+ }[] | undefined;
538
+ placeholder?: string | undefined;
539
+ pattern?: string | undefined;
540
+ }>, {
541
+ name: string;
542
+ type: "text" | "textarea" | "checkbox" | "select";
543
+ required: boolean;
544
+ label: string;
545
+ options?: {
546
+ value: string;
547
+ label: string;
548
+ }[] | undefined;
549
+ placeholder?: string | undefined;
550
+ pattern?: string | undefined;
551
+ }, {
552
+ name: string;
553
+ type: "text" | "textarea" | "checkbox" | "select";
554
+ required: boolean;
555
+ label: string;
556
+ options?: {
557
+ value: string;
558
+ label: string;
559
+ }[] | undefined;
560
+ placeholder?: string | undefined;
561
+ pattern?: string | undefined;
562
+ }>, "many">>;
563
+ ui: z.ZodOptional<z.ZodObject<{
564
+ theme: z.ZodOptional<z.ZodEnum<["light", "dark", "auto"]>>;
565
+ popupEnabled: z.ZodOptional<z.ZodBoolean>;
566
+ autoClose: z.ZodOptional<z.ZodBoolean>;
567
+ autoCloseDelay: z.ZodOptional<z.ZodNumber>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ theme?: "light" | "dark" | "auto" | undefined;
570
+ autoClose?: boolean | undefined;
571
+ popupEnabled?: boolean | undefined;
572
+ autoCloseDelay?: number | undefined;
573
+ }, {
574
+ theme?: "light" | "dark" | "auto" | undefined;
575
+ autoClose?: boolean | undefined;
576
+ popupEnabled?: boolean | undefined;
577
+ autoCloseDelay?: number | undefined;
578
+ }>>;
579
+ }, "strip", z.ZodTypeAny, {
580
+ branding?: {
581
+ primaryColor?: string | undefined;
582
+ logoUrl?: string | undefined;
583
+ companyName?: string | undefined;
584
+ theme?: "light" | "dark" | "auto" | undefined;
585
+ } | undefined;
586
+ terms?: {
587
+ required: boolean;
588
+ version?: string | undefined;
589
+ url?: string | undefined;
590
+ text?: string | undefined;
591
+ } | undefined;
592
+ customFields?: {
593
+ name: string;
594
+ type: "text" | "textarea" | "checkbox" | "select";
595
+ required: boolean;
596
+ label: string;
597
+ options?: {
598
+ value: string;
599
+ label: string;
600
+ }[] | undefined;
601
+ placeholder?: string | undefined;
602
+ pattern?: string | undefined;
603
+ }[] | undefined;
604
+ ui?: {
605
+ theme?: "light" | "dark" | "auto" | undefined;
606
+ autoClose?: boolean | undefined;
607
+ popupEnabled?: boolean | undefined;
608
+ autoCloseDelay?: number | undefined;
609
+ } | undefined;
610
+ }, {
611
+ branding?: {
612
+ primaryColor?: string | undefined;
613
+ logoUrl?: string | undefined;
614
+ companyName?: string | undefined;
615
+ theme?: "light" | "dark" | "auto" | undefined;
616
+ } | undefined;
617
+ terms?: {
618
+ version?: string | undefined;
619
+ url?: string | undefined;
620
+ text?: string | undefined;
621
+ required?: boolean | undefined;
622
+ } | undefined;
623
+ customFields?: {
624
+ name: string;
625
+ type: "text" | "textarea" | "checkbox" | "select";
626
+ required: boolean;
627
+ label: string;
628
+ options?: {
629
+ value: string;
630
+ label: string;
631
+ }[] | undefined;
632
+ placeholder?: string | undefined;
633
+ pattern?: string | undefined;
634
+ }[] | undefined;
635
+ ui?: {
636
+ theme?: "light" | "dark" | "auto" | undefined;
637
+ autoClose?: boolean | undefined;
638
+ popupEnabled?: boolean | undefined;
639
+ autoCloseDelay?: number | undefined;
640
+ } | undefined;
641
+ }>;
642
+ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
643
+ /**
644
+ * Validation Helpers
645
+ */
646
+ /**
647
+ * Validate a consent page config
648
+ *
649
+ * @param config - The config to validate
650
+ * @returns Validation result
651
+ */
652
+ export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
653
+ agentDid: string;
654
+ sessionId: string;
655
+ tool: string;
656
+ toolDescription: string;
657
+ scopes: string[];
658
+ projectId: string;
659
+ serverUrl: string;
660
+ branding?: {
661
+ primaryColor?: string | undefined;
662
+ logoUrl?: string | undefined;
663
+ companyName?: string | undefined;
664
+ theme?: "light" | "dark" | "auto" | undefined;
665
+ } | undefined;
666
+ terms?: {
667
+ version?: string | undefined;
668
+ url?: string | undefined;
669
+ text?: string | undefined;
670
+ required?: boolean | undefined;
671
+ } | undefined;
672
+ customFields?: {
673
+ name: string;
674
+ type: "text" | "textarea" | "checkbox" | "select";
675
+ required: boolean;
676
+ label: string;
677
+ options?: {
678
+ value: string;
679
+ label: string;
680
+ }[] | undefined;
681
+ placeholder?: string | undefined;
682
+ pattern?: string | undefined;
683
+ }[] | undefined;
684
+ autoClose?: boolean | undefined;
685
+ }, {
686
+ agentDid: string;
687
+ sessionId: string;
688
+ tool: string;
689
+ toolDescription: string;
690
+ scopes: string[];
691
+ projectId: string;
692
+ serverUrl: string;
693
+ branding?: {
694
+ primaryColor?: string | undefined;
695
+ logoUrl?: string | undefined;
696
+ companyName?: string | undefined;
697
+ theme?: "light" | "dark" | "auto" | undefined;
698
+ } | undefined;
699
+ terms?: {
700
+ required: boolean;
701
+ version?: string | undefined;
702
+ url?: string | undefined;
703
+ text?: string | undefined;
704
+ } | undefined;
705
+ customFields?: {
706
+ name: string;
707
+ type: "text" | "textarea" | "checkbox" | "select";
708
+ required: boolean;
709
+ label: string;
710
+ options?: {
711
+ value: string;
712
+ label: string;
713
+ }[] | undefined;
714
+ placeholder?: string | undefined;
715
+ pattern?: string | undefined;
716
+ }[] | undefined;
717
+ autoClose?: boolean | undefined;
718
+ }>;
719
+ /**
720
+ * Validate a consent approval request
721
+ *
722
+ * @param request - The request to validate
723
+ * @returns Validation result
724
+ */
725
+ export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
726
+ tool: string;
727
+ scopes: string[];
728
+ agent_did: string;
729
+ session_id: string;
730
+ project_id: string;
731
+ termsAccepted: boolean;
732
+ customFields?: Record<string, string | boolean> | undefined;
733
+ termsVersion?: string | undefined;
734
+ oauth_identity?: {
735
+ provider: string;
736
+ subject: string;
737
+ name?: string | undefined;
738
+ email?: string | undefined;
739
+ } | undefined;
740
+ user_did?: string | undefined;
741
+ }, {
742
+ tool: string;
743
+ scopes: string[];
744
+ agent_did: string;
745
+ session_id: string;
746
+ project_id: string;
747
+ termsAccepted: boolean;
748
+ customFields?: Record<string, string | boolean> | undefined;
749
+ termsVersion?: string | undefined;
750
+ oauth_identity?: {
751
+ provider: string;
752
+ subject: string;
753
+ name?: string | undefined;
754
+ email?: string | undefined;
755
+ } | undefined;
756
+ user_did?: string | undefined;
757
+ }>;
758
+ /**
759
+ * Validate a consent approval response
760
+ *
761
+ * @param response - The response to validate
762
+ * @returns Validation result
763
+ */
764
+ export declare function validateConsentApprovalResponse(response: unknown): z.SafeParseReturnType<{
765
+ success: boolean;
766
+ delegation_id?: string | undefined;
767
+ delegation_token?: string | undefined;
768
+ error?: string | undefined;
769
+ error_code?: string | undefined;
770
+ }, {
771
+ success: boolean;
772
+ delegation_id?: string | undefined;
773
+ delegation_token?: string | undefined;
774
+ error?: string | undefined;
775
+ error_code?: string | undefined;
776
+ }>;
777
+ /**
778
+ * Validate a consent config
779
+ *
780
+ * @param config - The config to validate
781
+ * @returns Validation result
782
+ */
783
+ export declare function validateConsentConfig(config: unknown): z.SafeParseReturnType<{
784
+ branding?: {
785
+ primaryColor?: string | undefined;
786
+ logoUrl?: string | undefined;
787
+ companyName?: string | undefined;
788
+ theme?: "light" | "dark" | "auto" | undefined;
789
+ } | undefined;
790
+ terms?: {
791
+ version?: string | undefined;
792
+ url?: string | undefined;
793
+ text?: string | undefined;
794
+ required?: boolean | undefined;
795
+ } | undefined;
796
+ customFields?: {
797
+ name: string;
798
+ type: "text" | "textarea" | "checkbox" | "select";
799
+ required: boolean;
800
+ label: string;
801
+ options?: {
802
+ value: string;
803
+ label: string;
804
+ }[] | undefined;
805
+ placeholder?: string | undefined;
806
+ pattern?: string | undefined;
807
+ }[] | undefined;
808
+ ui?: {
809
+ theme?: "light" | "dark" | "auto" | undefined;
810
+ autoClose?: boolean | undefined;
811
+ popupEnabled?: boolean | undefined;
812
+ autoCloseDelay?: number | undefined;
813
+ } | undefined;
814
+ }, {
815
+ branding?: {
816
+ primaryColor?: string | undefined;
817
+ logoUrl?: string | undefined;
818
+ companyName?: string | undefined;
819
+ theme?: "light" | "dark" | "auto" | undefined;
820
+ } | undefined;
821
+ terms?: {
822
+ required: boolean;
823
+ version?: string | undefined;
824
+ url?: string | undefined;
825
+ text?: string | undefined;
826
+ } | undefined;
827
+ customFields?: {
828
+ name: string;
829
+ type: "text" | "textarea" | "checkbox" | "select";
830
+ required: boolean;
831
+ label: string;
832
+ options?: {
833
+ value: string;
834
+ label: string;
835
+ }[] | undefined;
836
+ placeholder?: string | undefined;
837
+ pattern?: string | undefined;
838
+ }[] | undefined;
839
+ ui?: {
840
+ theme?: "light" | "dark" | "auto" | undefined;
841
+ autoClose?: boolean | undefined;
842
+ popupEnabled?: boolean | undefined;
843
+ autoCloseDelay?: number | undefined;
844
+ } | undefined;
845
+ }>;