@xyd-js/ask-ai-widget 0.0.0-build-6675456-20251014012658 → 0.0.0-build-e4644f3-20251015210712

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.
@@ -41223,7 +41223,7 @@ async function* executeTool({
41223
41223
  }
41224
41224
  }
41225
41225
 
41226
- // ../../node_modules/.pnpm/@ai-sdk+gateway@1.0.39_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
41226
+ // ../../node_modules/.pnpm/@ai-sdk+gateway@1.0.40_zod@3.25.76/node_modules/@ai-sdk/gateway/dist/index.mjs
41227
41227
  var import_oidc = __toESM(require_dist(), 1);
41228
41228
  var import_oidc2 = __toESM(require_dist(), 1);
41229
41229
  var marker15 = "vercel.ai.gateway.error";
@@ -41789,7 +41789,7 @@ async function getVercelRequestId() {
41789
41789
  var _a82;
41790
41790
  return (_a82 = import_oidc.getContext().headers) == null ? undefined : _a82["x-vercel-id"];
41791
41791
  }
41792
- var VERSION2 = "1.0.39";
41792
+ var VERSION2 = "1.0.40";
41793
41793
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
41794
41794
  function createGatewayProvider(options = {}) {
41795
41795
  var _a82, _b8;
@@ -41919,7 +41919,7 @@ async function getGatewayAuthToken(options) {
41919
41919
  }
41920
41920
  }
41921
41921
 
41922
- // ../../node_modules/.pnpm/ai@5.0.68_zod@3.25.76/node_modules/ai/dist/index.mjs
41922
+ // ../../node_modules/.pnpm/ai@5.0.72_zod@3.25.76/node_modules/ai/dist/index.mjs
41923
41923
  var import_api2 = __toESM(require_src2(), 1);
41924
41924
  var import_api3 = __toESM(require_src2(), 1);
41925
41925
  var __defProp2 = Object.defineProperty;
@@ -42345,7 +42345,7 @@ function detectMediaType({
42345
42345
  }
42346
42346
  return;
42347
42347
  }
42348
- var VERSION3 = "5.0.68";
42348
+ var VERSION3 = "5.0.72";
42349
42349
  var download = async ({ url: url2 }) => {
42350
42350
  var _a172;
42351
42351
  const urlText = url2.toString();
@@ -43587,7 +43587,12 @@ function writeToServerResponse({
43587
43587
  const { done, value } = await reader.read();
43588
43588
  if (done)
43589
43589
  break;
43590
- response.write(value);
43590
+ const canContinue = response.write(value);
43591
+ if (!canContinue) {
43592
+ await new Promise((resolve2) => {
43593
+ response.once("drain", resolve2);
43594
+ });
43595
+ }
43591
43596
  }
43592
43597
  } catch (error40) {
43593
43598
  throw error40;
@@ -47504,8 +47509,8 @@ async function pkceChallenge(length) {
47504
47509
  };
47505
47510
  }
47506
47511
 
47507
- // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.27_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
47508
- var VERSION4 = "2.0.27";
47512
+ // ../../node_modules/.pnpm/@ai-sdk+anthropic@2.0.30_zod@3.25.76/node_modules/@ai-sdk/anthropic/dist/index.mjs
47513
+ var VERSION4 = "2.0.30";
47509
47514
  var anthropicErrorDataSchema = lazySchema(() => zodSchema(exports_external.object({
47510
47515
  type: exports_external.literal("error"),
47511
47516
  error: exports_external.object({
@@ -47629,6 +47634,56 @@ var anthropicMessagesResponseSchema = lazySchema(() => zodSchema(exports_externa
47629
47634
  error_code: exports_external.string()
47630
47635
  })
47631
47636
  ])
47637
+ }),
47638
+ exports_external.object({
47639
+ type: exports_external.literal("bash_code_execution_tool_result"),
47640
+ tool_use_id: exports_external.string(),
47641
+ content: exports_external.discriminatedUnion("type", [
47642
+ exports_external.object({
47643
+ type: exports_external.literal("bash_code_execution_result"),
47644
+ content: exports_external.array(exports_external.object({
47645
+ type: exports_external.literal("bash_code_execution_output"),
47646
+ file_id: exports_external.string()
47647
+ })),
47648
+ stdout: exports_external.string(),
47649
+ stderr: exports_external.string(),
47650
+ return_code: exports_external.number()
47651
+ }),
47652
+ exports_external.object({
47653
+ type: exports_external.literal("bash_code_execution_tool_result_error"),
47654
+ error_code: exports_external.string()
47655
+ })
47656
+ ])
47657
+ }),
47658
+ exports_external.object({
47659
+ type: exports_external.literal("text_editor_code_execution_tool_result"),
47660
+ tool_use_id: exports_external.string(),
47661
+ content: exports_external.discriminatedUnion("type", [
47662
+ exports_external.object({
47663
+ type: exports_external.literal("text_editor_code_execution_tool_result_error"),
47664
+ error_code: exports_external.string()
47665
+ }),
47666
+ exports_external.object({
47667
+ type: exports_external.literal("text_editor_code_execution_view_result"),
47668
+ content: exports_external.string(),
47669
+ file_type: exports_external.string(),
47670
+ num_lines: exports_external.number().nullable(),
47671
+ start_line: exports_external.number().nullable(),
47672
+ total_lines: exports_external.number().nullable()
47673
+ }),
47674
+ exports_external.object({
47675
+ type: exports_external.literal("text_editor_code_execution_create_result"),
47676
+ is_file_update: exports_external.boolean()
47677
+ }),
47678
+ exports_external.object({
47679
+ type: exports_external.literal("text_editor_code_execution_str_replace_result"),
47680
+ lines: exports_external.array(exports_external.string()).nullable(),
47681
+ new_lines: exports_external.number().nullable(),
47682
+ new_start: exports_external.number().nullable(),
47683
+ old_lines: exports_external.number().nullable(),
47684
+ old_start: exports_external.number().nullable()
47685
+ })
47686
+ ])
47632
47687
  })
47633
47688
  ])),
47634
47689
  stop_reason: exports_external.string().nullish(),
