@kya-os/contracts 1.6.2-canary.0 → 1.6.3-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agentshield-api/admin-schemas.d.ts +2 -2
- package/dist/agentshield-api/endpoints.d.ts +3 -0
- package/dist/agentshield-api/endpoints.js +3 -0
- package/dist/agentshield-api/index.d.ts +2 -2
- package/dist/agentshield-api/index.js +7 -1
- package/dist/agentshield-api/schemas.d.ts +284 -93
- package/dist/agentshield-api/schemas.js +52 -5
- package/dist/agentshield-api/types.d.ts +69 -4
- package/dist/audit/index.d.ts +193 -0
- package/dist/audit/index.js +100 -0
- package/dist/config/identity.d.ts +214 -2
- package/dist/config/identity.js +29 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/tool-context.d.ts +34 -0
- package/dist/config/tool-context.js +13 -0
- package/dist/consent/schemas.d.ts +166 -71
- package/dist/consent/schemas.js +39 -1
- package/dist/dashboard-config/index.d.ts +2 -2
- package/dist/dashboard-config/index.js +4 -1
- package/dist/dashboard-config/schemas.d.ts +6227 -1536
- package/dist/dashboard-config/schemas.js +23 -1
- package/dist/dashboard-config/types.d.ts +28 -1
- package/dist/handshake.d.ts +14 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/tool-protection/index.d.ts +482 -6
- package/dist/tool-protection/index.js +89 -2
- package/dist/verifier/index.d.ts +1 -0
- package/dist/verifier/index.js +18 -0
- package/dist/well-known/index.d.ts +2 -2
- package/package.json +66 -119
|
@@ -38,13 +38,13 @@ export declare const consentTermsSchema: z.ZodObject<{
|
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
required: boolean;
|
|
40
40
|
version?: string | undefined;
|
|
41
|
-
url?: string | undefined;
|
|
42
41
|
text?: string | undefined;
|
|
43
|
-
}, {
|
|
44
|
-
version?: string | undefined;
|
|
45
42
|
url?: string | undefined;
|
|
43
|
+
}, {
|
|
46
44
|
required?: boolean | undefined;
|
|
45
|
+
version?: string | undefined;
|
|
47
46
|
text?: string | undefined;
|
|
47
|
+
url?: string | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type ConsentTerms = z.infer<typeof consentTermsSchema>;
|
|
50
50
|
/**
|
|
@@ -82,8 +82,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
82
82
|
pattern: z.ZodOptional<z.ZodString>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
84
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
85
|
-
name: string;
|
|
86
85
|
required: boolean;
|
|
86
|
+
name: string;
|
|
87
87
|
label: string;
|
|
88
88
|
options?: {
|
|
89
89
|
value: string;
|
|
@@ -93,8 +93,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
93
93
|
pattern?: string | undefined;
|
|
94
94
|
}, {
|
|
95
95
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
96
|
-
name: string;
|
|
97
96
|
required: boolean;
|
|
97
|
+
name: string;
|
|
98
98
|
label: string;
|
|
99
99
|
options?: {
|
|
100
100
|
value: string;
|
|
@@ -104,8 +104,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
104
104
|
pattern?: string | undefined;
|
|
105
105
|
}>, {
|
|
106
106
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
107
|
-
name: string;
|
|
108
107
|
required: boolean;
|
|
108
|
+
name: string;
|
|
109
109
|
label: string;
|
|
110
110
|
options?: {
|
|
111
111
|
value: string;
|
|
@@ -115,8 +115,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
115
115
|
pattern?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
118
|
-
name: string;
|
|
119
118
|
required: boolean;
|
|
119
|
+
name: string;
|
|
120
120
|
label: string;
|
|
121
121
|
options?: {
|
|
122
122
|
value: string;
|
|
@@ -151,13 +151,13 @@ export declare const oauthIdentitySchema: z.ZodObject<{
|
|
|
151
151
|
*/
|
|
152
152
|
name: z.ZodOptional<z.ZodString>;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
subject: string;
|
|
155
154
|
provider: string;
|
|
155
|
+
subject: string;
|
|
156
156
|
name?: string | undefined;
|
|
157
157
|
email?: string | undefined;
|
|
158
158
|
}, {
|
|
159
|
-
subject: string;
|
|
160
159
|
provider: string;
|
|
160
|
+
subject: string;
|
|
161
161
|
name?: string | undefined;
|
|
162
162
|
email?: string | undefined;
|
|
163
163
|
}>;
|
|
@@ -165,13 +165,14 @@ export type OAuthIdentity = z.infer<typeof oauthIdentitySchema>;
|
|
|
165
165
|
/**
|
|
166
166
|
* Consent Page Config Schema
|
|
167
167
|
*/
|
|
168
|
-
export declare const consentPageConfigSchema: z.ZodObject<{
|
|
168
|
+
export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
169
169
|
tool: z.ZodString;
|
|
170
170
|
toolDescription: z.ZodString;
|
|
171
171
|
scopes: z.ZodArray<z.ZodString, "many">;
|
|
172
172
|
agentDid: z.ZodString;
|
|
173
173
|
sessionId: z.ZodString;
|
|
174
174
|
projectId: z.ZodString;
|
|
175
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
175
176
|
branding: z.ZodOptional<z.ZodObject<{
|
|
176
177
|
primaryColor: z.ZodOptional<z.ZodString>;
|
|
177
178
|
logoUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -196,13 +197,13 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
196
197
|
}, "strip", z.ZodTypeAny, {
|
|
197
198
|
required: boolean;
|
|
198
199
|
version?: string | undefined;
|
|
199
|
-
url?: string | undefined;
|
|
200
200
|
text?: string | undefined;
|
|
201
|
-
}, {
|
|
202
|
-
version?: string | undefined;
|
|
203
201
|
url?: string | undefined;
|
|
202
|
+
}, {
|
|
204
203
|
required?: boolean | undefined;
|
|
204
|
+
version?: string | undefined;
|
|
205
205
|
text?: string | undefined;
|
|
206
|
+
url?: string | undefined;
|
|
206
207
|
}>>;
|
|
207
208
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
208
209
|
name: z.ZodString;
|
|
@@ -223,8 +224,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
223
224
|
pattern: z.ZodOptional<z.ZodString>;
|
|
224
225
|
}, "strip", z.ZodTypeAny, {
|
|
225
226
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
226
|
-
name: string;
|
|
227
227
|
required: boolean;
|
|
228
|
+
name: string;
|
|
228
229
|
label: string;
|
|
229
230
|
options?: {
|
|
230
231
|
value: string;
|
|
@@ -234,8 +235,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
234
235
|
pattern?: string | undefined;
|
|
235
236
|
}, {
|
|
236
237
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
237
|
-
name: string;
|
|
238
238
|
required: boolean;
|
|
239
|
+
name: string;
|
|
239
240
|
label: string;
|
|
240
241
|
options?: {
|
|
241
242
|
value: string;
|
|
@@ -245,8 +246,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
245
246
|
pattern?: string | undefined;
|
|
246
247
|
}>, {
|
|
247
248
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
248
|
-
name: string;
|
|
249
249
|
required: boolean;
|
|
250
|
+
name: string;
|
|
250
251
|
label: string;
|
|
251
252
|
options?: {
|
|
252
253
|
value: string;
|
|
@@ -256,8 +257,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
256
257
|
pattern?: string | undefined;
|
|
257
258
|
}, {
|
|
258
259
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
259
|
-
name: string;
|
|
260
260
|
required: boolean;
|
|
261
|
+
name: string;
|
|
261
262
|
label: string;
|
|
262
263
|
options?: {
|
|
263
264
|
value: string;
|
|
@@ -268,14 +269,25 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
268
269
|
}>, "many">>;
|
|
269
270
|
serverUrl: z.ZodString;
|
|
270
271
|
autoClose: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
/**
|
|
273
|
+
* Whether OAuth authorization is required immediately
|
|
274
|
+
* If true, the consent page will act as a landing page before redirecting
|
|
275
|
+
*/
|
|
276
|
+
oauthRequired: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
/**
|
|
278
|
+
* The OAuth authorization URL to redirect to
|
|
279
|
+
* Required if oauthRequired is true
|
|
280
|
+
*/
|
|
281
|
+
oauthUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
271
282
|
}, "strip", z.ZodTypeAny, {
|
|
272
|
-
|
|
283
|
+
scopes: string[];
|
|
273
284
|
sessionId: string;
|
|
285
|
+
agentDid: string;
|
|
274
286
|
tool: string;
|
|
275
|
-
scopes: string[];
|
|
276
287
|
projectId: string;
|
|
277
|
-
toolDescription: string;
|
|
278
288
|
serverUrl: string;
|
|
289
|
+
toolDescription: string;
|
|
290
|
+
provider?: string | undefined;
|
|
279
291
|
branding?: {
|
|
280
292
|
primaryColor?: string | undefined;
|
|
281
293
|
logoUrl?: string | undefined;
|
|
@@ -285,13 +297,13 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
285
297
|
terms?: {
|
|
286
298
|
required: boolean;
|
|
287
299
|
version?: string | undefined;
|
|
288
|
-
url?: string | undefined;
|
|
289
300
|
text?: string | undefined;
|
|
301
|
+
url?: string | undefined;
|
|
290
302
|
} | undefined;
|
|
291
303
|
customFields?: {
|
|
292
304
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
293
|
-
name: string;
|
|
294
305
|
required: boolean;
|
|
306
|
+
name: string;
|
|
295
307
|
label: string;
|
|
296
308
|
options?: {
|
|
297
309
|
value: string;
|
|
@@ -301,14 +313,53 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
301
313
|
pattern?: string | undefined;
|
|
302
314
|
}[] | undefined;
|
|
303
315
|
autoClose?: boolean | undefined;
|
|
316
|
+
oauthRequired?: boolean | undefined;
|
|
317
|
+
oauthUrl?: string | undefined;
|
|
304
318
|
}, {
|
|
305
|
-
|
|
319
|
+
scopes: string[];
|
|
306
320
|
sessionId: string;
|
|
321
|
+
agentDid: string;
|
|
307
322
|
tool: string;
|
|
308
|
-
scopes: string[];
|
|
309
323
|
projectId: string;
|
|
324
|
+
serverUrl: string;
|
|
310
325
|
toolDescription: string;
|
|
326
|
+
provider?: string | undefined;
|
|
327
|
+
branding?: {
|
|
328
|
+
primaryColor?: string | undefined;
|
|
329
|
+
logoUrl?: string | undefined;
|
|
330
|
+
companyName?: string | undefined;
|
|
331
|
+
theme?: "light" | "dark" | "auto" | undefined;
|
|
332
|
+
} | undefined;
|
|
333
|
+
terms?: {
|
|
334
|
+
required?: boolean | undefined;
|
|
335
|
+
version?: string | undefined;
|
|
336
|
+
text?: string | undefined;
|
|
337
|
+
url?: string | undefined;
|
|
338
|
+
} | undefined;
|
|
339
|
+
customFields?: {
|
|
340
|
+
type: "text" | "textarea" | "checkbox" | "select";
|
|
341
|
+
required: boolean;
|
|
342
|
+
name: string;
|
|
343
|
+
label: string;
|
|
344
|
+
options?: {
|
|
345
|
+
value: string;
|
|
346
|
+
label: string;
|
|
347
|
+
}[] | undefined;
|
|
348
|
+
placeholder?: string | undefined;
|
|
349
|
+
pattern?: string | undefined;
|
|
350
|
+
}[] | undefined;
|
|
351
|
+
autoClose?: boolean | undefined;
|
|
352
|
+
oauthRequired?: boolean | undefined;
|
|
353
|
+
oauthUrl?: string | undefined;
|
|
354
|
+
}>, {
|
|
355
|
+
scopes: string[];
|
|
356
|
+
sessionId: string;
|
|
357
|
+
agentDid: string;
|
|
358
|
+
tool: string;
|
|
359
|
+
projectId: string;
|
|
311
360
|
serverUrl: string;
|
|
361
|
+
toolDescription: string;
|
|
362
|
+
provider?: string | undefined;
|
|
312
363
|
branding?: {
|
|
313
364
|
primaryColor?: string | undefined;
|
|
314
365
|
logoUrl?: string | undefined;
|
|
@@ -316,15 +367,51 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
316
367
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
317
368
|
} | undefined;
|
|
318
369
|
terms?: {
|
|
370
|
+
required: boolean;
|
|
319
371
|
version?: string | undefined;
|
|
372
|
+
text?: string | undefined;
|
|
320
373
|
url?: string | undefined;
|
|
374
|
+
} | undefined;
|
|
375
|
+
customFields?: {
|
|
376
|
+
type: "text" | "textarea" | "checkbox" | "select";
|
|
377
|
+
required: boolean;
|
|
378
|
+
name: string;
|
|
379
|
+
label: string;
|
|
380
|
+
options?: {
|
|
381
|
+
value: string;
|
|
382
|
+
label: string;
|
|
383
|
+
}[] | undefined;
|
|
384
|
+
placeholder?: string | undefined;
|
|
385
|
+
pattern?: string | undefined;
|
|
386
|
+
}[] | undefined;
|
|
387
|
+
autoClose?: boolean | undefined;
|
|
388
|
+
oauthRequired?: boolean | undefined;
|
|
389
|
+
oauthUrl?: string | undefined;
|
|
390
|
+
}, {
|
|
391
|
+
scopes: string[];
|
|
392
|
+
sessionId: string;
|
|
393
|
+
agentDid: string;
|
|
394
|
+
tool: string;
|
|
395
|
+
projectId: string;
|
|
396
|
+
serverUrl: string;
|
|
397
|
+
toolDescription: string;
|
|
398
|
+
provider?: string | undefined;
|
|
399
|
+
branding?: {
|
|
400
|
+
primaryColor?: string | undefined;
|
|
401
|
+
logoUrl?: string | undefined;
|
|
402
|
+
companyName?: string | undefined;
|
|
403
|
+
theme?: "light" | "dark" | "auto" | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
terms?: {
|
|
321
406
|
required?: boolean | undefined;
|
|
407
|
+
version?: string | undefined;
|
|
322
408
|
text?: string | undefined;
|
|
409
|
+
url?: string | undefined;
|
|
323
410
|
} | undefined;
|
|
324
411
|
customFields?: {
|
|
325
412
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
326
|
-
name: string;
|
|
327
413
|
required: boolean;
|
|
414
|
+
name: string;
|
|
328
415
|
label: string;
|
|
329
416
|
options?: {
|
|
330
417
|
value: string;
|
|
@@ -334,6 +421,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
334
421
|
pattern?: string | undefined;
|
|
335
422
|
}[] | undefined;
|
|
336
423
|
autoClose?: boolean | undefined;
|
|
424
|
+
oauthRequired?: boolean | undefined;
|
|
425
|
+
oauthUrl?: string | undefined;
|
|
337
426
|
}>;
|
|
338
427
|
export type ConsentPageConfig = z.infer<typeof consentPageConfigSchema>;
|
|
339
428
|
/**
|
|
@@ -380,13 +469,13 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
380
469
|
*/
|
|
381
470
|
name: z.ZodOptional<z.ZodString>;
|
|
382
471
|
}, "strip", z.ZodTypeAny, {
|
|
383
|
-
subject: string;
|
|
384
472
|
provider: string;
|
|
473
|
+
subject: string;
|
|
385
474
|
name?: string | undefined;
|
|
386
475
|
email?: string | undefined;
|
|
387
476
|
}, {
|
|
388
|
-
subject: string;
|
|
389
477
|
provider: string;
|
|
478
|
+
subject: string;
|
|
390
479
|
name?: string | undefined;
|
|
391
480
|
email?: string | undefined;
|
|
392
481
|
}>>>;
|
|
@@ -397,33 +486,33 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
397
486
|
*/
|
|
398
487
|
user_did: z.ZodOptional<z.ZodString>;
|
|
399
488
|
}, "strip", z.ZodTypeAny, {
|
|
400
|
-
tool: string;
|
|
401
|
-
session_id: string;
|
|
402
489
|
scopes: string[];
|
|
490
|
+
session_id: string;
|
|
491
|
+
tool: string;
|
|
492
|
+
termsAccepted: boolean;
|
|
403
493
|
agent_did: string;
|
|
404
494
|
project_id: string;
|
|
405
|
-
termsAccepted: boolean;
|
|
406
495
|
customFields?: Record<string, string | boolean> | undefined;
|
|
407
496
|
termsVersion?: string | undefined;
|
|
408
497
|
oauth_identity?: {
|
|
409
|
-
subject: string;
|
|
410
498
|
provider: string;
|
|
499
|
+
subject: string;
|
|
411
500
|
name?: string | undefined;
|
|
412
501
|
email?: string | undefined;
|
|
413
502
|
} | null | undefined;
|
|
414
503
|
user_did?: string | undefined;
|
|
415
504
|
}, {
|
|
416
|
-
tool: string;
|
|
417
|
-
session_id: string;
|
|
418
505
|
scopes: string[];
|
|
506
|
+
session_id: string;
|
|
507
|
+
tool: string;
|
|
508
|
+
termsAccepted: boolean;
|
|
419
509
|
agent_did: string;
|
|
420
510
|
project_id: string;
|
|
421
|
-
termsAccepted: boolean;
|
|
422
511
|
customFields?: Record<string, string | boolean> | undefined;
|
|
423
512
|
termsVersion?: string | undefined;
|
|
424
513
|
oauth_identity?: {
|
|
425
|
-
subject: string;
|
|
426
514
|
provider: string;
|
|
515
|
+
subject: string;
|
|
427
516
|
name?: string | undefined;
|
|
428
517
|
email?: string | undefined;
|
|
429
518
|
} | null | undefined;
|
|
@@ -493,13 +582,13 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
493
582
|
}, "strip", z.ZodTypeAny, {
|
|
494
583
|
required: boolean;
|
|
495
584
|
version?: string | undefined;
|
|
496
|
-
url?: string | undefined;
|
|
497
585
|
text?: string | undefined;
|
|
498
|
-
}, {
|
|
499
|
-
version?: string | undefined;
|
|
500
586
|
url?: string | undefined;
|
|
587
|
+
}, {
|
|
501
588
|
required?: boolean | undefined;
|
|
589
|
+
version?: string | undefined;
|
|
502
590
|
text?: string | undefined;
|
|
591
|
+
url?: string | undefined;
|
|
503
592
|
}>>;
|
|
504
593
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
505
594
|
name: z.ZodString;
|
|
@@ -520,8 +609,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
520
609
|
pattern: z.ZodOptional<z.ZodString>;
|
|
521
610
|
}, "strip", z.ZodTypeAny, {
|
|
522
611
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
523
|
-
name: string;
|
|
524
612
|
required: boolean;
|
|
613
|
+
name: string;
|
|
525
614
|
label: string;
|
|
526
615
|
options?: {
|
|
527
616
|
value: string;
|
|
@@ -531,8 +620,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
531
620
|
pattern?: string | undefined;
|
|
532
621
|
}, {
|
|
533
622
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
534
|
-
name: string;
|
|
535
623
|
required: boolean;
|
|
624
|
+
name: string;
|
|
536
625
|
label: string;
|
|
537
626
|
options?: {
|
|
538
627
|
value: string;
|
|
@@ -542,8 +631,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
542
631
|
pattern?: string | undefined;
|
|
543
632
|
}>, {
|
|
544
633
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
545
|
-
name: string;
|
|
546
634
|
required: boolean;
|
|
635
|
+
name: string;
|
|
547
636
|
label: string;
|
|
548
637
|
options?: {
|
|
549
638
|
value: string;
|
|
@@ -553,8 +642,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
553
642
|
pattern?: string | undefined;
|
|
554
643
|
}, {
|
|
555
644
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
556
|
-
name: string;
|
|
557
645
|
required: boolean;
|
|
646
|
+
name: string;
|
|
558
647
|
label: string;
|
|
559
648
|
options?: {
|
|
560
649
|
value: string;
|
|
@@ -589,13 +678,13 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
589
678
|
terms?: {
|
|
590
679
|
required: boolean;
|
|
591
680
|
version?: string | undefined;
|
|
592
|
-
url?: string | undefined;
|
|
593
681
|
text?: string | undefined;
|
|
682
|
+
url?: string | undefined;
|
|
594
683
|
} | undefined;
|
|
595
684
|
customFields?: {
|
|
596
685
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
597
|
-
name: string;
|
|
598
686
|
required: boolean;
|
|
687
|
+
name: string;
|
|
599
688
|
label: string;
|
|
600
689
|
options?: {
|
|
601
690
|
value: string;
|
|
@@ -618,15 +707,15 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
618
707
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
619
708
|
} | undefined;
|
|
620
709
|
terms?: {
|
|
621
|
-
version?: string | undefined;
|
|
622
|
-
url?: string | undefined;
|
|
623
710
|
required?: boolean | undefined;
|
|
711
|
+
version?: string | undefined;
|
|
624
712
|
text?: string | undefined;
|
|
713
|
+
url?: string | undefined;
|
|
625
714
|
} | undefined;
|
|
626
715
|
customFields?: {
|
|
627
716
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
628
|
-
name: string;
|
|
629
717
|
required: boolean;
|
|
718
|
+
name: string;
|
|
630
719
|
label: string;
|
|
631
720
|
options?: {
|
|
632
721
|
value: string;
|
|
@@ -653,13 +742,14 @@ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
|
653
742
|
* @returns Validation result
|
|
654
743
|
*/
|
|
655
744
|
export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
|
|
656
|
-
|
|
745
|
+
scopes: string[];
|
|
657
746
|
sessionId: string;
|
|
747
|
+
agentDid: string;
|
|
658
748
|
tool: string;
|
|
659
|
-
scopes: string[];
|
|
660
749
|
projectId: string;
|
|
661
|
-
toolDescription: string;
|
|
662
750
|
serverUrl: string;
|
|
751
|
+
toolDescription: string;
|
|
752
|
+
provider?: string | undefined;
|
|
663
753
|
branding?: {
|
|
664
754
|
primaryColor?: string | undefined;
|
|
665
755
|
logoUrl?: string | undefined;
|
|
@@ -667,15 +757,15 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
667
757
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
668
758
|
} | undefined;
|
|
669
759
|
terms?: {
|
|
670
|
-
version?: string | undefined;
|
|
671
|
-
url?: string | undefined;
|
|
672
760
|
required?: boolean | undefined;
|
|
761
|
+
version?: string | undefined;
|
|
673
762
|
text?: string | undefined;
|
|
763
|
+
url?: string | undefined;
|
|
674
764
|
} | undefined;
|
|
675
765
|
customFields?: {
|
|
676
766
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
677
|
-
name: string;
|
|
678
767
|
required: boolean;
|
|
768
|
+
name: string;
|
|
679
769
|
label: string;
|
|
680
770
|
options?: {
|
|
681
771
|
value: string;
|
|
@@ -685,14 +775,17 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
685
775
|
pattern?: string | undefined;
|
|
686
776
|
}[] | undefined;
|
|
687
777
|
autoClose?: boolean | undefined;
|
|
778
|
+
oauthRequired?: boolean | undefined;
|
|
779
|
+
oauthUrl?: string | undefined;
|
|
688
780
|
}, {
|
|
689
|
-
|
|
781
|
+
scopes: string[];
|
|
690
782
|
sessionId: string;
|
|
783
|
+
agentDid: string;
|
|
691
784
|
tool: string;
|
|
692
|
-
scopes: string[];
|
|
693
785
|
projectId: string;
|
|
694
|
-
toolDescription: string;
|
|
695
786
|
serverUrl: string;
|
|
787
|
+
toolDescription: string;
|
|
788
|
+
provider?: string | undefined;
|
|
696
789
|
branding?: {
|
|
697
790
|
primaryColor?: string | undefined;
|
|
698
791
|
logoUrl?: string | undefined;
|
|
@@ -702,13 +795,13 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
702
795
|
terms?: {
|
|
703
796
|
required: boolean;
|
|
704
797
|
version?: string | undefined;
|
|
705
|
-
url?: string | undefined;
|
|
706
798
|
text?: string | undefined;
|
|
799
|
+
url?: string | undefined;
|
|
707
800
|
} | undefined;
|
|
708
801
|
customFields?: {
|
|
709
802
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
710
|
-
name: string;
|
|
711
803
|
required: boolean;
|
|
804
|
+
name: string;
|
|
712
805
|
label: string;
|
|
713
806
|
options?: {
|
|
714
807
|
value: string;
|
|
@@ -718,6 +811,8 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
718
811
|
pattern?: string | undefined;
|
|
719
812
|
}[] | undefined;
|
|
720
813
|
autoClose?: boolean | undefined;
|
|
814
|
+
oauthRequired?: boolean | undefined;
|
|
815
|
+
oauthUrl?: string | undefined;
|
|
721
816
|
}>;
|
|
722
817
|
/**
|
|
723
818
|
* Validate a consent approval request
|
|
@@ -726,33 +821,33 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
726
821
|
* @returns Validation result
|
|
727
822
|
*/
|
|
728
823
|
export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
|
|
729
|
-
tool: string;
|
|
730
|
-
session_id: string;
|
|
731
824
|
scopes: string[];
|
|
825
|
+
session_id: string;
|
|
826
|
+
tool: string;
|
|
827
|
+
termsAccepted: boolean;
|
|
732
828
|
agent_did: string;
|
|
733
829
|
project_id: string;
|
|
734
|
-
termsAccepted: boolean;
|
|
735
830
|
customFields?: Record<string, string | boolean> | undefined;
|
|
736
831
|
termsVersion?: string | undefined;
|
|
737
832
|
oauth_identity?: {
|
|
738
|
-
subject: string;
|
|
739
833
|
provider: string;
|
|
834
|
+
subject: string;
|
|
740
835
|
name?: string | undefined;
|
|
741
836
|
email?: string | undefined;
|
|
742
837
|
} | null | undefined;
|
|
743
838
|
user_did?: string | undefined;
|
|
744
839
|
}, {
|
|
745
|
-
tool: string;
|
|
746
|
-
session_id: string;
|
|
747
840
|
scopes: string[];
|
|
841
|
+
session_id: string;
|
|
842
|
+
tool: string;
|
|
843
|
+
termsAccepted: boolean;
|
|
748
844
|
agent_did: string;
|
|
749
845
|
project_id: string;
|
|
750
|
-
termsAccepted: boolean;
|
|
751
846
|
customFields?: Record<string, string | boolean> | undefined;
|
|
752
847
|
termsVersion?: string | undefined;
|
|
753
848
|
oauth_identity?: {
|
|
754
|
-
subject: string;
|
|
755
849
|
provider: string;
|
|
850
|
+
subject: string;
|
|
756
851
|
name?: string | undefined;
|
|
757
852
|
email?: string | undefined;
|
|
758
853
|
} | null | undefined;
|
|
@@ -791,15 +886,15 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
791
886
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
792
887
|
} | undefined;
|
|
793
888
|
terms?: {
|
|
794
|
-
version?: string | undefined;
|
|
795
|
-
url?: string | undefined;
|
|
796
889
|
required?: boolean | undefined;
|
|
890
|
+
version?: string | undefined;
|
|
797
891
|
text?: string | undefined;
|
|
892
|
+
url?: string | undefined;
|
|
798
893
|
} | undefined;
|
|
799
894
|
customFields?: {
|
|
800
895
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
801
|
-
name: string;
|
|
802
896
|
required: boolean;
|
|
897
|
+
name: string;
|
|
803
898
|
label: string;
|
|
804
899
|
options?: {
|
|
805
900
|
value: string;
|
|
@@ -824,13 +919,13 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
824
919
|
terms?: {
|
|
825
920
|
required: boolean;
|
|
826
921
|
version?: string | undefined;
|
|
827
|
-
url?: string | undefined;
|
|
828
922
|
text?: string | undefined;
|
|
923
|
+
url?: string | undefined;
|
|
829
924
|
} | undefined;
|
|
830
925
|
customFields?: {
|
|
831
926
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
832
|
-
name: string;
|
|
833
927
|
required: boolean;
|
|
928
|
+
name: string;
|
|
834
929
|
label: string;
|
|
835
930
|
options?: {
|
|
836
931
|
value: string;
|
package/dist/consent/schemas.js
CHANGED
|
@@ -132,7 +132,8 @@ exports.oauthIdentitySchema = zod_1.z.object({
|
|
|
132
132
|
/**
|
|
133
133
|
* Consent Page Config Schema
|
|
134
134
|
*/
|
|
135
|
-
exports.consentPageConfigSchema = zod_1.z
|
|
135
|
+
exports.consentPageConfigSchema = zod_1.z
|
|
136
|
+
.object({
|
|
136
137
|
tool: zod_1.z.string().min(1, "Tool name is required"),
|
|
137
138
|
toolDescription: zod_1.z
|
|
138
139
|
.string()
|
|
@@ -141,6 +142,7 @@ exports.consentPageConfigSchema = zod_1.z.object({
|
|
|
141
142
|
agentDid: zod_1.z.string().min(1, "Agent DID is required"),
|
|
142
143
|
sessionId: zod_1.z.string().min(1, "Session ID is required"),
|
|
143
144
|
projectId: zod_1.z.string().min(1, "Project ID is required"),
|
|
145
|
+
provider: zod_1.z.string().optional(), // Phase 2: OAuth provider name (e.g., "github", "google")
|
|
144
146
|
branding: exports.consentBrandingSchema.optional(),
|
|
145
147
|
terms: exports.consentTermsSchema.optional(),
|
|
146
148
|
customFields: zod_1.z
|
|
@@ -149,6 +151,42 @@ exports.consentPageConfigSchema = zod_1.z.object({
|
|
|
149
151
|
.optional(),
|
|
150
152
|
serverUrl: zod_1.z.string().url("Server URL must be a valid URL"),
|
|
151
153
|
autoClose: zod_1.z.boolean().optional(),
|
|
154
|
+
/**
|
|
155
|
+
* Whether OAuth authorization is required immediately
|
|
156
|
+
* If true, the consent page will act as a landing page before redirecting
|
|
157
|
+
*/
|
|
158
|
+
oauthRequired: zod_1.z.boolean().optional(),
|
|
159
|
+
/**
|
|
160
|
+
* The OAuth authorization URL to redirect to
|
|
161
|
+
* Required if oauthRequired is true
|
|
162
|
+
*/
|
|
163
|
+
oauthUrl: zod_1.z
|
|
164
|
+
.union([
|
|
165
|
+
zod_1.z.string().url(),
|
|
166
|
+
zod_1.z.literal(""), // Allow empty string to catch it in refine with better error
|
|
167
|
+
])
|
|
168
|
+
.optional(),
|
|
169
|
+
})
|
|
170
|
+
.superRefine((data, ctx) => {
|
|
171
|
+
// If oauthRequired is true, oauthUrl must be provided and non-empty
|
|
172
|
+
if (data.oauthRequired === true) {
|
|
173
|
+
if (data.oauthUrl === undefined || data.oauthUrl === "") {
|
|
174
|
+
ctx.addIssue({
|
|
175
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
176
|
+
message: "oauthUrl is required when oauthRequired is true",
|
|
177
|
+
path: ["oauthUrl"],
|
|
178
|
+
});
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// If oauthUrl is provided (not undefined), it must be a valid URL (not empty)
|
|
183
|
+
if (data.oauthUrl !== undefined && data.oauthUrl === "") {
|
|
184
|
+
ctx.addIssue({
|
|
185
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
186
|
+
message: "oauthUrl must be a valid URL",
|
|
187
|
+
path: ["oauthUrl"],
|
|
188
|
+
});
|
|
189
|
+
}
|
|
152
190
|
});
|
|
153
191
|
/**
|
|
154
192
|
* Consent Approval Request Schema
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @package @kya-os/contracts/dashboard-config
|
|
7
7
|
*/
|
|
8
|
-
export type { MCPIServerConfig, GetServerConfigRequest, GetServerConfigResponse, UpdateServerConfigRequest, UpdateServerConfigResponse, ValidateServerConfigRequest, ValidateServerConfigResponse, } from './types.js';
|
|
9
|
-
export { identityConfigSchema, proofingConfigSchema, delegationConfigSchema, toolProtectionConfigSchema, auditConfigSchema, sessionConfigSchema, platformConfigSchema, cloudflarePlatformConfigSchema, nodePlatformConfigSchema, vercelPlatformConfigSchema, configMetadataSchema, mcpIServerConfigSchema, getServerConfigRequestSchema, getServerConfigResponseSchema, updateServerConfigRequestSchema, updateServerConfigResponseSchema, validateServerConfigRequestSchema, validateServerConfigResponseSchema, } from './schemas.js';
|
|
8
|
+
export type { MCPIServerConfig, MergedMCPIServerConfig, GetServerConfigRequest, GetServerConfigResponse, GetMergedServerConfigResponse, UpdateServerConfigRequest, UpdateServerConfigResponse, ValidateServerConfigRequest, ValidateServerConfigResponse, } from './types.js';
|
|
9
|
+
export { identityConfigSchema, proofingConfigSchema, delegationConfigSchema, toolProtectionConfigSchema, mergedToolProtectionConfigSchema, auditConfigSchema, sessionConfigSchema, platformConfigSchema, cloudflarePlatformConfigSchema, nodePlatformConfigSchema, vercelPlatformConfigSchema, configMetadataSchema, mcpIServerConfigSchema, mergedMcpIServerConfigSchema, getServerConfigRequestSchema, getServerConfigResponseSchema, getMergedServerConfigResponseSchema, updateServerConfigRequestSchema, updateServerConfigResponseSchema, validateServerConfigRequestSchema, validateServerConfigResponseSchema, } from './schemas.js';
|
|
10
10
|
export { defaultConfig, getDefaultConfigForPlatform, mergeWithDefaults, } from './default-config.js';
|