@ai-sdk/gateway 3.0.237 → 3.0.238

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/index.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  import { APICallError } from "@ai-sdk/provider";
10
10
 
11
11
  // src/errors/create-gateway-error.ts
12
- import { z as z3 } from "zod/v4";
12
+ import { z as z4 } from "zod/v4";
13
13
 
14
14
  // src/errors/gateway-error.ts
15
15
  var marker = "vercel.ai.gateway.error";
@@ -271,12 +271,52 @@ var GatewayForbiddenError = class extends (_b8 = GatewayError, _a8 = symbol8, _b
271
271
  }
272
272
  };
273
273
 
274
- // src/errors/gateway-response-error.ts
275
- var name8 = "GatewayResponseError";
274
+ // src/errors/gateway-access-policy-denied-error.ts
275
+ import { z as z3 } from "zod/v4";
276
+ import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
277
+ var name8 = "GatewayAccessPolicyDeniedError";
276
278
  var marker9 = `vercel.ai.gateway.error.${name8}`;
277
279
  var symbol9 = Symbol.for(marker9);
280
+ var accessPolicyDeniedParamSchema = lazySchema3(
281
+ () => zodSchema3(
282
+ z3.object({
283
+ policyIds: z3.optional(z3.array(z3.string())),
284
+ removedModels: z3.optional(z3.array(z3.string())),
285
+ removedProviders: z3.optional(z3.array(z3.string()))
286
+ })
287
+ )
288
+ );
278
289
  var _a9, _b9;
