@ai-sdk/provider-utils 5.0.79 → 5.0.81

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.81
4
+
5
+ ### Patch Changes
6
+
7
+ - 6d50947: add experimental extraction models backed by structured language model output
8
+
9
+ ## 5.0.80
10
+
11
+ ### Patch Changes
12
+
13
+ - 2ebc78b: Move Node.js connection-time DNS validation to the optional `guarded-fetch` package. It uses an Undici agent to validate every resolved address and pin the connection to those results, independently of global fetch wrappers. It supports explicitly trusted private origins and connection-pool cleanup.
14
+
15
+ **Security behavior change:** provider-utils now uses the configured fetch or the runtime's global fetch and no longer depends on Undici. Default URL checks still reject private IP literals, local hostnames, unsafe schemes, and unsafe redirect URLs, but do not block public-looking hostnames that resolve to private addresses or DNS rebinding. Applications fetching untrusted URLs should inject `createGuardedFetch()` on Node.js or enforce equivalent network egress restrictions.
16
+
17
+ Allow `downloadBlob` to accept a fetch transport so applications can apply the same protection to file downloads.
18
+
19
+ MCP OAuth discovery keeps its strict DNS requirement: because Node.js no longer has a DNS-pinned default transport, untrusted authorization-server, redirect, token, and registration URLs now require an explicit custom fetch with connection-time DNS validation on Node.js too. Pass `createGuardedFetch()` through `transport.fetch`. The configured MCP server origin and browser window discovery remain supported.
20
+
21
+ - Updated dependencies [cb4fa52]
22
+ - @ai-sdk/provider@4.0.38
23
+
3
24
  ## 5.0.79
4
25
 
5
26
  ### Patch Changes
@@ -0,0 +1,38 @@
1
+ import { Experimental_ExtractionModelV4, Experimental_ExtractionModelV4CallOptions, Experimental_ExtractionModelV4Result, LanguageModelV4 } from "@ai-sdk/provider";
2
+ import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@workflow/serde";
3
+ //#region src/extraction-language-model.d.ts
4
+ /** Adapts structured language-model output to typed field extraction. */
5
+ declare class ExtractionLanguageModel implements Experimental_ExtractionModelV4 {
6
+ readonly specificationVersion = "v4";
7
+ readonly supportedFieldTypes: readonly ["text", "number", "date", "time", "datetime", "duration", "list"];
8
+ readonly provider: string;
9
+ private readonly model;
10
+ private readonly maxFieldsPerCall;
11
+ constructor({ model, provider, maxFieldsPerCall }: {
12
+ model: LanguageModelV4;
13
+ provider?: string;
14
+ /**
15
+ * Most fields per language-model call, for providers that limit schema
16
+ * size. Larger field maps are split into parallel calls whose answers are
17
+ * merged. Usage is summed, and response and provider metadata come from
18
+ * the first call.
19
+ */
20
+ maxFieldsPerCall?: number;
21
+ });
22
+ get modelId(): string;
23
+ static [WORKFLOW_SERIALIZE](model: ExtractionLanguageModel): {
24
+ model: LanguageModelV4;
25
+ provider: string;
26
+ maxFieldsPerCall: number;
27
+ };
28
+ static [WORKFLOW_DESERIALIZE](options: {
29
+ model: LanguageModelV4;
30
+ provider: string;
31
+ maxFieldsPerCall: number;
32
+ }): ExtractionLanguageModel;
33
+ doExtract(options: Experimental_ExtractionModelV4CallOptions): Promise<Experimental_ExtractionModelV4Result>;
34
+ private extractGroup;
35
+ }
36
+ //#endregion
37
+ export { ExtractionLanguageModel as Experimental_ExtractionLanguageModel };
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":["ExtractionModelV4CallOptions","ExtractionModelV4Result","ExtractionModelV4"],"sources":["../../src/extraction-language-model.ts"],"mappings":";;;;cAsFa,mCAAmCE;WACrC;WACA;WASA;mBACQ;mBACA;EAEL,cACV,OACA,UACA;IAEA,OAAO;IACP;;;;;;;IAOA;;MAsBE;UAII,oBAAoB,OAAO;;;;;UAQ3B,sBAAsB;IAC5B,OAAO;IACP;IACA;MACD;EAIK,UACJ,SAASF,4CACR,QAAQC;UA6EG"}