@@ -47737,6 +47792,56 @@ var anthropicMessagesChunkSchema = lazySchema(() => zodSchema(exports_external.d
47737
47792
  error_code: exports_external.string()
47738
47793
  })
47739
47794
  ])
47795
+ }),
47796
+ exports_external.object({
47797
+ type: exports_external.literal("bash_code_execution_tool_result"),
47798
+ tool_use_id: exports_external.string(),
47799
+ content: exports_external.discriminatedUnion("type", [
47800
+ exports_external.object({
47801
+ type: exports_external.literal("bash_code_execution_result"),
47802
+ content: exports_external.array(exports_external.object({
47803
+ type: exports_external.literal("bash_code_execution_output"),
47804
+ file_id: exports_external.string()
47805
+ })),
47806
+ stdout: exports_external.string(),
47807
+ stderr: exports_external.string(),
47808
+ return_code: exports_external.number()
47809
+ }),
47810
+ exports_external.object({
47811
+ type: exports_external.literal("bash_code_execution_tool_result_error"),
47812
+ error_code: exports_external.string()
47813
+ })
47814
+ ])
47815
+ }),
47816
+ exports_external.object({
47817
+ type: exports_external.literal("text_editor_code_execution_tool_result"),
47818
+ tool_use_id: exports_external.string(),
47819
+ content: exports_external.discriminatedUnion("type", [
47820
+ exports_external.object({
47821
+ type: exports_external.literal("text_editor_code_execution_tool_result_error"),
47822
+ error_code: exports_external.string()
47823
+ }),
47824
+ exports_external.object({
47825
+ type: exports_external.literal("text_editor_code_execution_view_result"),
47826
+ content: exports_external.string(),
47827
+ file_type: exports_external.string(),
47828
+ num_lines: exports_external.number().nullable(),
47829
+ start_line: exports_external.number().nullable(),
47830
+ total_lines: exports_external.number().nullable()
47831
+ }),
47832
+ exports_external.object({
47833
+ type: exports_external.literal("text_editor_code_execution_create_result"),
47834
+ is_file_update: exports_external.boolean()
47835
+ }),
47836
+ exports_external.object({
47837
+ type: exports_external.literal("text_editor_code_execution_str_replace_result"),
47838
+ lines: exports_external.array(exports_external.string()).nullable(),
47839
+ new_lines: exports_external.number().nullable(),
47840
+ new_start: exports_external.number().nullable(),
47841
+ old_lines: exports_external.number().nullable(),
47842
+ old_start: exports_external.number().nullable()
47843
+ })
47844
+ ])
47740
47845
  })
47741
47846
  ])
47742
47847
  }),
@@ -47974,6 +48079,14 @@ async function prepareTools({
47974
48079
  });
47975
48080
  break;
47976
48081
  }