279
- var GatewayResponseError = class extends (_b9 = GatewayError, _a9 = symbol9, _b9) {
290
+ var GatewayAccessPolicyDeniedError = class extends (_b9 = GatewayError, _a9 = symbol9, _b9) {
291
+ constructor({
292
+ message = "Access policy denied",
293
+ statusCode = 403,
294
+ cause,
295
+ generationId,
296
+ policyIds,
297
+ removedModels,
298
+ removedProviders
299
+ } = {}) {
300
+ super({ message, statusCode, cause, generationId });
301
+ this[_a9] = true;
302
+ // used in isInstance
303
+ this.name = name8;
304
+ this.type = "access_policy_denied";
305
+ this.policyIds = policyIds;
306
+ this.removedModels = removedModels;
307
+ this.removedProviders = removedProviders;
308
+ }
309
+ static isInstance(error) {
310
+ return GatewayError.hasMarker(error) && symbol9 in error;
311
+ }
312
+ };
313
+
314
+ // src/errors/gateway-response-error.ts
315
+ var name9 = "GatewayResponseError";
316
+ var marker10 = `vercel.ai.gateway.error.${name9}`;
317
+ var symbol10 = Symbol.for(marker10);
318
+ var _a10, _b10;
319
+ var GatewayResponseError = class extends (_b10 = GatewayError, _a10 = symbol10, _b10) {
280
320
  constructor({
281
321
  message = "Invalid response from Gateway",
282
322
  statusCode = 502,
@@ -287,23 +327,23 @@ var GatewayResponseError = class extends (_b9 = GatewayError, _a9 = symbol9, _b9
287
327
  isRetryable
288
328
  } = {}) {
289
329
  super({ message, statusCode, cause, generationId, isRetryable });
290
- this[_a9] = true;
330
+ this[_a10] = true;
291
331
  // used in isInstance
292
- this.name = name8;
332
+ this.name = name9;
293
333
  this.type = "response_error";
294
334
  this.response = response;
295
335
  this.validationError = validationError;
296
336
  }
297
337
  static isInstance(error) {
298
- return GatewayError.hasMarker(error) && symbol9 in error;
338
+ return GatewayError.hasMarker(error) && symbol10 in error;
299
339
  }
300
340
  };
301
341
 
302
342
  // src/errors/create-gateway-error.ts
303
343
  import {
304
- lazySchema as lazySchema3,
344
+ lazySchema as lazySchema4,
305
345
  safeValidateTypes,
306
- zodSchema as zodSchema3
346
+ zodSchema as zodSchema4
307
347
  } from "@ai-sdk/provider-utils";
308
348
  async function createGatewayErrorFromResponse({
309
349
  response,
@@ -313,7 +353,7 @@ async function createGatewayErrorFromResponse({
313
353
  authMethod,
314
354
  isRetryable
315
355
  }) {
316
- var _a11;
356
+ var _a12;
317
357
  const parseResult = await safeValidateTypes({
318
358
  value: response,
319
359
  schema: gatewayErrorResponseSchema
@@ -333,7 +373,7 @@ async function createGatewayErrorFromResponse({
333
373
  const validatedResponse = parseResult.value;
334
374
  const errorType = validatedResponse.error.type;
335
375
  const message = validatedResponse.error.message;
336
- const generationId = (_a11 = validatedResponse.generationId) != null ? _a11 : void 0;
376
+ const generationId = (_a12 = validatedResponse.generationId) != null ? _a12 : void 0;
337
377
  switch (errorType) {
338
378
  case "authentication_error":
339
379
  return GatewayAuthenticationError.createContextualError({
@@ -397,6 +437,22 @@ async function createGatewayErrorFromResponse({
397
437
  ruleId: ruleResult.success ? ruleResult.value.ruleId : void 0
398
438
  });
399
439
  }
440
+ case "access_policy_denied": {
441
+ const paramResult = await safeValidateTypes({
442
+ value: validatedResponse.error.param,
443
+ schema: accessPolicyDeniedParamSchema
444
+ });
445
+ const param = paramResult.success ? paramResult.value : void 0;
446
+ return new GatewayAccessPolicyDeniedError({
447
+ message,
448
+ statusCode,
449
+ cause,
450
+ generationId,
451
+ policyIds: param == null ? void 0 : param.policyIds,
452
+ removedModels: param == null ? void 0 : param.removedModels,
453
+ removedProviders: param == null ? void 0 : param.removedProviders
454
+ });
455
+ }
400
456
  default:
401
457
  return new GatewayInternalServerError({
402
458
  message,
@@ -406,16 +462,16 @@ async function createGatewayErrorFromResponse({
406
462
  });
407
463
  }
408
464
  }
409
- var gatewayErrorResponseSchema = lazySchema3(
410
- () => zodSchema3(
411
- z3.object({
412
- error: z3.object({
413
- message: z3.string(),
414
- type: z3.string().nullish(),
415
- param: z3.unknown().nullish(),
416
- code: z3.union([z3.string(), z3.number()]).nullish()
465
+ var gatewayErrorResponseSchema = lazySchema4(
466
+ () => zodSchema4(
467
+ z4.object({
468
+ error: z4.object({
469
+ message: z4.string(),
470
+ type: z4.string().nullish(),
471
+ param: z4.unknown().nullish(),
472
+ code: z4.union([z4.string(), z4.number()]).nullish()
417
473
  }),
418
- generationId: z3.string().nullish()
474
+ generationId: z4.string().nullish()
419
475
  })
420
476
  )
421
477
  );
@@ -437,11 +493,11 @@ function extractApiCallResponse(error) {
437
493
  }
438
494
 
439
495
  // src/errors/gateway-timeout-error.ts
440
- var name9 = "GatewayTimeoutError";
441
- var marker10 = `vercel.ai.gateway.error.${name9}`;
442
- var symbol10 = Symbol.for(marker10);
443
- var _a10, _b10;
444
- var GatewayTimeoutError = class _GatewayTimeoutError extends (_b10 = GatewayError, _a10 = symbol10, _b10) {
496
+ var name10 = "GatewayTimeoutError";
497
+ var marker11 = `vercel.ai.gateway.error.${name10}`;
498
+ var symbol11 = Symbol.for(marker11);
499
+ var _a11, _b11;
500
+ var GatewayTimeoutError = class _GatewayTimeoutError extends (_b11 = GatewayError, _a11 = symbol11, _b11) {
445
501
  constructor({
446
502
  message = "Request timed out",
447
503
  statusCode = 408,
@@ -449,13 +505,13 @@ var GatewayTimeoutError = class _GatewayTimeoutError extends (_b10 = GatewayErro
449
505
  generationId
450
506
  } = {}) {
451
507
  super({ message, statusCode, cause, generationId });
452
- this[_a10] = true;
508
+ this[_a11] = true;
453
509
  // used in isInstance
454
- this.name = name9;
510
+ this.name = name10;
455
511
  this.type = "timeout_error";
456
512
  }
457
513
  static isInstance(error) {
458
- return GatewayError.hasMarker(error) && symbol10 in error;
514
+ return GatewayError.hasMarker(error) && symbol11 in error;
459
515
  }
460
516
  /**
461
517
  * Creates a helpful timeout error message with troubleshooting guidance
@@ -495,7 +551,7 @@ function isTimeoutError(error) {
495
551
  return false;
496
552
  }
497
553
  async function asGatewayError(error, authMethod) {
498
- var _a11;
554
+ var _a12;
499
555
  if ((error instanceof Error || typeof DOMException === "function" && error instanceof DOMException) && (error.name === "AbortError" || error.name === "TimeoutError")) {
500
556
  throw error;
501
557
  }
@@ -517,7 +573,7 @@ async function asGatewayError(error, authMethod) {
517
573
  }
518
574
  return await createGatewayErrorFromResponse({
519
575
  response: extractApiCallResponse(error),
520
- statusCode: (_a11 = error.statusCode) != null ? _a11 : 500,
576
+ statusCode: (_a12 = error.statusCode) != null ? _a12 : 500,
521
577
  defaultMessage: "Gateway request failed",
522
578
  cause: error,
523
579
  authMethod,
@@ -534,11 +590,11 @@ async function asGatewayError(error, authMethod) {
534
590
  }
535
591
 
536
592
  // src/errors/parse-auth-method.ts
537
- import { z as z4 } from "zod/v4";
593
+ import { z as z5 } from "zod/v4";
538
594
  import {
539
- lazySchema as lazySchema4,
595
+ lazySchema as lazySchema5,
540
596
  safeValidateTypes as safeValidateTypes2,
541
- zodSchema as zodSchema4
597
+ zodSchema as zodSchema5
542
598
  } from "@ai-sdk/provider-utils";
543
599
  var GATEWAY_AUTH_METHOD_HEADER = "ai-gateway-auth-method";
544
600
  async function parseAuthMethod(headers) {
@@ -548,8 +604,8 @@ async function parseAuthMethod(headers) {
548
604
  });
549
605
  return result.success ? result.value : void 0;
550
606
  }
551
- var gatewayAuthMethodSchema = lazySchema4(
552
- () => zodSchema4(z4.union([z4.literal("api-key"), z4.literal("oidc")]))
607
+ var gatewayAuthMethodSchema = lazySchema5(
608
+ () => zodSchema5(z5.union([z5.literal("api-key"), z5.literal("oidc")]))
553
609
  );
554
610
 
555
611
  // src/gateway-fetch-metadata.ts
@@ -558,11 +614,11 @@ import {
558
614
  createJsonResponseHandler,
559
615
  getErrorMessage,
560
616
  getFromApi,
561
- lazySchema as lazySchema5,
617
+ lazySchema as lazySchema6,
562
618
  resolve,
563
- zodSchema as zodSchema5
619
+ zodSchema as zodSchema6
564
620
  } from "@ai-sdk/provider-utils";
565
- import { z as z5 } from "zod/v4";
621
+ import { z as z6 } from "zod/v4";
566
622
 
567
623
  // src/gateway-model-entry.ts
568
624
  var KNOWN_MODEL_TYPES = [
@@ -589,10 +645,10 @@ var GatewayFetchMetadata = class {
589
645
  gatewayAvailableModelsResponseSchema
590
646
  ),
591
647
  failedResponseHandler: createJsonErrorResponseHandler({
592
- errorSchema: z5.any(),
648
+ errorSchema: z6.any(),
593
649
  errorToMessage: (data) => {
594
- var _a11;
595
- return (_a11 = getErrorMessage(data)) != null ? _a11 : "unknown error";
650
+ var _a12;
651
+ return (_a12 = getErrorMessage(data)) != null ? _a12 : "unknown error";
596
652
  }
597
653
  }),
598
654
  fetch: this.config.fetch
@@ -612,10 +668,10 @@ var GatewayFetchMetadata = class {
612
668
  gatewayCreditsResponseSchema
613
669
  ),
614
670
  failedResponseHandler: createJsonErrorResponseHandler({
615
- errorSchema: z5.any(),
671
+ errorSchema: z6.any(),
616
672
  errorToMessage: (data) => {
617
- var _a11;
618
- return (_a11 = getErrorMessage(data)) != null ? _a11 : "unknown error";
673
+ var _a12;
674
+ return (_a12 = getErrorMessage(data)) != null ? _a12 : "unknown error";
619
675
  }
620
676
  }),
621
677
  fetch: this.config.fetch
@@ -626,19 +682,19 @@ var GatewayFetchMetadata = class {
626
682
  }
627
683
  }
628
684
  };
629
- var gatewayAvailableModelsResponseSchema = lazySchema5(
630
- () => zodSchema5(
631
- z5.object({
632
- models: z5.array(
633
- z5.object({
634
- id: z5.string(),
635
- name: z5.string(),
636
- description: z5.string().nullish(),
637
- pricing: z5.object({
638
- input: z5.string(),
639
- output: z5.string(),
640
- input_cache_read: z5.string().nullish(),
641
- input_cache_write: z5.string().nullish()
685
+ var gatewayAvailableModelsResponseSchema = lazySchema6(
686
+ () => zodSchema6(
687
+ z6.object({
688
+ models: z6.array(
689
+ z6.object({
690
+ id: z6.string(),
691
+ name: z6.string(),
692
+ description: z6.string().nullish(),
693
+ pricing: z6.object({
694
+ input: z6.string(),
695
+ output: z6.string(),
696
+ input_cache_read: z6.string().nullish(),
697
+ input_cache_write: z6.string().nullish()
642
698
  }).transform(
643
699
  ({ input, output, input_cache_read, input_cache_write }) => ({
644
700
  input,
@@ -647,12 +703,12 @@ var gatewayAvailableModelsResponseSchema = lazySchema5(
647
703
  ...input_cache_write ? { cacheCreationInputTokens: input_cache_write } : {}
648
704
  })
649
705
  ).nullish(),
650
- specification: z5.object({
651
- specificationVersion: z5.literal("v3"),
652
- provider: z5.string(),
653
- modelId: z5.string()
706
+ specification: z6.object({
707
+ specificationVersion: z6.literal("v3"),
708
+ provider: z6.string(),
709
+ modelId: z6.string()
654
710
  }),
655
- modelType: z5.string().nullish()
711
+ modelType: z6.string().nullish()
656
712
  })
657
713
  ).transform(
658
714
  (models) => models.filter(
@@ -662,11 +718,11 @@ var gatewayAvailableModelsResponseSchema = lazySchema5(
662
718
  })
663
719
  )
664
720
  );
665
- var gatewayCreditsResponseSchema = lazySchema5(
666
- () => zodSchema5(
667
- z5.object({
668
- balance: z5.string(),
669
- total_used: z5.string()
721
+ var gatewayCreditsResponseSchema = lazySchema6(
722
+ () => zodSchema6(
723
+ z6.object({
724
+ balance: z6.string(),
725
+ total_used: z6.string()
670
726
  }).transform(({ balance, total_used }) => ({
671
727
  balance,
672
728
  totalUsed: total_used
@@ -680,11 +736,11 @@ import {
680
736
  createJsonResponseHandler as createJsonResponseHandler2,
681
737
  getErrorMessage as getErrorMessage2,
682
738
  getFromApi as getFromApi2,
683
- lazySchema as lazySchema6,
739
+ lazySchema as lazySchema7,
684
740
  resolve as resolve2,
685
- zodSchema as zodSchema6
741
+ zodSchema as zodSchema7
686
742
  } from "@ai-sdk/provider-utils";
687
- import { z as z6 } from "zod/v4";
743
+ import { z as z7 } from "zod/v4";
688
744
  var GatewaySpendReport = class {
689
745
  constructor(config) {
690
746
  this.config = config;
@@ -723,10 +779,10 @@ var GatewaySpendReport = class {
723
779
  gatewaySpendReportResponseSchema
724
780
  ),
725
781
  failedResponseHandler: createJsonErrorResponseHandler2({
726
- errorSchema: z6.any(),
782
+ errorSchema: z7.any(),
727
783
  errorToMessage: (data) => {
728
- var _a11;
729
- return (_a11 = getErrorMessage2(data)) != null ? _a11 : "unknown error";
784
+ var _a12;
785
+ return (_a12 = getErrorMessage2(data)) != null ? _a12 : "unknown error";
730
786
  }
731
787
  }),
732
788
  fetch: this.config.fetch
@@ -737,26 +793,26 @@ var GatewaySpendReport = class {
737
793
  }
738
794
  }
739
795
  };
740
- var gatewaySpendReportResponseSchema = lazySchema6(
741
- () => zodSchema6(
742
- z6.object({
743
- results: z6.array(
744
- z6.object({
745
- day: z6.string().optional(),
746
- hour: z6.string().optional(),
747
- user: z6.string().optional(),
748
- model: z6.string().optional(),
749
- tag: z6.string().optional(),
750
- provider: z6.string().optional(),
751
- credential_type: z6.enum(["byok", "system"]).optional(),
752
- total_cost: z6.number(),
753
- market_cost: z6.number().optional(),
754
- input_tokens: z6.number().optional(),
755
- output_tokens: z6.number().optional(),
756
- cached_input_tokens: z6.number().optional(),
757
- cache_creation_input_tokens: z6.number().optional(),
758
- reasoning_tokens: z6.number().optional(),
759
- request_count: z6.number().optional()
796
+ var gatewaySpendReportResponseSchema = lazySchema7(
797
+ () => zodSchema7(
798
+ z7.object({
799
+ results: z7.array(
800
+ z7.object({
801
+ day: z7.string().optional(),
802
+ hour: z7.string().optional(),
803
+ user: z7.string().optional(),
804
+ model: z7.string().optional(),
805
+ tag: z7.string().optional(),
806
+ provider: z7.string().optional(),
807
+ credential_type: z7.enum(["byok", "system"]).optional(),
808
+ total_cost: z7.number(),
809
+ market_cost: z7.number().optional(),
810
+ input_tokens: z7.number().optional(),
811
+ output_tokens: z7.number().optional(),
812
+ cached_input_tokens: z7.number().optional(),
813
+ cache_creation_input_tokens: z7.number().optional(),
814
+ reasoning_tokens: z7.number().optional(),
815
+ request_count: z7.number().optional()
760
816
  }).transform(
761
817
  ({
762
818
  credential_type,
@@ -793,11 +849,11 @@ import {
793
849
  createJsonResponseHandler as createJsonResponseHandler3,
794
850
  getErrorMessage as getErrorMessage3,
795
851
  getFromApi as getFromApi3,
796
- lazySchema as lazySchema7,
852
+ lazySchema as lazySchema8,
797
853
  resolve as resolve3,
798
- zodSchema as zodSchema7
854
+ zodSchema as zodSchema8
799
855
  } from "@ai-sdk/provider-utils";
800
- import { z as z7 } from "zod/v4";
856
+ import { z as z8 } from "zod/v4";
801
857
  var GatewayGenerationInfoFetcher = class {
802
858
  constructor(config) {
803
859
  this.config = config;
@@ -812,10 +868,10 @@ var GatewayGenerationInfoFetcher = class {
812
868
  gatewayGenerationInfoResponseSchema
813
869
  ),
814
870
  failedResponseHandler: createJsonErrorResponseHandler3({
815
- errorSchema: z7.any(),
871
+ errorSchema: z8.any(),
816
872
  errorToMessage: (data) => {
817
- var _a11;
818
- return (_a11 = getErrorMessage3(data)) != null ? _a11 : "unknown error";
873
+ var _a12;
874
+ return (_a12 = getErrorMessage3(data)) != null ? _a12 : "unknown error";
819
875
  }
820
876
  }),
821
877
  fetch: this.config.fetch
@@ -826,28 +882,28 @@ var GatewayGenerationInfoFetcher = class {
826
882
  }
827
883
  }
828
884
  };
829
- var gatewayGenerationInfoResponseSchema = lazySchema7(
830
- () => zodSchema7(
831
- z7.object({
832
- data: z7.object({
833
- id: z7.string(),
834
- total_cost: z7.number(),
835
- upstream_inference_cost: z7.number(),
836
- usage: z7.number(),
837
- created_at: z7.string(),
838
- model: z7.string(),
839
- is_byok: z7.boolean(),
840
- provider_name: z7.string(),
841
- streamed: z7.boolean(),
842
- finish_reason: z7.string(),
843
- latency: z7.number(),
844
- generation_time: z7.number(),
845
- native_tokens_prompt: z7.number(),
846
- native_tokens_completion: z7.number(),
847
- native_tokens_reasoning: z7.number(),
848
- native_tokens_cached: z7.number(),
849
- native_tokens_cache_creation: z7.number(),
850
- billable_web_search_calls: z7.number()
885
+ var gatewayGenerationInfoResponseSchema = lazySchema8(
886
+ () => zodSchema8(
887
+ z8.object({
888
+ data: z8.object({
889
+ id: z8.string(),
890
+ total_cost: z8.number(),
891
+ upstream_inference_cost: z8.number(),
892
+ usage: z8.number(),
893
+ created_at: z8.string(),
894
+ model: z8.string(),
895
+ is_byok: z8.boolean(),
896
+ provider_name: z8.string(),
897
+ streamed: z8.boolean(),
898
+ finish_reason: z8.string(),
899
+ latency: z8.number(),
900
+ generation_time: z8.number(),
901
+ native_tokens_prompt: z8.number(),
902
+ native_tokens_completion: z8.number(),
903
+ native_tokens_reasoning: z8.number(),
904
+ native_tokens_cached: z8.number(),
905
+ native_tokens_cache_creation: z8.number(),
906
+ billable_web_search_calls: z8.number()
851
907
  }).transform(
852
908
  ({
853
909
  total_cost,
@@ -895,7 +951,7 @@ import {
895
951
  postJsonToApi,
896
952
  resolve as resolve4
897
953
  } from "@ai-sdk/provider-utils";
898
- import { z as z8 } from "zod/v4";
954
+ import { z as z9 } from "zod/v4";
899
955
  var GatewayLanguageModel = class {
900
956
  constructor(modelId, config) {
901
957
  this.modelId = modelId;
@@ -914,7 +970,7 @@ var GatewayLanguageModel = class {
914
970
  };
915
971
  }
916
972
  async doGenerate(options) {
917
- var _a11;
973
+ var _a12;
918
974
  const { args, warnings } = await this.getArgs(options);
919
975
  const { abortSignal } = options;
920
976
  const resolvedHeaders = await resolve4(this.config.headers());
@@ -932,12 +988,12 @@ var GatewayLanguageModel = class {
932
988
  await resolve4(this.config.o11yHeaders)
933
989
  ),
934
990
  body: args,
935
- successfulResponseHandler: createJsonResponseHandler4(z8.any()),
991
+ successfulResponseHandler: createJsonResponseHandler4(z9.any()),
936
992
  failedResponseHandler: createJsonErrorResponseHandler4({
937
- errorSchema: z8.any(),
993
+ errorSchema: z9.any(),
938
994
  errorToMessage: (data) => {
939
- var _a12;
940
- return (_a12 = getErrorMessage4(data)) != null ? _a12 : "unknown error";
995
+ var _a13;
996
+ return (_a13 = getErrorMessage4(data)) != null ? _a13 : "unknown error";
941
997
  }
942
998
  }),
943
999
  ...abortSignal && { abortSignal },
@@ -947,7 +1003,7 @@ var GatewayLanguageModel = class {
947
1003
  ...responseBody,
948
1004
  request: { body: args },
949
1005
  response: { headers: responseHeaders, body: rawResponse },
950
- warnings: [...(_a11 = responseBody.warnings) != null ? _a11 : [], ...warnings]
1006
+ warnings: [...(_a12 = responseBody.warnings) != null ? _a12 : [], ...warnings]
951
1007
  };
952
1008
  } catch (error) {
953
1009
  throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders));
@@ -967,12 +1023,12 @@ var GatewayLanguageModel = class {
967
1023
  await resolve4(this.config.o11yHeaders)
968
1024
  ),
969
1025
  body: args,
970
- successfulResponseHandler: createEventSourceResponseHandler(z8.any()),
1026
+ successfulResponseHandler: createEventSourceResponseHandler(z9.any()),
971
1027
  failedResponseHandler: createJsonErrorResponseHandler4({
972
- errorSchema: z8.any(),
1028
+ errorSchema: z9.any(),
973
1029
  errorToMessage: (data) => {
974
- var _a11;
975
- return (_a11 = getErrorMessage4(data)) != null ? _a11 : "unknown error";
1030
+ var _a12;
1031
+ return (_a12 = getErrorMessage4(data)) != null ? _a12 : "unknown error";
976
1032
  }
977
1033
  }),
978
1034
  ...abortSignal && { abortSignal },
@@ -1055,12 +1111,12 @@ import {
1055
1111
  createJsonErrorResponseHandler as createJsonErrorResponseHandler5,
1056
1112
  createJsonResponseHandler as createJsonResponseHandler5,
1057
1113
  getErrorMessage as getErrorMessage5,
1058
- lazySchema as lazySchema8,
1114
+ lazySchema as lazySchema9,
1059
1115
  postJsonToApi as postJsonToApi2,
1060
1116
  resolve as resolve5,
1061
- zodSchema as zodSchema8
1117
+ zodSchema as zodSchema9
1062
1118
  } from "@ai-sdk/provider-utils";
1063
- import { z as z9 } from "zod/v4";
1119
+ import { z as z10 } from "zod/v4";
1064
1120
  var GatewayEmbeddingModel = class {
1065
1121
  constructor(modelId, config) {
1066
1122
  this.modelId = modelId;
@@ -1078,7 +1134,7 @@ var GatewayEmbeddingModel = class {
1078
1134
  abortSignal,
1079
1135
  providerOptions
1080
1136
  }) {
1081
- var _a11, _b11;
1137
+ var _a12, _b12;
1082
1138
  const resolvedHeaders = await resolve5(this.config.headers());
1083
1139
  try {
1084
1140
  const {
@@ -1101,10 +1157,10 @@ var GatewayEmbeddingModel = class {
1101
1157
  gatewayEmbeddingResponseSchema
1102
1158
  ),
1103
1159
  failedResponseHandler: createJsonErrorResponseHandler5({
1104
- errorSchema: z9.any(),
1160
+ errorSchema: z10.any(),
1105
1161
  errorToMessage: (data) => {
1106
- var _a12;
1107
- return (_a12 = getErrorMessage5(data)) != null ? _a12 : "unknown error";
1162
+ var _a13;
1163
+ return (_a13 = getErrorMessage5(data)) != null ? _a13 : "unknown error";
1108
1164
  }
1109
1165
  }),
1110
1166
  ...abortSignal && { abortSignal },
@@ -1112,10 +1168,10 @@ var GatewayEmbeddingModel = class {
1112
1168
  });
1113
1169
  return {
1114
1170
  embeddings: responseBody.embeddings,
1115
- usage: (_a11 = responseBody.usage) != null ? _a11 : void 0,
1171
+ usage: (_a12 = responseBody.usage) != null ? _a12 : void 0,
1116
1172
  providerMetadata: responseBody.providerMetadata,
1117
1173
  response: { headers: responseHeaders, body: rawValue },
1118
- warnings: (_b11 = responseBody.warnings) != null ? _b11 : []
1174
+ warnings: (_b12 = responseBody.warnings) != null ? _b12 : []
1119
1175
  };
1120
1176
  } catch (error) {
1121
1177
  throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders));
@@ -1131,37 +1187,37 @@ var GatewayEmbeddingModel = class {
1131
1187
  };
1132
1188
  }
1133
1189
  };
1134
- var gatewayEmbeddingWarningSchema = () => z9.discriminatedUnion("type", [
1135
- z9.object({
1136
- type: z9.literal("unsupported"),
1137
- feature: z9.string(),
1138
- details: z9.string().optional()
1190
+ var gatewayEmbeddingWarningSchema = () => z10.discriminatedUnion("type", [
1191
+ z10.object({
1192
+ type: z10.literal("unsupported"),
1193
+ feature: z10.string(),
1194
+ details: z10.string().optional()
1139
1195
  }),
1140
- z9.object({
1141
- type: z9.literal("compatibility"),
1142
- feature: z9.string(),
1143
- details: z9.string().optional()
1196
+ z10.object({
1197
+ type: z10.literal("compatibility"),
1198
+ feature: z10.string(),
1199
+ details: z10.string().optional()
1144
1200
  }),
1145
- z9.object({
1146
- type: z9.literal("other"),
1147
- message: z9.string()
1201
+ z10.object({
1202
+ type: z10.literal("other"),
1203
+ message: z10.string()
1148
1204
  })
1149
1205
  ]);
1150
- var gatewayEmbeddingResponseSchema = lazySchema8(
1151
- () => zodSchema8(
1152
- z9.object({
1153
- embeddings: z9.array(z9.array(z9.number())),
1154
- usage: z9.object({ tokens: z9.number() }).nullish(),
1155
- warnings: z9.array(gatewayEmbeddingWarningSchema()).optional(),
1156
- providerMetadata: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())).optional()
1206
+ var gatewayEmbeddingResponseSchema = lazySchema9(
1207
+ () => zodSchema9(
1208
+ z10.object({
1209
+ embeddings: z10.array(z10.array(z10.number())),
1210
+ usage: z10.object({ tokens: z10.number() }).nullish(),
1211
+ warnings: z10.array(gatewayEmbeddingWarningSchema()).optional(),
1212
+ providerMetadata: z10.record(z10.string(), z10.record(z10.string(), z10.unknown())).optional()
1157
1213
  })
1158
1214
  )
1159
1215
  );
1160
1216
 
1161
1217
  // src/gateway-image-model.ts
1162
1218
  import {
1163
- lazySchema as lazySchema9,
1164
- zodSchema as zodSchema9,
1219
+ lazySchema as lazySchema10,
1220
+ zodSchema as zodSchema10,
1165
1221
  combineHeaders as combineHeaders3,
1166
1222
  convertUint8ArrayToBase64,
1167
1223
  createJsonErrorResponseHandler as createJsonErrorResponseHandler6,
@@ -1170,7 +1226,7 @@ import {
1170
1226
  postJsonToApi as postJsonToApi3,
1171
1227
  resolve as resolve6
1172
1228
  } from "@ai-sdk/provider-utils";
1173
- import { z as z10 } from "zod/v4";
1229
+ import { z as z11 } from "zod/v4";
1174
1230
 
1175
1231
  // src/map-gateway-warnings.ts
1176
1232
  function mapGatewayWarnings(warnings) {
@@ -1203,7 +1259,7 @@ var GatewayImageModel = class {
1203
1259
  headers,
1204
1260
  abortSignal
1205
1261
  }) {
1206
- var _a11, _b11, _c;
1262
+ var _a12, _b12, _c;
1207
1263
  const resolvedHeaders = await resolve6(this.config.headers());
1208
1264
  try {
1209
1265
  const {
@@ -1234,10 +1290,10 @@ var GatewayImageModel = class {
1234
1290
  gatewayImageResponseSchema
1235
1291
  ),
1236
1292
  failedResponseHandler: createJsonErrorResponseHandler6({
1237
- errorSchema: z10.any(),
1293
+ errorSchema: z11.any(),
1238
1294
  errorToMessage: (data) => {
1239
- var _a12;
1240
- return (_a12 = getErrorMessage6(data)) != null ? _a12 : "unknown error";
1295
+ var _a13;
1296
+ return (_a13 = getErrorMessage6(data)) != null ? _a13 : "unknown error";
1241
1297
  }
1242
1298
  }),
1243
1299
  ...abortSignal && { abortSignal },
@@ -1258,8 +1314,8 @@ var GatewayImageModel = class {
1258
1314
  },
1259
1315
  ...responseBody.usage != null && {
1260
1316
  usage: {
1261
- inputTokens: (_a11 = responseBody.usage.inputTokens) != null ? _a11 : void 0,
1262
- outputTokens: (_b11 = responseBody.usage.outputTokens) != null ? _b11 : void 0,
1317
+ inputTokens: (_a12 = responseBody.usage.inputTokens) != null ? _a12 : void 0,
1318
+ outputTokens: (_b12 = responseBody.usage.outputTokens) != null ? _b12 : void 0,
1263
1319
  totalTokens: (_c = responseBody.usage.totalTokens) != null ? _c : void 0
1264
1320
  }
1265
1321
  }
@@ -1287,43 +1343,43 @@ function maybeEncodeImageFile(file) {
1287
1343
  }
1288
1344
  return file;
1289
1345
  }
1290
- var providerMetadataEntrySchema = () => z10.object({
1291
- images: z10.array(z10.unknown()).optional()
1292
- }).catchall(z10.unknown());
1293
- var gatewayImageWarningSchema = () => z10.discriminatedUnion("type", [
1294
- z10.object({
1295
- type: z10.literal("unsupported"),
1296
- feature: z10.string(),
1297
- details: z10.string().optional()
1346
+ var providerMetadataEntrySchema = () => z11.object({
1347
+ images: z11.array(z11.unknown()).optional()
1348
+ }).catchall(z11.unknown());
1349
+ var gatewayImageWarningSchema = () => z11.discriminatedUnion("type", [
1350
+ z11.object({
1351
+ type: z11.literal("unsupported"),
1352
+ feature: z11.string(),
1353
+ details: z11.string().optional()
1298
1354
  }),
1299
- z10.object({
1300
- type: z10.literal("compatibility"),
1301
- feature: z10.string(),
1302
- details: z10.string().optional()
1355
+ z11.object({
1356
+ type: z11.literal("compatibility"),
1357
+ feature: z11.string(),
1358
+ details: z11.string().optional()
1303
1359
  }),
1304
- z10.object({
1305
- type: z10.literal("deprecated"),
1306
- setting: z10.string(),
1307
- message: z10.string()
1360
+ z11.object({
1361
+ type: z11.literal("deprecated"),
1362
+ setting: z11.string(),
1363
+ message: z11.string()
1308
1364
  }),
1309
- z10.object({
1310
- type: z10.literal("other"),
1311
- message: z10.string()
1365
+ z11.object({
1366
+ type: z11.literal("other"),
1367
+ message: z11.string()
1312
1368
  })
1313
1369
  ]);
1314
- var gatewayImageUsageSchema = () => z10.object({
1315
- inputTokens: z10.number().nullish(),
1316
- outputTokens: z10.number().nullish(),
1317
- totalTokens: z10.number().nullish()
1370
+ var gatewayImageUsageSchema = () => z11.object({
1371
+ inputTokens: z11.number().nullish(),
1372
+ outputTokens: z11.number().nullish(),
1373
+ totalTokens: z11.number().nullish()
1318
1374
  });
1319
- var gatewayImageResponseSchema = lazySchema9(
1320
- () => zodSchema9(
1321
- z10.object({
1322
- images: z10.array(z10.string()),
1375
+ var gatewayImageResponseSchema = lazySchema10(
1376
+ () => zodSchema10(
1377
+ z11.object({
1378
+ images: z11.array(z11.string()),
1323
1379
  // Always base64 strings over the wire
1324
- isRetryable: z10.boolean().optional(),
1325
- warnings: z10.array(gatewayImageWarningSchema()).optional(),
1326
- providerMetadata: z10.record(z10.string(), providerMetadataEntrySchema()).optional(),
1380
+ isRetryable: z11.boolean().optional(),
1381
+ warnings: z11.array(gatewayImageWarningSchema()).optional(),
1382
+ providerMetadata: z11.record(z11.string(), providerMetadataEntrySchema()).optional(),
1327
1383
  usage: gatewayImageUsageSchema().optional()
1328
1384
  })
1329
1385
  )
@@ -1334,8 +1390,8 @@ import {
1334
1390
  APICallError as APICallError2
1335
1391
  } from "@ai-sdk/provider";
1336
1392
  import {
1337
- lazySchema as lazySchema10,
1338
- zodSchema as zodSchema10,
1393
+ lazySchema as lazySchema11,
1394
+ zodSchema as zodSchema11,
1339
1395
  combineHeaders as combineHeaders4,
1340
1396
  convertUint8ArrayToBase64 as convertUint8ArrayToBase642,
1341
1397
  createJsonErrorResponseHandler as createJsonErrorResponseHandler7,
@@ -1344,7 +1400,7 @@ import {
1344
1400
  postJsonToApi as postJsonToApi4,
1345
1401
  resolve as resolve7
1346
1402
  } from "@ai-sdk/provider-utils";
1347
- import { z as z11 } from "zod/v4";
1403
+ import { z as z12 } from "zod/v4";
1348
1404
  var GatewayVideoModel = class {
1349
1405
  constructor(modelId, config) {
1350
1406
  this.modelId = modelId;
@@ -1471,10 +1527,10 @@ var GatewayVideoModel = class {
1471
1527
  };
1472
1528
  },
1473
1529
  failedResponseHandler: createJsonErrorResponseHandler7({
1474
- errorSchema: z11.any(),
1530
+ errorSchema: z12.any(),
1475
1531
  errorToMessage: (data) => {
1476
- var _a11;
1477
- return (_a11 = getErrorMessage7(data)) != null ? _a11 : "unknown error";
1532
+ var _a12;
1533
+ return (_a12 = getErrorMessage7(data)) != null ? _a12 : "unknown error";
1478
1534
  }
1479
1535
  }),
1480
1536
  ...abortSignal && { abortSignal },
@@ -1513,57 +1569,57 @@ function maybeEncodeVideoFile(file) {
1513
1569
  }
1514
1570
  return file;
1515
1571
  }
1516
- var providerMetadataEntrySchema2 = () => z11.object({
1517
- videos: z11.array(z11.unknown()).optional()
1518
- }).catchall(z11.unknown());
1519
- var gatewayVideoDataSchema = () => z11.union([
1520
- z11.object({
1521
- type: z11.literal("url"),
1522
- url: z11.string(),
1523
- mediaType: z11.string()
1572
+ var providerMetadataEntrySchema2 = () => z12.object({
1573
+ videos: z12.array(z12.unknown()).optional()
1574
+ }).catchall(z12.unknown());
1575
+ var gatewayVideoDataSchema = () => z12.union([
1576
+ z12.object({
1577
+ type: z12.literal("url"),
1578
+ url: z12.string(),
1579
+ mediaType: z12.string()
1524
1580
  }),
1525
- z11.object({
1526
- type: z11.literal("base64"),
1527
- data: z11.string(),
1528
- mediaType: z11.string()
1581
+ z12.object({
1582
+ type: z12.literal("base64"),
1583
+ data: z12.string(),
1584
+ mediaType: z12.string()
1529
1585
  })
1530
1586
  ]);
1531
- var gatewayVideoWarningSchema = () => z11.discriminatedUnion("type", [
1532
- z11.object({
1533
- type: z11.literal("unsupported"),
1534
- feature: z11.string(),
1535
- details: z11.string().optional()
1587
+ var gatewayVideoWarningSchema = () => z12.discriminatedUnion("type", [
1588
+ z12.object({
1589
+ type: z12.literal("unsupported"),
1590
+ feature: z12.string(),
1591
+ details: z12.string().optional()
1536
1592
  }),
1537
- z11.object({
1538
- type: z11.literal("compatibility"),
1539
- feature: z11.string(),
1540
- details: z11.string().optional()
1593
+ z12.object({
1594
+ type: z12.literal("compatibility"),
1595
+ feature: z12.string(),
1596
+ details: z12.string().optional()
1541
1597
  }),
1542
- z11.object({
1543
- type: z11.literal("deprecated"),
1544
- setting: z11.string(),
1545
- message: z11.string()
1598
+ z12.object({
1599
+ type: z12.literal("deprecated"),
1600
+ setting: z12.string(),
1601
+ message: z12.string()
1546
1602
  }),
1547
- z11.object({
1548
- type: z11.literal("other"),
1549
- message: z11.string()
1603
+ z12.object({
1604
+ type: z12.literal("other"),
1605
+ message: z12.string()
1550
1606
  })
1551
1607
  ]);
1552
- var gatewayVideoEventSchema = lazySchema10(
1553
- () => zodSchema10(
1554
- z11.discriminatedUnion("type", [
1555
- z11.object({
1556
- type: z11.literal("result"),
1557
- videos: z11.array(gatewayVideoDataSchema()),
1558
- warnings: z11.array(gatewayVideoWarningSchema()).optional(),
1559
- providerMetadata: z11.record(z11.string(), providerMetadataEntrySchema2()).optional()
1608
+ var gatewayVideoEventSchema = lazySchema11(
1609
+ () => zodSchema11(
1610
+ z12.discriminatedUnion("type", [
1611
+ z12.object({
1612
+ type: z12.literal("result"),
1613
+ videos: z12.array(gatewayVideoDataSchema()),
1614
+ warnings: z12.array(gatewayVideoWarningSchema()).optional(),
1615
+ providerMetadata: z12.record(z12.string(), providerMetadataEntrySchema2()).optional()
1560
1616
  }),
1561
- z11.object({
1562
- type: z11.literal("error"),
1563
- message: z11.string(),
1564
- errorType: z11.string(),
1565
- statusCode: z11.number(),
1566
- param: z11.unknown().nullable()
1617
+ z12.object({
1618
+ type: z12.literal("error"),
1619
+ message: z12.string(),
1620
+ errorType: z12.string(),
1621
+ statusCode: z12.number(),
1622
+ param: z12.unknown().nullable()
1567
1623
  })
1568
1624
  ])
1569
1625
  )
@@ -1575,12 +1631,12 @@ import {
1575
1631
  createJsonErrorResponseHandler as createJsonErrorResponseHandler8,
1576
1632
  createJsonResponseHandler as createJsonResponseHandler7,
1577
1633
  getErrorMessage as getErrorMessage8,
1578
- lazySchema as lazySchema11,
1634
+ lazySchema as lazySchema12,
1579
1635
  postJsonToApi as postJsonToApi5,
1580
1636
  resolve as resolve8,
1581
- zodSchema as zodSchema11
1637
+ zodSchema as zodSchema12
1582
1638
  } from "@ai-sdk/provider-utils";
1583
- import { z as z12 } from "zod/v4";
1639
+ import { z as z13 } from "zod/v4";
1584
1640
  var GatewayRerankingModel = class {
1585
1641
  constructor(modelId, config) {
1586
1642
  this.modelId = modelId;
@@ -1598,7 +1654,7 @@ var GatewayRerankingModel = class {
1598
1654
  abortSignal,
1599
1655
  providerOptions
1600
1656
  }) {
1601
- var _a11;
1657
+ var _a12;
1602
1658
  const resolvedHeaders = await resolve8(this.config.headers());
1603
1659
  try {
1604
1660
  const {
@@ -1623,10 +1679,10 @@ var GatewayRerankingModel = class {
1623
1679
  gatewayRerankingResponseSchema
1624
1680
  ),
1625
1681
  failedResponseHandler: createJsonErrorResponseHandler8({
1626
- errorSchema: z12.any(),
1682
+ errorSchema: z13.any(),
1627
1683
  errorToMessage: (data) => {
1628
- var _a12;
1629
- return (_a12 = getErrorMessage8(data)) != null ? _a12 : "unknown error";
1684
+ var _a13;
1685
+ return (_a13 = getErrorMessage8(data)) != null ? _a13 : "unknown error";
1630
1686
  }
1631
1687
  }),
1632
1688
  ...abortSignal && { abortSignal },
@@ -1636,7 +1692,7 @@ var GatewayRerankingModel = class {
1636
1692
  ranking: responseBody.ranking,
1637
1693
  providerMetadata: responseBody.providerMetadata,
1638
1694
  response: { headers: responseHeaders, body: rawValue },
1639
- warnings: (_a11 = responseBody.warnings) != null ? _a11 : []
1695
+ warnings: (_a12 = responseBody.warnings) != null ? _a12 : []
1640
1696
  };
1641
1697
  } catch (error) {
1642
1698
  throw await asGatewayError(error, await parseAuthMethod(resolvedHeaders));
@@ -1652,41 +1708,41 @@ var GatewayRerankingModel = class {
1652
1708
  };
1653
1709
  }
1654
1710
  };
1655
- var gatewayRerankingWarningSchema = () => z12.discriminatedUnion("type", [
1656
- z12.object({
1657
- type: z12.literal("unsupported"),
1658
- feature: z12.string(),
1659
- details: z12.string().optional()
1711
+ var gatewayRerankingWarningSchema = () => z13.discriminatedUnion("type", [
1712
+ z13.object({
1713
+ type: z13.literal("unsupported"),
1714
+ feature: z13.string(),
1715
+ details: z13.string().optional()
1660
1716
  }),
1661
- z12.object({
1662
- type: z12.literal("compatibility"),
1663
- feature: z12.string(),
1664
- details: z12.string().optional()
1717
+ z13.object({
1718
+ type: z13.literal("compatibility"),
1719
+ feature: z13.string(),
1720
+ details: z13.string().optional()
1665
1721
  }),
1666
- z12.object({
1667
- type: z12.literal("other"),
1668
- message: z12.string()
1722
+ z13.object({
1723
+ type: z13.literal("other"),
1724
+ message: z13.string()
1669
1725
  })
1670
1726
  ]);
1671
- var gatewayRerankingResponseSchema = lazySchema11(
1672
- () => zodSchema11(
1673
- z12.object({
1674
- ranking: z12.array(
1675
- z12.object({
1676
- index: z12.number(),
1677
- relevanceScore: z12.number()
1727
+ var gatewayRerankingResponseSchema = lazySchema12(
1728
+ () => zodSchema12(
1729
+ z13.object({
1730
+ ranking: z13.array(
1731
+ z13.object({
1732
+ index: z13.number(),
1733
+ relevanceScore: z13.number()
1678
1734
  })
1679
1735
  ),
1680
- warnings: z12.array(gatewayRerankingWarningSchema()).optional(),
1681
- providerMetadata: z12.record(z12.string(), z12.record(z12.string(), z12.unknown())).optional()
1736
+ warnings: z13.array(gatewayRerankingWarningSchema()).optional(),
1737
+ providerMetadata: z13.record(z13.string(), z13.record(z13.string(), z13.unknown())).optional()
1682
1738
  })
1683
1739
  )
1684
1740
  );
1685
1741
 
1686
1742
  // src/gateway-speech-model.ts
1687
1743
  import {
1688
- lazySchema as lazySchema12,
1689
- zodSchema as zodSchema12,
1744
+ lazySchema as lazySchema13,
1745
+ zodSchema as zodSchema13,
1690
1746
  combineHeaders as combineHeaders6,
1691
1747
  createJsonErrorResponseHandler as createJsonErrorResponseHandler9,
1692
1748
  createJsonResponseHandler as createJsonResponseHandler8,
@@ -1694,7 +1750,7 @@ import {
1694
1750
  postJsonToApi as postJsonToApi6,
1695
1751
  resolve as resolve9
1696
1752
  } from "@ai-sdk/provider-utils";
1697
- import { z as z13 } from "zod/v4";
1753
+ import { z as z14 } from "zod/v4";
1698
1754
  var GatewaySpeechModel = class {
1699
1755
  constructor(modelId, config) {
1700
1756
  this.modelId = modelId;
@@ -1742,10 +1798,10 @@ var GatewaySpeechModel = class {
1742
1798
  gatewaySpeechResponseSchema
1743
1799
  ),
1744
1800
  failedResponseHandler: createJsonErrorResponseHandler9({
1745
- errorSchema: z13.any(),
1801
+ errorSchema: z14.any(),
1746
1802
  errorToMessage: (data) => {
1747
- var _a11;
1748
- return (_a11 = getErrorMessage9(data)) != null ? _a11 : "unknown error";
1803
+ var _a12;
1804
+ return (_a12 = getErrorMessage9(data)) != null ? _a12 : "unknown error";
1749
1805
  }
1750
1806
  }),
1751
1807
  ...abortSignal && { abortSignal },
@@ -1779,42 +1835,42 @@ var GatewaySpeechModel = class {
1779
1835
  };
1780
1836
  }
1781
1837
  };
1782
- var providerMetadataEntrySchema3 = () => z13.object({}).catchall(z13.unknown());
1783
- var gatewaySpeechWarningSchema = () => z13.discriminatedUnion("type", [
1784
- z13.object({
1785
- type: z13.literal("unsupported"),
1786
- feature: z13.string(),
1787
- details: z13.string().optional()
1838
+ var providerMetadataEntrySchema3 = () => z14.object({}).catchall(z14.unknown());
1839
+ var gatewaySpeechWarningSchema = () => z14.discriminatedUnion("type", [
1840
+ z14.object({
1841
+ type: z14.literal("unsupported"),
1842
+ feature: z14.string(),
1843
+ details: z14.string().optional()
1788
1844
  }),
1789
- z13.object({
1790
- type: z13.literal("compatibility"),
1791
- feature: z13.string(),
1792
- details: z13.string().optional()
1845
+ z14.object({
1846
+ type: z14.literal("compatibility"),
1847
+ feature: z14.string(),
1848
+ details: z14.string().optional()
1793
1849
  }),
1794
- z13.object({
1795
- type: z13.literal("deprecated"),
1796
- setting: z13.string(),
1797
- message: z13.string()
1850
+ z14.object({
1851
+ type: z14.literal("deprecated"),
1852
+ setting: z14.string(),
1853
+ message: z14.string()
1798
1854
  }),
1799
- z13.object({
1800
- type: z13.literal("other"),
1801
- message: z13.string()
1855
+ z14.object({
1856
+ type: z14.literal("other"),
1857
+ message: z14.string()
1802
1858
  })
1803
1859
  ]);
1804
- var gatewaySpeechResponseSchema = lazySchema12(
1805
- () => zodSchema12(
1806
- z13.object({
1807
- audio: z13.string(),
1808
- warnings: z13.array(gatewaySpeechWarningSchema()).optional(),
1809
- providerMetadata: z13.record(z13.string(), providerMetadataEntrySchema3()).optional()
1860
+ var gatewaySpeechResponseSchema = lazySchema13(
1861
+ () => zodSchema13(
1862
+ z14.object({
1863
+ audio: z14.string(),
1864
+ warnings: z14.array(gatewaySpeechWarningSchema()).optional(),
1865
+ providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema3()).optional()
1810
1866
  })
1811
1867
  )
1812
1868
  );
1813
1869
 
1814
1870
  // src/gateway-transcription-model.ts
1815
1871
  import {
1816
- lazySchema as lazySchema13,
1817
- zodSchema as zodSchema13,
1872
+ lazySchema as lazySchema14,
1873
+ zodSchema as zodSchema14,
1818
1874
  combineHeaders as combineHeaders7,
1819
1875
  convertUint8ArrayToBase64 as convertUint8ArrayToBase643,
1820
1876
  createJsonErrorResponseHandler as createJsonErrorResponseHandler10,
@@ -1823,7 +1879,7 @@ import {
1823
1879
  postJsonToApi as postJsonToApi7,
1824
1880
  resolve as resolve10
1825
1881
  } from "@ai-sdk/provider-utils";
1826
- import { z as z14 } from "zod/v4";
1882
+ import { z as z15 } from "zod/v4";
1827
1883
  var GatewayTranscriptionModel = class {
1828
1884
  constructor(modelId, config) {
1829
1885
  this.modelId = modelId;
@@ -1840,7 +1896,7 @@ var GatewayTranscriptionModel = class {
1840
1896
  headers,
1841
1897
  abortSignal
1842
1898
  }) {
1843
- var _a11, _b11, _c;
1899
+ var _a12, _b12, _c;
1844
1900
  const resolvedHeaders = await resolve10(this.config.headers());
1845
1901
  try {
1846
1902
  const {
@@ -1864,10 +1920,10 @@ var GatewayTranscriptionModel = class {
1864
1920
  gatewayTranscriptionResponseSchema
1865
1921
  ),
1866
1922
  failedResponseHandler: createJsonErrorResponseHandler10({
1867
- errorSchema: z14.any(),
1923
+ errorSchema: z15.any(),
1868
1924
  errorToMessage: (data) => {
1869
- var _a12;
1870
- return (_a12 = getErrorMessage10(data)) != null ? _a12 : "unknown error";
1925
+ var _a13;
1926
+ return (_a13 = getErrorMessage10(data)) != null ? _a13 : "unknown error";
1871
1927
  }
1872
1928
  }),
1873
1929
  ...abortSignal && { abortSignal },
@@ -1875,8 +1931,8 @@ var GatewayTranscriptionModel = class {
1875
1931
  });
1876
1932
  return {
1877
1933
  text: responseBody.text,
1878
- segments: (_a11 = responseBody.segments) != null ? _a11 : [],
1879
- language: (_b11 = responseBody.language) != null ? _b11 : void 0,
1934
+ segments: (_a12 = responseBody.segments) != null ? _a12 : [],
1935
+ language: (_b12 = responseBody.language) != null ? _b12 : void 0,
1880
1936
  durationInSeconds: (_c = responseBody.durationInSeconds) != null ? _c : void 0,
1881
1937
  warnings: mapGatewayWarnings(responseBody.warnings),
1882
1938
  providerMetadata: responseBody.providerMetadata,
@@ -1904,43 +1960,43 @@ var GatewayTranscriptionModel = class {
1904
1960
  };
1905
1961
  }
1906
1962
  };
1907
- var providerMetadataEntrySchema4 = () => z14.object({}).catchall(z14.unknown());
1908
- var gatewayTranscriptionWarningSchema = () => z14.discriminatedUnion("type", [
1909
- z14.object({
1910
- type: z14.literal("unsupported"),
1911
- feature: z14.string(),
1912
- details: z14.string().optional()
1963
+ var providerMetadataEntrySchema4 = () => z15.object({}).catchall(z15.unknown());
1964
+ var gatewayTranscriptionWarningSchema = () => z15.discriminatedUnion("type", [
1965
+ z15.object({
1966
+ type: z15.literal("unsupported"),
1967
+ feature: z15.string(),
1968
+ details: z15.string().optional()
1913
1969
  }),
1914
- z14.object({
1915
- type: z14.literal("compatibility"),
1916
- feature: z14.string(),
1917
- details: z14.string().optional()
1970
+ z15.object({
1971
+ type: z15.literal("compatibility"),
1972
+ feature: z15.string(),
1973
+ details: z15.string().optional()
1918
1974
  }),
1919
- z14.object({
1920
- type: z14.literal("deprecated"),
1921
- setting: z14.string(),
1922
- message: z14.string()
1975
+ z15.object({
1976
+ type: z15.literal("deprecated"),
1977
+ setting: z15.string(),
1978
+ message: z15.string()
1923
1979
  }),
1924
- z14.object({
1925
- type: z14.literal("other"),
1926
- message: z14.string()
1980
+ z15.object({
1981
+ type: z15.literal("other"),
1982
+ message: z15.string()
1927
1983
  })
1928
1984
  ]);
1929
- var gatewayTranscriptionResponseSchema = lazySchema13(
1930
- () => zodSchema13(
1931
- z14.object({
1932
- text: z14.string(),
1933
- segments: z14.array(
1934
- z14.object({
1935
- text: z14.string(),
1936
- startSecond: z14.number(),
1937
- endSecond: z14.number()
1985
+ var gatewayTranscriptionResponseSchema = lazySchema14(
1986
+ () => zodSchema14(
1987
+ z15.object({
1988
+ text: z15.string(),
1989
+ segments: z15.array(
1990
+ z15.object({
1991
+ text: z15.string(),
1992
+ startSecond: z15.number(),
1993
+ endSecond: z15.number()
1938
1994
  })
1939
1995
  ).optional(),
1940
- language: z14.string().nullish(),
1941
- durationInSeconds: z14.number().nullish(),
1942
- warnings: z14.array(gatewayTranscriptionWarningSchema()).optional(),
1943
- providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema4()).optional()
1996
+ language: z15.string().nullish(),
1997
+ durationInSeconds: z15.number().nullish(),
1998
+ warnings: z15.array(gatewayTranscriptionWarningSchema()).optional(),
1999
+ providerMetadata: z15.record(z15.string(), providerMetadataEntrySchema4()).optional()
1944
2000
  })
1945
2001
  )
1946
2002
  );
@@ -1948,23 +2004,23 @@ var gatewayTranscriptionResponseSchema = lazySchema13(
1948
2004
  // src/tool/browserbase-fetch.ts
1949
2005
  import {
1950
2006
  createProviderToolFactoryWithOutputSchema,
1951
- lazySchema as lazySchema14,
1952
- zodSchema as zodSchema14
2007
+ lazySchema as lazySchema15,
2008
+ zodSchema as zodSchema15
1953
2009
  } from "@ai-sdk/provider-utils";
1954
- import { z as z15 } from "zod";
1955
- var jsonObjectSchema = () => z15.record(z15.string(), z15.unknown());
1956
- var browserbaseFetchInputSchema = lazySchema14(
1957
- () => zodSchema14(
1958
- z15.object({
1959
- url: z15.string().url().describe("URL of the page to fetch."),
1960
- allow_redirects: z15.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
1961
- allow_insecure_ssl: z15.boolean().optional().describe(
2010
+ import { z as z16 } from "zod";
2011
+ var jsonObjectSchema = () => z16.record(z16.string(), z16.unknown());
2012
+ var browserbaseFetchInputSchema = lazySchema15(
2013
+ () => zodSchema15(
2014
+ z16.object({
2015
+ url: z16.string().url().describe("URL of the page to fetch."),
2016
+ allow_redirects: z16.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
2017
+ allow_insecure_ssl: z16.boolean().optional().describe(
1962
2018
  "Whether to bypass TLS certificate verification (default: false). Only use for trusted hosts."
1963
2019
  ),
1964
- proxies: z15.boolean().optional().describe(
2020
+ proxies: z16.boolean().optional().describe(
1965
2021
  "Whether to route the request through Browserbase proxies (default: false)."
1966
2022
  ),
1967
- format: z15.enum(["raw", "json", "markdown"]).optional().describe(
2023
+ format: z16.enum(["raw", "json", "markdown"]).optional().describe(
1968
2024
  "Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
1969
2025
  ),
1970
2026
  schema: jsonObjectSchema().optional().describe(
@@ -1973,19 +2029,19 @@ var browserbaseFetchInputSchema = lazySchema14(
1973
2029
  })
1974
2030
  )
1975
2031
  );
1976
- var browserbaseFetchOutputSchema = lazySchema14(
1977
- () => zodSchema14(
1978
- z15.union([
1979
- z15.object({
1980
- id: z15.string(),
1981
- content: z15.union([z15.string(), jsonObjectSchema()]),
1982
- contentType: z15.string(),
1983
- encoding: z15.string(),
1984
- headers: z15.record(z15.string(), z15.string()),
1985
- statusCode: z15.number()
2032
+ var browserbaseFetchOutputSchema = lazySchema15(
2033
+ () => zodSchema15(
2034
+ z16.union([
2035
+ z16.object({
2036
+ id: z16.string(),
2037
+ content: z16.union([z16.string(), jsonObjectSchema()]),
2038
+ contentType: z16.string(),
2039
+ encoding: z16.string(),
2040
+ headers: z16.record(z16.string(), z16.string()),
2041
+ statusCode: z16.number()
1986
2042
  }),
1987
- z15.object({
1988
- error: z15.enum([
2043
+ z16.object({
2044
+ error: z16.enum([
1989
2045
  "api_error",
1990
2046
  "configuration_error",
1991
2047
  "execution_error",
@@ -1994,8 +2050,8 @@ var browserbaseFetchOutputSchema = lazySchema14(
1994
2050
  "timeout",
1995
2051
  "unknown"
1996
2052
  ]),
1997
- statusCode: z15.number().optional(),
1998
- message: z15.string()
2053
+ statusCode: z16.number().optional(),
2054
+ message: z16.string()
1999
2055
  })
2000
2056
  ])
2001
2057
  )
@@ -2010,38 +2066,38 @@ var browserbaseFetch = (config = {}) => browserbaseFetchToolFactory(config);
2010
2066
  // src/tool/browserbase-search.ts
2011
2067
  import {
2012
2068
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
2013
- lazySchema as lazySchema15,
2014
- zodSchema as zodSchema15
2069
+ lazySchema as lazySchema16,
2070
+ zodSchema as zodSchema16
2015
2071
  } from "@ai-sdk/provider-utils";
2016
- import { z as z16 } from "zod";
2017
- var browserbaseSearchInputSchema = lazySchema15(
2018
- () => zodSchema15(
2019
- z16.object({
2020
- query: z16.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
2021
- num_results: z16.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
2072
+ import { z as z17 } from "zod";
2073
+ var browserbaseSearchInputSchema = lazySchema16(
2074
+ () => zodSchema16(
2075
+ z17.object({
2076
+ query: z17.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
2077
+ num_results: z17.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
2022
2078
  })
2023
2079
  )
2024
2080
  );
2025
- var browserbaseSearchOutputSchema = lazySchema15(
2026
- () => zodSchema15(
2027
- z16.union([
2028
- z16.object({
2029
- query: z16.string(),
2030
- requestId: z16.string(),
2031
- results: z16.array(
2032
- z16.object({
2033
- id: z16.string(),
2034
- title: z16.string(),
2035
- url: z16.string(),
2036
- author: z16.string().optional(),
2037
- favicon: z16.string().optional(),
2038
- image: z16.string().optional(),
2039
- publishedDate: z16.string().optional()
2081
+ var browserbaseSearchOutputSchema = lazySchema16(
2082
+ () => zodSchema16(
2083
+ z17.union([
2084
+ z17.object({
2085
+ query: z17.string(),
2086
+ requestId: z17.string(),
2087
+ results: z17.array(
2088
+ z17.object({
2089
+ id: z17.string(),
2090
+ title: z17.string(),
2091
+ url: z17.string(),
2092
+ author: z17.string().optional(),
2093
+ favicon: z17.string().optional(),
2094
+ image: z17.string().optional(),
2095
+ publishedDate: z17.string().optional()
2040
2096
  })
2041
2097
  )
2042
2098
  }),
2043
- z16.object({
2044
- error: z16.enum([
2099
+ z17.object({
2100
+ error: z17.enum([
2045
2101
  "api_error",
2046
2102
  "configuration_error",
2047
2103
  "execution_error",
@@ -2050,8 +2106,8 @@ var browserbaseSearchOutputSchema = lazySchema15(
2050
2106
  "timeout",
2051
2107
  "unknown"
2052
2108
  ]),
2053
- statusCode: z16.number().optional(),
2054
- message: z16.string()
2109
+ statusCode: z17.number().optional(),
2110
+ message: z17.string()
2055
2111
  })
2056
2112
  ])
2057
2113
  )
@@ -2066,15 +2122,15 @@ var browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
2066
2122
  // src/tool/deepseek-fetch.ts
2067
2123
  import {
2068
2124
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2069
- lazySchema as lazySchema16,
2070
- zodSchema as zodSchema16
2125
+ lazySchema as lazySchema17,
2126
+ zodSchema as zodSchema17
2071
2127
  } from "@ai-sdk/provider-utils";
2072
- import { z as z18 } from "zod";
2128
+ import { z as z19 } from "zod";
2073
2129
 
2074
2130
  // src/tool/gateway-tool-error.ts
2075
- import { z as z17 } from "zod";
2076
- var gatewayToolErrorSchema = () => z17.object({
2077
- error: z17.enum([
2131
+ import { z as z18 } from "zod";
2132
+ var gatewayToolErrorSchema = () => z18.object({
2133
+ error: z18.enum([
2078
2134
  "api_error",
2079
2135
  "configuration_error",
2080
2136
  "execution_error",
@@ -2085,28 +2141,28 @@ var gatewayToolErrorSchema = () => z17.object({
2085
2141
  "unknown",
2086
2142
  "unknown_tool"
2087
2143
  ]),
2088
- message: z17.string(),
2089
- statusCode: z17.number().optional(),
2090
- retryAfter: z17.string().optional(),
2091
- statusText: z17.string().optional()
2144
+ message: z18.string(),
2145
+ statusCode: z18.number().optional(),
2146
+ retryAfter: z18.string().optional(),
2147
+ statusText: z18.string().optional()
2092
2148
  }).passthrough();
2093
2149
 
2094
2150
  // src/tool/deepseek-fetch.ts
2095
- var deepseekFetchInputSchema = lazySchema16(
2096
- () => zodSchema16(
2097
- z18.object({
2098
- url: z18.string().describe(
2151
+ var deepseekFetchInputSchema = lazySchema17(
2152
+ () => zodSchema17(
2153
+ z19.object({
2154
+ url: z19.string().describe(
2099
2155
  "URL to fetch, at most 8192 characters; HTTP(S) only, without a username or password."
2100
2156
  )
2101
2157
  })
2102
2158
  )
2103
2159
  );
2104
- var deepseekFetchOutputSchema = lazySchema16(
2105
- () => zodSchema16(
2106
- z18.union([
2107
- z18.object({
2108
- title: z18.string().nullish(),
2109
- content: z18.string()
2160
+ var deepseekFetchOutputSchema = lazySchema17(
2161
+ () => zodSchema17(
2162
+ z19.union([
2163
+ z19.object({
2164
+ title: z19.string().nullish(),
2165
+ content: z19.string()
2110
2166
  }).passthrough(),
2111
2167
  gatewayToolErrorSchema()
2112
2168
  ])
@@ -2122,38 +2178,38 @@ var deepseekFetch = (config = {}) => deepseekFetchToolFactory(config);
2122
2178
  // src/tool/deepseek-search.ts
2123
2179
  import {
2124
2180
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2125
- lazySchema as lazySchema17,
2126
- zodSchema as zodSchema17
2181
+ lazySchema as lazySchema18,
2182
+ zodSchema as zodSchema18
2127
2183
  } from "@ai-sdk/provider-utils";
2128
- import { z as z19 } from "zod";
2129
- var deepseekSearchInputSchema = lazySchema17(
2130
- () => zodSchema17(
2131
- z19.object({
2132
- query: z19.string().describe(
2184
+ import { z as z20 } from "zod";
2185
+ var deepseekSearchInputSchema = lazySchema18(
2186
+ () => zodSchema18(
2187
+ z20.object({
2188
+ query: z20.string().describe(
2133
2189
  "Web search query, 1 to 128 Unicode characters. Supports site:, -site:, lang:, after:, before:, and quoted phrases."
2134
2190
  ),
2135
- count: z19.number().int().optional().describe("Number of results, 1 to 50 (default: 10)."),
2136
- need_content: z19.boolean().optional().describe("Include available page content (default: false)."),
2137
- ori_question: z19.string().nullable().optional().describe("Original user question, 1 to 128 Unicode characters.")
2191
+ count: z20.number().int().optional().describe("Number of results, 1 to 50 (default: 10)."),
2192
+ need_content: z20.boolean().optional().describe("Include available page content (default: false)."),
2193
+ ori_question: z20.string().nullable().optional().describe("Original user question, 1 to 128 Unicode characters.")
2138
2194
  })
2139
2195
  )
2140
2196
  );
2141
- var deepseekSearchOutputSchema = lazySchema17(
2142
- () => zodSchema17(
2143
- z19.union([
2144
- z19.object({
2145
- results: z19.array(
2146
- z19.object({
2147
- authority: z19.number().nullish(),
2148
- content: z19.string().nullish(),
2149
- date: z19.string().nullish(),
2150
- rerank_score: z19.number().nullish(),
2151
- site_icon: z19.string().nullish(),
2152
- site_name: z19.string().nullish(),
2153
- snippet: z19.string().nullish(),
2154
- summary: z19.string().nullish(),
2155
- title: z19.string().nullish(),
2156
- url: z19.string().nullish()
2197
+ var deepseekSearchOutputSchema = lazySchema18(
2198
+ () => zodSchema18(
2199
+ z20.union([
2200
+ z20.object({
2201
+ results: z20.array(
2202
+ z20.object({
2203
+ authority: z20.number().nullish(),
2204
+ content: z20.string().nullish(),
2205
+ date: z20.string().nullish(),
2206
+ rerank_score: z20.number().nullish(),
2207
+ site_icon: z20.string().nullish(),
2208
+ site_name: z20.string().nullish(),
2209
+ snippet: z20.string().nullish(),
2210
+ summary: z20.string().nullish(),
2211
+ title: z20.string().nullish(),
2212
+ url: z20.string().nullish()
2157
2213
  }).passthrough()
2158
2214
  )
2159
2215
  }).passthrough(),
@@ -2171,19 +2227,19 @@ var deepseekSearch = (config = {}) => deepseekSearchToolFactory(config);
2171
2227
  // src/tool/exa-search.ts
2172
2228
  import {
2173
2229
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
2174
- lazySchema as lazySchema18,
2175
- zodSchema as zodSchema18
2230
+ lazySchema as lazySchema19,
2231
+ zodSchema as zodSchema19
2176
2232
  } from "@ai-sdk/provider-utils";
2177
- import { z as z20 } from "zod";
2178
- var exaSearchInputSchema = lazySchema18(
2179
- () => zodSchema18(
2180
- z20.object({
2181
- query: z20.string().describe("Natural-language web search query. This is required."),
2182
- type: z20.enum(["auto", "fast", "instant"]).optional().describe(
2233
+ import { z as z21 } from "zod";
2234
+ var exaSearchInputSchema = lazySchema19(
2235
+ () => zodSchema19(
2236
+ z21.object({
2237
+ query: z21.string().describe("Natural-language web search query. This is required."),
2238
+ type: z21.enum(["auto", "fast", "instant"]).optional().describe(
2183
2239
  "Search method. Use auto for the default balance of speed and quality."
2184
2240
  ),
2185
- num_results: z20.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
2186
- category: z20.enum([
2241
+ num_results: z21.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
2242
+ category: z21.enum([
2187
2243
  "company",
2188
2244
  "people",
2189
2245
  "research paper",
@@ -2191,20 +2247,20 @@ var exaSearchInputSchema = lazySchema18(
2191
2247
  "personal site",
2192
2248
  "financial report"
2193
2249
  ]).optional().describe("Optional content category to focus results."),
2194
- user_location: z20.string().optional().describe("Two-letter ISO country code such as 'US'."),
2195
- include_domains: z20.array(z20.string()).optional().describe("Only return results from these domains."),
2196
- exclude_domains: z20.array(z20.string()).optional().describe("Exclude results from these domains."),
2197
- start_published_date: z20.string().optional().describe("Only return links published after this ISO 8601 date."),
2198
- end_published_date: z20.string().optional().describe("Only return links published before this ISO 8601 date."),
2199
- contents: z20.object({
2200
- text: z20.union([
2201
- z20.boolean(),
2202
- z20.object({
2203
- max_characters: z20.number().optional(),
2204
- include_html_tags: z20.boolean().optional(),
2205
- verbosity: z20.enum(["compact", "standard", "full"]).optional(),
2206
- include_sections: z20.array(
2207
- z20.enum([
2250
+ user_location: z21.string().optional().describe("Two-letter ISO country code such as 'US'."),
2251
+ include_domains: z21.array(z21.string()).optional().describe("Only return results from these domains."),
2252
+ exclude_domains: z21.array(z21.string()).optional().describe("Exclude results from these domains."),
2253
+ start_published_date: z21.string().optional().describe("Only return links published after this ISO 8601 date."),
2254
+ end_published_date: z21.string().optional().describe("Only return links published before this ISO 8601 date."),
2255
+ contents: z21.object({
2256
+ text: z21.union([
2257
+ z21.boolean(),
2258
+ z21.object({
2259
+ max_characters: z21.number().optional(),
2260
+ include_html_tags: z21.boolean().optional(),
2261
+ verbosity: z21.enum(["compact", "standard", "full"]).optional(),
2262
+ include_sections: z21.array(
2263
+ z21.enum([
2208
2264
  "header",
2209
2265
  "navigation",
2210
2266
  "banner",
@@ -2214,8 +2270,8 @@ var exaSearchInputSchema = lazySchema18(
2214
2270
  "metadata"
2215
2271
  ])
2216
2272
  ).optional(),
2217
- exclude_sections: z20.array(
2218
- z20.enum([
2273
+ exclude_sections: z21.array(
2274
+ z21.enum([
2219
2275
  "header",
2220
2276
  "navigation",
2221
2277
  "banner",
@@ -2227,59 +2283,59 @@ var exaSearchInputSchema = lazySchema18(
2227
2283
  ).optional()
2228
2284
  })
2229
2285
  ]).optional(),
2230
- highlights: z20.union([
2231
- z20.boolean(),
2232
- z20.object({
2233
- query: z20.string().optional(),
2234
- max_characters: z20.number().optional()
2286
+ highlights: z21.union([
2287
+ z21.boolean(),
2288
+ z21.object({
2289
+ query: z21.string().optional(),
2290
+ max_characters: z21.number().optional()
2235
2291
  })
2236
2292
  ]).optional(),
2237
- max_age_hours: z20.number().optional(),
2238
- livecrawl_timeout: z20.number().optional(),
2239
- subpages: z20.number().optional(),
2240
- subpage_target: z20.union([z20.string(), z20.array(z20.string())]).optional(),
2241
- extras: z20.object({
2242
- links: z20.number().optional(),
2243
- image_links: z20.number().optional()
2293
+ max_age_hours: z21.number().optional(),
2294
+ livecrawl_timeout: z21.number().optional(),
2295
+ subpages: z21.number().optional(),
2296
+ subpage_target: z21.union([z21.string(), z21.array(z21.string())]).optional(),
2297
+ extras: z21.object({
2298
+ links: z21.number().optional(),
2299
+ image_links: z21.number().optional()
2244
2300
  }).optional()
2245
2301
  }).optional().describe("Controls extracted page content and freshness.")
2246
2302
  })
2247
2303
  )
2248
2304
  );
2249
- var exaSearchOutputSchema = lazySchema18(
2250
- () => zodSchema18(
2251
- z20.union([
2252
- z20.object({
2253
- requestId: z20.string(),
2254
- searchType: z20.string().optional(),
2255
- resolvedSearchType: z20.string().optional(),
2256
- results: z20.array(
2257
- z20.object({
2258
- title: z20.string(),
2259
- url: z20.string(),
2260
- id: z20.string(),
2261
- publishedDate: z20.string().nullable().optional(),
2262
- author: z20.string().nullable().optional(),
2263
- image: z20.string().nullable().optional(),
2264
- favicon: z20.string().nullable().optional(),
2265
- text: z20.string().optional(),
2266
- highlights: z20.array(z20.string()).optional(),
2267
- highlightScores: z20.array(z20.number()).optional(),
2268
- summary: z20.string().optional(),
2269
- subpages: z20.array(z20.any()).optional(),
2270
- extras: z20.object({
2271
- links: z20.array(z20.string()).optional(),
2272
- imageLinks: z20.array(z20.string()).optional()
2305
+ var exaSearchOutputSchema = lazySchema19(
2306
+ () => zodSchema19(
2307
+ z21.union([
2308
+ z21.object({
2309
+ requestId: z21.string(),
2310
+ searchType: z21.string().optional(),
2311
+ resolvedSearchType: z21.string().optional(),
2312
+ results: z21.array(
2313
+ z21.object({
2314
+ title: z21.string(),
2315
+ url: z21.string(),
2316
+ id: z21.string(),
2317
+ publishedDate: z21.string().nullable().optional(),
2318
+ author: z21.string().nullable().optional(),
2319
+ image: z21.string().nullable().optional(),
2320
+ favicon: z21.string().nullable().optional(),
2321
+ text: z21.string().optional(),
2322
+ highlights: z21.array(z21.string()).optional(),
2323
+ highlightScores: z21.array(z21.number()).optional(),
2324
+ summary: z21.string().optional(),
2325
+ subpages: z21.array(z21.any()).optional(),
2326
+ extras: z21.object({
2327
+ links: z21.array(z21.string()).optional(),
2328
+ imageLinks: z21.array(z21.string()).optional()
2273
2329
  }).optional()
2274
2330
  })
2275
2331
  ),
2276
- costDollars: z20.object({
2277
- total: z20.number().optional(),
2278
- search: z20.record(z20.number()).optional()
2332
+ costDollars: z21.object({
2333
+ total: z21.number().optional(),
2334
+ search: z21.record(z21.number()).optional()
2279
2335
  }).optional()
2280
2336
  }),
2281
- z20.object({
2282
- error: z20.enum([
2337
+ z21.object({
2338
+ error: z21.enum([
2283
2339
  "api_error",
2284
2340
  "rate_limit",
2285
2341
  "timeout",
@@ -2288,8 +2344,8 @@ var exaSearchOutputSchema = lazySchema18(
2288
2344
  "execution_error",
2289
2345
  "unknown"
2290
2346
  ]),
2291
- statusCode: z20.number().optional(),
2292
- message: z20.string()
2347
+ statusCode: z21.number().optional(),
2348
+ message: z21.string()
2293
2349
  })
2294
2350
  ])
2295
2351
  )
@@ -2304,10 +2360,10 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
2304
2360
  // src/tool/parallel-search.ts
2305
2361
  import {
2306
2362
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
2307
- lazySchema as lazySchema19,
2308
- zodSchema as zodSchema19
2363
+ lazySchema as lazySchema20,
2364
+ zodSchema as zodSchema20
2309
2365
  } from "@ai-sdk/provider-utils";
2310
- import { z as z21 } from "zod";
2366
+ import { z as z22 } from "zod";
2311
2367
  var parallelSearchModes = [
2312
2368
  "turbo",
2313
2369
  "fast",
@@ -2316,79 +2372,79 @@ var parallelSearchModes = [
2316
2372
  "one-shot",
2317
2373
  "agentic"
2318
2374
  ];
2319
- var parallelSearchInputSchema = lazySchema19(
2320
- () => zodSchema19(
2321
- z21.object({
2322
- objective: z21.string().describe(
2375
+ var parallelSearchInputSchema = lazySchema20(
2376
+ () => zodSchema20(
2377
+ z22.object({
2378
+ objective: z22.string().describe(
2323
2379
  "Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
2324
2380
  ),
2325
- search_queries: z21.array(z21.string()).optional().describe(
2381
+ search_queries: z22.array(z22.string()).optional().describe(
2326
2382
  "Provide 2-3 concise keyword queries, 3-6 words each (max 5, 200 chars each). Strongly recommended; the search runs on these queries."
2327
2383
  ),
2328
- mode: z21.enum(parallelSearchModes).optional().describe(
2384
+ mode: z22.enum(parallelSearchModes).optional().describe(
2329
2385
  'Search mode: "turbo" and "fast" return quickly with shorter excerpts, "basic" is balanced (default), "advanced" is the most thorough. "turbo" supports English and Japanese only. "one-shot" and "agentic" are deprecated aliases of "basic" and "advanced".'
2330
2386
  ),
2331
- max_results: z21.number().optional().describe(
2387
+ max_results: z22.number().optional().describe(
2332
2388
  "Maximum number of results to return (1-20). Defaults to 10 if not specified."
2333
2389
  ),
2334
- source_policy: z21.object({
2335
- include_domains: z21.array(z21.string()).optional().describe(
2390
+ source_policy: z22.object({
2391
+ include_domains: z22.array(z22.string()).optional().describe(
2336
2392
  "Domains or domain/path prefixes to restrict results to, without scheme or port. Example: ['wikipedia.org', 'docs.python.org/3']."
2337
2393
  ),
2338
- exclude_domains: z21.array(z21.string()).optional().describe(
2394
+ exclude_domains: z22.array(z22.string()).optional().describe(
2339
2395
  "Domains or domain/path prefixes to exclude, without scheme or port. Example: ['reddit.com']."
2340
2396
  ),
2341
- after_date: z21.string().optional().describe(
2397
+ after_date: z22.string().optional().describe(
2342
2398
  "Only include results published on or after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time."
2343
2399
  )
2344
2400
  }).optional().describe(
2345
2401
  "Source policy for controlling which domains to include/exclude and freshness."
2346
2402
  ),
2347
- excerpts: z21.object({
2348
- max_chars_per_result: z21.number().optional().describe("Maximum characters per result."),
2349
- max_chars_total: z21.number().optional().describe("Deprecated: use the top-level max_chars_total.")
2403
+ excerpts: z22.object({
2404
+ max_chars_per_result: z22.number().optional().describe("Maximum characters per result."),
2405
+ max_chars_total: z22.number().optional().describe("Deprecated: use the top-level max_chars_total.")
2350
2406
  }).optional().describe("Excerpt configuration for controlling result length."),
2351
- max_chars_total: z21.number().optional().describe("Maximum total characters across all result excerpts."),
2352
- fetch_policy: z21.object({
2353
- max_age_seconds: z21.number().optional().describe(
2407
+ max_chars_total: z22.number().optional().describe("Maximum total characters across all result excerpts."),
2408
+ fetch_policy: z22.object({
2409
+ max_age_seconds: z22.number().optional().describe(
2354
2410
  "Maximum age of cached content in seconds before a live fetch, minimum 600."
2355
2411
  ),
2356
- timeout_seconds: z21.number().optional().describe(
2412
+ timeout_seconds: z22.number().optional().describe(
2357
2413
  "Timeout in seconds for a live fetch when content is not cached. Capped by the gateway tool timeout."
2358
2414
  ),
2359
- disable_cache_fallback: z21.boolean().optional().describe(
2415
+ disable_cache_fallback: z22.boolean().optional().describe(
2360
2416
  "Return an error instead of older cached content when a live fetch fails."
2361
2417
  )
2362
2418
  }).optional().describe("Fetch policy for controlling content freshness."),
2363
- location: z21.string().optional().describe(
2419
+ location: z22.string().optional().describe(
2364
2420
  'ISO 3166-1 alpha-2 country code to localize results, e.g. "us".'
2365
2421
  )
2366
2422
  })
2367
2423
  )
2368
2424
  );
2369
- var parallelSearchOutputSchema = lazySchema19(
2370
- () => zodSchema19(
2371
- z21.union([
2425
+ var parallelSearchOutputSchema = lazySchema20(
2426
+ () => zodSchema20(
2427
+ z22.union([
2372
2428
  // Success response (Parallel's response, passed through by the gateway)
2373
- z21.object({
2374
- search_id: z21.string(),
2375
- results: z21.array(
2376
- z21.object({
2377
- url: z21.string(),
2378
- title: z21.string().nullable().optional(),
2379
- publish_date: z21.string().nullable().optional(),
2380
- excerpts: z21.array(z21.string())
2429
+ z22.object({
2430
+ search_id: z22.string(),
2431
+ results: z22.array(
2432
+ z22.object({
2433
+ url: z22.string(),
2434
+ title: z22.string().nullable().optional(),
2435
+ publish_date: z22.string().nullable().optional(),
2436
+ excerpts: z22.array(z22.string())
2381
2437
  })
2382
2438
  ),
2383
- warnings: z21.array(
2384
- z21.object({
2385
- type: z21.string(),
2386
- message: z21.string(),
2387
- detail: z21.record(z21.string(), z21.unknown()).nullable().optional()
2439
+ warnings: z22.array(
2440
+ z22.object({
2441
+ type: z22.string(),
2442
+ message: z22.string(),
2443
+ detail: z22.record(z22.string(), z22.unknown()).nullable().optional()
2388
2444
  })
2389
2445
  ).nullable().optional(),
2390
- usage: z21.array(z21.object({ name: z21.string(), count: z21.number().optional() })).nullable().optional(),
2391
- session_id: z21.string().optional()
2446
+ usage: z22.array(z22.object({ name: z22.string(), count: z22.number().optional() })).nullable().optional(),
2447
+ session_id: z22.string().optional()
2392
2448
  }),
2393
2449
  // Error response
2394
2450
  gatewayToolErrorSchema()
@@ -2405,79 +2461,79 @@ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
2405
2461
  // src/tool/perplexity-search.ts
2406
2462
  import {
2407
2463
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
2408
- lazySchema as lazySchema20,
2409
- zodSchema as zodSchema20
2464
+ lazySchema as lazySchema21,
2465
+ zodSchema as zodSchema21
2410
2466
  } from "@ai-sdk/provider-utils";
2411
- import { z as z22 } from "zod";
2412
- var perplexitySearchInputSchema = lazySchema20(
2413
- () => zodSchema20(
2414
- z22.object({
2415
- query: z22.union([z22.string(), z22.array(z22.string())]).describe(
2467
+ import { z as z23 } from "zod";
2468
+ var perplexitySearchInputSchema = lazySchema21(
2469
+ () => zodSchema21(
2470
+ z23.object({
2471
+ query: z23.union([z23.string(), z23.array(z23.string())]).describe(
2416
2472
  "Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
2417
2473
  ),
2418
- max_results: z22.number().optional().describe(
2474
+ max_results: z23.number().optional().describe(
2419
2475
  "Maximum number of search results to return (1-20, default: 10)"
2420
2476
  ),
2421
- max_tokens_per_page: z22.number().optional().describe(
2477
+ max_tokens_per_page: z23.number().optional().describe(
2422
2478
  "Maximum number of tokens to extract per search result page (256-2048, default: 2048)"
2423
2479
  ),
2424
- max_tokens: z22.number().optional().describe(
2480
+ max_tokens: z23.number().optional().describe(
2425
2481
  "Maximum total tokens across all search results (default: 25000, max: 1000000)"
2426
2482
  ),
2427
- country: z22.string().optional().describe(
2483
+ country: z23.string().optional().describe(
2428
2484
  "Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"
2429
2485
  ),
2430
- search_domain_filter: z22.array(z22.string()).optional().describe(
2486
+ search_domain_filter: z23.array(z23.string()).optional().describe(
2431
2487
  "List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"
2432
2488
  ),
2433
- search_language_filter: z22.array(z22.string()).optional().describe(
2489
+ search_language_filter: z23.array(z23.string()).optional().describe(
2434
2490
  "List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"
2435
2491
  ),
2436
- search_after_date: z22.string().optional().describe(
2492
+ search_after_date: z23.string().optional().describe(
2437
2493
  "Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
2438
2494
  ),
2439
- search_before_date: z22.string().optional().describe(
2495
+ search_before_date: z23.string().optional().describe(
2440
2496
  "Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
2441
2497
  ),
2442
- last_updated_after_filter: z22.string().optional().describe(
2498
+ last_updated_after_filter: z23.string().optional().describe(
2443
2499
  "Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
2444
2500
  ),
2445
- last_updated_before_filter: z22.string().optional().describe(
2501
+ last_updated_before_filter: z23.string().optional().describe(
2446
2502
  "Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
2447
2503
  ),
2448
- search_recency_filter: z22.enum(["day", "week", "month", "year"]).optional().describe(
2504
+ search_recency_filter: z23.enum(["day", "week", "month", "year"]).optional().describe(
2449
2505
  "Filter results by relative time period. Cannot be used with search_after_date or search_before_date."
2450
2506
  )
2451
2507
  })
2452
2508
  )
2453
2509
  );
2454
- var perplexitySearchOutputSchema = lazySchema20(
2455
- () => zodSchema20(
2456
- z22.union([
2510
+ var perplexitySearchOutputSchema = lazySchema21(
2511
+ () => zodSchema21(
2512
+ z23.union([
2457
2513
  // Success response
2458
- z22.object({
2459
- results: z22.array(
2460
- z22.object({
2461
- title: z22.string(),
2462
- url: z22.string(),
2463
- snippet: z22.string(),
2464
- date: z22.string().optional(),
2465
- lastUpdated: z22.string().optional()
2514
+ z23.object({
2515
+ results: z23.array(
2516
+ z23.object({
2517
+ title: z23.string(),
2518
+ url: z23.string(),
2519
+ snippet: z23.string(),
2520
+ date: z23.string().optional(),
2521
+ lastUpdated: z23.string().optional()
2466
2522
  })
2467
2523
  ),
2468
- id: z22.string()
2524
+ id: z23.string()
2469
2525
  }),
2470
2526
  // Error response
2471
- z22.object({
2472
- error: z22.enum([
2527
+ z23.object({
2528
+ error: z23.enum([
2473
2529
  "api_error",
2474
2530
  "rate_limit",
2475
2531
  "timeout",
2476
2532
  "invalid_input",
2477
2533
  "unknown"
2478
2534
  ]),
2479
- statusCode: z22.number().optional(),
2480
- message: z22.string()
2535
+ statusCode: z23.number().optional(),
2536
+ message: z23.string()
2481
2537
  })
2482
2538
  ])
2483
2539
  )
@@ -2492,208 +2548,208 @@ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
2492
2548
  // src/tool/tako-search.ts
2493
2549
  import {
2494
2550
  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
2495
- lazySchema as lazySchema21,
2496
- zodSchema as zodSchema21
2551
+ lazySchema as lazySchema22,
2552
+ zodSchema as zodSchema22
2497
2553
  } from "@ai-sdk/provider-utils";
2498
- import { z as z23 } from "zod";
2499
- var takoDataSourceInputSchema = () => z23.object({
2500
- count: z23.number().optional().describe(
2554
+ import { z as z24 } from "zod";
2555
+ var takoDataSourceInputSchema = () => z24.object({
2556
+ count: z24.number().optional().describe(
2501
2557
  "Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."
2502
2558
  ),
2503
- include_contents: z23.boolean().optional().describe(
2559
+ include_contents: z24.boolean().optional().describe(
2504
2560
  "Inline rows for each data result. This adds a data surcharge based on row count and dataset source. To estimate cost, search with include_contents disabled and inspect cards.content.export_pricing. This applies to every returned card; limit sources.data.count and sources.data.max_rows to control cost."
2505
2561
  ),
2506
- mode: z23.enum(["inline", "url"]).optional().describe(
2562
+ mode: z24.enum(["inline", "url"]).optional().describe(
2507
2563
  "Requested data delivery mode. Search card data is always inline."
2508
2564
  ),
2509
- content_format: z23.enum(["card_json", "csv", "json_compact", "json_records"]).optional().describe("Serialization for inlined card data."),
2510
- max_rows: z23.number().optional().describe(
2565
+ content_format: z24.enum(["card_json", "csv", "json_compact", "json_records"]).optional().describe("Serialization for inlined card data."),
2566
+ max_rows: z24.number().optional().describe(
2511
2567
  "Maximum rows to inline per result. Omit to use the allowance in cards.content.export_pricing. A data surcharge applies per 1,000 exported rows; lower values reduce cost."
2512
2568
  ),
2513
- node_ids: z23.array(z23.string()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),
2514
- strict: z23.boolean().optional().describe(
2569
+ node_ids: z24.array(z24.string()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),
2570
+ strict: z24.boolean().optional().describe(
2515
2571
  "Only return cards matching node_ids. Requires a non-empty node_ids."
2516
2572
  )
2517
2573
  });
2518
- var takoWebSourceInputSchema = () => z23.object({
2519
- count: z23.number().optional().describe("Maximum number of web results to return (1-20)."),
2520
- include_contents: z23.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
2521
- category: z23.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
2522
- include_domains: z23.array(z23.string()).optional().describe("Only return results from these bare domains."),
2523
- exclude_domains: z23.array(z23.string()).optional().describe("Exclude results from these bare domains."),
2524
- snippet_max_chars: z23.number().optional().describe("Maximum characters in each web-result snippet."),
2525
- highlights: z23.boolean().optional().describe(
2574
+ var takoWebSourceInputSchema = () => z24.object({
2575
+ count: z24.number().optional().describe("Maximum number of web results to return (1-20)."),
2576
+ include_contents: z24.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
2577
+ category: z24.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
2578
+ include_domains: z24.array(z24.string()).optional().describe("Only return results from these bare domains."),
2579
+ exclude_domains: z24.array(z24.string()).optional().describe("Exclude results from these bare domains."),
2580
+ snippet_max_chars: z24.number().optional().describe("Maximum characters in each web-result snippet."),
2581
+ highlights: z24.boolean().optional().describe(
2526
2582
  "Include highlighted passages in web results. Defaults to true in AI Gateway."
2527
2583
  ),
2528
- article_content_max_chars: z23.number().optional().describe(
2584
+ article_content_max_chars: z24.number().optional().describe(
2529
2585
  "Maximum extracted characters per web page when including contents."
2530
2586
  ),
2531
- published_after: z23.string().optional().describe(
2587
+ published_after: z24.string().optional().describe(
2532
2588
  "Keep results published on or after this ISO date (YYYY-MM-DD)."
2533
2589
  ),
2534
- published_before: z23.string().optional().describe(
2590
+ published_before: z24.string().optional().describe(
2535
2591
  "Keep results published on or before this ISO date (YYYY-MM-DD)."
2536
2592
  )
2537
2593
  });
2538
- var takoSearchInputSchema = lazySchema21(
2539
- () => zodSchema21(
2540
- z23.object({
2541
- query: z23.string().describe(
2594
+ var takoSearchInputSchema = lazySchema22(
2595
+ () => zodSchema22(
2596
+ z24.object({
2597
+ query: z24.string().describe(
2542
2598
  'Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.'
2543
2599
  ),
2544
- effort: z23.enum(["deep", "fast", "instant"]).optional().describe(
2600
+ effort: z24.enum(["deep", "fast", "instant"]).optional().describe(
2545
2601
  "Search effort. fast is the balanced default, instant favors cached results and low latency, and deep broadens retrieval with reranking at higher cost and latency."
2546
2602
  ),
2547
- sources: z23.object({
2603
+ sources: z24.object({
2548
2604
  data: takoDataSourceInputSchema().optional(),
2549
2605
  web: takoWebSourceInputSchema().optional()
2550
2606
  }).optional().describe(
2551
2607
  "Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."
2552
2608
  ),
2553
- location: z23.object({
2554
- latitude: z23.number().describe("Latitude between -90 and 90."),
2555
- longitude: z23.number().describe("Longitude between -180 and 180.")
2609
+ location: z24.object({
2610
+ latitude: z24.number().describe("Latitude between -90 and 90."),
2611
+ longitude: z24.number().describe("Longitude between -180 and 180.")
2556
2612
  }).optional().describe("End-user coordinates for localized results."),
2557
- country_code: z23.string().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),
2558
- locale: z23.string().optional().describe("BCP-47 locale, such as 'en-US'."),
2559
- timezone: z23.string().optional().describe("IANA timezone, such as 'America/New_York'."),
2560
- output_settings: z23.object({
2561
- image_dark_mode: z23.boolean().optional().describe("Render card preview images in dark mode."),
2562
- force_refresh: z23.boolean().optional().describe(
2613
+ country_code: z24.string().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),
2614
+ locale: z24.string().optional().describe("BCP-47 locale, such as 'en-US'."),
2615
+ timezone: z24.string().optional().describe("IANA timezone, such as 'America/New_York'."),
2616
+ output_settings: z24.object({
2617
+ image_dark_mode: z24.boolean().optional().describe("Render card preview images in dark mode."),
2618
+ force_refresh: z24.boolean().optional().describe(
2563
2619
  "Instant-effort only. Request a refreshed instant result."
2564
2620
  )
2565
2621
  }).optional().describe("Controls card rendering in the search response."),
2566
- include_related: z23.number().optional().describe("Maximum related search suggestions to include (1-20).")
2622
+ include_related: z24.number().optional().describe("Maximum related search suggestions to include (1-20).")
2567
2623
  })
2568
2624
  )
2569
2625
  );
2570
- var takoDatasetCellSchema = () => z23.union([z23.boolean(), z23.number(), z23.string()]).nullable();
2571
- var takoResultContentSchema = () => z23.object({
2572
- content_format: z23.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
2573
- cost: z23.number().optional(),
2574
- data: z23.string().nullish(),
2575
- records: z23.array(z23.record(z23.string(), takoDatasetCellSchema())).nullish(),
2576
- dataset: z23.object({
2577
- columns: z23.array(
2578
- z23.object({
2579
- name: z23.string(),
2580
- type: z23.enum(["boolean", "date", "datetime", "number", "string"]),
2581
- unit: z23.string().nullish()
2626
+ var takoDatasetCellSchema = () => z24.union([z24.boolean(), z24.number(), z24.string()]).nullable();
2627
+ var takoResultContentSchema = () => z24.object({
2628
+ content_format: z24.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
2629
+ cost: z24.number().optional(),
2630
+ data: z24.string().nullish(),
2631
+ records: z24.array(z24.record(z24.string(), takoDatasetCellSchema())).nullish(),
2632
+ dataset: z24.object({
2633
+ columns: z24.array(
2634
+ z24.object({
2635
+ name: z24.string(),
2636
+ type: z24.enum(["boolean", "date", "datetime", "number", "string"]),
2637
+ unit: z24.string().nullish()
2582
2638
  })
2583
2639
  ),
2584
- rows: z23.array(z23.array(takoDatasetCellSchema())),
2585
- total_rows: z23.number(),
2586
- truncated: z23.boolean(),
2587
- ref: z23.string(),
2588
- sources: z23.array(
2589
- z23.object({
2590
- name: z23.string(),
2591
- index: z23.enum(["data", "web"]).optional()
2640
+ rows: z24.array(z24.array(takoDatasetCellSchema())),
2641
+ total_rows: z24.number(),
2642
+ truncated: z24.boolean(),
2643
+ ref: z24.string(),
2644
+ sources: z24.array(
2645
+ z24.object({
2646
+ name: z24.string(),
2647
+ index: z24.enum(["data", "web"]).optional()
2592
2648
  })
2593
2649
  ),
2594
- provenance: z23.enum(["query", "web_extraction"]).optional()
2650
+ provenance: z24.enum(["query", "web_extraction"]).optional()
2595
2651
  }).nullish(),
2596
- card_data: z23.object({}).passthrough().nullish(),
2597
- card_data_schema: z23.object({}).passthrough().nullish(),
2598
- url: z23.string().nullish(),
2599
- expires_at: z23.string().nullish(),
2600
- total_rows: z23.number().nullish(),
2601
- truncated: z23.boolean().optional(),
2602
- premium_rows: z23.record(z23.string(), z23.number()).nullish(),
2603
- redacted_cells: z23.record(z23.string(), z23.array(z23.number())).nullish(),
2604
- total_matching: z23.number().nullish(),
2605
- export_pricing: z23.object({
2606
- baseline_usd: z23.number(),
2607
- free_rows: z23.number().optional(),
2608
- max_rows_ceiling: z23.number(),
2609
- row_cpm_usd: z23.number(),
2610
- premium_row_cpm_usd: z23.record(z23.string(), z23.number()).nullish(),
2611
- variable_cost_max_usd: z23.number().nullish()
2652
+ card_data: z24.object({}).passthrough().nullish(),
2653
+ card_data_schema: z24.object({}).passthrough().nullish(),
2654
+ url: z24.string().nullish(),
2655
+ expires_at: z24.string().nullish(),
2656
+ total_rows: z24.number().nullish(),
2657
+ truncated: z24.boolean().optional(),
2658
+ premium_rows: z24.record(z24.string(), z24.number()).nullish(),
2659
+ redacted_cells: z24.record(z24.string(), z24.array(z24.number())).nullish(),
2660
+ total_matching: z24.number().nullish(),
2661
+ export_pricing: z24.object({
2662
+ baseline_usd: z24.number(),
2663
+ free_rows: z24.number().optional(),
2664
+ max_rows_ceiling: z24.number(),
2665
+ row_cpm_usd: z24.number(),
2666
+ premium_row_cpm_usd: z24.record(z24.string(), z24.number()).nullish(),
2667
+ variable_cost_max_usd: z24.number().nullish()
2612
2668
  }).passthrough().nullish(),
2613
- manifest: z23.array(
2614
- z23.object({
2615
- dtype: z23.enum(["boolean", "date", "datetime", "number", "string"]).nullish(),
2616
- entity: z23.string().nullish(),
2617
- metric: z23.string().nullish(),
2618
- name: z23.string().nullish(),
2619
- unit: z23.string().nullish()
2669
+ manifest: z24.array(
2670
+ z24.object({
2671
+ dtype: z24.enum(["boolean", "date", "datetime", "number", "string"]).nullish(),
2672
+ entity: z24.string().nullish(),
2673
+ metric: z24.string().nullish(),
2674
+ name: z24.string().nullish(),
2675
+ unit: z24.string().nullish()
2620
2676
  })
2621
2677
  ).nullish()
2622
2678
  }).passthrough();
2623
- var takoCardSchema = () => z23.object({
2624
- card_id: z23.string().nullish(),
2625
- title: z23.string().nullish(),
2626
- description: z23.string().nullish(),
2627
- semantic_description: z23.string().nullish(),
2628
- webpage_url: z23.string().nullish(),
2629
- image_url: z23.string().nullish(),
2630
- embed_url: z23.string().nullish(),
2631
- sources: z23.array(
2632
- z23.object({
2633
- source_name: z23.string().nullish(),
2634
- source_description: z23.string().nullish(),
2635
- source_index: z23.enum(["data", "web"]),
2636
- source_text: z23.string().nullish(),
2637
- url: z23.string().nullish()
2679
+ var takoCardSchema = () => z24.object({
2680
+ card_id: z24.string().nullish(),
2681
+ title: z24.string().nullish(),
2682
+ description: z24.string().nullish(),
2683
+ semantic_description: z24.string().nullish(),
2684
+ webpage_url: z24.string().nullish(),
2685
+ image_url: z24.string().nullish(),
2686
+ embed_url: z24.string().nullish(),
2687
+ sources: z24.array(
2688
+ z24.object({
2689
+ source_name: z24.string().nullish(),
2690
+ source_description: z24.string().nullish(),
2691
+ source_index: z24.enum(["data", "web"]),
2692
+ source_text: z24.string().nullish(),
2693
+ url: z24.string().nullish()
2638
2694
  })
2639
2695
  ).nullish(),
2640
- methodologies: z23.array(
2641
- z23.object({
2642
- methodology_name: z23.string().nullable(),
2643
- methodology_description: z23.string().nullable()
2696
+ methodologies: z24.array(
2697
+ z24.object({
2698
+ methodology_name: z24.string().nullable(),
2699
+ methodology_description: z24.string().nullable()
2644
2700
  })
2645
2701
  ).nullish(),
2646
- source_indexes: z23.array(z23.enum(["data", "web"])).nullish(),
2647
- card_type: z23.string().nullish(),
2648
- relevance: z23.enum(["High", "Low", "Medium"]).nullish(),
2649
- relevance_score: z23.number().nullish(),
2702
+ source_indexes: z24.array(z24.enum(["data", "web"])).nullish(),
2703
+ card_type: z24.string().nullish(),
2704
+ relevance: z24.enum(["High", "Low", "Medium"]).nullish(),
2705
+ relevance_score: z24.number().nullish(),
2650
2706
  content: takoResultContentSchema().nullish(),
2651
- exportable: z23.boolean().optional(),
2652
- nodes: z23.array(
2653
- z23.object({
2654
- id: z23.string(),
2655
- type: z23.enum(["entity", "metric"]),
2656
- name: z23.string(),
2657
- description: z23.string().nullish()
2707
+ exportable: z24.boolean().optional(),
2708
+ nodes: z24.array(
2709
+ z24.object({
2710
+ id: z24.string(),
2711
+ type: z24.enum(["entity", "metric"]),
2712
+ name: z24.string(),
2713
+ description: z24.string().nullish()
2658
2714
  })
2659
2715
  ).nullish(),
2660
- metric_definitions: z23.array(z23.object({ name: z23.string(), definition: z23.string() })).nullish(),
2661
- data_freshness: z23.object({
2662
- coverage_end: z23.string().nullish(),
2663
- data_as_of: z23.string().nullish(),
2664
- last_updated: z23.string().nullish()
2716
+ metric_definitions: z24.array(z24.object({ name: z24.string(), definition: z24.string() })).nullish(),
2717
+ data_freshness: z24.object({
2718
+ coverage_end: z24.string().nullish(),
2719
+ data_as_of: z24.string().nullish(),
2720
+ last_updated: z24.string().nullish()
2665
2721
  }).nullish(),
2666
- placeholder: z23.object({
2667
- withheld_source: z23.string(),
2668
- reason: z23.enum(["not_served", "over_cap"]).nullish()
2722
+ placeholder: z24.object({
2723
+ withheld_source: z24.string(),
2724
+ reason: z24.enum(["not_served", "over_cap"]).nullish()
2669
2725
  }).passthrough().nullish()
2670
2726
  }).passthrough();
2671
- var takoWebResultSchema = () => z23.object({
2672
- title: z23.string(),
2673
- url: z23.string(),
2674
- snippet: z23.string().nullish(),
2675
- source_name: z23.string().nullish(),
2676
- publish_date: z23.string().nullish(),
2727
+ var takoWebResultSchema = () => z24.object({
2728
+ title: z24.string(),
2729
+ url: z24.string(),
2730
+ snippet: z24.string().nullish(),
2731
+ source_name: z24.string().nullish(),
2732
+ publish_date: z24.string().nullish(),
2677
2733
  content: takoResultContentSchema().nullish()
2678
2734
  }).passthrough();
2679
- var takoSearchOutputSchema = lazySchema21(
2680
- () => zodSchema21(
2681
- z23.union([
2682
- z23.object({
2683
- request_id: z23.string(),
2684
- cards: z23.array(takoCardSchema()).optional(),
2685
- web_results: z23.array(takoWebResultSchema()).optional(),
2686
- usage: z23.object({
2687
- total_cost_usd: z23.number(),
2688
- compute: z23.object({ cost_usd: z23.number() }).passthrough().nullish(),
2689
- data: z23.object({
2690
- cost_usd: z23.number(),
2691
- datasets: z23.number(),
2692
- data_points: z23.number().nullish()
2735
+ var takoSearchOutputSchema = lazySchema22(
2736
+ () => zodSchema22(
2737
+ z24.union([
2738
+ z24.object({
2739
+ request_id: z24.string(),
2740
+ cards: z24.array(takoCardSchema()).optional(),
2741
+ web_results: z24.array(takoWebResultSchema()).optional(),
2742
+ usage: z24.object({
2743
+ total_cost_usd: z24.number(),
2744
+ compute: z24.object({ cost_usd: z24.number() }).passthrough().nullish(),
2745
+ data: z24.object({
2746
+ cost_usd: z24.number(),
2747
+ datasets: z24.number(),
2748
+ data_points: z24.number().nullish()
2693
2749
  }).passthrough().nullish(),
2694
- variable_cost: z23.object({ cost_usd: z23.number() }).passthrough().nullish()
2750
+ variable_cost: z24.object({ cost_usd: z24.number() }).passthrough().nullish()
2695
2751
  }).passthrough().nullish(),
2696
- related: z23.array(z23.object({}).passthrough()).nullish()
2752
+ related: z24.array(z24.object({}).passthrough()).nullish()
2697
2753
  }).passthrough(),
2698
2754
  gatewayToolErrorSchema()
2699
2755
  ])
@@ -2772,22 +2828,22 @@ var gatewayTools = {
2772
2828
  import { getContext } from "@vercel/oidc";
2773
2829
  import { getVercelOidcToken } from "@vercel/oidc";
2774
2830
  async function getVercelRequestId() {
2775
- var _a11;
2776
- return (_a11 = getContext().headers) == null ? void 0 : _a11["x-vercel-id"];
2831
+ var _a12;
2832
+ return (_a12 = getContext().headers) == null ? void 0 : _a12["x-vercel-id"];
2777
2833
  }
2778
2834
 
2779
2835
  // src/version.ts
2780
- var VERSION = true ? "3.0.237" : "0.0.0-test";
2836
+ var VERSION = true ? "3.0.238" : "0.0.0-test";
2781
2837
 
2782
2838
  // src/gateway-provider.ts
2783
2839
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
2784
2840
  function createGatewayProvider(options = {}) {
2785
- var _a11, _b11;
2841
+ var _a12, _b12;
2786
2842
  let pendingMetadata = null;
2787
2843
  let metadataCache = null;
2788
- const cacheRefreshMillis = (_a11 = options.metadataCacheRefreshMillis) != null ? _a11 : 1e3 * 60 * 5;
2844
+ const cacheRefreshMillis = (_a12 = options.metadataCacheRefreshMillis) != null ? _a12 : 1e3 * 60 * 5;
2789
2845
  let lastFetchTime = 0;
2790
- const baseURL = (_b11 = withoutTrailingSlash(options.baseURL)) != null ? _b11 : "https://ai-gateway.vercel.sh/v3/ai";
2846
+ const baseURL = (_b12 = withoutTrailingSlash(options.baseURL)) != null ? _b12 : "https://ai-gateway.vercel.sh/v3/ai";
2791
2847
  const getHeaders = async () => {
2792
2848
  try {
2793
2849
  const auth = await getGatewayAuthToken(options);
@@ -2847,8 +2903,8 @@ function createGatewayProvider(options = {}) {
2847
2903
  });
2848
2904
  };
2849
2905
  const getAvailableModels = async () => {
2850
- var _a12, _b12, _c;
2851
- const now = (_c = (_b12 = (_a12 = options._internal) == null ? void 0 : _a12.currentDate) == null ? void 0 : _b12.call(_a12).getTime()) != null ? _c : Date.now();
2906
+ var _a13, _b13, _c;
2907
+ const now = (_c = (_b13 = (_a13 = options._internal) == null ? void 0 : _a13.currentDate) == null ? void 0 : _b13.call(_a13).getTime()) != null ? _c : Date.now();
2852
2908
  if (!pendingMetadata || now - lastFetchTime > cacheRefreshMillis) {
2853
2909
  lastFetchTime = now;
2854
2910
  pendingMetadata = new GatewayFetchMetadata({
@@ -3005,6 +3061,7 @@ async function getGatewayAuthToken(options) {
3005
3061
  };
3006
3062
  }
3007
3063
  export {
3064
+ GatewayAccessPolicyDeniedError,
3008
3065
  GatewayAuthenticationError,
3009
3066
  GatewayError,
3010
3067
  GatewayFailedDependencyError,