@kya-os/checkpoint-shared 1.3.1 → 1.4.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.
@@ -95,23 +95,15 @@ interface AuthRequiredErrorData {
95
95
  }
96
96
  declare const AuthRequiredErrorDataSchema: z.ZodObject<{
97
97
  error: z.ZodLiteral<"auth_required">;
98
- type: z.ZodEnum<["apikey", "oauth", "credential"]>;
99
- envVarNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
98
+ type: z.ZodEnum<{
99
+ oauth: "oauth";
100
+ credential: "credential";
101
+ apikey: "apikey";
102
+ }>;
103
+ envVarNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
104
  configUrl: z.ZodString;
101
105
  message: z.ZodString;
102
- }, "strip", z.ZodTypeAny, {
103
- error: "auth_required";
104
- message: string;
105
- type: "oauth" | "credential" | "apikey";
106
- configUrl: string;
107
- envVarNames?: string[] | undefined;
108
- }, {
109
- error: "auth_required";
110
- message: string;
111
- type: "oauth" | "credential" | "apikey";
112
- configUrl: string;
113
- envVarNames?: string[] | undefined;
114
- }>;
106
+ }, z.core.$strip>;
115
107
  declare class AuthRequiredError extends Error {
116
108
  readonly type: AuthRequiredErrorData['type'];
117
109
  readonly envVarNames?: string[];
@@ -128,944 +120,253 @@ type LegacyToolProtection = Omit<ToolProtection, 'authorization'> & {
128
120
  oauthProvider?: string;
129
121
  };
130
122
  type ToolProtectionInput = ToolProtection | LegacyToolProtection;
131
- declare const AuthorizationRequirementSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
123
+ declare const AuthorizationRequirementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
132
124
  type: z.ZodLiteral<"oauth">;
133
125
  provider: z.ZodString;
134
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
135
- }, "strip", z.ZodTypeAny, {
136
- type: "oauth";
137
- provider: string;
138
- requiredScopes?: string[] | undefined;
139
- }, {
140
- type: "oauth";
141
- provider: string;
142
- requiredScopes?: string[] | undefined;
143
- }>, z.ZodObject<{
126
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ }, z.core.$strip>, z.ZodObject<{
144
128
  type: z.ZodLiteral<"oauth2">;
145
129
  provider: z.ZodString;
146
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
147
- }, "strip", z.ZodTypeAny, {
148
- type: "oauth2";
149
- provider: string;
150
- requiredScopes?: string[] | undefined;
151
- }, {
152
- type: "oauth2";
153
- provider: string;
154
- requiredScopes?: string[] | undefined;
155
- }>, z.ZodObject<{
130
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
131
+ }, z.core.$strip>, z.ZodObject<{
156
132
  type: z.ZodLiteral<"password">;
157
133
  provider: z.ZodString;
158
- }, "strip", z.ZodTypeAny, {
159
- type: "password";
160
- provider: string;
161
- }, {
162
- type: "password";
163
- provider: string;
164
- }>, z.ZodObject<{
134
+ }, z.core.$strip>, z.ZodObject<{
165
135
  type: z.ZodLiteral<"mdl">;
166
136
  issuer: z.ZodString;
167
137
  credentialType: z.ZodOptional<z.ZodString>;
168
- }, "strip", z.ZodTypeAny, {
169
- type: "mdl";
170
- issuer: string;
171
- credentialType?: string | undefined;
172
- }, {
173
- type: "mdl";
174
- issuer: string;
175
- credentialType?: string | undefined;
176
- }>, z.ZodObject<{
138
+ }, z.core.$strip>, z.ZodObject<{
177
139
  type: z.ZodLiteral<"idv">;
178
140
  provider: z.ZodString;
179
- verificationLevel: z.ZodOptional<z.ZodEnum<["basic", "enhanced", "loa3"]>>;
180
- }, "strip", z.ZodTypeAny, {
181
- type: "idv";
182
- provider: string;
183
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
184
- }, {
185
- type: "idv";
186
- provider: string;
187
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
188
- }>, z.ZodObject<{
141
+ verificationLevel: z.ZodOptional<z.ZodEnum<{
142
+ basic: "basic";
143
+ enhanced: "enhanced";
144
+ loa3: "loa3";
145
+ }>>;
146
+ }, z.core.$strip>, z.ZodObject<{
189
147
  type: z.ZodLiteral<"verifiable_credential">;
190
148
  credentialType: z.ZodString;
191
149
  issuer: z.ZodOptional<z.ZodString>;
192
- }, "strip", z.ZodTypeAny, {
193
- type: "verifiable_credential";
194
- credentialType: string;
195
- issuer?: string | undefined;
196
- }, {
197
- type: "verifiable_credential";
198
- credentialType: string;
199
- issuer?: string | undefined;
200
- }>, z.ZodObject<{
150
+ }, z.core.$strip>, z.ZodObject<{
201
151
  type: z.ZodLiteral<"credential">;
202
152
  credentialType: z.ZodString;
203
153
  issuer: z.ZodOptional<z.ZodString>;
204
- }, "strip", z.ZodTypeAny, {
205
- type: "credential";
206
- credentialType: string;
207
- issuer?: string | undefined;
208
- }, {
209
- type: "credential";
210
- credentialType: string;
211
- issuer?: string | undefined;
212
- }>, z.ZodObject<{
154
+ }, z.core.$strip>, z.ZodObject<{
213
155
  type: z.ZodLiteral<"webauthn">;
214
156
  rpId: z.ZodOptional<z.ZodString>;
215
- userVerification: z.ZodOptional<z.ZodEnum<["required", "preferred", "discouraged"]>>;
216
- }, "strip", z.ZodTypeAny, {
217
- type: "webauthn";
218
- rpId?: string | undefined;
219
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
220
- }, {
221
- type: "webauthn";
222
- rpId?: string | undefined;
223
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
224
- }>, z.ZodObject<{
157
+ userVerification: z.ZodOptional<z.ZodEnum<{
158
+ required: "required";
159
+ preferred: "preferred";
160
+ discouraged: "discouraged";
161
+ }>>;
162
+ }, z.core.$strip>, z.ZodObject<{
225
163
  type: z.ZodLiteral<"siwe">;
226
164
  chainId: z.ZodOptional<z.ZodNumber>;
227
165
  domain: z.ZodOptional<z.ZodString>;
228
- }, "strip", z.ZodTypeAny, {
229
- type: "siwe";
230
- chainId?: number | undefined;
231
- domain?: string | undefined;
232
- }, {
233
- type: "siwe";
234
- chainId?: number | undefined;
235
- domain?: string | undefined;
236
- }>, z.ZodObject<{
166
+ }, z.core.$strip>, z.ZodObject<{
237
167
  type: z.ZodLiteral<"apikey">;
238
- envVarNames: z.ZodArray<z.ZodString, "many">;
168
+ envVarNames: z.ZodArray<z.ZodString>;
239
169
  headerMapping: z.ZodRecord<z.ZodString, z.ZodString>;
240
- }, "strip", z.ZodTypeAny, {
241
- type: "apikey";
242
- envVarNames: string[];
243
- headerMapping: Record<string, string>;
244
- }, {
245
- type: "apikey";
246
- envVarNames: string[];
247
- headerMapping: Record<string, string>;
248
- }>, z.ZodObject<{
170
+ }, z.core.$strip>, z.ZodObject<{
249
171
  type: z.ZodLiteral<"none">;
250
- }, "strip", z.ZodTypeAny, {
251
- type: "none";
252
- }, {
253
- type: "none";
254
- }>]>;
172
+ }, z.core.$strip>], "type">;
255
173
  declare const ToolProtectionSchema: z.ZodObject<{
256
174
  requiresDelegation: z.ZodBoolean;
257
- requiredScopes: z.ZodArray<z.ZodString, "many">;
258
- riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
175
+ requiredScopes: z.ZodArray<z.ZodString>;
176
+ riskLevel: z.ZodOptional<z.ZodEnum<{
177
+ low: "low";
178
+ medium: "medium";
179
+ high: "high";
180
+ critical: "critical";
181
+ }>>;
259
182
  oauthProvider: z.ZodOptional<z.ZodString>;
260
- authorization: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
183
+ authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
261
184
  type: z.ZodLiteral<"oauth">;
262
185
  provider: z.ZodString;
263
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
264
- }, "strip", z.ZodTypeAny, {
265
- type: "oauth";
266
- provider: string;
267
- requiredScopes?: string[] | undefined;
268
- }, {
269
- type: "oauth";
270
- provider: string;
271
- requiredScopes?: string[] | undefined;
272
- }>, z.ZodObject<{
186
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
+ }, z.core.$strip>, z.ZodObject<{
273
188
  type: z.ZodLiteral<"oauth2">;
274
189
  provider: z.ZodString;
275
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
276
- }, "strip", z.ZodTypeAny, {
277
- type: "oauth2";
278
- provider: string;
279
- requiredScopes?: string[] | undefined;
280
- }, {
281
- type: "oauth2";
282
- provider: string;
283
- requiredScopes?: string[] | undefined;
284
- }>, z.ZodObject<{
190
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ }, z.core.$strip>, z.ZodObject<{
285
192
  type: z.ZodLiteral<"password">;
286
193
  provider: z.ZodString;
287
- }, "strip", z.ZodTypeAny, {
288
- type: "password";
289
- provider: string;
290
- }, {
291
- type: "password";
292
- provider: string;
293
- }>, z.ZodObject<{
194
+ }, z.core.$strip>, z.ZodObject<{
294
195
  type: z.ZodLiteral<"mdl">;
295
196
  issuer: z.ZodString;
296
197
  credentialType: z.ZodOptional<z.ZodString>;
297
- }, "strip", z.ZodTypeAny, {
298
- type: "mdl";
299
- issuer: string;
300
- credentialType?: string | undefined;
301
- }, {
302
- type: "mdl";
303
- issuer: string;
304
- credentialType?: string | undefined;
305
- }>, z.ZodObject<{
198
+ }, z.core.$strip>, z.ZodObject<{
306
199
  type: z.ZodLiteral<"idv">;
307
200
  provider: z.ZodString;
308
- verificationLevel: z.ZodOptional<z.ZodEnum<["basic", "enhanced", "loa3"]>>;
309
- }, "strip", z.ZodTypeAny, {
310
- type: "idv";
311
- provider: string;
312
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
313
- }, {
314
- type: "idv";
315
- provider: string;
316
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
317
- }>, z.ZodObject<{
201
+ verificationLevel: z.ZodOptional<z.ZodEnum<{
202
+ basic: "basic";
203
+ enhanced: "enhanced";
204
+ loa3: "loa3";
205
+ }>>;
206
+ }, z.core.$strip>, z.ZodObject<{
318
207
  type: z.ZodLiteral<"verifiable_credential">;
319
208
  credentialType: z.ZodString;
320
209
  issuer: z.ZodOptional<z.ZodString>;
321
- }, "strip", z.ZodTypeAny, {
322
- type: "verifiable_credential";
323
- credentialType: string;
324
- issuer?: string | undefined;
325
- }, {
326
- type: "verifiable_credential";
327
- credentialType: string;
328
- issuer?: string | undefined;
329
- }>, z.ZodObject<{
210
+ }, z.core.$strip>, z.ZodObject<{
330
211
  type: z.ZodLiteral<"credential">;
331
212
  credentialType: z.ZodString;
332
213
  issuer: z.ZodOptional<z.ZodString>;
333
- }, "strip", z.ZodTypeAny, {
334
- type: "credential";
335
- credentialType: string;
336
- issuer?: string | undefined;
337
- }, {
338
- type: "credential";
339
- credentialType: string;
340
- issuer?: string | undefined;
341
- }>, z.ZodObject<{
214
+ }, z.core.$strip>, z.ZodObject<{
342
215
  type: z.ZodLiteral<"webauthn">;
343
216
  rpId: z.ZodOptional<z.ZodString>;
344
- userVerification: z.ZodOptional<z.ZodEnum<["required", "preferred", "discouraged"]>>;
345
- }, "strip", z.ZodTypeAny, {
346
- type: "webauthn";
347
- rpId?: string | undefined;
348
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
349
- }, {
350
- type: "webauthn";
351
- rpId?: string | undefined;
352
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
353
- }>, z.ZodObject<{
217
+ userVerification: z.ZodOptional<z.ZodEnum<{
218
+ required: "required";
219
+ preferred: "preferred";
220
+ discouraged: "discouraged";
221
+ }>>;
222
+ }, z.core.$strip>, z.ZodObject<{
354
223
  type: z.ZodLiteral<"siwe">;
355
224
  chainId: z.ZodOptional<z.ZodNumber>;
356
225
  domain: z.ZodOptional<z.ZodString>;
357
- }, "strip", z.ZodTypeAny, {
358
- type: "siwe";
359
- chainId?: number | undefined;
360
- domain?: string | undefined;
361
- }, {
362
- type: "siwe";
363
- chainId?: number | undefined;
364
- domain?: string | undefined;
365
- }>, z.ZodObject<{
226
+ }, z.core.$strip>, z.ZodObject<{
366
227
  type: z.ZodLiteral<"apikey">;
367
- envVarNames: z.ZodArray<z.ZodString, "many">;
228
+ envVarNames: z.ZodArray<z.ZodString>;
368
229
  headerMapping: z.ZodRecord<z.ZodString, z.ZodString>;
369
- }, "strip", z.ZodTypeAny, {
370
- type: "apikey";
371
- envVarNames: string[];
372
- headerMapping: Record<string, string>;
373
- }, {
374
- type: "apikey";
375
- envVarNames: string[];
376
- headerMapping: Record<string, string>;
377
- }>, z.ZodObject<{
230
+ }, z.core.$strip>, z.ZodObject<{
378
231
  type: z.ZodLiteral<"none">;
379
- }, "strip", z.ZodTypeAny, {
380
- type: "none";
381
- }, {
382
- type: "none";
383
- }>]>>;
384
- }, "strip", z.ZodTypeAny, {
385
- requiresDelegation: boolean;
386
- requiredScopes: string[];
387
- authorization?: {
388
- type: "oauth";
389
- provider: string;
390
- requiredScopes?: string[] | undefined;
391
- } | {
392
- type: "oauth2";
393
- provider: string;
394
- requiredScopes?: string[] | undefined;
395
- } | {
396
- type: "password";
397
- provider: string;
398
- } | {
399
- type: "mdl";
400
- issuer: string;
401
- credentialType?: string | undefined;
402
- } | {
403
- type: "idv";
404
- provider: string;
405
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
406
- } | {
407
- type: "verifiable_credential";
408
- credentialType: string;
409
- issuer?: string | undefined;
410
- } | {
411
- type: "credential";
412
- credentialType: string;
413
- issuer?: string | undefined;
414
- } | {
415
- type: "webauthn";
416
- rpId?: string | undefined;
417
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
418
- } | {
419
- type: "siwe";
420
- chainId?: number | undefined;
421
- domain?: string | undefined;
422
- } | {
423
- type: "apikey";
424
- envVarNames: string[];
425
- headerMapping: Record<string, string>;
426
- } | {
427
- type: "none";
428
- } | undefined;
429
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
430
- oauthProvider?: string | undefined;
431
- }, {
432
- requiresDelegation: boolean;
433
- requiredScopes: string[];
434
- authorization?: {
435
- type: "oauth";
436
- provider: string;
437
- requiredScopes?: string[] | undefined;
438
- } | {
439
- type: "oauth2";
440
- provider: string;
441
- requiredScopes?: string[] | undefined;
442
- } | {
443
- type: "password";
444
- provider: string;
445
- } | {
446
- type: "mdl";
447
- issuer: string;
448
- credentialType?: string | undefined;
449
- } | {
450
- type: "idv";
451
- provider: string;
452
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
453
- } | {
454
- type: "verifiable_credential";
455
- credentialType: string;
456
- issuer?: string | undefined;
457
- } | {
458
- type: "credential";
459
- credentialType: string;
460
- issuer?: string | undefined;
461
- } | {
462
- type: "webauthn";
463
- rpId?: string | undefined;
464
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
465
- } | {
466
- type: "siwe";
467
- chainId?: number | undefined;
468
- domain?: string | undefined;
469
- } | {
470
- type: "apikey";
471
- envVarNames: string[];
472
- headerMapping: Record<string, string>;
473
- } | {
474
- type: "none";
475
- } | undefined;
476
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
477
- oauthProvider?: string | undefined;
478
- }>;
232
+ }, z.core.$strip>], "type">>;
233
+ }, z.core.$strip>;
479
234
  declare const ToolProtectionMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
