@broberg/ai-sdk 0.64.2 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -17,11 +17,13 @@ import {
17
17
  MEDIA_PRICING,
18
18
  MEDIA_PRICING_CHECKED_AT,
19
19
  PRICING_STALE_AFTER_DAYS,
20
+ cheapestModels,
21
+ classifyKind,
20
22
  getMediaPrice,
21
23
  listMediaPrices,
22
24
  pricingFreshness,
23
25
  pricingGeneratedAt
24
- } from "./chunk-JMRWFOAC.js";
26
+ } from "./chunk-D53S242W.js";
25
27
  import {
26
28
  PRICING,
27
29
  getPrice
@@ -3732,13 +3734,13 @@ var tierSpecSchema = z.object({
3732
3734
  var toolSchema = z.object({
3733
3735
  name: z.string(),
3734
3736
  description: z.string(),
3735
- parameters: z.record(z.unknown())
3737
+ parameters: z.record(z.string(), z.unknown())
3736
3738
  });
3737
3739
  var toolCallSchema = z.object({
3738
3740
  id: z.string(),
3739
3741
  name: z.string(),
3740
- arguments: z.record(z.unknown()).optional(),
3741
- args: z.record(z.unknown()).optional()
3742
+ arguments: z.record(z.string(), z.unknown()).optional(),
3743
+ args: z.record(z.string(), z.unknown()).optional()
3742
3744
  }).refine((tc) => tc.arguments !== void 0 || tc.args !== void 0, {
3743
3745
  message: "tool call needs `arguments` (canonical) or `args` (@broberg/chat's spelling)",
3744
3746
  path: ["arguments"]
@@ -3902,7 +3904,7 @@ var moderationInputSchema = z.object({
3902
3904
  input: z.union([z.string(), z.array(z.string())]),
3903
3905
  ...callOptions
3904
3906
  });
3905
- var judgeEntrySchema = z.union([z.string().min(1), z.null(), z.array(z.unknown()), z.record(z.unknown())]);
3907
+ var judgeEntrySchema = z.union([z.string().min(1), z.null(), z.array(z.unknown()), z.record(z.string(), z.unknown())]);
3906
3908
  var judgeQuestionSchema = z.discriminatedUnion("type", [
3907
3909
  z.object({
3908
3910
  type: z.literal("noul"),
@@ -3927,7 +3929,7 @@ var judgeQuestionSchema = z.discriminatedUnion("type", [
3927
3929
  })
3928
3930
  ]);
3929
3931
  var judgeInputSchema = z.object({
3930
- state: z.union([z.string().min(1), z.array(z.string()), z.record(z.unknown())]),
3932
+ state: z.union([z.string().min(1), z.array(z.string()), z.record(z.string(), z.unknown())]),
3931
3933
  questions: z.record(z.string(), judgeQuestionSchema).refine((q) => Object.keys(q).length > 0, {
3932
3934
  message: "judge needs at least one question"
3933
3935
  }),
@@ -3995,7 +3997,7 @@ var aiConfigSchema = z.object({
3995
3997
  promptCache: z.boolean().optional(),
3996
3998
  /** F077.3 — refuse any "-latest" model id unless the call passes allowFloating: true. */
3997
3999
  strictPinning: z.boolean().optional(),
3998
- defaults: z.record(tierSchema, tierSpecSchema).optional(),
4000
+ defaults: z.partialRecord(tierSchema, tierSpecSchema).optional(),
3999
4001
  // Functions can't be deeply validated — z.custom asserts the TS type and
4000
4002
  // passes the value through untouched.
4001
4003
  providers: z.record(z.string(), z.custom()).optional(),
@@ -4014,8 +4016,8 @@ var aiConfigSchema = z.object({
4014
4016
  import { randomUUID } from "crypto";
4015
4017
 
4016
4018
  // src/version.ts
4017
- var VERSION = "0.64.2";
4018
- var SDK_TAG = "@broberg/ai-sdk@0.64.2";
4019
+ var VERSION = "0.66.0";
4020
+ var SDK_TAG = "@broberg/ai-sdk@0.66.0";
4019
4021
 
4020
4022
  // src/cost/sinks/upmetrics.ts
4021
4023
  function isRetryableStatus(status) {
@@ -5594,8 +5596,10 @@ export {
5594
5596
  bflCredits,
5595
5597
  byokAdapter,
5596
5598
  chatInputSchema,
5599
+ cheapestModels,
5597
5600
  checkPriceDrift,
5598
5601
  checkVoice,
5602
+ classifyKind,
5599
5603
  classifyRegionName,
5600
5604
  computeCost,
5601
5605
  createAI,