@kya-os/contracts 1.5.3-canary.2 → 1.5.3-canary.21
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/.turbo/turbo-build.log +17 -0
- package/.turbo/turbo-test$colon$coverage.log +85 -0
- package/.turbo/turbo-test.log +32 -0
- package/coverage/coverage-final.json +38 -0
- package/dist/agentshield-api/admin-schemas.d.ts +2 -2
- package/dist/agentshield-api/index.d.ts +1 -1
- package/dist/agentshield-api/schemas.d.ts +150 -48
- package/dist/agentshield-api/schemas.js +32 -4
- package/dist/agentshield-api/types.d.ts +31 -4
- package/dist/audit/index.d.ts +193 -0
- package/dist/audit/index.js +100 -0
- package/dist/config/identity.d.ts +205 -2
- package/dist/config/identity.js +28 -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 +119 -93
- package/dist/consent/schemas.js +111 -64
- package/dist/dashboard-config/schemas.d.ts +2248 -992
- 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 +490 -14
- 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 +43 -122
- package/schemas/cli/register-output/v1.0.0.json +69 -0
- package/schemas/identity/v1.0.0.json +46 -0
- package/schemas/proof/v1.0.0.json +80 -0
- package/schemas/registry/receipt-v1.0.0.json +60 -0
- package/schemas/verifier/verify-page/v1.0.0.json +94 -0
- package/schemas/well-known/agent/v1.0.0.json +67 -0
- package/schemas/well-known/did/v1.0.0.json +174 -0
- package/scripts/emit-schemas.js +11 -0
- package/src/agentshield-api/admin-schemas.ts +31 -0
- package/src/agentshield-api/admin-types.ts +47 -0
- package/src/agentshield-api/endpoints.ts +60 -0
- package/src/agentshield-api/index.ts +70 -0
- package/src/agentshield-api/schemas.ts +304 -0
- package/src/agentshield-api/types.ts +317 -0
- package/src/audit/index.ts +128 -0
- package/src/cli.ts +156 -0
- package/src/config/base.ts +107 -0
- package/src/config/builder.ts +97 -0
- package/src/config/delegation.ts +232 -0
- package/src/config/identity.ts +252 -0
- package/src/config/index.ts +78 -0
- package/src/config/proofing.ts +138 -0
- package/src/config/tool-context.ts +41 -0
- package/src/config/tool-protection.ts +174 -0
- package/src/consent/index.ts +32 -0
- package/src/consent/schemas.ts +334 -0
- package/src/consent/types.ts +199 -0
- package/src/dashboard-config/default-config.json +86 -0
- package/src/dashboard-config/default-config.ts +266 -0
- package/src/dashboard-config/index.ts +48 -0
- package/src/dashboard-config/schemas.ts +286 -0
- package/src/dashboard-config/types.ts +404 -0
- package/src/delegation/constraints.ts +267 -0
- package/src/delegation/index.ts +8 -0
- package/src/delegation/schemas.ts +595 -0
- package/src/did/index.ts +9 -0
- package/src/did/resolve-contract.ts +255 -0
- package/src/did/schemas.ts +190 -0
- package/src/did/types.ts +224 -0
- package/src/env/constants.ts +70 -0
- package/src/env/index.ts +5 -0
- package/src/handshake.ts +125 -0
- package/src/index.ts +45 -0
- package/src/proof/index.ts +31 -0
- package/src/proof/proof-record.ts +163 -0
- package/src/proof/signing-spec.ts +146 -0
- package/src/proof.ts +99 -0
- package/src/registry.ts +146 -0
- package/src/runtime/errors.ts +153 -0
- package/src/runtime/headers.ts +136 -0
- package/src/runtime/index.ts +6 -0
- package/src/test.ts +143 -0
- package/src/tlkrc/index.ts +5 -0
- package/src/tlkrc/rotation.ts +153 -0
- package/src/tool-protection/index.ts +406 -0
- package/src/utils/validation.ts +93 -0
- package/src/vc/index.ts +8 -0
- package/src/vc/schemas.ts +277 -0
- package/src/vc/statuslist.ts +279 -0
- package/src/verifier/index.ts +2 -0
- package/src/verifier.ts +92 -0
- package/src/well-known/index.ts +237 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Related Spec: MCP-I Phase 0 Implementation Plan
|
|
8
8
|
*/
|
|
9
|
-
import { z } from
|
|
9
|
+
import { z } from "zod";
|
|
10
10
|
/**
|
|
11
11
|
* Consent Branding Schema
|
|
12
12
|
*/
|
|
@@ -37,14 +37,14 @@ export declare const consentTermsSchema: z.ZodObject<{
|
|
|
37
37
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
required: boolean;
|
|
40
|
-
text?: string | undefined;
|
|
41
|
-
url?: string | undefined;
|
|
42
40
|
version?: string | undefined;
|
|
43
|
-
}, {
|
|
44
|
-
text?: string | undefined;
|
|
45
41
|
url?: string | undefined;
|
|
42
|
+
text?: string | undefined;
|
|
43
|
+
}, {
|
|
46
44
|
version?: string | undefined;
|
|
45
|
+
url?: string | undefined;
|
|
47
46
|
required?: boolean | undefined;
|
|
47
|
+
text?: string | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type ConsentTerms = z.infer<typeof consentTermsSchema>;
|
|
50
50
|
/**
|
|
@@ -82,9 +82,9 @@ 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;
|
|
85
86
|
required: boolean;
|
|
86
87
|
label: string;
|
|
87
|
-
name: string;
|
|
88
88
|
options?: {
|
|
89
89
|
value: string;
|
|
90
90
|
label: string;
|
|
@@ -93,9 +93,9 @@ 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;
|
|
96
97
|
required: boolean;
|
|
97
98
|
label: string;
|
|
98
|
-
name: string;
|
|
99
99
|
options?: {
|
|
100
100
|
value: string;
|
|
101
101
|
label: string;
|
|
@@ -104,9 +104,9 @@ 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;
|
|
107
108
|
required: boolean;
|
|
108
109
|
label: string;
|
|
109
|
-
name: string;
|
|
110
110
|
options?: {
|
|
111
111
|
value: string;
|
|
112
112
|
label: string;
|
|
@@ -115,9 +115,9 @@ 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;
|
|
118
119
|
required: boolean;
|
|
119
120
|
label: string;
|
|
120
|
-
name: string;
|
|
121
121
|
options?: {
|
|
122
122
|
value: string;
|
|
123
123
|
label: 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
|
-
provider: string;
|
|
155
154
|
subject: string;
|
|
155
|
+
provider: string;
|
|
156
156
|
name?: string | undefined;
|
|
157
157
|
email?: string | undefined;
|
|
158
158
|
}, {
|
|
159
|
-
provider: string;
|
|
160
159
|
subject: string;
|
|
160
|
+
provider: string;
|
|
161
161
|
name?: string | undefined;
|
|
162
162
|
email?: string | undefined;
|
|
163
163
|
}>;
|
|
@@ -172,6 +172,7 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
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>;
|
|
@@ -195,14 +196,14 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
195
196
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
196
197
|
}, "strip", z.ZodTypeAny, {
|
|
197
198
|
required: boolean;
|
|
198
|
-
text?: string | undefined;
|
|
199
|
-
url?: string | undefined;
|
|
200
199
|
version?: string | undefined;
|
|
201
|
-
}, {
|
|
202
|
-
text?: string | undefined;
|
|
203
200
|
url?: string | undefined;
|
|
201
|
+
text?: string | undefined;
|
|
202
|
+
}, {
|
|
204
203
|
version?: string | undefined;
|
|
204
|
+
url?: string | undefined;
|
|
205
205
|
required?: boolean | undefined;
|
|
206
|
+
text?: string | undefined;
|
|
206
207
|
}>>;
|
|
207
208
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
208
209
|
name: z.ZodString;
|
|
@@ -223,9 +224,9 @@ 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";
|
|
227
|
+
name: string;
|
|
226
228
|
required: boolean;
|
|
227
229
|
label: string;
|
|
228
|
-
name: string;
|
|
229
230
|
options?: {
|
|
230
231
|
value: string;
|
|
231
232
|
label: string;
|
|
@@ -234,9 +235,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
234
235
|
pattern?: string | undefined;
|
|
235
236
|
}, {
|
|
236
237
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
238
|
+
name: string;
|
|
237
239
|
required: boolean;
|
|
238
240
|
label: string;
|
|
239
|
-
name: string;
|
|
240
241
|
options?: {
|
|
241
242
|
value: string;
|
|
242
243
|
label: string;
|
|
@@ -245,9 +246,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
245
246
|
pattern?: string | undefined;
|
|
246
247
|
}>, {
|
|
247
248
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
249
|
+
name: string;
|
|
248
250
|
required: boolean;
|
|
249
251
|
label: string;
|
|
250
|
-
name: string;
|
|
251
252
|
options?: {
|
|
252
253
|
value: string;
|
|
253
254
|
label: string;
|
|
@@ -256,9 +257,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
256
257
|
pattern?: string | undefined;
|
|
257
258
|
}, {
|
|
258
259
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
260
|
+
name: string;
|
|
259
261
|
required: boolean;
|
|
260
262
|
label: string;
|
|
261
|
-
name: string;
|
|
262
263
|
options?: {
|
|
263
264
|
value: string;
|
|
264
265
|
label: 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.ZodString>;
|
|
271
282
|
}, "strip", z.ZodTypeAny, {
|
|
272
|
-
tool: string;
|
|
273
|
-
toolDescription: string;
|
|
274
|
-
scopes: string[];
|
|
275
283
|
agentDid: string;
|
|
276
284
|
sessionId: string;
|
|
285
|
+
tool: string;
|
|
286
|
+
scopes: string[];
|
|
277
287
|
projectId: string;
|
|
288
|
+
toolDescription: string;
|
|
278
289
|
serverUrl: string;
|
|
290
|
+
provider?: string | undefined;
|
|
279
291
|
branding?: {
|
|
280
292
|
primaryColor?: string | undefined;
|
|
281
293
|
logoUrl?: string | undefined;
|
|
@@ -284,15 +296,15 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
284
296
|
} | undefined;
|
|
285
297
|
terms?: {
|
|
286
298
|
required: boolean;
|
|
287
|
-
text?: string | undefined;
|
|
288
|
-
url?: string | undefined;
|
|
289
299
|
version?: string | undefined;
|
|
300
|
+
url?: string | undefined;
|
|
301
|
+
text?: string | undefined;
|
|
290
302
|
} | undefined;
|
|
291
303
|
customFields?: {
|
|
292
304
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
305
|
+
name: string;
|
|
293
306
|
required: boolean;
|
|
294
307
|
label: string;
|
|
295
|
-
name: string;
|
|
296
308
|
options?: {
|
|
297
309
|
value: string;
|
|
298
310
|
label: string;
|
|
@@ -301,14 +313,17 @@ 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
|
-
tool: string;
|
|
306
|
-
toolDescription: string;
|
|
307
|
-
scopes: string[];
|
|
308
319
|
agentDid: string;
|
|
309
320
|
sessionId: string;
|
|
321
|
+
tool: string;
|
|
322
|
+
scopes: string[];
|
|
310
323
|
projectId: string;
|
|
324
|
+
toolDescription: string;
|
|
311
325
|
serverUrl: string;
|
|
326
|
+
provider?: string | undefined;
|
|
312
327
|
branding?: {
|
|
313
328
|
primaryColor?: string | undefined;
|
|
314
329
|
logoUrl?: string | undefined;
|
|
@@ -316,16 +331,16 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
316
331
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
317
332
|
} | undefined;
|
|
318
333
|
terms?: {
|
|
319
|
-
text?: string | undefined;
|
|
320
|
-
url?: string | undefined;
|
|
321
334
|
version?: string | undefined;
|
|
335
|
+
url?: string | undefined;
|
|
322
336
|
required?: boolean | undefined;
|
|
337
|
+
text?: string | undefined;
|
|
323
338
|
} | undefined;
|
|
324
339
|
customFields?: {
|
|
325
340
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
341
|
+
name: string;
|
|
326
342
|
required: boolean;
|
|
327
343
|
label: string;
|
|
328
|
-
name: string;
|
|
329
344
|
options?: {
|
|
330
345
|
value: string;
|
|
331
346
|
label: string;
|
|
@@ -334,6 +349,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
334
349
|
pattern?: string | undefined;
|
|
335
350
|
}[] | undefined;
|
|
336
351
|
autoClose?: boolean | undefined;
|
|
352
|
+
oauthRequired?: boolean | undefined;
|
|
353
|
+
oauthUrl?: string | undefined;
|
|
337
354
|
}>;
|
|
338
355
|
export type ConsentPageConfig = z.infer<typeof consentPageConfigSchema>;
|
|
339
356
|
/**
|
|
@@ -357,8 +374,11 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
357
374
|
/**
|
|
358
375
|
* OAuth provider identity information (optional)
|
|
359
376
|
* Used to link OAuth accounts to persistent User DIDs
|
|
377
|
+
*
|
|
378
|
+
* CRITICAL: Uses .nullish() to accept null, undefined, or OAuthIdentity
|
|
379
|
+
* This matches JSON parsing behavior where missing fields become null
|
|
360
380
|
*/
|
|
361
|
-
oauth_identity: z.ZodOptional<z.ZodObject<{
|
|
381
|
+
oauth_identity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
362
382
|
/**
|
|
363
383
|
* OAuth provider name (e.g., "google", "github", "microsoft")
|
|
364
384
|
*/
|
|
@@ -377,16 +397,16 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
377
397
|
*/
|
|
378
398
|
name: z.ZodOptional<z.ZodString>;
|
|
379
399
|
}, "strip", z.ZodTypeAny, {
|
|
380
|
-
provider: string;
|
|
381
400
|
subject: string;
|
|
401
|
+
provider: string;
|
|
382
402
|
name?: string | undefined;
|
|
383
403
|
email?: string | undefined;
|
|
384
404
|
}, {
|
|
385
|
-
provider: string;
|
|
386
405
|
subject: string;
|
|
406
|
+
provider: string;
|
|
387
407
|
name?: string | undefined;
|
|
388
408
|
email?: string | undefined;
|
|
389
|
-
}
|
|
409
|
+
}>>>;
|
|
390
410
|
/**
|
|
391
411
|
* User DID (optional)
|
|
392
412
|
* If provided, represents the persistent User DID for this user
|
|
@@ -394,36 +414,36 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
394
414
|
*/
|
|
395
415
|
user_did: z.ZodOptional<z.ZodString>;
|
|
396
416
|
}, "strip", z.ZodTypeAny, {
|
|
397
|
-
agent_did: string;
|
|
398
|
-
project_id: string;
|
|
399
417
|
tool: string;
|
|
400
|
-
scopes: string[];
|
|
401
418
|
session_id: string;
|
|
419
|
+
scopes: string[];
|
|
420
|
+
agent_did: string;
|
|
421
|
+
project_id: string;
|
|
402
422
|
termsAccepted: boolean;
|
|
403
423
|
customFields?: Record<string, string | boolean> | undefined;
|
|
404
424
|
termsVersion?: string | undefined;
|
|
405
425
|
oauth_identity?: {
|
|
406
|
-
provider: string;
|
|
407
426
|
subject: string;
|
|
427
|
+
provider: string;
|
|
408
428
|
name?: string | undefined;
|
|
409
429
|
email?: string | undefined;
|
|
410
|
-
} | undefined;
|
|
430
|
+
} | null | undefined;
|
|
411
431
|
user_did?: string | undefined;
|
|
412
432
|
}, {
|
|
413
|
-
agent_did: string;
|
|
414
|
-
project_id: string;
|
|
415
433
|
tool: string;
|
|
416
|
-
scopes: string[];
|
|
417
434
|
session_id: string;
|
|
435
|
+
scopes: string[];
|
|
436
|
+
agent_did: string;
|
|
437
|
+
project_id: string;
|
|
418
438
|
termsAccepted: boolean;
|
|
419
439
|
customFields?: Record<string, string | boolean> | undefined;
|
|
420
440
|
termsVersion?: string | undefined;
|
|
421
441
|
oauth_identity?: {
|
|
422
|
-
provider: string;
|
|
423
442
|
subject: string;
|
|
443
|
+
provider: string;
|
|
424
444
|
name?: string | undefined;
|
|
425
445
|
email?: string | undefined;
|
|
426
|
-
} | undefined;
|
|
446
|
+
} | null | undefined;
|
|
427
447
|
user_did?: string | undefined;
|
|
428
448
|
}>;
|
|
429
449
|
export type ConsentApprovalRequest = z.infer<typeof consentApprovalRequestSchema>;
|
|
@@ -438,27 +458,27 @@ export declare const consentApprovalResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
438
458
|
error_code: z.ZodOptional<z.ZodString>;
|
|
439
459
|
}, "strip", z.ZodTypeAny, {
|
|
440
460
|
success: boolean;
|
|
461
|
+
error?: string | undefined;
|
|
441
462
|
delegation_id?: string | undefined;
|
|
442
463
|
delegation_token?: string | undefined;
|
|
443
|
-
error?: string | undefined;
|
|
444
464
|
error_code?: string | undefined;
|
|
445
465
|
}, {
|
|
446
466
|
success: boolean;
|
|
467
|
+
error?: string | undefined;
|
|
447
468
|
delegation_id?: string | undefined;
|
|
448
469
|
delegation_token?: string | undefined;
|
|
449
|
-
error?: string | undefined;
|
|
450
470
|
error_code?: string | undefined;
|
|
451
471
|
}>, {
|
|
452
472
|
success: boolean;
|
|
473
|
+
error?: string | undefined;
|
|
453
474
|
delegation_id?: string | undefined;
|
|
454
475
|
delegation_token?: string | undefined;
|
|
455
|
-
error?: string | undefined;
|
|
456
476
|
error_code?: string | undefined;
|
|
457
477
|
}, {
|
|
458
478
|
success: boolean;
|
|
479
|
+
error?: string | undefined;
|
|
459
480
|
delegation_id?: string | undefined;
|
|
460
481
|
delegation_token?: string | undefined;
|
|
461
|
-
error?: string | undefined;
|
|
462
482
|
error_code?: string | undefined;
|
|
463
483
|
}>;
|
|
464
484
|
export type ConsentApprovalResponse = z.infer<typeof consentApprovalResponseSchema>;
|
|
@@ -489,14 +509,14 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
489
509
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
490
510
|
}, "strip", z.ZodTypeAny, {
|
|
491
511
|
required: boolean;
|
|
492
|
-
text?: string | undefined;
|
|
493
|
-
url?: string | undefined;
|
|
494
512
|
version?: string | undefined;
|
|
495
|
-
}, {
|
|
496
|
-
text?: string | undefined;
|
|
497
513
|
url?: string | undefined;
|
|
514
|
+
text?: string | undefined;
|
|
515
|
+
}, {
|
|
498
516
|
version?: string | undefined;
|
|
517
|
+
url?: string | undefined;
|
|
499
518
|
required?: boolean | undefined;
|
|
519
|
+
text?: string | undefined;
|
|
500
520
|
}>>;
|
|
501
521
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
502
522
|
name: z.ZodString;
|
|
@@ -517,9 +537,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
517
537
|
pattern: z.ZodOptional<z.ZodString>;
|
|
518
538
|
}, "strip", z.ZodTypeAny, {
|
|
519
539
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
540
|
+
name: string;
|
|
520
541
|
required: boolean;
|
|
521
542
|
label: string;
|
|
522
|
-
name: string;
|
|
523
543
|
options?: {
|
|
524
544
|
value: string;
|
|
525
545
|
label: string;
|
|
@@ -528,9 +548,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
528
548
|
pattern?: string | undefined;
|
|
529
549
|
}, {
|
|
530
550
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
551
|
+
name: string;
|
|
531
552
|
required: boolean;
|
|
532
553
|
label: string;
|
|
533
|
-
name: string;
|
|
534
554
|
options?: {
|
|
535
555
|
value: string;
|
|
536
556
|
label: string;
|
|
@@ -539,9 +559,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
539
559
|
pattern?: string | undefined;
|
|
540
560
|
}>, {
|
|
541
561
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
562
|
+
name: string;
|
|
542
563
|
required: boolean;
|
|
543
564
|
label: string;
|
|
544
|
-
name: string;
|
|
545
565
|
options?: {
|
|
546
566
|
value: string;
|
|
547
567
|
label: string;
|
|
@@ -550,9 +570,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
550
570
|
pattern?: string | undefined;
|
|
551
571
|
}, {
|
|
552
572
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
573
|
+
name: string;
|
|
553
574
|
required: boolean;
|
|
554
575
|
label: string;
|
|
555
|
-
name: string;
|
|
556
576
|
options?: {
|
|
557
577
|
value: string;
|
|
558
578
|
label: string;
|
|
@@ -585,15 +605,15 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
585
605
|
} | undefined;
|
|
586
606
|
terms?: {
|
|
587
607
|
required: boolean;
|
|
588
|
-
text?: string | undefined;
|
|
589
|
-
url?: string | undefined;
|
|
590
608
|
version?: string | undefined;
|
|
609
|
+
url?: string | undefined;
|
|
610
|
+
text?: string | undefined;
|
|
591
611
|
} | undefined;
|
|
592
612
|
customFields?: {
|
|
593
613
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
614
|
+
name: string;
|
|
594
615
|
required: boolean;
|
|
595
616
|
label: string;
|
|
596
|
-
name: string;
|
|
597
617
|
options?: {
|
|
598
618
|
value: string;
|
|
599
619
|
label: string;
|
|
@@ -615,16 +635,16 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
615
635
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
616
636
|
} | undefined;
|
|
617
637
|
terms?: {
|
|
618
|
-
text?: string | undefined;
|
|
619
|
-
url?: string | undefined;
|
|
620
638
|
version?: string | undefined;
|
|
639
|
+
url?: string | undefined;
|
|
621
640
|
required?: boolean | undefined;
|
|
641
|
+
text?: string | undefined;
|
|
622
642
|
} | undefined;
|
|
623
643
|
customFields?: {
|
|
624
644
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
645
|
+
name: string;
|
|
625
646
|
required: boolean;
|
|
626
647
|
label: string;
|
|
627
|
-
name: string;
|
|
628
648
|
options?: {
|
|
629
649
|
value: string;
|
|
630
650
|
label: string;
|
|
@@ -650,13 +670,14 @@ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
|
650
670
|
* @returns Validation result
|
|
651
671
|
*/
|
|
652
672
|
export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
|
|
653
|
-
tool: string;
|
|
654
|
-
toolDescription: string;
|
|
655
|
-
scopes: string[];
|
|
656
673
|
agentDid: string;
|
|
657
674
|
sessionId: string;
|
|
675
|
+
tool: string;
|
|
676
|
+
scopes: string[];
|
|
658
677
|
projectId: string;
|
|
678
|
+
toolDescription: string;
|
|
659
679
|
serverUrl: string;
|
|
680
|
+
provider?: string | undefined;
|
|
660
681
|
branding?: {
|
|
661
682
|
primaryColor?: string | undefined;
|
|
662
683
|
logoUrl?: string | undefined;
|
|
@@ -664,16 +685,16 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
664
685
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
665
686
|
} | undefined;
|
|
666
687
|
terms?: {
|
|
667
|
-
text?: string | undefined;
|
|
668
|
-
url?: string | undefined;
|
|
669
688
|
version?: string | undefined;
|
|
689
|
+
url?: string | undefined;
|
|
670
690
|
required?: boolean | undefined;
|
|
691
|
+
text?: string | undefined;
|
|
671
692
|
} | undefined;
|
|
672
693
|
customFields?: {
|
|
673
694
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
695
|
+
name: string;
|
|
674
696
|
required: boolean;
|
|
675
697
|
label: string;
|
|
676
|
-
name: string;
|
|
677
698
|
options?: {
|
|
678
699
|
value: string;
|
|
679
700
|
label: string;
|
|
@@ -682,14 +703,17 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
682
703
|
pattern?: string | undefined;
|
|
683
704
|
}[] | undefined;
|
|
684
705
|
autoClose?: boolean | undefined;
|
|
706
|
+
oauthRequired?: boolean | undefined;
|
|
707
|
+
oauthUrl?: string | undefined;
|
|
685
708
|
}, {
|
|
686
|
-
tool: string;
|
|
687
|
-
toolDescription: string;
|
|
688
|
-
scopes: string[];
|
|
689
709
|
agentDid: string;
|
|
690
710
|
sessionId: string;
|
|
711
|
+
tool: string;
|
|
712
|
+
scopes: string[];
|
|
691
713
|
projectId: string;
|
|
714
|
+
toolDescription: string;
|
|
692
715
|
serverUrl: string;
|
|
716
|
+
provider?: string | undefined;
|
|
693
717
|
branding?: {
|
|
694
718
|
primaryColor?: string | undefined;
|
|
695
719
|
logoUrl?: string | undefined;
|
|
@@ -698,15 +722,15 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
698
722
|
} | undefined;
|
|
699
723
|
terms?: {
|
|
700
724
|
required: boolean;
|
|
701
|
-
text?: string | undefined;
|
|
702
|
-
url?: string | undefined;
|
|
703
725
|
version?: string | undefined;
|
|
726
|
+
url?: string | undefined;
|
|
727
|
+
text?: string | undefined;
|
|
704
728
|
} | undefined;
|
|
705
729
|
customFields?: {
|
|
706
730
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
731
|
+
name: string;
|
|
707
732
|
required: boolean;
|
|
708
733
|
label: string;
|
|
709
|
-
name: string;
|
|
710
734
|
options?: {
|
|
711
735
|
value: string;
|
|
712
736
|
label: string;
|
|
@@ -715,6 +739,8 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
715
739
|
pattern?: string | undefined;
|
|
716
740
|
}[] | undefined;
|
|
717
741
|
autoClose?: boolean | undefined;
|
|
742
|
+
oauthRequired?: boolean | undefined;
|
|
743
|
+
oauthUrl?: string | undefined;
|
|
718
744
|
}>;
|
|
719
745
|
/**
|
|
720
746
|
* Validate a consent approval request
|
|
@@ -723,36 +749,36 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
723
749
|
* @returns Validation result
|
|
724
750
|
*/
|
|
725
751
|
export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
|
|
726
|
-
agent_did: string;
|
|
727
|
-
project_id: string;
|
|
728
752
|
tool: string;
|
|
729
|
-
scopes: string[];
|
|
730
753
|
session_id: string;
|
|
754
|
+
scopes: string[];
|
|
755
|
+
agent_did: string;
|
|
756
|
+
project_id: string;
|
|
731
757
|
termsAccepted: boolean;
|
|
732
758
|
customFields?: Record<string, string | boolean> | undefined;
|
|
733
759
|
termsVersion?: string | undefined;
|
|
734
760
|
oauth_identity?: {
|
|
735
|
-
provider: string;
|
|
736
761
|
subject: string;
|
|
762
|
+
provider: string;
|
|
737
763
|
name?: string | undefined;
|
|
738
764
|
email?: string | undefined;
|
|
739
|
-
} | undefined;
|
|
765
|
+
} | null | undefined;
|
|
740
766
|
user_did?: string | undefined;
|
|
741
767
|
}, {
|
|
742
|
-
agent_did: string;
|
|
743
|
-
project_id: string;
|
|
744
768
|
tool: string;
|
|
745
|
-
scopes: string[];
|
|
746
769
|
session_id: string;
|
|
770
|
+
scopes: string[];
|
|
771
|
+
agent_did: string;
|
|
772
|
+
project_id: string;
|
|
747
773
|
termsAccepted: boolean;
|
|
748
774
|
customFields?: Record<string, string | boolean> | undefined;
|
|
749
775
|
termsVersion?: string | undefined;
|
|
750
776
|
oauth_identity?: {
|
|
751
|
-
provider: string;
|
|
752
777
|
subject: string;
|
|
778
|
+
provider: string;
|
|
753
779
|
name?: string | undefined;
|
|
754
780
|
email?: string | undefined;
|
|
755
|
-
} | undefined;
|
|
781
|
+
} | null | undefined;
|
|
756
782
|
user_did?: string | undefined;
|
|
757
783
|
}>;
|
|
758
784
|
/**
|
|
@@ -763,15 +789,15 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
|
|
|
763
789
|
*/
|
|
764
790
|
export declare function validateConsentApprovalResponse(response: unknown): z.SafeParseReturnType<{
|
|
765
791
|
success: boolean;
|
|
792
|
+
error?: string | undefined;
|
|
766
793
|
delegation_id?: string | undefined;
|
|
767
794
|
delegation_token?: string | undefined;
|
|
768
|
-
error?: string | undefined;
|
|
769
795
|
error_code?: string | undefined;
|
|
770
796
|
}, {
|
|
771
797
|
success: boolean;
|
|
798
|
+
error?: string | undefined;
|
|
772
799
|
delegation_id?: string | undefined;
|
|
773
800
|
delegation_token?: string | undefined;
|
|
774
|
-
error?: string | undefined;
|
|
775
801
|
error_code?: string | undefined;
|
|
776
802
|
}>;
|
|
777
803
|
/**
|
|
@@ -788,16 +814,16 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
788
814
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
789
815
|
} | undefined;
|
|
790
816
|
terms?: {
|
|
791
|
-
text?: string | undefined;
|
|
792
|
-
url?: string | undefined;
|
|
793
817
|
version?: string | undefined;
|
|
818
|
+
url?: string | undefined;
|
|
794
819
|
required?: boolean | undefined;
|
|
820
|
+
text?: string | undefined;
|
|
795
821
|
} | undefined;
|
|
796
822
|
customFields?: {
|
|
797
823
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
824
|
+
name: string;
|
|
798
825
|
required: boolean;
|
|
799
826
|
label: string;
|
|
800
|
-
name: string;
|
|
801
827
|
options?: {
|
|
802
828
|
value: string;
|
|
803
829
|
label: string;
|
|
@@ -820,15 +846,15 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
820
846
|
} | undefined;
|
|
821
847
|
terms?: {
|
|
822
848
|
required: boolean;
|
|
823
|
-
text?: string | undefined;
|
|
824
|
-
url?: string | undefined;
|
|
825
849
|
version?: string | undefined;
|
|
850
|
+
url?: string | undefined;
|
|
851
|
+
text?: string | undefined;
|
|
826
852
|
} | undefined;
|
|
827
853
|
customFields?: {
|
|
828
854
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
855
|
+
name: string;
|
|
829
856
|
required: boolean;
|
|
830
857
|
label: string;
|
|
831
|
-
name: string;
|
|
832
858
|
options?: {
|
|
833
859
|
value: string;
|
|
834
860
|
label: string;
|