@broberg/ai-sdk 0.69.4 → 0.70.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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CostSink, T as Tier, U as Usage, a as ChatResult, b as ChatStreamEvent, c as TranslateResult, I as ImageResult, A as AnimateResult, d as TrainStyleResult, E as EmbeddingResult, e as TranscribeResult, O as OcrResult, M as ModerationResult, J as JudgeResult, P as PodcastResult, B as BatchRequestItem, f as TierSpec, g as BatchJob, h as BatchResultItem, i as ProviderAdapter, j as ToolCall, k as Tool, l as Transport, m as Capability, R as Region, n as BudgetConfig, o as BudgetStore } from './registry-rn-6k7Zt.js';
2
- export { p as AlignedWordTimings, q as AvailabilitySource, r as AvailabilityStatus, s as AzureWordBoundary, t as CallOptions, u as ChatRequest, v as ContentPart, D as DialogueRequest, w as DialogueTurn, x as EmbeddingRequest, y as ImageRequest, z as JudgeAnswer, F as JudgeChoiceAnswer, G as JudgeNoulAnswer, H as JudgeQuestion, K as JudgeScoreAnswer, L as LoraWeight, N as Message, Q as ModelStatus, S as ModelUnavailableError, V as ModerationItem, W as ModerationRequest, X as OcrPage, Y as OcrRequest, Z as ResolveOptions, _ as ResolveResult, $ as Role, a0 as TierDescription, a1 as TrainStyleRequest, a2 as TranscribeRequest, a3 as TtsRequest, a4 as WordTiming, a5 as alignWordTimings, a6 as classifyRegionName, a7 as describeTier, a8 as listModels, a9 as regionOfHost, aa as regionOfProvider, ab as resolveModel } from './registry-rn-6k7Zt.js';
1
+ import { C as CostSink, T as Tier, U as Usage, a as ChatResult, b as ChatStreamEvent, c as TranslateResult, I as ImageResult, A as AnimateResult, d as TrainStyleResult, E as EmbeddingResult, e as TranscribeResult, O as OcrResult, M as ModerationResult, J as JudgeResult, V as VectorizeResult, P as PodcastResult, B as BatchRequestItem, f as TierSpec, g as BatchJob, h as BatchResultItem, i as ProviderAdapter, j as ToolCall, k as Tool, l as Transport, m as Capability, R as Region, n as BudgetConfig, o as BudgetStore } from './registry-CCKJyveA.js';
2
+ export { p as AlignedWordTimings, q as AvailabilitySource, r as AvailabilityStatus, s as AzureWordBoundary, t as CallOptions, u as ChatRequest, v as ContentPart, D as DialogueRequest, w as DialogueTurn, x as EmbeddingRequest, y as ImageRequest, z as JudgeAnswer, F as JudgeChoiceAnswer, G as JudgeNoulAnswer, H as JudgeQuestion, K as JudgeScoreAnswer, L as LoraWeight, N as Message, Q as ModelStatus, S as ModelUnavailableError, W as ModerationItem, X as ModerationRequest, Y as OcrPage, Z as OcrRequest, _ as ResolveOptions, $ as ResolveResult, a0 as Role, a1 as TierDescription, a2 as TrainStyleRequest, a3 as TranscribeRequest, a4 as TtsRequest, a5 as WordTiming, a6 as alignWordTimings, a7 as classifyRegionName, a8 as describeTier, a9 as listModels, aa as regionOfHost, ab as regionOfProvider, ac as resolveModel } from './registry-CCKJyveA.js';
3
3
  import { z } from 'zod';
4
4
  export { CheapestQuery, CheapestResult, CheapestRow, DEFAULT_CLIP_SEC, MEDIA_PRICING_CHECKED_AT, MediaPrice, MediaUnit, PRICING_STALE_AFTER_DAYS, PriceKind, PricingFreshness, UnitFreshness, UpstreamStatus, cheapestModels, classifyKind, getMediaPrice, listMediaPrices, pricingFreshness, pricingGeneratedAt } from './pricing.js';
5
5
 
@@ -837,6 +837,49 @@ declare const moderationInputSchema: z.ZodObject<{
837
837
  labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
838
838
  input: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
839
839
  }, z.core.$strip>;
