@ai-sdk/openai 4.0.14 → 4.0.16

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.
@@ -3052,7 +3052,7 @@ import {
3052
3052
  resolveProviderReference as resolveProviderReference2,
3053
3053
  validateTypes
3054
3054
  } from "@ai-sdk/provider-utils";
3055
- import { z as z17 } from "zod/v4";
3055
+ import { z as z18 } from "zod/v4";
3056
3056
 
3057
3057
  // src/tool/apply-patch.ts
3058
3058
  import {
@@ -3100,124 +3100,220 @@ var applyPatchToolFactory = createProviderDefinedToolFactoryWithOutputSchema({
3100
3100
  });
3101
3101
  var applyPatch = applyPatchToolFactory;
3102
3102
 
3103
- // src/tool/local-shell.ts
3103
+ // src/tool/computer.ts
3104
3104
  import {
3105
3105
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
3106
3106
  lazySchema as lazySchema13,
3107
3107
  zodSchema as zodSchema13
3108
3108
  } from "@ai-sdk/provider-utils";
3109
3109
  import { z as z14 } from "zod/v4";
3110
- var localShellInputSchema = lazySchema13(
3110
+ var safetyCheckSchema = z14.object({
3111
+ id: z14.string(),
3112
+ code: z14.string().optional(),
3113
+ message: z14.string().optional()
3114
+ });
3115
+ var computerActionSchema = z14.discriminatedUnion("type", [
3116
+ z14.object({
3117
+ type: z14.literal("click"),
3118
+ button: z14.enum(["left", "right", "wheel", "back", "forward"]),
3119
+ x: z14.number(),
3120
+ y: z14.number(),
3121
+ keys: z14.array(z14.string()).optional()
3122
+ }),
3123
+ z14.object({
3124
+ type: z14.literal("double_click"),
3125
+ x: z14.number(),
3126
+ y: z14.number(),
3127
+ keys: z14.array(z14.string()).optional()
3128
+ }),
3129
+ z14.object({
3130
+ type: z14.literal("drag"),
3131
+ path: z14.array(z14.object({ x: z14.number(), y: z14.number() })),
3132
+ keys: z14.array(z14.string()).optional()
3133
+ }),
3134
+ z14.object({
3135
+ type: z14.literal("keypress"),
3136
+ keys: z14.array(z14.string())
3137
+ }),
3138
+ z14.object({
3139
+ type: z14.literal("move"),
3140
+ x: z14.number(),
3141
+ y: z14.number(),
3142
+ keys: z14.array(z14.string()).optional()
3143
+ }),
3144
+ z14.object({
3145
+ type: z14.literal("screenshot")
3146
+ }),
3147
+ z14.object({
3148
+ type: z14.literal("scroll"),
3149
+ x: z14.number(),
3150
+ y: z14.number(),
3151
+ scrollX: z14.number(),
3152
+ scrollY: z14.number(),
3153
+ keys: z14.array(z14.string()).optional()
3154
+ }),
3155
+ z14.object({
3156
+ type: z14.literal("type"),
3157
+ text: z14.string()
3158
+ }),
3159
+ z14.object({
3160
+ type: z14.literal("wait")
3161
+ })
3162
+ ]);
3163
+ var computerInputSchema = lazySchema13(
3111
3164
  () => zodSchema13(
3112
3165
  z14.object({
3113
- action: z14.object({
3114
- type: z14.literal("exec"),
3115
- command: z14.array(z14.string()),
3116
- timeoutMs: z14.number().optional(),
3117
- user: z14.string().optional(),
3118
- workingDirectory: z14.string().optional(),
3119
- env: z14.record(z14.string(), z14.string()).optional()
3120
- })
3166
+ actions: z14.array(computerActionSchema),
3167
+ pendingSafetyChecks: z14.array(safetyCheckSchema),
3168
+ status: z14.enum(["in_progress", "completed", "incomplete"])
3121
3169
  })
3122
3170
  )
3123
3171
  );
3124
- var localShellOutputSchema = lazySchema13(
3125
- () => zodSchema13(z14.object({ output: z14.string() }))
3172
+ var computerOutputSchema = lazySchema13(
3173
+ () => zodSchema13(
3174
+ z14.object({
3175
+ output: z14.union([
3176
+ z14.object({
3177
+ type: z14.literal("computer_screenshot"),
3178
+ imageUrl: z14.string(),
3179
+ fileId: z14.string().optional(),
3180
+ detail: z14.enum(["auto", "low", "high", "original"]).optional()
3181
+ }),
3182
+ z14.object({
3183
+ type: z14.literal("computer_screenshot"),
3184
+ fileId: z14.string(),
3185
+ imageUrl: z14.string().optional(),
3186
+ detail: z14.enum(["auto", "low", "high", "original"]).optional()
3187
+ })
3188
+ ]),
3189
+ acknowledgedSafetyChecks: z14.array(safetyCheckSchema).optional()
3190
+ })
3191
+ )
3126
3192
  );
3127
- var localShell = createProviderDefinedToolFactoryWithOutputSchema2({
3128
- id: "openai.local_shell",
3129
- inputSchema: localShellInputSchema,
3130
- outputSchema: localShellOutputSchema
3193
+ var computerToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
3194
+ id: "openai.computer",
3195
+ inputSchema: computerInputSchema,
3196
+ outputSchema: computerOutputSchema
3131
3197
  });
3132
3198
 
3133
- // src/tool/shell.ts
3199
+ // src/tool/local-shell.ts
3134
3200
  import {
3135
3201
  createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3,
3136
3202
  lazySchema as lazySchema14,
3137
3203
  zodSchema as zodSchema14
3138
3204
  } from "@ai-sdk/provider-utils";
3139
3205
  import { z as z15 } from "zod/v4";
3140
- var shellInputSchema = lazySchema14(
3206
+ var localShellInputSchema = lazySchema14(
3141
3207
  () => zodSchema14(
3142
3208
  z15.object({
3143
3209
  action: z15.object({
3144
- commands: z15.array(z15.string()),
3210
+ type: z15.literal("exec"),
3211
+ command: z15.array(z15.string()),
3145
3212
  timeoutMs: z15.number().optional(),
3146
- maxOutputLength: z15.number().optional()
3213
+ user: z15.string().optional(),
3214
+ workingDirectory: z15.string().optional(),
3215
+ env: z15.record(z15.string(), z15.string()).optional()
3147
3216
  })
3148
3217
  })
3149
3218
  )
3150
3219
  );
3151
- var shellOutputSchema = lazySchema14(
3152
- () => zodSchema14(
3153
- z15.object({
3154
- output: z15.array(
3155
- z15.object({
3156
- stdout: z15.string(),
3157
- stderr: z15.string(),
3158
- outcome: z15.discriminatedUnion("type", [
3159
- z15.object({ type: z15.literal("timeout") }),
3160
- z15.object({ type: z15.literal("exit"), exitCode: z15.number() })
3220
+ var localShellOutputSchema = lazySchema14(
3221
+ () => zodSchema14(z15.object({ output: z15.string() }))
3222
+ );
3223
+ var localShell = createProviderDefinedToolFactoryWithOutputSchema3({
3224
+ id: "openai.local_shell",
3225
+ inputSchema: localShellInputSchema,
3226
+ outputSchema: localShellOutputSchema
3227
+ });
3228
+
3229
+ // src/tool/shell.ts
3230
+ import {
3231
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
3232
+ lazySchema as lazySchema15,
3233
+ zodSchema as zodSchema15
3234
+ } from "@ai-sdk/provider-utils";
3235
+ import { z as z16 } from "zod/v4";
3236
+ var shellInputSchema = lazySchema15(
3237
+ () => zodSchema15(
3238
+ z16.object({
3239
+ action: z16.object({
3240
+ commands: z16.array(z16.string()),
3241
+ timeoutMs: z16.number().optional(),
3242
+ maxOutputLength: z16.number().optional()
3243
+ })
3244
+ })
3245
+ )
3246
+ );
3247
+ var shellOutputSchema = lazySchema15(
3248
+ () => zodSchema15(
3249
+ z16.object({
3250
+ output: z16.array(
3251
+ z16.object({
3252
+ stdout: z16.string(),
3253
+ stderr: z16.string(),
3254
+ outcome: z16.discriminatedUnion("type", [
3255
+ z16.object({ type: z16.literal("timeout") }),
3256
+ z16.object({ type: z16.literal("exit"), exitCode: z16.number() })
3161
3257
  ])
3162
3258
  })
3163
3259
  )
3164
3260
  })
3165
3261
  )
3166
3262
  );
3167
- var shellSkillsSchema = z15.array(
3168
- z15.discriminatedUnion("type", [
3169
- z15.object({
3170
- type: z15.literal("skillReference"),
3171
- providerReference: z15.record(z15.string(), z15.string()),
3172
- version: z15.string().optional()
3263
+ var shellSkillsSchema = z16.array(
3264
+ z16.discriminatedUnion("type", [
3265
+ z16.object({
3266
+ type: z16.literal("skillReference"),
3267
+ providerReference: z16.record(z16.string(), z16.string()),
3268
+ version: z16.string().optional()
3173
3269
  }),
3174
- z15.object({
3175
- type: z15.literal("inline"),
3176
- name: z15.string(),
3177
- description: z15.string(),
3178
- source: z15.object({
3179
- type: z15.literal("base64"),
3180
- mediaType: z15.literal("application/zip"),
3181
- data: z15.string()
3270
+ z16.object({
3271
+ type: z16.literal("inline"),
3272
+ name: z16.string(),
3273
+ description: z16.string(),
3274
+ source: z16.object({
3275
+ type: z16.literal("base64"),
3276
+ mediaType: z16.literal("application/zip"),
3277
+ data: z16.string()
3182
3278
  })
3183
3279
  })
3184
3280
  ])
3185
3281
  ).optional();
3186
- var shellArgsSchema = lazySchema14(
3187
- () => zodSchema14(
3188
- z15.object({
3189
- environment: z15.union([
3190
- z15.object({
3191
- type: z15.literal("containerAuto"),
3192
- fileIds: z15.array(z15.string()).optional(),
3193
- memoryLimit: z15.enum(["1g", "4g", "16g", "64g"]).optional(),
3194
- networkPolicy: z15.discriminatedUnion("type", [
3195
- z15.object({ type: z15.literal("disabled") }),
3196
- z15.object({
3197
- type: z15.literal("allowlist"),
3198
- allowedDomains: z15.array(z15.string()),
3199
- domainSecrets: z15.array(
3200
- z15.object({
3201
- domain: z15.string(),
3202
- name: z15.string(),
3203
- value: z15.string()
3282
+ var shellArgsSchema = lazySchema15(
3283
+ () => zodSchema15(
3284
+ z16.object({
3285
+ environment: z16.union([
3286
+ z16.object({
3287
+ type: z16.literal("containerAuto"),
3288
+ fileIds: z16.array(z16.string()).optional(),
3289
+ memoryLimit: z16.enum(["1g", "4g", "16g", "64g"]).optional(),
3290
+ networkPolicy: z16.discriminatedUnion("type", [
3291
+ z16.object({ type: z16.literal("disabled") }),
3292
+ z16.object({
3293
+ type: z16.literal("allowlist"),
3294
+ allowedDomains: z16.array(z16.string()),
3295
+ domainSecrets: z16.array(
3296
+ z16.object({
3297
+ domain: z16.string(),
3298
+ name: z16.string(),
3299
+ value: z16.string()
3204
3300
  })
3205
3301
  ).optional()
3206
3302
  })
3207
3303
  ]).optional(),
3208
3304
  skills: shellSkillsSchema
3209
3305
  }),
3210
- z15.object({
3211
- type: z15.literal("containerReference"),
3212
- containerId: z15.string()
3306
+ z16.object({
3307
+ type: z16.literal("containerReference"),
3308
+ containerId: z16.string()
3213
3309
  }),
3214
- z15.object({
3215
- type: z15.literal("local").optional(),
3216
- skills: z15.array(
3217
- z15.object({
3218
- name: z15.string(),
3219
- description: z15.string(),
3220
- path: z15.string()
3310
+ z16.object({
3311
+ type: z16.literal("local").optional(),
3312
+ skills: z16.array(
3313
+ z16.object({
3314
+ name: z16.string(),
3315
+ description: z16.string(),
3316
+ path: z16.string()
3221
3317
  })
3222
3318
  ).optional()
3223
3319
  })
@@ -3225,7 +3321,7 @@ var shellArgsSchema = lazySchema14(
3225
3321
  })
3226
3322
  )
3227
3323
  );
3228
- var shell = createProviderDefinedToolFactoryWithOutputSchema3({
3324
+ var shell = createProviderDefinedToolFactoryWithOutputSchema4({
3229
3325
  id: "openai.shell",
3230
3326
  inputSchema: shellInputSchema,
3231
3327
  outputSchema: shellOutputSchema
@@ -3233,36 +3329,36 @@ var shell = createProviderDefinedToolFactoryWithOutputSchema3({
3233
3329
 
3234
3330
  // src/tool/tool-search.ts
3235
3331
  import {
3236
- createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4,
3237
- lazySchema as lazySchema15,
3238
- zodSchema as zodSchema15
3332
+ createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5,
3333
+ lazySchema as lazySchema16,
3334
+ zodSchema as zodSchema16
3239
3335
  } from "@ai-sdk/provider-utils";
3240
- import { z as z16 } from "zod/v4";
3241
- var toolSearchArgsSchema = lazySchema15(
3242
- () => zodSchema15(
3243
- z16.object({
3244
- execution: z16.enum(["server", "client"]).optional(),
3245
- description: z16.string().optional(),
3246
- parameters: z16.record(z16.string(), z16.unknown()).optional()
3336
+ import { z as z17 } from "zod/v4";
3337
+ var toolSearchArgsSchema = lazySchema16(
3338
+ () => zodSchema16(
3339
+ z17.object({
3340
+ execution: z17.enum(["server", "client"]).optional(),
3341
+ description: z17.string().optional(),
3342
+ parameters: z17.record(z17.string(), z17.unknown()).optional()
3247
3343
  })
3248
3344
  )
3249
3345
  );
3250
- var toolSearchInputSchema = lazySchema15(
3251
- () => zodSchema15(
3252
- z16.object({
3253
- arguments: z16.unknown().optional(),
3254
- call_id: z16.string().nullish()
3346
+ var toolSearchInputSchema = lazySchema16(
3347
+ () => zodSchema16(
3348
+ z17.object({
3349
+ arguments: z17.unknown().optional(),
3350
+ call_id: z17.string().nullish()
3255
3351
  })
3256
3352
  )
3257
3353
  );
3258
- var toolSearchOutputSchema = lazySchema15(
3259
- () => zodSchema15(
3260
- z16.object({
3261
- tools: z16.array(z16.record(z16.string(), z16.unknown()))
3354
+ var toolSearchOutputSchema = lazySchema16(
3355
+ () => zodSchema16(
3356
+ z17.object({
3357
+ tools: z17.array(z17.record(z17.string(), z17.unknown()))
3262
3358
  })
3263
3359
  )
3264
3360
  );
3265
- var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
3361
+ var toolSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
3266
3362
  id: "openai.tool_search",
3267
3363
  inputSchema: toolSearchInputSchema,
3268
3364
  outputSchema: toolSearchOutputSchema
@@ -3293,9 +3389,10 @@ async function convertToOpenAIResponsesInput({
3293
3389
  hasLocalShellTool = false,
3294
3390
  hasShellTool = false,
3295
3391
  hasApplyPatchTool = false,
3392
+ hasComputerTool = false,
3296
3393
  customProviderToolNames
3297
3394
  }) {
3298
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
3395
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
3299
3396
  let input = [];
3300
3397
  const warnings = [];
3301
3398
  const processedApprovalIds = /* @__PURE__ */ new Set();
@@ -3519,7 +3616,7 @@ async function convertToOpenAIResponsesInput({
3519
3616
  if (hasPreviousResponseId && store && id != null) {
3520
3617
  break;
3521
3618
  }
3522
- const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
3619
+ const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === "local_shell" || hasShellTool && resolvedToolName === "shell" || hasApplyPatchTool && resolvedToolName === "apply_patch" || hasComputerTool && resolvedToolName === "computer" || ((_m = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _m : false);
3523
3620
  if (store && id != null && isProviderDefinedToolCall) {
3524
3621
  input.push({ type: "item_reference", id });
3525
3622
  break;
@@ -3576,6 +3673,53 @@ async function convertToOpenAIResponsesInput({
3576
3673
  });
3577
3674
  break;
3578
3675
  }
3676
+ if (hasComputerTool && resolvedToolName === "computer") {
3677
+ const parsedInput = await validateTypes({
3678
+ value: part.input,
3679
+ schema: computerInputSchema
3680
+ });
3681
+ input.push({
3682
+ type: "computer_call",
3683
+ call_id: part.toolCallId,
3684
+ id,
3685
+ status: parsedInput.status,
3686
+ actions: parsedInput.actions.map((action) => {
3687
+ switch (action.type) {
3688
+ case "click":
3689
+ case "double_click":
3690
+ case "move":
3691
+ return {
3692
+ ...action,
3693
+ keys: action.keys
3694
+ };
3695
+ case "drag":
3696
+ return {
3697
+ ...action,
3698
+ keys: action.keys
3699
+ };
3700
+ case "scroll":
3701
+ return {
3702
+ type: "scroll",
3703
+ x: action.x,
3704
+ y: action.y,
3705
+ scroll_x: action.scrollX,
3706
+ scroll_y: action.scrollY,
3707
+ keys: action.keys
3708
+ };
3709
+ default:
3710
+ return action;
3711
+ }
3712
+ }),
3713
+ pending_safety_checks: parsedInput.pendingSafetyChecks.map(
3714
+ (safetyCheck) => ({
3715
+ id: safetyCheck.id,
3716
+ code: safetyCheck.code,
3717
+ message: safetyCheck.message
3718
+ })
3719
+ )
3720
+ });
3721
+ break;
3722
+ }
3579
3723
  if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
3580
3724
  input.push({
3581
3725
  type: "custom_tool_call",
@@ -3846,6 +3990,28 @@ async function convertToOpenAIResponsesInput({
3846
3990
  });
3847
3991
  continue;
3848
3992
  }
3993
+ if (hasComputerTool && resolvedToolName === "computer" && output.type === "json") {
3994
+ const parsedOutput = await validateTypes({
3995
+ value: output.value,
3996
+ schema: computerOutputSchema
3997
+ });
3998
+ input.push({
3999
+ type: "computer_call_output",
4000
+ call_id: part.toolCallId,
4001
+ output: {
4002
+ type: "computer_screenshot",
4003
+ image_url: parsedOutput.output.imageUrl,
4004
+ file_id: parsedOutput.output.fileId,
4005
+ detail: parsedOutput.output.detail
4006
+ },
4007
+ acknowledged_safety_checks: (_w = parsedOutput.acknowledgedSafetyChecks) == null ? void 0 : _w.map((safetyCheck) => ({
4008
+ id: safetyCheck.id,
4009
+ code: safetyCheck.code,
4010
+ message: safetyCheck.message
4011
+ }))
4012
+ });
4013
+ continue;
4014
+ }
3849
4015
  if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {
3850
4016
  let outputValue;
3851
4017
  switch (output.type) {
@@ -3854,7 +4020,7 @@ async function convertToOpenAIResponsesInput({
3854
4020
  outputValue = output.value;
3855
4021
  break;
3856
4022
  case "execution-denied":
3857
- outputValue = (_w = output.reason) != null ? _w : "Tool call execution denied.";
4023
+ outputValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
3858
4024
  break;
3859
4025
  case "json":
3860
4026
  case "error-json":
@@ -3953,7 +4119,7 @@ async function convertToOpenAIResponsesInput({
3953
4119
  contentValue = output.value;
3954
4120
  break;
3955
4121
  case "execution-denied":
3956
- contentValue = (_x = output.reason) != null ? _x : "Tool call execution denied.";
4122
+ contentValue = (_y = output.reason) != null ? _y : "Tool call execution denied.";
3957
4123
  break;
3958
4124
  case "json":
3959
4125
  case "error-json":
@@ -4065,9 +4231,9 @@ async function convertToOpenAIResponsesInput({
4065
4231
  }
4066
4232
  return { input, warnings };
4067
4233
  }
4068
- var openaiResponsesReasoningProviderOptionsSchema = z17.object({
4069
- itemId: z17.string().nullish(),
4070
- reasoningEncryptedContent: z17.string().nullish()
4234
+ var openaiResponsesReasoningProviderOptionsSchema = z18.object({
4235
+ itemId: z18.string().nullish(),
4236
+ reasoningEncryptedContent: z18.string().nullish()
4071
4237
  });
4072
4238
 
4073
4239
  // src/responses/map-openai-responses-finish-reason.ts
@@ -4090,589 +4256,643 @@ function mapOpenAIResponseFinishReason({
4090
4256
 
4091
4257
  // src/responses/openai-responses-api.ts
4092
4258
  import {
4093
- lazySchema as lazySchema16,
4094
- zodSchema as zodSchema16
4259
+ lazySchema as lazySchema17,
4260
+ zodSchema as zodSchema17
4095
4261
  } from "@ai-sdk/provider-utils";
4096
- import { z as z18 } from "zod/v4";
4097
- var jsonValueSchema = z18.lazy(
4098
- () => z18.union([
4099
- z18.string(),
4100
- z18.number(),
4101
- z18.boolean(),
4102
- z18.null(),
4103
- z18.array(jsonValueSchema),
4104
- z18.record(z18.string(), jsonValueSchema.optional())
4262
+ import { z as z19 } from "zod/v4";
4263
+ var jsonValueSchema = z19.lazy(
4264
+ () => z19.union([
4265
+ z19.string(),
4266
+ z19.number(),
4267
+ z19.boolean(),
4268
+ z19.null(),
4269
+ z19.array(jsonValueSchema),
4270
+ z19.record(z19.string(), jsonValueSchema.optional())
4105
4271
  ])
4106
4272
  );
4107
- var openaiResponsesNestedErrorChunkSchema = z18.object({
4108
- type: z18.literal("error"),
4109
- sequence_number: z18.number(),
4110
- error: z18.object({
4111
- type: z18.string(),
4112
- code: z18.string(),
4113
- message: z18.string(),
4114
- param: z18.string().nullish()
4273
+ var openaiResponsesComputerSafetyCheckSchema = z19.object({
4274
+ id: z19.string(),
4275
+ code: z19.string().nullish(),
4276
+ message: z19.string().nullish()
4277
+ });
4278
+ var openaiResponsesComputerActionSchema = z19.discriminatedUnion("type", [
4279
+ z19.object({
4280
+ type: z19.literal("click"),
4281
+ button: z19.enum(["left", "right", "wheel", "back", "forward"]),
4282
+ x: z19.number(),
4283
+ y: z19.number(),
4284
+ keys: z19.array(z19.string()).nullish()
4285
+ }),
4286
+ z19.object({
4287
+ type: z19.literal("double_click"),
4288
+ x: z19.number(),
4289
+ y: z19.number(),
4290
+ keys: z19.array(z19.string()).nullish()
4291
+ }),
4292
+ z19.object({
4293
+ type: z19.literal("drag"),
4294
+ path: z19.array(z19.object({ x: z19.number(), y: z19.number() })),
4295
+ keys: z19.array(z19.string()).nullish()
4296
+ }),
4297
+ z19.object({
4298
+ type: z19.literal("keypress"),
4299
+ keys: z19.array(z19.string())
4300
+ }),
4301
+ z19.object({
4302
+ type: z19.literal("move"),
4303
+ x: z19.number(),
4304
+ y: z19.number(),
4305
+ keys: z19.array(z19.string()).nullish()
4306
+ }),
4307
+ z19.object({
4308
+ type: z19.literal("screenshot")
4309
+ }),
4310
+ z19.object({
4311
+ type: z19.literal("scroll"),
4312
+ x: z19.number(),
4313
+ y: z19.number(),
4314
+ scroll_x: z19.number(),
4315
+ scroll_y: z19.number(),
4316
+ keys: z19.array(z19.string()).nullish()
4317
+ }),
4318
+ z19.object({
4319
+ type: z19.literal("type"),
4320
+ text: z19.string()
4321
+ }),
4322
+ z19.object({
4323
+ type: z19.literal("wait")
4115
4324
  })
4325
+ ]);
4326
+ var openaiResponsesComputerCallSchema = z19.object({
4327
+ type: z19.literal("computer_call"),
4328
+ id: z19.string(),
4329
+ call_id: z19.string().nullish(),
4330
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4331
+ action: openaiResponsesComputerActionSchema.nullish(),
4332
+ actions: z19.array(openaiResponsesComputerActionSchema).nullish(),
4333
+ pending_safety_checks: z19.array(openaiResponsesComputerSafetyCheckSchema).nullish()
4116
4334
  });
4117
- var openaiResponsesErrorChunkSchema = z18.object({
4118
- type: z18.literal("error"),
4119
- sequence_number: z18.number(),
4120
- code: z18.string().nullish(),
4121
- message: z18.string(),
4122
- param: z18.string().nullish()
4335
+ var openaiResponsesNestedErrorChunkSchema = z19.object({
4336
+ type: z19.literal("error"),
4337
+ sequence_number: z19.number(),
4338
+ error: z19.object({
4339
+ type: z19.string(),
4340
+ code: z19.string(),
4341
+ message: z19.string(),
4342
+ param: z19.string().nullish()
4343
+ })
4123
4344
  });
4124
- var openaiResponsesChunkSchema = lazySchema16(
4125
- () => zodSchema16(
4126
- z18.union([
4127
- z18.object({
4128
- type: z18.literal("response.output_text.delta"),
4129
- item_id: z18.string(),
4130
- delta: z18.string(),
4131
- logprobs: z18.array(
4132
- z18.object({
4133
- token: z18.string(),
4134
- logprob: z18.number(),
4135
- top_logprobs: z18.array(
4136
- z18.object({
4137
- token: z18.string(),
4138
- logprob: z18.number()
4345
+ var openaiResponsesErrorChunkSchema = z19.object({
4346
+ type: z19.literal("error"),
4347
+ sequence_number: z19.number(),
4348
+ code: z19.string().nullish(),
4349
+ message: z19.string(),
4350
+ param: z19.string().nullish()
4351
+ });
4352
+ var openaiResponsesChunkSchema = lazySchema17(
4353
+ () => zodSchema17(
4354
+ z19.union([
4355
+ z19.object({
4356
+ type: z19.literal("response.output_text.delta"),
4357
+ item_id: z19.string(),
4358
+ delta: z19.string(),
4359
+ logprobs: z19.array(
4360
+ z19.object({
4361
+ token: z19.string(),
4362
+ logprob: z19.number(),
4363
+ top_logprobs: z19.array(
4364
+ z19.object({
4365
+ token: z19.string(),
4366
+ logprob: z19.number()
4139
4367
  })
4140
4368
  )
4141
4369
  })
4142
4370
  ).nullish()
4143
4371
  }),
4144
- z18.object({
4145
- type: z18.enum(["response.completed", "response.incomplete"]),
4146
- response: z18.object({
4147
- incomplete_details: z18.object({ reason: z18.string() }).nullish(),
4148
- usage: z18.object({
4149
- input_tokens: z18.number(),
4150
- input_tokens_details: z18.object({
4151
- cached_tokens: z18.number().nullish(),
4152
- cache_write_tokens: z18.number().nullish(),
4153
- orchestration_input_tokens: z18.number().nullish(),
4154
- orchestration_input_cached_tokens: z18.number().nullish()
4372
+ z19.object({
4373
+ type: z19.enum(["response.completed", "response.incomplete"]),
4374
+ response: z19.object({
4375
+ incomplete_details: z19.object({ reason: z19.string() }).nullish(),
4376
+ usage: z19.object({
4377
+ input_tokens: z19.number(),
4378
+ input_tokens_details: z19.object({
4379
+ cached_tokens: z19.number().nullish(),
4380
+ cache_write_tokens: z19.number().nullish(),
4381
+ orchestration_input_tokens: z19.number().nullish(),
4382
+ orchestration_input_cached_tokens: z19.number().nullish()
4155
4383
  }).nullish(),
4156
- output_tokens: z18.number(),
4157
- output_tokens_details: z18.object({
4158
- reasoning_tokens: z18.number().nullish(),
4159
- orchestration_output_tokens: z18.number().nullish()
4384
+ output_tokens: z19.number(),
4385
+ output_tokens_details: z19.object({
4386
+ reasoning_tokens: z19.number().nullish(),
4387
+ orchestration_output_tokens: z19.number().nullish()
4160
4388
  }).nullish()
4161
4389
  }),
4162
- reasoning: z18.object({
4163
- context: z18.string().nullish()
4390
+ reasoning: z19.object({
4391
+ context: z19.string().nullish()
4164
4392
  }).nullish(),
4165
- service_tier: z18.string().nullish()
4393
+ service_tier: z19.string().nullish()
4166
4394
  })
4167
4395
  }),
4168
- z18.object({
4169
- type: z18.literal("response.failed"),
4170
- sequence_number: z18.number(),
4171
- response: z18.object({
4172
- error: z18.object({
4173
- code: z18.string().nullish(),
4174
- message: z18.string()
4396
+ z19.object({
4397
+ type: z19.literal("response.failed"),
4398
+ sequence_number: z19.number(),
4399
+ response: z19.object({
4400
+ error: z19.object({
4401
+ code: z19.string().nullish(),
4402
+ message: z19.string()
4175
4403
  }).nullish(),
4176
- incomplete_details: z18.object({ reason: z18.string() }).nullish(),
4177
- usage: z18.object({
4178
- input_tokens: z18.number(),
4179
- input_tokens_details: z18.object({
4180
- cached_tokens: z18.number().nullish(),
4181
- cache_write_tokens: z18.number().nullish(),
4182
- orchestration_input_tokens: z18.number().nullish(),
4183
- orchestration_input_cached_tokens: z18.number().nullish()
4404
+ incomplete_details: z19.object({ reason: z19.string() }).nullish(),
4405
+ usage: z19.object({
4406
+ input_tokens: z19.number(),
4407
+ input_tokens_details: z19.object({
4408
+ cached_tokens: z19.number().nullish(),
4409
+ cache_write_tokens: z19.number().nullish(),
4410
+ orchestration_input_tokens: z19.number().nullish(),
4411
+ orchestration_input_cached_tokens: z19.number().nullish()
4184
4412
  }).nullish(),
4185
- output_tokens: z18.number(),
4186
- output_tokens_details: z18.object({
4187
- reasoning_tokens: z18.number().nullish(),
4188
- orchestration_output_tokens: z18.number().nullish()
4413
+ output_tokens: z19.number(),
4414
+ output_tokens_details: z19.object({
4415
+ reasoning_tokens: z19.number().nullish(),
4416
+ orchestration_output_tokens: z19.number().nullish()
4189
4417
  }).nullish()
4190
4418
  }).nullish(),
4191
- reasoning: z18.object({
4192
- context: z18.string().nullish()
4419
+ reasoning: z19.object({
4420
+ context: z19.string().nullish()
4193
4421
  }).nullish(),
4194
- service_tier: z18.string().nullish()
4422
+ service_tier: z19.string().nullish()
4195
4423
  })
4196
4424
  }),
4197
- z18.object({
4198
- type: z18.literal("response.created"),
4199
- response: z18.object({
4200
- id: z18.string(),
4201
- created_at: z18.number(),
4202
- model: z18.string(),
4203
- service_tier: z18.string().nullish()
4425
+ z19.object({
4426
+ type: z19.literal("response.created"),
4427
+ response: z19.object({
4428
+ id: z19.string(),
4429
+ created_at: z19.number(),
4430
+ model: z19.string(),
4431
+ service_tier: z19.string().nullish()
4204
4432
  })
4205
4433
  }),
4206
- z18.object({
4207
- type: z18.literal("response.output_item.added"),
4208
- output_index: z18.number(),
4209
- item: z18.discriminatedUnion("type", [
4210
- z18.object({
4211
- type: z18.literal("message"),
4212
- id: z18.string(),
4213
- phase: z18.enum(["commentary", "final_answer"]).nullish()
4214
- }),
4215
- z18.object({
4216
- type: z18.literal("reasoning"),
4217
- id: z18.string(),
4218
- encrypted_content: z18.string().nullish()
4434
+ z19.object({
4435
+ type: z19.literal("response.output_item.added"),
4436
+ output_index: z19.number(),
4437
+ item: z19.discriminatedUnion("type", [
4438
+ z19.object({
4439
+ type: z19.literal("message"),
4440
+ id: z19.string(),
4441
+ phase: z19.enum(["commentary", "final_answer"]).nullish()
4219
4442
  }),
4220
- z18.object({
4221
- type: z18.literal("function_call"),
4222
- id: z18.string(),
4223
- call_id: z18.string(),
4224
- name: z18.string(),
4225
- arguments: z18.string(),
4226
- namespace: z18.string().nullish()
4443
+ z19.object({
4444
+ type: z19.literal("reasoning"),
4445
+ id: z19.string(),
4446
+ encrypted_content: z19.string().nullish()
4227
4447
  }),
4228
- z18.object({
4229
- type: z18.literal("web_search_call"),
4230
- id: z18.string(),
4231
- status: z18.string()
4448
+ z19.object({
4449
+ type: z19.literal("function_call"),
4450
+ id: z19.string(),
4451
+ call_id: z19.string(),
4452
+ name: z19.string(),
4453
+ arguments: z19.string(),
4454
+ namespace: z19.string().nullish()
4232
4455
  }),
4233
- z18.object({
4234
- type: z18.literal("computer_call"),
4235
- id: z18.string(),
4236
- status: z18.string()
4456
+ z19.object({
4457
+ type: z19.literal("web_search_call"),
4458
+ id: z19.string(),
4459
+ status: z19.string()
4237
4460
  }),
4238
- z18.object({
4239
- type: z18.literal("file_search_call"),
4240
- id: z18.string()
4461
+ openaiResponsesComputerCallSchema,
4462
+ z19.object({
4463
+ type: z19.literal("file_search_call"),
4464
+ id: z19.string()
4241
4465
  }),
4242
- z18.object({
4243
- type: z18.literal("image_generation_call"),
4244
- id: z18.string()
4466
+ z19.object({
4467
+ type: z19.literal("image_generation_call"),
4468
+ id: z19.string()
4245
4469
  }),
4246
- z18.object({
4247
- type: z18.literal("code_interpreter_call"),
4248
- id: z18.string(),
4249
- container_id: z18.string(),
4250
- code: z18.string().nullable(),
4251
- outputs: z18.array(
4252
- z18.discriminatedUnion("type", [
4253
- z18.object({ type: z18.literal("logs"), logs: z18.string() }),
4254
- z18.object({ type: z18.literal("image"), url: z18.string() })
4470
+ z19.object({
4471
+ type: z19.literal("code_interpreter_call"),
4472
+ id: z19.string(),
4473
+ container_id: z19.string(),
4474
+ code: z19.string().nullable(),
4475
+ outputs: z19.array(
4476
+ z19.discriminatedUnion("type", [
4477
+ z19.object({ type: z19.literal("logs"), logs: z19.string() }),
4478
+ z19.object({ type: z19.literal("image"), url: z19.string() })
4255
4479
  ])
4256
4480
  ).nullable(),
4257
- status: z18.string()
4481
+ status: z19.string()
4258
4482
  }),
4259
- z18.object({
4260
- type: z18.literal("mcp_call"),
4261
- id: z18.string(),
4262
- status: z18.string(),
4263
- approval_request_id: z18.string().nullish()
4483
+ z19.object({
4484
+ type: z19.literal("mcp_call"),
4485
+ id: z19.string(),
4486
+ status: z19.string(),
4487
+ approval_request_id: z19.string().nullish()
4264
4488
  }),
4265
- z18.object({
4266
- type: z18.literal("mcp_list_tools"),
4267
- id: z18.string()
4489
+ z19.object({
4490
+ type: z19.literal("mcp_list_tools"),
4491
+ id: z19.string()
4268
4492
  }),
4269
- z18.object({
4270
- type: z18.literal("mcp_approval_request"),
4271
- id: z18.string()
4493
+ z19.object({
4494
+ type: z19.literal("mcp_approval_request"),
4495
+ id: z19.string()
4272
4496
  }),
4273
- z18.object({
4274
- type: z18.literal("apply_patch_call"),
4275
- id: z18.string(),
4276
- call_id: z18.string(),
4277
- status: z18.enum(["in_progress", "completed"]),
4278
- operation: z18.discriminatedUnion("type", [
4279
- z18.object({
4280
- type: z18.literal("create_file"),
4281
- path: z18.string(),
4282
- diff: z18.string()
4497
+ z19.object({
4498
+ type: z19.literal("apply_patch_call"),
4499
+ id: z19.string(),
4500
+ call_id: z19.string(),
4501
+ status: z19.enum(["in_progress", "completed"]),
4502
+ operation: z19.discriminatedUnion("type", [
4503
+ z19.object({
4504
+ type: z19.literal("create_file"),
4505
+ path: z19.string(),
4506
+ diff: z19.string()
4283
4507
  }),
4284
- z18.object({
4285
- type: z18.literal("delete_file"),
4286
- path: z18.string()
4508
+ z19.object({
4509
+ type: z19.literal("delete_file"),
4510
+ path: z19.string()
4287
4511
  }),
4288
- z18.object({
4289
- type: z18.literal("update_file"),
4290
- path: z18.string(),
4291
- diff: z18.string()
4512
+ z19.object({
4513
+ type: z19.literal("update_file"),
4514
+ path: z19.string(),
4515
+ diff: z19.string()
4292
4516
  })
4293
4517
  ])
4294
4518
  }),
4295
- z18.object({
4296
- type: z18.literal("custom_tool_call"),
4297
- id: z18.string(),
4298
- call_id: z18.string(),
4299
- name: z18.string(),
4300
- input: z18.string()
4519
+ z19.object({
4520
+ type: z19.literal("custom_tool_call"),
4521
+ id: z19.string(),
4522
+ call_id: z19.string(),
4523
+ name: z19.string(),
4524
+ input: z19.string()
4301
4525
  }),
4302
- z18.object({
4303
- type: z18.literal("shell_call"),
4304
- id: z18.string(),
4305
- call_id: z18.string(),
4306
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4307
- action: z18.object({
4308
- commands: z18.array(z18.string())
4526
+ z19.object({
4527
+ type: z19.literal("shell_call"),
4528
+ id: z19.string(),
4529
+ call_id: z19.string(),
4530
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4531
+ action: z19.object({
4532
+ commands: z19.array(z19.string())
4309
4533
  })
4310
4534
  }),
4311
- z18.object({
4312
- type: z18.literal("compaction"),
4313
- id: z18.string(),
4314
- encrypted_content: z18.string().nullish()
4535
+ z19.object({
4536
+ type: z19.literal("compaction"),
4537
+ id: z19.string(),
4538
+ encrypted_content: z19.string().nullish()
4315
4539
  }),
4316
- z18.object({
4317
- type: z18.literal("shell_call_output"),
4318
- id: z18.string(),
4319
- call_id: z18.string(),
4320
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4321
- output: z18.array(
4322
- z18.object({
4323
- stdout: z18.string(),
4324
- stderr: z18.string(),
4325
- outcome: z18.discriminatedUnion("type", [
4326
- z18.object({ type: z18.literal("timeout") }),
4327
- z18.object({
4328
- type: z18.literal("exit"),
4329
- exit_code: z18.number()
4540
+ z19.object({
4541
+ type: z19.literal("shell_call_output"),
4542
+ id: z19.string(),
4543
+ call_id: z19.string(),
4544
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4545
+ output: z19.array(
4546
+ z19.object({
4547
+ stdout: z19.string(),
4548
+ stderr: z19.string(),
4549
+ outcome: z19.discriminatedUnion("type", [
4550
+ z19.object({ type: z19.literal("timeout") }),
4551
+ z19.object({
4552
+ type: z19.literal("exit"),
4553
+ exit_code: z19.number()
4330
4554
  })
4331
4555
  ])
4332
4556
  })
4333
4557
  )
4334
4558
  }),
4335
- z18.object({
4336
- type: z18.literal("tool_search_call"),
4337
- id: z18.string(),
4338
- execution: z18.enum(["server", "client"]),
4339
- call_id: z18.string().nullable(),
4340
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4341
- arguments: z18.unknown()
4559
+ z19.object({
4560
+ type: z19.literal("tool_search_call"),
4561
+ id: z19.string(),
4562
+ execution: z19.enum(["server", "client"]),
4563
+ call_id: z19.string().nullable(),
4564
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4565
+ arguments: z19.unknown()
4342
4566
  }),
4343
- z18.object({
4344
- type: z18.literal("tool_search_output"),
4345
- id: z18.string(),
4346
- execution: z18.enum(["server", "client"]),
4347
- call_id: z18.string().nullable(),
4348
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4349
- tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
4567
+ z19.object({
4568
+ type: z19.literal("tool_search_output"),
4569
+ id: z19.string(),
4570
+ execution: z19.enum(["server", "client"]),
4571
+ call_id: z19.string().nullable(),
4572
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4573
+ tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
4350
4574
  })
4351
4575
  ])
4352
4576
  }),
4353
- z18.object({
4354
- type: z18.literal("response.output_item.done"),
4355
- output_index: z18.number(),
4356
- item: z18.discriminatedUnion("type", [
4357
- z18.object({
4358
- type: z18.literal("message"),
4359
- id: z18.string(),
4360
- phase: z18.enum(["commentary", "final_answer"]).nullish()
4577
+ z19.object({
4578
+ type: z19.literal("response.output_item.done"),
4579
+ output_index: z19.number(),
4580
+ item: z19.discriminatedUnion("type", [
4581
+ z19.object({
4582
+ type: z19.literal("message"),
4583
+ id: z19.string(),
4584
+ phase: z19.enum(["commentary", "final_answer"]).nullish()
4361
4585
  }),
4362
- z18.object({
4363
- type: z18.literal("reasoning"),
4364
- id: z18.string(),
4365
- encrypted_content: z18.string().nullish()
4586
+ z19.object({
4587
+ type: z19.literal("reasoning"),
4588
+ id: z19.string(),
4589
+ encrypted_content: z19.string().nullish()
4366
4590
  }),
4367
- z18.object({
4368
- type: z18.literal("function_call"),
4369
- id: z18.string(),
4370
- call_id: z18.string(),
4371
- name: z18.string(),
4372
- arguments: z18.string(),
4373
- status: z18.literal("completed"),
4374
- namespace: z18.string().nullish()
4591
+ z19.object({
4592
+ type: z19.literal("function_call"),
4593
+ id: z19.string(),
4594
+ call_id: z19.string(),
4595
+ name: z19.string(),
4596
+ arguments: z19.string(),
4597
+ status: z19.literal("completed"),
4598
+ namespace: z19.string().nullish()
4375
4599
  }),
4376
- z18.object({
4377
- type: z18.literal("custom_tool_call"),
4378
- id: z18.string(),
4379
- call_id: z18.string(),
4380
- name: z18.string(),
4381
- input: z18.string(),
4382
- status: z18.literal("completed")
4600
+ z19.object({
4601
+ type: z19.literal("custom_tool_call"),
4602
+ id: z19.string(),
4603
+ call_id: z19.string(),
4604
+ name: z19.string(),
4605
+ input: z19.string(),
4606
+ status: z19.literal("completed")
4383
4607
  }),
4384
- z18.object({
4385
- type: z18.literal("code_interpreter_call"),
4386
- id: z18.string(),
4387
- code: z18.string().nullable(),
4388
- container_id: z18.string(),
4389
- outputs: z18.array(
4390
- z18.discriminatedUnion("type", [
4391
- z18.object({ type: z18.literal("logs"), logs: z18.string() }),
4392
- z18.object({ type: z18.literal("image"), url: z18.string() })
4608
+ z19.object({
4609
+ type: z19.literal("code_interpreter_call"),
4610
+ id: z19.string(),
4611
+ code: z19.string().nullable(),
4612
+ container_id: z19.string(),
4613
+ outputs: z19.array(
4614
+ z19.discriminatedUnion("type", [
4615
+ z19.object({ type: z19.literal("logs"), logs: z19.string() }),
4616
+ z19.object({ type: z19.literal("image"), url: z19.string() })
4393
4617
  ])
4394
4618
  ).nullable()
4395
4619
  }),
4396
- z18.object({
4397
- type: z18.literal("image_generation_call"),
4398
- id: z18.string(),
4399
- result: z18.string()
4620
+ z19.object({
4621
+ type: z19.literal("image_generation_call"),
4622
+ id: z19.string(),
4623
+ result: z19.string()
4400
4624
  }),
4401
- z18.object({
4402
- type: z18.literal("web_search_call"),
4403
- id: z18.string(),
4404
- status: z18.string(),
4405
- action: z18.discriminatedUnion("type", [
4406
- z18.object({
4407
- type: z18.literal("search"),
4408
- query: z18.string().nullish(),
4409
- queries: z18.array(z18.string()).nullish(),
4410
- sources: z18.array(
4411
- z18.discriminatedUnion("type", [
4412
- z18.object({ type: z18.literal("url"), url: z18.string() }),
4413
- z18.object({ type: z18.literal("api"), name: z18.string() })
4625
+ z19.object({
4626
+ type: z19.literal("web_search_call"),
4627
+ id: z19.string(),
4628
+ status: z19.string(),
4629
+ action: z19.discriminatedUnion("type", [
4630
+ z19.object({
4631
+ type: z19.literal("search"),
4632
+ query: z19.string().nullish(),
4633
+ queries: z19.array(z19.string()).nullish(),
4634
+ sources: z19.array(
4635
+ z19.discriminatedUnion("type", [
4636
+ z19.object({ type: z19.literal("url"), url: z19.string() }),
4637
+ z19.object({ type: z19.literal("api"), name: z19.string() })
4414
4638
  ])
4415
4639
  ).nullish()
4416
4640
  }),
4417
- z18.object({
4418
- type: z18.literal("open_page"),
4419
- url: z18.string().nullish()
4641
+ z19.object({
4642
+ type: z19.literal("open_page"),
4643
+ url: z19.string().nullish()
4420
4644
  }),
4421
- z18.object({
4422
- type: z18.literal("find_in_page"),
4423
- url: z18.string().nullish(),
4424
- pattern: z18.string().nullish()
4645
+ z19.object({
4646
+ type: z19.literal("find_in_page"),
4647
+ url: z19.string().nullish(),
4648
+ pattern: z19.string().nullish()
4425
4649
  })
4426
4650
  ]).nullish()
4427
4651
  }),
4428
- z18.object({
4429
- type: z18.literal("file_search_call"),
4430
- id: z18.string(),
4431
- queries: z18.array(z18.string()),
4432
- results: z18.array(
4433
- z18.object({
4434
- attributes: z18.record(
4435
- z18.string(),
4436
- z18.union([z18.string(), z18.number(), z18.boolean()])
4652
+ z19.object({
4653
+ type: z19.literal("file_search_call"),
4654
+ id: z19.string(),
4655
+ queries: z19.array(z19.string()),
4656
+ results: z19.array(
4657
+ z19.object({
4658
+ attributes: z19.record(
4659
+ z19.string(),
4660
+ z19.union([z19.string(), z19.number(), z19.boolean()])
4437
4661
  ),
4438
- file_id: z18.string(),
4439
- filename: z18.string(),
4440
- score: z18.number(),
4441
- text: z18.string()
4662
+ file_id: z19.string(),
4663
+ filename: z19.string(),
4664
+ score: z19.number(),
4665
+ text: z19.string()
4442
4666
  })
4443
4667
  ).nullish()
4444
4668
  }),
4445
- z18.object({
4446
- type: z18.literal("local_shell_call"),
4447
- id: z18.string(),
4448
- call_id: z18.string(),
4449
- action: z18.object({
4450
- type: z18.literal("exec"),
4451
- command: z18.array(z18.string()),
4452
- timeout_ms: z18.number().optional(),
4453
- user: z18.string().optional(),
4454
- working_directory: z18.string().optional(),
4455
- env: z18.record(z18.string(), z18.string()).optional()
4669
+ z19.object({
4670
+ type: z19.literal("local_shell_call"),
4671
+ id: z19.string(),
4672
+ call_id: z19.string(),
4673
+ action: z19.object({
4674
+ type: z19.literal("exec"),
4675
+ command: z19.array(z19.string()),
4676
+ timeout_ms: z19.number().optional(),
4677
+ user: z19.string().optional(),
4678
+ working_directory: z19.string().optional(),
4679
+ env: z19.record(z19.string(), z19.string()).optional()
4456
4680
  })
4457
4681
  }),
4458
- z18.object({
4459
- type: z18.literal("computer_call"),
4460
- id: z18.string(),
4461
- status: z18.literal("completed")
4462
- }),
4463
- z18.object({
4464
- type: z18.literal("mcp_call"),
4465
- id: z18.string(),
4466
- status: z18.string(),
4467
- arguments: z18.string(),
4468
- name: z18.string(),
4469
- server_label: z18.string(),
4470
- output: z18.string().nullish(),
4471
- error: z18.union([
4472
- z18.string(),
4473
- z18.object({
4474
- type: z18.string().optional(),
4475
- code: z18.union([z18.number(), z18.string()]).optional(),
4476
- message: z18.string().optional()
4682
+ openaiResponsesComputerCallSchema,
4683
+ z19.object({
4684
+ type: z19.literal("mcp_call"),
4685
+ id: z19.string(),
4686
+ status: z19.string(),
4687
+ arguments: z19.string(),
4688
+ name: z19.string(),
4689
+ server_label: z19.string(),
4690
+ output: z19.string().nullish(),
4691
+ error: z19.union([
4692
+ z19.string(),
4693
+ z19.object({
4694
+ type: z19.string().optional(),
4695
+ code: z19.union([z19.number(), z19.string()]).optional(),
4696
+ message: z19.string().optional()
4477
4697
  }).loose()
4478
4698
  ]).nullish(),
4479
- approval_request_id: z18.string().nullish()
4699
+ approval_request_id: z19.string().nullish()
4480
4700
  }),
4481
- z18.object({
4482
- type: z18.literal("mcp_list_tools"),
4483
- id: z18.string(),
4484
- server_label: z18.string(),
4485
- tools: z18.array(
4486
- z18.object({
4487
- name: z18.string(),
4488
- description: z18.string().optional(),
4489
- input_schema: z18.any(),
4490
- annotations: z18.record(z18.string(), z18.unknown()).optional()
4701
+ z19.object({
4702
+ type: z19.literal("mcp_list_tools"),
4703
+ id: z19.string(),
4704
+ server_label: z19.string(),
4705
+ tools: z19.array(
4706
+ z19.object({
4707
+ name: z19.string(),
4708
+ description: z19.string().optional(),
4709
+ input_schema: z19.any(),
4710
+ annotations: z19.record(z19.string(), z19.unknown()).optional()
4491
4711
  })
4492
4712
  ),
4493
- error: z18.union([
4494
- z18.string(),
4495
- z18.object({
4496
- type: z18.string().optional(),
4497
- code: z18.union([z18.number(), z18.string()]).optional(),
4498
- message: z18.string().optional()
4713
+ error: z19.union([
4714
+ z19.string(),
4715
+ z19.object({
4716
+ type: z19.string().optional(),
4717
+ code: z19.union([z19.number(), z19.string()]).optional(),
4718
+ message: z19.string().optional()
4499
4719
  }).loose()
4500
4720
  ]).optional()
4501
4721
  }),
4502
- z18.object({
4503
- type: z18.literal("mcp_approval_request"),
4504
- id: z18.string(),
4505
- server_label: z18.string(),
4506
- name: z18.string(),
4507
- arguments: z18.string(),
4508
- approval_request_id: z18.string().optional()
4722
+ z19.object({
4723
+ type: z19.literal("mcp_approval_request"),
4724
+ id: z19.string(),
4725
+ server_label: z19.string(),
4726
+ name: z19.string(),
4727
+ arguments: z19.string(),
4728
+ approval_request_id: z19.string().optional()
4509
4729
  }),
4510
- z18.object({
4511
- type: z18.literal("apply_patch_call"),
4512
- id: z18.string(),
4513
- call_id: z18.string(),
4514
- status: z18.enum(["in_progress", "completed"]),
4515
- operation: z18.discriminatedUnion("type", [
4516
- z18.object({
4517
- type: z18.literal("create_file"),
4518
- path: z18.string(),
4519
- diff: z18.string()
4730
+ z19.object({
4731
+ type: z19.literal("apply_patch_call"),
4732
+ id: z19.string(),
4733
+ call_id: z19.string(),
4734
+ status: z19.enum(["in_progress", "completed"]),
4735
+ operation: z19.discriminatedUnion("type", [
4736
+ z19.object({
4737
+ type: z19.literal("create_file"),
4738
+ path: z19.string(),
4739
+ diff: z19.string()
4520
4740
  }),
4521
- z18.object({
4522
- type: z18.literal("delete_file"),
4523
- path: z18.string()
4741
+ z19.object({
4742
+ type: z19.literal("delete_file"),
4743
+ path: z19.string()
4524
4744
  }),
4525
- z18.object({
4526
- type: z18.literal("update_file"),
4527
- path: z18.string(),
4528
- diff: z18.string()
4745
+ z19.object({
4746
+ type: z19.literal("update_file"),
4747
+ path: z19.string(),
4748
+ diff: z19.string()
4529
4749
  })
4530
4750
  ])
4531
4751
  }),
4532
- z18.object({
4533
- type: z18.literal("shell_call"),
4534
- id: z18.string(),
4535
- call_id: z18.string(),
4536
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4537
- action: z18.object({
4538
- commands: z18.array(z18.string())
4752
+ z19.object({
4753
+ type: z19.literal("shell_call"),
4754
+ id: z19.string(),
4755
+ call_id: z19.string(),
4756
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4757
+ action: z19.object({
4758
+ commands: z19.array(z19.string())
4539
4759
  })
4540
4760
  }),
4541
- z18.object({
4542
- type: z18.literal("compaction"),
4543
- id: z18.string(),
4544
- encrypted_content: z18.string()
4761
+ z19.object({
4762
+ type: z19.literal("compaction"),
4763
+ id: z19.string(),
4764
+ encrypted_content: z19.string()
4545
4765
  }),
4546
- z18.object({
4547
- type: z18.literal("shell_call_output"),
4548
- id: z18.string(),
4549
- call_id: z18.string(),
4550
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4551
- output: z18.array(
4552
- z18.object({
4553
- stdout: z18.string(),
4554
- stderr: z18.string(),
4555
- outcome: z18.discriminatedUnion("type", [
4556
- z18.object({ type: z18.literal("timeout") }),
4557
- z18.object({
4558
- type: z18.literal("exit"),
4559
- exit_code: z18.number()
4766
+ z19.object({
4767
+ type: z19.literal("shell_call_output"),
4768
+ id: z19.string(),
4769
+ call_id: z19.string(),
4770
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4771
+ output: z19.array(
4772
+ z19.object({
4773
+ stdout: z19.string(),
4774
+ stderr: z19.string(),
4775
+ outcome: z19.discriminatedUnion("type", [
4776
+ z19.object({ type: z19.literal("timeout") }),
4777
+ z19.object({
4778
+ type: z19.literal("exit"),
4779
+ exit_code: z19.number()
4560
4780
  })
4561
4781
  ])
4562
4782
  })
4563
4783
  )
4564
4784
  }),
4565
- z18.object({
4566
- type: z18.literal("tool_search_call"),
4567
- id: z18.string(),
4568
- execution: z18.enum(["server", "client"]),
4569
- call_id: z18.string().nullable(),
4570
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4571
- arguments: z18.unknown()
4785
+ z19.object({
4786
+ type: z19.literal("tool_search_call"),
4787
+ id: z19.string(),
4788
+ execution: z19.enum(["server", "client"]),
4789
+ call_id: z19.string().nullable(),
4790
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4791
+ arguments: z19.unknown()
4572
4792
  }),
4573
- z18.object({
4574
- type: z18.literal("tool_search_output"),
4575
- id: z18.string(),
4576
- execution: z18.enum(["server", "client"]),
4577
- call_id: z18.string().nullable(),
4578
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4579
- tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
4793
+ z19.object({
4794
+ type: z19.literal("tool_search_output"),
4795
+ id: z19.string(),
4796
+ execution: z19.enum(["server", "client"]),
4797
+ call_id: z19.string().nullable(),
4798
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
4799
+ tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
4580
4800
  })
4581
4801
  ])
4582
4802
  }),
4583
- z18.object({
4584
- type: z18.literal("response.function_call_arguments.delta"),
4585
- item_id: z18.string(),
4586
- output_index: z18.number(),
4587
- delta: z18.string()
4803
+ z19.object({
4804
+ type: z19.literal("response.function_call_arguments.delta"),
4805
+ item_id: z19.string(),
4806
+ output_index: z19.number(),
4807
+ delta: z19.string()
4588
4808
  }),
4589
- z18.object({
4590
- type: z18.literal("response.custom_tool_call_input.delta"),
4591
- item_id: z18.string(),
4592
- output_index: z18.number(),
4593
- delta: z18.string()
4809
+ z19.object({
4810
+ type: z19.literal("response.custom_tool_call_input.delta"),
4811
+ item_id: z19.string(),
4812
+ output_index: z19.number(),
4813
+ delta: z19.string()
4594
4814
  }),
4595
- z18.object({
4596
- type: z18.literal("response.image_generation_call.partial_image"),
4597
- item_id: z18.string(),
4598
- output_index: z18.number(),
4599
- partial_image_b64: z18.string()
4815
+ z19.object({
4816
+ type: z19.literal("response.image_generation_call.partial_image"),
4817
+ item_id: z19.string(),
4818
+ output_index: z19.number(),
4819
+ partial_image_b64: z19.string()
4600
4820
  }),
4601
- z18.object({
4602
- type: z18.literal("response.code_interpreter_call_code.delta"),
4603
- item_id: z18.string(),
4604
- output_index: z18.number(),
4605
- delta: z18.string()
4821
+ z19.object({
4822
+ type: z19.literal("response.code_interpreter_call_code.delta"),
4823
+ item_id: z19.string(),
4824
+ output_index: z19.number(),
4825
+ delta: z19.string()
4606
4826
  }),
4607
- z18.object({
4608
- type: z18.literal("response.code_interpreter_call_code.done"),
4609
- item_id: z18.string(),
4610
- output_index: z18.number(),
4611
- code: z18.string()
4827
+ z19.object({
4828
+ type: z19.literal("response.code_interpreter_call_code.done"),
4829
+ item_id: z19.string(),
4830
+ output_index: z19.number(),
4831
+ code: z19.string()
4612
4832
  }),
4613
- z18.object({
4614
- type: z18.literal("response.output_text.annotation.added"),
4615
- annotation: z18.discriminatedUnion("type", [
4616
- z18.object({
4617
- type: z18.literal("url_citation"),
4618
- start_index: z18.number(),
4619
- end_index: z18.number(),
4620
- url: z18.string(),
4621
- title: z18.string()
4833
+ z19.object({
4834
+ type: z19.literal("response.output_text.annotation.added"),
4835
+ annotation: z19.discriminatedUnion("type", [
4836
+ z19.object({
4837
+ type: z19.literal("url_citation"),
4838
+ start_index: z19.number(),
4839
+ end_index: z19.number(),
4840
+ url: z19.string(),
4841
+ title: z19.string()
4622
4842
  }),
4623
- z18.object({
4624
- type: z18.literal("file_citation"),
4625
- file_id: z18.string(),
4626
- filename: z18.string(),
4627
- index: z18.number()
4843
+ z19.object({
4844
+ type: z19.literal("file_citation"),
4845
+ file_id: z19.string(),
4846
+ filename: z19.string(),
4847
+ index: z19.number()
4628
4848
  }),
4629
- z18.object({
4630
- type: z18.literal("container_file_citation"),
4631
- container_id: z18.string(),
4632
- file_id: z18.string(),
4633
- filename: z18.string(),
4634
- start_index: z18.number(),
4635
- end_index: z18.number()
4849
+ z19.object({
4850
+ type: z19.literal("container_file_citation"),
4851
+ container_id: z19.string(),
4852
+ file_id: z19.string(),
4853
+ filename: z19.string(),
4854
+ start_index: z19.number(),
4855
+ end_index: z19.number()
4636
4856
  }),
4637
- z18.object({
4638
- type: z18.literal("file_path"),
4639
- file_id: z18.string(),
4640
- index: z18.number()
4857
+ z19.object({
4858
+ type: z19.literal("file_path"),
4859
+ file_id: z19.string(),
4860
+ index: z19.number()
4641
4861
  })
4642
4862
  ])
4643
4863
  }),
4644
- z18.object({
4645
- type: z18.literal("response.reasoning_summary_part.added"),
4646
- item_id: z18.string(),
4647
- summary_index: z18.number()
4864
+ z19.object({
4865
+ type: z19.literal("response.reasoning_summary_part.added"),
4866
+ item_id: z19.string(),
4867
+ summary_index: z19.number()
4648
4868
  }),
4649
- z18.object({
4650
- type: z18.literal("response.reasoning_summary_text.delta"),
4651
- item_id: z18.string(),
4652
- summary_index: z18.number(),
4653
- delta: z18.string()
4869
+ z19.object({
4870
+ type: z19.literal("response.reasoning_summary_text.delta"),
4871
+ item_id: z19.string(),
4872
+ summary_index: z19.number(),
4873
+ delta: z19.string()
4654
4874
  }),
4655
- z18.object({
4656
- type: z18.literal("response.reasoning_summary_part.done"),
4657
- item_id: z18.string(),
4658
- summary_index: z18.number()
4875
+ z19.object({
4876
+ type: z19.literal("response.reasoning_summary_part.done"),
4877
+ item_id: z19.string(),
4878
+ summary_index: z19.number()
4659
4879
  }),
4660
- z18.object({
4661
- type: z18.literal("response.apply_patch_call_operation_diff.delta"),
4662
- item_id: z18.string(),
4663
- output_index: z18.number(),
4664
- delta: z18.string(),
4665
- obfuscation: z18.string().nullish()
4880
+ z19.object({
4881
+ type: z19.literal("response.apply_patch_call_operation_diff.delta"),
4882
+ item_id: z19.string(),
4883
+ output_index: z19.number(),
4884
+ delta: z19.string(),
4885
+ obfuscation: z19.string().nullish()
4666
4886
  }),
4667
- z18.object({
4668
- type: z18.literal("response.apply_patch_call_operation_diff.done"),
4669
- item_id: z18.string(),
4670
- output_index: z18.number(),
4671
- diff: z18.string()
4887
+ z19.object({
4888
+ type: z19.literal("response.apply_patch_call_operation_diff.done"),
4889
+ item_id: z19.string(),
4890
+ output_index: z19.number(),
4891
+ diff: z19.string()
4672
4892
  }),
4673
4893
  openaiResponsesNestedErrorChunkSchema,
4674
4894
  openaiResponsesErrorChunkSchema,
4675
- z18.object({ type: z18.string() }).loose().transform((value) => ({
4895
+ z19.object({ type: z19.string() }).loose().transform((value) => ({
4676
4896
  type: "unknown_chunk",
4677
4897
  message: value.type
4678
4898
  }))
@@ -4680,319 +4900,315 @@ var openaiResponsesChunkSchema = lazySchema16(
4680
4900
  ])
4681
4901
  )
4682
4902
  );
4683
- var openaiResponsesResponseSchema = lazySchema16(
4684
- () => zodSchema16(
4685
- z18.object({
4686
- id: z18.string().optional(),
4687
- created_at: z18.number().optional(),
4688
- error: z18.object({
4689
- message: z18.string(),
4690
- type: z18.string(),
4691
- param: z18.string().nullish(),
4692
- code: z18.string()
4903
+ var openaiResponsesResponseSchema = lazySchema17(
4904
+ () => zodSchema17(
4905
+ z19.object({
4906
+ id: z19.string().optional(),
4907
+ created_at: z19.number().optional(),
4908
+ error: z19.object({
4909
+ message: z19.string(),
4910
+ type: z19.string(),
4911
+ param: z19.string().nullish(),
4912
+ code: z19.string()
4693
4913
  }).nullish(),
4694
- model: z18.string().optional(),
4695
- output: z18.array(
4696
- z18.discriminatedUnion("type", [
4697
- z18.object({
4698
- type: z18.literal("message"),
4699
- role: z18.literal("assistant"),
4700
- id: z18.string(),
4701
- phase: z18.enum(["commentary", "final_answer"]).nullish(),
4702
- content: z18.array(
4703
- z18.object({
4704
- type: z18.literal("output_text"),
4705
- text: z18.string(),
4706
- logprobs: z18.array(
4707
- z18.object({
4708
- token: z18.string(),
4709
- logprob: z18.number(),
4710
- top_logprobs: z18.array(
4711
- z18.object({
4712
- token: z18.string(),
4713
- logprob: z18.number()
4914
+ model: z19.string().optional(),
4915
+ output: z19.array(
4916
+ z19.discriminatedUnion("type", [
4917
+ z19.object({
4918
+ type: z19.literal("message"),
4919
+ role: z19.literal("assistant"),
4920
+ id: z19.string(),
4921
+ phase: z19.enum(["commentary", "final_answer"]).nullish(),
4922
+ content: z19.array(
4923
+ z19.object({
4924
+ type: z19.literal("output_text"),
4925
+ text: z19.string(),
4926
+ logprobs: z19.array(
4927
+ z19.object({
4928
+ token: z19.string(),
4929
+ logprob: z19.number(),
4930
+ top_logprobs: z19.array(
4931
+ z19.object({
4932
+ token: z19.string(),
4933
+ logprob: z19.number()
4714
4934
  })
4715
4935
  )
4716
4936
  })
4717
4937
  ).nullish(),
4718
- annotations: z18.array(
4719
- z18.discriminatedUnion("type", [
4720
- z18.object({
4721
- type: z18.literal("url_citation"),
4722
- start_index: z18.number(),
4723
- end_index: z18.number(),
4724
- url: z18.string(),
4725
- title: z18.string()
4938
+ annotations: z19.array(
4939
+ z19.discriminatedUnion("type", [
4940
+ z19.object({
4941
+ type: z19.literal("url_citation"),
4942
+ start_index: z19.number(),
4943
+ end_index: z19.number(),
4944
+ url: z19.string(),
4945
+ title: z19.string()
4726
4946
  }),
4727
- z18.object({
4728
- type: z18.literal("file_citation"),
4729
- file_id: z18.string(),
4730
- filename: z18.string(),
4731
- index: z18.number()
4947
+ z19.object({
4948
+ type: z19.literal("file_citation"),
4949
+ file_id: z19.string(),
4950
+ filename: z19.string(),
4951
+ index: z19.number()
4732
4952
  }),
4733
- z18.object({
4734
- type: z18.literal("container_file_citation"),
4735
- container_id: z18.string(),
4736
- file_id: z18.string(),
4737
- filename: z18.string(),
4738
- start_index: z18.number(),
4739
- end_index: z18.number()
4953
+ z19.object({
4954
+ type: z19.literal("container_file_citation"),
4955
+ container_id: z19.string(),
4956
+ file_id: z19.string(),
4957
+ filename: z19.string(),
4958
+ start_index: z19.number(),
4959
+ end_index: z19.number()
4740
4960
  }),
4741
- z18.object({
4742
- type: z18.literal("file_path"),
4743
- file_id: z18.string(),
4744
- index: z18.number()
4961
+ z19.object({
4962
+ type: z19.literal("file_path"),
4963
+ file_id: z19.string(),
4964
+ index: z19.number()
4745
4965
  })
4746
4966
  ])
4747
4967
  )
4748
4968
  })
4749
4969
  )
4750
4970
  }),
4751
- z18.object({
4752
- type: z18.literal("web_search_call"),
4753
- id: z18.string(),
4754
- status: z18.string(),
4755
- action: z18.discriminatedUnion("type", [
4756
- z18.object({
4757
- type: z18.literal("search"),
4758
- query: z18.string().nullish(),
4759
- queries: z18.array(z18.string()).nullish(),
4760
- sources: z18.array(
4761
- z18.discriminatedUnion("type", [
4762
- z18.object({ type: z18.literal("url"), url: z18.string() }),
4763
- z18.object({
4764
- type: z18.literal("api"),
4765
- name: z18.string()
4971
+ z19.object({
4972
+ type: z19.literal("web_search_call"),
4973
+ id: z19.string(),
4974
+ status: z19.string(),
4975
+ action: z19.discriminatedUnion("type", [
4976
+ z19.object({
4977
+ type: z19.literal("search"),
4978
+ query: z19.string().nullish(),
4979
+ queries: z19.array(z19.string()).nullish(),
4980
+ sources: z19.array(
4981
+ z19.discriminatedUnion("type", [
4982
+ z19.object({ type: z19.literal("url"), url: z19.string() }),
4983
+ z19.object({
4984
+ type: z19.literal("api"),
4985
+ name: z19.string()
4766
4986
  })
4767
4987
  ])
4768
4988
  ).nullish()
4769
4989
  }),
4770
- z18.object({
4771
- type: z18.literal("open_page"),
4772
- url: z18.string().nullish()
4990
+ z19.object({
4991
+ type: z19.literal("open_page"),
4992
+ url: z19.string().nullish()
4773
4993
  }),
4774
- z18.object({
4775
- type: z18.literal("find_in_page"),
4776
- url: z18.string().nullish(),
4777
- pattern: z18.string().nullish()
4994
+ z19.object({
4995
+ type: z19.literal("find_in_page"),
4996
+ url: z19.string().nullish(),
4997
+ pattern: z19.string().nullish()
4778
4998
  })
4779
4999
  ]).nullish()
4780
5000
  }),
4781
- z18.object({
4782
- type: z18.literal("file_search_call"),
4783
- id: z18.string(),
4784
- queries: z18.array(z18.string()),
4785
- results: z18.array(
4786
- z18.object({
4787
- attributes: z18.record(
4788
- z18.string(),
4789
- z18.union([z18.string(), z18.number(), z18.boolean()])
5001
+ z19.object({
5002
+ type: z19.literal("file_search_call"),
5003
+ id: z19.string(),
5004
+ queries: z19.array(z19.string()),
5005
+ results: z19.array(
5006
+ z19.object({
5007
+ attributes: z19.record(
5008
+ z19.string(),
5009
+ z19.union([z19.string(), z19.number(), z19.boolean()])
4790
5010
  ),
4791
- file_id: z18.string(),
4792
- filename: z18.string(),
4793
- score: z18.number(),
4794
- text: z18.string()
5011
+ file_id: z19.string(),
5012
+ filename: z19.string(),
5013
+ score: z19.number(),
5014
+ text: z19.string()
4795
5015
  })
4796
5016
  ).nullish()
4797
5017
  }),
4798
- z18.object({
4799
- type: z18.literal("code_interpreter_call"),
4800
- id: z18.string(),
4801
- code: z18.string().nullable(),
4802
- container_id: z18.string(),
4803
- outputs: z18.array(
4804
- z18.discriminatedUnion("type", [
4805
- z18.object({ type: z18.literal("logs"), logs: z18.string() }),
4806
- z18.object({ type: z18.literal("image"), url: z18.string() })
5018
+ z19.object({
5019
+ type: z19.literal("code_interpreter_call"),
5020
+ id: z19.string(),
5021
+ code: z19.string().nullable(),
5022
+ container_id: z19.string(),
5023
+ outputs: z19.array(
5024
+ z19.discriminatedUnion("type", [
5025
+ z19.object({ type: z19.literal("logs"), logs: z19.string() }),
5026
+ z19.object({ type: z19.literal("image"), url: z19.string() })
4807
5027
  ])
4808
5028
  ).nullable()
4809
5029
  }),
4810
- z18.object({
4811
- type: z18.literal("image_generation_call"),
4812
- id: z18.string(),
4813
- result: z18.string()
5030
+ z19.object({
5031
+ type: z19.literal("image_generation_call"),
5032
+ id: z19.string(),
5033
+ result: z19.string()
4814
5034
  }),
4815
- z18.object({
4816
- type: z18.literal("local_shell_call"),
4817
- id: z18.string(),
4818
- call_id: z18.string(),
4819
- action: z18.object({
4820
- type: z18.literal("exec"),
4821
- command: z18.array(z18.string()),
4822
- timeout_ms: z18.number().optional(),
4823
- user: z18.string().optional(),
4824
- working_directory: z18.string().optional(),
4825
- env: z18.record(z18.string(), z18.string()).optional()
5035
+ z19.object({
5036
+ type: z19.literal("local_shell_call"),
5037
+ id: z19.string(),
5038
+ call_id: z19.string(),
5039
+ action: z19.object({
5040
+ type: z19.literal("exec"),
5041
+ command: z19.array(z19.string()),
5042
+ timeout_ms: z19.number().optional(),
5043
+ user: z19.string().optional(),
5044
+ working_directory: z19.string().optional(),
5045
+ env: z19.record(z19.string(), z19.string()).optional()
4826
5046
  })
4827
5047
  }),
4828
- z18.object({
4829
- type: z18.literal("function_call"),
4830
- call_id: z18.string(),
4831
- name: z18.string(),
4832
- arguments: z18.string(),
4833
- id: z18.string(),
4834
- namespace: z18.string().nullish()
4835
- }),
4836
- z18.object({
4837
- type: z18.literal("custom_tool_call"),
4838
- call_id: z18.string(),
4839
- name: z18.string(),
4840
- input: z18.string(),
4841
- id: z18.string()
5048
+ z19.object({
5049
+ type: z19.literal("function_call"),
5050
+ call_id: z19.string(),
5051
+ name: z19.string(),
5052
+ arguments: z19.string(),
5053
+ id: z19.string(),
5054
+ namespace: z19.string().nullish()
4842
5055
  }),
4843
- z18.object({
4844
- type: z18.literal("computer_call"),
4845
- id: z18.string(),
4846
- status: z18.string().optional()
5056
+ z19.object({
5057
+ type: z19.literal("custom_tool_call"),
5058
+ call_id: z19.string(),
5059
+ name: z19.string(),
5060
+ input: z19.string(),
5061
+ id: z19.string()
4847
5062
  }),
4848
- z18.object({
4849
- type: z18.literal("reasoning"),
4850
- id: z18.string(),
4851
- encrypted_content: z18.string().nullish(),
4852
- summary: z18.array(
4853
- z18.object({
4854
- type: z18.literal("summary_text"),
4855
- text: z18.string()
5063
+ openaiResponsesComputerCallSchema,
5064
+ z19.object({
5065
+ type: z19.literal("reasoning"),
5066
+ id: z19.string(),
5067
+ encrypted_content: z19.string().nullish(),
5068
+ summary: z19.array(
5069
+ z19.object({
5070
+ type: z19.literal("summary_text"),
5071
+ text: z19.string()
4856
5072
  })
4857
5073
  )
4858
5074
  }),
4859
- z18.object({
4860
- type: z18.literal("mcp_call"),
4861
- id: z18.string(),
4862
- status: z18.string(),
4863
- arguments: z18.string(),
4864
- name: z18.string(),
4865
- server_label: z18.string(),
4866
- output: z18.string().nullish(),
4867
- error: z18.union([
4868
- z18.string(),
4869
- z18.object({
4870
- type: z18.string().optional(),
4871
- code: z18.union([z18.number(), z18.string()]).optional(),
4872
- message: z18.string().optional()
5075
+ z19.object({
5076
+ type: z19.literal("mcp_call"),
5077
+ id: z19.string(),
5078
+ status: z19.string(),
5079
+ arguments: z19.string(),
5080
+ name: z19.string(),
5081
+ server_label: z19.string(),
5082
+ output: z19.string().nullish(),
5083
+ error: z19.union([
5084
+ z19.string(),
5085
+ z19.object({
5086
+ type: z19.string().optional(),
5087
+ code: z19.union([z19.number(), z19.string()]).optional(),
5088
+ message: z19.string().optional()
4873
5089
  }).loose()
4874
5090
  ]).nullish(),
4875
- approval_request_id: z18.string().nullish()
5091
+ approval_request_id: z19.string().nullish()
4876
5092
  }),
4877
- z18.object({
4878
- type: z18.literal("mcp_list_tools"),
4879
- id: z18.string(),
4880
- server_label: z18.string(),
4881
- tools: z18.array(
4882
- z18.object({
4883
- name: z18.string(),
4884
- description: z18.string().optional(),
4885
- input_schema: z18.any(),
4886
- annotations: z18.record(z18.string(), z18.unknown()).optional()
5093
+ z19.object({
5094
+ type: z19.literal("mcp_list_tools"),
5095
+ id: z19.string(),
5096
+ server_label: z19.string(),
5097
+ tools: z19.array(
5098
+ z19.object({
5099
+ name: z19.string(),
5100
+ description: z19.string().optional(),
5101
+ input_schema: z19.any(),
5102
+ annotations: z19.record(z19.string(), z19.unknown()).optional()
4887
5103
  })
4888
5104
  ),
4889
- error: z18.union([
4890
- z18.string(),
4891
- z18.object({
4892
- type: z18.string().optional(),
4893
- code: z18.union([z18.number(), z18.string()]).optional(),
4894
- message: z18.string().optional()
5105
+ error: z19.union([
5106
+ z19.string(),
5107
+ z19.object({
5108
+ type: z19.string().optional(),
5109
+ code: z19.union([z19.number(), z19.string()]).optional(),
5110
+ message: z19.string().optional()
4895
5111
  }).loose()
4896
5112
  ]).optional()
4897
5113
  }),
4898
- z18.object({
4899
- type: z18.literal("mcp_approval_request"),
4900
- id: z18.string(),
4901
- server_label: z18.string(),
4902
- name: z18.string(),
4903
- arguments: z18.string(),
4904
- approval_request_id: z18.string().optional()
5114
+ z19.object({
5115
+ type: z19.literal("mcp_approval_request"),
5116
+ id: z19.string(),
5117
+ server_label: z19.string(),
5118
+ name: z19.string(),
5119
+ arguments: z19.string(),
5120
+ approval_request_id: z19.string().optional()
4905
5121
  }),
4906
- z18.object({
4907
- type: z18.literal("apply_patch_call"),
4908
- id: z18.string(),
4909
- call_id: z18.string(),
4910
- status: z18.enum(["in_progress", "completed"]),
4911
- operation: z18.discriminatedUnion("type", [
4912
- z18.object({
4913
- type: z18.literal("create_file"),
4914
- path: z18.string(),
4915
- diff: z18.string()
5122
+ z19.object({
5123
+ type: z19.literal("apply_patch_call"),
5124
+ id: z19.string(),
5125
+ call_id: z19.string(),
5126
+ status: z19.enum(["in_progress", "completed"]),
5127
+ operation: z19.discriminatedUnion("type", [
5128
+ z19.object({
5129
+ type: z19.literal("create_file"),
5130
+ path: z19.string(),
5131
+ diff: z19.string()
4916
5132
  }),
4917
- z18.object({
4918
- type: z18.literal("delete_file"),
4919
- path: z18.string()
5133
+ z19.object({
5134
+ type: z19.literal("delete_file"),
5135
+ path: z19.string()
4920
5136
  }),
4921
- z18.object({
4922
- type: z18.literal("update_file"),
4923
- path: z18.string(),
4924
- diff: z18.string()
5137
+ z19.object({
5138
+ type: z19.literal("update_file"),
5139
+ path: z19.string(),
5140
+ diff: z19.string()
4925
5141
  })
4926
5142
  ])
4927
5143
  }),
4928
- z18.object({
4929
- type: z18.literal("shell_call"),
4930
- id: z18.string(),
4931
- call_id: z18.string(),
4932
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4933
- action: z18.object({
4934
- commands: z18.array(z18.string())
5144
+ z19.object({
5145
+ type: z19.literal("shell_call"),
5146
+ id: z19.string(),
5147
+ call_id: z19.string(),
5148
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
5149
+ action: z19.object({
5150
+ commands: z19.array(z19.string())
4935
5151
  })
4936
5152
  }),
4937
- z18.object({
4938
- type: z18.literal("compaction"),
4939
- id: z18.string(),
4940
- encrypted_content: z18.string()
5153
+ z19.object({
5154
+ type: z19.literal("compaction"),
5155
+ id: z19.string(),
5156
+ encrypted_content: z19.string()
4941
5157
  }),
4942
- z18.object({
4943
- type: z18.literal("shell_call_output"),
4944
- id: z18.string(),
4945
- call_id: z18.string(),
4946
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4947
- output: z18.array(
4948
- z18.object({
4949
- stdout: z18.string(),
4950
- stderr: z18.string(),
4951
- outcome: z18.discriminatedUnion("type", [
4952
- z18.object({ type: z18.literal("timeout") }),
4953
- z18.object({
4954
- type: z18.literal("exit"),
4955
- exit_code: z18.number()
5158
+ z19.object({
5159
+ type: z19.literal("shell_call_output"),
5160
+ id: z19.string(),
5161
+ call_id: z19.string(),
5162
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
5163
+ output: z19.array(
5164
+ z19.object({
5165
+ stdout: z19.string(),
5166
+ stderr: z19.string(),
5167
+ outcome: z19.discriminatedUnion("type", [
5168
+ z19.object({ type: z19.literal("timeout") }),
5169
+ z19.object({
5170
+ type: z19.literal("exit"),
5171
+ exit_code: z19.number()
4956
5172
  })
4957
5173
  ])
4958
5174
  })
4959
5175
  )
4960
5176
  }),
4961
- z18.object({
4962
- type: z18.literal("tool_search_call"),
4963
- id: z18.string(),
4964
- execution: z18.enum(["server", "client"]),
4965
- call_id: z18.string().nullable(),
4966
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4967
- arguments: z18.unknown()
5177
+ z19.object({
5178
+ type: z19.literal("tool_search_call"),
5179
+ id: z19.string(),
5180
+ execution: z19.enum(["server", "client"]),
5181
+ call_id: z19.string().nullable(),
5182
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
5183
+ arguments: z19.unknown()
4968
5184
  }),
4969
- z18.object({
4970
- type: z18.literal("tool_search_output"),
4971
- id: z18.string(),
4972
- execution: z18.enum(["server", "client"]),
4973
- call_id: z18.string().nullable(),
4974
- status: z18.enum(["in_progress", "completed", "incomplete"]),
4975
- tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
5185
+ z19.object({
5186
+ type: z19.literal("tool_search_output"),
5187
+ id: z19.string(),
5188
+ execution: z19.enum(["server", "client"]),
5189
+ call_id: z19.string().nullable(),
5190
+ status: z19.enum(["in_progress", "completed", "incomplete"]),
5191
+ tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
4976
5192
  })
4977
5193
  ])
4978
5194
  ).optional(),
4979
- service_tier: z18.string().nullish(),
4980
- reasoning: z18.object({
4981
- context: z18.string().nullish()
5195
+ service_tier: z19.string().nullish(),
5196
+ reasoning: z19.object({
5197
+ context: z19.string().nullish()
4982
5198
  }).nullish(),
4983
- incomplete_details: z18.object({ reason: z18.string() }).nullish(),
4984
- usage: z18.object({
4985
- input_tokens: z18.number(),
4986
- input_tokens_details: z18.object({
4987
- cached_tokens: z18.number().nullish(),
4988
- cache_write_tokens: z18.number().nullish(),
4989
- orchestration_input_tokens: z18.number().nullish(),
4990
- orchestration_input_cached_tokens: z18.number().nullish()
5199
+ incomplete_details: z19.object({ reason: z19.string() }).nullish(),
5200
+ usage: z19.object({
5201
+ input_tokens: z19.number(),
5202
+ input_tokens_details: z19.object({
5203
+ cached_tokens: z19.number().nullish(),
5204
+ cache_write_tokens: z19.number().nullish(),
5205
+ orchestration_input_tokens: z19.number().nullish(),
5206
+ orchestration_input_cached_tokens: z19.number().nullish()
4991
5207
  }).nullish(),
4992
- output_tokens: z18.number(),
4993
- output_tokens_details: z18.object({
4994
- reasoning_tokens: z18.number().nullish(),
4995
- orchestration_output_tokens: z18.number().nullish()
5208
+ output_tokens: z19.number(),
5209
+ output_tokens_details: z19.object({
5210
+ reasoning_tokens: z19.number().nullish(),
5211
+ orchestration_output_tokens: z19.number().nullish()
4996
5212
  }).nullish()
4997
5213
  }).optional()
4998
5214
  })
@@ -5001,10 +5217,10 @@ var openaiResponsesResponseSchema = lazySchema16(
5001
5217
 
5002
5218
  // src/responses/openai-responses-language-model-options.ts
5003
5219
  import {
5004
- lazySchema as lazySchema17,
5005
- zodSchema as zodSchema17
5220
+ lazySchema as lazySchema18,
5221
+ zodSchema as zodSchema18
5006
5222
  } from "@ai-sdk/provider-utils";
5007
- import { z as z19 } from "zod/v4";
5223
+ import { z as z20 } from "zod/v4";
5008
5224
  var TOP_LOGPROBS_MAX = 20;
5009
5225
  var openaiResponsesReasoningModelIds = [
5010
5226
  "o1",
@@ -5075,9 +5291,9 @@ var openaiResponsesModelIds = [
5075
5291
  "gpt-5-chat-latest",
5076
5292
  ...openaiResponsesReasoningModelIds
5077
5293
  ];
5078
- var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5079
- () => zodSchema17(
5080
- z19.object({
5294
+ var openaiLanguageModelResponsesOptionsSchema = lazySchema18(
5295
+ () => zodSchema18(
5296
+ z20.object({
5081
5297
  /**
5082
5298
  * The ID of the OpenAI Conversation to continue.
5083
5299
  * You must create a conversation first via the OpenAI API.
@@ -5085,13 +5301,13 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5085
5301
  * Defaults to `undefined`.
5086
5302
  * @see https://platform.openai.com/docs/api-reference/conversations/create
5087
5303
  */
5088
- conversation: z19.string().nullish(),
5304
+ conversation: z20.string().nullish(),
5089
5305
  /**
5090
5306
  * The set of extra fields to include in the response (advanced, usually not needed).
5091
5307
  * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
5092
5308
  */
5093
- include: z19.array(
5094
- z19.enum([
5309
+ include: z20.array(
5310
+ z20.enum([
5095
5311
  "reasoning.encrypted_content",
5096
5312
  // handled internally by default, only needed for unknown reasoning models
5097
5313
  "file_search_call.results",
@@ -5104,7 +5320,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5104
5320
  * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
5105
5321
  * Defaults to `undefined`.
5106
5322
  */
5107
- instructions: z19.string().nullish(),
5323
+ instructions: z20.string().nullish(),
5108
5324
  /**
5109
5325
  * Return the log probabilities of the tokens. Including logprobs will increase
5110
5326
  * the response size and can slow down response times. However, it can
@@ -5119,38 +5335,38 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5119
5335
  * @see https://platform.openai.com/docs/api-reference/responses/create
5120
5336
  * @see https://cookbook.openai.com/examples/using_logprobs
5121
5337
  */
5122
- logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
5338
+ logprobs: z20.union([z20.boolean(), z20.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
5123
5339
  /**
5124
5340
  * The maximum number of total calls to built-in tools that can be processed in a response.
5125
5341
  * This maximum number applies across all built-in tool calls, not per individual tool.
5126
5342
  * Any further attempts to call a tool by the model will be ignored.
5127
5343
  */
5128
- maxToolCalls: z19.number().nullish(),
5344
+ maxToolCalls: z20.number().nullish(),
5129
5345
  /**
5130
5346
  * Additional metadata to store with the generation.
5131
5347
  */
5132
- metadata: z19.any().nullish(),
5348
+ metadata: z20.any().nullish(),
5133
5349
  /**
5134
5350
  * Whether to use parallel tool calls. Defaults to `true`.
5135
5351
  */
5136
- parallelToolCalls: z19.boolean().nullish(),
5352
+ parallelToolCalls: z20.boolean().nullish(),
5137
5353
  /**
5138
5354
  * The ID of the previous response. You can use it to continue a conversation.
5139
5355
  * Defaults to `undefined`.
5140
5356
  */
5141
- previousResponseId: z19.string().nullish(),
5357
+ previousResponseId: z20.string().nullish(),
5142
5358
  /**
5143
5359
  * Sets a cache key to tie this prompt to cached prefixes for better caching performance.
5144
5360
  */
5145
- promptCacheKey: z19.string().nullish(),
5361
+ promptCacheKey: z20.string().nullish(),
5146
5362
  /**
5147
5363
  * Prompt cache behavior for GPT-5.6 and later models.
5148
5364
  * `mode` controls whether OpenAI also places an implicit breakpoint.
5149
5365
  * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
5150
5366
  */
5151
- promptCacheOptions: z19.object({
5152
- mode: z19.enum(["implicit", "explicit"]).optional(),
5153
- ttl: z19.literal("30m").optional()
5367
+ promptCacheOptions: z20.object({
5368
+ mode: z20.enum(["implicit", "explicit"]).optional(),
5369
+ ttl: z20.literal("30m").optional()
5154
5370
  }).optional(),
5155
5371
  /**
5156
5372
  * The retention policy for the prompt cache.
@@ -5162,35 +5378,35 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5162
5378
  *
5163
5379
  * @default 'in_memory'
5164
5380
  */
5165
- promptCacheRetention: z19.enum(["in_memory", "24h"]).nullish(),
5381
+ promptCacheRetention: z20.enum(["in_memory", "24h"]).nullish(),
5166
5382
  /**
5167
5383
  * Reasoning effort for reasoning models. Defaults to `medium`. If you use
5168
5384
  * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
5169
5385
  * GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
5170
5386
  * Supported values vary by model.
5171
5387
  */
5172
- reasoningEffort: z19.string().nullish(),
5388
+ reasoningEffort: z20.string().nullish(),
5173
5389
  /**
5174
5390
  * Controls how much model work GPT-5.6 performs before returning a final answer.
5175
5391
  * `standard` is the default. `pro` increases quality, latency, and token usage.
5176
5392
  */
5177
- reasoningMode: z19.enum(["standard", "pro"]).optional(),
5393
+ reasoningMode: z20.enum(["standard", "pro"]).optional(),
5178
5394
  /**
5179
5395
  * Controls which available reasoning items GPT-5.6 can use.
5180
5396
  * `auto` uses the model default, `current_turn` excludes reasoning from earlier
5181
5397
  * turns, and `all_turns` makes compatible earlier reasoning available.
5182
5398
  */
5183
- reasoningContext: z19.enum(["auto", "current_turn", "all_turns"]).optional(),
5399
+ reasoningContext: z20.enum(["auto", "current_turn", "all_turns"]).optional(),
5184
5400
  /**
5185
5401
  * Controls reasoning summary output from the model.
5186
5402
  * Set to "auto" to automatically receive the richest level available,
5187
5403
  * or "detailed" for comprehensive summaries.
5188
5404
  */
5189
- reasoningSummary: z19.string().nullish(),
5405
+ reasoningSummary: z20.string().nullish(),
5190
5406
  /**
5191
5407
  * The identifier for safety monitoring and tracking.
5192
5408
  */
5193
- safetyIdentifier: z19.string().nullish(),
5409
+ safetyIdentifier: z20.string().nullish(),
5194
5410
  /**
5195
5411
  * Service tier for the request.
5196
5412
  * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
@@ -5198,11 +5414,11 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5198
5414
  *
5199
5415
  * Defaults to 'auto'.
5200
5416
  */
5201
- serviceTier: z19.enum(["auto", "flex", "priority", "default"]).nullish(),
5417
+ serviceTier: z20.enum(["auto", "flex", "priority", "default"]).nullish(),
5202
5418
  /**
5203
5419
  * Whether to store the generation. Defaults to `true`.
5204
5420
  */
5205
- store: z19.boolean().nullish(),
5421
+ store: z20.boolean().nullish(),
5206
5422
  /**
5207
5423
  * Whether to pass through non-image file types as generic input files.
5208
5424
  *
@@ -5210,30 +5426,30 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5210
5426
  * Enable this when the target OpenAI Responses model supports additional
5211
5427
  * file media types, such as text/csv.
5212
5428
  */
5213
- passThroughUnsupportedFiles: z19.boolean().optional(),
5429
+ passThroughUnsupportedFiles: z20.boolean().optional(),
5214
5430
  /**
5215
5431
  * Whether to use strict JSON schema validation.
5216
5432
  * Defaults to `true`.
5217
5433
  */
5218
- strictJsonSchema: z19.boolean().nullish(),
5434
+ strictJsonSchema: z20.boolean().nullish(),
5219
5435
  /**
5220
5436
  * Controls the verbosity of the model's responses. Lower values ('low') will result
5221
5437
  * in more concise responses, while higher values ('high') will result in more verbose responses.
5222
5438
  * Valid values: 'low', 'medium', 'high'.
5223
5439
  */
5224
- textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
5440
+ textVerbosity: z20.enum(["low", "medium", "high"]).nullish(),
5225
5441
  /**
5226
5442
  * Controls output truncation. 'auto' (default) performs truncation automatically;
5227
5443
  * 'disabled' turns truncation off.
5228
5444
  */
5229
- truncation: z19.enum(["auto", "disabled"]).nullish(),
5445
+ truncation: z20.enum(["auto", "disabled"]).nullish(),
5230
5446
  /**
5231
5447
  * A unique identifier representing your end-user, which can help OpenAI to
5232
5448
  * monitor and detect abuse.
5233
5449
  * Defaults to `undefined`.
5234
5450
  * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
5235
5451
  */
5236
- user: z19.string().nullish(),
5452
+ user: z20.string().nullish(),
5237
5453
  /**
5238
5454
  * Override the system message mode for this model.
5239
5455
  * - 'system': Use the 'system' role for system messages (default for most models)
@@ -5242,7 +5458,7 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5242
5458
  *
5243
5459
  * If not specified, the mode is automatically determined based on the model.
5244
5460
  */
5245
- systemMessageMode: z19.enum(["system", "developer", "remove"]).optional(),
5461
+ systemMessageMode: z20.enum(["system", "developer", "remove"]).optional(),
5246
5462
  /**
5247
5463
  * Force treating this model as a reasoning model.
5248
5464
  *
@@ -5252,14 +5468,14 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5252
5468
  * When enabled, the SDK applies reasoning-model parameter compatibility rules
5253
5469
  * and defaults `systemMessageMode` to `developer` unless overridden.
5254
5470
  */
5255
- forceReasoning: z19.boolean().optional(),
5471
+ forceReasoning: z20.boolean().optional(),
5256
5472
  /**
5257
5473
  * Enable server-side context management (compaction).
5258
5474
  */
5259
- contextManagement: z19.array(
5260
- z19.object({
5261
- type: z19.literal("compaction"),
5262
- compactThreshold: z19.number()
5475
+ contextManagement: z20.array(
5476
+ z20.object({
5477
+ type: z20.literal("compaction"),
5478
+ compactThreshold: z20.number()
5263
5479
  })
5264
5480
  ).nullish(),
5265
5481
  /**
@@ -5272,9 +5488,9 @@ var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
5272
5488
  *
5273
5489
  * @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
5274
5490
  */
5275
- allowedTools: z19.object({
5276
- toolNames: z19.array(z19.string()).min(1),
5277
- mode: z19.enum(["auto", "required"]).optional()
5491
+ allowedTools: z20.object({
5492
+ toolNames: z20.array(z20.string()).min(1),
5493
+ mode: z20.enum(["auto", "required"]).optional()
5278
5494
  }).optional()
5279
5495
  })
5280
5496
  )
@@ -5292,37 +5508,37 @@ import {
5292
5508
  // src/tool/code-interpreter.ts
5293
5509
  import {
5294
5510
  createProviderExecutedToolFactory,
5295
- lazySchema as lazySchema18,
5296
- zodSchema as zodSchema18
5511
+ lazySchema as lazySchema19,
5512
+ zodSchema as zodSchema19
5297
5513
  } from "@ai-sdk/provider-utils";
5298
- import { z as z20 } from "zod/v4";
5299
- var codeInterpreterInputSchema = lazySchema18(
5300
- () => zodSchema18(
5301
- z20.object({
5302
- code: z20.string().nullish(),
5303
- containerId: z20.string()
5514
+ import { z as z21 } from "zod/v4";
5515
+ var codeInterpreterInputSchema = lazySchema19(
5516
+ () => zodSchema19(
5517
+ z21.object({
5518
+ code: z21.string().nullish(),
5519
+ containerId: z21.string()
5304
5520
  })
5305
5521
  )
5306
5522
  );
5307
- var codeInterpreterOutputSchema = lazySchema18(
5308
- () => zodSchema18(
5309
- z20.object({
5310
- outputs: z20.array(
5311
- z20.discriminatedUnion("type", [
5312
- z20.object({ type: z20.literal("logs"), logs: z20.string() }),
5313
- z20.object({ type: z20.literal("image"), url: z20.string() })
5523
+ var codeInterpreterOutputSchema = lazySchema19(
5524
+ () => zodSchema19(
5525
+ z21.object({
5526
+ outputs: z21.array(
5527
+ z21.discriminatedUnion("type", [
5528
+ z21.object({ type: z21.literal("logs"), logs: z21.string() }),
5529
+ z21.object({ type: z21.literal("image"), url: z21.string() })
5314
5530
  ])
5315
5531
  ).nullish()
5316
5532
  })
5317
5533
  )
5318
5534
  );
5319
- var codeInterpreterArgsSchema = lazySchema18(
5320
- () => zodSchema18(
5321
- z20.object({
5322
- container: z20.union([
5323
- z20.string(),
5324
- z20.object({
5325
- fileIds: z20.array(z20.string()).optional()
5535
+ var codeInterpreterArgsSchema = lazySchema19(
5536
+ () => zodSchema19(
5537
+ z21.object({
5538
+ container: z21.union([
5539
+ z21.string(),
5540
+ z21.object({
5541
+ fileIds: z21.array(z21.string()).optional()
5326
5542
  })
5327
5543
  ]).optional()
5328
5544
  })
@@ -5340,45 +5556,45 @@ var codeInterpreter = (args = {}) => {
5340
5556
  // src/tool/file-search.ts
5341
5557
  import {
5342
5558
  createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
5343
- lazySchema as lazySchema19,
5344
- zodSchema as zodSchema19
5559
+ lazySchema as lazySchema20,
5560
+ zodSchema as zodSchema20
5345
5561
  } from "@ai-sdk/provider-utils";
5346
- import { z as z21 } from "zod/v4";
5347
- var comparisonFilterSchema = z21.object({
5348
- key: z21.string(),
5349
- type: z21.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
5350
- value: z21.union([z21.string(), z21.number(), z21.boolean(), z21.array(z21.string())])
5562
+ import { z as z22 } from "zod/v4";
5563
+ var comparisonFilterSchema = z22.object({
5564
+ key: z22.string(),
5565
+ type: z22.enum(["eq", "ne", "gt", "gte", "lt", "lte", "in", "nin"]),
5566
+ value: z22.union([z22.string(), z22.number(), z22.boolean(), z22.array(z22.string())])
5351
5567
  });
5352
- var compoundFilterSchema = z21.object({
5353
- type: z21.enum(["and", "or"]),
5354
- filters: z21.array(
5355
- z21.union([comparisonFilterSchema, z21.lazy(() => compoundFilterSchema)])
5568
+ var compoundFilterSchema = z22.object({
5569
+ type: z22.enum(["and", "or"]),
5570
+ filters: z22.array(
5571
+ z22.union([comparisonFilterSchema, z22.lazy(() => compoundFilterSchema)])
5356
5572
  )
5357
5573
  });
5358
- var fileSearchArgsSchema = lazySchema19(
5359
- () => zodSchema19(
5360
- z21.object({
5361
- vectorStoreIds: z21.array(z21.string()),
5362
- maxNumResults: z21.number().optional(),
5363
- ranking: z21.object({
5364
- ranker: z21.string().optional(),
5365
- scoreThreshold: z21.number().optional()
5574
+ var fileSearchArgsSchema = lazySchema20(
5575
+ () => zodSchema20(
5576
+ z22.object({
5577
+ vectorStoreIds: z22.array(z22.string()),
5578
+ maxNumResults: z22.number().optional(),
5579
+ ranking: z22.object({
5580
+ ranker: z22.string().optional(),
5581
+ scoreThreshold: z22.number().optional()
5366
5582
  }).optional(),
5367
- filters: z21.union([comparisonFilterSchema, compoundFilterSchema]).optional()
5583
+ filters: z22.union([comparisonFilterSchema, compoundFilterSchema]).optional()
5368
5584
  })
5369
5585
  )
5370
5586
  );
5371
- var fileSearchOutputSchema = lazySchema19(
5372
- () => zodSchema19(
5373
- z21.object({
5374
- queries: z21.array(z21.string()),
5375
- results: z21.array(
5376
- z21.object({
5377
- attributes: z21.record(z21.string(), z21.unknown()),
5378
- fileId: z21.string(),
5379
- filename: z21.string(),
5380
- score: z21.number(),
5381
- text: z21.string()
5587
+ var fileSearchOutputSchema = lazySchema20(
5588
+ () => zodSchema20(
5589
+ z22.object({
5590
+ queries: z22.array(z22.string()),
5591
+ results: z22.array(
5592
+ z22.object({
5593
+ attributes: z22.record(z22.string(), z22.unknown()),
5594
+ fileId: z22.string(),
5595
+ filename: z22.string(),
5596
+ score: z22.number(),
5597
+ text: z22.string()
5382
5598
  })
5383
5599
  ).nullable()
5384
5600
  })
@@ -5386,39 +5602,39 @@ var fileSearchOutputSchema = lazySchema19(
5386
5602
  );
5387
5603
  var fileSearch = createProviderExecutedToolFactory2({
5388
5604
  id: "openai.file_search",
5389
- inputSchema: z21.object({}),
5605
+ inputSchema: z22.object({}),
5390
5606
  outputSchema: fileSearchOutputSchema
5391
5607
  });
5392
5608
 
5393
5609
  // src/tool/image-generation.ts
5394
5610
  import {
5395
5611
  createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
5396
- lazySchema as lazySchema20,
5397
- zodSchema as zodSchema20
5612
+ lazySchema as lazySchema21,
5613
+ zodSchema as zodSchema21
5398
5614
  } from "@ai-sdk/provider-utils";
5399
- import { z as z22 } from "zod/v4";
5400
- var imageGenerationArgsSchema = lazySchema20(
5401
- () => zodSchema20(
5402
- z22.object({
5403
- background: z22.enum(["auto", "opaque", "transparent"]).optional(),
5404
- inputFidelity: z22.enum(["low", "high"]).optional(),
5405
- inputImageMask: z22.object({
5406
- fileId: z22.string().optional(),
5407
- imageUrl: z22.string().optional()
5615
+ import { z as z23 } from "zod/v4";
5616
+ var imageGenerationArgsSchema = lazySchema21(
5617
+ () => zodSchema21(
5618
+ z23.object({
5619
+ background: z23.enum(["auto", "opaque", "transparent"]).optional(),
5620
+ inputFidelity: z23.enum(["low", "high"]).optional(),
5621
+ inputImageMask: z23.object({
5622
+ fileId: z23.string().optional(),
5623
+ imageUrl: z23.string().optional()
5408
5624
  }).optional(),
5409
- model: z22.string().optional(),
5410
- moderation: z22.enum(["auto"]).optional(),
5411
- outputCompression: z22.number().int().min(0).max(100).optional(),
5412
- outputFormat: z22.enum(["png", "jpeg", "webp"]).optional(),
5413
- partialImages: z22.number().int().min(0).max(3).optional(),
5414
- quality: z22.enum(["auto", "low", "medium", "high"]).optional(),
5415
- size: z22.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
5625
+ model: z23.string().optional(),
5626
+ moderation: z23.enum(["auto"]).optional(),
5627
+ outputCompression: z23.number().int().min(0).max(100).optional(),
5628
+ outputFormat: z23.enum(["png", "jpeg", "webp"]).optional(),
5629
+ partialImages: z23.number().int().min(0).max(3).optional(),
5630
+ quality: z23.enum(["auto", "low", "medium", "high"]).optional(),
5631
+ size: z23.enum(["1024x1024", "1024x1536", "1536x1024", "auto"]).optional()
5416
5632
  }).strict()
5417
5633
  )
5418
5634
  );
5419
- var imageGenerationInputSchema = lazySchema20(() => zodSchema20(z22.object({})));
5420
- var imageGenerationOutputSchema = lazySchema20(
5421
- () => zodSchema20(z22.object({ result: z22.string() }))
5635
+ var imageGenerationInputSchema = lazySchema21(() => zodSchema21(z23.object({})));
5636
+ var imageGenerationOutputSchema = lazySchema21(
5637
+ () => zodSchema21(z23.object({ result: z23.string() }))
5422
5638
  );
5423
5639
  var imageGenerationToolFactory = createProviderExecutedToolFactory3({
5424
5640
  id: "openai.image_generation",
@@ -5432,28 +5648,28 @@ var imageGeneration = (args = {}) => {
5432
5648
  // src/tool/custom.ts
5433
5649
  import {
5434
5650
  createProviderDefinedToolFactory,
5435
- lazySchema as lazySchema21,
5436
- zodSchema as zodSchema21
5651
+ lazySchema as lazySchema22,
5652
+ zodSchema as zodSchema22
5437
5653
  } from "@ai-sdk/provider-utils";
5438
- import { z as z23 } from "zod/v4";
5439
- var customArgsSchema = lazySchema21(
5440
- () => zodSchema21(
5441
- z23.object({
5442
- description: z23.string().optional(),
5443
- format: z23.union([
5444
- z23.object({
5445
- type: z23.literal("grammar"),
5446
- syntax: z23.enum(["regex", "lark"]),
5447
- definition: z23.string()
5654
+ import { z as z24 } from "zod/v4";
5655
+ var customArgsSchema = lazySchema22(
5656
+ () => zodSchema22(
5657
+ z24.object({
5658
+ description: z24.string().optional(),
5659
+ format: z24.union([
5660
+ z24.object({
5661
+ type: z24.literal("grammar"),
5662
+ syntax: z24.enum(["regex", "lark"]),
5663
+ definition: z24.string()
5448
5664
  }),
5449
- z23.object({
5450
- type: z23.literal("text")
5665
+ z24.object({
5666
+ type: z24.literal("text")
5451
5667
  })
5452
5668
  ]).optional()
5453
5669
  })
5454
5670
  )
5455
5671
  );
5456
- var customInputSchema = lazySchema21(() => zodSchema21(z23.string()));
5672
+ var customInputSchema = lazySchema22(() => zodSchema22(z24.string()));
5457
5673
  var customToolFactory = createProviderDefinedToolFactory({
5458
5674
  id: "openai.custom",
5459
5675
  inputSchema: customInputSchema
@@ -5462,60 +5678,60 @@ var customToolFactory = createProviderDefinedToolFactory({
5462
5678
  // src/tool/mcp.ts
5463
5679
  import {
5464
5680
  createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
5465
- lazySchema as lazySchema22,
5466
- zodSchema as zodSchema22
5681
+ lazySchema as lazySchema23,
5682
+ zodSchema as zodSchema23
5467
5683
  } from "@ai-sdk/provider-utils";
5468
- import { z as z24 } from "zod/v4";
5469
- var jsonValueSchema2 = z24.lazy(
5470
- () => z24.union([
5471
- z24.string(),
5472
- z24.number(),
5473
- z24.boolean(),
5474
- z24.null(),
5475
- z24.array(jsonValueSchema2),
5476
- z24.record(z24.string(), jsonValueSchema2)
5684
+ import { z as z25 } from "zod/v4";
5685
+ var jsonValueSchema2 = z25.lazy(
5686
+ () => z25.union([
5687
+ z25.string(),
5688
+ z25.number(),
5689
+ z25.boolean(),
5690
+ z25.null(),
5691
+ z25.array(jsonValueSchema2),
5692
+ z25.record(z25.string(), jsonValueSchema2)
5477
5693
  ])
5478
5694
  );
5479
- var mcpArgsSchema = lazySchema22(
5480
- () => zodSchema22(
5481
- z24.object({
5482
- serverLabel: z24.string(),
5483
- allowedTools: z24.union([
5484
- z24.array(z24.string()),
5485
- z24.object({
5486
- readOnly: z24.boolean().optional(),
5487
- toolNames: z24.array(z24.string()).optional()
5695
+ var mcpArgsSchema = lazySchema23(
5696
+ () => zodSchema23(
5697
+ z25.object({
5698
+ serverLabel: z25.string(),
5699
+ allowedTools: z25.union([
5700
+ z25.array(z25.string()),
5701
+ z25.object({
5702
+ readOnly: z25.boolean().optional(),
5703
+ toolNames: z25.array(z25.string()).optional()
5488
5704
  })
5489
5705
  ]).optional(),
5490
- authorization: z24.string().optional(),
5491
- connectorId: z24.string().optional(),
5492
- headers: z24.record(z24.string(), z24.string()).optional(),
5493
- requireApproval: z24.union([
5494
- z24.enum(["always", "never"]),
5495
- z24.object({
5496
- never: z24.object({
5497
- toolNames: z24.array(z24.string()).optional()
5706
+ authorization: z25.string().optional(),
5707
+ connectorId: z25.string().optional(),
5708
+ headers: z25.record(z25.string(), z25.string()).optional(),
5709
+ requireApproval: z25.union([
5710
+ z25.enum(["always", "never"]),
5711
+ z25.object({
5712
+ never: z25.object({
5713
+ toolNames: z25.array(z25.string()).optional()
5498
5714
  }).optional()
5499
5715
  })
5500
5716
  ]).optional(),
5501
- serverDescription: z24.string().optional(),
5502
- serverUrl: z24.string().optional()
5717
+ serverDescription: z25.string().optional(),
5718
+ serverUrl: z25.string().optional()
5503
5719
  }).refine(
5504
5720
  (v) => v.serverUrl != null || v.connectorId != null,
5505
5721
  "One of serverUrl or connectorId must be provided."
5506
5722
  )
5507
5723
  )
5508
5724
  );
5509
- var mcpInputSchema = lazySchema22(() => zodSchema22(z24.object({})));
5510
- var mcpOutputSchema = lazySchema22(
5511
- () => zodSchema22(
5512
- z24.object({
5513
- type: z24.literal("call"),
5514
- serverLabel: z24.string(),
5515
- name: z24.string(),
5516
- arguments: z24.string(),
5517
- output: z24.string().nullish(),
5518
- error: z24.union([z24.string(), jsonValueSchema2]).optional()
5725
+ var mcpInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
5726
+ var mcpOutputSchema = lazySchema23(
5727
+ () => zodSchema23(
5728
+ z25.object({
5729
+ type: z25.literal("call"),
5730
+ serverLabel: z25.string(),
5731
+ name: z25.string(),
5732
+ arguments: z25.string(),
5733
+ output: z25.string().nullish(),
5734
+ error: z25.union([z25.string(), jsonValueSchema2]).optional()
5519
5735
  })
5520
5736
  )
5521
5737
  );
@@ -5528,50 +5744,50 @@ var mcpToolFactory = createProviderExecutedToolFactory4({
5528
5744
  // src/tool/web-search.ts
5529
5745
  import {
5530
5746
  createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
5531
- lazySchema as lazySchema23,
5532
- zodSchema as zodSchema23
5747
+ lazySchema as lazySchema24,
5748
+ zodSchema as zodSchema24
5533
5749
  } from "@ai-sdk/provider-utils";
5534
- import { z as z25 } from "zod/v4";
5535
- var webSearchArgsSchema = lazySchema23(
5536
- () => zodSchema23(
5537
- z25.object({
5538
- externalWebAccess: z25.boolean().optional(),
5539
- filters: z25.object({ allowedDomains: z25.array(z25.string()).optional() }).optional(),
5540
- searchContextSize: z25.enum(["low", "medium", "high"]).optional(),
5541
- userLocation: z25.object({
5542
- type: z25.literal("approximate"),
5543
- country: z25.string().optional(),
5544
- city: z25.string().optional(),
5545
- region: z25.string().optional(),
5546
- timezone: z25.string().optional()
5750
+ import { z as z26 } from "zod/v4";
5751
+ var webSearchArgsSchema = lazySchema24(
5752
+ () => zodSchema24(
5753
+ z26.object({
5754
+ externalWebAccess: z26.boolean().optional(),
5755
+ filters: z26.object({ allowedDomains: z26.array(z26.string()).optional() }).optional(),
5756
+ searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
5757
+ userLocation: z26.object({
5758
+ type: z26.literal("approximate"),
5759
+ country: z26.string().optional(),
5760
+ city: z26.string().optional(),
5761
+ region: z26.string().optional(),
5762
+ timezone: z26.string().optional()
5547
5763
  }).optional()
5548
5764
  })
5549
5765
  )
5550
5766
  );
5551
- var webSearchInputSchema = lazySchema23(() => zodSchema23(z25.object({})));
5552
- var webSearchOutputSchema = lazySchema23(
5553
- () => zodSchema23(
5554
- z25.object({
5555
- action: z25.discriminatedUnion("type", [
5556
- z25.object({
5557
- type: z25.literal("search"),
5558
- query: z25.string().optional(),
5559
- queries: z25.array(z25.string()).optional()
5767
+ var webSearchInputSchema = lazySchema24(() => zodSchema24(z26.object({})));
5768
+ var webSearchOutputSchema = lazySchema24(
5769
+ () => zodSchema24(
5770
+ z26.object({
5771
+ action: z26.discriminatedUnion("type", [
5772
+ z26.object({
5773
+ type: z26.literal("search"),
5774
+ query: z26.string().optional(),
5775
+ queries: z26.array(z26.string()).optional()
5560
5776
  }),
5561
- z25.object({
5562
- type: z25.literal("openPage"),
5563
- url: z25.string().nullish()
5777
+ z26.object({
5778
+ type: z26.literal("openPage"),
5779
+ url: z26.string().nullish()
5564
5780
  }),
5565
- z25.object({
5566
- type: z25.literal("findInPage"),
5567
- url: z25.string().nullish(),
5568
- pattern: z25.string().nullish()
5781
+ z26.object({
5782
+ type: z26.literal("findInPage"),
5783
+ url: z26.string().nullish(),
5784
+ pattern: z26.string().nullish()
5569
5785
  })
5570
5786
  ]).optional(),
5571
- sources: z25.array(
5572
- z25.discriminatedUnion("type", [
5573
- z25.object({ type: z25.literal("url"), url: z25.string() }),
5574
- z25.object({ type: z25.literal("api"), name: z25.string() })
5787
+ sources: z26.array(
5788
+ z26.discriminatedUnion("type", [
5789
+ z26.object({ type: z26.literal("url"), url: z26.string() }),
5790
+ z26.object({ type: z26.literal("api"), name: z26.string() })
5575
5791
  ])
5576
5792
  ).optional()
5577
5793
  })
@@ -5587,43 +5803,43 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
5587
5803
  // src/tool/web-search-preview.ts
5588
5804
  import {
5589
5805
  createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
5590
- lazySchema as lazySchema24,
5591
- zodSchema as zodSchema24
5806
+ lazySchema as lazySchema25,
5807
+ zodSchema as zodSchema25
5592
5808
  } from "@ai-sdk/provider-utils";
5593
- import { z as z26 } from "zod/v4";
5594
- var webSearchPreviewArgsSchema = lazySchema24(
5595
- () => zodSchema24(
5596
- z26.object({
5597
- searchContextSize: z26.enum(["low", "medium", "high"]).optional(),
5598
- userLocation: z26.object({
5599
- type: z26.literal("approximate"),
5600
- country: z26.string().optional(),
5601
- city: z26.string().optional(),
5602
- region: z26.string().optional(),
5603
- timezone: z26.string().optional()
5809
+ import { z as z27 } from "zod/v4";
5810
+ var webSearchPreviewArgsSchema = lazySchema25(
5811
+ () => zodSchema25(
5812
+ z27.object({
5813
+ searchContextSize: z27.enum(["low", "medium", "high"]).optional(),
5814
+ userLocation: z27.object({
5815
+ type: z27.literal("approximate"),
5816
+ country: z27.string().optional(),
5817
+ city: z27.string().optional(),
5818
+ region: z27.string().optional(),
5819
+ timezone: z27.string().optional()
5604
5820
  }).optional()
5605
5821
  })
5606
5822
  )
5607
5823
  );
5608
- var webSearchPreviewInputSchema = lazySchema24(
5609
- () => zodSchema24(z26.object({}))
5824
+ var webSearchPreviewInputSchema = lazySchema25(
5825
+ () => zodSchema25(z27.object({}))
5610
5826
  );
5611
- var webSearchPreviewOutputSchema = lazySchema24(
5612
- () => zodSchema24(
5613
- z26.object({
5614
- action: z26.discriminatedUnion("type", [
5615
- z26.object({
5616
- type: z26.literal("search"),
5617
- query: z26.string().optional()
5827
+ var webSearchPreviewOutputSchema = lazySchema25(
5828
+ () => zodSchema25(
5829
+ z27.object({
5830
+ action: z27.discriminatedUnion("type", [
5831
+ z27.object({
5832
+ type: z27.literal("search"),
5833
+ query: z27.string().optional()
5618
5834
  }),
5619
- z26.object({
5620
- type: z26.literal("openPage"),
5621
- url: z26.string().nullish()
5835
+ z27.object({
5836
+ type: z27.literal("openPage"),
5837
+ url: z27.string().nullish()
5622
5838
  }),
5623
- z26.object({
5624
- type: z26.literal("findInPage"),
5625
- url: z26.string().nullish(),
5626
- pattern: z26.string().nullish()
5839
+ z27.object({
5840
+ type: z27.literal("findInPage"),
5841
+ url: z27.string().nullish(),
5842
+ pattern: z27.string().nullish()
5627
5843
  })
5628
5844
  ]).optional()
5629
5845
  })
@@ -5727,6 +5943,12 @@ async function prepareResponsesTools({
5727
5943
  });
5728
5944
  break;
5729
5945
  }
5946
+ case "openai.computer": {
5947
+ openaiTools.push({
5948
+ type: "computer"
5949
+ });
5950
+ break;
5951
+ }
5730
5952
  case "openai.web_search_preview": {
5731
5953
  const args = await validateTypes2({
5732
5954
  value: tool.args,
@@ -5881,7 +6103,7 @@ async function prepareResponsesTools({
5881
6103
  const resolvedToolName = (_c = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _c : toolChoice.toolName;
5882
6104
  return {
5883
6105
  tools: openaiTools,
5884
- toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
6106
+ toolChoice: resolvedToolName === "code_interpreter" || resolvedToolName === "file_search" || resolvedToolName === "image_generation" || resolvedToolName === "web_search_preview" || resolvedToolName === "web_search" || resolvedToolName === "mcp" || resolvedToolName === "apply_patch" || resolvedToolName === "computer" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: "custom", name: resolvedToolName } : { type: "function", name: resolvedToolName },
5885
6107
  toolWarnings
5886
6108
  };
5887
6109
  }
@@ -5976,6 +6198,74 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
5976
6198
  }
5977
6199
  return mapping;
5978
6200
  }
6201
+ function mapComputerAction(action) {
6202
+ switch (action.type) {
6203
+ case "click":
6204
+ return {
6205
+ type: "click",
6206
+ button: action.button,
6207
+ x: action.x,
6208
+ y: action.y,
6209
+ ...action.keys != null && { keys: action.keys }
6210
+ };
6211
+ case "double_click":
6212
+ return {
6213
+ type: "double_click",
6214
+ x: action.x,
6215
+ y: action.y,
6216
+ ...action.keys != null && { keys: action.keys }
6217
+ };
6218
+ case "drag":
6219
+ return {
6220
+ type: "drag",
6221
+ path: action.path,
6222
+ ...action.keys != null && { keys: action.keys }
6223
+ };
6224
+ case "keypress":
6225
+ return action;
6226
+ case "move":
6227
+ return {
6228
+ type: "move",
6229
+ x: action.x,
6230
+ y: action.y,
6231
+ ...action.keys != null && { keys: action.keys }
6232
+ };
6233
+ case "screenshot":
6234
+ return action;
6235
+ case "scroll":
6236
+ return {
6237
+ type: "scroll",
6238
+ x: action.x,
6239
+ y: action.y,
6240
+ scrollX: action.scroll_x,
6241
+ scrollY: action.scroll_y,
6242
+ ...action.keys != null && { keys: action.keys }
6243
+ };
6244
+ case "type":
6245
+ return action;
6246
+ case "wait":
6247
+ return action;
6248
+ }
6249
+ }
6250
+ function mapComputerCallInput({
6251
+ action,
6252
+ actions,
6253
+ pending_safety_checks,
6254
+ status
6255
+ }) {
6256
+ var _a;
6257
+ return {
6258
+ actions: (actions != null ? actions : action != null ? [action] : []).map(
6259
+ mapComputerAction
6260
+ ),
6261
+ pendingSafetyChecks: (_a = pending_safety_checks == null ? void 0 : pending_safety_checks.map((safetyCheck) => ({
6262
+ id: safetyCheck.id,
6263
+ ...safetyCheck.code != null && { code: safetyCheck.code },
6264
+ ...safetyCheck.message != null && { message: safetyCheck.message }
6265
+ }))) != null ? _a : [],
6266
+ status
6267
+ };
6268
+ }
5979
6269
  var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
5980
6270
  constructor(modelId, config) {
5981
6271
  this.specificationVersion = "v4";
@@ -6059,6 +6349,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6059
6349
  tools,
6060
6350
  providerToolNames: {
6061
6351
  "openai.code_interpreter": "code_interpreter",
6352
+ "openai.computer": "computer",
6062
6353
  "openai.file_search": "file_search",
6063
6354
  "openai.image_generation": "image_generation",
6064
6355
  "openai.local_shell": "local_shell",
@@ -6095,6 +6386,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6095
6386
  hasLocalShellTool: hasOpenAITool("openai.local_shell"),
6096
6387
  hasShellTool: hasOpenAITool("openai.shell"),
6097
6388
  hasApplyPatchTool: hasOpenAITool("openai.apply_patch"),
6389
+ hasComputerTool: hasOpenAITool("openai.computer"),
6098
6390
  customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0
6099
6391
  });
6100
6392
  warnings.push(...inputWarnings);
@@ -6275,7 +6567,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6275
6567
  };
6276
6568
  }
6277
6569
  async doGenerate(options) {
6278
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
6570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
6279
6571
  const {
6280
6572
  args: body,
6281
6573
  warnings,
@@ -6315,6 +6607,18 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6315
6607
  isRetryable: false
6316
6608
  });
6317
6609
  }
6610
+ if (response.output == null) {
6611
+ const detail = (_c = response.incomplete_details) == null ? void 0 : _c.reason;
6612
+ throw new APICallError2({
6613
+ message: detail ? `Responses API returned no output (${detail})` : "Responses API returned no output",
6614
+ url,
6615
+ requestBodyValues: body,
6616
+ statusCode: 500,
6617
+ responseHeaders,
6618
+ responseBody: rawResponse,
6619
+ isRetryable: false
6620
+ });
6621
+ }
6318
6622
  const content = [];
6319
6623
  const logprobs = [];
6320
6624
  let hasFunctionCall = false;
@@ -6332,7 +6636,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6332
6636
  providerMetadata: {
6333
6637
  [providerOptionsName]: {
6334
6638
  itemId: part.id,
6335
- reasoningEncryptedContent: (_c = part.encrypted_content) != null ? _c : null
6639
+ reasoningEncryptedContent: (_d = part.encrypted_content) != null ? _d : null
6336
6640
  }
6337
6641
  }
6338
6642
  });
@@ -6358,7 +6662,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6358
6662
  break;
6359
6663
  }
6360
6664
  case "tool_search_call": {
6361
- const toolCallId = (_d = part.call_id) != null ? _d : part.id;
6665
+ const toolCallId = (_e = part.call_id) != null ? _e : part.id;
6362
6666
  const isHosted = part.execution === "server";
6363
6667
  if (isHosted) {
6364
6668
  hostedToolSearchCallIds.push(toolCallId);
@@ -6381,7 +6685,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6381
6685
  break;
6382
6686
  }
6383
6687
  case "tool_search_output": {
6384
- const toolCallId = (_f = (_e = part.call_id) != null ? _e : hostedToolSearchCallIds.shift()) != null ? _f : part.id;
6688
+ const toolCallId = (_g = (_f = part.call_id) != null ? _f : hostedToolSearchCallIds.shift()) != null ? _g : part.id;
6385
6689
  content.push({
6386
6690
  type: "tool-result",
6387
6691
  toolCallId,
@@ -6452,7 +6756,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6452
6756
  }
6453
6757
  case "message": {
6454
6758
  for (const contentPart of part.content) {
6455
- if (((_h = (_g = options.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.logprobs) && contentPart.logprobs) {
6759
+ if (((_i = (_h = options.providerOptions) == null ? void 0 : _h[providerOptionsName]) == null ? void 0 : _i.logprobs) && contentPart.logprobs) {
6456
6760
  logprobs.push(contentPart.logprobs);
6457
6761
  }
6458
6762
  const providerMetadata2 = {
@@ -6474,7 +6778,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6474
6778
  content.push({
6475
6779
  type: "source",
6476
6780
  sourceType: "url",
6477
- id: (_k = (_j = (_i = this.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : generateId2(),
6781
+ id: (_l = (_k = (_j = this.config).generateId) == null ? void 0 : _k.call(_j)) != null ? _l : generateId2(),
6478
6782
  url: annotation.url,
6479
6783
  title: annotation.title
6480
6784
  });
@@ -6482,7 +6786,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6482
6786
  content.push({
6483
6787
  type: "source",
6484
6788
  sourceType: "document",
6485
- id: (_n = (_m = (_l = this.config).generateId) == null ? void 0 : _m.call(_l)) != null ? _n : generateId2(),
6789
+ id: (_o = (_n = (_m = this.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2(),
6486
6790
  mediaType: "text/plain",
6487
6791
  title: annotation.filename,
6488
6792
  filename: annotation.filename,
@@ -6498,7 +6802,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6498
6802
  content.push({
6499
6803
  type: "source",
6500
6804
  sourceType: "document",
6501
- id: (_q = (_p = (_o = this.config).generateId) == null ? void 0 : _p.call(_o)) != null ? _q : generateId2(),
6805
+ id: (_r = (_q = (_p = this.config).generateId) == null ? void 0 : _q.call(_p)) != null ? _r : generateId2(),
6502
6806
  mediaType: "text/plain",
6503
6807
  title: annotation.filename,
6504
6808
  filename: annotation.filename,
@@ -6514,7 +6818,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6514
6818
  content.push({
6515
6819
  type: "source",
6516
6820
  sourceType: "document",
6517
- id: (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : generateId2(),
6821
+ id: (_u = (_t = (_s = this.config).generateId) == null ? void 0 : _t.call(_s)) != null ? _u : generateId2(),
6518
6822
  mediaType: "application/octet-stream",
6519
6823
  title: annotation.file_id,
6520
6824
  filename: annotation.file_id,
@@ -6584,7 +6888,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6584
6888
  break;
6585
6889
  }
6586
6890
  case "mcp_call": {
6587
- const toolCallId = part.approval_request_id != null ? (_u = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _u : part.id : part.id;
6891
+ const toolCallId = part.approval_request_id != null ? (_v = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _v : part.id : part.id;
6588
6892
  const toolName = `mcp.${part.name}`;
6589
6893
  content.push({
6590
6894
  type: "tool-call",
@@ -6618,8 +6922,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6618
6922
  break;
6619
6923
  }
6620
6924
  case "mcp_approval_request": {
6621
- const approvalRequestId = (_v = part.approval_request_id) != null ? _v : part.id;
6622
- const dummyToolCallId = (_y = (_x = (_w = this.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : generateId2();
6925
+ const approvalRequestId = (_w = part.approval_request_id) != null ? _w : part.id;
6926
+ const dummyToolCallId = (_z = (_y = (_x = this.config).generateId) == null ? void 0 : _y.call(_x)) != null ? _z : generateId2();
6623
6927
  const toolName = `mcp.${part.name}`;
6624
6928
  content.push({
6625
6929
  type: "tool-call",
@@ -6637,20 +6941,36 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6637
6941
  break;
6638
6942
  }
6639
6943
  case "computer_call": {
6944
+ if (part.call_id == null) {
6945
+ content.push({
6946
+ type: "tool-call",
6947
+ toolCallId: part.id,
6948
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
6949
+ input: "",
6950
+ providerExecuted: true
6951
+ });
6952
+ content.push({
6953
+ type: "tool-result",
6954
+ toolCallId: part.id,
6955
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
6956
+ result: {
6957
+ type: "computer_use_tool_result",
6958
+ status: part.status
6959
+ }
6960
+ });
6961
+ break;
6962
+ }
6963
+ hasFunctionCall = true;
6964
+ const toolName = toolNameMapping.toCustomToolName("computer");
6640
6965
  content.push({
6641
6966
  type: "tool-call",
6642
- toolCallId: part.id,
6643
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6644
- input: "",
6645
- providerExecuted: true
6646
- });
6647
- content.push({
6648
- type: "tool-result",
6649
- toolCallId: part.id,
6650
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6651
- result: {
6652
- type: "computer_use_tool_result",
6653
- status: part.status || "completed"
6967
+ toolCallId: part.call_id,
6968
+ toolName,
6969
+ input: JSON.stringify(mapComputerCallInput(part)),
6970
+ providerMetadata: {
6971
+ [providerOptionsName]: {
6972
+ itemId: part.id
6973
+ }
6654
6974
  }
6655
6975
  });
6656
6976
  break;
@@ -6669,13 +6989,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6669
6989
  toolName: toolNameMapping.toCustomToolName("file_search"),
6670
6990
  result: {
6671
6991
  queries: part.queries,
6672
- results: (_A = (_z = part.results) == null ? void 0 : _z.map((result) => ({
6992
+ results: (_B = (_A = part.results) == null ? void 0 : _A.map((result) => ({
6673
6993
  attributes: result.attributes,
6674
6994
  fileId: result.file_id,
6675
6995
  filename: result.filename,
6676
6996
  score: result.score,
6677
6997
  text: result.text
6678
- }))) != null ? _A : null
6998
+ }))) != null ? _B : null
6679
6999
  }
6680
7000
  });
6681
7001
  break;
@@ -6739,7 +7059,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6739
7059
  responseId: response.id,
6740
7060
  ...logprobs.length > 0 ? { logprobs } : {},
6741
7061
  ...typeof response.service_tier === "string" ? { serviceTier: response.service_tier } : {},
6742
- ...((_B = response.reasoning) == null ? void 0 : _B.context) != null ? { reasoningContext: response.reasoning.context } : {}
7062
+ ...((_C = response.reasoning) == null ? void 0 : _C.context) != null ? { reasoningContext: response.reasoning.context } : {}
6743
7063
  }
6744
7064
  };
6745
7065
  const usage = response.usage;
@@ -6747,10 +7067,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6747
7067
  content,
6748
7068
  finishReason: {
6749
7069
  unified: mapOpenAIResponseFinishReason({
6750
- finishReason: (_C = response.incomplete_details) == null ? void 0 : _C.reason,
7070
+ finishReason: (_D = response.incomplete_details) == null ? void 0 : _D.reason,
6751
7071
  hasFunctionCall
6752
7072
  }),
6753
- raw: (_E = (_D = response.incomplete_details) == null ? void 0 : _D.reason) != null ? _E : void 0
7073
+ raw: (_F = (_E = response.incomplete_details) == null ? void 0 : _E.reason) != null ? _F : void 0
6754
7074
  },
6755
7075
  usage: convertOpenAIResponsesUsage(usage),
6756
7076
  request: { body },
@@ -6828,7 +7148,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6828
7148
  controller.enqueue({ type: "stream-start", warnings });
6829
7149
  },
6830
7150
  transform(chunk, controller) {
6831
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
7151
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
6832
7152
  if (options.includeRawChunks) {
6833
7153
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
6834
7154
  }
@@ -6898,15 +7218,15 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6898
7218
  providerExecuted: true
6899
7219
  });
6900
7220
  } else if (value.item.type === "computer_call") {
7221
+ const toolCallId = (_a2 = value.item.call_id) != null ? _a2 : value.item.id;
6901
7222
  ongoingToolCalls[value.output_index] = {
6902
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6903
- toolCallId: value.item.id
7223
+ toolName: toolNameMapping.toCustomToolName("computer"),
7224
+ toolCallId
6904
7225
  };
6905
7226
  controller.enqueue({
6906
7227
  type: "tool-input-start",
6907
- id: value.item.id,
6908
- toolName: toolNameMapping.toCustomToolName("computer_use"),
6909
- providerExecuted: true
7228
+ id: toolCallId,
7229
+ toolName: toolNameMapping.toCustomToolName("computer")
6910
7230
  });
6911
7231
  } else if (value.item.type === "code_interpreter_call") {
6912
7232
  ongoingToolCalls[value.output_index] = {
@@ -6950,7 +7270,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
6950
7270
  ongoingToolCalls[value.output_index] = {
6951
7271
  toolName,
6952
7272
  toolCallId,
6953
- toolSearchExecution: (_a2 = value.item.execution) != null ? _a2 : "server"
7273
+ toolSearchExecution: (_b2 = value.item.execution) != null ? _b2 : "server"
6954
7274
  };
6955
7275
  if (isHosted) {
6956
7276
  controller.enqueue({
@@ -7007,7 +7327,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7007
7327
  } else if (value.item.type === "shell_call_output") {
7008
7328
  } else if (value.item.type === "message") {
7009
7329
  ongoingAnnotations.splice(0, ongoingAnnotations.length);
7010
- activeMessagePhase = (_b2 = value.item.phase) != null ? _b2 : void 0;
7330
+ activeMessagePhase = (_c = value.item.phase) != null ? _c : void 0;
7011
7331
  controller.enqueue({
7012
7332
  type: "text-start",
7013
7333
  id: value.item.id,
@@ -7031,14 +7351,14 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7031
7351
  providerMetadata: {
7032
7352
  [providerOptionsName]: {
7033
7353
  itemId: value.item.id,
7034
- reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null
7354
+ reasoningEncryptedContent: (_d = value.item.encrypted_content) != null ? _d : null
7035
7355
  }
7036
7356
  }
7037
7357
  });
7038
7358
  }
7039
7359
  } else if (isResponseOutputItemDoneChunk(value)) {
7040
7360
  if (value.item.type === "message") {
7041
- const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;
7361
+ const phase = (_e = value.item.phase) != null ? _e : activeMessagePhase;
7042
7362
  activeMessagePhase = void 0;
7043
7363
  controller.enqueue({
7044
7364
  type: "text-end",
@@ -7114,24 +7434,50 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7114
7434
  });
7115
7435
  } else if (value.item.type === "computer_call") {
7116
7436
  ongoingToolCalls[value.output_index] = void 0;
7437
+ if (value.item.call_id == null) {
7438
+ controller.enqueue({
7439
+ type: "tool-input-end",
7440
+ id: value.item.id
7441
+ });
7442
+ controller.enqueue({
7443
+ type: "tool-call",
7444
+ toolCallId: value.item.id,
7445
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
7446
+ input: "",
7447
+ providerExecuted: true
7448
+ });
7449
+ controller.enqueue({
7450
+ type: "tool-result",
7451
+ toolCallId: value.item.id,
7452
+ toolName: toolNameMapping.toCustomToolName("computer_use"),
7453
+ result: {
7454
+ type: "computer_use_tool_result",
7455
+ status: value.item.status
7456
+ }
7457
+ });
7458
+ return;
7459
+ }
7460
+ hasFunctionCall = true;
7461
+ const toolName = toolNameMapping.toCustomToolName("computer");
7462
+ const input = JSON.stringify(mapComputerCallInput(value.item));
7117
7463
  controller.enqueue({
7118
- type: "tool-input-end",
7119
- id: value.item.id
7464
+ type: "tool-input-delta",
7465
+ id: value.item.call_id,
7466
+ delta: input
7120
7467
  });
7121
7468
  controller.enqueue({
7122
- type: "tool-call",
7123
- toolCallId: value.item.id,
7124
- toolName: toolNameMapping.toCustomToolName("computer_use"),
7125
- input: "",
7126
- providerExecuted: true
7469
+ type: "tool-input-end",
7470
+ id: value.item.call_id
7127
7471
  });
7128
7472
  controller.enqueue({
7129
- type: "tool-result",
7130
- toolCallId: value.item.id,
7131
- toolName: toolNameMapping.toCustomToolName("computer_use"),
7132
- result: {
7133
- type: "computer_use_tool_result",
7134
- status: value.item.status || "completed"
7473
+ type: "tool-call",
7474
+ toolCallId: value.item.call_id,
7475
+ toolName,
7476
+ input,
7477
+ providerMetadata: {
7478
+ [providerOptionsName]: {
7479
+ itemId: value.item.id
7480
+ }
7135
7481
  }
7136
7482
  });
7137
7483
  } else if (value.item.type === "file_search_call") {
@@ -7142,13 +7488,13 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7142
7488
  toolName: toolNameMapping.toCustomToolName("file_search"),
7143
7489
  result: {
7144
7490
  queries: value.item.queries,
7145
- results: (_f = (_e = value.item.results) == null ? void 0 : _e.map((result2) => ({
7491
+ results: (_g = (_f = value.item.results) == null ? void 0 : _f.map((result2) => ({
7146
7492
  attributes: result2.attributes,
7147
7493
  fileId: result2.file_id,
7148
7494
  filename: result2.filename,
7149
7495
  score: result2.score,
7150
7496
  text: result2.text
7151
- }))) != null ? _f : null
7497
+ }))) != null ? _g : null
7152
7498
  }
7153
7499
  });
7154
7500
  } else if (value.item.type === "code_interpreter_call") {
@@ -7174,7 +7520,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7174
7520
  const toolCall = ongoingToolCalls[value.output_index];
7175
7521
  const isHosted = value.item.execution === "server";
7176
7522
  if (toolCall != null) {
7177
- const toolCallId = isHosted ? toolCall.toolCallId : (_g = value.item.call_id) != null ? _g : value.item.id;
7523
+ const toolCallId = isHosted ? toolCall.toolCallId : (_h = value.item.call_id) != null ? _h : value.item.id;
7178
7524
  if (isHosted) {
7179
7525
  hostedToolSearchCallIds.push(toolCallId);
7180
7526
  } else {
@@ -7206,7 +7552,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7206
7552
  }
7207
7553
  ongoingToolCalls[value.output_index] = void 0;
7208
7554
  } else if (value.item.type === "tool_search_output") {
7209
- const toolCallId = (_i = (_h = value.item.call_id) != null ? _h : hostedToolSearchCallIds.shift()) != null ? _i : value.item.id;
7555
+ const toolCallId = (_j = (_i = value.item.call_id) != null ? _i : hostedToolSearchCallIds.shift()) != null ? _j : value.item.id;
7210
7556
  controller.enqueue({
7211
7557
  type: "tool-result",
7212
7558
  toolCallId,
@@ -7222,10 +7568,10 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7222
7568
  });
7223
7569
  } else if (value.item.type === "mcp_call") {
7224
7570
  ongoingToolCalls[value.output_index] = void 0;
7225
- const approvalRequestId = (_j = value.item.approval_request_id) != null ? _j : void 0;
7226
- const aliasedToolCallId = approvalRequestId != null ? (_l = (_k = approvalRequestIdToDummyToolCallIdFromStream.get(
7571
+ const approvalRequestId = (_k = value.item.approval_request_id) != null ? _k : void 0;
7572
+ const aliasedToolCallId = approvalRequestId != null ? (_m = (_l = approvalRequestIdToDummyToolCallIdFromStream.get(
7227
7573
  approvalRequestId
7228
- )) != null ? _k : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _l : value.item.id : value.item.id;
7574
+ )) != null ? _l : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _m : value.item.id : value.item.id;
7229
7575
  const toolName = `mcp.${value.item.name}`;
7230
7576
  controller.enqueue({
7231
7577
  type: "tool-call",
@@ -7295,8 +7641,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7295
7641
  ongoingToolCalls[value.output_index] = void 0;
7296
7642
  } else if (value.item.type === "mcp_approval_request") {
7297
7643
  ongoingToolCalls[value.output_index] = void 0;
7298
- const dummyToolCallId = (_o = (_n = (_m = self.config).generateId) == null ? void 0 : _n.call(_m)) != null ? _o : generateId2();
7299
- const approvalRequestId = (_p = value.item.approval_request_id) != null ? _p : value.item.id;
7644
+ const dummyToolCallId = (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : generateId2();
7645
+ const approvalRequestId = (_q = value.item.approval_request_id) != null ? _q : value.item.id;
7300
7646
  approvalRequestIdToDummyToolCallIdFromStream.set(
7301
7647
  approvalRequestId,
7302
7648
  dummyToolCallId
@@ -7385,7 +7731,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7385
7731
  providerMetadata: {
7386
7732
  [providerOptionsName]: {
7387
7733
  itemId: value.item.id,
7388
- reasoningEncryptedContent: (_q = value.item.encrypted_content) != null ? _q : null
7734
+ reasoningEncryptedContent: (_r = value.item.encrypted_content) != null ? _r : null
7389
7735
  }
7390
7736
  }
7391
7737
  });
@@ -7510,7 +7856,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7510
7856
  id: value.item_id,
7511
7857
  delta: value.delta
7512
7858
  });
7513
- if (((_s = (_r = options.providerOptions) == null ? void 0 : _r[providerOptionsName]) == null ? void 0 : _s.logprobs) && value.logprobs) {
7859
+ if (((_t = (_s = options.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.logprobs) && value.logprobs) {
7514
7860
  logprobs.push(value.logprobs);
7515
7861
  }
7516
7862
  } else if (value.type === "response.reasoning_summary_part.added") {
@@ -7539,7 +7885,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7539
7885
  providerMetadata: {
7540
7886
  [providerOptionsName]: {
7541
7887
  itemId: value.item_id,
7542
- reasoningEncryptedContent: (_u = (_t = activeReasoning[value.item_id]) == null ? void 0 : _t.encryptedContent) != null ? _u : null
7888
+ reasoningEncryptedContent: (_v = (_u = activeReasoning[value.item_id]) == null ? void 0 : _u.encryptedContent) != null ? _v : null
7543
7889
  }
7544
7890
  }
7545
7891
  });
@@ -7573,20 +7919,20 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7573
7919
  } else if (isResponseFinishedChunk(value)) {
7574
7920
  finishReason = {
7575
7921
  unified: mapOpenAIResponseFinishReason({
7576
- finishReason: (_v = value.response.incomplete_details) == null ? void 0 : _v.reason,
7922
+ finishReason: (_w = value.response.incomplete_details) == null ? void 0 : _w.reason,
7577
7923
  hasFunctionCall
7578
7924
  }),
7579
- raw: (_x = (_w = value.response.incomplete_details) == null ? void 0 : _w.reason) != null ? _x : void 0
7925
+ raw: (_y = (_x = value.response.incomplete_details) == null ? void 0 : _x.reason) != null ? _y : void 0
7580
7926
  };
7581
7927
  usage = value.response.usage;
7582
7928
  if (typeof value.response.service_tier === "string") {
7583
7929
  serviceTier = value.response.service_tier;
7584
7930
  }
7585
- if (((_y = value.response.reasoning) == null ? void 0 : _y.context) != null) {
7931
+ if (((_z = value.response.reasoning) == null ? void 0 : _z.context) != null) {
7586
7932
  reasoningContext = value.response.reasoning.context;
7587
7933
  }
7588
7934
  } else if (isResponseFailedChunk(value)) {
7589
- const incompleteReason = (_z = value.response.incomplete_details) == null ? void 0 : _z.reason;
7935
+ const incompleteReason = (_A = value.response.incomplete_details) == null ? void 0 : _A.reason;
7590
7936
  finishReason = {
7591
7937
  unified: incompleteReason ? mapOpenAIResponseFinishReason({
7592
7938
  finishReason: incompleteReason,
@@ -7594,8 +7940,8 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7594
7940
  }) : "error",
7595
7941
  raw: incompleteReason != null ? incompleteReason : "error"
7596
7942
  };
7597
- usage = (_A = value.response.usage) != null ? _A : void 0;
7598
- if (((_B = value.response.reasoning) == null ? void 0 : _B.context) != null) {
7943
+ usage = (_B = value.response.usage) != null ? _B : void 0;
7944
+ if (((_C = value.response.reasoning) == null ? void 0 : _C.context) != null) {
7599
7945
  reasoningContext = value.response.reasoning.context;
7600
7946
  }
7601
7947
  if (!encounteredStreamError && value.response.error != null) {
@@ -7619,7 +7965,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7619
7965
  controller.enqueue({
7620
7966
  type: "source",
7621
7967
  sourceType: "url",
7622
- id: (_E = (_D = (_C = self.config).generateId) == null ? void 0 : _D.call(_C)) != null ? _E : generateId2(),
7968
+ id: (_F = (_E = (_D = self.config).generateId) == null ? void 0 : _E.call(_D)) != null ? _F : generateId2(),
7623
7969
  url: value.annotation.url,
7624
7970
  title: value.annotation.title
7625
7971
  });
@@ -7627,7 +7973,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7627
7973
  controller.enqueue({
7628
7974
  type: "source",
7629
7975
  sourceType: "document",
7630
- id: (_H = (_G = (_F = self.config).generateId) == null ? void 0 : _G.call(_F)) != null ? _H : generateId2(),
7976
+ id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),
7631
7977
  mediaType: "text/plain",
7632
7978
  title: value.annotation.filename,
7633
7979
  filename: value.annotation.filename,
@@ -7643,7 +7989,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7643
7989
  controller.enqueue({
7644
7990
  type: "source",
7645
7991
  sourceType: "document",
7646
- id: (_K = (_J = (_I = self.config).generateId) == null ? void 0 : _J.call(_I)) != null ? _K : generateId2(),
7992
+ id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),
7647
7993
  mediaType: "text/plain",
7648
7994
  title: value.annotation.filename,
7649
7995
  filename: value.annotation.filename,
@@ -7659,7 +8005,7 @@ var OpenAIResponsesLanguageModel = class _OpenAIResponsesLanguageModel {
7659
8005
  controller.enqueue({
7660
8006
  type: "source",
7661
8007
  sourceType: "document",
7662
- id: (_N = (_M = (_L = self.config).generateId) == null ? void 0 : _M.call(_L)) != null ? _N : generateId2(),
8008
+ id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),
7663
8009
  mediaType: "application/octet-stream",
7664
8010
  title: value.annotation.file_id,
7665
8011
  filename: value.annotation.file_id,