@ai-sdk/openai 2.0.54 → 2.0.55

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.
@@ -2600,7 +2600,8 @@ var openaiResponsesChunkSchema = (0, import_provider_utils21.lazyValidator)(
2600
2600
  action: import_v414.z.discriminatedUnion("type", [
2601
2601
  import_v414.z.object({
2602
2602
  type: import_v414.z.literal("search"),
2603
- query: import_v414.z.string().nullish()
2603
+ query: import_v414.z.string().nullish(),
2604
+ sources: import_v414.z.array(import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() })).nullish()
2604
2605
  }),
2605
2606
  import_v414.z.object({
2606
2607
  type: import_v414.z.literal("open_page"),
@@ -2786,7 +2787,8 @@ var openaiResponsesResponseSchema = (0, import_provider_utils21.lazyValidator)(
2786
2787
  action: import_v414.z.discriminatedUnion("type", [
2787
2788
  import_v414.z.object({
2788
2789
  type: import_v414.z.literal("search"),
2789
- query: import_v414.z.string().nullish()
2790
+ query: import_v414.z.string().nullish(),
2791
+ sources: import_v414.z.array(import_v414.z.object({ type: import_v414.z.literal("url"), url: import_v414.z.string() })).nullish()
2790
2792
  }),
2791
2793
  import_v414.z.object({
2792
2794
  type: import_v414.z.literal("open_page"),
@@ -3123,7 +3125,8 @@ var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
3123
3125
  url: import_v418.z.string(),
3124
3126
  pattern: import_v418.z.string()
3125
3127
  })
3126
- ])
3128
+ ]),
3129
+ sources: import_v418.z.array(import_v418.z.object({ type: import_v418.z.literal("url"), url: import_v418.z.string() })).optional()
3127
3130
  })
3128
3131
  )
3129
3132
  );
@@ -4374,7 +4377,11 @@ function mapWebSearchOutput(action) {
4374
4377
  var _a;
4375
4378
  switch (action.type) {
4376
4379
  case "search":
4377
- return { action: { type: "search", query: (_a = action.query) != null ? _a : void 0 } };
4380
+ return {
4381
+ action: { type: "search", query: (_a = action.query) != null ? _a : void 0 },
4382
+ // include sources when provided by the Responses API (behind include flag)
4383
+ ...action.sources != null && { sources: action.sources }
4384
+ };
4378
4385
  case "open_page":
4379
4386
  return { action: { type: "openPage", url: action.url } };
4380
4387
  case "find":