@ai-sdk/openai 4.0.0-beta.29 → 4.0.0-beta.30

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
@@ -1,53 +1,41 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- VERSION: () => VERSION,
24
- createOpenAI: () => createOpenAI,
25
- openai: () => openai
26
- });
27
- module.exports = __toCommonJS(index_exports);
28
-
29
1
  // src/openai-provider.ts
30
- var import_provider_utils40 = require("@ai-sdk/provider-utils");
2
+ import {
3
+ loadApiKey,
4
+ loadOptionalSetting,
5
+ withoutTrailingSlash,
6
+ withUserAgentSuffix
7
+ } from "@ai-sdk/provider-utils";
31
8
 
32
9
  // src/chat/openai-chat-language-model.ts
33
- var import_provider3 = require("@ai-sdk/provider");
34
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
10
+ import {
11
+ InvalidResponseDataError
12
+ } from "@ai-sdk/provider";
13
+ import {
14
+ combineHeaders,
15
+ createEventSourceResponseHandler,
16
+ createJsonResponseHandler,
17
+ generateId,
18
+ isCustomReasoning,
19
+ isParsableJson,
20
+ parseProviderOptions,
21
+ postJsonToApi
22
+ } from "@ai-sdk/provider-utils";
35
23
 
36
24
  // src/openai-error.ts