48082
+ case "anthropic.code_execution_20250825": {
48083
+ betas.add("code-execution-2025-08-25");
48084
+ anthropicTools2.push({
48085
+ type: "code_execution_20250825",
48086
+ name: "code_execution"
48087
+ });
48088
+ break;
48089
+ }
47977
48090
  case "anthropic.computer_20250124": {
47978
48091
  betas.add("computer-use-2025-01-24");
47979
48092
  anthropicTools2.push({
@@ -48048,6 +48161,14 @@ async function prepareTools({
48048
48161
  });
48049
48162
  break;
48050
48163
  }
48164
+ case "anthropic.memory_20250818": {
48165
+ betas.add("context-management-2025-06-27");
48166
+ anthropicTools2.push({
48167
+ name: "memory",
48168
+ type: "memory_20250818"
48169
+ });
48170
+ break;
48171
+ }
48051
48172
  case "anthropic.web_fetch_20250910": {
48052
48173
  betas.add("web-fetch-2025-09-10");
48053
48174
  const args = await validateTypes({
@@ -48162,6 +48283,81 @@ var factory4 = createProviderDefinedToolFactoryWithOutputSchema({
48162
48283
  var codeExecution_20250522 = (args = {}) => {
48163
48284
  return factory4(args);
48164
48285
  };
48286
+ var codeExecution_20250825OutputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
48287
+ exports_external.object({
48288
+ type: exports_external.literal("bash_code_execution_result"),
48289
+ content: exports_external.array(exports_external.object({
48290
+ type: exports_external.literal("bash_code_execution_output"),
48291
+ file_id: exports_external.string()
48292
+ })),
48293
+ stdout: exports_external.string(),
48294
+ stderr: exports_external.string(),
48295
+ return_code: exports_external.number()
48296
+ }),
48297
+ exports_external.object({
48298
+ type: exports_external.literal("bash_code_execution_tool_result_error"),
48299
+ error_code: exports_external.string()
48300
+ }),
48301
+ exports_external.object({
48302
+ type: exports_external.literal("text_editor_code_execution_tool_result_error"),
48303
+ error_code: exports_external.string()
48304
+ }),
48305
+ exports_external.object({
48306
+ type: exports_external.literal("text_editor_code_execution_view_result"),
48307
+ content: exports_external.string(),
48308
+ file_type: exports_external.string(),
48309
+ num_lines: exports_external.number().nullable(),
48310
+ start_line: exports_external.number().nullable(),
48311
+ total_lines: exports_external.number().nullable()
48312
+ }),
48313
+ exports_external.object({
48314
+ type: exports_external.literal("text_editor_code_execution_create_result"),
48315
+ is_file_update: exports_external.boolean()
48316
+ }),
48317
+ exports_external.object({
48318
+ type: exports_external.literal("text_editor_code_execution_str_replace_result"),
48319
+ lines: exports_external.array(exports_external.string()).nullable(),
48320
+ new_lines: exports_external.number().nullable(),
48321
+ new_start: exports_external.number().nullable(),
48322
+ old_lines: exports_external.number().nullable(),
48323
+ old_start: exports_external.number().nullable()
48324
+ })
48325
+ ])));
48326
+ var codeExecution_20250825InputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("type", [
48327
+ exports_external.object({
48328
+ type: exports_external.literal("bash_code_execution"),
48329
+ command: exports_external.string()
48330
+ }),
48331
+ exports_external.discriminatedUnion("command", [
48332
+ exports_external.object({
48333
+ type: exports_external.literal("text_editor_code_execution"),
48334
+ command: exports_external.literal("view"),
48335
+ path: exports_external.string()
48336
+ }),
48337
+ exports_external.object({
48338
+ type: exports_external.literal("text_editor_code_execution"),
48339
+ command: exports_external.literal("create"),
48340
+ path: exports_external.string(),
48341
+ file_text: exports_external.string().nullish()
48342
+ }),
48343
+ exports_external.object({
48344
+ type: exports_external.literal("text_editor_code_execution"),
48345
+ command: exports_external.literal("str_replace"),
48346
+ path: exports_external.string(),
48347
+ old_str: exports_external.string(),
48348
+ new_str: exports_external.string()
48349
+ })
48350
+ ])
48351
+ ])));
48352
+ var factory5 = createProviderDefinedToolFactoryWithOutputSchema({
48353
+ id: "anthropic.code_execution_20250825",
48354
+ name: "code_execution",
48355
+ inputSchema: codeExecution_20250825InputSchema,
48356
+ outputSchema: codeExecution_20250825OutputSchema
48357
+ });
48358
+ var codeExecution_20250825 = (args = {}) => {
48359
+ return factory5(args);
48360
+ };
48165
48361
  function convertToString(data) {
48166
48362
  if (typeof data === "string") {
48167
48363
  return Buffer.from(data, "base64").toString("utf-8");
@@ -48450,7 +48646,15 @@ async function convertToAnthropicMessagesPrompt({
48450
48646
  }
48451
48647
  case "tool-call": {
48452
48648
  if (part.providerExecuted) {
48453
- if (part.toolName === "code_execution" || part.toolName === "web_fetch" || part.toolName === "web_search") {
48649
+ if (part.toolName === "code_execution" && part.input != null && typeof part.input === "object" && "type" in part.input && typeof part.input.type === "string" && (part.input.type === "bash_code_execution" || part.input.type === "text_editor_code_execution")) {
48650
+ anthropicContent.push({
48651
+ type: "server_tool_use",
48652
+ id: part.toolCallId,
48653
+ name: part.input.type,
48654
+ input: part.input,
48655
+ cache_control: cacheControl
48656
+ });
48657
+ } else if (part.toolName === "code_execution" || part.toolName === "web_fetch" || part.toolName === "web_search") {
48454
48658
  anthropicContent.push({
48455
48659
  type: "server_tool_use",
48456
48660
  id: part.toolCallId,
@@ -48485,21 +48689,46 @@ async function convertToAnthropicMessagesPrompt({
48485
48689
  });
48486
48690
  break;
48487
48691
  }
48488
- const codeExecutionOutput = await validateTypes({
48489
- value: output.value,
48490
- schema: codeExecution_20250522OutputSchema
48491
- });
48492
- anthropicContent.push({
48493
- type: "code_execution_tool_result",
48494
- tool_use_id: part.toolCallId,
48495
- content: {
48496
- type: codeExecutionOutput.type,
48497
- stdout: codeExecutionOutput.stdout,
48498
- stderr: codeExecutionOutput.stderr,
48499
- return_code: codeExecutionOutput.return_code
48500
- },
48501
- cache_control: cacheControl
48502
- });
48692
+ if (output.value == null || typeof output.value !== "object" || !("type" in output.value) || typeof output.value.type !== "string") {
48693
+ warnings.push({
48694
+ type: "other",
48695
+ message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`
48696
+ });
48697
+ break;
48698
+ }
48699
+ if (output.value.type === "code_execution_result") {
48700
+ const codeExecutionOutput = await validateTypes({
48701
+ value: output.value,
48702
+ schema: codeExecution_20250522OutputSchema
48703
+ });
48704
+ anthropicContent.push({
48705
+ type: "code_execution_tool_result",
48706
+ tool_use_id: part.toolCallId,
48707
+ content: {
48708
+ type: codeExecutionOutput.type,
48709
+ stdout: codeExecutionOutput.stdout,
48710
+ stderr: codeExecutionOutput.stderr,
48711
+ return_code: codeExecutionOutput.return_code
48712
+ },
48713
+ cache_control: cacheControl
48714
+ });
48715
+ } else {
48716
+ const codeExecutionOutput = await validateTypes({
48717
+ value: output.value,
48718
+ schema: codeExecution_20250825OutputSchema
48719
+ });
48720
+ anthropicContent.push(codeExecutionOutput.type === "bash_code_execution_result" || codeExecutionOutput.type === "bash_code_execution_tool_result_error" ? {
48721
+ type: "bash_code_execution_tool_result",
48722
+ tool_use_id: part.toolCallId,
48723
+ cache_control: cacheControl,
48724
+ content: codeExecutionOutput
48725
+ } : {
48726
+ type: "text_editor_code_execution_tool_result",
48727
+ tool_use_id: part.toolCallId,
48728
+ cache_control: cacheControl,
48729
+ content: codeExecutionOutput
48730
+ });
48731
+ }
48503
48732
  break;
48504
48733
  }
48505
48734
  if (part.toolName === "web_fetch") {
@@ -48945,7 +49174,15 @@ var AnthropicMessagesLanguageModel = class {
48945
49174
  break;
48946
49175
  }
48947
49176
  case "server_tool_use": {
48948
- if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
49177
+ if (part.name === "text_editor_code_execution" || part.name === "bash_code_execution") {
49178
+ content.push({
49179
+ type: "tool-call",
49180
+ toolCallId: part.id,
49181
+ toolName: "code_execution",
49182
+ input: JSON.stringify({ type: part.name, ...part.input }),
49183
+ providerExecuted: true
49184
+ });
49185
+ } else if (part.name === "web_search" || part.name === "code_execution" || part.name === "web_fetch") {
48949
49186
  content.push({
48950
49187
  type: "tool-call",
48951
49188
  toolCallId: part.id,
@@ -49070,6 +49307,17 @@ var AnthropicMessagesLanguageModel = class {
49070
49307
  }
49071
49308
  break;
49072
49309
  }
49310
+ case "bash_code_execution_tool_result":
49311
+ case "text_editor_code_execution_tool_result": {
49312
+ content.push({
49313
+ type: "tool-result",
49314
+ toolCallId: part.tool_use_id,
49315
+ toolName: "code_execution",
49316
+ result: part.content,
49317
+ providerExecuted: true
49318
+ });
49319
+ break;
49320
+ }
49073
49321
  }
49074
49322
  }
49075
49323
  return {
@@ -49183,7 +49431,8 @@ var AnthropicMessagesLanguageModel = class {
49183
49431
  type: "tool-call",
49184
49432
  toolCallId: value.content_block.id,
49185
49433
  toolName: value.content_block.name,
49186
- input: ""
49434
+ input: "",
49435
+ firstDelta: true
49187
49436
  };
49188
49437
  controller.enqueue(usesJsonResponseTool ? { type: "text-start", id: String(value.index) } : {
49189
49438
  type: "tool-input-start",
@@ -49193,18 +49442,26 @@ var AnthropicMessagesLanguageModel = class {
49193
49442
  return;
49194
49443
  }
49195
49444
  case "server_tool_use": {
49196
- if (value.content_block.name === "web_fetch" || value.content_block.name === "web_search" || value.content_block.name === "code_execution") {
49445
+ if ([
49446
+ "web_fetch",
49447
+ "web_search",
49448
+ "code_execution",
49449
+ "text_editor_code_execution",
49450
+ "bash_code_execution"
49451
+ ].includes(value.content_block.name)) {
49197
49452
  contentBlocks[value.index] = {
49198
49453
  type: "tool-call",
49199
49454
  toolCallId: value.content_block.id,
49200
49455
  toolName: value.content_block.name,
49201
49456
  input: "",
49202
- providerExecuted: true
49457
+ providerExecuted: true,
49458
+ firstDelta: true
49203
49459
  };
49460
+ const mappedToolName = value.content_block.name === "text_editor_code_execution" || value.content_block.name === "bash_code_execution" ? "code_execution" : value.content_block.name;
49204
49461
  controller.enqueue({
49205
49462
  type: "tool-input-start",
49206
49463
  id: value.content_block.id,
49207
- toolName: value.content_block.name,
49464
+ toolName: mappedToolName,
49208
49465
  providerExecuted: true
49209
49466
  });
49210
49467
  }
@@ -49326,6 +49583,18 @@ var AnthropicMessagesLanguageModel = class {
49326
49583
  }
49327
49584
  return;
49328
49585
  }
49586
+ case "bash_code_execution_tool_result":
49587
+ case "text_editor_code_execution_tool_result": {
49588
+ const part = value.content_block;
49589
+ controller.enqueue({
49590
+ type: "tool-result",
49591
+ toolCallId: part.tool_use_id,
49592
+ toolName: "code_execution",
49593
+ result: part.content,
49594
+ providerExecuted: true
49595
+ });
49596
+ return;
49597
+ }
49329
49598
  default: {
49330
49599
  const _exhaustiveCheck = contentBlockType;
49331
49600
  throw new Error(`Unsupported content block type: ${_exhaustiveCheck}`);
@@ -49356,7 +49625,14 @@ var AnthropicMessagesLanguageModel = class {
49356
49625
  type: "tool-input-end",
49357
49626
  id: contentBlock.toolCallId
49358
49627
  });
49359
- controller.enqueue(contentBlock);
49628
+ const toolName = contentBlock.toolName === "text_editor_code_execution" || contentBlock.toolName === "bash_code_execution" ? "code_execution" : contentBlock.toolName;
49629
+ controller.enqueue({
49630
+ type: "tool-call",
49631
+ toolCallId: contentBlock.toolCallId,
49632
+ toolName,
49633
+ input: contentBlock.input,
49634
+ providerExecuted: contentBlock.providerExecuted
49635
+ });
49360
49636
  }
49361
49637
  break;
49362
49638
  }
@@ -49404,7 +49680,10 @@ var AnthropicMessagesLanguageModel = class {
49404
49680
  }
49405
49681
  case "input_json_delta": {
49406
49682
  const contentBlock = contentBlocks[value.index];
49407
- const delta = value.delta.partial_json;
49683
+ let delta = value.delta.partial_json;
49684
+ if (delta.length === 0) {
49685
+ return;
49686
+ }
49408
49687
  if (usesJsonResponseTool) {
49409
49688
  if ((contentBlock == null ? undefined : contentBlock.type) !== "text") {
49410
49689
  return;
@@ -49418,12 +49697,16 @@ var AnthropicMessagesLanguageModel = class {
49418
49697
  if ((contentBlock == null ? undefined : contentBlock.type) !== "tool-call") {
49419
49698
  return;
49420
49699
  }
49700
+ if (contentBlock.firstDelta && (contentBlock.toolName === "bash_code_execution" || contentBlock.toolName === "text_editor_code_execution")) {
49701
+ delta = `{"type": "${contentBlock.toolName}",${delta.substring(1)}`;
49702
+ }
49421
49703
  controller.enqueue({
49422
49704
  type: "tool-input-delta",
49423
49705
  id: contentBlock.toolCallId,
49424
49706
  delta
49425
49707
  });
49426
49708
  contentBlock.input += delta;
49709
+ contentBlock.firstDelta = false;
49427
49710
  }
49428
49711
  return;
49429
49712
  }
@@ -49570,6 +49853,44 @@ var computer_20250124 = createProviderDefinedToolFactory({
49570
49853
  name: "computer",
49571
49854
  inputSchema: computer_20250124InputSchema
49572
49855
  });
49856
+ var memory_20250818InputSchema = lazySchema(() => zodSchema(exports_external.discriminatedUnion("command", [
49857
+ exports_external.object({
49858
+ command: exports_external.literal("view"),
49859
+ path: exports_external.string(),
49860
+ view_range: exports_external.tuple([exports_external.number(), exports_external.number()]).optional()
49861
+ }),
49862
+ exports_external.object({
49863
+ command: exports_external.literal("create"),
49864
+ path: exports_external.string(),
49865
+ file_text: exports_external.string()
49866
+ }),
49867
+ exports_external.object({
49868
+ command: exports_external.literal("str_replace"),
49869
+ path: exports_external.string(),
49870
+ old_str: exports_external.string(),
49871
+ new_str: exports_external.string()
49872
+ }),
49873
+ exports_external.object({
49874
+ command: exports_external.literal("insert"),
49875
+ path: exports_external.string(),
49876
+ insert_line: exports_external.number(),
49877
+ insert_text: exports_external.string()
49878
+ }),
49879
+ exports_external.object({
49880
+ command: exports_external.literal("delete"),
49881
+ path: exports_external.string()
49882
+ }),
49883
+ exports_external.object({
49884
+ command: exports_external.literal("rename"),
49885
+ old_path: exports_external.string(),
49886
+ new_path: exports_external.string()
49887
+ })
49888
+ ])));
49889
+ var memory_20250818 = createProviderDefinedToolFactory({
49890
+ id: "anthropic.memory_20250818",
49891
+ name: "memory",
49892
+ inputSchema: memory_20250818InputSchema
49893
+ });
49573
49894
  var textEditor_20241022InputSchema = lazySchema(() => zodSchema(exports_external.object({
49574
49895
  command: exports_external.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
49575
49896
  path: exports_external.string(),
@@ -49616,8 +49937,10 @@ var anthropicTools = {
49616
49937
  bash_20241022,
49617
49938
  bash_20250124,
49618
49939
  codeExecution_20250522,
49940
+ codeExecution_20250825,
49619
49941
  computer_20241022,
49620
49942
  computer_20250124,
49943
+ memory_20250818,
49621
49944
  textEditor_20241022,
49622
49945
  textEditor_20250124,
49623
49946
  textEditor_20250429,
@@ -49670,7 +49993,7 @@ function createAnthropic(options = {}) {
49670
49993
  }
49671
49994
  var anthropic = createAnthropic();
49672
49995
 
49673
- // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.50_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
49996
+ // ../../node_modules/.pnpm/@ai-sdk+openai@2.0.52_zod@3.25.76/node_modules/@ai-sdk/openai/dist/index.mjs
49674
49997
  var openaiErrorDataSchema = exports_external.object({
49675
49998
  error: exports_external.object({
49676
49999
  message: exports_external.string(),
@@ -51211,9 +51534,7 @@ var localShell = createProviderDefinedToolFactoryWithOutputSchema({
51211
51534
  outputSchema: localShellOutputSchema
51212
51535
  });
51213
51536
  var webSearchArgsSchema = lazySchema(() => zodSchema(exports_external.object({
51214
- filters: exports_external.object({
51215
- allowedDomains: exports_external.array(exports_external.string()).optional()
51216
- }).optional(),
51537
+ filters: exports_external.object({ allowedDomains: exports_external.array(exports_external.string()).optional() }).optional(),
51217
51538
  searchContextSize: exports_external.enum(["low", "medium", "high"]).optional(),
51218
51539
  userLocation: exports_external.object({
51219
51540
  type: exports_external.literal("approximate"),
@@ -51223,14 +51544,15 @@ var webSearchArgsSchema = lazySchema(() => zodSchema(exports_external.object({
51223
51544
  timezone: exports_external.string().optional()
51224
51545
  }).optional()
51225
51546
  })));
51226
- var webSearchInputSchema = lazySchema(() => zodSchema(exports_external.object({
51547
+ var webSearchInputSchema = lazySchema(() => zodSchema(exports_external.object({})));
51548
+ var webSearchOutputSchema = lazySchema(() => zodSchema(exports_external.object({
51227
51549
  action: exports_external.discriminatedUnion("type", [
51228
51550
  exports_external.object({
51229
51551
  type: exports_external.literal("search"),
51230
- query: exports_external.string().nullish()
51552
+ query: exports_external.string().optional()
51231
51553
  }),
51232
51554
  exports_external.object({
51233
- type: exports_external.literal("open_page"),
51555
+ type: exports_external.literal("openPage"),
51234
51556
  url: exports_external.string()
51235
51557
  }),
51236
51558
  exports_external.object({
@@ -51238,16 +51560,15 @@ var webSearchInputSchema = lazySchema(() => zodSchema(exports_external.object({
51238
51560
  url: exports_external.string(),
51239
51561
  pattern: exports_external.string()
51240
51562
  })
51241
- ]).nullish()
51563
+ ])
51242
51564
  })));
51243
- var webSearchToolFactory = createProviderDefinedToolFactory({
51565
+ var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema({
51244
51566
  id: "openai.web_search",
51245
51567
  name: "web_search",
51246
- inputSchema: webSearchInputSchema
51568
+ inputSchema: webSearchInputSchema,
51569
+ outputSchema: webSearchOutputSchema
51247
51570
  });
51248
- var webSearch = (args = {}) => {
51249
- return webSearchToolFactory(args);
51250
- };
51571
+ var webSearch = (args = {}) => webSearchToolFactory(args);
51251
51572
  var webSearchPreviewArgsSchema = lazySchema(() => zodSchema(exports_external.object({
51252
51573
  searchContextSize: exports_external.enum(["low", "medium", "high"]).optional(),
51253
51574
  userLocation: exports_external.object({
@@ -51258,14 +51579,15 @@ var webSearchPreviewArgsSchema = lazySchema(() => zodSchema(exports_external.obj
51258
51579
  timezone: exports_external.string().optional()
51259
51580
  }).optional()
51260
51581
  })));
51261
- var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external.object({
51582
+ var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external.object({})));
51583
+ var webSearchPreviewOutputSchema = lazySchema(() => zodSchema(exports_external.object({
51262
51584
  action: exports_external.discriminatedUnion("type", [
51263
51585
  exports_external.object({
51264
51586
  type: exports_external.literal("search"),
51265
- query: exports_external.string().nullish()
51587
+ query: exports_external.string().optional()
51266
51588
  }),
51267
51589
  exports_external.object({
51268
- type: exports_external.literal("open_page"),
51590
+ type: exports_external.literal("openPage"),
51269
51591
  url: exports_external.string()
51270
51592
  }),
51271
51593
  exports_external.object({
@@ -51273,12 +51595,13 @@ var webSearchPreviewInputSchema = lazySchema(() => zodSchema(exports_external.ob
51273
51595
  url: exports_external.string(),
51274
51596
  pattern: exports_external.string()
51275
51597
  })
51276
- ]).nullish()
51598
+ ])
51277
51599
  })));
51278
- var webSearchPreview = createProviderDefinedToolFactory({
51600
+ var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema({
51279
51601
  id: "openai.web_search_preview",
51280
51602
  name: "web_search_preview",
51281
- inputSchema: webSearchPreviewInputSchema
51603
+ inputSchema: webSearchPreviewInputSchema,
51604
+ outputSchema: webSearchPreviewOutputSchema
51282
51605
  });
51283
51606
  var openaiTools = {
51284
51607
  codeInterpreter,
@@ -51482,6 +51805,9 @@ async function convertToOpenAIResponsesInput({
51482
51805
  input.push(reasoningMessages[reasoningId]);
51483
51806
  } else {
51484
51807
  reasoningMessage.summary.push(...summaryParts);
51808
+ if ((providerOptions == null ? undefined : providerOptions.reasoningEncryptedContent) != null) {
51809
+ reasoningMessage.encrypted_content = providerOptions.reasoningEncryptedContent;
51810
+ }
51485
51811
  }
51486
51812
  }
51487
51813
  } else {
@@ -51636,11 +51962,7 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external.
51636
51962
  exports_external.object({
51637
51963
  type: exports_external.literal("web_search_call"),
51638
51964
  id: exports_external.string(),
51639
- status: exports_external.string(),
51640
- action: exports_external.object({
51641
- type: exports_external.literal("search"),
51642
- query: exports_external.string().optional()
51643
- }).nullish()
51965
+ status: exports_external.string()
51644
51966
  }),
51645
51967
  exports_external.object({
51646
51968
  type: exports_external.literal("computer_call"),
@@ -51722,7 +52044,7 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external.
51722
52044
  url: exports_external.string(),
51723
52045
  pattern: exports_external.string()
51724
52046
  })
51725
- ]).nullish()
52047
+ ])
51726
52048
  }),
51727
52049
  exports_external.object({
51728
52050
  type: exports_external.literal("file_search_call"),
@@ -51810,6 +52132,11 @@ var openaiResponsesChunkSchema = lazyValidator(() => zodSchema(exports_external.
51810
52132
  summary_index: exports_external.number(),
51811
52133
  delta: exports_external.string()
51812
52134
  }),
52135
+ exports_external.object({
52136
+ type: exports_external.literal("response.reasoning_summary_part.done"),
52137
+ item_id: exports_external.string(),
52138
+ summary_index: exports_external.number()
52139
+ }),
51813
52140
  exports_external.object({
51814
52141
  type: exports_external.literal("error"),
51815
52142
  code: exports_external.string(),
@@ -51887,7 +52214,7 @@ var openaiResponsesResponseSchema = lazyValidator(() => zodSchema(exports_extern
51887
52214
  url: exports_external.string(),
51888
52215
  pattern: exports_external.string()
51889
52216
  })
51890
- ]).nullish()
52217
+ ])
51891
52218
  }),
51892
52219
  exports_external.object({
51893
52220
  type: exports_external.literal("file_search_call"),
@@ -52381,7 +52708,8 @@ var OpenAIResponsesLanguageModel = class {
52381
52708
  tools: openaiTools2,
52382
52709
  tool_choice: openaiToolChoice
52383
52710
  },
52384
- warnings: [...warnings, ...toolWarnings]
52711
+ warnings: [...warnings, ...toolWarnings],
52712
+ store
52385
52713
  };
52386
52714
  }
52387
52715
  async doGenerate(options) {
@@ -52534,14 +52862,14 @@ var OpenAIResponsesLanguageModel = class {
52534
52862
  type: "tool-call",
52535
52863
  toolCallId: part.id,
52536
52864
  toolName: webSearchToolName != null ? webSearchToolName : "web_search",
52537
- input: JSON.stringify({ action: part.action }),
52865
+ input: JSON.stringify({}),
52538
52866
  providerExecuted: true
52539
52867
  });
52540
52868
  content.push({
52541
52869
  type: "tool-result",
52542
52870
  toolCallId: part.id,
52543
52871
  toolName: webSearchToolName != null ? webSearchToolName : "web_search",
52544
- result: { status: part.status },
52872
+ result: mapWebSearchOutput(part.action),
52545
52873
  providerExecuted: true
52546
52874
  });
52547
52875
  break;
@@ -52654,7 +52982,8 @@ var OpenAIResponsesLanguageModel = class {
52654
52982
  const {
52655
52983
  args: body,
52656
52984
  warnings,
52657
- webSearchToolName
52985
+ webSearchToolName,
52986
+ store
52658
52987
  } = await this.getArgs(options);
52659
52988
  const { responseHeaders, value: response } = await postJsonToApi({
52660
52989
  url: this.config.url({
@@ -52690,7 +53019,7 @@ var OpenAIResponsesLanguageModel = class {
52690
53019
  controller.enqueue({ type: "stream-start", warnings });
52691
53020
  },
52692
53021
  transform(chunk, controller) {
52693
- var _a18, _b8, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
53022
+ var _a18, _b8, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
52694
53023
  if (options.includeRawChunks) {
52695
53024
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
52696
53025
  }
@@ -52722,6 +53051,17 @@ var OpenAIResponsesLanguageModel = class {
52722
53051
  toolName: webSearchToolName != null ? webSearchToolName : "web_search",
52723
53052
  providerExecuted: true
52724
53053
  });
53054
+ controller.enqueue({
53055
+ type: "tool-input-end",
53056
+ id: value.item.id
53057
+ });
53058
+ controller.enqueue({
53059
+ type: "tool-call",
53060
+ toolCallId: value.item.id,
53061
+ toolName: "web_search",
53062
+ input: JSON.stringify({}),
53063
+ providerExecuted: true
53064
+ });
52725
53065
  } else if (value.item.type === "computer_call") {
52726
53066
  ongoingToolCalls[value.output_index] = {
52727
53067
  toolName: "computer_use",
@@ -52778,10 +53118,10 @@ var OpenAIResponsesLanguageModel = class {
52778
53118
  }
52779
53119
  }
52780
53120
  });
52781
- } else if (isResponseOutputItemAddedReasoningChunk(value)) {
53121
+ } else if (isResponseOutputItemAddedChunk(value) && value.item.type === "reasoning") {
52782
53122
  activeReasoning[value.item.id] = {
52783
53123
  encryptedContent: value.item.encrypted_content,
52784
- summaryParts: [0]
53124
+ summaryParts: { 0: "active" }
52785
53125
  };
52786
53126
  controller.enqueue({
52787
53127
  type: "reasoning-start",
@@ -52815,22 +53155,11 @@ var OpenAIResponsesLanguageModel = class {
52815
53155
  });
52816
53156
  } else if (value.item.type === "web_search_call") {
52817
53157
  ongoingToolCalls[value.output_index] = undefined;
52818
- controller.enqueue({
52819
- type: "tool-input-end",
52820
- id: value.item.id
52821
- });
52822
- controller.enqueue({
52823
- type: "tool-call",
52824
- toolCallId: value.item.id,
52825
- toolName: "web_search",
52826
- input: JSON.stringify({ action: value.item.action }),
52827
- providerExecuted: true
52828
- });
52829
53158
  controller.enqueue({
52830
53159
  type: "tool-result",
52831
53160
  toolCallId: value.item.id,
52832
53161
  toolName: "web_search",
52833
- result: { status: value.item.status },
53162
+ result: mapWebSearchOutput(value.item.action),
52834
53163
  providerExecuted: true
52835
53164
  });
52836
53165
  } else if (value.item.type === "computer_call") {
@@ -52920,9 +53249,10 @@ var OpenAIResponsesLanguageModel = class {
52920
53249
  type: "text-end",
52921
53250
  id: value.item.id
52922
53251
  });
52923
- } else if (isResponseOutputItemDoneReasoningChunk(value)) {
53252
+ } else if (value.item.type === "reasoning") {
52924
53253
  const activeReasoningPart = activeReasoning[value.item.id];
52925
- for (const summaryIndex of activeReasoningPart.summaryParts) {
53254
+ const summaryPartIndices = Object.entries(activeReasoningPart.summaryParts).filter(([_, status]) => status === "active" || status === "can-conclude").map(([summaryIndex]) => summaryIndex);
53255
+ for (const summaryIndex of summaryPartIndices) {
52926
53256
  controller.enqueue({
52927
53257
  type: "reasoning-end",
52928
53258
  id: `${value.item.id}:${summaryIndex}`,
@@ -52994,21 +53324,32 @@ var OpenAIResponsesLanguageModel = class {
52994
53324
  if (((_f = (_e = options.providerOptions) == null ? undefined : _e.openai) == null ? undefined : _f.logprobs) && value.logprobs) {
52995
53325
  logprobs.push(value.logprobs);
52996
53326
  }
52997
- } else if (isResponseReasoningSummaryPartAddedChunk(value)) {
53327
+ } else if (value.type === "response.reasoning_summary_part.added") {
52998
53328
  if (value.summary_index > 0) {
52999
- (_g = activeReasoning[value.item_id]) == null || _g.summaryParts.push(value.summary_index);
53329
+ const activeReasoningPart = activeReasoning[value.item_id];
53330
+ activeReasoningPart.summaryParts[value.summary_index] = "active";
53331
+ for (const summaryIndex of Object.keys(activeReasoningPart.summaryParts)) {
53332
+ if (activeReasoningPart.summaryParts[summaryIndex] === "can-conclude") {
53333
+ controller.enqueue({
53334
+ type: "reasoning-end",
53335
+ id: `${value.item_id}:${summaryIndex}`,
53336
+ providerMetadata: { openai: { itemId: value.item_id } }
53337
+ });
53338
+ activeReasoningPart.summaryParts[summaryIndex] = "concluded";
53339
+ }
53340
+ }
53000
53341
  controller.enqueue({
53001
53342
  type: "reasoning-start",
53002
53343
  id: `${value.item_id}:${value.summary_index}`,
53003
53344
  providerMetadata: {
53004
53345
  openai: {
53005
53346
  itemId: value.item_id,
53006
- reasoningEncryptedContent: (_i = (_h = activeReasoning[value.item_id]) == null ? undefined : _h.encryptedContent) != null ? _i : null
53347
+ reasoningEncryptedContent: (_h = (_g = activeReasoning[value.item_id]) == null ? undefined : _g.encryptedContent) != null ? _h : null
53007
53348
  }
53008
53349
  }
53009
53350
  });
53010
53351
  }
53011
- } else if (isResponseReasoningSummaryTextDeltaChunk(value)) {
53352
+ } else if (value.type === "response.reasoning_summary_text.delta") {
53012
53353
  controller.enqueue({
53013
53354
  type: "reasoning-delta",
53014
53355
  id: `${value.item_id}:${value.summary_index}`,
@@ -53019,16 +53360,29 @@ var OpenAIResponsesLanguageModel = class {
53019
53360
  }
53020
53361
  }
53021
53362
  });
53363
+ } else if (value.type === "response.reasoning_summary_part.done") {
53364
+ if (store) {
53365
+ controller.enqueue({
53366
+ type: "reasoning-end",
53367
+ id: `${value.item_id}:${value.summary_index}`,
53368
+ providerMetadata: {
53369
+ openai: { itemId: value.item_id }
53370
+ }
53371
+ });
53372
+ activeReasoning[value.item_id].summaryParts[value.summary_index] = "concluded";
53373
+ } else {
53374
+ activeReasoning[value.item_id].summaryParts[value.summary_index] = "can-conclude";
53375
+ }
53022
53376
  } else if (isResponseFinishedChunk(value)) {
53023
53377
  finishReason = mapOpenAIResponseFinishReason({
53024
- finishReason: (_j = value.response.incomplete_details) == null ? undefined : _j.reason,
53378
+ finishReason: (_i = value.response.incomplete_details) == null ? undefined : _i.reason,
53025
53379
  hasFunctionCall
53026
53380
  });
53027
53381
  usage.inputTokens = value.response.usage.input_tokens;
53028
53382
  usage.outputTokens = value.response.usage.output_tokens;
53029
53383
  usage.totalTokens = value.response.usage.input_tokens + value.response.usage.output_tokens;
53030
- usage.reasoningTokens = (_l = (_k = value.response.usage.output_tokens_details) == null ? undefined : _k.reasoning_tokens) != null ? _l : undefined;
53031
- usage.cachedInputTokens = (_n = (_m = value.response.usage.input_tokens_details) == null ? undefined : _m.cached_tokens) != null ? _n : undefined;
53384
+ usage.reasoningTokens = (_k = (_j = value.response.usage.output_tokens_details) == null ? undefined : _j.reasoning_tokens) != null ? _k : undefined;
53385
+ usage.cachedInputTokens = (_m = (_l = value.response.usage.input_tokens_details) == null ? undefined : _l.cached_tokens) != null ? _m : undefined;
53032
53386
  if (typeof value.response.service_tier === "string") {
53033
53387
  serviceTier = value.response.service_tier;
53034
53388
  }
@@ -53037,7 +53391,7 @@ var OpenAIResponsesLanguageModel = class {
53037
53391
  controller.enqueue({
53038
53392
  type: "source",
53039
53393
  sourceType: "url",
53040
- id: (_q = (_p = (_o = self.config).generateId) == null ? undefined : _p.call(_o)) != null ? _q : generateId(),
53394
+ id: (_p = (_o = (_n = self.config).generateId) == null ? undefined : _o.call(_n)) != null ? _p : generateId(),
53041
53395
  url: value.annotation.url,
53042
53396
  title: value.annotation.title
53043
53397
  });
@@ -53045,10 +53399,10 @@ var OpenAIResponsesLanguageModel = class {
53045
53399
  controller.enqueue({
53046
53400
  type: "source",
53047
53401
  sourceType: "document",
53048
- id: (_t = (_s = (_r = self.config).generateId) == null ? undefined : _s.call(_r)) != null ? _t : generateId(),
53402
+ id: (_s = (_r = (_q = self.config).generateId) == null ? undefined : _r.call(_q)) != null ? _s : generateId(),
53049
53403
  mediaType: "text/plain",
53050
- title: (_v = (_u = value.annotation.quote) != null ? _u : value.annotation.filename) != null ? _v : "Document",
53051
- filename: (_w = value.annotation.filename) != null ? _w : value.annotation.file_id
53404
+ title: (_u = (_t = value.annotation.quote) != null ? _t : value.annotation.filename) != null ? _u : "Document",
53405
+ filename: (_v = value.annotation.filename) != null ? _v : value.annotation.file_id
53052
53406
  });
53053
53407
  }
53054
53408
  } else if (isErrorChunk(value)) {
@@ -53086,9 +53440,6 @@ function isTextDeltaChunk(chunk) {
53086
53440
  function isResponseOutputItemDoneChunk(chunk) {
53087
53441
  return chunk.type === "response.output_item.done";
53088
53442
  }
53089
- function isResponseOutputItemDoneReasoningChunk(chunk) {
53090
- return isResponseOutputItemDoneChunk(chunk) && chunk.item.type === "reasoning";
53091
- }
53092
53443
  function isResponseFinishedChunk(chunk) {
53093
53444
  return chunk.type === "response.completed" || chunk.type === "response.incomplete";
53094
53445
  }
@@ -53107,18 +53458,9 @@ function isResponseCodeInterpreterCallCodeDoneChunk(chunk) {
53107
53458
  function isResponseOutputItemAddedChunk(chunk) {
53108
53459
  return chunk.type === "response.output_item.added";
53109
53460
  }
53110
- function isResponseOutputItemAddedReasoningChunk(chunk) {
53111
- return isResponseOutputItemAddedChunk(chunk) && chunk.item.type === "reasoning";
53112
- }
53113
53461
  function isResponseAnnotationAddedChunk(chunk) {
53114
53462
  return chunk.type === "response.output_text.annotation.added";
53115
53463
  }
53116
- function isResponseReasoningSummaryPartAddedChunk(chunk) {
53117
- return chunk.type === "response.reasoning_summary_part.added";
53118
- }
53119
- function isResponseReasoningSummaryTextDeltaChunk(chunk) {
53120
- return chunk.type === "response.reasoning_summary_text.delta";
53121
- }
53122
53464
  function isErrorChunk(chunk) {
53123
53465
  return chunk.type === "error";
53124
53466
  }
@@ -53156,6 +53498,19 @@ function getResponsesModelConfig(modelId) {
53156
53498
  isReasoningModel: false
53157
53499
  };
53158
53500
  }
53501
+ function mapWebSearchOutput(action) {
53502
+ var _a18;
53503
+ switch (action.type) {
53504
+ case "search":
53505
+ return { action: { type: "search", query: (_a18 = action.query) != null ? _a18 : undefined } };
53506
+ case "open_page":
53507
+ return { action: { type: "openPage", url: action.url } };
53508
+ case "find":
53509
+ return {
53510
+ action: { type: "find", url: action.url, pattern: action.pattern }
53511
+ };
53512
+ }
53513
+ }
53159
53514
  var openaiSpeechProviderOptionsSchema = lazyValidator(() => zodSchema(exports_external.object({
53160
53515
  instructions: exports_external.string().nullish(),
53161
53516
  speed: exports_external.number().min(0.25).max(4).default(1).nullish()
@@ -53445,7 +53800,7 @@ var OpenAITranscriptionModel = class {
53445
53800
  };
53446
53801
  }
53447
53802
  };
53448
- var VERSION5 = "2.0.50";
53803
+ var VERSION5 = "2.0.52";
53449
53804
  function createOpenAI(options = {}) {
53450
53805
  var _a18, _b8;
53451
53806
  const baseURL = (_a18 = withoutTrailingSlash(loadOptionalSetting({