480
235
  requiresDelegation: z.ZodBoolean;
481
- requiredScopes: z.ZodArray<z.ZodString, "many">;
482
- riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
236
+ requiredScopes: z.ZodArray<z.ZodString>;
237
+ riskLevel: z.ZodOptional<z.ZodEnum<{
238
+ low: "low";
239
+ medium: "medium";
240
+ high: "high";
241
+ critical: "critical";
242
+ }>>;
483
243
  oauthProvider: z.ZodOptional<z.ZodString>;
484
- authorization: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
244
+ authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
485
245
  type: z.ZodLiteral<"oauth">;
486
246
  provider: z.ZodString;
487
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
488
- }, "strip", z.ZodTypeAny, {
489
- type: "oauth";
490
- provider: string;
491
- requiredScopes?: string[] | undefined;
492
- }, {
493
- type: "oauth";
494
- provider: string;
495
- requiredScopes?: string[] | undefined;
496
- }>, z.ZodObject<{
247
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
248
+ }, z.core.$strip>, z.ZodObject<{
497
249
  type: z.ZodLiteral<"oauth2">;
498
250
  provider: z.ZodString;
499
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
500
- }, "strip", z.ZodTypeAny, {
501
- type: "oauth2";
502
- provider: string;
503
- requiredScopes?: string[] | undefined;
504
- }, {
505
- type: "oauth2";
506
- provider: string;
507
- requiredScopes?: string[] | undefined;
508
- }>, z.ZodObject<{
251
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ }, z.core.$strip>, z.ZodObject<{
509
253
  type: z.ZodLiteral<"password">;
510
254
  provider: z.ZodString;
511
- }, "strip", z.ZodTypeAny, {
512
- type: "password";
513
- provider: string;
514
- }, {
515
- type: "password";
516
- provider: string;
517
- }>, z.ZodObject<{
255
+ }, z.core.$strip>, z.ZodObject<{
518
256
  type: z.ZodLiteral<"mdl">;
519
257
  issuer: z.ZodString;
520
258
  credentialType: z.ZodOptional<z.ZodString>;
521
- }, "strip", z.ZodTypeAny, {
522
- type: "mdl";
523
- issuer: string;
524
- credentialType?: string | undefined;
525
- }, {
526
- type: "mdl";
527
- issuer: string;
528
- credentialType?: string | undefined;
529
- }>, z.ZodObject<{
259
+ }, z.core.$strip>, z.ZodObject<{
530
260
  type: z.ZodLiteral<"idv">;
531
261
  provider: z.ZodString;
532
- verificationLevel: z.ZodOptional<z.ZodEnum<["basic", "enhanced", "loa3"]>>;
533
- }, "strip", z.ZodTypeAny, {
534
- type: "idv";
535
- provider: string;
536
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
537
- }, {
538
- type: "idv";
539
- provider: string;
540
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
541
- }>, z.ZodObject<{
262
+ verificationLevel: z.ZodOptional<z.ZodEnum<{
263
+ basic: "basic";
264
+ enhanced: "enhanced";
265
+ loa3: "loa3";
266
+ }>>;
267
+ }, z.core.$strip>, z.ZodObject<{
542
268
  type: z.ZodLiteral<"verifiable_credential">;
543
269
  credentialType: z.ZodString;
544
270
  issuer: z.ZodOptional<z.ZodString>;
545
- }, "strip", z.ZodTypeAny, {
546
- type: "verifiable_credential";
547
- credentialType: string;
548
- issuer?: string | undefined;
549
- }, {
550
- type: "verifiable_credential";
551
- credentialType: string;
552
- issuer?: string | undefined;
553
- }>, z.ZodObject<{
271
+ }, z.core.$strip>, z.ZodObject<{
554
272
  type: z.ZodLiteral<"credential">;
555
273
  credentialType: z.ZodString;
556
274
  issuer: z.ZodOptional<z.ZodString>;
557
- }, "strip", z.ZodTypeAny, {
558
- type: "credential";
559
- credentialType: string;
560
- issuer?: string | undefined;
561
- }, {
562
- type: "credential";
563
- credentialType: string;
564
- issuer?: string | undefined;
565
- }>, z.ZodObject<{
275
+ }, z.core.$strip>, z.ZodObject<{
566
276
  type: z.ZodLiteral<"webauthn">;
567
277
  rpId: z.ZodOptional<z.ZodString>;
568
- userVerification: z.ZodOptional<z.ZodEnum<["required", "preferred", "discouraged"]>>;
569
- }, "strip", z.ZodTypeAny, {
570
- type: "webauthn";
571
- rpId?: string | undefined;
572
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
573
- }, {
574
- type: "webauthn";
575
- rpId?: string | undefined;
576
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
577
- }>, z.ZodObject<{
278
+ userVerification: z.ZodOptional<z.ZodEnum<{
279
+ required: "required";
280
+ preferred: "preferred";
281
+ discouraged: "discouraged";
282
+ }>>;
283
+ }, z.core.$strip>, z.ZodObject<{
578
284
  type: z.ZodLiteral<"siwe">;
579
285
  chainId: z.ZodOptional<z.ZodNumber>;
580
286
  domain: z.ZodOptional<z.ZodString>;
581
- }, "strip", z.ZodTypeAny, {
582
- type: "siwe";
583
- chainId?: number | undefined;
584
- domain?: string | undefined;
585
- }, {
586
- type: "siwe";
587
- chainId?: number | undefined;
588
- domain?: string | undefined;
589
- }>, z.ZodObject<{
287
+ }, z.core.$strip>, z.ZodObject<{
590
288
  type: z.ZodLiteral<"apikey">;
591
- envVarNames: z.ZodArray<z.ZodString, "many">;
289
+ envVarNames: z.ZodArray<z.ZodString>;
592
290
  headerMapping: z.ZodRecord<z.ZodString, z.ZodString>;
593
- }, "strip", z.ZodTypeAny, {
594
- type: "apikey";
595
- envVarNames: string[];
596
- headerMapping: Record<string, string>;
597
- }, {
598
- type: "apikey";
599
- envVarNames: string[];
600
- headerMapping: Record<string, string>;
601
- }>, z.ZodObject<{
291
+ }, z.core.$strip>, z.ZodObject<{
602
292
  type: z.ZodLiteral<"none">;
603
- }, "strip", z.ZodTypeAny, {
604
- type: "none";
605
- }, {
606
- type: "none";
607
- }>]>>;
608
- }, "strip", z.ZodTypeAny, {
609
- requiresDelegation: boolean;
610
- requiredScopes: string[];
611
- authorization?: {
612
- type: "oauth";
613
- provider: string;
614
- requiredScopes?: string[] | undefined;
615
- } | {
616
- type: "oauth2";
617
- provider: string;
618
- requiredScopes?: string[] | undefined;
619
- } | {
620
- type: "password";
621
- provider: string;
622
- } | {
623
- type: "mdl";
624
- issuer: string;
625
- credentialType?: string | undefined;
626
- } | {
627
- type: "idv";
628
- provider: string;
629
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
630
- } | {
631
- type: "verifiable_credential";
632
- credentialType: string;
633
- issuer?: string | undefined;
634
- } | {
635
- type: "credential";
636
- credentialType: string;
637
- issuer?: string | undefined;
638
- } | {
639
- type: "webauthn";
640
- rpId?: string | undefined;
641
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
642
- } | {
643
- type: "siwe";
644
- chainId?: number | undefined;
645
- domain?: string | undefined;
646
- } | {
647
- type: "apikey";
648
- envVarNames: string[];
649
- headerMapping: Record<string, string>;
650
- } | {
651
- type: "none";
652
- } | undefined;
653
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
654
- oauthProvider?: string | undefined;
655
- }, {
656
- requiresDelegation: boolean;
657
- requiredScopes: string[];
658
- authorization?: {
659
- type: "oauth";
660
- provider: string;
661
- requiredScopes?: string[] | undefined;
662
- } | {
663
- type: "oauth2";
664
- provider: string;
665
- requiredScopes?: string[] | undefined;
666
- } | {
667
- type: "password";
668
- provider: string;
669
- } | {
670
- type: "mdl";
671
- issuer: string;
672
- credentialType?: string | undefined;
673
- } | {
674
- type: "idv";
675
- provider: string;
676
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
677
- } | {
678
- type: "verifiable_credential";
679
- credentialType: string;
680
- issuer?: string | undefined;
681
- } | {
682
- type: "credential";
683
- credentialType: string;
684
- issuer?: string | undefined;
685
- } | {
686
- type: "webauthn";
687
- rpId?: string | undefined;
688
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
689
- } | {
690
- type: "siwe";
691
- chainId?: number | undefined;
692
- domain?: string | undefined;
693
- } | {
694
- type: "apikey";
695
- envVarNames: string[];
696
- headerMapping: Record<string, string>;
697
- } | {
698
- type: "none";
699
- } | undefined;
700
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
701
- oauthProvider?: string | undefined;
702
- }>>;
293
+ }, z.core.$strip>], "type">>;
294
+ }, z.core.$strip>>;
703
295
  declare const ToolProtectionResponseSchema: z.ZodObject<{
704
296
  toolProtections: z.ZodRecord<z.ZodString, z.ZodObject<{
705
297
  requiresDelegation: z.ZodBoolean;
706
- requiredScopes: z.ZodArray<z.ZodString, "many">;
707
- riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
298
+ requiredScopes: z.ZodArray<z.ZodString>;
299
+ riskLevel: z.ZodOptional<z.ZodEnum<{
300
+ low: "low";
301
+ medium: "medium";
302
+ high: "high";
303
+ critical: "critical";
304
+ }>>;
708
305
  oauthProvider: z.ZodOptional<z.ZodString>;
709
- authorization: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
306
+ authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
710
307
  type: z.ZodLiteral<"oauth">;
711
308
  provider: z.ZodString;
712
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
713
- }, "strip", z.ZodTypeAny, {
714
- type: "oauth";
715
- provider: string;
716
- requiredScopes?: string[] | undefined;
717
- }, {
718
- type: "oauth";
719
- provider: string;
720
- requiredScopes?: string[] | undefined;
721
- }>, z.ZodObject<{
309
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
310
+ }, z.core.$strip>, z.ZodObject<{
722
311
  type: z.ZodLiteral<"oauth2">;
723
312
  provider: z.ZodString;
724
- requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
725
- }, "strip", z.ZodTypeAny, {
726
- type: "oauth2";
727
- provider: string;
728
- requiredScopes?: string[] | undefined;
729
- }, {
730
- type: "oauth2";
731
- provider: string;
732
- requiredScopes?: string[] | undefined;
733
- }>, z.ZodObject<{
313
+ requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
314
+ }, z.core.$strip>, z.ZodObject<{
734
315
  type: z.ZodLiteral<"password">;
735
316
  provider: z.ZodString;
736
- }, "strip", z.ZodTypeAny, {
737
- type: "password";
738
- provider: string;
739
- }, {
740
- type: "password";
741
- provider: string;
742
- }>, z.ZodObject<{
317
+ }, z.core.$strip>, z.ZodObject<{
743
318
  type: z.ZodLiteral<"mdl">;
744
319
  issuer: z.ZodString;
745
320
  credentialType: z.ZodOptional<z.ZodString>;
746
- }, "strip", z.ZodTypeAny, {
747
- type: "mdl";
748
- issuer: string;
749
- credentialType?: string | undefined;
750
- }, {
751
- type: "mdl";
752
- issuer: string;
753
- credentialType?: string | undefined;
754
- }>, z.ZodObject<{
321
+ }, z.core.$strip>, z.ZodObject<{
755
322
  type: z.ZodLiteral<"idv">;
756
323
  provider: z.ZodString;
757
- verificationLevel: z.ZodOptional<z.ZodEnum<["basic", "enhanced", "loa3"]>>;
758
- }, "strip", z.ZodTypeAny, {
759
- type: "idv";
760
- provider: string;
761
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
762
- }, {
763
- type: "idv";
764
- provider: string;
765
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
766
- }>, z.ZodObject<{
324
+ verificationLevel: z.ZodOptional<z.ZodEnum<{
325
+ basic: "basic";
326
+ enhanced: "enhanced";
327
+ loa3: "loa3";
328
+ }>>;
329
+ }, z.core.$strip>, z.ZodObject<{
767
330
  type: z.ZodLiteral<"verifiable_credential">;
768
331
  credentialType: z.ZodString;
769
332
  issuer: z.ZodOptional<z.ZodString>;
770
- }, "strip", z.ZodTypeAny, {
771
- type: "verifiable_credential";
772
- credentialType: string;
773
- issuer?: string | undefined;
774
- }, {
775
- type: "verifiable_credential";
776
- credentialType: string;
777
- issuer?: string | undefined;
778
- }>, z.ZodObject<{
333
+ }, z.core.$strip>, z.ZodObject<{
779
334
  type: z.ZodLiteral<"credential">;
780
335
  credentialType: z.ZodString;
781
336
  issuer: z.ZodOptional<z.ZodString>;
782
- }, "strip", z.ZodTypeAny, {
783
- type: "credential";
784
- credentialType: string;
785
- issuer?: string | undefined;
786
- }, {
787
- type: "credential";
788
- credentialType: string;
789
- issuer?: string | undefined;
790
- }>, z.ZodObject<{
337
+ }, z.core.$strip>, z.ZodObject<{
791
338
  type: z.ZodLiteral<"webauthn">;
792
339
  rpId: z.ZodOptional<z.ZodString>;
793
- userVerification: z.ZodOptional<z.ZodEnum<["required", "preferred", "discouraged"]>>;
794
- }, "strip", z.ZodTypeAny, {
795
- type: "webauthn";
796
- rpId?: string | undefined;
797
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
798
- }, {
799
- type: "webauthn";
800
- rpId?: string | undefined;
801
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
802
- }>, z.ZodObject<{
340
+ userVerification: z.ZodOptional<z.ZodEnum<{
341
+ required: "required";
342
+ preferred: "preferred";
343
+ discouraged: "discouraged";
344
+ }>>;
345
+ }, z.core.$strip>, z.ZodObject<{
803
346
  type: z.ZodLiteral<"siwe">;
804
347
  chainId: z.ZodOptional<z.ZodNumber>;
805
348
  domain: z.ZodOptional<z.ZodString>;
806
- }, "strip", z.ZodTypeAny, {
807
- type: "siwe";
808
- chainId?: number | undefined;
809
- domain?: string | undefined;
810
- }, {
811
- type: "siwe";
812
- chainId?: number | undefined;
813
- domain?: string | undefined;
814
- }>, z.ZodObject<{
349
+ }, z.core.$strip>, z.ZodObject<{
815
350
  type: z.ZodLiteral<"apikey">;
816
- envVarNames: z.ZodArray<z.ZodString, "many">;
351
+ envVarNames: z.ZodArray<z.ZodString>;
817
352
  headerMapping: z.ZodRecord<z.ZodString, z.ZodString>;
818
- }, "strip", z.ZodTypeAny, {
819
- type: "apikey";
820
- envVarNames: string[];
821
- headerMapping: Record<string, string>;
822
- }, {
823
- type: "apikey";
824
- envVarNames: string[];
825
- headerMapping: Record<string, string>;
826
- }>, z.ZodObject<{
353
+ }, z.core.$strip>, z.ZodObject<{
827
354
  type: z.ZodLiteral<"none">;
828
- }, "strip", z.ZodTypeAny, {
829
- type: "none";
830
- }, {
831
- type: "none";
832
- }>]>>;
833
- }, "strip", z.ZodTypeAny, {
834
- requiresDelegation: boolean;
835
- requiredScopes: string[];
836
- authorization?: {
837
- type: "oauth";
838
- provider: string;
839
- requiredScopes?: string[] | undefined;
840
- } | {
841
- type: "oauth2";
842
- provider: string;
843
- requiredScopes?: string[] | undefined;
844
- } | {
845
- type: "password";
846
- provider: string;
847
- } | {
848
- type: "mdl";
849
- issuer: string;
850
- credentialType?: string | undefined;
851
- } | {
852
- type: "idv";
853
- provider: string;
854
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
855
- } | {
856
- type: "verifiable_credential";
857
- credentialType: string;
858
- issuer?: string | undefined;
859
- } | {
860
- type: "credential";
861
- credentialType: string;
862
- issuer?: string | undefined;
863
- } | {
864
- type: "webauthn";
865
- rpId?: string | undefined;
866
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
867
- } | {
868
- type: "siwe";
869
- chainId?: number | undefined;
870
- domain?: string | undefined;
871
- } | {
872
- type: "apikey";
873
- envVarNames: string[];
874
- headerMapping: Record<string, string>;
875
- } | {
876
- type: "none";
877
- } | undefined;
878
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
879
- oauthProvider?: string | undefined;
880
- }, {
881
- requiresDelegation: boolean;
882
- requiredScopes: string[];
883
- authorization?: {
884
- type: "oauth";
885
- provider: string;
886
- requiredScopes?: string[] | undefined;
887
- } | {
888
- type: "oauth2";
889
- provider: string;
890
- requiredScopes?: string[] | undefined;
891
- } | {
892
- type: "password";
893
- provider: string;
894
- } | {
895
- type: "mdl";
896
- issuer: string;
897
- credentialType?: string | undefined;
898
- } | {
899
- type: "idv";
900
- provider: string;
901
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
902
- } | {
903
- type: "verifiable_credential";
904
- credentialType: string;
905
- issuer?: string | undefined;
906
- } | {
907
- type: "credential";
908
- credentialType: string;
909
- issuer?: string | undefined;
910
- } | {
911
- type: "webauthn";
912
- rpId?: string | undefined;
913
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
914
- } | {
915
- type: "siwe";
916
- chainId?: number | undefined;
917
- domain?: string | undefined;
918
- } | {
919
- type: "apikey";
920
- envVarNames: string[];
921
- headerMapping: Record<string, string>;
922
- } | {
923
- type: "none";
924
- } | undefined;
925
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
926
- oauthProvider?: string | undefined;
927
- }>>;
355
+ }, z.core.$strip>], "type">>;
356
+ }, z.core.$strip>>;
928
357
  metadata: z.ZodOptional<z.ZodObject<{
929
358
  lastUpdated: z.ZodOptional<z.ZodString>;
930
359
  version: z.ZodOptional<z.ZodString>;
931
360
  source: z.ZodOptional<z.ZodString>;
932
- }, "strip", z.ZodTypeAny, {
933
- lastUpdated?: string | undefined;
934
- version?: string | undefined;
935
- source?: string | undefined;
936
- }, {
937
- lastUpdated?: string | undefined;
938
- version?: string | undefined;
939
- source?: string | undefined;
940
- }>>;
941
- }, "strip", z.ZodTypeAny, {
942
- toolProtections: Record<string, {
943
- requiresDelegation: boolean;
944
- requiredScopes: string[];
945
- authorization?: {
946
- type: "oauth";
947
- provider: string;
948
- requiredScopes?: string[] | undefined;
949
- } | {
950
- type: "oauth2";
951
- provider: string;
952
- requiredScopes?: string[] | undefined;
953
- } | {
954
- type: "password";
955
- provider: string;
956
- } | {
957
- type: "mdl";
958
- issuer: string;
959
- credentialType?: string | undefined;
960
- } | {
961
- type: "idv";
962
- provider: string;
963
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
964
- } | {
965
- type: "verifiable_credential";
966
- credentialType: string;
967
- issuer?: string | undefined;
968
- } | {
969
- type: "credential";
970
- credentialType: string;
971
- issuer?: string | undefined;
972
- } | {
973
- type: "webauthn";
974
- rpId?: string | undefined;
975
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
976
- } | {
977
- type: "siwe";
978
- chainId?: number | undefined;
979
- domain?: string | undefined;
980
- } | {
981
- type: "apikey";
982
- envVarNames: string[];
983
- headerMapping: Record<string, string>;
984
- } | {
985
- type: "none";
986
- } | undefined;
987
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
988
- oauthProvider?: string | undefined;
989
- }>;
990
- metadata?: {
991
- lastUpdated?: string | undefined;
992
- version?: string | undefined;
993
- source?: string | undefined;
994
- } | undefined;
995
- }, {
996
- toolProtections: Record<string, {
997
- requiresDelegation: boolean;
998
- requiredScopes: string[];
999
- authorization?: {
1000
- type: "oauth";
1001
- provider: string;
1002
- requiredScopes?: string[] | undefined;
1003
- } | {
1004
- type: "oauth2";
1005
- provider: string;
1006
- requiredScopes?: string[] | undefined;
1007
- } | {
1008
- type: "password";
1009
- provider: string;
1010
- } | {
1011
- type: "mdl";
1012
- issuer: string;
1013
- credentialType?: string | undefined;
1014
- } | {
1015
- type: "idv";
1016
- provider: string;
1017
- verificationLevel?: "basic" | "enhanced" | "loa3" | undefined;
1018
- } | {
1019
- type: "verifiable_credential";
1020
- credentialType: string;
1021
- issuer?: string | undefined;
1022
- } | {
1023
- type: "credential";
1024
- credentialType: string;
1025
- issuer?: string | undefined;
1026
- } | {
1027
- type: "webauthn";
1028
- rpId?: string | undefined;
1029
- userVerification?: "required" | "preferred" | "discouraged" | undefined;
1030
- } | {
1031
- type: "siwe";
1032
- chainId?: number | undefined;
1033
- domain?: string | undefined;
1034
- } | {
1035
- type: "apikey";
1036
- envVarNames: string[];
1037
- headerMapping: Record<string, string>;
1038
- } | {
1039
- type: "none";
1040
- } | undefined;
1041
- riskLevel?: "low" | "medium" | "high" | "critical" | undefined;
1042
- oauthProvider?: string | undefined;
1043
- }>;
1044
- metadata?: {
1045
- lastUpdated?: string | undefined;
1046
- version?: string | undefined;
1047
- source?: string | undefined;
1048
- } | undefined;
1049
- }>;
361
+ }, z.core.$strip>>;
362
+ }, z.core.$strip>;
1050
363
  declare const DelegationRequiredErrorDataSchema: z.ZodObject<{
1051
364
  toolName: z.ZodString;
1052
- requiredScopes: z.ZodArray<z.ZodString, "many">;
365
+ requiredScopes: z.ZodArray<z.ZodString>;
1053
366
  consentUrl: z.ZodOptional<z.ZodString>;
1054
367
  authorizationUrl: z.ZodOptional<z.ZodString>;
1055
368
  reason: z.ZodOptional<z.ZodString>;
1056
- }, "strip", z.ZodTypeAny, {
1057
- requiredScopes: string[];
1058
- toolName: string;
1059
- consentUrl?: string | undefined;
1060
- authorizationUrl?: string | undefined;
1061
- reason?: string | undefined;
1062
- }, {
1063
- requiredScopes: string[];
1064
- toolName: string;
1065
- consentUrl?: string | undefined;
1066
- authorizationUrl?: string | undefined;
1067
- reason?: string | undefined;
1068
- }>;
369
+ }, z.core.$strip>;
1069
370
  declare function isToolProtection(obj: unknown): obj is ToolProtection;
1070
371
  declare function isToolProtectionMap(obj: unknown): obj is ToolProtectionMap;
1071
372
  declare function isToolProtectionResponse(obj: unknown): obj is ToolProtectionResponse;