840
+ declare const vectorizeInputSchema: z.ZodObject<{
841
+ tier: z.ZodOptional<z.ZodEnum<{
842
+ vision: "vision";
843
+ video: "video";
844
+ embedding: "embedding";
845
+ fast: "fast";
846
+ smart: "smart";
847
+ powerful: "powerful";
848
+ cheap: "cheap";
849
+ }>>;
850
+ override: z.ZodOptional<z.ZodObject<{
851
+ provider: z.ZodOptional<z.ZodString>;
852
+ model: z.ZodOptional<z.ZodString>;
853
+ transport: z.ZodOptional<z.ZodEnum<{
854
+ http: "http";
855
+ subprocess: "subprocess";
856
+ }>>;
857
+ }, z.core.$strip>>;
858
+ fallback: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
859
+ vision: "vision";
860
+ video: "video";
861
+ embedding: "embedding";
862
+ fast: "fast";
863
+ smart: "smart";
864
+ powerful: "powerful";
865
+ cheap: "cheap";
866
+ }>, z.ZodObject<{
867
+ provider: z.ZodString;
868
+ model: z.ZodString;
869
+ transport: z.ZodEnum<{
870
+ http: "http";
871
+ subprocess: "subprocess";
872
+ }>;
873
+ }, z.core.$strip>]>>>;
874
+ purpose: z.ZodOptional<z.ZodString>;
875
+ allowFloating: z.ZodOptional<z.ZodBoolean>;
876
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
877
+ image: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
878
+ shapeStacking: z.ZodOptional<z.ZodEnum<{
879
+ hierarchical: "hierarchical";
880
+ cut_out: "cut_out";
881
+ }>>;
882
+ }, z.core.$strip>;
840
883
  declare const judgeInputSchema: z.ZodObject<{
841
884
  tier: z.ZodOptional<z.ZodEnum<{
842
885
  vision: "vision";
@@ -1040,6 +1083,7 @@ type TranscribeInput = z.infer<typeof transcribeInputSchema>;
1040
1083
  type OcrInput = z.infer<typeof ocrInputSchema>;
1041
1084
  type ModerationInput = z.infer<typeof moderationInputSchema>;
1042
1085
  type JudgeInput = z.infer<typeof judgeInputSchema>;
1086
+ type VectorizeInput = z.infer<typeof vectorizeInputSchema>;
1043
1087
  type PodcastInput = z.infer<typeof podcastInputSchema>;
1044
1088
  type TtsInput = z.infer<typeof ttsInputSchema>;
1045
1089
  type AiConfig = z.infer<typeof aiConfigSchema>;
@@ -1076,6 +1120,8 @@ interface AiClient {
1076
1120
  /** F078 — web search through ai-sdk; reports every call to this client's cost sink
1077
1121
  * with the client's labels. Same request/result as the standalone `search()`. */
1078
1122
  search(req: SearchRequest, opts?: Omit<SearchOptions, "costSink">): Promise<SearchResult>;
1123
+ /** F070 — raster image → SVG (Recraft). Returns the SVG text, already downloaded. */
1124
+ vectorize(input: VectorizeInput): Promise<VectorizeResult>;
1079
1125
  /** Podcast (F020) — a finished manuscript → one multi-voice audio episode. ElevenLabs. */
1080
1126
  podcast(input: PodcastInput): Promise<PodcastResult>;
1081
1127
  /** Single-voice TTS (F020.4) — text → audio. `voice` = curated name or voiceId. ElevenLabs. */
@@ -1297,6 +1343,12 @@ declare function microsoftDecisionAdapter(config?: {
1297
1343
  fetch?: typeof fetch;
1298
1344
  }): ProviderAdapter;
1299
1345
 
1346
+ declare function recraftAdapter(config?: {
1347
+ apiKey?: string;
1348
+ baseUrl?: string;
1349
+ fetch?: typeof fetch;
1350
+ }): ProviderAdapter;
1351
+
1300
1352
  interface FalAdapterConfig {
1301
1353
  apiKey?: string;
1302
1354
  /** "sync" (default — fal.run, fast models) or "queue" (queue.fal.run, polled). */
@@ -1447,8 +1499,8 @@ declare const falStubAdapter: ProviderAdapter;
1447
1499
  * wires the live adapters. */
1448
1500
  declare const stubProviders: Record<string, ProviderAdapter>;
1449
1501
 
1450
- declare const VERSION: "0.69.4";
1451
- declare const SDK_TAG: "@broberg/ai-sdk@0.69.4";
1502
+ declare const VERSION: "0.70.0";
1503
+ declare const SDK_TAG: "@broberg/ai-sdk@0.70.0";
1452
1504
 
1453
1505
  /** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
1454
1506
  * per-call override.
@@ -1883,6 +1935,7 @@ declare const DEFAULT_BASE_URLS: {
1883
1935
  readonly openai: "https://api.openai.com/v1";
1884
1936
  readonly openrouter: "https://openrouter.ai/api/v1";
1885
1937
  readonly typesafe: "https://api.typesafe.ai/v1";
1938
+ readonly recraft: "https://external.api.recraft.ai/v1";
1886
1939
  };
1887
1940
  type FixedHostProvider = keyof typeof DEFAULT_BASE_URLS;
1888
1941
  /** `bfl` is DELIBERATELY ABSENT. Its adapter hard-pins `https://api.eu.bfl.ai` in a local
@@ -2014,4 +2067,4 @@ declare function memorySearchCache(max?: number): SearchCache;
2014
2067
 
2015
2068
  declare function search(req: SearchRequest, opts?: SearchOptions): Promise<SearchResult>;
2016
2069
 
2017
- export { AZURE_DANISH_VOICES, AZURE_DANISH_VOICE_LIST, type AiClient, type AiConfig, type AzureVoiceInfo, BatchJob, BatchRequestItem, BatchResultItem, type BflAdapterConfig, type BflCredits, BudgetConfig, BudgetExceededError, BudgetGuard, BudgetStore, CONFIG_DERIVED_HOSTS, Capability, type ChatInput, ChatResult, ChatStreamEvent, type CheckVoiceOptions, type ClassifyInput, type ClassifyResult, type Contracts, type CostQuery, CostSink, type CostSummary, type CostSummaryQuery, type CostTimeseriesQuery, DEFAULT_BASE_URLS, DEFAULT_SEARCH_ROUTES, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DiscordSinkConfig, ELEVENLABS_DANISH_VOICES, type EmbeddingInput, EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type FixedHostProvider, type HttpResponse, INPUT_LIMITS, type ImageInput, ImageResult, type JudgeInput, JudgeResult, LOCALLY_PINNED_HOSTS, MICROSOFT_DECISION_DEFAULT_DEPLOYMENT, type MockupInput, type MockupResult, type ModerationInput, ModerationResult, type OcrInput, OcrResult, type OpenAICompatibleConfig, type PodcastInput, PodcastResult, type PriceDriftResult, type PriceDriftRow, type PricingEntry, ProviderAdapter, type RefreshOptions, type RefreshResult, Region, type RerankInput, type RerankResult, type RouteForecast, SDK_TAG, SEARCH_CACHE_TTL_MS, SEARCH_PRICE_USD, SearchBudgetExceededError, type SearchCache, type SearchCapStore, type SearchCredentials, type SearchItem, SearchKeyMissingError, type SearchOptions, type SearchProviderId, type SearchPurpose, type SearchRequest, type SearchResult, type SearchRoute, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, Tier, TierSpec, Tool, ToolCall, type TrainStyleInput, TrainStyleResult, type TranscribeInput, TranscribeResult, type TranslateInput, TranslateResult, Transport, type TransportRequest, type TransportResponse, type TtsInput, type UpmetricsCostClientConfig, UpmetricsCostError, type UpmetricsCostRow, type UpmetricsCostSummary, type UpmetricsCostTimeseries, type UpmetricsSink, type UpmetricsSinkConfig, type UpmetricsSinkStats, Usage, VERSION, type VideoInput, type VisionInput, type VoiceInfo, type VoiceProvider, type VoiceResolveResult, type VoiceStatus, VoiceUnavailableError, type WebSearchContext, type WebSearchToolResult, ZDR_PROVIDERS, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, azureAdapter, bflAdapter, bflCredits, byokAdapter, chatInputSchema, checkPriceDrift, checkVoice, computeCost, createAI, deepinfraAdapter, deeplAdapter, deepseekAdapter, defaultBaseUrl, defaultProviders, discordSink, elevenlabsAdapter, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, isByokKeyed, listAzureDanishVoices, listVoices, makeContracts, makeOpenAICompatibleAdapter, matchLabel, memorySearchCache, messageSchema, microsoftDecisionAdapter, mistralAdapter, mistralStubAdapter, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, refreshAvailability, requestyAdapter, resetRefreshState, resetRegistry, resolveAzureVoice, resolveTier, resolveVoice, routeSearch, runWebSearch, search, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, typesafeAdapter, upmetricsCostClient, upmetricsSink, usdFromMicro, vertexAdapter, visionInputSchema, webSearchTool, wouldProviderRouteTo, wouldRouteTo };
2070
+ export { AZURE_DANISH_VOICES, AZURE_DANISH_VOICE_LIST, type AiClient, type AiConfig, type AzureVoiceInfo, BatchJob, BatchRequestItem, BatchResultItem, type BflAdapterConfig, type BflCredits, BudgetConfig, BudgetExceededError, BudgetGuard, BudgetStore, CONFIG_DERIVED_HOSTS, Capability, type ChatInput, ChatResult, ChatStreamEvent, type CheckVoiceOptions, type ClassifyInput, type ClassifyResult, type Contracts, type CostQuery, CostSink, type CostSummary, type CostSummaryQuery, type CostTimeseriesQuery, DEFAULT_BASE_URLS, DEFAULT_SEARCH_ROUTES, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DiscordSinkConfig, ELEVENLABS_DANISH_VOICES, type EmbeddingInput, EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type FixedHostProvider, type HttpResponse, INPUT_LIMITS, type ImageInput, ImageResult, type JudgeInput, JudgeResult, LOCALLY_PINNED_HOSTS, MICROSOFT_DECISION_DEFAULT_DEPLOYMENT, type MockupInput, type MockupResult, type ModerationInput, ModerationResult, type OcrInput, OcrResult, type OpenAICompatibleConfig, type PodcastInput, PodcastResult, type PriceDriftResult, type PriceDriftRow, type PricingEntry, ProviderAdapter, type RefreshOptions, type RefreshResult, Region, type RerankInput, type RerankResult, type RouteForecast, SDK_TAG, SEARCH_CACHE_TTL_MS, SEARCH_PRICE_USD, SearchBudgetExceededError, type SearchCache, type SearchCapStore, type SearchCredentials, type SearchItem, SearchKeyMissingError, type SearchOptions, type SearchProviderId, type SearchPurpose, type SearchRequest, type SearchResult, type SearchRoute, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, Tier, TierSpec, Tool, ToolCall, type TrainStyleInput, TrainStyleResult, type TranscribeInput, TranscribeResult, type TranslateInput, TranslateResult, Transport, type TransportRequest, type TransportResponse, type TtsInput, type UpmetricsCostClientConfig, UpmetricsCostError, type UpmetricsCostRow, type UpmetricsCostSummary, type UpmetricsCostTimeseries, type UpmetricsSink, type UpmetricsSinkConfig, type UpmetricsSinkStats, Usage, VERSION, type VideoInput, type VisionInput, type VoiceInfo, type VoiceProvider, type VoiceResolveResult, type VoiceStatus, VoiceUnavailableError, type WebSearchContext, type WebSearchToolResult, ZDR_PROVIDERS, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, azureAdapter, bflAdapter, bflCredits, byokAdapter, chatInputSchema, checkPriceDrift, checkVoice, computeCost, createAI, deepinfraAdapter, deeplAdapter, deepseekAdapter, defaultBaseUrl, defaultProviders, discordSink, elevenlabsAdapter, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, isByokKeyed, listAzureDanishVoices, listVoices, makeContracts, makeOpenAICompatibleAdapter, matchLabel, memorySearchCache, messageSchema, microsoftDecisionAdapter, mistralAdapter, mistralStubAdapter, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, recraftAdapter, refreshAvailability, requestyAdapter, resetRefreshState, resetRegistry, resolveAzureVoice, resolveTier, resolveVoice, routeSearch, runWebSearch, search, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, typesafeAdapter, upmetricsCostClient, upmetricsSink, usdFromMicro, vertexAdapter, visionInputSchema, webSearchTool, wouldProviderRouteTo, wouldRouteTo };
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  listMediaPrices,
24
24
  pricingFreshness,
25
25
  pricingGeneratedAt
26
- } from "./chunk-NDLYPW3M.js";
26
+ } from "./chunk-4YQVYVTA.js";
27
27
  import {
28
28
  PRICING,
29
29
  getPrice
@@ -410,7 +410,9 @@ var DEFAULT_BASE_URLS = {
410
410
  openai: "https://api.openai.com/v1",
411
411
  openrouter: "https://openrouter.ai/api/v1",
412
412
  // F066. US-hosted per the TypeSafe privacy policy — see region.ts.
413
- typesafe: "https://api.typesafe.ai/v1"
413
+ typesafe: "https://api.typesafe.ai/v1",
414
+ // F070 — Recraft (vectorize). Residency not stated where we looked — see region.ts.
415
+ recraft: "https://external.api.recraft.ai/v1"
414
416
  };
415
417
  var LOCALLY_PINNED_HOSTS = {
416
418
  bfl: "https://api.eu.bfl.ai"
@@ -655,6 +657,9 @@ var HOST_REGION = {
655
657
  // COPENHAGEN edge (cf-ray …-CPH). That is where the TLS terminated, not where the data
656
658
  // is processed — a host behind a CDN cannot have its residency read off the edge.
657
659
  "api.typesafe.ai": "us",
660
+ // F070 — Recraft. We have not found where it processes data (read 2026-10-07), so
661
+ // "unknown": only "eu" is a residency claim, and we will not invent one.
662
+ "external.api.recraft.ai": "unknown",
658
663
  // Aggregators: the host is theirs, the upstream is not ours to know.
659
664
  "openrouter.ai": "unknown",
660
665
  "router.requesty.ai": "unknown"
@@ -3449,6 +3454,52 @@ function bflAdapter(config = {}) {
3449
3454
  return { name: "bfl", image, animate };
3450
3455
  }
3451
3456
 
3457
+ // src/providers/recraft.ts
3458
+ function recraftAdapter(config = {}) {
3459
+ const fetchImpl = config.fetch ?? fetch;
3460
+ const baseUrl = config.baseUrl ?? DEFAULT_BASE_URLS.recraft;
3461
+ function key() {
3462
+ const k = config.apiKey ?? process.env.RECRAFT_API_TOKEN;
3463
+ if (!k) throw new Error("recraft adapter: API token not set (env RECRAFT_API_TOKEN)");
3464
+ return k;
3465
+ }
3466
+ async function vectorize(req) {
3467
+ const token = key();
3468
+ const imageUrl = typeof req.image === "string" && /^https?:\/\//i.test(req.image) ? req.image : await toInlineImage(req.image, fetchImpl).then(({ data: data2, mimeType }) => `data:${mimeType};base64,${data2}`);
3469
+ const body = { image_url: imageUrl };
3470
+ if (req.shapeStacking) body.shape_stacking = req.shapeStacking;
3471
+ const res = await fetchImpl(`${baseUrl}/images/vectorize`, {
3472
+ method: "POST",
3473
+ headers: { "content-type": "application/json", authorization: `Bearer ${token}` },
3474
+ body: JSON.stringify(body)
3475
+ });
3476
+ if (!res.ok) {
3477
+ const errBody = await res.text().catch(() => "");
3478
+ throw new Error(`recraft vectorize ${res.status}: ${errBody.slice(0, 300)}`);
3479
+ }
3480
+ const data = await res.json();
3481
+ const url = data.image?.url;
3482
+ if (!url) throw new Error("recraft vectorize: response contained no image url");
3483
+ const svgRes = await fetchImpl(url);
3484
+ if (!svgRes.ok) throw new Error(`recraft vectorize: could not download the SVG (${svgRes.status})`);
3485
+ const svg = await svgRes.text();
3486
+ if (!svg.includes("<svg")) throw new Error("recraft vectorize: downloaded file is not an SVG");
3487
+ const usage = freshUsage({
3488
+ provider: "recraft",
3489
+ region: regionOfHost(baseUrl),
3490
+ model: req.spec.model,
3491
+ transport: "http",
3492
+ capability: "vectorize",
3493
+ inputTokens: 0,
3494
+ outputTokens: 0
3495
+ });
3496
+ usage.costUsd = getMediaPrice("recraft", "vectorize")?.usd ?? 0;
3497
+ usage.costBasis = "estimated";
3498
+ return { svg, usage };
3499
+ }
3500
+ return { name: "recraft", vectorize };
3501
+ }
3502
+
3452
3503
  // src/providers/registry.ts
3453
3504
  var defaultProviders = {
3454
3505
  anthropic: anthropicAdapter(),
@@ -3466,7 +3517,8 @@ var defaultProviders = {
3466
3517
  typesafe: typesafeAdapter(),
3467
3518
  "microsoft-decision": microsoftDecisionAdapter(),
3468
3519
  fal: falAdapter(),
3469
- bfl: bflAdapter()
3520
+ bfl: bflAdapter(),
3521
+ recraft: recraftAdapter()
3470
3522
  };
3471
3523
 
3472
3524
  // src/cost/budget.ts
@@ -4119,6 +4171,11 @@ var judgeQuestionSchema = z.discriminatedUnion("type", [
4119
4171
  criteria: z.array(judgeEntrySchema).min(2).max(10)
4120
4172
  })
4121
4173
  ]);
4174
+ var vectorizeInputSchema = z.object({
4175
+ image: z.union([z.string().min(1), z.instanceof(Uint8Array)]),
4176
+ shapeStacking: z.enum(["hierarchical", "cut_out"]).optional(),
4177
+ ...callOptions
4178
+ });
4122
4179
  var judgeInputSchema = z.object({
4123
4180
  state: z.union([z.string().min(1), z.array(z.string()).max(L.stateItems), z.record(z.string(), z.unknown())]),
4124
4181
  questions: z.record(z.string(), judgeQuestionSchema).refine((q) => Object.keys(q).length > 0, {
@@ -4207,8 +4264,8 @@ var aiConfigSchema = z.object({
4207
4264
  import { randomUUID } from "crypto";
4208
4265
 
4209
4266
  // src/version.ts
4210
- var VERSION = "0.69.4";
4211
- var SDK_TAG = "@broberg/ai-sdk@0.69.4";
4267
+ var VERSION = "0.70.0";
4268
+ var SDK_TAG = "@broberg/ai-sdk@0.70.0";
4212
4269
 
4213
4270
  // src/cost/sinks/upmetrics.ts
4214
4271
  function isRetryableStatus(status) {
@@ -4542,6 +4599,7 @@ function judgeSpecFromEnv() {
4542
4599
  if (!spec) throw new Error(`createAI: AI_JUDGE_PROVIDER="${v}" is not a judge route \u2014 use ${Object.keys(JUDGE_SPECS).join(" or ")}`);
4543
4600
  return spec;
4544
4601
  }
4602
+ var DEFAULT_VECTORIZE_SPEC = { provider: "recraft", model: "vectorize", transport: "http" };
4545
4603
  var DEFAULT_PODCAST_SPEC = { provider: "elevenlabs", model: "eleven_v3", transport: "http" };
4546
4604
  var DEFAULT_TTS_SPEC = { provider: "elevenlabs", model: "eleven_multilingual_v2", transport: "http" };
4547
4605
  var DEFAULT_BATCH_SPEC = { provider: "mistral", model: "mistral-small-2603", transport: "http" };
@@ -4556,6 +4614,7 @@ var ROUTED_SPECS = [
4556
4614
  DEFAULT_MODERATION_SPEC,
4557
4615
  DEFAULT_JUDGE_SPEC,
4558
4616
  EU_JUDGE_SPEC,
4617
+ DEFAULT_VECTORIZE_SPEC,
4559
4618
  DEFAULT_PODCAST_SPEC,
4560
4619
  DEFAULT_TTS_SPEC,
4561
4620
  DEFAULT_BATCH_SPEC,
@@ -5053,6 +5112,23 @@ function createAI(config = {}) {
5053
5112
  }
5054
5113
  });
5055
5114
  },
5115
+ async vectorize(input) {
5116
+ input = vectorizeInputSchema.parse(input);
5117
+ return runCapability({
5118
+ primary: withOverride(DEFAULT_VECTORIZE_SPEC, input.override, "vectorize"),
5119
+ fallback: input.fallback,
5120
+ capability: "vectorize",
5121
+ purpose: input.purpose,
5122
+ labels: input.labels,
5123
+ estIn: 0,
5124
+ estOut: 0,
5125
+ invoke: async (spec) => {
5126
+ const adapter = pickProvider(spec.provider);
5127
+ if (!adapter.vectorize) throw new Error(`createAI: provider "${spec.provider}" does not support vectorize`);
5128
+ return adapter.vectorize({ image: input.image, shapeStacking: input.shapeStacking, spec });
5129
+ }
5130
+ });
5131
+ },
5056
5132
  async podcast(input) {
5057
5133
  input = podcastInputSchema.parse(input);
5058
5134
  const inputs = input.script.map((turn) => {
@@ -5848,6 +5924,7 @@ export {
5848
5924
  parseJsonLoose,
5849
5925
  pricingFreshness,
5850
5926
  pricingGeneratedAt,
5927
+ recraftAdapter,
5851
5928
  refreshAvailability,
5852
5929
  regionOfHost,
5853
5930
  regionOfProvider,