37
- var import_v4 = require("zod/v4");
38
- var import_provider_utils = require("@ai-sdk/provider-utils");
39
- var openaiErrorDataSchema = import_v4.z.object({
40
- error: import_v4.z.object({
41
- message: import_v4.z.string(),
25
+ import { z } from "zod/v4";
26
+ import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
27
+ var openaiErrorDataSchema = z.object({
28
+ error: z.object({
29
+ message: z.string(),
42
30
  // The additional information below is handled loosely to support
43
31
  // OpenAI-compatible providers that have slightly different error
44
32
  // responses:
45
- type: import_v4.z.string().nullish(),
46
- param: import_v4.z.any().nullish(),
47
- code: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).nullish()
33
+ type: z.string().nullish(),
34
+ param: z.any().nullish(),
35
+ code: z.union([z.string(), z.number()]).nullish()
48
36
  })
49
37
  });
50
- var openaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
38
+ var openaiFailedResponseHandler = createJsonErrorResponseHandler({
51
39
  errorSchema: openaiErrorDataSchema,
52
40
  errorToMessage: (data) => data.error.message
53
41
  });
@@ -108,8 +96,14 @@ function convertOpenAIChatUsage(usage) {
108
96
  }
109
97
 
110
98
  // src/chat/convert-to-openai-chat-messages.ts
111
- var import_provider = require("@ai-sdk/provider");
112
- var import_provider_utils2 = require("@ai-sdk/provider-utils");
99
+ import {
100
+ UnsupportedFunctionalityError
101
+ } from "@ai-sdk/provider";
102
+ import {
103
+ convertToBase64,
104
+ isProviderReference,
105
+ resolveProviderReference
106
+ } from "@ai-sdk/provider-utils";
113
107
  function convertToOpenAIChatMessages({
114
108
  prompt,
115
109
  systemMessageMode = "system"
@@ -159,11 +153,11 @@ function convertToOpenAIChatMessages({
159
153
  return { type: "text", text: part.text };
160
154
  }
161
155
  case "file": {
162
- if ((0, import_provider_utils2.isProviderReference)(part.data)) {
156
+ if (isProviderReference(part.data)) {
163
157
  return {
164
158
  type: "file",
165
159
  file: {
166
- file_id: (0, import_provider_utils2.resolveProviderReference)({
160
+ file_id: resolveProviderReference({
167
161
  reference: part.data,
168
162
  provider: "openai"
169
163
  })
@@ -175,13 +169,13 @@ function convertToOpenAIChatMessages({
175
169
  return {
176
170
  type: "image_url",
177
171
  image_url: {
178
- url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${(0, import_provider_utils2.convertToBase64)(part.data)}`,
172
+ url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,
179
173
  detail: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.imageDetail
180
174
  }
181
175
  };
182
176
  } else if (part.mediaType.startsWith("audio/")) {
183
177
  if (part.data instanceof URL) {
184
- throw new import_provider.UnsupportedFunctionalityError({
178
+ throw new UnsupportedFunctionalityError({
185
179
  functionality: "audio file parts with URLs"
186
180
  });
187
181
  }
@@ -190,7 +184,7 @@ function convertToOpenAIChatMessages({
190
184
  return {
191
185
  type: "input_audio",
192
186
  input_audio: {
193
- data: (0, import_provider_utils2.convertToBase64)(part.data),
187
+ data: convertToBase64(part.data),
194
188
  format: "wav"
195
189
  }
196
190
  };
@@ -200,20 +194,20 @@ function convertToOpenAIChatMessages({
200
194
  return {
201
195
  type: "input_audio",
202
196
  input_audio: {
203
- data: (0, import_provider_utils2.convertToBase64)(part.data),
197
+ data: convertToBase64(part.data),
204
198
  format: "mp3"
205
199
  }
206
200
  };
207
201
  }
208
202
  default: {
209
- throw new import_provider.UnsupportedFunctionalityError({
203
+ throw new UnsupportedFunctionalityError({
210
204
  functionality: `audio content parts with media type ${part.mediaType}`
211
205
  });
212
206
  }
213
207
  }
214
208
  } else if (part.mediaType === "application/pdf") {
215
209
  if (part.data instanceof URL) {
216
- throw new import_provider.UnsupportedFunctionalityError({
210
+ throw new UnsupportedFunctionalityError({
217
211
  functionality: "PDF file parts with URLs"
218
212
  });
219
213
  }
@@ -221,11 +215,11 @@ function convertToOpenAIChatMessages({
221
215
  type: "file",
222
216
  file: {
223
217
  filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,
224
- file_data: `data:application/pdf;base64,${(0, import_provider_utils2.convertToBase64)(part.data)}`
218
+ file_data: `data:application/pdf;base64,${convertToBase64(part.data)}`
225
219
  }
226
220
  };
227
221
  } else {
228
- throw new import_provider.UnsupportedFunctionalityError({
222
+ throw new UnsupportedFunctionalityError({
229
223
  functionality: `file part media type ${part.mediaType}`
230
224
  });
231
225
  }
@@ -333,139 +327,139 @@ function mapOpenAIFinishReason(finishReason) {
333
327
  }
334
328
 
335
329
  // src/chat/openai-chat-api.ts
336
- var import_provider_utils3 = require("@ai-sdk/provider-utils");
337
- var import_v42 = require("zod/v4");
338
- var openaiChatResponseSchema = (0, import_provider_utils3.lazySchema)(
339
- () => (0, import_provider_utils3.zodSchema)(
340
- import_v42.z.object({
341
- id: import_v42.z.string().nullish(),
342
- created: import_v42.z.number().nullish(),
343
- model: import_v42.z.string().nullish(),
344
- choices: import_v42.z.array(
345
- import_v42.z.object({
346
- message: import_v42.z.object({
347
- role: import_v42.z.literal("assistant").nullish(),
348
- content: import_v42.z.string().nullish(),
349
- tool_calls: import_v42.z.array(
350
- import_v42.z.object({
351
- id: import_v42.z.string().nullish(),
352
- type: import_v42.z.literal("function"),
353
- function: import_v42.z.object({
354
- name: import_v42.z.string(),
355
- arguments: import_v42.z.string()
330
+ import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
331
+ import { z as z2 } from "zod/v4";
332
+ var openaiChatResponseSchema = lazySchema(
333
+ () => zodSchema(
334
+ z2.object({
335
+ id: z2.string().nullish(),
336
+ created: z2.number().nullish(),
337
+ model: z2.string().nullish(),
338
+ choices: z2.array(
339
+ z2.object({
340
+ message: z2.object({
341
+ role: z2.literal("assistant").nullish(),
342
+ content: z2.string().nullish(),
343
+ tool_calls: z2.array(
344
+ z2.object({
345
+ id: z2.string().nullish(),
346
+ type: z2.literal("function"),
347
+ function: z2.object({
348
+ name: z2.string(),
349
+ arguments: z2.string()
356
350
  })
357
351
  })
358
352
  ).nullish(),
359
- annotations: import_v42.z.array(
360
- import_v42.z.object({
361
- type: import_v42.z.literal("url_citation"),
362
- url_citation: import_v42.z.object({
363
- start_index: import_v42.z.number(),
364
- end_index: import_v42.z.number(),
365
- url: import_v42.z.string(),
366
- title: import_v42.z.string()
353
+ annotations: z2.array(
354
+ z2.object({
355
+ type: z2.literal("url_citation"),
356
+ url_citation: z2.object({
357
+ start_index: z2.number(),
358
+ end_index: z2.number(),
359
+ url: z2.string(),
360
+ title: z2.string()
367
361
  })
368
362
  })
369
363
  ).nullish()
370
364
  }),
371
- index: import_v42.z.number(),
372
- logprobs: import_v42.z.object({
373
- content: import_v42.z.array(
374
- import_v42.z.object({
375
- token: import_v42.z.string(),
376
- logprob: import_v42.z.number(),
377
- top_logprobs: import_v42.z.array(
378
- import_v42.z.object({
379
- token: import_v42.z.string(),
380
- logprob: import_v42.z.number()
365
+ index: z2.number(),
366
+ logprobs: z2.object({
367
+ content: z2.array(
368
+ z2.object({
369
+ token: z2.string(),
370
+ logprob: z2.number(),
371
+ top_logprobs: z2.array(
372
+ z2.object({
373
+ token: z2.string(),
374
+ logprob: z2.number()
381
375
  })
382
376
  )
383
377
  })
384
378
  ).nullish()
385
379
  }).nullish(),
386
- finish_reason: import_v42.z.string().nullish()
380
+ finish_reason: z2.string().nullish()
387
381
  })
388
382
  ),
389
- usage: import_v42.z.object({
390
- prompt_tokens: import_v42.z.number().nullish(),
391
- completion_tokens: import_v42.z.number().nullish(),
392
- total_tokens: import_v42.z.number().nullish(),
393
- prompt_tokens_details: import_v42.z.object({
394
- cached_tokens: import_v42.z.number().nullish()
383
+ usage: z2.object({
384
+ prompt_tokens: z2.number().nullish(),
385
+ completion_tokens: z2.number().nullish(),
386
+ total_tokens: z2.number().nullish(),
387
+ prompt_tokens_details: z2.object({
388
+ cached_tokens: z2.number().nullish()
395
389
  }).nullish(),
396
- completion_tokens_details: import_v42.z.object({
397
- reasoning_tokens: import_v42.z.number().nullish(),
398
- accepted_prediction_tokens: import_v42.z.number().nullish(),
399
- rejected_prediction_tokens: import_v42.z.number().nullish()
390
+ completion_tokens_details: z2.object({
391
+ reasoning_tokens: z2.number().nullish(),
392
+ accepted_prediction_tokens: z2.number().nullish(),
393
+ rejected_prediction_tokens: z2.number().nullish()
400
394
  }).nullish()
401
395
  }).nullish()
402
396
  })
403
397
  )
404
398
  );
405
- var openaiChatChunkSchema = (0, import_provider_utils3.lazySchema)(
406
- () => (0, import_provider_utils3.zodSchema)(
407
- import_v42.z.union([
408
- import_v42.z.object({
409
- id: import_v42.z.string().nullish(),
410
- created: import_v42.z.number().nullish(),
411
- model: import_v42.z.string().nullish(),
412
- choices: import_v42.z.array(
413
- import_v42.z.object({
414
- delta: import_v42.z.object({
415
- role: import_v42.z.enum(["assistant"]).nullish(),
416
- content: import_v42.z.string().nullish(),
417
- tool_calls: import_v42.z.array(
418
- import_v42.z.object({
419
- index: import_v42.z.number(),
420
- id: import_v42.z.string().nullish(),
421
- type: import_v42.z.literal("function").nullish(),
422
- function: import_v42.z.object({
423
- name: import_v42.z.string().nullish(),
424
- arguments: import_v42.z.string().nullish()
399
+ var openaiChatChunkSchema = lazySchema(
400
+ () => zodSchema(
401
+ z2.union([
402
+ z2.object({
403
+ id: z2.string().nullish(),
404
+ created: z2.number().nullish(),
405
+ model: z2.string().nullish(),
406
+ choices: z2.array(
407
+ z2.object({
408
+ delta: z2.object({
409
+ role: z2.enum(["assistant"]).nullish(),
410
+ content: z2.string().nullish(),
411
+ tool_calls: z2.array(
412
+ z2.object({
413
+ index: z2.number(),
414
+ id: z2.string().nullish(),
415
+ type: z2.literal("function").nullish(),
416
+ function: z2.object({
417
+ name: z2.string().nullish(),
418
+ arguments: z2.string().nullish()
425
419
  })
426
420
  })
427
421
  ).nullish(),
428
- annotations: import_v42.z.array(
429
- import_v42.z.object({
430
- type: import_v42.z.literal("url_citation"),
431
- url_citation: import_v42.z.object({
432
- start_index: import_v42.z.number(),
433
- end_index: import_v42.z.number(),
434
- url: import_v42.z.string(),
435
- title: import_v42.z.string()
422
+ annotations: z2.array(
423
+ z2.object({
424
+ type: z2.literal("url_citation"),
425
+ url_citation: z2.object({
426
+ start_index: z2.number(),
427
+ end_index: z2.number(),
428
+ url: z2.string(),
429
+ title: z2.string()
436
430
  })
437
431
  })
438
432
  ).nullish()
439
433
  }).nullish(),
440
- logprobs: import_v42.z.object({
441
- content: import_v42.z.array(
442
- import_v42.z.object({
443
- token: import_v42.z.string(),
444
- logprob: import_v42.z.number(),
445
- top_logprobs: import_v42.z.array(
446
- import_v42.z.object({
447
- token: import_v42.z.string(),
448
- logprob: import_v42.z.number()
434
+ logprobs: z2.object({
435
+ content: z2.array(
436
+ z2.object({
437
+ token: z2.string(),
438
+ logprob: z2.number(),
439
+ top_logprobs: z2.array(
440
+ z2.object({
441
+ token: z2.string(),
442
+ logprob: z2.number()
449
443
  })
450
444
  )
451
445
  })
452
446
  ).nullish()
453
447
  }).nullish(),
454
- finish_reason: import_v42.z.string().nullish(),
455
- index: import_v42.z.number()
448
+ finish_reason: z2.string().nullish(),
449
+ index: z2.number()
456
450
  })
457
451
  ),
458
- usage: import_v42.z.object({
459
- prompt_tokens: import_v42.z.number().nullish(),
460
- completion_tokens: import_v42.z.number().nullish(),
461
- total_tokens: import_v42.z.number().nullish(),
462
- prompt_tokens_details: import_v42.z.object({
463
- cached_tokens: import_v42.z.number().nullish()
452
+ usage: z2.object({
453
+ prompt_tokens: z2.number().nullish(),
454
+ completion_tokens: z2.number().nullish(),
455
+ total_tokens: z2.number().nullish(),
456
+ prompt_tokens_details: z2.object({
457
+ cached_tokens: z2.number().nullish()
464
458
  }).nullish(),
465
- completion_tokens_details: import_v42.z.object({
466
- reasoning_tokens: import_v42.z.number().nullish(),
467
- accepted_prediction_tokens: import_v42.z.number().nullish(),
468
- rejected_prediction_tokens: import_v42.z.number().nullish()
459
+ completion_tokens_details: z2.object({
460
+ reasoning_tokens: z2.number().nullish(),
461
+ accepted_prediction_tokens: z2.number().nullish(),
462
+ rejected_prediction_tokens: z2.number().nullish()
469
463
  }).nullish()
470
464
  }).nullish()
471
465
  }),
@@ -475,18 +469,18 @@ var openaiChatChunkSchema = (0, import_provider_utils3.lazySchema)(
475
469
  );
476
470
 
477
471
  // src/chat/openai-chat-options.ts
478
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
479
- var import_v43 = require("zod/v4");
480
- var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
481
- () => (0, import_provider_utils4.zodSchema)(
482
- import_v43.z.object({
472
+ import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
473
+ import { z as z3 } from "zod/v4";
474
+ var openaiLanguageModelChatOptions = lazySchema2(
475
+ () => zodSchema2(
476
+ z3.object({
483
477
  /**
484
478
  * Modify the likelihood of specified tokens appearing in the completion.
485
479
  *
486
480
  * Accepts a JSON object that maps tokens (specified by their token ID in
487
481
  * the GPT tokenizer) to an associated bias value from -100 to 100.
488
482
  */
489
- logitBias: import_v43.z.record(import_v43.z.coerce.number(), import_v43.z.number()).optional(),
483
+ logitBias: z3.record(z3.coerce.number(), z3.number()).optional(),
490
484
  /**
491
485
  * Return the log probabilities of the tokens.
492
486
  *
@@ -496,36 +490,36 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
496
490
  * Setting to a number will return the log probabilities of the top n
497
491
  * tokens that were generated.
498
492
  */
499
- logprobs: import_v43.z.union([import_v43.z.boolean(), import_v43.z.number()]).optional(),
493
+ logprobs: z3.union([z3.boolean(), z3.number()]).optional(),
500
494
  /**
501
495
  * Whether to enable parallel function calling during tool use. Default to true.
502
496
  */
503
- parallelToolCalls: import_v43.z.boolean().optional(),
497
+ parallelToolCalls: z3.boolean().optional(),
504
498
  /**
505
499
  * A unique identifier representing your end-user, which can help OpenAI to
506
500
  * monitor and detect abuse.
507
501
  */
508
- user: import_v43.z.string().optional(),
502
+ user: z3.string().optional(),
509
503
  /**
510
504
  * Reasoning effort for reasoning models. Defaults to `medium`.
511
505
  */
512
- reasoningEffort: import_v43.z.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
506
+ reasoningEffort: z3.enum(["none", "minimal", "low", "medium", "high", "xhigh"]).optional(),
513
507
  /**
514
508
  * Maximum number of completion tokens to generate. Useful for reasoning models.
515
509
  */
516
- maxCompletionTokens: import_v43.z.number().optional(),
510
+ maxCompletionTokens: z3.number().optional(),
517
511
  /**
518
512
  * Whether to enable persistence in responses API.
519
513
  */
520
- store: import_v43.z.boolean().optional(),
514
+ store: z3.boolean().optional(),
521
515
  /**
522
516
  * Metadata to associate with the request.
523
517
  */
524
- metadata: import_v43.z.record(import_v43.z.string().max(64), import_v43.z.string().max(512)).optional(),
518
+ metadata: z3.record(z3.string().max(64), z3.string().max(512)).optional(),
525
519
  /**
526
520
  * Parameters for prediction mode.
527
521
  */
528
- prediction: import_v43.z.record(import_v43.z.string(), import_v43.z.any()).optional(),
522
+ prediction: z3.record(z3.string(), z3.any()).optional(),
529
523
  /**
530
524
  * Service tier for the request.
531
525
  * - 'auto': Default service tier. The request will be processed with the service tier configured in the
@@ -536,23 +530,23 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
536
530
  *
537
531
  * @default 'auto'
538
532
  */
539
- serviceTier: import_v43.z.enum(["auto", "flex", "priority", "default"]).optional(),
533
+ serviceTier: z3.enum(["auto", "flex", "priority", "default"]).optional(),
540
534
  /**
541
535
  * Whether to use strict JSON schema validation.
542
536
  *
543
537
  * @default true
544
538
  */
545
- strictJsonSchema: import_v43.z.boolean().optional(),
539
+ strictJsonSchema: z3.boolean().optional(),
546
540
  /**
547
541
  * Controls the verbosity of the model's responses.
548
542
  * Lower values will result in more concise responses, while higher values will result in more verbose responses.
549
543
  */
550
- textVerbosity: import_v43.z.enum(["low", "medium", "high"]).optional(),
544
+ textVerbosity: z3.enum(["low", "medium", "high"]).optional(),
551
545
  /**
552
546
  * A cache key for prompt caching. Allows manual control over prompt caching behavior.
553
547
  * Useful for improving cache hit rates and working around automatic caching issues.
554
548
  */
555
- promptCacheKey: import_v43.z.string().optional(),
549
+ promptCacheKey: z3.string().optional(),
556
550
  /**
557
551
  * The retention policy for the prompt cache.
558
552
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -561,7 +555,7 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
561
555
  *
562
556
  * @default 'in_memory'
563
557
  */
564
- promptCacheRetention: import_v43.z.enum(["in_memory", "24h"]).optional(),
558
+ promptCacheRetention: z3.enum(["in_memory", "24h"]).optional(),
565
559
  /**
566
560
  * A stable identifier used to help detect users of your application
567
561
  * that may be violating OpenAI's usage policies. The IDs should be a
@@ -569,7 +563,7 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
569
563
  * username or email address, in order to avoid sending us any identifying
570
564
  * information.
571
565
  */
572
- safetyIdentifier: import_v43.z.string().optional(),
566
+ safetyIdentifier: z3.string().optional(),
573
567
  /**
574
568
  * Override the system message mode for this model.
575
569
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -578,7 +572,7 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
578
572
  *
579
573
  * If not specified, the mode is automatically determined based on the model.
580
574
  */
581
- systemMessageMode: import_v43.z.enum(["system", "developer", "remove"]).optional(),
575
+ systemMessageMode: z3.enum(["system", "developer", "remove"]).optional(),
582
576
  /**
583
577
  * Force treating this model as a reasoning model.
584
578
  *
@@ -588,13 +582,15 @@ var openaiLanguageModelChatOptions = (0, import_provider_utils4.lazySchema)(
588
582
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
589
583
  * and defaults `systemMessageMode` to `developer` unless overridden.
590
584
  */
591
- forceReasoning: import_v43.z.boolean().optional()
585
+ forceReasoning: z3.boolean().optional()
592
586
  })
593
587
  )
594
588
  );
595
589
 
596
590
  // src/chat/openai-chat-prepare-tools.ts
597
- var import_provider2 = require("@ai-sdk/provider");
591
+ import {
592
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError2
593
+ } from "@ai-sdk/provider";
598
594
  function prepareChatTools({
599
595
  tools,
600
596
  toolChoice
@@ -648,7 +644,7 @@ function prepareChatTools({
648
644
  };
649
645
  default: {
650
646
  const _exhaustiveCheck = type;
651
- throw new import_provider2.UnsupportedFunctionalityError({
647
+ throw new UnsupportedFunctionalityError2({
652
648
  functionality: `tool choice type: ${_exhaustiveCheck}`
653
649
  });
654
650
  }
@@ -686,13 +682,13 @@ var OpenAIChatLanguageModel = class {
686
682
  }) {
687
683
  var _a, _b, _c, _d, _e, _f;
688
684
  const warnings = [];
689
- const openaiOptions = (_a = await (0, import_provider_utils5.parseProviderOptions)({
685
+ const openaiOptions = (_a = await parseProviderOptions({
690
686
  provider: "openai",
691
687
  providerOptions,
692
688
  schema: openaiLanguageModelChatOptions
693
689
  })) != null ? _a : {};
694
690
  const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);
695
- const resolvedReasoningEffort = (_b = openaiOptions.reasoningEffort) != null ? _b : (0, import_provider_utils5.isCustomReasoning)(reasoning) ? reasoning : void 0;
691
+ const resolvedReasoningEffort = (_b = openaiOptions.reasoningEffort) != null ? _b : isCustomReasoning(reasoning) ? reasoning : void 0;
696
692
  const isReasoningModel = (_c = openaiOptions.forceReasoning) != null ? _c : modelCapabilities.isReasoningModel;
697
693
  if (topK != null) {
698
694
  warnings.push({ type: "unsupported", feature: "topK" });
@@ -858,15 +854,15 @@ var OpenAIChatLanguageModel = class {
858
854
  responseHeaders,
859
855
  value: response,
860
856
  rawValue: rawResponse
861
- } = await (0, import_provider_utils5.postJsonToApi)({
857
+ } = await postJsonToApi({
862
858
  url: this.config.url({
863
859
  path: "/chat/completions",
864
860
  modelId: this.modelId
865
861
  }),
866
- headers: (0, import_provider_utils5.combineHeaders)(this.config.headers(), options.headers),
862
+ headers: combineHeaders(this.config.headers(), options.headers),
867
863
  body,
868
864
  failedResponseHandler: openaiFailedResponseHandler,
869
- successfulResponseHandler: (0, import_provider_utils5.createJsonResponseHandler)(
865
+ successfulResponseHandler: createJsonResponseHandler(
870
866
  openaiChatResponseSchema
871
867
  ),
872
868
  abortSignal: options.abortSignal,
@@ -881,7 +877,7 @@ var OpenAIChatLanguageModel = class {
881
877
  for (const toolCall of (_a = choice.message.tool_calls) != null ? _a : []) {
882
878
  content.push({
883
879
  type: "tool-call",
884
- toolCallId: (_b = toolCall.id) != null ? _b : (0, import_provider_utils5.generateId)(),
880
+ toolCallId: (_b = toolCall.id) != null ? _b : generateId(),
885
881
  toolName: toolCall.function.name,
886
882
  input: toolCall.function.arguments
887
883
  });
@@ -890,7 +886,7 @@ var OpenAIChatLanguageModel = class {
890
886
  content.push({
891
887
  type: "source",
892
888
  sourceType: "url",
893
- id: (0, import_provider_utils5.generateId)(),
889
+ id: generateId(),
894
890
  url: annotation.url_citation.url,
895
891
  title: annotation.url_citation.title
896
892
  });
@@ -932,15 +928,15 @@ var OpenAIChatLanguageModel = class {
932
928
  include_usage: true
933
929
  }
934
930
  };
935
- const { responseHeaders, value: response } = await (0, import_provider_utils5.postJsonToApi)({
931
+ const { responseHeaders, value: response } = await postJsonToApi({
936
932
  url: this.config.url({
937
933
  path: "/chat/completions",
938
934
  modelId: this.modelId
939
935
  }),
940
- headers: (0, import_provider_utils5.combineHeaders)(this.config.headers(), options.headers),
936
+ headers: combineHeaders(this.config.headers(), options.headers),
941
937
  body,
942
938
  failedResponseHandler: openaiFailedResponseHandler,
943
- successfulResponseHandler: (0, import_provider_utils5.createEventSourceResponseHandler)(
939
+ successfulResponseHandler: createEventSourceResponseHandler(
944
940
  openaiChatChunkSchema
945
941
  ),
946
942
  abortSignal: options.abortSignal,
@@ -1026,19 +1022,19 @@ var OpenAIChatLanguageModel = class {
1026
1022
  const index = toolCallDelta.index;
1027
1023
  if (toolCalls[index] == null) {
1028
1024
  if (toolCallDelta.type != null && toolCallDelta.type !== "function") {
1029
- throw new import_provider3.InvalidResponseDataError({
1025
+ throw new InvalidResponseDataError({
1030
1026
  data: toolCallDelta,
1031
1027
  message: `Expected 'function' type.`
1032
1028
  });
1033
1029
  }
1034
1030
  if (toolCallDelta.id == null) {
1035
- throw new import_provider3.InvalidResponseDataError({
1031
+ throw new InvalidResponseDataError({
1036
1032
  data: toolCallDelta,
1037
1033
  message: `Expected 'id' to be a string.`
1038
1034
  });
1039
1035
  }
1040
1036
  if (((_f = toolCallDelta.function) == null ? void 0 : _f.name) == null) {
1041
- throw new import_provider3.InvalidResponseDataError({
1037
+ throw new InvalidResponseDataError({
1042
1038
  data: toolCallDelta,
1043
1039
  message: `Expected 'function.name' to be a string.`
1044
1040
  });
@@ -1066,14 +1062,14 @@ var OpenAIChatLanguageModel = class {
1066
1062
  delta: toolCall2.function.arguments
1067
1063
  });
1068
1064
  }
1069
- if ((0, import_provider_utils5.isParsableJson)(toolCall2.function.arguments)) {
1065
+ if (isParsableJson(toolCall2.function.arguments)) {
1070
1066
  controller.enqueue({
1071
1067
  type: "tool-input-end",
1072
1068
  id: toolCall2.id
1073
1069
  });
1074
1070
  controller.enqueue({
1075
1071
  type: "tool-call",
1076
- toolCallId: (_j = toolCall2.id) != null ? _j : (0, import_provider_utils5.generateId)(),
1072
+ toolCallId: (_j = toolCall2.id) != null ? _j : generateId(),
1077
1073
  toolName: toolCall2.function.name,
1078
1074
  input: toolCall2.function.arguments
1079
1075
  });
@@ -1094,14 +1090,14 @@ var OpenAIChatLanguageModel = class {
1094
1090
  id: toolCall.id,
1095
1091
  delta: (_n = toolCallDelta.function.arguments) != null ? _n : ""
1096
1092
  });
1097
- if (((_o = toolCall.function) == null ? void 0 : _o.name) != null && ((_p = toolCall.function) == null ? void 0 : _p.arguments) != null && (0, import_provider_utils5.isParsableJson)(toolCall.function.arguments)) {
1093
+ if (((_o = toolCall.function) == null ? void 0 : _o.name) != null && ((_p = toolCall.function) == null ? void 0 : _p.arguments) != null && isParsableJson(toolCall.function.arguments)) {
1098
1094
  controller.enqueue({
1099
1095
  type: "tool-input-end",
1100
1096
  id: toolCall.id
1101
1097
  });
1102
1098
  controller.enqueue({
1103
1099
  type: "tool-call",
1104
- toolCallId: (_q = toolCall.id) != null ? _q : (0, import_provider_utils5.generateId)(),
1100
+ toolCallId: (_q = toolCall.id) != null ? _q : generateId(),
1105
1101
  toolName: toolCall.function.name,
1106
1102
  input: toolCall.function.arguments
1107
1103
  });
@@ -1114,7 +1110,7 @@ var OpenAIChatLanguageModel = class {
1114
1110
  controller.enqueue({
1115
1111
  type: "source",
1116
1112
  sourceType: "url",
1117
- id: (0, import_provider_utils5.generateId)(),
1113
+ id: generateId(),
1118
1114
  url: annotation.url_citation.url,
1119
1115
  title: annotation.url_citation.title
1120
1116
  });
@@ -1141,7 +1137,13 @@ var OpenAIChatLanguageModel = class {
1141
1137
  };
1142
1138
 
1143
1139
  // src/completion/openai-completion-language-model.ts
1144
- var import_provider_utils8 = require("@ai-sdk/provider-utils");
1140
+ import {
1141
+ combineHeaders as combineHeaders2,
1142
+ createEventSourceResponseHandler as createEventSourceResponseHandler2,
1143
+ createJsonResponseHandler as createJsonResponseHandler2,
1144
+ parseProviderOptions as parseProviderOptions2,
1145
+ postJsonToApi as postJsonToApi2
1146
+ } from "@ai-sdk/provider-utils";
1145
1147
 
1146
1148
  // src/completion/convert-openai-completion-usage.ts
1147
1149
  function convertOpenAICompletionUsage(usage) {
@@ -1181,7 +1183,10 @@ function convertOpenAICompletionUsage(usage) {
1181
1183
  }
1182
1184
 
1183
1185
  // src/completion/convert-to-openai-completion-prompt.ts
1184
- var import_provider4 = require("@ai-sdk/provider");
1186
+ import {
1187
+ InvalidPromptError,
1188
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError3
1189
+ } from "@ai-sdk/provider";
1185
1190
  function convertToOpenAICompletionPrompt({
1186
1191
  prompt,
1187
1192
  user = "user",
@@ -1197,7 +1202,7 @@ function convertToOpenAICompletionPrompt({
1197
1202
  for (const { role, content } of prompt) {
1198
1203
  switch (role) {
1199
1204
  case "system": {
1200
- throw new import_provider4.InvalidPromptError({
1205
+ throw new InvalidPromptError({
1201
1206
  message: "Unexpected system message in prompt: ${content}",
1202
1207
  prompt
1203
1208
  });
@@ -1223,7 +1228,7 @@ ${userMessage}
1223
1228
  return part.text;
1224
1229
  }
1225
1230
  case "tool-call": {
1226
- throw new import_provider4.UnsupportedFunctionalityError({
1231
+ throw new UnsupportedFunctionalityError3({
1227
1232
  functionality: "tool-call messages"
1228
1233
  });
1229
1234
  }
@@ -1236,7 +1241,7 @@ ${assistantMessage}
1236
1241
  break;
1237
1242
  }
1238
1243
  case "tool": {
1239
- throw new import_provider4.UnsupportedFunctionalityError({
1244
+ throw new UnsupportedFunctionalityError3({
1240
1245
  functionality: "tool messages"
1241
1246
  });
1242
1247
  }
@@ -1286,56 +1291,56 @@ function mapOpenAIFinishReason2(finishReason) {
1286
1291
  }
1287
1292
 
1288
1293
  // src/completion/openai-completion-api.ts
1289
- var import_v44 = require("zod/v4");
1290
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
1291
- var openaiCompletionResponseSchema = (0, import_provider_utils6.lazySchema)(
1292
- () => (0, import_provider_utils6.zodSchema)(
1293
- import_v44.z.object({
1294
- id: import_v44.z.string().nullish(),
1295
- created: import_v44.z.number().nullish(),
1296
- model: import_v44.z.string().nullish(),
1297
- choices: import_v44.z.array(
1298
- import_v44.z.object({
1299
- text: import_v44.z.string(),
1300
- finish_reason: import_v44.z.string(),
1301
- logprobs: import_v44.z.object({
1302
- tokens: import_v44.z.array(import_v44.z.string()),
1303
- token_logprobs: import_v44.z.array(import_v44.z.number()),
1304
- top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
1294
+ import { z as z4 } from "zod/v4";
1295
+ import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
1296
+ var openaiCompletionResponseSchema = lazySchema3(
1297
+ () => zodSchema3(
1298
+ z4.object({
1299
+ id: z4.string().nullish(),
1300
+ created: z4.number().nullish(),
1301
+ model: z4.string().nullish(),
1302
+ choices: z4.array(
1303
+ z4.object({
1304
+ text: z4.string(),
1305
+ finish_reason: z4.string(),
1306
+ logprobs: z4.object({
1307
+ tokens: z4.array(z4.string()),
1308
+ token_logprobs: z4.array(z4.number()),
1309
+ top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1305
1310
  }).nullish()
1306
1311
  })
1307
1312
  ),
1308
- usage: import_v44.z.object({
1309
- prompt_tokens: import_v44.z.number(),
1310
- completion_tokens: import_v44.z.number(),
1311
- total_tokens: import_v44.z.number()
1313
+ usage: z4.object({
1314
+ prompt_tokens: z4.number(),
1315
+ completion_tokens: z4.number(),
1316
+ total_tokens: z4.number()
1312
1317
  }).nullish()
1313
1318
  })
1314
1319
  )
1315
1320
  );
1316
- var openaiCompletionChunkSchema = (0, import_provider_utils6.lazySchema)(
1317
- () => (0, import_provider_utils6.zodSchema)(
1318
- import_v44.z.union([
1319
- import_v44.z.object({
1320
- id: import_v44.z.string().nullish(),
1321
- created: import_v44.z.number().nullish(),
1322
- model: import_v44.z.string().nullish(),
1323
- choices: import_v44.z.array(
1324
- import_v44.z.object({
1325
- text: import_v44.z.string(),
1326
- finish_reason: import_v44.z.string().nullish(),
1327
- index: import_v44.z.number(),
1328
- logprobs: import_v44.z.object({
1329
- tokens: import_v44.z.array(import_v44.z.string()),
1330
- token_logprobs: import_v44.z.array(import_v44.z.number()),
1331
- top_logprobs: import_v44.z.array(import_v44.z.record(import_v44.z.string(), import_v44.z.number())).nullish()
1321
+ var openaiCompletionChunkSchema = lazySchema3(
1322
+ () => zodSchema3(
1323
+ z4.union([
1324
+ z4.object({
1325
+ id: z4.string().nullish(),
1326
+ created: z4.number().nullish(),
1327
+ model: z4.string().nullish(),
1328
+ choices: z4.array(
1329
+ z4.object({
1330
+ text: z4.string(),
1331
+ finish_reason: z4.string().nullish(),
1332
+ index: z4.number(),
1333
+ logprobs: z4.object({
1334
+ tokens: z4.array(z4.string()),
1335
+ token_logprobs: z4.array(z4.number()),
1336
+ top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()
1332
1337
  }).nullish()
1333
1338
  })
1334
1339
  ),
1335
- usage: import_v44.z.object({
1336
- prompt_tokens: import_v44.z.number(),
1337
- completion_tokens: import_v44.z.number(),
1338
- total_tokens: import_v44.z.number()
1340
+ usage: z4.object({
1341
+ prompt_tokens: z4.number(),
1342
+ completion_tokens: z4.number(),
1343
+ total_tokens: z4.number()
1339
1344
  }).nullish()
1340
1345
  }),
1341
1346
  openaiErrorDataSchema
@@ -1344,15 +1349,15 @@ var openaiCompletionChunkSchema = (0, import_provider_utils6.lazySchema)(
1344
1349
  );
1345
1350
 
1346
1351
  // src/completion/openai-completion-options.ts
1347
- var import_provider_utils7 = require("@ai-sdk/provider-utils");
1348
- var import_v45 = require("zod/v4");
1349
- var openaiLanguageModelCompletionOptions = (0, import_provider_utils7.lazySchema)(
1350
- () => (0, import_provider_utils7.zodSchema)(
1351
- import_v45.z.object({
1352
+ import { lazySchema as lazySchema4, zodSchema as zodSchema4 } from "@ai-sdk/provider-utils";
1353
+ import { z as z5 } from "zod/v4";
1354
+ var openaiLanguageModelCompletionOptions = lazySchema4(
1355
+ () => zodSchema4(
1356
+ z5.object({
1352
1357
  /**
1353
1358
  * Echo back the prompt in addition to the completion.
1354
1359
  */
1355
- echo: import_v45.z.boolean().optional(),
1360
+ echo: z5.boolean().optional(),
1356
1361
  /**
1357
1362
  * Modify the likelihood of specified tokens appearing in the completion.
1358
1363
  *
@@ -1367,16 +1372,16 @@ var openaiLanguageModelCompletionOptions = (0, import_provider_utils7.lazySchema
1367
1372
  * As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
1368
1373
  * token from being generated.
1369
1374
  */
1370
- logitBias: import_v45.z.record(import_v45.z.string(), import_v45.z.number()).optional(),
1375
+ logitBias: z5.record(z5.string(), z5.number()).optional(),
1371
1376
  /**
1372
1377
  * The suffix that comes after a completion of inserted text.
1373
1378
  */
1374
- suffix: import_v45.z.string().optional(),
1379
+ suffix: z5.string().optional(),
1375
1380
  /**
1376
1381
  * A unique identifier representing your end-user, which can help OpenAI to
1377
1382
  * monitor and detect abuse. Learn more.
1378
1383
  */
1379
- user: import_v45.z.string().optional(),
1384
+ user: z5.string().optional(),
1380
1385
  /**
1381
1386
  * Return the log probabilities of the tokens. Including logprobs will increase
1382
1387
  * the response size and can slow down response times. However, it can
@@ -1386,7 +1391,7 @@ var openaiLanguageModelCompletionOptions = (0, import_provider_utils7.lazySchema
1386
1391
  * Setting to a number will return the log probabilities of the top n
1387
1392
  * tokens that were generated.
1388
1393
  */
1389
- logprobs: import_v45.z.union([import_v45.z.boolean(), import_v45.z.number()]).optional()
1394
+ logprobs: z5.union([z5.boolean(), z5.number()]).optional()
1390
1395
  })
1391
1396
  )
1392
1397
  );
@@ -1424,12 +1429,12 @@ var OpenAICompletionLanguageModel = class {
1424
1429
  }) {
1425
1430
  const warnings = [];
1426
1431
  const openaiOptions = {
1427
- ...await (0, import_provider_utils8.parseProviderOptions)({
1432
+ ...await parseProviderOptions2({
1428
1433
  provider: "openai",
1429
1434
  providerOptions,
1430
1435
  schema: openaiLanguageModelCompletionOptions
1431
1436
  }),
1432
- ...await (0, import_provider_utils8.parseProviderOptions)({
1437
+ ...await parseProviderOptions2({
1433
1438
  provider: this.providerOptionsName,
1434
1439
  providerOptions,
1435
1440
  schema: openaiLanguageModelCompletionOptions
@@ -1485,15 +1490,15 @@ var OpenAICompletionLanguageModel = class {
1485
1490
  responseHeaders,
1486
1491
  value: response,
1487
1492
  rawValue: rawResponse
1488
- } = await (0, import_provider_utils8.postJsonToApi)({
1493
+ } = await postJsonToApi2({
1489
1494
  url: this.config.url({
1490
1495
  path: "/completions",
1491
1496
  modelId: this.modelId
1492
1497
  }),
1493
- headers: (0, import_provider_utils8.combineHeaders)(this.config.headers(), options.headers),
1498
+ headers: combineHeaders2(this.config.headers(), options.headers),
1494
1499
  body: args,
1495
1500
  failedResponseHandler: openaiFailedResponseHandler,
1496
- successfulResponseHandler: (0, import_provider_utils8.createJsonResponseHandler)(
1501
+ successfulResponseHandler: createJsonResponseHandler2(
1497
1502
  openaiCompletionResponseSchema
1498
1503
  ),
1499
1504
  abortSignal: options.abortSignal,
@@ -1530,15 +1535,15 @@ var OpenAICompletionLanguageModel = class {
1530
1535
  include_usage: true
1531
1536
  }
1532
1537
  };
1533
- const { responseHeaders, value: response } = await (0, import_provider_utils8.postJsonToApi)({
1538
+ const { responseHeaders, value: response } = await postJsonToApi2({
1534
1539
  url: this.config.url({
1535
1540
  path: "/completions",
1536
1541
  modelId: this.modelId
1537
1542
  }),
1538
- headers: (0, import_provider_utils8.combineHeaders)(this.config.headers(), options.headers),
1543
+ headers: combineHeaders2(this.config.headers(), options.headers),
1539
1544
  body,
1540
1545
  failedResponseHandler: openaiFailedResponseHandler,
1541
- successfulResponseHandler: (0, import_provider_utils8.createEventSourceResponseHandler)(
1546
+ successfulResponseHandler: createEventSourceResponseHandler2(
1542
1547
  openaiCompletionChunkSchema
1543
1548
  ),
1544
1549
  abortSignal: options.abortSignal,
@@ -1621,37 +1626,44 @@ var OpenAICompletionLanguageModel = class {
1621
1626
  };
1622
1627
 
1623
1628
  // src/embedding/openai-embedding-model.ts
1624
- var import_provider5 = require("@ai-sdk/provider");
1625
- var import_provider_utils11 = require("@ai-sdk/provider-utils");
1629
+ import {
1630
+ TooManyEmbeddingValuesForCallError
1631
+ } from "@ai-sdk/provider";
1632
+ import {
1633
+ combineHeaders as combineHeaders3,
1634
+ createJsonResponseHandler as createJsonResponseHandler3,
1635
+ parseProviderOptions as parseProviderOptions3,
1636
+ postJsonToApi as postJsonToApi3
1637
+ } from "@ai-sdk/provider-utils";
1626
1638
 
1627
1639
  // src/embedding/openai-embedding-options.ts
1628
- var import_provider_utils9 = require("@ai-sdk/provider-utils");
1629
- var import_v46 = require("zod/v4");
1630
- var openaiEmbeddingModelOptions = (0, import_provider_utils9.lazySchema)(
1631
- () => (0, import_provider_utils9.zodSchema)(
1632
- import_v46.z.object({
1640
+ import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
1641
+ import { z as z6 } from "zod/v4";
1642
+ var openaiEmbeddingModelOptions = lazySchema5(
1643
+ () => zodSchema5(
1644
+ z6.object({
1633
1645
  /**
1634
1646
  * The number of dimensions the resulting output embeddings should have.
1635
1647
  * Only supported in text-embedding-3 and later models.
1636
1648
  */
1637
- dimensions: import_v46.z.number().optional(),
1649
+ dimensions: z6.number().optional(),
1638
1650
  /**
1639
1651
  * A unique identifier representing your end-user, which can help OpenAI to
1640
1652
  * monitor and detect abuse. Learn more.
1641
1653
  */
1642
- user: import_v46.z.string().optional()
1654
+ user: z6.string().optional()
1643
1655
  })
1644
1656
  )
1645
1657
  );
1646
1658
 
1647
1659
  // src/embedding/openai-embedding-api.ts
1648
- var import_provider_utils10 = require("@ai-sdk/provider-utils");
1649
- var import_v47 = require("zod/v4");
1650
- var openaiTextEmbeddingResponseSchema = (0, import_provider_utils10.lazySchema)(
1651
- () => (0, import_provider_utils10.zodSchema)(
1652
- import_v47.z.object({
1653
- data: import_v47.z.array(import_v47.z.object({ embedding: import_v47.z.array(import_v47.z.number()) })),
1654
- usage: import_v47.z.object({ prompt_tokens: import_v47.z.number() }).nullish()
1660
+ import { lazySchema as lazySchema6, zodSchema as zodSchema6 } from "@ai-sdk/provider-utils";
1661
+ import { z as z7 } from "zod/v4";
1662
+ var openaiTextEmbeddingResponseSchema = lazySchema6(
1663
+ () => zodSchema6(
1664
+ z7.object({
1665
+ data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),
1666
+ usage: z7.object({ prompt_tokens: z7.number() }).nullish()
1655
1667
  })
1656
1668
  )
1657
1669
  );
@@ -1676,14 +1688,14 @@ var OpenAIEmbeddingModel = class {
1676
1688
  }) {
1677
1689
  var _a;
1678
1690
  if (values.length > this.maxEmbeddingsPerCall) {
1679
- throw new import_provider5.TooManyEmbeddingValuesForCallError({
1691
+ throw new TooManyEmbeddingValuesForCallError({
1680
1692
  provider: this.provider,
1681
1693
  modelId: this.modelId,
1682
1694
  maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
1683
1695
  values
1684
1696
  });
1685
1697
  }
1686
- const openaiOptions = (_a = await (0, import_provider_utils11.parseProviderOptions)({
1698
+ const openaiOptions = (_a = await parseProviderOptions3({
1687
1699
  provider: "openai",
1688
1700
  providerOptions,
1689
1701
  schema: openaiEmbeddingModelOptions
@@ -1692,12 +1704,12 @@ var OpenAIEmbeddingModel = class {
1692
1704
  responseHeaders,
1693
1705
  value: response,
1694
1706
  rawValue
1695
- } = await (0, import_provider_utils11.postJsonToApi)({
1707
+ } = await postJsonToApi3({
1696
1708
  url: this.config.url({
1697
1709
  path: "/embeddings",
1698
1710
  modelId: this.modelId
1699
1711
  }),
1700
- headers: (0, import_provider_utils11.combineHeaders)(this.config.headers(), headers),
1712
+ headers: combineHeaders3(this.config.headers(), headers),
1701
1713
  body: {
1702
1714
  model: this.modelId,
1703
1715
  input: values,
@@ -1706,7 +1718,7 @@ var OpenAIEmbeddingModel = class {
1706
1718
  user: openaiOptions.user
1707
1719
  },
1708
1720
  failedResponseHandler: openaiFailedResponseHandler,
1709
- successfulResponseHandler: (0, import_provider_utils11.createJsonResponseHandler)(
1721
+ successfulResponseHandler: createJsonResponseHandler3(
1710
1722
  openaiTextEmbeddingResponseSchema
1711
1723
  ),
1712
1724
  abortSignal,
@@ -1722,39 +1734,45 @@ var OpenAIEmbeddingModel = class {
1722
1734
  };
1723
1735
 
1724
1736
  // src/files/openai-files.ts
1725
- var import_provider_utils14 = require("@ai-sdk/provider-utils");
1737
+ import {
1738
+ combineHeaders as combineHeaders4,
1739
+ convertBase64ToUint8Array,
1740
+ createJsonResponseHandler as createJsonResponseHandler4,
1741
+ parseProviderOptions as parseProviderOptions4,
1742
+ postFormDataToApi
1743
+ } from "@ai-sdk/provider-utils";
1726
1744
 
1727
1745
  // src/files/openai-files-api.ts
1728
- var import_provider_utils12 = require("@ai-sdk/provider-utils");
1729
- var import_v48 = require("zod/v4");
1730
- var openaiFilesResponseSchema = (0, import_provider_utils12.lazySchema)(
1731
- () => (0, import_provider_utils12.zodSchema)(
1732
- import_v48.z.object({
1733
- id: import_v48.z.string(),
1734
- object: import_v48.z.string().nullish(),
1735
- bytes: import_v48.z.number().nullish(),
1736
- created_at: import_v48.z.number().nullish(),
1737
- filename: import_v48.z.string().nullish(),
1738
- purpose: import_v48.z.string().nullish(),
1739
- status: import_v48.z.string().nullish(),
1740
- expires_at: import_v48.z.number().nullish()
1746
+ import { lazySchema as lazySchema7, zodSchema as zodSchema7 } from "@ai-sdk/provider-utils";
1747
+ import { z as z8 } from "zod/v4";
1748
+ var openaiFilesResponseSchema = lazySchema7(
1749
+ () => zodSchema7(
1750
+ z8.object({
1751
+ id: z8.string(),
1752
+ object: z8.string().nullish(),
1753
+ bytes: z8.number().nullish(),
1754
+ created_at: z8.number().nullish(),
1755
+ filename: z8.string().nullish(),
1756
+ purpose: z8.string().nullish(),
1757
+ status: z8.string().nullish(),
1758
+ expires_at: z8.number().nullish()
1741
1759
  })
1742
1760
  )
1743
1761
  );
1744
1762
 
1745
1763
  // src/files/openai-files-options.ts
1746
- var import_provider_utils13 = require("@ai-sdk/provider-utils");
1747
- var import_v49 = require("zod/v4");
1748
- var openaiFilesOptionsSchema = (0, import_provider_utils13.lazySchema)(
1749
- () => (0, import_provider_utils13.zodSchema)(
1750
- import_v49.z.object({
1764
+ import { lazySchema as lazySchema8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
1765
+ import { z as z9 } from "zod/v4";
1766
+ var openaiFilesOptionsSchema = lazySchema8(
1767
+ () => zodSchema8(
1768
+ z9.object({
1751
1769
  /*
1752
1770
  * Required by the OpenAI API, but optional here because
1753
1771
  * the SDK defaults to "assistants" — by far the most common
1754
1772
  * purpose when uploading files in this context.
1755
1773
  */
1756
- purpose: import_v49.z.string().optional(),
1757
- expiresAfter: import_v49.z.number().optional()
1774
+ purpose: z9.string().optional(),
1775
+ expiresAfter: z9.number().optional()
1758
1776
  })
1759
1777
  )
1760
1778
  );
@@ -1775,12 +1793,12 @@ var OpenAIFiles = class {
1775
1793
  providerOptions
1776
1794
  }) {
1777
1795
  var _a, _b, _c;
1778
- const openaiOptions = await (0, import_provider_utils14.parseProviderOptions)({
1796
+ const openaiOptions = await parseProviderOptions4({
1779
1797
  provider: "openai",
1780
1798
  providerOptions,
1781
1799
  schema: openaiFilesOptionsSchema
1782
1800
  });
1783
- const fileBytes = data instanceof Uint8Array ? data : (0, import_provider_utils14.convertBase64ToUint8Array)(data);
1801
+ const fileBytes = data instanceof Uint8Array ? data : convertBase64ToUint8Array(data);
1784
1802
  const blob = new Blob([fileBytes], {
1785
1803
  type: mediaType
1786
1804
  });
@@ -1794,12 +1812,12 @@ var OpenAIFiles = class {
1794
1812
  if ((openaiOptions == null ? void 0 : openaiOptions.expiresAfter) != null) {
1795
1813
  formData.append("expires_after", String(openaiOptions.expiresAfter));
1796
1814
  }
1797
- const { value: response } = await (0, import_provider_utils14.postFormDataToApi)({
1815
+ const { value: response } = await postFormDataToApi({
1798
1816
  url: `${this.config.baseURL}/files`,
1799
- headers: (0, import_provider_utils14.combineHeaders)(this.config.headers()),
1817
+ headers: combineHeaders4(this.config.headers()),
1800
1818
  formData,
1801
1819
  failedResponseHandler: openaiFailedResponseHandler,
1802
- successfulResponseHandler: (0, import_provider_utils14.createJsonResponseHandler)(
1820
+ successfulResponseHandler: createJsonResponseHandler4(
1803
1821
  openaiFilesResponseSchema
1804
1822
  ),
1805
1823
  fetch: this.config.fetch
@@ -1824,32 +1842,40 @@ var OpenAIFiles = class {
1824
1842
  };
1825
1843
 
1826
1844
  // src/image/openai-image-model.ts
1827
- var import_provider_utils16 = require("@ai-sdk/provider-utils");
1845
+ import {
1846
+ combineHeaders as combineHeaders5,
1847
+ convertBase64ToUint8Array as convertBase64ToUint8Array2,
1848
+ convertToFormData,
1849
+ createJsonResponseHandler as createJsonResponseHandler5,
1850
+ downloadBlob,
1851
+ postFormDataToApi as postFormDataToApi2,
1852
+ postJsonToApi as postJsonToApi4
1853
+ } from "@ai-sdk/provider-utils";
1828
1854
 
1829
1855
  // src/image/openai-image-api.ts
1830
- var import_provider_utils15 = require("@ai-sdk/provider-utils");
1831
- var import_v410 = require("zod/v4");
1832
- var openaiImageResponseSchema = (0, import_provider_utils15.lazySchema)(
1833
- () => (0, import_provider_utils15.zodSchema)(
1834
- import_v410.z.object({
1835
- created: import_v410.z.number().nullish(),
1836
- data: import_v410.z.array(
1837
- import_v410.z.object({
1838
- b64_json: import_v410.z.string(),
1839
- revised_prompt: import_v410.z.string().nullish()
1856
+ import { lazySchema as lazySchema9, zodSchema as zodSchema9 } from "@ai-sdk/provider-utils";
1857
+ import { z as z10 } from "zod/v4";
1858
+ var openaiImageResponseSchema = lazySchema9(
1859
+ () => zodSchema9(
1860
+ z10.object({
1861
+ created: z10.number().nullish(),
1862
+ data: z10.array(
1863
+ z10.object({
1864
+ b64_json: z10.string(),
1865
+ revised_prompt: z10.string().nullish()
1840
1866
  })
1841
1867
  ),
1842
- background: import_v410.z.string().nullish(),
1843
- output_format: import_v410.z.string().nullish(),
1844
- size: import_v410.z.string().nullish(),
1845
- quality: import_v410.z.string().nullish(),
1846
- usage: import_v410.z.object({
1847
- input_tokens: import_v410.z.number().nullish(),
1848
- output_tokens: import_v410.z.number().nullish(),
1849
- total_tokens: import_v410.z.number().nullish(),
1850
- input_tokens_details: import_v410.z.object({
1851
- image_tokens: import_v410.z.number().nullish(),
1852
- text_tokens: import_v410.z.number().nullish()
1868
+ background: z10.string().nullish(),
1869
+ output_format: z10.string().nullish(),
1870
+ size: z10.string().nullish(),
1871
+ quality: z10.string().nullish(),
1872
+ usage: z10.object({
1873
+ input_tokens: z10.number().nullish(),
1874
+ output_tokens: z10.number().nullish(),
1875
+ total_tokens: z10.number().nullish(),
1876
+ input_tokens_details: z10.object({
1877
+ image_tokens: z10.number().nullish(),
1878
+ text_tokens: z10.number().nullish()
1853
1879
  }).nullish()
1854
1880
  }).nullish()
1855
1881
  })
@@ -1917,13 +1943,13 @@ var OpenAIImageModel = class {
1917
1943
  }
1918
1944
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
1919
1945
  if (files != null) {
1920
- const { value: response2, responseHeaders: responseHeaders2 } = await (0, import_provider_utils16.postFormDataToApi)({
1946
+ const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi2({
1921
1947
  url: this.config.url({
1922
1948
  path: "/images/edits",
1923
1949
  modelId: this.modelId
1924
1950
  }),
1925
- headers: (0, import_provider_utils16.combineHeaders)(this.config.headers(), headers),
1926
- formData: (0, import_provider_utils16.convertToFormData)({
1951
+ headers: combineHeaders5(this.config.headers(), headers),
1952
+ formData: convertToFormData({
1927
1953
  model: this.modelId,
1928
1954
  prompt,
1929
1955
  image: await Promise.all(
@@ -1932,12 +1958,12 @@ var OpenAIImageModel = class {
1932
1958
  [
1933
1959
  file.data instanceof Uint8Array ? new Blob([file.data], {
1934
1960
  type: file.mediaType
1935
- }) : new Blob([(0, import_provider_utils16.convertBase64ToUint8Array)(file.data)], {
1961
+ }) : new Blob([convertBase64ToUint8Array2(file.data)], {
1936
1962
  type: file.mediaType
1937
1963
  })
1938
1964
  ],
1939
1965
  { type: file.mediaType }
1940
- ) : (0, import_provider_utils16.downloadBlob)(file.url)
1966
+ ) : downloadBlob(file.url)
1941
1967
  )
1942
1968
  ),
1943
1969
  mask: mask != null ? await fileToBlob(mask) : void 0,
@@ -1946,7 +1972,7 @@ var OpenAIImageModel = class {
1946
1972
  ...(_d = providerOptions.openai) != null ? _d : {}
1947
1973
  }),
1948
1974
  failedResponseHandler: openaiFailedResponseHandler,
1949
- successfulResponseHandler: (0, import_provider_utils16.createJsonResponseHandler)(
1975
+ successfulResponseHandler: createJsonResponseHandler5(
1950
1976
  openaiImageResponseSchema
1951
1977
  ),
1952
1978
  abortSignal,
@@ -1987,12 +2013,12 @@ var OpenAIImageModel = class {
1987
2013
  }
1988
2014
  };
1989
2015
  }
1990
- const { value: response, responseHeaders } = await (0, import_provider_utils16.postJsonToApi)({
2016
+ const { value: response, responseHeaders } = await postJsonToApi4({
1991
2017
  url: this.config.url({
1992
2018
  path: "/images/generations",
1993
2019
  modelId: this.modelId
1994
2020
  }),
1995
- headers: (0, import_provider_utils16.combineHeaders)(this.config.headers(), headers),
2021
+ headers: combineHeaders5(this.config.headers(), headers),
1996
2022
  body: {
1997
2023
  model: this.modelId,
1998
2024
  prompt,
@@ -2002,7 +2028,7 @@ var OpenAIImageModel = class {
2002
2028
  ...!hasDefaultResponseFormat(this.modelId) ? { response_format: "b64_json" } : {}
2003
2029
  },
2004
2030
  failedResponseHandler: openaiFailedResponseHandler,
2005
- successfulResponseHandler: (0, import_provider_utils16.createJsonResponseHandler)(
2031
+ successfulResponseHandler: createJsonResponseHandler5(
2006
2032
  openaiImageResponseSchema
2007
2033
  ),
2008
2034
  abortSignal,
@@ -2064,48 +2090,52 @@ function distributeTokenDetails(details, index, total) {
2064
2090
  async function fileToBlob(file) {
2065
2091
  if (!file) return void 0;
2066
2092
  if (file.type === "url") {
2067
- return (0, import_provider_utils16.downloadBlob)(file.url);
2093
+ return downloadBlob(file.url);
2068
2094
  }
2069
- const data = file.data instanceof Uint8Array ? file.data : (0, import_provider_utils16.convertBase64ToUint8Array)(file.data);
2095
+ const data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array2(file.data);
2070
2096
  return new Blob([data], { type: file.mediaType });
2071
2097
  }
2072
2098
 
2073
2099
  // src/tool/apply-patch.ts
2074
- var import_provider_utils17 = require("@ai-sdk/provider-utils");
2075
- var import_v411 = require("zod/v4");
2076
- var applyPatchInputSchema = (0, import_provider_utils17.lazySchema)(
2077
- () => (0, import_provider_utils17.zodSchema)(
2078
- import_v411.z.object({
2079
- callId: import_v411.z.string(),
2080
- operation: import_v411.z.discriminatedUnion("type", [
2081
- import_v411.z.object({
2082
- type: import_v411.z.literal("create_file"),
2083
- path: import_v411.z.string(),
2084
- diff: import_v411.z.string()
2100
+ import {
2101
+ createProviderToolFactoryWithOutputSchema,
2102
+ lazySchema as lazySchema10,
2103
+ zodSchema as zodSchema10
2104
+ } from "@ai-sdk/provider-utils";
2105
+ import { z as z11 } from "zod/v4";
2106
+ var applyPatchInputSchema = lazySchema10(
2107
+ () => zodSchema10(
2108
+ z11.object({
2109
+ callId: z11.string(),
2110
+ operation: z11.discriminatedUnion("type", [
2111
+ z11.object({
2112
+ type: z11.literal("create_file"),
2113
+ path: z11.string(),
2114
+ diff: z11.string()
2085
2115
  }),
2086
- import_v411.z.object({
2087
- type: import_v411.z.literal("delete_file"),
2088
- path: import_v411.z.string()
2116
+ z11.object({
2117
+ type: z11.literal("delete_file"),
2118
+ path: z11.string()
2089
2119
  }),
2090
- import_v411.z.object({
2091
- type: import_v411.z.literal("update_file"),
2092
- path: import_v411.z.string(),
2093
- diff: import_v411.z.string()
2120
+ z11.object({
2121
+ type: z11.literal("update_file"),
2122
+ path: z11.string(),
2123
+ diff: z11.string()
2094
2124
  })
2095
2125
  ])
2096
2126
  })
2097
2127
  )
2098
2128
  );
2099
- var applyPatchOutputSchema = (0, import_provider_utils17.lazySchema)(
2100
- () => (0, import_provider_utils17.zodSchema)(
2101
- import_v411.z.object({
2102
- status: import_v411.z.enum(["completed", "failed"]),
2103
- output: import_v411.z.string().optional()
2129
+ var applyPatchOutputSchema = lazySchema10(
2130
+ () => zodSchema10(
2131
+ z11.object({
2132
+ status: z11.enum(["completed", "failed"]),
2133
+ output: z11.string().optional()
2104
2134
  })
2105
2135
  )
2106
2136
  );
2107
- var applyPatchArgsSchema = (0, import_provider_utils17.lazySchema)(() => (0, import_provider_utils17.zodSchema)(import_v411.z.object({})));
2108
- var applyPatchToolFactory = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
2137
+ var applyPatchArgsSchema = lazySchema10(() => zodSchema10(z11.object({})));
2138
+ var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
2109
2139
  id: "openai.apply_patch",
2110
2140
  inputSchema: applyPatchInputSchema,
2111
2141
  outputSchema: applyPatchOutputSchema
@@ -2113,41 +2143,45 @@ var applyPatchToolFactory = (0, import_provider_utils17.createProviderToolFactor
2113
2143
  var applyPatch = applyPatchToolFactory;
2114
2144
 
2115
2145
  // src/tool/code-interpreter.ts
2116
- var import_provider_utils18 = require("@ai-sdk/provider-utils");
2117
- var import_v412 = require("zod/v4");
2118
- var codeInterpreterInputSchema = (0, import_provider_utils18.lazySchema)(
2119
- () => (0, import_provider_utils18.zodSchema)(
2120
- import_v412.z.object({
2121
- code: import_v412.z.string().nullish(),
2122
- containerId: import_v412.z.string()
2146
+ import {
2147
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
2148
+ lazySchema as lazySchema11,
2149
+ zodSchema as zodSchema11
2150
+ } from "@ai-sdk/provider-utils";
2151
+ import { z as z12 } from "zod/v4";
2152
+ var codeInterpreterInputSchema = lazySchema11(
2153
+ () => zodSchema11(
2154
+ z12.object({
2155
+ code: z12.string().nullish(),
2156
+ containerId: z12.string()
2123
2157
  })
2124
2158
  )
2125
2159
  );
2126
- var codeInterpreterOutputSchema = (0, import_provider_utils18.lazySchema)(
2127
- () => (0, import_provider_utils18.zodSchema)(
2128
- import_v412.z.object({
2129
- outputs: import_v412.z.array(
2130
- import_v412.z.discriminatedUnion("type", [
2131
- import_v412.z.object({ type: import_v412.z.literal("logs"), logs: import_v412.z.string() }),
2132
- import_v412.z.object({ type: import_v412.z.literal("image"), url: import_v412.z.string() })
2160
+ var codeInterpreterOutputSchema = lazySchema11(
2161
+ () => zodSchema11(
2162
+ z12.object({
2163
+ outputs: z12.array(
2164
+ z12.discriminatedUnion("type", [
2165
+ z12.object({ type: z12.literal("logs"), logs: z12.string() }),
2166
+ z12.object({ type: z12.literal("image"), url: z12.string() })
2133
2167
  ])
2134
2168
  ).nullish()
2135
2169
  })
2136
2170
  )
2137
2171
  );
2138
- var codeInterpreterArgsSchema = (0, import_provider_utils18.lazySchema)(
2139
- () => (0, import_provider_utils18.zodSchema)(
2140
- import_v412.z.object({
2141
- container: import_v412.z.union([
2142
- import_v412.z.string(),
2143
- import_v412.z.object({
2144
- fileIds: import_v412.z.array(import_v412.z.string()).optional()
2172
+ var codeInterpreterArgsSchema = lazySchema11(
2173
+ () => zodSchema11(
2174
+ z12.object({
2175
+ container: z12.union([
2176
+ z12.string(),
2177
+ z12.object({
2178
+ fileIds: z12.array(z12.string()).optional()
2145
2179
  })
2146
2180
  ]).optional()
2147
2181
  })
2148
2182
  )
2149
2183
  );
2150
- var codeInterpreterToolFactory = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
2184
+ var codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema2({
2151
2185
  id: "openai.code_interpreter",
2152
2186
  inputSchema: codeInterpreterInputSchema,
2153
2187
  outputSchema: codeInterpreterOutputSchema
@@ -2157,108 +2191,120 @@ var codeInterpreter = (args = {}) => {
2157
2191
  };
2158
2192
 
2159
2193
  // src/tool/custom.ts
2160
- var import_provider_utils19 = require("@ai-sdk/provider-utils");
2161
- var import_v413 = require("zod/v4");
2162
- var customArgsSchema = (0, import_provider_utils19.lazySchema)(
2163
- () => (0, import_provider_utils19.zodSchema)(
2164
- import_v413.z.object({
2165
- description: import_v413.z.string().optional(),
2166
- format: import_v413.z.union([
2167
- import_v413.z.object({
2168
- type: import_v413.z.literal("grammar"),
2169
- syntax: import_v413.z.enum(["regex", "lark"]),
2170
- definition: import_v413.z.string()
2194
+ import {
2195
+ createProviderToolFactory,
2196
+ lazySchema as lazySchema12,
2197
+ zodSchema as zodSchema12
2198
+ } from "@ai-sdk/provider-utils";
2199
+ import { z as z13 } from "zod/v4";
2200
+ var customArgsSchema = lazySchema12(
2201
+ () => zodSchema12(
2202
+ z13.object({
2203
+ description: z13.string().optional(),
2204
+ format: z13.union([
2205
+ z13.object({
2206
+ type: z13.literal("grammar"),
2207
+ syntax: z13.enum(["regex", "lark"]),
2208
+ definition: z13.string()
2171
2209
  }),
2172
- import_v413.z.object({
2173
- type: import_v413.z.literal("text")
2210
+ z13.object({
2211
+ type: z13.literal("text")
2174
2212
  })
2175
2213
  ]).optional()
2176
2214
  })
2177
2215
  )
2178
2216
  );
2179
- var customInputSchema = (0, import_provider_utils19.lazySchema)(() => (0, import_provider_utils19.zodSchema)(import_v413.z.string()));
2180
- var customToolFactory = (0, import_provider_utils19.createProviderToolFactory)({
2217
+ var customInputSchema = lazySchema12(() => zodSchema12(z13.string()));
2218
+ var customToolFactory = createProviderToolFactory({
2181
2219
  id: "openai.custom",
2182
2220
  inputSchema: customInputSchema
2183
2221
  });
2184
2222
  var customTool = (args) => customToolFactory(args);
2185
2223
 
2186
2224
  // src/tool/file-search.ts
2187
- var import_provider_utils20 = require("@ai-sdk/provider-utils");
2188
- var import_v414 = require("zod/v4");
2189
- var comparisonFilterSchema = import_v414.z.object({
2190
- key: import_v414.z.string(),
2191
- type: import_v414.z.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2192
- value: import_v414.z.union([import_v414.z.string(), import_v414.z.number(), import_v414.z.boolean(), import_v414.z.array(import_v414.z.string())])
2225
+ import {
2226
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
2227
+ lazySchema as lazySchema13,
2228
+ zodSchema as zodSchema13
2229
+ } from "@ai-sdk/provider-utils";
2230
+ import { z as z14 } from "zod/v4";
2231
+ var comparisonFilterSchema = z14.object({
2232
+ key: z14.string(),
2233
+ type: z14.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
2234
+ value: z14.union([z14.string(), z14.number(), z14.boolean(), z14.array(z14.string())])
2193
2235
  });
2194
- var compoundFilterSchema = import_v414.z.object({
2195
- type: import_v414.z.enum(["and", "or"]),
2196
- filters: import_v414.z.array(
2197
- import_v414.z.union([comparisonFilterSchema, import_v414.z.lazy(() => compoundFilterSchema)])
2236
+ var compoundFilterSchema = z14.object({
2237
+ type: z14.enum(["and", "or"]),
2238
+ filters: z14.array(
2239
+ z14.union([comparisonFilterSchema, z14.lazy(() => compoundFilterSchema)])
2198
2240
  )
2199
2241
  });
2200
- var fileSearchArgsSchema = (0, import_provider_utils20.lazySchema)(
2201
- () => (0, import_provider_utils20.zodSchema)(
2202
- import_v414.z.object({
2203
- vectorStoreIds: import_v414.z.array(import_v414.z.string()),
2204
- maxNumResults: import_v414.z.number().optional(),
2205
- ranking: import_v414.z.object({
2206
- ranker: import_v414.z.string().optional(),
2207
- scoreThreshold: import_v414.z.number().optional()
2242
+ var fileSearchArgsSchema = lazySchema13(
2243
+ () => zodSchema13(
2244
+ z14.object({
2245
+ vectorStoreIds: z14.array(z14.string()),
2246
+ maxNumResults: z14.number().optional(),
2247
+ ranking: z14.object({
2248
+ ranker: z14.string().optional(),
2249
+ scoreThreshold: z14.number().optional()
2208
2250
  }).optional(),
2209
- filters: import_v414.z.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2251
+ filters: z14.union([comparisonFilterSchema, compoundFilterSchema]).optional()
2210
2252
  })
2211
2253
  )
2212
2254
  );
2213
- var fileSearchOutputSchema = (0, import_provider_utils20.lazySchema)(
2214
- () => (0, import_provider_utils20.zodSchema)(
2215
- import_v414.z.object({
2216
- queries: import_v414.z.array(import_v414.z.string()),
2217
- results: import_v414.z.array(
2218
- import_v414.z.object({
2219
- attributes: import_v414.z.record(import_v414.z.string(), import_v414.z.unknown()),
2220
- fileId: import_v414.z.string(),
2221
- filename: import_v414.z.string(),
2222
- score: import_v414.z.number(),
2223
- text: import_v414.z.string()
2255
+ var fileSearchOutputSchema = lazySchema13(
2256
+ () => zodSchema13(
2257
+ z14.object({
2258
+ queries: z14.array(z14.string()),
2259
+ results: z14.array(
2260
+ z14.object({
2261
+ attributes: z14.record(z14.string(), z14.unknown()),
2262
+ fileId: z14.string(),
2263
+ filename: z14.string(),
2264
+ score: z14.number(),
2265
+ text: z14.string()
2224
2266
  })
2225
2267
  ).nullable()
2226
2268
  })
2227
2269
  )
2228
2270
  );
2229
- var fileSearch = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
2271
+ var fileSearch = createProviderToolFactoryWithOutputSchema3({
2230
2272
  id: "openai.file_search",
2231
- inputSchema: import_v414.z.object({}),
2273
+ inputSchema: z14.object({}),
2232
2274
  outputSchema: fileSearchOutputSchema
2233
2275
  });
2234
2276
 
2235
2277
  // src/tool/image-generation.ts
2236
- var import_provider_utils21 = require("@ai-sdk/provider-utils");
2237
- var import_v415 = require("zod/v4");
2238
- var imageGenerationArgsSchema = (0, import_provider_utils21.lazySchema)(
2239
- () => (0, import_provider_utils21.zodSchema)(
2240
- import_v415.z.object({
2241
- background: import_v415.z.enum(["auto", "opaque", "transparent"]).optional(),
2242
- inputFidelity: import_v415.z.enum(["low", "high"]).optional(),
2243
- inputImageMask: import_v415.z.object({
2244
- fileId: import_v415.z.string().optional(),
2245
- imageUrl: import_v415.z.string().optional()
2278
+ import {
2279
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
2280
+ lazySchema as lazySchema14,
2281
+ zodSchema as zodSchema14
2282
+ } from "@ai-sdk/provider-utils";
2283
+ import { z as z15 } from "zod/v4";
2284
+ var imageGenerationArgsSchema = lazySchema14(
2285
+ () => zodSchema14(
2286
+ z15.object({
2287
+ background: z15.enum(["auto", "opaque", "transparent"]).optional(),
2288
+ inputFidelity: z15.enum(["low", "high"]).optional(),
2289
+ inputImageMask: z15.object({
2290
+ fileId: z15.string().optional(),
2291
+ imageUrl: z15.string().optional()
2246
2292
  }).optional(),
2247
- model: import_v415.z.string().optional(),
2248
- moderation: import_v415.z.enum(["auto"]).optional(),
2249
- outputCompression: import_v415.z.number().int().min(0).max(100).optional(),
2250
- outputFormat: import_v415.z.enum(["png", "jpeg", "webp"]).optional(),
2251
- partialImages: import_v415.z.number().int().min(0).max(3).optional(),
2252
- quality: import_v415.z.enum(["auto", "low", "medium", "high"]).optional(),
2253
- size: import_v415.z.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2293
+ model: z15.string().optional(),
2294
+ moderation: z15.enum(["auto"]).optional(),
2295
+ outputCompression: z15.number().int().min(0).max(100).optional(),
2296
+ outputFormat: z15.enum(["png", "jpeg", "webp"]).optional(),
2297
+ partialImages: z15.number().int().min(0).max(3).optional(),
2298
+ quality: z15.enum(["auto", "low", "medium", "high"]).optional(),
2299
+ size: z15.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
2254
2300
  }).strict()
2255
2301
  )
2256
2302
  );
2257
- var imageGenerationInputSchema = (0, import_provider_utils21.lazySchema)(() => (0, import_provider_utils21.zodSchema)(import_v415.z.object({})));
2258
- var imageGenerationOutputSchema = (0, import_provider_utils21.lazySchema)(
2259
- () => (0, import_provider_utils21.zodSchema)(import_v415.z.object({ result: import_v415.z.string() }))
2303
+ var imageGenerationInputSchema = lazySchema14(() => zodSchema14(z15.object({})));
2304
+ var imageGenerationOutputSchema = lazySchema14(
2305
+ () => zodSchema14(z15.object({ result: z15.string() }))
2260
2306
  );
2261
- var imageGenerationToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
2307
+ var imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({
2262
2308
  id: "openai.image_generation",
2263
2309
  inputSchema: imageGenerationInputSchema,
2264
2310
  outputSchema: imageGenerationOutputSchema
@@ -2268,115 +2314,123 @@ var imageGeneration = (args = {}) => {
2268
2314
  };
2269
2315
 
2270
2316
  // src/tool/local-shell.ts
2271
- var import_provider_utils22 = require("@ai-sdk/provider-utils");
2272
- var import_v416 = require("zod/v4");
2273
- var localShellInputSchema = (0, import_provider_utils22.lazySchema)(
2274
- () => (0, import_provider_utils22.zodSchema)(
2275
- import_v416.z.object({
2276
- action: import_v416.z.object({
2277
- type: import_v416.z.literal("exec"),
2278
- command: import_v416.z.array(import_v416.z.string()),
2279
- timeoutMs: import_v416.z.number().optional(),
2280
- user: import_v416.z.string().optional(),
2281
- workingDirectory: import_v416.z.string().optional(),
2282
- env: import_v416.z.record(import_v416.z.string(), import_v416.z.string()).optional()
2317
+ import {
2318
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
2319
+ lazySchema as lazySchema15,
2320
+ zodSchema as zodSchema15
2321
+ } from "@ai-sdk/provider-utils";
2322
+ import { z as z16 } from "zod/v4";
2323
+ var localShellInputSchema = lazySchema15(
2324
+ () => zodSchema15(
2325
+ z16.object({
2326
+ action: z16.object({
2327
+ type: z16.literal("exec"),
2328
+ command: z16.array(z16.string()),
2329
+ timeoutMs: z16.number().optional(),
2330
+ user: z16.string().optional(),
2331
+ workingDirectory: z16.string().optional(),
2332
+ env: z16.record(z16.string(), z16.string()).optional()
2283
2333
  })
2284
2334
  })
2285
2335
  )
2286
2336
  );
2287
- var localShellOutputSchema = (0, import_provider_utils22.lazySchema)(
2288
- () => (0, import_provider_utils22.zodSchema)(import_v416.z.object({ output: import_v416.z.string() }))
2337
+ var localShellOutputSchema = lazySchema15(
2338
+ () => zodSchema15(z16.object({ output: z16.string() }))
2289
2339
  );
2290
- var localShell = (0, import_provider_utils22.createProviderToolFactoryWithOutputSchema)({
2340
+ var localShell = createProviderToolFactoryWithOutputSchema5({
2291
2341
  id: "openai.local_shell",
2292
2342
  inputSchema: localShellInputSchema,
2293
2343
  outputSchema: localShellOutputSchema
2294
2344
  });
2295
2345
 
2296
2346
  // src/tool/shell.ts
2297
- var import_provider_utils23 = require("@ai-sdk/provider-utils");
2298
- var import_v417 = require("zod/v4");
2299
- var shellInputSchema = (0, import_provider_utils23.lazySchema)(
2300
- () => (0, import_provider_utils23.zodSchema)(
2301
- import_v417.z.object({
2302
- action: import_v417.z.object({
2303
- commands: import_v417.z.array(import_v417.z.string()),
2304
- timeoutMs: import_v417.z.number().optional(),
2305
- maxOutputLength: import_v417.z.number().optional()
2347
+ import {
2348
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
2349
+ lazySchema as lazySchema16,
2350
+ zodSchema as zodSchema16
2351
+ } from "@ai-sdk/provider-utils";
2352
+ import { z as z17 } from "zod/v4";
2353
+ var shellInputSchema = lazySchema16(
2354
+ () => zodSchema16(
2355
+ z17.object({
2356
+ action: z17.object({
2357
+ commands: z17.array(z17.string()),
2358
+ timeoutMs: z17.number().optional(),
2359
+ maxOutputLength: z17.number().optional()
2306
2360
  })
2307
2361
  })
2308
2362
  )
2309
2363
  );
2310
- var shellOutputSchema = (0, import_provider_utils23.lazySchema)(
2311
- () => (0, import_provider_utils23.zodSchema)(
2312
- import_v417.z.object({
2313
- output: import_v417.z.array(
2314
- import_v417.z.object({
2315
- stdout: import_v417.z.string(),
2316
- stderr: import_v417.z.string(),
2317
- outcome: import_v417.z.discriminatedUnion("type", [
2318
- import_v417.z.object({ type: import_v417.z.literal("timeout") }),
2319
- import_v417.z.object({ type: import_v417.z.literal("exit"), exitCode: import_v417.z.number() })
2364
+ var shellOutputSchema = lazySchema16(
2365
+ () => zodSchema16(
2366
+ z17.object({
2367
+ output: z17.array(
2368
+ z17.object({
2369
+ stdout: z17.string(),
2370
+ stderr: z17.string(),
2371
+ outcome: z17.discriminatedUnion("type", [
2372
+ z17.object({ type: z17.literal("timeout") }),
2373
+ z17.object({ type: z17.literal("exit"), exitCode: z17.number() })
2320
2374
  ])
2321
2375
  })
2322
2376
  )
2323
2377
  })
2324
2378
  )
2325
2379
  );
2326
- var shellSkillsSchema = import_v417.z.array(
2327
- import_v417.z.discriminatedUnion("type", [
2328
- import_v417.z.object({
2329
- type: import_v417.z.literal("skillReference"),
2330
- providerReference: import_v417.z.record(import_v417.z.string(), import_v417.z.string()),
2331
- version: import_v417.z.string().optional()
2380
+ var shellSkillsSchema = z17.array(
2381
+ z17.discriminatedUnion("type", [
2382
+ z17.object({
2383
+ type: z17.literal("skillReference"),
2384
+ providerReference: z17.record(z17.string(), z17.string()),
2385
+ version: z17.string().optional()
2332
2386
  }),
2333
- import_v417.z.object({
2334
- type: import_v417.z.literal("inline"),
2335
- name: import_v417.z.string(),
2336
- description: import_v417.z.string(),
2337
- source: import_v417.z.object({
2338
- type: import_v417.z.literal("base64"),
2339
- mediaType: import_v417.z.literal("application/zip"),
2340
- data: import_v417.z.string()
2387
+ z17.object({
2388
+ type: z17.literal("inline"),
2389
+ name: z17.string(),
2390
+ description: z17.string(),
2391
+ source: z17.object({
2392
+ type: z17.literal("base64"),
2393
+ mediaType: z17.literal("application/zip"),
2394
+ data: z17.string()
2341
2395
  })
2342
2396
  })
2343
2397
  ])
2344
2398
  ).optional();
2345
- var shellArgsSchema = (0, import_provider_utils23.lazySchema)(
2346
- () => (0, import_provider_utils23.zodSchema)(
2347
- import_v417.z.object({
2348
- environment: import_v417.z.union([
2349
- import_v417.z.object({
2350
- type: import_v417.z.literal("containerAuto"),
2351
- fileIds: import_v417.z.array(import_v417.z.string()).optional(),
2352
- memoryLimit: import_v417.z.enum(["1g", "4g", "16g", "64g"]).optional(),
2353
- networkPolicy: import_v417.z.discriminatedUnion("type", [
2354
- import_v417.z.object({ type: import_v417.z.literal("disabled") }),
2355
- import_v417.z.object({
2356
- type: import_v417.z.literal("allowlist"),
2357
- allowedDomains: import_v417.z.array(import_v417.z.string()),
2358
- domainSecrets: import_v417.z.array(
2359
- import_v417.z.object({
2360
- domain: import_v417.z.string(),
2361
- name: import_v417.z.string(),
2362
- value: import_v417.z.string()
2399
+ var shellArgsSchema = lazySchema16(
2400
+ () => zodSchema16(
2401
+ z17.object({
2402
+ environment: z17.union([
2403
+ z17.object({
2404
+ type: z17.literal("containerAuto"),
2405
+ fileIds: z17.array(z17.string()).optional(),
2406
+ memoryLimit: z17.enum(["1g", "4g", "16g", "64g"]).optional(),
2407
+ networkPolicy: z17.discriminatedUnion("type", [
2408
+ z17.object({ type: z17.literal("disabled") }),
2409
+ z17.object({
2410
+ type: z17.literal("allowlist"),
2411
+ allowedDomains: z17.array(z17.string()),
2412
+ domainSecrets: z17.array(
2413
+ z17.object({
2414
+ domain: z17.string(),
2415
+ name: z17.string(),
2416
+ value: z17.string()
2363
2417
  })
2364
2418
  ).optional()
2365
2419
  })
2366
2420
  ]).optional(),
2367
2421
  skills: shellSkillsSchema
2368
2422
  }),
2369
- import_v417.z.object({
2370
- type: import_v417.z.literal("containerReference"),
2371
- containerId: import_v417.z.string()
2423
+ z17.object({
2424
+ type: z17.literal("containerReference"),
2425
+ containerId: z17.string()
2372
2426
  }),
2373
- import_v417.z.object({
2374
- type: import_v417.z.literal("local").optional(),
2375
- skills: import_v417.z.array(
2376
- import_v417.z.object({
2377
- name: import_v417.z.string(),
2378
- description: import_v417.z.string(),
2379
- path: import_v417.z.string()
2427
+ z17.object({
2428
+ type: z17.literal("local").optional(),
2429
+ skills: z17.array(
2430
+ z17.object({
2431
+ name: z17.string(),
2432
+ description: z17.string(),
2433
+ path: z17.string()
2380
2434
  })
2381
2435
  ).optional()
2382
2436
  })
@@ -2384,40 +2438,44 @@ var shellArgsSchema = (0, import_provider_utils23.lazySchema)(
2384
2438
  })
2385
2439
  )
2386
2440
  );
2387
- var shell = (0, import_provider_utils23.createProviderToolFactoryWithOutputSchema)({
2441
+ var shell = createProviderToolFactoryWithOutputSchema6({
2388
2442
  id: "openai.shell",
2389
2443
  inputSchema: shellInputSchema,
2390
2444
  outputSchema: shellOutputSchema
2391
2445
  });
2392
2446
 
2393
2447
  // src/tool/tool-search.ts
2394
- var import_provider_utils24 = require("@ai-sdk/provider-utils");
2395
- var import_v418 = require("zod/v4");
2396
- var toolSearchArgsSchema = (0, import_provider_utils24.lazySchema)(
2397
- () => (0, import_provider_utils24.zodSchema)(
2398
- import_v418.z.object({
2399
- execution: import_v418.z.enum(["server", "client"]).optional(),
2400
- description: import_v418.z.string().optional(),
2401
- parameters: import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()).optional()
2448
+ import {
2449
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
2450
+ lazySchema as lazySchema17,
2451
+ zodSchema as zodSchema17
2452
+ } from "@ai-sdk/provider-utils";
2453
+ import { z as z18 } from "zod/v4";
2454
+ var toolSearchArgsSchema = lazySchema17(
2455
+ () => zodSchema17(
2456
+ z18.object({
2457
+ execution: z18.enum(["server", "client"]).optional(),
2458
+ description: z18.string().optional(),
2459
+ parameters: z18.record(z18.string(), z18.unknown()).optional()
2402
2460
  })
2403
2461
  )
2404
2462
  );
2405
- var toolSearchInputSchema = (0, import_provider_utils24.lazySchema)(
2406
- () => (0, import_provider_utils24.zodSchema)(
2407
- import_v418.z.object({
2408
- arguments: import_v418.z.unknown().optional(),
2409
- call_id: import_v418.z.string().nullish()
2463
+ var toolSearchInputSchema = lazySchema17(
2464
+ () => zodSchema17(
2465
+ z18.object({
2466
+ arguments: z18.unknown().optional(),
2467
+ call_id: z18.string().nullish()
2410
2468
  })
2411
2469
  )
2412
2470
  );
2413
- var toolSearchOutputSchema = (0, import_provider_utils24.lazySchema)(
2414
- () => (0, import_provider_utils24.zodSchema)(
2415
- import_v418.z.object({
2416
- tools: import_v418.z.array(import_v418.z.record(import_v418.z.string(), import_v418.z.unknown()))
2471
+ var toolSearchOutputSchema = lazySchema17(
2472
+ () => zodSchema17(
2473
+ z18.object({
2474
+ tools: z18.array(z18.record(z18.string(), z18.unknown()))
2417
2475
  })
2418
2476
  )
2419
2477
  );
2420
- var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactoryWithOutputSchema)({
2478
+ var toolSearchToolFactory = createProviderToolFactoryWithOutputSchema7({
2421
2479
  id: "openai.tool_search",
2422
2480
  inputSchema: toolSearchInputSchema,
2423
2481
  outputSchema: toolSearchOutputSchema
@@ -2425,53 +2483,57 @@ var toolSearchToolFactory = (0, import_provider_utils24.createProviderToolFactor
2425
2483
  var toolSearch = (args = {}) => toolSearchToolFactory(args);
2426
2484
 
2427
2485
  // src/tool/web-search.ts
2428
- var import_provider_utils25 = require("@ai-sdk/provider-utils");
2429
- var import_v419 = require("zod/v4");
2430
- var webSearchArgsSchema = (0, import_provider_utils25.lazySchema)(
2431
- () => (0, import_provider_utils25.zodSchema)(
2432
- import_v419.z.object({
2433
- externalWebAccess: import_v419.z.boolean().optional(),
2434
- filters: import_v419.z.object({ allowedDomains: import_v419.z.array(import_v419.z.string()).optional() }).optional(),
2435
- searchContextSize: import_v419.z.enum(["low", "medium", "high"]).optional(),
2436
- userLocation: import_v419.z.object({
2437
- type: import_v419.z.literal("approximate"),
2438
- country: import_v419.z.string().optional(),
2439
- city: import_v419.z.string().optional(),
2440
- region: import_v419.z.string().optional(),
2441
- timezone: import_v419.z.string().optional()
2486
+ import {
2487
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
2488
+ lazySchema as lazySchema18,
2489
+ zodSchema as zodSchema18
2490
+ } from "@ai-sdk/provider-utils";
2491
+ import { z as z19 } from "zod/v4";
2492
+ var webSearchArgsSchema = lazySchema18(
2493
+ () => zodSchema18(
2494
+ z19.object({
2495
+ externalWebAccess: z19.boolean().optional(),
2496
+ filters: z19.object({ allowedDomains: z19.array(z19.string()).optional() }).optional(),
2497
+ searchContextSize: z19.enum(["low", "medium", "high"]).optional(),
2498
+ userLocation: z19.object({
2499
+ type: z19.literal("approximate"),
2500
+ country: z19.string().optional(),
2501
+ city: z19.string().optional(),
2502
+ region: z19.string().optional(),
2503
+ timezone: z19.string().optional()
2442
2504
  }).optional()
2443
2505
  })
2444
2506
  )
2445
2507
  );
2446
- var webSearchInputSchema = (0, import_provider_utils25.lazySchema)(() => (0, import_provider_utils25.zodSchema)(import_v419.z.object({})));
2447
- var webSearchOutputSchema = (0, import_provider_utils25.lazySchema)(
2448
- () => (0, import_provider_utils25.zodSchema)(
2449
- import_v419.z.object({
2450
- action: import_v419.z.discriminatedUnion("type", [
2451
- import_v419.z.object({
2452
- type: import_v419.z.literal("search"),
2453
- query: import_v419.z.string().optional()
2508
+ var webSearchInputSchema = lazySchema18(() => zodSchema18(z19.object({})));
2509
+ var webSearchOutputSchema = lazySchema18(
2510
+ () => zodSchema18(
2511
+ z19.object({
2512
+ action: z19.discriminatedUnion("type", [
2513
+ z19.object({
2514
+ type: z19.literal("search"),
2515
+ query: z19.string().optional()
2454
2516
  }),
2455
- import_v419.z.object({
2456
- type: import_v419.z.literal("openPage"),
2457
- url: import_v419.z.string().nullish()
2517
+ z19.object({
2518
+ type: z19.literal("openPage"),
2519
+ url: z19.string().nullish()
2458
2520
  }),
2459
- import_v419.z.object({
2460
- type: import_v419.z.literal("findInPage"),
2461
- url: import_v419.z.string().nullish(),
2462
- pattern: import_v419.z.string().nullish()
2521
+ z19.object({
2522
+ type: z19.literal("findInPage"),
2523
+ url: z19.string().nullish(),
2524
+ pattern: z19.string().nullish()
2463
2525
  })
2464
2526
  ]).optional(),
2465
- sources: import_v419.z.array(
2466
- import_v419.z.discriminatedUnion("type", [
2467
- import_v419.z.object({ type: import_v419.z.literal("url"), url: import_v419.z.string() }),
2468
- import_v419.z.object({ type: import_v419.z.literal("api"), name: import_v419.z.string() })
2527
+ sources: z19.array(
2528
+ z19.discriminatedUnion("type", [
2529
+ z19.object({ type: z19.literal("url"), url: z19.string() }),
2530
+ z19.object({ type: z19.literal("api"), name: z19.string() })
2469
2531
  ])
2470
2532
  ).optional()
2471
2533
  })
2472
2534
  )
2473
2535
  );
2474
- var webSearchToolFactory = (0, import_provider_utils25.createProviderToolFactoryWithOutputSchema)({
2536
+ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({
2475
2537
  id: "openai.web_search",
2476
2538
  inputSchema: webSearchInputSchema,
2477
2539
  outputSchema: webSearchOutputSchema
@@ -2479,109 +2541,117 @@ var webSearchToolFactory = (0, import_provider_utils25.createProviderToolFactory
2479
2541
  var webSearch = (args = {}) => webSearchToolFactory(args);
2480
2542
 
2481
2543
  // src/tool/web-search-preview.ts
2482
- var import_provider_utils26 = require("@ai-sdk/provider-utils");
2483
- var import_v420 = require("zod/v4");
2484
- var webSearchPreviewArgsSchema = (0, import_provider_utils26.lazySchema)(
2485
- () => (0, import_provider_utils26.zodSchema)(
2486
- import_v420.z.object({
2487
- searchContextSize: import_v420.z.enum(["low", "medium", "high"]).optional(),
2488
- userLocation: import_v420.z.object({
2489
- type: import_v420.z.literal("approximate"),
2490
- country: import_v420.z.string().optional(),
2491
- city: import_v420.z.string().optional(),
2492
- region: import_v420.z.string().optional(),
2493
- timezone: import_v420.z.string().optional()
2544
+ import {
2545
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
2546
+ lazySchema as lazySchema19,
2547
+ zodSchema as zodSchema19
2548
+ } from "@ai-sdk/provider-utils";
2549
+ import { z as z20 } from "zod/v4";
2550
+ var webSearchPreviewArgsSchema = lazySchema19(
2551
+ () => zodSchema19(
2552
+ z20.object({
2553
+ searchContextSize: z20.enum(["low", "medium", "high"]).optional(),
2554
+ userLocation: z20.object({
2555
+ type: z20.literal("approximate"),
2556
+ country: z20.string().optional(),
2557
+ city: z20.string().optional(),
2558
+ region: z20.string().optional(),
2559
+ timezone: z20.string().optional()
2494
2560
  }).optional()
2495
2561
  })
2496
2562
  )
2497
2563
  );
2498
- var webSearchPreviewInputSchema = (0, import_provider_utils26.lazySchema)(
2499
- () => (0, import_provider_utils26.zodSchema)(import_v420.z.object({}))
2564
+ var webSearchPreviewInputSchema = lazySchema19(
2565
+ () => zodSchema19(z20.object({}))
2500
2566
  );
2501
- var webSearchPreviewOutputSchema = (0, import_provider_utils26.lazySchema)(
2502
- () => (0, import_provider_utils26.zodSchema)(
2503
- import_v420.z.object({
2504
- action: import_v420.z.discriminatedUnion("type", [
2505
- import_v420.z.object({
2506
- type: import_v420.z.literal("search"),
2507
- query: import_v420.z.string().optional()
2567
+ var webSearchPreviewOutputSchema = lazySchema19(
2568
+ () => zodSchema19(
2569
+ z20.object({
2570
+ action: z20.discriminatedUnion("type", [
2571
+ z20.object({
2572
+ type: z20.literal("search"),
2573
+ query: z20.string().optional()
2508
2574
  }),
2509
- import_v420.z.object({
2510
- type: import_v420.z.literal("openPage"),
2511
- url: import_v420.z.string().nullish()
2575
+ z20.object({
2576
+ type: z20.literal("openPage"),
2577
+ url: z20.string().nullish()
2512
2578
  }),
2513
- import_v420.z.object({
2514
- type: import_v420.z.literal("findInPage"),
2515
- url: import_v420.z.string().nullish(),
2516
- pattern: import_v420.z.string().nullish()
2579
+ z20.object({
2580
+ type: z20.literal("findInPage"),
2581
+ url: z20.string().nullish(),
2582
+ pattern: z20.string().nullish()
2517
2583
  })
2518
2584
  ]).optional()
2519
2585
  })
2520
2586
  )
2521
2587
  );
2522
- var webSearchPreview = (0, import_provider_utils26.createProviderToolFactoryWithOutputSchema)({
2588
+ var webSearchPreview = createProviderToolFactoryWithOutputSchema9({
2523
2589
  id: "openai.web_search_preview",
2524
2590
  inputSchema: webSearchPreviewInputSchema,
2525
2591
  outputSchema: webSearchPreviewOutputSchema
2526
2592
  });
2527
2593
 
2528
2594
  // src/tool/mcp.ts
2529
- var import_provider_utils27 = require("@ai-sdk/provider-utils");
2530
- var import_v421 = require("zod/v4");
2531
- var jsonValueSchema = import_v421.z.lazy(
2532
- () => import_v421.z.union([
2533
- import_v421.z.string(),
2534
- import_v421.z.number(),
2535
- import_v421.z.boolean(),
2536
- import_v421.z.null(),
2537
- import_v421.z.array(jsonValueSchema),
2538
- import_v421.z.record(import_v421.z.string(), jsonValueSchema)
2595
+ import {
2596
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
2597
+ lazySchema as lazySchema20,
2598
+ zodSchema as zodSchema20
2599
+ } from "@ai-sdk/provider-utils";
2600
+ import { z as z21 } from "zod/v4";
2601
+ var jsonValueSchema = z21.lazy(
2602
+ () => z21.union([
2603
+ z21.string(),
2604
+ z21.number(),
2605
+ z21.boolean(),
2606
+ z21.null(),
2607
+ z21.array(jsonValueSchema),
2608
+ z21.record(z21.string(), jsonValueSchema)
2539
2609
  ])
2540
2610
  );
2541
- var mcpArgsSchema = (0, import_provider_utils27.lazySchema)(
2542
- () => (0, import_provider_utils27.zodSchema)(
2543
- import_v421.z.object({
2544
- serverLabel: import_v421.z.string(),
2545
- allowedTools: import_v421.z.union([
2546
- import_v421.z.array(import_v421.z.string()),
2547
- import_v421.z.object({
2548
- readOnly: import_v421.z.boolean().optional(),
2549
- toolNames: import_v421.z.array(import_v421.z.string()).optional()
2611
+ var mcpArgsSchema = lazySchema20(
2612
+ () => zodSchema20(
2613
+ z21.object({
2614
+ serverLabel: z21.string(),
2615
+ allowedTools: z21.union([
2616
+ z21.array(z21.string()),
2617
+ z21.object({
2618
+ readOnly: z21.boolean().optional(),
2619
+ toolNames: z21.array(z21.string()).optional()
2550
2620
  })
2551
2621
  ]).optional(),
2552
- authorization: import_v421.z.string().optional(),
2553
- connectorId: import_v421.z.string().optional(),
2554
- headers: import_v421.z.record(import_v421.z.string(), import_v421.z.string()).optional(),
2555
- requireApproval: import_v421.z.union([
2556
- import_v421.z.enum(["always", "never"]),
2557
- import_v421.z.object({
2558
- never: import_v421.z.object({
2559
- toolNames: import_v421.z.array(import_v421.z.string()).optional()
2622
+ authorization: z21.string().optional(),
2623
+ connectorId: z21.string().optional(),
2624
+ headers: z21.record(z21.string(), z21.string()).optional(),
2625
+ requireApproval: z21.union([
2626
+ z21.enum(["always", "never"]),
2627
+ z21.object({
2628
+ never: z21.object({
2629
+ toolNames: z21.array(z21.string()).optional()
2560
2630
  }).optional()
2561
2631
  })
2562
2632
  ]).optional(),
2563
- serverDescription: import_v421.z.string().optional(),
2564
- serverUrl: import_v421.z.string().optional()
2633
+ serverDescription: z21.string().optional(),
2634
+ serverUrl: z21.string().optional()
2565
2635
  }).refine(
2566
2636
  (v) => v.serverUrl != null || v.connectorId != null,
2567
2637
  "One of serverUrl or connectorId must be provided."
2568
2638
  )
2569
2639
  )
2570
2640
  );
2571
- var mcpInputSchema = (0, import_provider_utils27.lazySchema)(() => (0, import_provider_utils27.zodSchema)(import_v421.z.object({})));
2572
- var mcpOutputSchema = (0, import_provider_utils27.lazySchema)(
2573
- () => (0, import_provider_utils27.zodSchema)(
2574
- import_v421.z.object({
2575
- type: import_v421.z.literal("call"),
2576
- serverLabel: import_v421.z.string(),
2577
- name: import_v421.z.string(),
2578
- arguments: import_v421.z.string(),
2579
- output: import_v421.z.string().nullish(),
2580
- error: import_v421.z.union([import_v421.z.string(), jsonValueSchema]).optional()
2641
+ var mcpInputSchema = lazySchema20(() => zodSchema20(z21.object({})));
2642
+ var mcpOutputSchema = lazySchema20(
2643
+ () => zodSchema20(
2644
+ z21.object({
2645
+ type: z21.literal("call"),
2646
+ serverLabel: z21.string(),
2647
+ name: z21.string(),
2648
+ arguments: z21.string(),
2649
+ output: z21.string().nullish(),
2650
+ error: z21.union([z21.string(), jsonValueSchema]).optional()
2581
2651
  })
2582
2652
  )
2583
2653
  );
2584
- var mcpToolFactory = (0, import_provider_utils27.createProviderToolFactoryWithOutputSchema)({
2654
+ var mcpToolFactory = createProviderToolFactoryWithOutputSchema10({
2585
2655
  id: "openai.mcp",
2586
2656
  inputSchema: mcpInputSchema,
2587
2657
  outputSchema: mcpOutputSchema
@@ -2706,8 +2776,19 @@ var openaiTools = {
2706
2776
  };
2707
2777
 
2708
2778
  // src/responses/openai-responses-language-model.ts
2709
- var import_provider8 = require("@ai-sdk/provider");
2710
- var import_provider_utils32 = require("@ai-sdk/provider-utils");
2779
+ import {
2780
+ APICallError
2781
+ } from "@ai-sdk/provider";
2782
+ import {
2783
+ combineHeaders as combineHeaders6,
2784
+ createEventSourceResponseHandler as createEventSourceResponseHandler3,
2785
+ createJsonResponseHandler as createJsonResponseHandler6,
2786
+ createToolNameMapping,
2787
+ generateId as generateId2,
2788
+ isCustomReasoning as isCustomReasoning2,
2789
+ parseProviderOptions as parseProviderOptions6,
2790
+ postJsonToApi as postJsonToApi5
2791
+ } from "@ai-sdk/provider-utils";
2711
2792
 
2712
2793
  // src/responses/convert-openai-responses-usage.ts
2713
2794
  function convertOpenAIResponsesUsage(usage) {
@@ -2749,9 +2830,19 @@ function convertOpenAIResponsesUsage(usage) {
2749
2830
  }
2750
2831
 
2751
2832
  // src/responses/convert-to-openai-responses-input.ts
2752
- var import_provider6 = require("@ai-sdk/provider");
2753
- var import_provider_utils28 = require("@ai-sdk/provider-utils");
2754
- var import_v422 = require("zod/v4");
2833
+ import {
2834
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError4
2835
+ } from "@ai-sdk/provider";
2836
+ import {
2837
+ convertToBase64 as convertToBase642,
2838
+ isNonNullable,
2839
+ isProviderReference as isProviderReference2,
2840
+ parseJSON,
2841
+ parseProviderOptions as parseProviderOptions5,
2842
+ resolveProviderReference as resolveProviderReference2,
2843
+ validateTypes
2844
+ } from "@ai-sdk/provider-utils";
2845
+ import { z as z22 } from "zod/v4";
2755
2846
  function isFileId(data, prefixes) {
2756
2847
  if (!prefixes) return false;
2757
2848
  return prefixes.some((prefix) => data.startsWith(prefix));
@@ -2811,8 +2902,8 @@ async function convertToOpenAIResponsesInput({
2811
2902
  return { type: "input_text", text: part.text };
2812
2903
  }
2813
2904
  case "file": {
2814
- if ((0, import_provider_utils28.isProviderReference)(part.data)) {
2815
- const fileId = (0, import_provider_utils28.resolveProviderReference)({
2905
+ if (isProviderReference2(part.data)) {
2906
+ const fileId = resolveProviderReference2({
2816
2907
  reference: part.data,
2817
2908
  provider: providerOptionsName
2818
2909
  });
@@ -2833,7 +2924,7 @@ async function convertToOpenAIResponsesInput({
2833
2924
  return {
2834
2925
  type: "input_image",
2835
2926
  ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2836
- image_url: `data:${mediaType};base64,${(0, import_provider_utils28.convertToBase64)(part.data)}`
2927
+ image_url: `data:${mediaType};base64,${convertToBase642(part.data)}`
2837
2928
  },
2838
2929
  detail: (_d2 = (_c2 = part.providerOptions) == null ? void 0 : _c2[providerOptionsName]) == null ? void 0 : _d2.imageDetail
2839
2930
  };
@@ -2848,11 +2939,11 @@ async function convertToOpenAIResponsesInput({
2848
2939
  type: "input_file",
2849
2940
  ...typeof part.data === "string" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {
2850
2941
  filename: (_e2 = part.filename) != null ? _e2 : `part-${index}.pdf`,
2851
- file_data: `data:application/pdf;base64,${(0, import_provider_utils28.convertToBase64)(part.data)}`
2942
+ file_data: `data:application/pdf;base64,${convertToBase642(part.data)}`
2852
2943
  }
2853
2944
  };
2854
2945
  } else {
2855
- throw new import_provider6.UnsupportedFunctionalityError({
2946
+ throw new UnsupportedFunctionalityError4({
2856
2947
  functionality: `file part media type ${part.mediaType}`
2857
2948
  });
2858
2949
  }
@@ -2898,10 +2989,10 @@ async function convertToOpenAIResponsesInput({
2898
2989
  input.push({ type: "item_reference", id });
2899
2990
  break;
2900
2991
  }
2901
- const parsedInput = typeof part.input === "string" ? await (0, import_provider_utils28.parseJSON)({
2992
+ const parsedInput = typeof part.input === "string" ? await parseJSON({
2902
2993
  text: part.input,
2903
2994
  schema: toolSearchInputSchema
2904
- }) : await (0, import_provider_utils28.validateTypes)({
2995
+ }) : await validateTypes({
2905
2996
  value: part.input,
2906
2997
  schema: toolSearchInputSchema
2907
2998
  });
@@ -2927,7 +3018,7 @@ async function convertToOpenAIResponsesInput({
2927
3018
  break;
2928
3019
  }
2929
3020
  if (hasLocalShellTool && resolvedToolName === "local_shell") {
2930
- const parsedInput = await (0, import_provider_utils28.validateTypes)({
3021
+ const parsedInput = await validateTypes({
2931
3022
  value: part.input,
2932
3023
  schema: localShellInputSchema
2933
3024
  });
@@ -2947,7 +3038,7 @@ async function convertToOpenAIResponsesInput({
2947
3038
  break;
2948
3039
  }
2949
3040
  if (hasShellTool && resolvedToolName === "shell") {
2950
- const parsedInput = await (0, import_provider_utils28.validateTypes)({
3041
+ const parsedInput = await validateTypes({
2951
3042
  value: part.input,
2952
3043
  schema: shellInputSchema
2953
3044
  });
@@ -2965,7 +3056,7 @@ async function convertToOpenAIResponsesInput({
2965
3056
  break;
2966
3057
  }
2967
3058
  if (hasApplyPatchTool && resolvedToolName === "apply_patch") {
2968
- const parsedInput = await (0, import_provider_utils28.validateTypes)({
3059
+ const parsedInput = await validateTypes({
2969
3060
  value: part.input,
2970
3061
  schema: applyPatchInputSchema
2971
3062
  });
@@ -3013,7 +3104,7 @@ async function convertToOpenAIResponsesInput({
3013
3104
  if (store) {
3014
3105
  input.push({ type: "item_reference", id: itemId });
3015
3106
  } else if (part.output.type === "json") {
3016
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3107
+ const parsedOutput = await validateTypes({
3017
3108
  value: part.output.value,
3018
3109
  schema: toolSearchOutputSchema
3019
3110
  });
@@ -3030,7 +3121,7 @@ async function convertToOpenAIResponsesInput({
3030
3121
  }
3031
3122
  if (hasShellTool && resolvedResultToolName === "shell") {
3032
3123
  if (part.output.type === "json") {
3033
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3124
+ const parsedOutput = await validateTypes({
3034
3125
  value: part.output.value,
3035
3126
  schema: shellOutputSchema
3036
3127
  });
@@ -3061,7 +3152,7 @@ async function convertToOpenAIResponsesInput({
3061
3152
  break;
3062
3153
  }
3063
3154
  case "reasoning": {
3064
- const providerOptions = await (0, import_provider_utils28.parseProviderOptions)({
3155
+ const providerOptions = await parseProviderOptions5({
3065
3156
  provider: providerOptionsName,
3066
3157
  providerOptions: part.providerOptions,
3067
3158
  schema: openaiResponsesReasoningProviderOptionsSchema
@@ -3191,7 +3282,7 @@ async function convertToOpenAIResponsesInput({
3191
3282
  part.toolName
3192
3283
  );
3193
3284
  if (resolvedToolName === "tool_search" && output.type === "json") {
3194
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3285
+ const parsedOutput = await validateTypes({
3195
3286
  value: output.value,
3196
3287
  schema: toolSearchOutputSchema
3197
3288
  });
@@ -3205,7 +3296,7 @@ async function convertToOpenAIResponsesInput({
3205
3296
  continue;
3206
3297
  }
3207
3298
  if (hasLocalShellTool && resolvedToolName === "local_shell" && output.type === "json") {
3208
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3299
+ const parsedOutput = await validateTypes({
3209
3300
  value: output.value,
3210
3301
  schema: localShellOutputSchema
3211
3302
  });
@@ -3217,7 +3308,7 @@ async function convertToOpenAIResponsesInput({
3217
3308
  continue;
3218
3309
  }
3219
3310
  if (hasShellTool && resolvedToolName === "shell" && output.type === "json") {
3220
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3311
+ const parsedOutput = await validateTypes({
3221
3312
  value: output.value,
3222
3313
  schema: shellOutputSchema
3223
3314
  });
@@ -3236,7 +3327,7 @@ async function convertToOpenAIResponsesInput({
3236
3327
  continue;
3237
3328
  }
3238
3329
  if (hasApplyPatchTool && part.toolName === "apply_patch" && output.type === "json") {
3239
- const parsedOutput = await (0, import_provider_utils28.validateTypes)({
3330
+ const parsedOutput = await validateTypes({
3240
3331
  value: output.value,
3241
3332
  schema: applyPatchOutputSchema
3242
3333
  });
@@ -3296,7 +3387,7 @@ async function convertToOpenAIResponsesInput({
3296
3387
  });
3297
3388
  return void 0;
3298
3389
  }
3299
- }).filter(import_provider_utils28.isNonNullable);
3390
+ }).filter(isNonNullable);
3300
3391
  break;
3301
3392
  default:
3302
3393
  outputValue = "";
@@ -3361,7 +3452,7 @@ async function convertToOpenAIResponsesInput({
3361
3452
  return void 0;
3362
3453
  }
3363
3454
  }
3364
- }).filter(import_provider_utils28.isNonNullable);
3455
+ }).filter(isNonNullable);
3365
3456
  break;
3366
3457
  }
3367
3458
  input.push({
@@ -3391,9 +3482,9 @@ async function convertToOpenAIResponsesInput({
3391
3482
  }
3392
3483
  return { input, warnings };
3393
3484
  }
3394
- var openaiResponsesReasoningProviderOptionsSchema = import_v422.z.object({
3395
- itemId: import_v422.z.string().nullish(),
3396
- reasoningEncryptedContent: import_v422.z.string().nullish()
3485
+ var openaiResponsesReasoningProviderOptionsSchema = z22.object({
3486
+ itemId: z22.string().nullish(),
3487
+ reasoningEncryptedContent: z22.string().nullish()
3397
3488
  });
3398
3489
 
3399
3490
  // src/responses/map-openai-responses-finish-reason.ts
@@ -3415,552 +3506,552 @@ function mapOpenAIResponseFinishReason({
3415
3506
  }
3416
3507
 
3417
3508
  // src/responses/openai-responses-api.ts
3418
- var import_provider_utils29 = require("@ai-sdk/provider-utils");
3419
- var import_v423 = require("zod/v4");
3420
- var jsonValueSchema2 = import_v423.z.lazy(
3421
- () => import_v423.z.union([
3422
- import_v423.z.string(),
3423
- import_v423.z.number(),
3424
- import_v423.z.boolean(),
3425
- import_v423.z.null(),
3426
- import_v423.z.array(jsonValueSchema2),
3427
- import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional())
3509
+ import { lazySchema as lazySchema21, zodSchema as zodSchema21 } from "@ai-sdk/provider-utils";
3510
+ import { z as z23 } from "zod/v4";
3511
+ var jsonValueSchema2 = z23.lazy(
3512
+ () => z23.union([
3513
+ z23.string(),
3514
+ z23.number(),
3515
+ z23.boolean(),
3516
+ z23.null(),
3517
+ z23.array(jsonValueSchema2),
3518
+ z23.record(z23.string(), jsonValueSchema2.optional())
3428
3519
  ])
3429
3520
  );
3430
- var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
3431
- () => (0, import_provider_utils29.zodSchema)(
3432
- import_v423.z.union([
3433
- import_v423.z.object({
3434
- type: import_v423.z.literal("response.output_text.delta"),
3435
- item_id: import_v423.z.string(),
3436
- delta: import_v423.z.string(),
3437
- logprobs: import_v423.z.array(
3438
- import_v423.z.object({
3439
- token: import_v423.z.string(),
3440
- logprob: import_v423.z.number(),
3441
- top_logprobs: import_v423.z.array(
3442
- import_v423.z.object({
3443
- token: import_v423.z.string(),
3444
- logprob: import_v423.z.number()
3521
+ var openaiResponsesChunkSchema = lazySchema21(
3522
+ () => zodSchema21(
3523
+ z23.union([
3524
+ z23.object({
3525
+ type: z23.literal("response.output_text.delta"),
3526
+ item_id: z23.string(),
3527
+ delta: z23.string(),
3528
+ logprobs: z23.array(
3529
+ z23.object({
3530
+ token: z23.string(),
3531
+ logprob: z23.number(),
3532
+ top_logprobs: z23.array(
3533
+ z23.object({
3534
+ token: z23.string(),
3535
+ logprob: z23.number()
3445
3536
  })
3446
3537
  )
3447
3538
  })
3448
3539
  ).nullish()
3449
3540
  }),
3450
- import_v423.z.object({
3451
- type: import_v423.z.enum(["response.completed", "response.incomplete"]),
3452
- response: import_v423.z.object({
3453
- incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
3454
- usage: import_v423.z.object({
3455
- input_tokens: import_v423.z.number(),
3456
- input_tokens_details: import_v423.z.object({ cached_tokens: import_v423.z.number().nullish() }).nullish(),
3457
- output_tokens: import_v423.z.number(),
3458
- output_tokens_details: import_v423.z.object({ reasoning_tokens: import_v423.z.number().nullish() }).nullish()
3541
+ z23.object({
3542
+ type: z23.enum(["response.completed", "response.incomplete"]),
3543
+ response: z23.object({
3544
+ incomplete_details: z23.object({ reason: z23.string() }).nullish(),
3545
+ usage: z23.object({
3546
+ input_tokens: z23.number(),
3547
+ input_tokens_details: z23.object({ cached_tokens: z23.number().nullish() }).nullish(),
3548
+ output_tokens: z23.number(),
3549
+ output_tokens_details: z23.object({ reasoning_tokens: z23.number().nullish() }).nullish()
3459
3550
  }),
3460
- service_tier: import_v423.z.string().nullish()
3551
+ service_tier: z23.string().nullish()
3461
3552
  })
3462
3553
  }),
3463
- import_v423.z.object({
3464
- type: import_v423.z.literal("response.failed"),
3465
- response: import_v423.z.object({
3466
- error: import_v423.z.object({
3467
- code: import_v423.z.string().nullish(),
3468
- message: import_v423.z.string()
3554
+ z23.object({
3555
+ type: z23.literal("response.failed"),
3556
+ response: z23.object({
3557
+ error: z23.object({
3558
+ code: z23.string().nullish(),
3559
+ message: z23.string()
3469
3560
  }).nullish(),
3470
- incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
3471
- usage: import_v423.z.object({
3472
- input_tokens: import_v423.z.number(),
3473
- input_tokens_details: import_v423.z.object({ cached_tokens: import_v423.z.number().nullish() }).nullish(),
3474
- output_tokens: import_v423.z.number(),
3475
- output_tokens_details: import_v423.z.object({ reasoning_tokens: import_v423.z.number().nullish() }).nullish()
3561
+ incomplete_details: z23.object({ reason: z23.string() }).nullish(),
3562
+ usage: z23.object({
3563
+ input_tokens: z23.number(),
3564
+ input_tokens_details: z23.object({ cached_tokens: z23.number().nullish() }).nullish(),
3565
+ output_tokens: z23.number(),
3566
+ output_tokens_details: z23.object({ reasoning_tokens: z23.number().nullish() }).nullish()
3476
3567
  }).nullish(),
3477
- service_tier: import_v423.z.string().nullish()
3568
+ service_tier: z23.string().nullish()
3478
3569
  })
3479
3570
  }),
3480
- import_v423.z.object({
3481
- type: import_v423.z.literal("response.created"),
3482
- response: import_v423.z.object({
3483
- id: import_v423.z.string(),
3484
- created_at: import_v423.z.number(),
3485
- model: import_v423.z.string(),
3486
- service_tier: import_v423.z.string().nullish()
3571
+ z23.object({
3572
+ type: z23.literal("response.created"),
3573
+ response: z23.object({
3574
+ id: z23.string(),
3575
+ created_at: z23.number(),
3576
+ model: z23.string(),
3577
+ service_tier: z23.string().nullish()
3487
3578
  })
3488
3579
  }),
3489
- import_v423.z.object({
3490
- type: import_v423.z.literal("response.output_item.added"),
3491
- output_index: import_v423.z.number(),
3492
- item: import_v423.z.discriminatedUnion("type", [
3493
- import_v423.z.object({
3494
- type: import_v423.z.literal("message"),
3495
- id: import_v423.z.string(),
3496
- phase: import_v423.z.enum(["commentary", "final_answer"]).nullish()
3580
+ z23.object({
3581
+ type: z23.literal("response.output_item.added"),
3582
+ output_index: z23.number(),
3583
+ item: z23.discriminatedUnion("type", [
3584
+ z23.object({
3585
+ type: z23.literal("message"),
3586
+ id: z23.string(),
3587
+ phase: z23.enum(["commentary", "final_answer"]).nullish()
3497
3588
  }),
3498
- import_v423.z.object({
3499
- type: import_v423.z.literal("reasoning"),
3500
- id: import_v423.z.string(),
3501
- encrypted_content: import_v423.z.string().nullish()
3589
+ z23.object({
3590
+ type: z23.literal("reasoning"),
3591
+ id: z23.string(),
3592
+ encrypted_content: z23.string().nullish()
3502
3593
  }),
3503
- import_v423.z.object({
3504
- type: import_v423.z.literal("function_call"),
3505
- id: import_v423.z.string(),
3506
- call_id: import_v423.z.string(),
3507
- name: import_v423.z.string(),
3508
- arguments: import_v423.z.string()
3594
+ z23.object({
3595
+ type: z23.literal("function_call"),
3596
+ id: z23.string(),
3597
+ call_id: z23.string(),
3598
+ name: z23.string(),
3599
+ arguments: z23.string()
3509
3600
  }),
3510
- import_v423.z.object({
3511
- type: import_v423.z.literal("web_search_call"),
3512
- id: import_v423.z.string(),
3513
- status: import_v423.z.string()
3601
+ z23.object({
3602
+ type: z23.literal("web_search_call"),
3603
+ id: z23.string(),
3604
+ status: z23.string()
3514
3605
  }),
3515
- import_v423.z.object({
3516
- type: import_v423.z.literal("computer_call"),
3517
- id: import_v423.z.string(),
3518
- status: import_v423.z.string()
3606
+ z23.object({
3607
+ type: z23.literal("computer_call"),
3608
+ id: z23.string(),
3609
+ status: z23.string()
3519
3610
  }),
3520
- import_v423.z.object({
3521
- type: import_v423.z.literal("file_search_call"),
3522
- id: import_v423.z.string()
3611
+ z23.object({
3612
+ type: z23.literal("file_search_call"),
3613
+ id: z23.string()
3523
3614
  }),
3524
- import_v423.z.object({
3525
- type: import_v423.z.literal("image_generation_call"),
3526
- id: import_v423.z.string()
3615
+ z23.object({
3616
+ type: z23.literal("image_generation_call"),
3617
+ id: z23.string()
3527
3618
  }),
3528
- import_v423.z.object({
3529
- type: import_v423.z.literal("code_interpreter_call"),
3530
- id: import_v423.z.string(),
3531
- container_id: import_v423.z.string(),
3532
- code: import_v423.z.string().nullable(),
3533
- outputs: import_v423.z.array(
3534
- import_v423.z.discriminatedUnion("type", [
3535
- import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
3536
- import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
3619
+ z23.object({
3620
+ type: z23.literal("code_interpreter_call"),
3621
+ id: z23.string(),
3622
+ container_id: z23.string(),
3623
+ code: z23.string().nullable(),
3624
+ outputs: z23.array(
3625
+ z23.discriminatedUnion("type", [
3626
+ z23.object({ type: z23.literal("logs"), logs: z23.string() }),
3627
+ z23.object({ type: z23.literal("image"), url: z23.string() })
3537
3628
  ])
3538
3629
  ).nullable(),
3539
- status: import_v423.z.string()
3630
+ status: z23.string()
3540
3631
  }),
3541
- import_v423.z.object({
3542
- type: import_v423.z.literal("mcp_call"),
3543
- id: import_v423.z.string(),
3544
- status: import_v423.z.string(),
3545
- approval_request_id: import_v423.z.string().nullish()
3632
+ z23.object({
3633
+ type: z23.literal("mcp_call"),
3634
+ id: z23.string(),
3635
+ status: z23.string(),
3636
+ approval_request_id: z23.string().nullish()
3546
3637
  }),
3547
- import_v423.z.object({
3548
- type: import_v423.z.literal("mcp_list_tools"),
3549
- id: import_v423.z.string()
3638
+ z23.object({
3639
+ type: z23.literal("mcp_list_tools"),
3640
+ id: z23.string()
3550
3641
  }),
3551
- import_v423.z.object({
3552
- type: import_v423.z.literal("mcp_approval_request"),
3553
- id: import_v423.z.string()
3642
+ z23.object({
3643
+ type: z23.literal("mcp_approval_request"),
3644
+ id: z23.string()
3554
3645
  }),
3555
- import_v423.z.object({
3556
- type: import_v423.z.literal("apply_patch_call"),
3557
- id: import_v423.z.string(),
3558
- call_id: import_v423.z.string(),
3559
- status: import_v423.z.enum(["in_progress", "completed"]),
3560
- operation: import_v423.z.discriminatedUnion("type", [
3561
- import_v423.z.object({
3562
- type: import_v423.z.literal("create_file"),
3563
- path: import_v423.z.string(),
3564
- diff: import_v423.z.string()
3646
+ z23.object({
3647
+ type: z23.literal("apply_patch_call"),
3648
+ id: z23.string(),
3649
+ call_id: z23.string(),
3650
+ status: z23.enum(["in_progress", "completed"]),
3651
+ operation: z23.discriminatedUnion("type", [
3652
+ z23.object({
3653
+ type: z23.literal("create_file"),
3654
+ path: z23.string(),
3655
+ diff: z23.string()
3565
3656
  }),
3566
- import_v423.z.object({
3567
- type: import_v423.z.literal("delete_file"),
3568
- path: import_v423.z.string()
3657
+ z23.object({
3658
+ type: z23.literal("delete_file"),
3659
+ path: z23.string()
3569
3660
  }),
3570
- import_v423.z.object({
3571
- type: import_v423.z.literal("update_file"),
3572
- path: import_v423.z.string(),
3573
- diff: import_v423.z.string()
3661
+ z23.object({
3662
+ type: z23.literal("update_file"),
3663
+ path: z23.string(),
3664
+ diff: z23.string()
3574
3665
  })
3575
3666
  ])
3576
3667
  }),
3577
- import_v423.z.object({
3578
- type: import_v423.z.literal("custom_tool_call"),
3579
- id: import_v423.z.string(),
3580
- call_id: import_v423.z.string(),
3581
- name: import_v423.z.string(),
3582
- input: import_v423.z.string()
3668
+ z23.object({
3669
+ type: z23.literal("custom_tool_call"),
3670
+ id: z23.string(),
3671
+ call_id: z23.string(),
3672
+ name: z23.string(),
3673
+ input: z23.string()
3583
3674
  }),
3584
- import_v423.z.object({
3585
- type: import_v423.z.literal("shell_call"),
3586
- id: import_v423.z.string(),
3587
- call_id: import_v423.z.string(),
3588
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3589
- action: import_v423.z.object({
3590
- commands: import_v423.z.array(import_v423.z.string())
3675
+ z23.object({
3676
+ type: z23.literal("shell_call"),
3677
+ id: z23.string(),
3678
+ call_id: z23.string(),
3679
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3680
+ action: z23.object({
3681
+ commands: z23.array(z23.string())
3591
3682
  })
3592
3683
  }),
3593
- import_v423.z.object({
3594
- type: import_v423.z.literal("compaction"),
3595
- id: import_v423.z.string(),
3596
- encrypted_content: import_v423.z.string().nullish()
3684
+ z23.object({
3685
+ type: z23.literal("compaction"),
3686
+ id: z23.string(),
3687
+ encrypted_content: z23.string().nullish()
3597
3688
  }),
3598
- import_v423.z.object({
3599
- type: import_v423.z.literal("shell_call_output"),
3600
- id: import_v423.z.string(),
3601
- call_id: import_v423.z.string(),
3602
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3603
- output: import_v423.z.array(
3604
- import_v423.z.object({
3605
- stdout: import_v423.z.string(),
3606
- stderr: import_v423.z.string(),
3607
- outcome: import_v423.z.discriminatedUnion("type", [
3608
- import_v423.z.object({ type: import_v423.z.literal("timeout") }),
3609
- import_v423.z.object({
3610
- type: import_v423.z.literal("exit"),
3611
- exit_code: import_v423.z.number()
3689
+ z23.object({
3690
+ type: z23.literal("shell_call_output"),
3691
+ id: z23.string(),
3692
+ call_id: z23.string(),
3693
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3694
+ output: z23.array(
3695
+ z23.object({
3696
+ stdout: z23.string(),
3697
+ stderr: z23.string(),
3698
+ outcome: z23.discriminatedUnion("type", [
3699
+ z23.object({ type: z23.literal("timeout") }),
3700
+ z23.object({
3701
+ type: z23.literal("exit"),
3702
+ exit_code: z23.number()
3612
3703
  })
3613
3704
  ])
3614
3705
  })
3615
3706
  )
3616
3707
  }),
3617
- import_v423.z.object({
3618
- type: import_v423.z.literal("tool_search_call"),
3619
- id: import_v423.z.string(),
3620
- execution: import_v423.z.enum(["server", "client"]),
3621
- call_id: import_v423.z.string().nullable(),
3622
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3623
- arguments: import_v423.z.unknown()
3708
+ z23.object({
3709
+ type: z23.literal("tool_search_call"),
3710
+ id: z23.string(),
3711
+ execution: z23.enum(["server", "client"]),
3712
+ call_id: z23.string().nullable(),
3713
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3714
+ arguments: z23.unknown()
3624
3715
  }),
3625
- import_v423.z.object({
3626
- type: import_v423.z.literal("tool_search_output"),
3627
- id: import_v423.z.string(),
3628
- execution: import_v423.z.enum(["server", "client"]),
3629
- call_id: import_v423.z.string().nullable(),
3630
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3631
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
3716
+ z23.object({
3717
+ type: z23.literal("tool_search_output"),
3718
+ id: z23.string(),
3719
+ execution: z23.enum(["server", "client"]),
3720
+ call_id: z23.string().nullable(),
3721
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3722
+ tools: z23.array(z23.record(z23.string(), jsonValueSchema2.optional()))
3632
3723
  })
3633
3724
  ])
3634
3725
  }),
3635
- import_v423.z.object({
3636
- type: import_v423.z.literal("response.output_item.done"),
3637
- output_index: import_v423.z.number(),
3638
- item: import_v423.z.discriminatedUnion("type", [
3639
- import_v423.z.object({
3640
- type: import_v423.z.literal("message"),
3641
- id: import_v423.z.string(),
3642
- phase: import_v423.z.enum(["commentary", "final_answer"]).nullish()
3726
+ z23.object({
3727
+ type: z23.literal("response.output_item.done"),
3728
+ output_index: z23.number(),
3729
+ item: z23.discriminatedUnion("type", [
3730
+ z23.object({
3731
+ type: z23.literal("message"),
3732
+ id: z23.string(),
3733
+ phase: z23.enum(["commentary", "final_answer"]).nullish()
3643
3734
  }),
3644
- import_v423.z.object({
3645
- type: import_v423.z.literal("reasoning"),
3646
- id: import_v423.z.string(),
3647
- encrypted_content: import_v423.z.string().nullish()
3735
+ z23.object({
3736
+ type: z23.literal("reasoning"),
3737
+ id: z23.string(),
3738
+ encrypted_content: z23.string().nullish()
3648
3739
  }),
3649
- import_v423.z.object({
3650
- type: import_v423.z.literal("function_call"),
3651
- id: import_v423.z.string(),
3652
- call_id: import_v423.z.string(),
3653
- name: import_v423.z.string(),
3654
- arguments: import_v423.z.string(),
3655
- status: import_v423.z.literal("completed")
3740
+ z23.object({
3741
+ type: z23.literal("function_call"),
3742
+ id: z23.string(),
3743
+ call_id: z23.string(),
3744
+ name: z23.string(),
3745
+ arguments: z23.string(),
3746
+ status: z23.literal("completed")
3656
3747
  }),
3657
- import_v423.z.object({
3658
- type: import_v423.z.literal("custom_tool_call"),
3659
- id: import_v423.z.string(),
3660
- call_id: import_v423.z.string(),
3661
- name: import_v423.z.string(),
3662
- input: import_v423.z.string(),
3663
- status: import_v423.z.literal("completed")
3748
+ z23.object({
3749
+ type: z23.literal("custom_tool_call"),
3750
+ id: z23.string(),
3751
+ call_id: z23.string(),
3752
+ name: z23.string(),
3753
+ input: z23.string(),
3754
+ status: z23.literal("completed")
3664
3755
  }),
3665
- import_v423.z.object({
3666
- type: import_v423.z.literal("code_interpreter_call"),
3667
- id: import_v423.z.string(),
3668
- code: import_v423.z.string().nullable(),
3669
- container_id: import_v423.z.string(),
3670
- outputs: import_v423.z.array(
3671
- import_v423.z.discriminatedUnion("type", [
3672
- import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
3673
- import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
3756
+ z23.object({
3757
+ type: z23.literal("code_interpreter_call"),
3758
+ id: z23.string(),
3759
+ code: z23.string().nullable(),
3760
+ container_id: z23.string(),
3761
+ outputs: z23.array(
3762
+ z23.discriminatedUnion("type", [
3763
+ z23.object({ type: z23.literal("logs"), logs: z23.string() }),
3764
+ z23.object({ type: z23.literal("image"), url: z23.string() })
3674
3765
  ])
3675
3766
  ).nullable()
3676
3767
  }),
3677
- import_v423.z.object({
3678
- type: import_v423.z.literal("image_generation_call"),
3679
- id: import_v423.z.string(),
3680
- result: import_v423.z.string()
3768
+ z23.object({
3769
+ type: z23.literal("image_generation_call"),
3770
+ id: z23.string(),
3771
+ result: z23.string()
3681
3772
  }),
3682
- import_v423.z.object({
3683
- type: import_v423.z.literal("web_search_call"),
3684
- id: import_v423.z.string(),
3685
- status: import_v423.z.string(),
3686
- action: import_v423.z.discriminatedUnion("type", [
3687
- import_v423.z.object({
3688
- type: import_v423.z.literal("search"),
3689
- query: import_v423.z.string().nullish(),
3690
- sources: import_v423.z.array(
3691
- import_v423.z.discriminatedUnion("type", [
3692
- import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
3693
- import_v423.z.object({ type: import_v423.z.literal("api"), name: import_v423.z.string() })
3773
+ z23.object({
3774
+ type: z23.literal("web_search_call"),
3775
+ id: z23.string(),
3776
+ status: z23.string(),
3777
+ action: z23.discriminatedUnion("type", [
3778
+ z23.object({
3779
+ type: z23.literal("search"),
3780
+ query: z23.string().nullish(),
3781
+ sources: z23.array(
3782
+ z23.discriminatedUnion("type", [
3783
+ z23.object({ type: z23.literal("url"), url: z23.string() }),
3784
+ z23.object({ type: z23.literal("api"), name: z23.string() })
3694
3785
  ])
3695
3786
  ).nullish()
3696
3787
  }),
3697
- import_v423.z.object({
3698
- type: import_v423.z.literal("open_page"),
3699
- url: import_v423.z.string().nullish()
3788
+ z23.object({
3789
+ type: z23.literal("open_page"),
3790
+ url: z23.string().nullish()
3700
3791
  }),
3701
- import_v423.z.object({
3702
- type: import_v423.z.literal("find_in_page"),
3703
- url: import_v423.z.string().nullish(),
3704
- pattern: import_v423.z.string().nullish()
3792
+ z23.object({
3793
+ type: z23.literal("find_in_page"),
3794
+ url: z23.string().nullish(),
3795
+ pattern: z23.string().nullish()
3705
3796
  })
3706
3797
  ]).nullish()
3707
3798
  }),
3708
- import_v423.z.object({
3709
- type: import_v423.z.literal("file_search_call"),
3710
- id: import_v423.z.string(),
3711
- queries: import_v423.z.array(import_v423.z.string()),
3712
- results: import_v423.z.array(
3713
- import_v423.z.object({
3714
- attributes: import_v423.z.record(
3715
- import_v423.z.string(),
3716
- import_v423.z.union([import_v423.z.string(), import_v423.z.number(), import_v423.z.boolean()])
3799
+ z23.object({
3800
+ type: z23.literal("file_search_call"),
3801
+ id: z23.string(),
3802
+ queries: z23.array(z23.string()),
3803
+ results: z23.array(
3804
+ z23.object({
3805
+ attributes: z23.record(
3806
+ z23.string(),
3807
+ z23.union([z23.string(), z23.number(), z23.boolean()])
3717
3808
  ),
3718
- file_id: import_v423.z.string(),
3719
- filename: import_v423.z.string(),
3720
- score: import_v423.z.number(),
3721
- text: import_v423.z.string()
3809
+ file_id: z23.string(),
3810
+ filename: z23.string(),
3811
+ score: z23.number(),
3812
+ text: z23.string()
3722
3813
  })
3723
3814
  ).nullish()
3724
3815
  }),
3725
- import_v423.z.object({
3726
- type: import_v423.z.literal("local_shell_call"),
3727
- id: import_v423.z.string(),
3728
- call_id: import_v423.z.string(),
3729
- action: import_v423.z.object({
3730
- type: import_v423.z.literal("exec"),
3731
- command: import_v423.z.array(import_v423.z.string()),
3732
- timeout_ms: import_v423.z.number().optional(),
3733
- user: import_v423.z.string().optional(),
3734
- working_directory: import_v423.z.string().optional(),
3735
- env: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).optional()
3816
+ z23.object({
3817
+ type: z23.literal("local_shell_call"),
3818
+ id: z23.string(),
3819
+ call_id: z23.string(),
3820
+ action: z23.object({
3821
+ type: z23.literal("exec"),
3822
+ command: z23.array(z23.string()),
3823
+ timeout_ms: z23.number().optional(),
3824
+ user: z23.string().optional(),
3825
+ working_directory: z23.string().optional(),
3826
+ env: z23.record(z23.string(), z23.string()).optional()
3736
3827
  })
3737
3828
  }),
3738
- import_v423.z.object({
3739
- type: import_v423.z.literal("computer_call"),
3740
- id: import_v423.z.string(),
3741
- status: import_v423.z.literal("completed")
3829
+ z23.object({
3830
+ type: z23.literal("computer_call"),
3831
+ id: z23.string(),
3832
+ status: z23.literal("completed")
3742
3833
  }),
3743
- import_v423.z.object({
3744
- type: import_v423.z.literal("mcp_call"),
3745
- id: import_v423.z.string(),
3746
- status: import_v423.z.string(),
3747
- arguments: import_v423.z.string(),
3748
- name: import_v423.z.string(),
3749
- server_label: import_v423.z.string(),
3750
- output: import_v423.z.string().nullish(),
3751
- error: import_v423.z.union([
3752
- import_v423.z.string(),
3753
- import_v423.z.object({
3754
- type: import_v423.z.string().optional(),
3755
- code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
3756
- message: import_v423.z.string().optional()
3834
+ z23.object({
3835
+ type: z23.literal("mcp_call"),
3836
+ id: z23.string(),
3837
+ status: z23.string(),
3838
+ arguments: z23.string(),
3839
+ name: z23.string(),
3840
+ server_label: z23.string(),
3841
+ output: z23.string().nullish(),
3842
+ error: z23.union([
3843
+ z23.string(),
3844
+ z23.object({
3845
+ type: z23.string().optional(),
3846
+ code: z23.union([z23.number(), z23.string()]).optional(),
3847
+ message: z23.string().optional()
3757
3848
  }).loose()
3758
3849
  ]).nullish(),
3759
- approval_request_id: import_v423.z.string().nullish()
3850
+ approval_request_id: z23.string().nullish()
3760
3851
  }),
3761
- import_v423.z.object({
3762
- type: import_v423.z.literal("mcp_list_tools"),
3763
- id: import_v423.z.string(),
3764
- server_label: import_v423.z.string(),
3765
- tools: import_v423.z.array(
3766
- import_v423.z.object({
3767
- name: import_v423.z.string(),
3768
- description: import_v423.z.string().optional(),
3769
- input_schema: import_v423.z.any(),
3770
- annotations: import_v423.z.record(import_v423.z.string(), import_v423.z.unknown()).optional()
3852
+ z23.object({
3853
+ type: z23.literal("mcp_list_tools"),
3854
+ id: z23.string(),
3855
+ server_label: z23.string(),
3856
+ tools: z23.array(
3857
+ z23.object({
3858
+ name: z23.string(),
3859
+ description: z23.string().optional(),
3860
+ input_schema: z23.any(),
3861
+ annotations: z23.record(z23.string(), z23.unknown()).optional()
3771
3862
  })
3772
3863
  ),
3773
- error: import_v423.z.union([
3774
- import_v423.z.string(),
3775
- import_v423.z.object({
3776
- type: import_v423.z.string().optional(),
3777
- code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
3778
- message: import_v423.z.string().optional()
3864
+ error: z23.union([
3865
+ z23.string(),
3866
+ z23.object({
3867
+ type: z23.string().optional(),
3868
+ code: z23.union([z23.number(), z23.string()]).optional(),
3869
+ message: z23.string().optional()
3779
3870
  }).loose()
3780
3871
  ]).optional()
3781
3872
  }),
3782
- import_v423.z.object({
3783
- type: import_v423.z.literal("mcp_approval_request"),
3784
- id: import_v423.z.string(),
3785
- server_label: import_v423.z.string(),
3786
- name: import_v423.z.string(),
3787
- arguments: import_v423.z.string(),
3788
- approval_request_id: import_v423.z.string().optional()
3873
+ z23.object({
3874
+ type: z23.literal("mcp_approval_request"),
3875
+ id: z23.string(),
3876
+ server_label: z23.string(),
3877
+ name: z23.string(),
3878
+ arguments: z23.string(),
3879
+ approval_request_id: z23.string().optional()
3789
3880
  }),
3790
- import_v423.z.object({
3791
- type: import_v423.z.literal("apply_patch_call"),
3792
- id: import_v423.z.string(),
3793
- call_id: import_v423.z.string(),
3794
- status: import_v423.z.enum(["in_progress", "completed"]),
3795
- operation: import_v423.z.discriminatedUnion("type", [
3796
- import_v423.z.object({
3797
- type: import_v423.z.literal("create_file"),
3798
- path: import_v423.z.string(),
3799
- diff: import_v423.z.string()
3881
+ z23.object({
3882
+ type: z23.literal("apply_patch_call"),
3883
+ id: z23.string(),
3884
+ call_id: z23.string(),
3885
+ status: z23.enum(["in_progress", "completed"]),
3886
+ operation: z23.discriminatedUnion("type", [
3887
+ z23.object({
3888
+ type: z23.literal("create_file"),
3889
+ path: z23.string(),
3890
+ diff: z23.string()
3800
3891
  }),
3801
- import_v423.z.object({
3802
- type: import_v423.z.literal("delete_file"),
3803
- path: import_v423.z.string()
3892
+ z23.object({
3893
+ type: z23.literal("delete_file"),
3894
+ path: z23.string()
3804
3895
  }),
3805
- import_v423.z.object({
3806
- type: import_v423.z.literal("update_file"),
3807
- path: import_v423.z.string(),
3808
- diff: import_v423.z.string()
3896
+ z23.object({
3897
+ type: z23.literal("update_file"),
3898
+ path: z23.string(),
3899
+ diff: z23.string()
3809
3900
  })
3810
3901
  ])
3811
3902
  }),
3812
- import_v423.z.object({
3813
- type: import_v423.z.literal("shell_call"),
3814
- id: import_v423.z.string(),
3815
- call_id: import_v423.z.string(),
3816
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3817
- action: import_v423.z.object({
3818
- commands: import_v423.z.array(import_v423.z.string())
3903
+ z23.object({
3904
+ type: z23.literal("shell_call"),
3905
+ id: z23.string(),
3906
+ call_id: z23.string(),
3907
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3908
+ action: z23.object({
3909
+ commands: z23.array(z23.string())
3819
3910
  })
3820
3911
  }),
3821
- import_v423.z.object({
3822
- type: import_v423.z.literal("compaction"),
3823
- id: import_v423.z.string(),
3824
- encrypted_content: import_v423.z.string()
3912
+ z23.object({
3913
+ type: z23.literal("compaction"),
3914
+ id: z23.string(),
3915
+ encrypted_content: z23.string()
3825
3916
  }),
3826
- import_v423.z.object({
3827
- type: import_v423.z.literal("shell_call_output"),
3828
- id: import_v423.z.string(),
3829
- call_id: import_v423.z.string(),
3830
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3831
- output: import_v423.z.array(
3832
- import_v423.z.object({
3833
- stdout: import_v423.z.string(),
3834
- stderr: import_v423.z.string(),
3835
- outcome: import_v423.z.discriminatedUnion("type", [
3836
- import_v423.z.object({ type: import_v423.z.literal("timeout") }),
3837
- import_v423.z.object({
3838
- type: import_v423.z.literal("exit"),
3839
- exit_code: import_v423.z.number()
3917
+ z23.object({
3918
+ type: z23.literal("shell_call_output"),
3919
+ id: z23.string(),
3920
+ call_id: z23.string(),
3921
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3922
+ output: z23.array(
3923
+ z23.object({
3924
+ stdout: z23.string(),
3925
+ stderr: z23.string(),
3926
+ outcome: z23.discriminatedUnion("type", [
3927
+ z23.object({ type: z23.literal("timeout") }),
3928
+ z23.object({
3929
+ type: z23.literal("exit"),
3930
+ exit_code: z23.number()
3840
3931
  })
3841
3932
  ])
3842
3933
  })
3843
3934
  )
3844
3935
  }),
3845
- import_v423.z.object({
3846
- type: import_v423.z.literal("tool_search_call"),
3847
- id: import_v423.z.string(),
3848
- execution: import_v423.z.enum(["server", "client"]),
3849
- call_id: import_v423.z.string().nullable(),
3850
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3851
- arguments: import_v423.z.unknown()
3936
+ z23.object({
3937
+ type: z23.literal("tool_search_call"),
3938
+ id: z23.string(),
3939
+ execution: z23.enum(["server", "client"]),
3940
+ call_id: z23.string().nullable(),
3941
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3942
+ arguments: z23.unknown()
3852
3943
  }),
3853
- import_v423.z.object({
3854
- type: import_v423.z.literal("tool_search_output"),
3855
- id: import_v423.z.string(),
3856
- execution: import_v423.z.enum(["server", "client"]),
3857
- call_id: import_v423.z.string().nullable(),
3858
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
3859
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
3944
+ z23.object({
3945
+ type: z23.literal("tool_search_output"),
3946
+ id: z23.string(),
3947
+ execution: z23.enum(["server", "client"]),
3948
+ call_id: z23.string().nullable(),
3949
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
3950
+ tools: z23.array(z23.record(z23.string(), jsonValueSchema2.optional()))
3860
3951
  })
3861
3952
  ])
3862
3953
  }),
3863
- import_v423.z.object({
3864
- type: import_v423.z.literal("response.function_call_arguments.delta"),
3865
- item_id: import_v423.z.string(),
3866
- output_index: import_v423.z.number(),
3867
- delta: import_v423.z.string()
3954
+ z23.object({
3955
+ type: z23.literal("response.function_call_arguments.delta"),
3956
+ item_id: z23.string(),
3957
+ output_index: z23.number(),
3958
+ delta: z23.string()
3868
3959
  }),
3869
- import_v423.z.object({
3870
- type: import_v423.z.literal("response.custom_tool_call_input.delta"),
3871
- item_id: import_v423.z.string(),
3872
- output_index: import_v423.z.number(),
3873
- delta: import_v423.z.string()
3960
+ z23.object({
3961
+ type: z23.literal("response.custom_tool_call_input.delta"),
3962
+ item_id: z23.string(),
3963
+ output_index: z23.number(),
3964
+ delta: z23.string()
3874
3965
  }),
3875
- import_v423.z.object({
3876
- type: import_v423.z.literal("response.image_generation_call.partial_image"),
3877
- item_id: import_v423.z.string(),
3878
- output_index: import_v423.z.number(),
3879
- partial_image_b64: import_v423.z.string()
3966
+ z23.object({
3967
+ type: z23.literal("response.image_generation_call.partial_image"),
3968
+ item_id: z23.string(),
3969
+ output_index: z23.number(),
3970
+ partial_image_b64: z23.string()
3880
3971
  }),
3881
- import_v423.z.object({
3882
- type: import_v423.z.literal("response.code_interpreter_call_code.delta"),
3883
- item_id: import_v423.z.string(),
3884
- output_index: import_v423.z.number(),
3885
- delta: import_v423.z.string()
3972
+ z23.object({
3973
+ type: z23.literal("response.code_interpreter_call_code.delta"),
3974
+ item_id: z23.string(),
3975
+ output_index: z23.number(),
3976
+ delta: z23.string()
3886
3977
  }),
3887
- import_v423.z.object({
3888
- type: import_v423.z.literal("response.code_interpreter_call_code.done"),
3889
- item_id: import_v423.z.string(),
3890
- output_index: import_v423.z.number(),
3891
- code: import_v423.z.string()
3978
+ z23.object({
3979
+ type: z23.literal("response.code_interpreter_call_code.done"),
3980
+ item_id: z23.string(),
3981
+ output_index: z23.number(),
3982
+ code: z23.string()
3892
3983
  }),
3893
- import_v423.z.object({
3894
- type: import_v423.z.literal("response.output_text.annotation.added"),
3895
- annotation: import_v423.z.discriminatedUnion("type", [
3896
- import_v423.z.object({
3897
- type: import_v423.z.literal("url_citation"),
3898
- start_index: import_v423.z.number(),
3899
- end_index: import_v423.z.number(),
3900
- url: import_v423.z.string(),
3901
- title: import_v423.z.string()
3984
+ z23.object({
3985
+ type: z23.literal("response.output_text.annotation.added"),
3986
+ annotation: z23.discriminatedUnion("type", [
3987
+ z23.object({
3988
+ type: z23.literal("url_citation"),
3989
+ start_index: z23.number(),
3990
+ end_index: z23.number(),
3991
+ url: z23.string(),
3992
+ title: z23.string()
3902
3993
  }),
3903
- import_v423.z.object({
3904
- type: import_v423.z.literal("file_citation"),
3905
- file_id: import_v423.z.string(),
3906
- filename: import_v423.z.string(),
3907
- index: import_v423.z.number()
3994
+ z23.object({
3995
+ type: z23.literal("file_citation"),
3996
+ file_id: z23.string(),
3997
+ filename: z23.string(),
3998
+ index: z23.number()
3908
3999
  }),
3909
- import_v423.z.object({
3910
- type: import_v423.z.literal("container_file_citation"),
3911
- container_id: import_v423.z.string(),
3912
- file_id: import_v423.z.string(),
3913
- filename: import_v423.z.string(),
3914
- start_index: import_v423.z.number(),
3915
- end_index: import_v423.z.number()
4000
+ z23.object({
4001
+ type: z23.literal("container_file_citation"),
4002
+ container_id: z23.string(),
4003
+ file_id: z23.string(),
4004
+ filename: z23.string(),
4005
+ start_index: z23.number(),
4006
+ end_index: z23.number()
3916
4007
  }),
3917
- import_v423.z.object({
3918
- type: import_v423.z.literal("file_path"),
3919
- file_id: import_v423.z.string(),
3920
- index: import_v423.z.number()
4008
+ z23.object({
4009
+ type: z23.literal("file_path"),
4010
+ file_id: z23.string(),
4011
+ index: z23.number()
3921
4012
  })
3922
4013
  ])
3923
4014
  }),
3924
- import_v423.z.object({
3925
- type: import_v423.z.literal("response.reasoning_summary_part.added"),
3926
- item_id: import_v423.z.string(),
3927
- summary_index: import_v423.z.number()
4015
+ z23.object({
4016
+ type: z23.literal("response.reasoning_summary_part.added"),
4017
+ item_id: z23.string(),
4018
+ summary_index: z23.number()
3928
4019
  }),
3929
- import_v423.z.object({
3930
- type: import_v423.z.literal("response.reasoning_summary_text.delta"),
3931
- item_id: import_v423.z.string(),
3932
- summary_index: import_v423.z.number(),
3933
- delta: import_v423.z.string()
4020
+ z23.object({
4021
+ type: z23.literal("response.reasoning_summary_text.delta"),
4022
+ item_id: z23.string(),
4023
+ summary_index: z23.number(),
4024
+ delta: z23.string()
3934
4025
  }),
3935
- import_v423.z.object({
3936
- type: import_v423.z.literal("response.reasoning_summary_part.done"),
3937
- item_id: import_v423.z.string(),
3938
- summary_index: import_v423.z.number()
4026
+ z23.object({
4027
+ type: z23.literal("response.reasoning_summary_part.done"),
4028
+ item_id: z23.string(),
4029
+ summary_index: z23.number()
3939
4030
  }),
3940
- import_v423.z.object({
3941
- type: import_v423.z.literal("response.apply_patch_call_operation_diff.delta"),
3942
- item_id: import_v423.z.string(),
3943
- output_index: import_v423.z.number(),
3944
- delta: import_v423.z.string(),
3945
- obfuscation: import_v423.z.string().nullish()
4031
+ z23.object({
4032
+ type: z23.literal("response.apply_patch_call_operation_diff.delta"),
4033
+ item_id: z23.string(),
4034
+ output_index: z23.number(),
4035
+ delta: z23.string(),
4036
+ obfuscation: z23.string().nullish()
3946
4037
  }),
3947
- import_v423.z.object({
3948
- type: import_v423.z.literal("response.apply_patch_call_operation_diff.done"),
3949
- item_id: import_v423.z.string(),
3950
- output_index: import_v423.z.number(),
3951
- diff: import_v423.z.string()
4038
+ z23.object({
4039
+ type: z23.literal("response.apply_patch_call_operation_diff.done"),
4040
+ item_id: z23.string(),
4041
+ output_index: z23.number(),
4042
+ diff: z23.string()
3952
4043
  }),
3953
- import_v423.z.object({
3954
- type: import_v423.z.literal("error"),
3955
- sequence_number: import_v423.z.number(),
3956
- error: import_v423.z.object({
3957
- type: import_v423.z.string(),
3958
- code: import_v423.z.string(),
3959
- message: import_v423.z.string(),
3960
- param: import_v423.z.string().nullish()
4044
+ z23.object({
4045
+ type: z23.literal("error"),
4046
+ sequence_number: z23.number(),
4047
+ error: z23.object({
4048
+ type: z23.string(),
4049
+ code: z23.string(),
4050
+ message: z23.string(),
4051
+ param: z23.string().nullish()
3961
4052
  })
3962
4053
  }),
3963
- import_v423.z.object({ type: import_v423.z.string() }).loose().transform((value) => ({
4054
+ z23.object({ type: z23.string() }).loose().transform((value) => ({
3964
4055
  type: "unknown_chunk",
3965
4056
  message: value.type
3966
4057
  }))
@@ -3968,315 +4059,315 @@ var openaiResponsesChunkSchema = (0, import_provider_utils29.lazySchema)(
3968
4059
  ])
3969
4060
  )
3970
4061
  );
3971
- var openaiResponsesResponseSchema = (0, import_provider_utils29.lazySchema)(
3972
- () => (0, import_provider_utils29.zodSchema)(
3973
- import_v423.z.object({
3974
- id: import_v423.z.string().optional(),
3975
- created_at: import_v423.z.number().optional(),
3976
- error: import_v423.z.object({
3977
- message: import_v423.z.string(),
3978
- type: import_v423.z.string(),
3979
- param: import_v423.z.string().nullish(),
3980
- code: import_v423.z.string()
4062
+ var openaiResponsesResponseSchema = lazySchema21(
4063
+ () => zodSchema21(
4064
+ z23.object({
4065
+ id: z23.string().optional(),
4066
+ created_at: z23.number().optional(),
4067
+ error: z23.object({
4068
+ message: z23.string(),
4069
+ type: z23.string(),
4070
+ param: z23.string().nullish(),
4071
+ code: z23.string()
3981
4072
  }).nullish(),
3982
- model: import_v423.z.string().optional(),
3983
- output: import_v423.z.array(
3984
- import_v423.z.discriminatedUnion("type", [
3985
- import_v423.z.object({
3986
- type: import_v423.z.literal("message"),
3987
- role: import_v423.z.literal("assistant"),
3988
- id: import_v423.z.string(),
3989
- phase: import_v423.z.enum(["commentary", "final_answer"]).nullish(),
3990
- content: import_v423.z.array(
3991
- import_v423.z.object({
3992
- type: import_v423.z.literal("output_text"),
3993
- text: import_v423.z.string(),
3994
- logprobs: import_v423.z.array(
3995
- import_v423.z.object({
3996
- token: import_v423.z.string(),
3997
- logprob: import_v423.z.number(),
3998
- top_logprobs: import_v423.z.array(
3999
- import_v423.z.object({
4000
- token: import_v423.z.string(),
4001
- logprob: import_v423.z.number()
4073
+ model: z23.string().optional(),
4074
+ output: z23.array(
4075
+ z23.discriminatedUnion("type", [
4076
+ z23.object({
4077
+ type: z23.literal("message"),
4078
+ role: z23.literal("assistant"),
4079
+ id: z23.string(),
4080
+ phase: z23.enum(["commentary", "final_answer"]).nullish(),
4081
+ content: z23.array(
4082
+ z23.object({
4083
+ type: z23.literal("output_text"),
4084
+ text: z23.string(),
4085
+ logprobs: z23.array(
4086
+ z23.object({
4087
+ token: z23.string(),
4088
+ logprob: z23.number(),
4089
+ top_logprobs: z23.array(
4090
+ z23.object({
4091
+ token: z23.string(),
4092
+ logprob: z23.number()
4002
4093
  })
4003
4094
  )
4004
4095
  })
4005
4096
  ).nullish(),
4006
- annotations: import_v423.z.array(
4007
- import_v423.z.discriminatedUnion("type", [
4008
- import_v423.z.object({
4009
- type: import_v423.z.literal("url_citation"),
4010
- start_index: import_v423.z.number(),
4011
- end_index: import_v423.z.number(),
4012
- url: import_v423.z.string(),
4013
- title: import_v423.z.string()
4097
+ annotations: z23.array(
4098
+ z23.discriminatedUnion("type", [
4099
+ z23.object({
4100
+ type: z23.literal("url_citation"),
4101
+ start_index: z23.number(),
4102
+ end_index: z23.number(),
4103
+ url: z23.string(),
4104
+ title: z23.string()
4014
4105
  }),
4015
- import_v423.z.object({
4016
- type: import_v423.z.literal("file_citation"),
4017
- file_id: import_v423.z.string(),
4018
- filename: import_v423.z.string(),
4019
- index: import_v423.z.number()
4106
+ z23.object({
4107
+ type: z23.literal("file_citation"),
4108
+ file_id: z23.string(),
4109
+ filename: z23.string(),
4110
+ index: z23.number()
4020
4111
  }),
4021
- import_v423.z.object({
4022
- type: import_v423.z.literal("container_file_citation"),
4023
- container_id: import_v423.z.string(),
4024
- file_id: import_v423.z.string(),
4025
- filename: import_v423.z.string(),
4026
- start_index: import_v423.z.number(),
4027
- end_index: import_v423.z.number()
4112
+ z23.object({
4113
+ type: z23.literal("container_file_citation"),
4114
+ container_id: z23.string(),
4115
+ file_id: z23.string(),
4116
+ filename: z23.string(),
4117
+ start_index: z23.number(),
4118
+ end_index: z23.number()
4028
4119
  }),
4029
- import_v423.z.object({
4030
- type: import_v423.z.literal("file_path"),
4031
- file_id: import_v423.z.string(),
4032
- index: import_v423.z.number()
4120
+ z23.object({
4121
+ type: z23.literal("file_path"),
4122
+ file_id: z23.string(),
4123
+ index: z23.number()
4033
4124
  })
4034
4125
  ])
4035
4126
  )
4036
4127
  })
4037
4128
  )
4038
4129
  }),
4039
- import_v423.z.object({
4040
- type: import_v423.z.literal("web_search_call"),
4041
- id: import_v423.z.string(),
4042
- status: import_v423.z.string(),
4043
- action: import_v423.z.discriminatedUnion("type", [
4044
- import_v423.z.object({
4045
- type: import_v423.z.literal("search"),
4046
- query: import_v423.z.string().nullish(),
4047
- sources: import_v423.z.array(
4048
- import_v423.z.discriminatedUnion("type", [
4049
- import_v423.z.object({ type: import_v423.z.literal("url"), url: import_v423.z.string() }),
4050
- import_v423.z.object({
4051
- type: import_v423.z.literal("api"),
4052
- name: import_v423.z.string()
4130
+ z23.object({
4131
+ type: z23.literal("web_search_call"),
4132
+ id: z23.string(),
4133
+ status: z23.string(),
4134
+ action: z23.discriminatedUnion("type", [
4135
+ z23.object({
4136
+ type: z23.literal("search"),
4137
+ query: z23.string().nullish(),
4138
+ sources: z23.array(
4139
+ z23.discriminatedUnion("type", [
4140
+ z23.object({ type: z23.literal("url"), url: z23.string() }),
4141
+ z23.object({
4142
+ type: z23.literal("api"),
4143
+ name: z23.string()
4053
4144
  })
4054
4145
  ])
4055
4146
  ).nullish()
4056
4147
  }),
4057
- import_v423.z.object({
4058
- type: import_v423.z.literal("open_page"),
4059
- url: import_v423.z.string().nullish()
4148
+ z23.object({
4149
+ type: z23.literal("open_page"),
4150
+ url: z23.string().nullish()
4060
4151
  }),
4061
- import_v423.z.object({
4062
- type: import_v423.z.literal("find_in_page"),
4063
- url: import_v423.z.string().nullish(),
4064
- pattern: import_v423.z.string().nullish()
4152
+ z23.object({
4153
+ type: z23.literal("find_in_page"),
4154
+ url: z23.string().nullish(),
4155
+ pattern: z23.string().nullish()
4065
4156
  })
4066
4157
  ]).nullish()
4067
4158
  }),
4068
- import_v423.z.object({
4069
- type: import_v423.z.literal("file_search_call"),
4070
- id: import_v423.z.string(),
4071
- queries: import_v423.z.array(import_v423.z.string()),
4072
- results: import_v423.z.array(
4073
- import_v423.z.object({
4074
- attributes: import_v423.z.record(
4075
- import_v423.z.string(),
4076
- import_v423.z.union([import_v423.z.string(), import_v423.z.number(), import_v423.z.boolean()])
4159
+ z23.object({
4160
+ type: z23.literal("file_search_call"),
4161
+ id: z23.string(),
4162
+ queries: z23.array(z23.string()),
4163
+ results: z23.array(
4164
+ z23.object({
4165
+ attributes: z23.record(
4166
+ z23.string(),
4167
+ z23.union([z23.string(), z23.number(), z23.boolean()])
4077
4168
  ),
4078
- file_id: import_v423.z.string(),
4079
- filename: import_v423.z.string(),
4080
- score: import_v423.z.number(),
4081
- text: import_v423.z.string()
4169
+ file_id: z23.string(),
4170
+ filename: z23.string(),
4171
+ score: z23.number(),
4172
+ text: z23.string()
4082
4173
  })
4083
4174
  ).nullish()
4084
4175
  }),
4085
- import_v423.z.object({
4086
- type: import_v423.z.literal("code_interpreter_call"),
4087
- id: import_v423.z.string(),
4088
- code: import_v423.z.string().nullable(),
4089
- container_id: import_v423.z.string(),
4090
- outputs: import_v423.z.array(
4091
- import_v423.z.discriminatedUnion("type", [
4092
- import_v423.z.object({ type: import_v423.z.literal("logs"), logs: import_v423.z.string() }),
4093
- import_v423.z.object({ type: import_v423.z.literal("image"), url: import_v423.z.string() })
4176
+ z23.object({
4177
+ type: z23.literal("code_interpreter_call"),
4178
+ id: z23.string(),
4179
+ code: z23.string().nullable(),
4180
+ container_id: z23.string(),
4181
+ outputs: z23.array(
4182
+ z23.discriminatedUnion("type", [
4183
+ z23.object({ type: z23.literal("logs"), logs: z23.string() }),
4184
+ z23.object({ type: z23.literal("image"), url: z23.string() })
4094
4185
  ])
4095
4186
  ).nullable()
4096
4187
  }),
4097
- import_v423.z.object({
4098
- type: import_v423.z.literal("image_generation_call"),
4099
- id: import_v423.z.string(),
4100
- result: import_v423.z.string()
4188
+ z23.object({
4189
+ type: z23.literal("image_generation_call"),
4190
+ id: z23.string(),
4191
+ result: z23.string()
4101
4192
  }),
4102
- import_v423.z.object({
4103
- type: import_v423.z.literal("local_shell_call"),
4104
- id: import_v423.z.string(),
4105
- call_id: import_v423.z.string(),
4106
- action: import_v423.z.object({
4107
- type: import_v423.z.literal("exec"),
4108
- command: import_v423.z.array(import_v423.z.string()),
4109
- timeout_ms: import_v423.z.number().optional(),
4110
- user: import_v423.z.string().optional(),
4111
- working_directory: import_v423.z.string().optional(),
4112
- env: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).optional()
4193
+ z23.object({
4194
+ type: z23.literal("local_shell_call"),
4195
+ id: z23.string(),
4196
+ call_id: z23.string(),
4197
+ action: z23.object({
4198
+ type: z23.literal("exec"),
4199
+ command: z23.array(z23.string()),
4200
+ timeout_ms: z23.number().optional(),
4201
+ user: z23.string().optional(),
4202
+ working_directory: z23.string().optional(),
4203
+ env: z23.record(z23.string(), z23.string()).optional()
4113
4204
  })
4114
4205
  }),
4115
- import_v423.z.object({
4116
- type: import_v423.z.literal("function_call"),
4117
- call_id: import_v423.z.string(),
4118
- name: import_v423.z.string(),
4119
- arguments: import_v423.z.string(),
4120
- id: import_v423.z.string()
4206
+ z23.object({
4207
+ type: z23.literal("function_call"),
4208
+ call_id: z23.string(),
4209
+ name: z23.string(),
4210
+ arguments: z23.string(),
4211
+ id: z23.string()
4121
4212
  }),
4122
- import_v423.z.object({
4123
- type: import_v423.z.literal("custom_tool_call"),
4124
- call_id: import_v423.z.string(),
4125
- name: import_v423.z.string(),
4126
- input: import_v423.z.string(),
4127
- id: import_v423.z.string()
4213
+ z23.object({
4214
+ type: z23.literal("custom_tool_call"),
4215
+ call_id: z23.string(),
4216
+ name: z23.string(),
4217
+ input: z23.string(),
4218
+ id: z23.string()
4128
4219
  }),
4129
- import_v423.z.object({
4130
- type: import_v423.z.literal("computer_call"),
4131
- id: import_v423.z.string(),
4132
- status: import_v423.z.string().optional()
4220
+ z23.object({
4221
+ type: z23.literal("computer_call"),
4222
+ id: z23.string(),
4223
+ status: z23.string().optional()
4133
4224
  }),
4134
- import_v423.z.object({
4135
- type: import_v423.z.literal("reasoning"),
4136
- id: import_v423.z.string(),
4137
- encrypted_content: import_v423.z.string().nullish(),
4138
- summary: import_v423.z.array(
4139
- import_v423.z.object({
4140
- type: import_v423.z.literal("summary_text"),
4141
- text: import_v423.z.string()
4225
+ z23.object({
4226
+ type: z23.literal("reasoning"),
4227
+ id: z23.string(),
4228
+ encrypted_content: z23.string().nullish(),
4229
+ summary: z23.array(
4230
+ z23.object({
4231
+ type: z23.literal("summary_text"),
4232
+ text: z23.string()
4142
4233
  })
4143
4234
  )
4144
4235
  }),
4145
- import_v423.z.object({
4146
- type: import_v423.z.literal("mcp_call"),
4147
- id: import_v423.z.string(),
4148
- status: import_v423.z.string(),
4149
- arguments: import_v423.z.string(),
4150
- name: import_v423.z.string(),
4151
- server_label: import_v423.z.string(),
4152
- output: import_v423.z.string().nullish(),
4153
- error: import_v423.z.union([
4154
- import_v423.z.string(),
4155
- import_v423.z.object({
4156
- type: import_v423.z.string().optional(),
4157
- code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
4158
- message: import_v423.z.string().optional()
4236
+ z23.object({
4237
+ type: z23.literal("mcp_call"),
4238
+ id: z23.string(),
4239
+ status: z23.string(),
4240
+ arguments: z23.string(),
4241
+ name: z23.string(),
4242
+ server_label: z23.string(),
4243
+ output: z23.string().nullish(),
4244
+ error: z23.union([
4245
+ z23.string(),
4246
+ z23.object({
4247
+ type: z23.string().optional(),
4248
+ code: z23.union([z23.number(), z23.string()]).optional(),
4249
+ message: z23.string().optional()
4159
4250
  }).loose()
4160
4251
  ]).nullish(),
4161
- approval_request_id: import_v423.z.string().nullish()
4252
+ approval_request_id: z23.string().nullish()
4162
4253
  }),
4163
- import_v423.z.object({
4164
- type: import_v423.z.literal("mcp_list_tools"),
4165
- id: import_v423.z.string(),
4166
- server_label: import_v423.z.string(),
4167
- tools: import_v423.z.array(
4168
- import_v423.z.object({
4169
- name: import_v423.z.string(),
4170
- description: import_v423.z.string().optional(),
4171
- input_schema: import_v423.z.any(),
4172
- annotations: import_v423.z.record(import_v423.z.string(), import_v423.z.unknown()).optional()
4254
+ z23.object({
4255
+ type: z23.literal("mcp_list_tools"),
4256
+ id: z23.string(),
4257
+ server_label: z23.string(),
4258
+ tools: z23.array(
4259
+ z23.object({
4260
+ name: z23.string(),
4261
+ description: z23.string().optional(),
4262
+ input_schema: z23.any(),
4263
+ annotations: z23.record(z23.string(), z23.unknown()).optional()
4173
4264
  })
4174
4265
  ),
4175
- error: import_v423.z.union([
4176
- import_v423.z.string(),
4177
- import_v423.z.object({
4178
- type: import_v423.z.string().optional(),
4179
- code: import_v423.z.union([import_v423.z.number(), import_v423.z.string()]).optional(),
4180
- message: import_v423.z.string().optional()
4266
+ error: z23.union([
4267
+ z23.string(),
4268
+ z23.object({
4269
+ type: z23.string().optional(),
4270
+ code: z23.union([z23.number(), z23.string()]).optional(),
4271
+ message: z23.string().optional()
4181
4272
  }).loose()
4182
4273
  ]).optional()
4183
4274
  }),
4184
- import_v423.z.object({
4185
- type: import_v423.z.literal("mcp_approval_request"),
4186
- id: import_v423.z.string(),
4187
- server_label: import_v423.z.string(),
4188
- name: import_v423.z.string(),
4189
- arguments: import_v423.z.string(),
4190
- approval_request_id: import_v423.z.string().optional()
4275
+ z23.object({
4276
+ type: z23.literal("mcp_approval_request"),
4277
+ id: z23.string(),
4278
+ server_label: z23.string(),
4279
+ name: z23.string(),
4280
+ arguments: z23.string(),
4281
+ approval_request_id: z23.string().optional()
4191
4282
  }),
4192
- import_v423.z.object({
4193
- type: import_v423.z.literal("apply_patch_call"),
4194
- id: import_v423.z.string(),
4195
- call_id: import_v423.z.string(),
4196
- status: import_v423.z.enum(["in_progress", "completed"]),
4197
- operation: import_v423.z.discriminatedUnion("type", [
4198
- import_v423.z.object({
4199
- type: import_v423.z.literal("create_file"),
4200
- path: import_v423.z.string(),
4201
- diff: import_v423.z.string()
4283
+ z23.object({
4284
+ type: z23.literal("apply_patch_call"),
4285
+ id: z23.string(),
4286
+ call_id: z23.string(),
4287
+ status: z23.enum(["in_progress", "completed"]),
4288
+ operation: z23.discriminatedUnion("type", [
4289
+ z23.object({
4290
+ type: z23.literal("create_file"),
4291
+ path: z23.string(),
4292
+ diff: z23.string()
4202
4293
  }),
4203
- import_v423.z.object({
4204
- type: import_v423.z.literal("delete_file"),
4205
- path: import_v423.z.string()
4294
+ z23.object({
4295
+ type: z23.literal("delete_file"),
4296
+ path: z23.string()
4206
4297
  }),
4207
- import_v423.z.object({
4208
- type: import_v423.z.literal("update_file"),
4209
- path: import_v423.z.string(),
4210
- diff: import_v423.z.string()
4298
+ z23.object({
4299
+ type: z23.literal("update_file"),
4300
+ path: z23.string(),
4301
+ diff: z23.string()
4211
4302
  })
4212
4303
  ])
4213
4304
  }),
4214
- import_v423.z.object({
4215
- type: import_v423.z.literal("shell_call"),
4216
- id: import_v423.z.string(),
4217
- call_id: import_v423.z.string(),
4218
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
4219
- action: import_v423.z.object({
4220
- commands: import_v423.z.array(import_v423.z.string())
4305
+ z23.object({
4306
+ type: z23.literal("shell_call"),
4307
+ id: z23.string(),
4308
+ call_id: z23.string(),
4309
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
4310
+ action: z23.object({
4311
+ commands: z23.array(z23.string())
4221
4312
  })
4222
4313
  }),
4223
- import_v423.z.object({
4224
- type: import_v423.z.literal("compaction"),
4225
- id: import_v423.z.string(),
4226
- encrypted_content: import_v423.z.string()
4314
+ z23.object({
4315
+ type: z23.literal("compaction"),
4316
+ id: z23.string(),
4317
+ encrypted_content: z23.string()
4227
4318
  }),
4228
- import_v423.z.object({
4229
- type: import_v423.z.literal("shell_call_output"),
4230
- id: import_v423.z.string(),
4231
- call_id: import_v423.z.string(),
4232
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
4233
- output: import_v423.z.array(
4234
- import_v423.z.object({
4235
- stdout: import_v423.z.string(),
4236
- stderr: import_v423.z.string(),
4237
- outcome: import_v423.z.discriminatedUnion("type", [
4238
- import_v423.z.object({ type: import_v423.z.literal("timeout") }),
4239
- import_v423.z.object({
4240
- type: import_v423.z.literal("exit"),
4241
- exit_code: import_v423.z.number()
4319
+ z23.object({
4320
+ type: z23.literal("shell_call_output"),
4321
+ id: z23.string(),
4322
+ call_id: z23.string(),
4323
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
4324
+ output: z23.array(
4325
+ z23.object({
4326
+ stdout: z23.string(),
4327
+ stderr: z23.string(),
4328
+ outcome: z23.discriminatedUnion("type", [
4329
+ z23.object({ type: z23.literal("timeout") }),
4330
+ z23.object({
4331
+ type: z23.literal("exit"),
4332
+ exit_code: z23.number()
4242
4333
  })
4243
4334
  ])
4244
4335
  })
4245
4336
  )
4246
4337
  }),
4247
- import_v423.z.object({
4248
- type: import_v423.z.literal("tool_search_call"),
4249
- id: import_v423.z.string(),
4250
- execution: import_v423.z.enum(["server", "client"]),
4251
- call_id: import_v423.z.string().nullable(),
4252
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
4253
- arguments: import_v423.z.unknown()
4338
+ z23.object({
4339
+ type: z23.literal("tool_search_call"),
4340
+ id: z23.string(),
4341
+ execution: z23.enum(["server", "client"]),
4342
+ call_id: z23.string().nullable(),
4343
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
4344
+ arguments: z23.unknown()
4254
4345
  }),
4255
- import_v423.z.object({
4256
- type: import_v423.z.literal("tool_search_output"),
4257
- id: import_v423.z.string(),
4258
- execution: import_v423.z.enum(["server", "client"]),
4259
- call_id: import_v423.z.string().nullable(),
4260
- status: import_v423.z.enum(["in_progress", "completed", "incomplete"]),
4261
- tools: import_v423.z.array(import_v423.z.record(import_v423.z.string(), jsonValueSchema2.optional()))
4346
+ z23.object({
4347
+ type: z23.literal("tool_search_output"),
4348
+ id: z23.string(),
4349
+ execution: z23.enum(["server", "client"]),
4350
+ call_id: z23.string().nullable(),
4351
+ status: z23.enum(["in_progress", "completed", "incomplete"]),
4352
+ tools: z23.array(z23.record(z23.string(), jsonValueSchema2.optional()))
4262
4353
  })
4263
4354
  ])
4264
4355
  ).optional(),
4265
- service_tier: import_v423.z.string().nullish(),
4266
- incomplete_details: import_v423.z.object({ reason: import_v423.z.string() }).nullish(),
4267
- usage: import_v423.z.object({
4268
- input_tokens: import_v423.z.number(),
4269
- input_tokens_details: import_v423.z.object({ cached_tokens: import_v423.z.number().nullish() }).nullish(),
4270
- output_tokens: import_v423.z.number(),
4271
- output_tokens_details: import_v423.z.object({ reasoning_tokens: import_v423.z.number().nullish() }).nullish()
4356
+ service_tier: z23.string().nullish(),
4357
+ incomplete_details: z23.object({ reason: z23.string() }).nullish(),
4358
+ usage: z23.object({
4359
+ input_tokens: z23.number(),
4360
+ input_tokens_details: z23.object({ cached_tokens: z23.number().nullish() }).nullish(),
4361
+ output_tokens: z23.number(),
4362
+ output_tokens_details: z23.object({ reasoning_tokens: z23.number().nullish() }).nullish()
4272
4363
  }).optional()
4273
4364
  })
4274
4365
  )
4275
4366
  );
4276
4367
 
4277
4368
  // src/responses/openai-responses-options.ts
4278
- var import_provider_utils30 = require("@ai-sdk/provider-utils");
4279
- var import_v424 = require("zod/v4");
4369
+ import { lazySchema as lazySchema22, zodSchema as zodSchema22 } from "@ai-sdk/provider-utils";
4370
+ import { z as z24 } from "zod/v4";
4280
4371
  var TOP_LOGPROBS_MAX = 20;
4281
4372
  var openaiResponsesReasoningModelIds = [
4282
4373
  "o1",
@@ -4341,9 +4432,9 @@ var openaiResponsesModelIds = [
4341
4432
  "gpt-5-chat-latest",
4342
4433
  ...openaiResponsesReasoningModelIds
4343
4434
  ];
4344
- var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazySchema)(
4345
- () => (0, import_provider_utils30.zodSchema)(
4346
- import_v424.z.object({
4435
+ var openaiLanguageModelResponsesOptionsSchema = lazySchema22(
4436
+ () => zodSchema22(
4437
+ z24.object({
4347
4438
  /**
4348
4439
  * The ID of the OpenAI Conversation to continue.
4349
4440
  * You must create a conversation first via the OpenAI API.
@@ -4351,13 +4442,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4351
4442
  * Defaults to `undefined`.
4352
4443
  * @see https://platform.openai.com/docs/api-reference/conversations/create
4353
4444
  */
4354
- conversation: import_v424.z.string().nullish(),
4445
+ conversation: z24.string().nullish(),
4355
4446
  /**
4356
4447
  * The set of extra fields to include in the response (advanced, usually not needed).
4357
4448
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'message.output_text.logprobs'.
4358
4449
  */
4359
- include: import_v424.z.array(
4360
- import_v424.z.enum([
4450
+ include: z24.array(
4451
+ z24.enum([
4361
4452
  "reasoning.encrypted_content",
4362
4453
  // handled internally by default, only needed for unknown reasoning models
4363
4454
  "file_search_call.results",
@@ -4369,7 +4460,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4369
4460
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
4370
4461
  * Defaults to `undefined`.
4371
4462
  */
4372
- instructions: import_v424.z.string().nullish(),
4463
+ instructions: z24.string().nullish(),
4373
4464
  /**
4374
4465
  * Return the log probabilities of the tokens. Including logprobs will increase
4375
4466
  * the response size and can slow down response times. However, it can
@@ -4384,30 +4475,30 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4384
4475
  * @see https://platform.openai.com/docs/api-reference/responses/create
4385
4476
  * @see https://cookbook.openai.com/examples/using_logprobs
4386
4477
  */
4387
- logprobs: import_v424.z.union([import_v424.z.boolean(), import_v424.z.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4478
+ logprobs: z24.union([z24.boolean(), z24.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
4388
4479
  /**
4389
4480
  * The maximum number of total calls to built-in tools that can be processed in a response.
4390
4481
  * This maximum number applies across all built-in tool calls, not per individual tool.
4391
4482
  * Any further attempts to call a tool by the model will be ignored.
4392
4483
  */
4393
- maxToolCalls: import_v424.z.number().nullish(),
4484
+ maxToolCalls: z24.number().nullish(),
4394
4485
  /**
4395
4486
  * Additional metadata to store with the generation.
4396
4487
  */
4397
- metadata: import_v424.z.any().nullish(),
4488
+ metadata: z24.any().nullish(),
4398
4489
  /**
4399
4490
  * Whether to use parallel tool calls. Defaults to `true`.
4400
4491
  */
4401
- parallelToolCalls: import_v424.z.boolean().nullish(),
4492
+ parallelToolCalls: z24.boolean().nullish(),
4402
4493
  /**
4403
4494
  * The ID of the previous response. You can use it to continue a conversation.
4404
4495
  * Defaults to `undefined`.
4405
4496
  */
4406
- previousResponseId: import_v424.z.string().nullish(),
4497
+ previousResponseId: z24.string().nullish(),
4407
4498
  /**
4408
4499
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
4409
4500
  */
4410
- promptCacheKey: import_v424.z.string().nullish(),
4501
+ promptCacheKey: z24.string().nullish(),
4411
4502
  /**
4412
4503
  * The retention policy for the prompt cache.
4413
4504
  * - 'in_memory': Default. Standard prompt caching behavior.
@@ -4416,7 +4507,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4416
4507
  *
4417
4508
  * @default 'in_memory'
4418
4509
  */
4419
- promptCacheRetention: import_v424.z.enum(["in_memory", "24h"]).nullish(),
4510
+ promptCacheRetention: z24.enum(["in_memory", "24h"]).nullish(),
4420
4511
  /**
4421
4512
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
4422
4513
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
@@ -4427,17 +4518,17 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4427
4518
  * OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
4428
4519
  * an error.
4429
4520
  */
4430
- reasoningEffort: import_v424.z.string().nullish(),
4521
+ reasoningEffort: z24.string().nullish(),
4431
4522
  /**
4432
4523
  * Controls reasoning summary output from the model.
4433
4524
  * Set to "auto" to automatically receive the richest level available,
4434
4525
  * or "detailed" for comprehensive summaries.
4435
4526
  */
4436
- reasoningSummary: import_v424.z.string().nullish(),
4527
+ reasoningSummary: z24.string().nullish(),
4437
4528
  /**
4438
4529
  * The identifier for safety monitoring and tracking.
4439
4530
  */
4440
- safetyIdentifier: import_v424.z.string().nullish(),
4531
+ safetyIdentifier: z24.string().nullish(),
4441
4532
  /**
4442
4533
  * Service tier for the request.
4443
4534
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -4445,34 +4536,34 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4445
4536
  *
4446
4537
  * Defaults to 'auto'.
4447
4538
  */
4448
- serviceTier: import_v424.z.enum(["auto", "flex", "priority", "default"]).nullish(),
4539
+ serviceTier: z24.enum(["auto", "flex", "priority", "default"]).nullish(),
4449
4540
  /**
4450
4541
  * Whether to store the generation. Defaults to `true`.
4451
4542
  */
4452
- store: import_v424.z.boolean().nullish(),
4543
+ store: z24.boolean().nullish(),
4453
4544
  /**
4454
4545
  * Whether to use strict JSON schema validation.
4455
4546
  * Defaults to `true`.
4456
4547
  */
4457
- strictJsonSchema: import_v424.z.boolean().nullish(),
4548
+ strictJsonSchema: z24.boolean().nullish(),
4458
4549
  /**
4459
4550
  * Controls the verbosity of the model's responses. Lower values ('low') will result
4460
4551
  * in more concise responses, while higher values ('high') will result in more verbose responses.
4461
4552
  * Valid values: 'low', 'medium', 'high'.
4462
4553
  */
4463
- textVerbosity: import_v424.z.enum(["low", "medium", "high"]).nullish(),
4554
+ textVerbosity: z24.enum(["low", "medium", "high"]).nullish(),
4464
4555
  /**
4465
4556
  * Controls output truncation. 'auto' (default) performs truncation automatically;
4466
4557
  * 'disabled' turns truncation off.
4467
4558
  */
4468
- truncation: import_v424.z.enum(["auto", "disabled"]).nullish(),
4559
+ truncation: z24.enum(["auto", "disabled"]).nullish(),
4469
4560
  /**
4470
4561
  * A unique identifier representing your end-user, which can help OpenAI to
4471
4562
  * monitor and detect abuse.
4472
4563
  * Defaults to `undefined`.
4473
4564
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
4474
4565
  */
4475
- user: import_v424.z.string().nullish(),
4566
+ user: z24.string().nullish(),
4476
4567
  /**
4477
4568
  * Override the system message mode for this model.
4478
4569
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -4481,7 +4572,7 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4481
4572
  *
4482
4573
  * If not specified, the mode is automatically determined based on the model.
4483
4574
  */
4484
- systemMessageMode: import_v424.z.enum(["system", "developer", "remove"]).optional(),
4575
+ systemMessageMode: z24.enum(["system", "developer", "remove"]).optional(),
4485
4576
  /**
4486
4577
  * Force treating this model as a reasoning model.
4487
4578
  *
@@ -4491,14 +4582,14 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4491
4582
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
4492
4583
  * and defaults `systemMessageMode` to `developer` unless overridden.
4493
4584
  */
4494
- forceReasoning: import_v424.z.boolean().optional(),
4585
+ forceReasoning: z24.boolean().optional(),
4495
4586
  /**
4496
4587
  * Enable server-side context management (compaction).
4497
4588
  */
4498
- contextManagement: import_v424.z.array(
4499
- import_v424.z.object({
4500
- type: import_v424.z.literal("compaction"),
4501
- compactThreshold: import_v424.z.number()
4589
+ contextManagement: z24.array(
4590
+ z24.object({
4591
+ type: z24.literal("compaction"),
4592
+ compactThreshold: z24.number()
4502
4593
  })
4503
4594
  ).nullish()
4504
4595
  })
@@ -4506,8 +4597,13 @@ var openaiLanguageModelResponsesOptionsSchema = (0, import_provider_utils30.lazy
4506
4597
  );
4507
4598
 
4508
4599
  // src/responses/openai-responses-prepare-tools.ts
4509
- var import_provider7 = require("@ai-sdk/provider");
4510
- var import_provider_utils31 = require("@ai-sdk/provider-utils");
4600
+ import {
4601
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError5
4602
+ } from "@ai-sdk/provider";
4603
+ import {
4604
+ resolveProviderReference as resolveProviderReference3,
4605
+ validateTypes as validateTypes2
4606
+ } from "@ai-sdk/provider-utils";
4511
4607
  async function prepareResponsesTools({
4512
4608
  tools,
4513
4609
  toolChoice,
@@ -4540,7 +4636,7 @@ async function prepareResponsesTools({
4540
4636
  case "provider": {
4541
4637
  switch (tool.id) {
4542
4638
  case "openai.file_search": {
4543
- const args = await (0, import_provider_utils31.validateTypes)({
4639
+ const args = await validateTypes2({
4544
4640
  value: tool.args,
4545
4641
  schema: fileSearchArgsSchema
4546
4642
  });
@@ -4563,7 +4659,7 @@ async function prepareResponsesTools({
4563
4659
  break;
4564
4660
  }
4565
4661
  case "openai.shell": {
4566
- const args = await (0, import_provider_utils31.validateTypes)({
4662
+ const args = await validateTypes2({
4567
4663
  value: tool.args,
4568
4664
  schema: shellArgsSchema
4569
4665
  });
@@ -4582,7 +4678,7 @@ async function prepareResponsesTools({
4582
4678
  break;
4583
4679
  }
4584
4680
  case "openai.web_search_preview": {
4585
- const args = await (0, import_provider_utils31.validateTypes)({
4681
+ const args = await validateTypes2({
4586
4682
  value: tool.args,
4587
4683
  schema: webSearchPreviewArgsSchema
4588
4684
  });
@@ -4594,7 +4690,7 @@ async function prepareResponsesTools({
4594
4690
  break;
4595
4691
  }
4596
4692
  case "openai.web_search": {
4597
- const args = await (0, import_provider_utils31.validateTypes)({
4693
+ const args = await validateTypes2({
4598
4694
  value: tool.args,
4599
4695
  schema: webSearchArgsSchema
4600
4696
  });
@@ -4608,7 +4704,7 @@ async function prepareResponsesTools({
4608
4704
  break;
4609
4705
  }
4610
4706
  case "openai.code_interpreter": {
4611
- const args = await (0, import_provider_utils31.validateTypes)({
4707
+ const args = await validateTypes2({
4612
4708
  value: tool.args,
4613
4709
  schema: codeInterpreterArgsSchema
4614
4710
  });
@@ -4619,7 +4715,7 @@ async function prepareResponsesTools({
4619
4715
  break;
4620
4716
  }
4621
4717
  case "openai.image_generation": {
4622
- const args = await (0, import_provider_utils31.validateTypes)({
4718
+ const args = await validateTypes2({
4623
4719
  value: tool.args,
4624
4720
  schema: imageGenerationArgsSchema
4625
4721
  });
@@ -4642,7 +4738,7 @@ async function prepareResponsesTools({
4642
4738
  break;
4643
4739
  }
4644
4740
  case "openai.mcp": {
4645
- const args = await (0, import_provider_utils31.validateTypes)({
4741
+ const args = await validateTypes2({
4646
4742
  value: tool.args,
4647
4743
  schema: mcpArgsSchema
4648
4744
  });
@@ -4668,7 +4764,7 @@ async function prepareResponsesTools({
4668
4764
  break;
4669
4765
  }
4670
4766
  case "openai.custom": {
4671
- const args = await (0, import_provider_utils31.validateTypes)({
4767
+ const args = await validateTypes2({
4672
4768
  value: tool.args,
4673
4769
  schema: customArgsSchema
4674
4770
  });
@@ -4682,7 +4778,7 @@ async function prepareResponsesTools({
4682
4778
  break;
4683
4779
  }
4684
4780
  case "openai.tool_search": {
4685
- const args = await (0, import_provider_utils31.validateTypes)({
4781
+ const args = await validateTypes2({
4686
4782
  value: tool.args,
4687
4783
  schema: toolSearchArgsSchema
4688
4784
  });
@@ -4724,7 +4820,7 @@ async function prepareResponsesTools({
4724
4820
  }
4725
4821
  default: {
4726
4822
  const _exhaustiveCheck = type;
4727
- throw new import_provider7.UnsupportedFunctionalityError({
4823
+ throw new UnsupportedFunctionalityError5({
4728
4824
  functionality: `tool choice type: ${_exhaustiveCheck}`
4729
4825
  });
4730
4826
  }
@@ -4764,7 +4860,7 @@ function mapShellSkills(skills) {
4764
4860
  var _a, _b;
4765
4861
  return skill.type === "skillReference" ? {
4766
4862
  type: "skill_reference",
4767
- skill_id: (0, import_provider_utils31.resolveProviderReference)({
4863
+ skill_id: resolveProviderReference3({
4768
4864
  reference: (_a = skill.providerReference) != null ? _a : {},
4769
4865
  provider: "openai"
4770
4866
  }),
@@ -4847,19 +4943,19 @@ var OpenAIResponsesLanguageModel = class {
4847
4943
  warnings.push({ type: "unsupported", feature: "stopSequences" });
4848
4944
  }
4849
4945
  const providerOptionsName = this.config.provider.includes("azure") ? "azure" : "openai";
4850
- let openaiOptions = await (0, import_provider_utils32.parseProviderOptions)({
4946
+ let openaiOptions = await parseProviderOptions6({
4851
4947
  provider: providerOptionsName,
4852
4948
  providerOptions,
4853
4949
  schema: openaiLanguageModelResponsesOptionsSchema
4854
4950
  });
4855
4951
  if (openaiOptions == null && providerOptionsName !== "openai") {
4856
- openaiOptions = await (0, import_provider_utils32.parseProviderOptions)({
4952
+ openaiOptions = await parseProviderOptions6({
4857
4953
  provider: "openai",
4858
4954
  providerOptions,
4859
4955
  schema: openaiLanguageModelResponsesOptionsSchema
4860
4956
  });
4861
4957
  }
4862
- const resolvedReasoningEffort = (_a = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null ? _a : (0, import_provider_utils32.isCustomReasoning)(reasoning) ? reasoning : void 0;
4958
+ const resolvedReasoningEffort = (_a = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null ? _a : isCustomReasoning2(reasoning) ? reasoning : void 0;
4863
4959
  const isReasoningModel = (_b = openaiOptions == null ? void 0 : openaiOptions.forceReasoning) != null ? _b : modelCapabilities.isReasoningModel;
4864
4960
  if ((openaiOptions == null ? void 0 : openaiOptions.conversation) && (openaiOptions == null ? void 0 : openaiOptions.previousResponseId)) {
4865
4961
  warnings.push({
@@ -4868,7 +4964,7 @@ var OpenAIResponsesLanguageModel = class {
4868
4964
  details: "conversation and previousResponseId cannot be used together"
4869
4965
  });
4870
4966
  }
4871
- const toolNameMapping = (0, import_provider_utils32.createToolNameMapping)({
4967
+ const toolNameMapping = createToolNameMapping({
4872
4968
  tools,
4873
4969
  providerToolNames: {
4874
4970
  "openai.code_interpreter": "code_interpreter",
@@ -5082,19 +5178,19 @@ var OpenAIResponsesLanguageModel = class {
5082
5178
  responseHeaders,
5083
5179
  value: response,
5084
5180
  rawValue: rawResponse
5085
- } = await (0, import_provider_utils32.postJsonToApi)({
5181
+ } = await postJsonToApi5({
5086
5182
  url,
5087
- headers: (0, import_provider_utils32.combineHeaders)(this.config.headers(), options.headers),
5183
+ headers: combineHeaders6(this.config.headers(), options.headers),
5088
5184
  body,
5089
5185
  failedResponseHandler: openaiFailedResponseHandler,
5090
- successfulResponseHandler: (0, import_provider_utils32.createJsonResponseHandler)(
5186
+ successfulResponseHandler: createJsonResponseHandler6(
5091
5187
  openaiResponsesResponseSchema
5092
5188
  ),
5093
5189
  abortSignal: options.abortSignal,
5094
5190
  fetch: this.config.fetch
5095
5191
  });
5096
5192
  if (response.error) {
5097
- throw new import_provider8.APICallError({
5193
+ throw new APICallError({
5098
5194
  message: response.error.message,
5099
5195
  url,
5100
5196
  requestBodyValues: body,
@@ -5263,7 +5359,7 @@ var OpenAIResponsesLanguageModel = class {
5263
5359
  content.push({
5264
5360
  type: "source",
5265
5361
  sourceType: "url",
5266
- id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : (0, import_provider_utils32.generateId)(),
5362
+ id: (_i = (_h = (_g = this.config).generateId) == null ? void 0 : _h.call(_g)) != null ? _i : generateId2(),
5267
5363
  url: annotation.url,
5268
5364
  title: annotation.title
5269
5365
  });
@@ -5271,7 +5367,7 @@ var OpenAIResponsesLanguageModel = class {
5271
5367
  content.push({
5272
5368
  type: "source",
5273
5369
  sourceType: "document",
5274
- id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : (0, import_provider_utils32.generateId)(),
5370
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
5275
5371
  mediaType: "text/plain",
5276
5372
  title: annotation.filename,
5277
5373
  filename: annotation.filename,
@@ -5287,7 +5383,7 @@ var OpenAIResponsesLanguageModel = class {
5287
5383
  content.push({
5288
5384
  type: "source",
5289
5385
  sourceType: "document",
5290
- id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils32.generateId)(),
5386
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
5291
5387
  mediaType: "text/plain",
5292
5388
  title: annotation.filename,
5293
5389
  filename: annotation.filename,
@@ -5303,7 +5399,7 @@ var OpenAIResponsesLanguageModel = class {
5303
5399
  content.push({
5304
5400
  type: "source",
5305
5401
  sourceType: "document",
5306
- id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : (0, import_provider_utils32.generateId)(),
5402
+ id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
5307
5403
  mediaType: "application/octet-stream",
5308
5404
  title: annotation.file_id,
5309
5405
  filename: annotation.file_id,
@@ -5407,7 +5503,7 @@ var OpenAIResponsesLanguageModel = class {
5407
5503
  }
5408
5504
  case "mcp_approval_request": {
5409
5505
  const approvalRequestId = (_t = part.approval_request_id) != null ? _t : part.id;
5410
- const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : (0, import_provider_utils32.generateId)();
5506
+ const dummyToolCallId = (_w = (_v = (_u = this.config).generateId) == null ? void 0 : _v.call(_u)) != null ? _w : generateId2();
5411
5507
  const toolName = `mcp.${part.name}`;
5412
5508
  content.push({
5413
5509
  type: "tool-call",
@@ -5562,18 +5658,18 @@ var OpenAIResponsesLanguageModel = class {
5562
5658
  providerOptionsName,
5563
5659
  isShellProviderExecuted
5564
5660
  } = await this.getArgs(options);
5565
- const { responseHeaders, value: response } = await (0, import_provider_utils32.postJsonToApi)({
5661
+ const { responseHeaders, value: response } = await postJsonToApi5({
5566
5662
  url: this.config.url({
5567
5663
  path: "/responses",
5568
5664
  modelId: this.modelId
5569
5665
  }),
5570
- headers: (0, import_provider_utils32.combineHeaders)(this.config.headers(), options.headers),
5666
+ headers: combineHeaders6(this.config.headers(), options.headers),
5571
5667
  body: {
5572
5668
  ...body,
5573
5669
  stream: true
5574
5670
  },
5575
5671
  failedResponseHandler: openaiFailedResponseHandler,
5576
- successfulResponseHandler: (0, import_provider_utils32.createEventSourceResponseHandler)(
5672
+ successfulResponseHandler: createEventSourceResponseHandler3(
5577
5673
  openaiResponsesChunkSchema
5578
5674
  ),
5579
5675
  abortSignal: options.abortSignal,
@@ -6053,7 +6149,7 @@ var OpenAIResponsesLanguageModel = class {
6053
6149
  ongoingToolCalls[value.output_index] = void 0;
6054
6150
  } else if (value.item.type === "mcp_approval_request") {
6055
6151
  ongoingToolCalls[value.output_index] = void 0;
6056
- const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : (0, import_provider_utils32.generateId)();
6152
+ const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
6057
6153
  const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
6058
6154
  approvalRequestIdToDummyToolCallIdFromStream.set(
6059
6155
  approvalRequestId,
@@ -6356,7 +6452,7 @@ var OpenAIResponsesLanguageModel = class {
6356
6452
  controller.enqueue({
6357
6453
  type: "source",
6358
6454
  sourceType: "url",
6359
- id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : (0, import_provider_utils32.generateId)(),
6455
+ id: (_C = (_B = (_A = self.config).generateId) == null ? void 0 : _B.call(_A)) != null ? _C : generateId2(),
6360
6456
  url: value.annotation.url,
6361
6457
  title: value.annotation.title
6362
6458
  });
@@ -6364,7 +6460,7 @@ var OpenAIResponsesLanguageModel = class {
6364
6460
  controller.enqueue({
6365
6461
  type: "source",
6366
6462
  sourceType: "document",
6367
- id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : (0, import_provider_utils32.generateId)(),
6463
+ id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
6368
6464
  mediaType: "text/plain",
6369
6465
  title: value.annotation.filename,
6370
6466
  filename: value.annotation.filename,
@@ -6380,7 +6476,7 @@ var OpenAIResponsesLanguageModel = class {
6380
6476
  controller.enqueue({
6381
6477
  type: "source",
6382
6478
  sourceType: "document",
6383
- id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : (0, import_provider_utils32.generateId)(),
6479
+ id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
6384
6480
  mediaType: "text/plain",
6385
6481
  title: value.annotation.filename,
6386
6482
  filename: value.annotation.filename,
@@ -6396,7 +6492,7 @@ var OpenAIResponsesLanguageModel = class {
6396
6492
  controller.enqueue({
6397
6493
  type: "source",
6398
6494
  sourceType: "document",
6399
- id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : (0, import_provider_utils32.generateId)(),
6495
+ id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
6400
6496
  mediaType: "application/octet-stream",
6401
6497
  title: value.annotation.file_id,
6402
6498
  filename: value.annotation.file_id,
@@ -6509,16 +6605,21 @@ function escapeJSONDelta(delta) {
6509
6605
  }
6510
6606
 
6511
6607
  // src/speech/openai-speech-model.ts
6512
- var import_provider_utils34 = require("@ai-sdk/provider-utils");
6608
+ import {
6609
+ combineHeaders as combineHeaders7,
6610
+ createBinaryResponseHandler,
6611
+ parseProviderOptions as parseProviderOptions7,
6612
+ postJsonToApi as postJsonToApi6
6613
+ } from "@ai-sdk/provider-utils";
6513
6614
 
6514
6615
  // src/speech/openai-speech-options.ts
6515
- var import_provider_utils33 = require("@ai-sdk/provider-utils");
6516
- var import_v425 = require("zod/v4");
6517
- var openaiSpeechModelOptionsSchema = (0, import_provider_utils33.lazySchema)(
6518
- () => (0, import_provider_utils33.zodSchema)(
6519
- import_v425.z.object({
6520
- instructions: import_v425.z.string().nullish(),
6521
- speed: import_v425.z.number().min(0.25).max(4).default(1).nullish()
6616
+ import { lazySchema as lazySchema23, zodSchema as zodSchema23 } from "@ai-sdk/provider-utils";
6617
+ import { z as z25 } from "zod/v4";
6618
+ var openaiSpeechModelOptionsSchema = lazySchema23(
6619
+ () => zodSchema23(
6620
+ z25.object({
6621
+ instructions: z25.string().nullish(),
6622
+ speed: z25.number().min(0.25).max(4).default(1).nullish()
6522
6623
  })
6523
6624
  )
6524
6625
  );
@@ -6543,7 +6644,7 @@ var OpenAISpeechModel = class {
6543
6644
  providerOptions
6544
6645
  }) {
6545
6646
  const warnings = [];
6546
- const openAIOptions = await (0, import_provider_utils34.parseProviderOptions)({
6647
+ const openAIOptions = await parseProviderOptions7({
6547
6648
  provider: "openai",
6548
6649
  providerOptions,
6549
6650
  schema: openaiSpeechModelOptionsSchema
@@ -6596,15 +6697,15 @@ var OpenAISpeechModel = class {
6596
6697
  value: audio,
6597
6698
  responseHeaders,
6598
6699
  rawValue: rawResponse
6599
- } = await (0, import_provider_utils34.postJsonToApi)({
6700
+ } = await postJsonToApi6({
6600
6701
  url: this.config.url({
6601
6702
  path: "/audio/speech",
6602
6703
  modelId: this.modelId
6603
6704
  }),
6604
- headers: (0, import_provider_utils34.combineHeaders)(this.config.headers(), options.headers),
6705
+ headers: combineHeaders7(this.config.headers(), options.headers),
6605
6706
  body: requestBody,
6606
6707
  failedResponseHandler: openaiFailedResponseHandler,
6607
- successfulResponseHandler: (0, import_provider_utils34.createBinaryResponseHandler)(),
6708
+ successfulResponseHandler: createBinaryResponseHandler(),
6608
6709
  abortSignal: options.abortSignal,
6609
6710
  fetch: this.config.fetch
6610
6711
  });
@@ -6625,36 +6726,43 @@ var OpenAISpeechModel = class {
6625
6726
  };
6626
6727
 
6627
6728
  // src/transcription/openai-transcription-model.ts
6628
- var import_provider_utils37 = require("@ai-sdk/provider-utils");
6729
+ import {
6730
+ combineHeaders as combineHeaders8,
6731
+ convertBase64ToUint8Array as convertBase64ToUint8Array3,
6732
+ createJsonResponseHandler as createJsonResponseHandler7,
6733
+ mediaTypeToExtension,
6734
+ parseProviderOptions as parseProviderOptions8,
6735
+ postFormDataToApi as postFormDataToApi3
6736
+ } from "@ai-sdk/provider-utils";
6629
6737
 
6630
6738
  // src/transcription/openai-transcription-api.ts
6631
- var import_provider_utils35 = require("@ai-sdk/provider-utils");
6632
- var import_v426 = require("zod/v4");
6633
- var openaiTranscriptionResponseSchema = (0, import_provider_utils35.lazySchema)(
6634
- () => (0, import_provider_utils35.zodSchema)(
6635
- import_v426.z.object({
6636
- text: import_v426.z.string(),
6637
- language: import_v426.z.string().nullish(),
6638
- duration: import_v426.z.number().nullish(),
6639
- words: import_v426.z.array(
6640
- import_v426.z.object({
6641
- word: import_v426.z.string(),
6642
- start: import_v426.z.number(),
6643
- end: import_v426.z.number()
6739
+ import { lazySchema as lazySchema24, zodSchema as zodSchema24 } from "@ai-sdk/provider-utils";
6740
+ import { z as z26 } from "zod/v4";
6741
+ var openaiTranscriptionResponseSchema = lazySchema24(
6742
+ () => zodSchema24(
6743
+ z26.object({
6744
+ text: z26.string(),
6745
+ language: z26.string().nullish(),
6746
+ duration: z26.number().nullish(),
6747
+ words: z26.array(
6748
+ z26.object({
6749
+ word: z26.string(),
6750
+ start: z26.number(),
6751
+ end: z26.number()
6644
6752
  })
6645
6753
  ).nullish(),
6646
- segments: import_v426.z.array(
6647
- import_v426.z.object({
6648
- id: import_v426.z.number(),
6649
- seek: import_v426.z.number(),
6650
- start: import_v426.z.number(),
6651
- end: import_v426.z.number(),
6652
- text: import_v426.z.string(),
6653
- tokens: import_v426.z.array(import_v426.z.number()),
6654
- temperature: import_v426.z.number(),
6655
- avg_logprob: import_v426.z.number(),
6656
- compression_ratio: import_v426.z.number(),
6657
- no_speech_prob: import_v426.z.number()
6754
+ segments: z26.array(
6755
+ z26.object({
6756
+ id: z26.number(),
6757
+ seek: z26.number(),
6758
+ start: z26.number(),
6759
+ end: z26.number(),
6760
+ text: z26.string(),
6761
+ tokens: z26.array(z26.number()),
6762
+ temperature: z26.number(),
6763
+ avg_logprob: z26.number(),
6764
+ compression_ratio: z26.number(),
6765
+ no_speech_prob: z26.number()
6658
6766
  })
6659
6767
  ).nullish()
6660
6768
  })
@@ -6662,33 +6770,33 @@ var openaiTranscriptionResponseSchema = (0, import_provider_utils35.lazySchema)(
6662
6770
  );
6663
6771
 
6664
6772
  // src/transcription/openai-transcription-options.ts
6665
- var import_provider_utils36 = require("@ai-sdk/provider-utils");
6666
- var import_v427 = require("zod/v4");
6667
- var openAITranscriptionModelOptions = (0, import_provider_utils36.lazySchema)(
6668
- () => (0, import_provider_utils36.zodSchema)(
6669
- import_v427.z.object({
6773
+ import { lazySchema as lazySchema25, zodSchema as zodSchema25 } from "@ai-sdk/provider-utils";
6774
+ import { z as z27 } from "zod/v4";
6775
+ var openAITranscriptionModelOptions = lazySchema25(
6776
+ () => zodSchema25(
6777
+ z27.object({
6670
6778
  /**
6671
6779
  * Additional information to include in the transcription response.
6672
6780
  */
6673
- include: import_v427.z.array(import_v427.z.string()).optional(),
6781
+ include: z27.array(z27.string()).optional(),
6674
6782
  /**
6675
6783
  * The language of the input audio in ISO-639-1 format.
6676
6784
  */
6677
- language: import_v427.z.string().optional(),
6785
+ language: z27.string().optional(),
6678
6786
  /**
6679
6787
  * An optional text to guide the model's style or continue a previous audio segment.
6680
6788
  */
6681
- prompt: import_v427.z.string().optional(),
6789
+ prompt: z27.string().optional(),
6682
6790
  /**
6683
6791
  * The sampling temperature, between 0 and 1.
6684
6792
  * @default 0
6685
6793
  */
6686
- temperature: import_v427.z.number().min(0).max(1).default(0).optional(),
6794
+ temperature: z27.number().min(0).max(1).default(0).optional(),
6687
6795
  /**
6688
6796
  * The timestamp granularities to populate for this transcription.
6689
6797
  * @default ['segment']
6690
6798
  */
6691
- timestampGranularities: import_v427.z.array(import_v427.z.enum(["word", "segment"])).default(["segment"]).optional()
6799
+ timestampGranularities: z27.array(z27.enum(["word", "segment"])).default(["segment"]).optional()
6692
6800
  })
6693
6801
  )
6694
6802
  );
@@ -6768,15 +6876,15 @@ var OpenAITranscriptionModel = class {
6768
6876
  providerOptions
6769
6877
  }) {
6770
6878
  const warnings = [];
6771
- const openAIOptions = await (0, import_provider_utils37.parseProviderOptions)({
6879
+ const openAIOptions = await parseProviderOptions8({
6772
6880
  provider: "openai",
6773
6881
  providerOptions,
6774
6882
  schema: openAITranscriptionModelOptions
6775
6883
  });
6776
6884
  const formData = new FormData();
6777
- const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([(0, import_provider_utils37.convertBase64ToUint8Array)(audio)]);
6885
+ const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array3(audio)]);
6778
6886
  formData.append("model", this.modelId);
6779
- const fileExtension = (0, import_provider_utils37.mediaTypeToExtension)(mediaType);
6887
+ const fileExtension = mediaTypeToExtension(mediaType);
6780
6888
  formData.append(
6781
6889
  "file",
6782
6890
  new File([blob], "audio", { type: mediaType }),
@@ -6821,15 +6929,15 @@ var OpenAITranscriptionModel = class {
6821
6929
  value: response,
6822
6930
  responseHeaders,
6823
6931
  rawValue: rawResponse
6824
- } = await (0, import_provider_utils37.postFormDataToApi)({
6932
+ } = await postFormDataToApi3({
6825
6933
  url: this.config.url({
6826
6934
  path: "/audio/transcriptions",
6827
6935
  modelId: this.modelId
6828
6936
  }),
6829
- headers: (0, import_provider_utils37.combineHeaders)(this.config.headers(), options.headers),
6937
+ headers: combineHeaders8(this.config.headers(), options.headers),
6830
6938
  formData,
6831
6939
  failedResponseHandler: openaiFailedResponseHandler,
6832
- successfulResponseHandler: (0, import_provider_utils37.createJsonResponseHandler)(
6940
+ successfulResponseHandler: createJsonResponseHandler7(
6833
6941
  openaiTranscriptionResponseSchema
6834
6942
  ),
6835
6943
  abortSignal: options.abortSignal,
@@ -6861,31 +6969,36 @@ var OpenAITranscriptionModel = class {
6861
6969
  };
6862
6970
 
6863
6971
  // src/skills/openai-skills.ts
6864
- var import_provider_utils39 = require("@ai-sdk/provider-utils");
6972
+ import {
6973
+ combineHeaders as combineHeaders9,
6974
+ convertBase64ToUint8Array as convertBase64ToUint8Array4,
6975
+ createJsonResponseHandler as createJsonResponseHandler8,
6976
+ postFormDataToApi as postFormDataToApi4
6977
+ } from "@ai-sdk/provider-utils";
6865
6978
 
6866
6979
  // src/skills/openai-skills-api.ts
6867
- var import_provider_utils38 = require("@ai-sdk/provider-utils");
6868
- var import_v428 = require("zod/v4");
6869
- var openaiSkillResponseSchema = (0, import_provider_utils38.lazySchema)(
6870
- () => (0, import_provider_utils38.zodSchema)(
6871
- import_v428.z.object({
6872
- id: import_v428.z.string(),
6873
- name: import_v428.z.string().nullish(),
6874
- description: import_v428.z.string().nullish(),
6875
- default_version: import_v428.z.string().nullish(),
6876
- latest_version: import_v428.z.string().nullish(),
6877
- created_at: import_v428.z.number(),
6878
- updated_at: import_v428.z.number().nullish()
6980
+ import { lazySchema as lazySchema26, zodSchema as zodSchema26 } from "@ai-sdk/provider-utils";
6981
+ import { z as z28 } from "zod/v4";
6982
+ var openaiSkillResponseSchema = lazySchema26(
6983
+ () => zodSchema26(
6984
+ z28.object({
6985
+ id: z28.string(),
6986
+ name: z28.string().nullish(),
6987
+ description: z28.string().nullish(),
6988
+ default_version: z28.string().nullish(),
6989
+ latest_version: z28.string().nullish(),
6990
+ created_at: z28.number(),
6991
+ updated_at: z28.number().nullish()
6879
6992
  })
6880
6993
  )
6881
6994
  );
6882
- var openaiSkillVersionResponseSchema = (0, import_provider_utils38.lazySchema)(
6883
- () => (0, import_provider_utils38.zodSchema)(
6884
- import_v428.z.object({
6885
- id: import_v428.z.string(),
6886
- version: import_v428.z.string().nullish(),
6887
- name: import_v428.z.string().nullish(),
6888
- description: import_v428.z.string().nullish()
6995
+ var openaiSkillVersionResponseSchema = lazySchema26(
6996
+ () => zodSchema26(
6997
+ z28.object({
6998
+ id: z28.string(),
6999
+ version: z28.string().nullish(),
7000
+ name: z28.string().nullish(),
7001
+ description: z28.string().nullish()
6889
7002
  })
6890
7003
  )
6891
7004
  );
@@ -6909,15 +7022,15 @@ var OpenAISkills = class {
6909
7022
  }
6910
7023
  const formData = new FormData();
6911
7024
  for (const file of params.files) {
6912
- const content = typeof file.content === "string" ? (0, import_provider_utils39.convertBase64ToUint8Array)(file.content) : file.content;
7025
+ const content = typeof file.content === "string" ? convertBase64ToUint8Array4(file.content) : file.content;
6913
7026
  formData.append("files[]", new Blob([content]), file.path);
6914
7027
  }
6915
- const { value: response } = await (0, import_provider_utils39.postFormDataToApi)({
7028
+ const { value: response } = await postFormDataToApi4({
6916
7029
  url: this.config.url({ path: "/skills" }),
6917
- headers: (0, import_provider_utils39.combineHeaders)(this.config.headers()),
7030
+ headers: combineHeaders9(this.config.headers()),
6918
7031
  formData,
6919
7032
  failedResponseHandler: openaiFailedResponseHandler,
6920
- successfulResponseHandler: (0, import_provider_utils39.createJsonResponseHandler)(
7033
+ successfulResponseHandler: createJsonResponseHandler8(
6921
7034
  openaiSkillResponseSchema
6922
7035
  ),
6923
7036
  fetch: this.config.fetch
@@ -6940,21 +7053,21 @@ var OpenAISkills = class {
6940
7053
  };
6941
7054
 
6942
7055
  // src/version.ts
6943
- var VERSION = true ? "4.0.0-beta.29" : "0.0.0-test";
7056
+ var VERSION = true ? "4.0.0-beta.30" : "0.0.0-test";
6944
7057
 
6945
7058
  // src/openai-provider.ts
6946
7059
  function createOpenAI(options = {}) {
6947
7060
  var _a, _b;
6948
- const baseURL = (_a = (0, import_provider_utils40.withoutTrailingSlash)(
6949
- (0, import_provider_utils40.loadOptionalSetting)({
7061
+ const baseURL = (_a = withoutTrailingSlash(
7062
+ loadOptionalSetting({
6950
7063
  settingValue: options.baseURL,
6951
7064
  environmentVariableName: "OPENAI_BASE_URL"
6952
7065
  })
6953
7066
  )) != null ? _a : "https://api.openai.com/v1";
6954
7067
  const providerName = (_b = options.name) != null ? _b : "openai";
6955
- const getHeaders = () => (0, import_provider_utils40.withUserAgentSuffix)(
7068
+ const getHeaders = () => withUserAgentSuffix(
6956
7069
  {
6957
- Authorization: `Bearer ${(0, import_provider_utils40.loadApiKey)({
7070
+ Authorization: `Bearer ${loadApiKey({
6958
7071
  apiKey: options.apiKey,
6959
7072
  environmentVariableName: "OPENAI_API_KEY",
6960
7073
  description: "OpenAI"
@@ -7055,10 +7168,9 @@ function createOpenAI(options = {}) {
7055
7168
  return provider;
7056
7169
  }
7057
7170
  var openai = createOpenAI();
7058
- // Annotate the CommonJS export names for ESM import in node:
7059
- 0 && (module.exports = {
7171
+ export {
7060
7172
  VERSION,
7061
7173
  createOpenAI,
7062
7174
  openai
7063
- });
7175
+ };
7064
7176
  //# sourceMappingURL=index.js.map