@langchain/anthropic 1.5.2 → 1.5.3

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/chat_models.cjs +30 -3
  3. package/dist/chat_models.cjs.map +1 -1
  4. package/dist/chat_models.d.cts +4 -4
  5. package/dist/chat_models.d.cts.map +1 -1
  6. package/dist/chat_models.d.ts +3 -3
  7. package/dist/chat_models.d.ts.map +1 -1
  8. package/dist/chat_models.js +30 -2
  9. package/dist/chat_models.js.map +1 -1
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/output_parsers.cjs +0 -1
  13. package/dist/output_parsers.cjs.map +1 -1
  14. package/dist/output_parsers.js.map +1 -1
  15. package/dist/profiles.cjs.map +1 -1
  16. package/dist/profiles.js.map +1 -1
  17. package/dist/tools/bash.cjs +0 -1
  18. package/dist/tools/bash.cjs.map +1 -1
  19. package/dist/tools/bash.d.cts +0 -1
  20. package/dist/tools/bash.d.cts.map +1 -1
  21. package/dist/tools/bash.d.ts +0 -1
  22. package/dist/tools/bash.d.ts.map +1 -1
  23. package/dist/tools/bash.js.map +1 -1
  24. package/dist/tools/codeExecution.cjs.map +1 -1
  25. package/dist/tools/codeExecution.d.cts +0 -1
  26. package/dist/tools/codeExecution.d.cts.map +1 -1
  27. package/dist/tools/codeExecution.d.ts +0 -1
  28. package/dist/tools/codeExecution.d.ts.map +1 -1
  29. package/dist/tools/codeExecution.js.map +1 -1
  30. package/dist/tools/computer.cjs +0 -1
  31. package/dist/tools/computer.cjs.map +1 -1
  32. package/dist/tools/computer.d.cts +0 -1
  33. package/dist/tools/computer.d.cts.map +1 -1
  34. package/dist/tools/computer.d.ts +0 -1
  35. package/dist/tools/computer.d.ts.map +1 -1
  36. package/dist/tools/computer.js.map +1 -1
  37. package/dist/tools/index.cjs.map +1 -1
  38. package/dist/tools/index.d.cts +1 -2
  39. package/dist/tools/index.d.cts.map +1 -1
  40. package/dist/tools/index.d.ts +1 -2
  41. package/dist/tools/index.d.ts.map +1 -1
  42. package/dist/tools/index.js.map +1 -1
  43. package/dist/tools/mcpToolset.cjs.map +1 -1
  44. package/dist/tools/mcpToolset.d.cts +1 -2
  45. package/dist/tools/mcpToolset.d.cts.map +1 -1
  46. package/dist/tools/mcpToolset.d.ts +1 -2
  47. package/dist/tools/mcpToolset.d.ts.map +1 -1
  48. package/dist/tools/mcpToolset.js.map +1 -1
  49. package/dist/tools/memory.cjs +0 -1
  50. package/dist/tools/memory.cjs.map +1 -1
  51. package/dist/tools/memory.d.cts +0 -1
  52. package/dist/tools/memory.d.cts.map +1 -1
  53. package/dist/tools/memory.d.ts +0 -1
  54. package/dist/tools/memory.d.ts.map +1 -1
  55. package/dist/tools/memory.js.map +1 -1
  56. package/dist/tools/textEditor.cjs +0 -1
  57. package/dist/tools/textEditor.cjs.map +1 -1
  58. package/dist/tools/textEditor.d.cts +0 -1
  59. package/dist/tools/textEditor.d.cts.map +1 -1
  60. package/dist/tools/textEditor.d.ts +0 -1
  61. package/dist/tools/textEditor.d.ts.map +1 -1
  62. package/dist/tools/textEditor.js.map +1 -1
  63. package/dist/tools/toolSearch.cjs.map +1 -1
  64. package/dist/tools/toolSearch.d.cts +0 -1
  65. package/dist/tools/toolSearch.d.cts.map +1 -1
  66. package/dist/tools/toolSearch.d.ts +0 -1
  67. package/dist/tools/toolSearch.d.ts.map +1 -1
  68. package/dist/tools/toolSearch.js.map +1 -1
  69. package/dist/tools/types.cjs +28 -1
  70. package/dist/tools/types.cjs.map +1 -1
  71. package/dist/tools/types.d.cts +0 -1
  72. package/dist/tools/types.d.cts.map +1 -1
  73. package/dist/tools/types.d.ts +0 -1
  74. package/dist/tools/types.d.ts.map +1 -1
  75. package/dist/tools/types.js +1 -1
  76. package/dist/tools/types.js.map +1 -1
  77. package/dist/tools/webFetch.cjs.map +1 -1
  78. package/dist/tools/webFetch.d.cts +0 -1
  79. package/dist/tools/webFetch.d.cts.map +1 -1
  80. package/dist/tools/webFetch.d.ts +0 -1
  81. package/dist/tools/webFetch.d.ts.map +1 -1
  82. package/dist/tools/webFetch.js.map +1 -1
  83. package/dist/tools/webSearch.cjs.map +1 -1
  84. package/dist/tools/webSearch.d.cts +0 -1
  85. package/dist/tools/webSearch.d.cts.map +1 -1
  86. package/dist/tools/webSearch.d.ts +0 -1
  87. package/dist/tools/webSearch.d.ts.map +1 -1
  88. package/dist/tools/webSearch.js.map +1 -1
  89. package/dist/types.d.cts +1 -2
  90. package/dist/types.d.cts.map +1 -1
  91. package/dist/types.d.ts +1 -2
  92. package/dist/types.d.ts.map +1 -1
  93. package/dist/utils/content.cjs +0 -1
  94. package/dist/utils/content.cjs.map +1 -1
  95. package/dist/utils/content.js.map +1 -1
  96. package/dist/utils/errors.cjs +1 -1
  97. package/dist/utils/errors.cjs.map +1 -1
  98. package/dist/utils/errors.js +1 -1
  99. package/dist/utils/errors.js.map +1 -1
  100. package/dist/utils/index.cjs.map +1 -1
  101. package/dist/utils/index.js.map +1 -1
  102. package/dist/utils/message_inputs.cjs +1 -1
  103. package/dist/utils/message_inputs.cjs.map +1 -1
  104. package/dist/utils/message_inputs.js +1 -1
  105. package/dist/utils/message_inputs.js.map +1 -1
  106. package/dist/utils/message_outputs.cjs +5 -2
  107. package/dist/utils/message_outputs.cjs.map +1 -1
  108. package/dist/utils/message_outputs.js +5 -1
  109. package/dist/utils/message_outputs.js.map +1 -1
  110. package/dist/utils/params.cjs +2 -0
  111. package/dist/utils/params.cjs.map +1 -1
  112. package/dist/utils/params.js +1 -1
  113. package/dist/utils/params.js.map +1 -1
  114. package/dist/utils/prompts.cjs.map +1 -1
  115. package/dist/utils/prompts.d.cts +0 -1
  116. package/dist/utils/prompts.d.cts.map +1 -1
  117. package/dist/utils/prompts.d.ts +0 -1
  118. package/dist/utils/prompts.d.ts.map +1 -1
  119. package/dist/utils/prompts.js.map +1 -1
  120. package/dist/utils/standard.cjs +2 -2
  121. package/dist/utils/standard.cjs.map +1 -1
  122. package/dist/utils/standard.js +2 -2
  123. package/dist/utils/standard.js.map +1 -1
  124. package/dist/utils/stream_events.cjs.map +1 -1
  125. package/dist/utils/stream_events.js.map +1 -1
  126. package/dist/utils/tools.cjs.map +1 -1
  127. package/dist/utils/tools.js.map +1 -1
  128. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","names":[],"sources":["../../src/tools/memory.ts"],"mappings":";;;;;;AA2CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,eAAA,CAAgB,OAAA,GAAU,yBAAA,GAoBnB,qBAAA,QACZ,2BAAA,EACP,qBAAA,oBAES,OAAA"}
1
+ {"version":3,"file":"memory.d.ts","names":[],"sources":["../../src/tools/memory.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CgB,gBAAgB,UAAU,4BAoBnB,6BACZ,6BACP,yCAES"}
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","names":[],"sources":["../../src/tools/memory.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Memory20250818CommandSchema,\n type MemoryTool20250818Options,\n type Memory20250818Command,\n} from \"./types.js\";\n\n/**\n * Creates an Anthropic memory tool that can be used with ChatAnthropic.\n *\n * The memory tool enables Claude to store and retrieve information across conversations\n * through a memory file directory. Claude can create, read, update, and delete files that\n * persist between sessions, allowing it to build knowledge over time without keeping\n * everything in the context window.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, memory_20250818 } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\"\n * });\n *\n * const memory = memory_20250818({\n * execute: async (args) => {\n * // handle memory command execution\n * // ...\n * },\n * });\n * const llmWithMemory = llm.bindTools([memory]);\n *\n * const response = await llmWithMemory.invoke(\"Remember that I like Python\");\n * ```\n *\n * @param options - Optional configuration for the memory tool (currently unused)\n * @param options.execute - Optional execute function that handles memory command execution.\n * @returns The memory tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\nexport function memory_20250818(options?: MemoryTool20250818Options) {\n const memoryTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name: \"memory\",\n schema: Memory20250818CommandSchema,\n }\n );\n\n memoryTool.extras = {\n ...(memoryTool.extras ?? {}),\n providerToolDefinition: {\n type: \"memory_20250818\",\n name: \"memory\",\n } satisfies Anthropic.Beta.BetaMemoryTool20250818,\n };\n\n return memoryTool as DynamicStructuredTool<\n typeof Memory20250818CommandSchema,\n Memory20250818Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,gBAAgB,SAAqC;CACnE,MAAM,aAAa,KACjB,SAAS,SAIT;EACE,MAAM;EACN,QAAQ;EACT,CACF;AAED,YAAW,SAAS;EAClB,GAAI,WAAW,UAAU,EAAE;EAC3B,wBAAwB;GACtB,MAAM;GACN,MAAM;GACP;EACF;AAED,QAAO"}
1
+ {"version":3,"file":"memory.js","names":[],"sources":["../../src/tools/memory.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n Memory20250818CommandSchema,\n type MemoryTool20250818Options,\n type Memory20250818Command,\n} from \"./types.js\";\n\n/**\n * Creates an Anthropic memory tool that can be used with ChatAnthropic.\n *\n * The memory tool enables Claude to store and retrieve information across conversations\n * through a memory file directory. Claude can create, read, update, and delete files that\n * persist between sessions, allowing it to build knowledge over time without keeping\n * everything in the context window.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, memory_20250818 } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\"\n * });\n *\n * const memory = memory_20250818({\n * execute: async (args) => {\n * // handle memory command execution\n * // ...\n * },\n * });\n * const llmWithMemory = llm.bindTools([memory]);\n *\n * const response = await llmWithMemory.invoke(\"Remember that I like Python\");\n * ```\n *\n * @param options - Optional configuration for the memory tool (currently unused)\n * @param options.execute - Optional execute function that handles memory command execution.\n * @returns The memory tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\nexport function memory_20250818(options?: MemoryTool20250818Options) {\n const memoryTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name: \"memory\",\n schema: Memory20250818CommandSchema,\n }\n );\n\n memoryTool.extras = {\n ...(memoryTool.extras ?? {}),\n providerToolDefinition: {\n type: \"memory_20250818\",\n name: \"memory\",\n } satisfies Anthropic.Beta.BetaMemoryTool20250818,\n };\n\n return memoryTool as DynamicStructuredTool<\n typeof Memory20250818CommandSchema,\n Memory20250818Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,gBAAgB,SAAqC;CACnE,MAAM,aAAa,KACjB,SAAS,SAIT;EACE,MAAM;EACN,QAAQ;CACV,CACF;CAEA,WAAW,SAAS;EAClB,GAAI,WAAW,UAAU,CAAC;EAC1B,wBAAwB;GACtB,MAAM;GACN,MAAM;EACR;CACF;CAEA,OAAO;AAMT"}
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  const require_types = require("./types.cjs");
3
2
  let _langchain_core_tools = require("@langchain/core/tools");
4
3
  //#region src/tools/textEditor.ts
@@ -1 +1 @@
1
- {"version":3,"file":"textEditor.cjs","names":["TextEditor20250728CommandSchema"],"sources":["../../src/tools/textEditor.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n TextEditor20250728CommandSchema,\n type TextEditor20250728Command,\n} from \"./types.js\";\n\n/**\n * Options for the text editor tool (Claude 4.x version).\n */\nexport interface TextEditor20250728Options {\n /**\n * Optional execute function that handles text editor command execution.\n * This function receives the command input and should return the result.\n */\n execute?: (args: TextEditor20250728Command) => string | Promise<string>;\n /**\n * Optional maximum characters to return when viewing files.\n * If the file content exceeds this limit, it will be truncated.\n */\n maxCharacters?: number;\n}\n\n/**\n * Creates an Anthropic text editor tool for Claude 4.x models that can view and modify text files.\n *\n * The text editor tool enables Claude to view and modify text files, helping debug, fix,\n * and improve code or other text documents. Claude can directly interact with files,\n * providing hands-on assistance rather than just suggesting changes.\n *\n * Available commands:\n * - `view`: Examine file contents or list directory contents\n * - `str_replace`: Replace specific text in a file\n * - `create`: Create a new file with specified content\n * - `insert`: Insert text at a specific line number\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import * as fs from \"fs\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const textEditor = tools.textEditor_20250728({\n * execute: async (args) => {\n * if (args.command === \"view\") {\n * const content = fs.readFileSync(args.path, \"utf-8\");\n * return content.split(\"\\n\").map((line, i) => `${i + 1}: ${line}`).join(\"\\n\");\n * }\n * if (args.command === \"str_replace\") {\n * let content = fs.readFileSync(args.path, \"utf-8\");\n * content = content.replace(args.old_str!, args.new_str!);\n * fs.writeFileSync(args.path, content);\n * return \"Successfully replaced text.\";\n * }\n * // Handle other commands...\n * return \"Command executed\";\n * },\n * maxCharacters: 10000,\n * });\n *\n * const llmWithEditor = llm.bindTools([textEditor]);\n * const response = await llmWithEditor.invoke(\n * \"There's a syntax error in my primes.py file. Can you help me fix it?\"\n * );\n * ```\n *\n * @param options - Configuration options for the text editor tool\n * @param options.execute - Function that handles text editor command execution\n * @param options.maxCharacters - Maximum characters to return when viewing files\n * @returns The text editor tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\nexport function textEditor_20250728(options?: TextEditor20250728Options) {\n const name = \"str_replace_based_edit_tool\";\n const textEditorTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for editing text files\",\n schema: TextEditor20250728CommandSchema,\n }\n );\n\n textEditorTool.extras = {\n ...(textEditorTool.extras ?? {}),\n providerToolDefinition: {\n type: \"text_editor_20250728\",\n name,\n ...(options?.maxCharacters !== undefined && {\n max_characters: options.maxCharacters,\n }),\n } satisfies Anthropic.Beta.Messages.BetaToolTextEditor20250728,\n };\n\n return textEditorTool as DynamicStructuredTool<\n typeof TextEditor20250728CommandSchema,\n TextEditor20250728Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,oBAAoB,SAAqC;CACvE,MAAM,OAAO;CACb,MAAM,kBAAA,GAAA,sBAAA,MACJ,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQA,cAAAA;EACT,CACF;AAED,gBAAe,SAAS;EACtB,GAAI,eAAe,UAAU,EAAE;EAC/B,wBAAwB;GACtB,MAAM;GACN;GACA,GAAI,SAAS,kBAAkB,KAAA,KAAa,EAC1C,gBAAgB,QAAQ,eACzB;GACF;EACF;AAED,QAAO"}
1
+ {"version":3,"file":"textEditor.cjs","names":["TextEditor20250728CommandSchema"],"sources":["../../src/tools/textEditor.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n TextEditor20250728CommandSchema,\n type TextEditor20250728Command,\n} from \"./types.js\";\n\n/**\n * Options for the text editor tool (Claude 4.x version).\n */\nexport interface TextEditor20250728Options {\n /**\n * Optional execute function that handles text editor command execution.\n * This function receives the command input and should return the result.\n */\n execute?: (args: TextEditor20250728Command) => string | Promise<string>;\n /**\n * Optional maximum characters to return when viewing files.\n * If the file content exceeds this limit, it will be truncated.\n */\n maxCharacters?: number;\n}\n\n/**\n * Creates an Anthropic text editor tool for Claude 4.x models that can view and modify text files.\n *\n * The text editor tool enables Claude to view and modify text files, helping debug, fix,\n * and improve code or other text documents. Claude can directly interact with files,\n * providing hands-on assistance rather than just suggesting changes.\n *\n * Available commands:\n * - `view`: Examine file contents or list directory contents\n * - `str_replace`: Replace specific text in a file\n * - `create`: Create a new file with specified content\n * - `insert`: Insert text at a specific line number\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import * as fs from \"fs\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const textEditor = tools.textEditor_20250728({\n * execute: async (args) => {\n * if (args.command === \"view\") {\n * const content = fs.readFileSync(args.path, \"utf-8\");\n * return content.split(\"\\n\").map((line, i) => `${i + 1}: ${line}`).join(\"\\n\");\n * }\n * if (args.command === \"str_replace\") {\n * let content = fs.readFileSync(args.path, \"utf-8\");\n * content = content.replace(args.old_str!, args.new_str!);\n * fs.writeFileSync(args.path, content);\n * return \"Successfully replaced text.\";\n * }\n * // Handle other commands...\n * return \"Command executed\";\n * },\n * maxCharacters: 10000,\n * });\n *\n * const llmWithEditor = llm.bindTools([textEditor]);\n * const response = await llmWithEditor.invoke(\n * \"There's a syntax error in my primes.py file. Can you help me fix it?\"\n * );\n * ```\n *\n * @param options - Configuration options for the text editor tool\n * @param options.execute - Function that handles text editor command execution\n * @param options.maxCharacters - Maximum characters to return when viewing files\n * @returns The text editor tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\nexport function textEditor_20250728(options?: TextEditor20250728Options) {\n const name = \"str_replace_based_edit_tool\";\n const textEditorTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for editing text files\",\n schema: TextEditor20250728CommandSchema,\n }\n );\n\n textEditorTool.extras = {\n ...(textEditorTool.extras ?? {}),\n providerToolDefinition: {\n type: \"text_editor_20250728\",\n name,\n ...(options?.maxCharacters !== undefined && {\n max_characters: options.maxCharacters,\n }),\n } satisfies Anthropic.Beta.Messages.BetaToolTextEditor20250728,\n };\n\n return textEditorTool as DynamicStructuredTool<\n typeof TextEditor20250728CommandSchema,\n TextEditor20250728Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,oBAAoB,SAAqC;CACvE,MAAM,OAAO;CACb,MAAM,kBAAA,GAAA,sBAAA,KAAA,CACJ,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQA,cAAAA;CACV,CACF;CAEA,eAAe,SAAS;EACtB,GAAI,eAAe,UAAU,CAAC;EAC9B,wBAAwB;GACtB,MAAM;GACN;GACA,GAAI,SAAS,kBAAkB,KAAA,KAAa,EAC1C,gBAAgB,QAAQ,cAC1B;EACF;CACF;CAEA,OAAO;AAMT"}
@@ -1,6 +1,5 @@
1
1
  import { TextEditor20250728Command, TextEditor20250728CommandSchema } from "./types.cjs";
2
2
  import { DynamicStructuredTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/textEditor.d.ts
5
4
  /**
6
5
  * Options for the text editor tool (Claude 4.x version).
@@ -1 +1 @@
1
- {"version":3,"file":"textEditor.d.cts","names":[],"sources":["../../src/tools/textEditor.ts"],"mappings":";;;;;;AAYA;UAAiB,yBAAA;;;;;EAKf,OAAA,IAAW,IAAA,EAAM,yBAAA,cAAuC,OAAA;EAAA;;;;EAKxD,aAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDc,mBAAA,CAAoB,OAAA,GAAU,yBAAA,GAyBnB,qBAAA,QAChB,+BAAA,EACP,yBAAA,oBAES,OAAA"}
1
+ {"version":3,"file":"textEditor.d.cts","names":[],"sources":["../../src/tools/textEditor.ts"],"mappings":";;;;;;UAYiB;;;;;EAKf,WAAW,MAAM,uCAAuC;;;;;EAKxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDc,oBAAoB,UAAU,4BAyBnB,6BAChB,iCACP,6CAES"}
@@ -1,6 +1,5 @@
1
1
  import { TextEditor20250728Command, TextEditor20250728CommandSchema } from "./types.js";
2
2
  import { DynamicStructuredTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/textEditor.d.ts
5
4
  /**
6
5
  * Options for the text editor tool (Claude 4.x version).
@@ -1 +1 @@
1
- {"version":3,"file":"textEditor.d.ts","names":[],"sources":["../../src/tools/textEditor.ts"],"mappings":";;;;;;AAYA;UAAiB,yBAAA;;;;;EAKf,OAAA,IAAW,IAAA,EAAM,yBAAA,cAAuC,OAAA;EAAA;;;;EAKxD,aAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDc,mBAAA,CAAoB,OAAA,GAAU,yBAAA,GAyBnB,qBAAA,QAChB,+BAAA,EACP,yBAAA,oBAES,OAAA"}
1
+ {"version":3,"file":"textEditor.d.ts","names":[],"sources":["../../src/tools/textEditor.ts"],"mappings":";;;;;;UAYiB;;;;;EAKf,WAAW,MAAM,uCAAuC;;;;;EAKxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDc,oBAAoB,UAAU,4BAyBnB,6BAChB,iCACP,6CAES"}
@@ -1 +1 @@
1
- {"version":3,"file":"textEditor.js","names":[],"sources":["../../src/tools/textEditor.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n TextEditor20250728CommandSchema,\n type TextEditor20250728Command,\n} from \"./types.js\";\n\n/**\n * Options for the text editor tool (Claude 4.x version).\n */\nexport interface TextEditor20250728Options {\n /**\n * Optional execute function that handles text editor command execution.\n * This function receives the command input and should return the result.\n */\n execute?: (args: TextEditor20250728Command) => string | Promise<string>;\n /**\n * Optional maximum characters to return when viewing files.\n * If the file content exceeds this limit, it will be truncated.\n */\n maxCharacters?: number;\n}\n\n/**\n * Creates an Anthropic text editor tool for Claude 4.x models that can view and modify text files.\n *\n * The text editor tool enables Claude to view and modify text files, helping debug, fix,\n * and improve code or other text documents. Claude can directly interact with files,\n * providing hands-on assistance rather than just suggesting changes.\n *\n * Available commands:\n * - `view`: Examine file contents or list directory contents\n * - `str_replace`: Replace specific text in a file\n * - `create`: Create a new file with specified content\n * - `insert`: Insert text at a specific line number\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import * as fs from \"fs\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const textEditor = tools.textEditor_20250728({\n * execute: async (args) => {\n * if (args.command === \"view\") {\n * const content = fs.readFileSync(args.path, \"utf-8\");\n * return content.split(\"\\n\").map((line, i) => `${i + 1}: ${line}`).join(\"\\n\");\n * }\n * if (args.command === \"str_replace\") {\n * let content = fs.readFileSync(args.path, \"utf-8\");\n * content = content.replace(args.old_str!, args.new_str!);\n * fs.writeFileSync(args.path, content);\n * return \"Successfully replaced text.\";\n * }\n * // Handle other commands...\n * return \"Command executed\";\n * },\n * maxCharacters: 10000,\n * });\n *\n * const llmWithEditor = llm.bindTools([textEditor]);\n * const response = await llmWithEditor.invoke(\n * \"There's a syntax error in my primes.py file. Can you help me fix it?\"\n * );\n * ```\n *\n * @param options - Configuration options for the text editor tool\n * @param options.execute - Function that handles text editor command execution\n * @param options.maxCharacters - Maximum characters to return when viewing files\n * @returns The text editor tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\nexport function textEditor_20250728(options?: TextEditor20250728Options) {\n const name = \"str_replace_based_edit_tool\";\n const textEditorTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for editing text files\",\n schema: TextEditor20250728CommandSchema,\n }\n );\n\n textEditorTool.extras = {\n ...(textEditorTool.extras ?? {}),\n providerToolDefinition: {\n type: \"text_editor_20250728\",\n name,\n ...(options?.maxCharacters !== undefined && {\n max_characters: options.maxCharacters,\n }),\n } satisfies Anthropic.Beta.Messages.BetaToolTextEditor20250728,\n };\n\n return textEditorTool as DynamicStructuredTool<\n typeof TextEditor20250728CommandSchema,\n TextEditor20250728Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,oBAAoB,SAAqC;CACvE,MAAM,OAAO;CACb,MAAM,iBAAiB,KACrB,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQ;EACT,CACF;AAED,gBAAe,SAAS;EACtB,GAAI,eAAe,UAAU,EAAE;EAC/B,wBAAwB;GACtB,MAAM;GACN;GACA,GAAI,SAAS,kBAAkB,KAAA,KAAa,EAC1C,gBAAgB,QAAQ,eACzB;GACF;EACF;AAED,QAAO"}
1
+ {"version":3,"file":"textEditor.js","names":[],"sources":["../../src/tools/textEditor.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { tool } from \"@langchain/core/tools\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\n\nimport {\n TextEditor20250728CommandSchema,\n type TextEditor20250728Command,\n} from \"./types.js\";\n\n/**\n * Options for the text editor tool (Claude 4.x version).\n */\nexport interface TextEditor20250728Options {\n /**\n * Optional execute function that handles text editor command execution.\n * This function receives the command input and should return the result.\n */\n execute?: (args: TextEditor20250728Command) => string | Promise<string>;\n /**\n * Optional maximum characters to return when viewing files.\n * If the file content exceeds this limit, it will be truncated.\n */\n maxCharacters?: number;\n}\n\n/**\n * Creates an Anthropic text editor tool for Claude 4.x models that can view and modify text files.\n *\n * The text editor tool enables Claude to view and modify text files, helping debug, fix,\n * and improve code or other text documents. Claude can directly interact with files,\n * providing hands-on assistance rather than just suggesting changes.\n *\n * Available commands:\n * - `view`: Examine file contents or list directory contents\n * - `str_replace`: Replace specific text in a file\n * - `create`: Create a new file with specified content\n * - `insert`: Insert text at a specific line number\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n * import * as fs from \"fs\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const textEditor = tools.textEditor_20250728({\n * execute: async (args) => {\n * if (args.command === \"view\") {\n * const content = fs.readFileSync(args.path, \"utf-8\");\n * return content.split(\"\\n\").map((line, i) => `${i + 1}: ${line}`).join(\"\\n\");\n * }\n * if (args.command === \"str_replace\") {\n * let content = fs.readFileSync(args.path, \"utf-8\");\n * content = content.replace(args.old_str!, args.new_str!);\n * fs.writeFileSync(args.path, content);\n * return \"Successfully replaced text.\";\n * }\n * // Handle other commands...\n * return \"Command executed\";\n * },\n * maxCharacters: 10000,\n * });\n *\n * const llmWithEditor = llm.bindTools([textEditor]);\n * const response = await llmWithEditor.invoke(\n * \"There's a syntax error in my primes.py file. Can you help me fix it?\"\n * );\n * ```\n *\n * @param options - Configuration options for the text editor tool\n * @param options.execute - Function that handles text editor command execution\n * @param options.maxCharacters - Maximum characters to return when viewing files\n * @returns The text editor tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\nexport function textEditor_20250728(options?: TextEditor20250728Options) {\n const name = \"str_replace_based_edit_tool\";\n const textEditorTool = tool(\n options?.execute as (\n input: unknown,\n runtime: ToolRuntime<unknown, unknown>\n ) => string | Promise<string>,\n {\n name,\n description: \"A tool for editing text files\",\n schema: TextEditor20250728CommandSchema,\n }\n );\n\n textEditorTool.extras = {\n ...(textEditorTool.extras ?? {}),\n providerToolDefinition: {\n type: \"text_editor_20250728\",\n name,\n ...(options?.maxCharacters !== undefined && {\n max_characters: options.maxCharacters,\n }),\n } satisfies Anthropic.Beta.Messages.BetaToolTextEditor20250728,\n };\n\n return textEditorTool as DynamicStructuredTool<\n typeof TextEditor20250728CommandSchema,\n TextEditor20250728Command,\n unknown,\n string | Promise<string>\n >;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,oBAAoB,SAAqC;CACvE,MAAM,OAAO;CACb,MAAM,iBAAiB,KACrB,SAAS,SAIT;EACE;EACA,aAAa;EACb,QAAQ;CACV,CACF;CAEA,eAAe,SAAS;EACtB,GAAI,eAAe,UAAU,CAAC;EAC9B,wBAAwB;GACtB,MAAM;GACN;GACA,GAAI,SAAS,kBAAkB,KAAA,KAAa,EAC1C,gBAAgB,QAAQ,cAC1B;EACF;CACF;CAEA,OAAO;AAMT"}
@@ -1 +1 @@
1
- {"version":3,"file":"toolSearch.cjs","names":[],"sources":["../../src/tools/toolSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the tool search tool.\n */\nexport interface ToolSearchOptions {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a regex-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude constructs regex patterns (using Python's `re.search()` syntax) to search\n * for tools by name, description, argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search and discover tools as needed\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchRegex_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchRegex_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_regex_20251119\",\n name: \"tool_search_tool_regex\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolRegex20251119;\n}\n\n/**\n * Creates a BM25-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude uses natural language queries to search for tools by name, description,\n * argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: { \"anthropic-beta\": \"advanced-tool-use-2025-11-20\" },\n * },\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search using natural language\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchBM25_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchBM25_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_bm25_20251119\",\n name: \"tool_search_tool_bm25\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolBm25_20251119;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,yBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,SAAgB,wBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB"}
1
+ {"version":3,"file":"toolSearch.cjs","names":[],"sources":["../../src/tools/toolSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the tool search tool.\n */\nexport interface ToolSearchOptions {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a regex-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude constructs regex patterns (using Python's `re.search()` syntax) to search\n * for tools by name, description, argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search and discover tools as needed\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchRegex_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchRegex_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_regex_20251119\",\n name: \"tool_search_tool_regex\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolRegex20251119;\n}\n\n/**\n * Creates a BM25-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude uses natural language queries to search for tools by name, description,\n * argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: { \"anthropic-beta\": \"advanced-tool-use-2025-11-20\" },\n * },\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search using natural language\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchBM25_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchBM25_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_bm25_20251119\",\n name: \"tool_search_tool_bm25\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolBm25_20251119;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,yBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CAC1B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,wBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CAC1B;AACF"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/toolSearch.d.ts
5
4
  /**
6
5
  * Options for the tool search tool.
@@ -1 +1 @@
1
- {"version":3,"file":"toolSearch.d.cts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;;;;AAMA;UAAiB,iBAAA;;;;EAIf,YAAA,GAAe,WAAA,CAAU,IAAA,CAAK,yBAAA;AAAA;;;;AA8ChC;;;;;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAxDgB,wBAAA,CACd,OAAA,GAAU,iBAAA,GACT,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDa,uBAAA,CACd,OAAA,GAAU,iBAAA,GACT,UAAA"}
1
+ {"version":3,"file":"toolSearch.d.cts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;;;;UAMiB;;;;EAIf,eAAe,YAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8ChB,yBACd,UAAU,oBACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDa,wBACd,UAAU,oBACT"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/toolSearch.d.ts
5
4
  /**
6
5
  * Options for the tool search tool.
@@ -1 +1 @@
1
- {"version":3,"file":"toolSearch.d.ts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;;;;AAMA;UAAiB,iBAAA;;;;EAIf,YAAA,GAAe,WAAA,CAAU,IAAA,CAAK,yBAAA;AAAA;;;;AA8ChC;;;;;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAxDgB,wBAAA,CACd,OAAA,GAAU,iBAAA,GACT,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDa,uBAAA,CACd,OAAA,GAAU,iBAAA,GACT,UAAA"}
1
+ {"version":3,"file":"toolSearch.d.ts","names":[],"sources":["../../src/tools/toolSearch.ts"],"mappings":";;;;;;UAMiB;;;;EAIf,eAAe,YAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8ChB,yBACd,UAAU,oBACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsDa,wBACd,UAAU,oBACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"toolSearch.js","names":[],"sources":["../../src/tools/toolSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the tool search tool.\n */\nexport interface ToolSearchOptions {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a regex-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude constructs regex patterns (using Python's `re.search()` syntax) to search\n * for tools by name, description, argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search and discover tools as needed\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchRegex_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchRegex_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_regex_20251119\",\n name: \"tool_search_tool_regex\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolRegex20251119;\n}\n\n/**\n * Creates a BM25-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude uses natural language queries to search for tools by name, description,\n * argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: { \"anthropic-beta\": \"advanced-tool-use-2025-11-20\" },\n * },\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search using natural language\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchBM25_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchBM25_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_bm25_20251119\",\n name: \"tool_search_tool_bm25\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolBm25_20251119;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,yBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,SAAgB,wBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;EACzB"}
1
+ {"version":3,"file":"toolSearch.js","names":[],"sources":["../../src/tools/toolSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the tool search tool.\n */\nexport interface ToolSearchOptions {\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n}\n\n/**\n * Creates a regex-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude constructs regex patterns (using Python's `re.search()` syntax) to search\n * for tools by name, description, argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search and discover tools as needed\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchRegex_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchRegex_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_regex_20251119\",\n name: \"tool_search_tool_regex\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolRegex20251119;\n}\n\n/**\n * Creates a BM25-based tool search tool that enables Claude to work with hundreds\n * or thousands of tools by dynamically discovering and loading them on-demand.\n * Claude uses natural language queries to search for tools by name, description,\n * argument names, and argument descriptions.\n *\n * @note This tool requires the beta header `advanced-tool-use-2025-11-20` in API requests.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/tool-search-tool | Anthropic Tool Search Documentation}\n * @param options - Configuration options for the tool search tool\n * @returns A tool search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: { \"anthropic-beta\": \"advanced-tool-use-2025-11-20\" },\n * },\n * });\n *\n * const getWeather = tool(\n * async (input: { location: string }) => {\n * return `Weather in ${input.location}`;\n * },\n * {\n * name: \"get_weather\",\n * description: \"Get the weather at a specific location\",\n * schema: z.object({\n * location: z.string(),\n * }),\n * extras: { defer_loading: true },\n * },\n * );\n *\n * // Use with deferred tools - Claude will search using natural language\n * const response = await model.invoke(\"What is the weather in San Francisco?\", {\n * tools: [\n * tools.toolSearchBM25_20251119(),\n * getWeather,\n * ],\n * });\n * ```\n */\nexport function toolSearchBM25_20251119(\n options?: ToolSearchOptions\n): ServerTool {\n return {\n type: \"tool_search_tool_bm25_20251119\",\n name: \"tool_search_tool_bm25\",\n cache_control: options?.cacheControl,\n } satisfies Anthropic.Beta.Messages.BetaToolSearchToolBm25_20251119;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,SAAgB,yBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CAC1B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,wBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,SAAS;CAC1B;AACF"}
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  let zod_v4 = require("zod/v4");
3
2
  //#region src/tools/types.ts
4
3
  /**
@@ -195,9 +194,37 @@ const Bash20250124RestartCommandSchema = zod_v4.z.object({ restart: zod_v4.z.lit
195
194
  const Bash20250124CommandSchema = zod_v4.z.union([Bash20250124ExecuteCommandSchema, Bash20250124RestartCommandSchema]);
196
195
  //#endregion
197
196
  exports.Bash20250124CommandSchema = Bash20250124CommandSchema;
197
+ exports.Bash20250124ExecuteCommandSchema = Bash20250124ExecuteCommandSchema;
198
+ exports.Bash20250124RestartCommandSchema = Bash20250124RestartCommandSchema;
198
199
  exports.Computer20250124ActionSchema = Computer20250124ActionSchema;
199
200
  exports.Computer20251124ActionSchema = Computer20251124ActionSchema;
201
+ exports.ComputerDoubleClickActionSchema = ComputerDoubleClickActionSchema;
202
+ exports.ComputerHoldKeyActionSchema = ComputerHoldKeyActionSchema;
203
+ exports.ComputerKeyActionSchema = ComputerKeyActionSchema;
204
+ exports.ComputerLeftClickActionSchema = ComputerLeftClickActionSchema;
205
+ exports.ComputerLeftClickDragActionSchema = ComputerLeftClickDragActionSchema;
206
+ exports.ComputerLeftMouseDownActionSchema = ComputerLeftMouseDownActionSchema;
207
+ exports.ComputerLeftMouseUpActionSchema = ComputerLeftMouseUpActionSchema;
208
+ exports.ComputerMiddleClickActionSchema = ComputerMiddleClickActionSchema;
209
+ exports.ComputerMouseMoveActionSchema = ComputerMouseMoveActionSchema;
210
+ exports.ComputerRightClickActionSchema = ComputerRightClickActionSchema;
211
+ exports.ComputerScreenshotActionSchema = ComputerScreenshotActionSchema;
212
+ exports.ComputerScrollActionSchema = ComputerScrollActionSchema;
213
+ exports.ComputerTripleClickActionSchema = ComputerTripleClickActionSchema;
214
+ exports.ComputerTypeActionSchema = ComputerTypeActionSchema;
215
+ exports.ComputerWaitActionSchema = ComputerWaitActionSchema;
216
+ exports.ComputerZoomActionSchema = ComputerZoomActionSchema;
200
217
  exports.Memory20250818CommandSchema = Memory20250818CommandSchema;
218
+ exports.Memory20250818CreateCommandSchema = Memory20250818CreateCommandSchema;
219
+ exports.Memory20250818DeleteCommandSchema = Memory20250818DeleteCommandSchema;
220
+ exports.Memory20250818InsertCommandSchema = Memory20250818InsertCommandSchema;
221
+ exports.Memory20250818RenameCommandSchema = Memory20250818RenameCommandSchema;
222
+ exports.Memory20250818StrReplaceCommandSchema = Memory20250818StrReplaceCommandSchema;
223
+ exports.Memory20250818ViewCommandSchema = Memory20250818ViewCommandSchema;
201
224
  exports.TextEditor20250728CommandSchema = TextEditor20250728CommandSchema;
225
+ exports.TextEditor20250728CreateCommandSchema = TextEditor20250728CreateCommandSchema;
226
+ exports.TextEditor20250728InsertCommandSchema = TextEditor20250728InsertCommandSchema;
227
+ exports.TextEditor20250728StrReplaceCommandSchema = TextEditor20250728StrReplaceCommandSchema;
228
+ exports.TextEditor20250728ViewCommandSchema = TextEditor20250728ViewCommandSchema;
202
229
 
203
230
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":["z"],"sources":["../../src/tools/types.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { z } from \"zod/v4\";\n\n/**\n * Memory tool command types as defined by Anthropic's memory tool API.\n * @beta\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\n\n// Zod schemas for memory commands\nexport const Memory20250818ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n});\n\nexport const Memory20250818CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const Memory20250818StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const Memory20250818InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n insert_text: z.string(),\n});\n\nexport const Memory20250818DeleteCommandSchema = z.object({\n command: z.literal(\"delete\"),\n path: z.string(),\n});\n\nexport const Memory20250818RenameCommandSchema = z.object({\n command: z.literal(\"rename\"),\n old_path: z.string(),\n new_path: z.string(),\n});\n\n// Discriminated union schema for all memory commands\nexport const Memory20250818CommandSchema = z.discriminatedUnion(\"command\", [\n Memory20250818ViewCommandSchema,\n Memory20250818CreateCommandSchema,\n Memory20250818StrReplaceCommandSchema,\n Memory20250818InsertCommandSchema,\n Memory20250818DeleteCommandSchema,\n Memory20250818RenameCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Memory20250818ViewCommand = z.infer<\n typeof Memory20250818ViewCommandSchema\n>;\nexport type Memory20250818CreateCommand = z.infer<\n typeof Memory20250818CreateCommandSchema\n>;\nexport type Memory20250818StrReplaceCommand = z.infer<\n typeof Memory20250818StrReplaceCommandSchema\n>;\nexport type Memory20250818InsertCommand = z.infer<\n typeof Memory20250818InsertCommandSchema\n>;\nexport type Memory20250818DeleteCommand = z.infer<\n typeof Memory20250818DeleteCommandSchema\n>;\nexport type Memory20250818RenameCommand = z.infer<\n typeof Memory20250818RenameCommandSchema\n>;\n\nexport type Memory20250818Command = z.infer<typeof Memory20250818CommandSchema>;\n\n/**\n * Options for creating a memory tool.\n */\nexport interface MemoryTool20250818Options {\n /**\n * Optional execute function that handles memory command execution.\n * In LangChain, this is typically handled separately when processing tool calls,\n * but this option is provided for compatibility with the AI SDK pattern.\n * Note: This option is currently unused but reserved for future use.\n */\n execute: (action: Memory20250818Command) => Promise<string> | string;\n}\n\n/**\n * Memory tool type definition.\n */\nexport type MemoryTool20250818 = Anthropic.Beta.BetaMemoryTool20250818;\n\n/**\n * Text editor tool command types for Claude 4.x models.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\n\n// Zod schemas for text editor commands\nexport const TextEditor20250728ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n view_range: z.tuple([z.number(), z.number()]).optional(),\n});\n\nexport const TextEditor20250728StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const TextEditor20250728CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const TextEditor20250728InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n new_str: z.string(),\n});\n\n// Discriminated union schema for all text editor commands\nexport const TextEditor20250728CommandSchema = z.discriminatedUnion(\"command\", [\n TextEditor20250728ViewCommandSchema,\n TextEditor20250728StrReplaceCommandSchema,\n TextEditor20250728CreateCommandSchema,\n TextEditor20250728InsertCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type TextEditor20250728ViewCommand = z.infer<\n typeof TextEditor20250728ViewCommandSchema\n>;\nexport type TextEditor20250728StrReplaceCommand = z.infer<\n typeof TextEditor20250728StrReplaceCommandSchema\n>;\nexport type TextEditor20250728CreateCommand = z.infer<\n typeof TextEditor20250728CreateCommandSchema\n>;\nexport type TextEditor20250728InsertCommand = z.infer<\n typeof TextEditor20250728InsertCommandSchema\n>;\nexport type TextEditor20250728Command = z.infer<\n typeof TextEditor20250728CommandSchema\n>;\n\n/**\n * Computer use tool action types for Claude Opus 4.5.\n * Includes zoom action which is not available in earlier versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20251124Action =\n | Computer20250124Action\n | ComputerZoomAction;\n\n/**\n * Computer use tool action types for Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20250124Action =\n | ComputerScreenshotAction\n | ComputerLeftClickAction\n | ComputerRightClickAction\n | ComputerMiddleClickAction\n | ComputerDoubleClickAction\n | ComputerTripleClickAction\n | ComputerLeftClickDragAction\n | ComputerLeftMouseDownAction\n | ComputerLeftMouseUpAction\n | ComputerScrollAction\n | ComputerTypeAction\n | ComputerKeyAction\n | ComputerMouseMoveAction\n | ComputerHoldKeyAction\n | ComputerWaitAction;\n\n// Zod schemas for computer actions\nconst coordinateSchema = z.tuple([z.number(), z.number()]);\n\nexport const ComputerScreenshotActionSchema = z.object({\n action: z.literal(\"screenshot\"),\n});\n\nexport const ComputerLeftClickActionSchema = z.object({\n action: z.literal(\"left_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerRightClickActionSchema = z.object({\n action: z.literal(\"right_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerMiddleClickActionSchema = z.object({\n action: z.literal(\"middle_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerDoubleClickActionSchema = z.object({\n action: z.literal(\"double_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerTripleClickActionSchema = z.object({\n action: z.literal(\"triple_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftClickDragActionSchema = z.object({\n action: z.literal(\"left_click_drag\"),\n start_coordinate: coordinateSchema,\n end_coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseDownActionSchema = z.object({\n action: z.literal(\"left_mouse_down\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseUpActionSchema = z.object({\n action: z.literal(\"left_mouse_up\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerScrollActionSchema = z.object({\n action: z.literal(\"scroll\"),\n coordinate: coordinateSchema,\n scroll_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]),\n scroll_amount: z.number(),\n});\n\nexport const ComputerTypeActionSchema = z.object({\n action: z.literal(\"type\"),\n text: z.string(),\n});\n\nexport const ComputerKeyActionSchema = z.object({\n action: z.literal(\"key\"),\n key: z.string(),\n});\n\nexport const ComputerMouseMoveActionSchema = z.object({\n action: z.literal(\"mouse_move\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerHoldKeyActionSchema = z.object({\n action: z.literal(\"hold_key\"),\n key: z.string(),\n});\n\nexport const ComputerWaitActionSchema = z.object({\n action: z.literal(\"wait\"),\n duration: z.number().optional(),\n});\n\nexport const ComputerZoomActionSchema = z.object({\n action: z.literal(\"zoom\"),\n region: z.tuple([z.number(), z.number(), z.number(), z.number()]),\n});\n\n// Discriminated union schemas\nexport const Computer20250124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n]);\n\nexport const Computer20251124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n ComputerZoomActionSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type ComputerScreenshotAction = z.infer<\n typeof ComputerScreenshotActionSchema\n>;\n\nexport type ComputerLeftClickAction = z.infer<\n typeof ComputerLeftClickActionSchema\n>;\n\nexport type ComputerRightClickAction = z.infer<\n typeof ComputerRightClickActionSchema\n>;\n\nexport type ComputerMiddleClickAction = z.infer<\n typeof ComputerMiddleClickActionSchema\n>;\n\nexport type ComputerDoubleClickAction = z.infer<\n typeof ComputerDoubleClickActionSchema\n>;\n\nexport type ComputerTripleClickAction = z.infer<\n typeof ComputerTripleClickActionSchema\n>;\n\nexport type ComputerLeftClickDragAction = z.infer<\n typeof ComputerLeftClickDragActionSchema\n>;\n\nexport type ComputerLeftMouseDownAction = z.infer<\n typeof ComputerLeftMouseDownActionSchema\n>;\n\nexport type ComputerLeftMouseUpAction = z.infer<\n typeof ComputerLeftMouseUpActionSchema\n>;\n\nexport type ComputerScrollAction = z.infer<typeof ComputerScrollActionSchema>;\n\nexport type ComputerTypeAction = z.infer<typeof ComputerTypeActionSchema>;\n\nexport type ComputerKeyAction = z.infer<typeof ComputerKeyActionSchema>;\n\nexport type ComputerMouseMoveAction = z.infer<\n typeof ComputerMouseMoveActionSchema\n>;\n\nexport type ComputerHoldKeyAction = z.infer<typeof ComputerHoldKeyActionSchema>;\n\nexport type ComputerWaitAction = z.infer<typeof ComputerWaitActionSchema>;\n\nexport type ComputerZoomAction = z.infer<typeof ComputerZoomActionSchema>;\n\n/**\n * Bash tool command types for Claude 4 models and Claude 3.7.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\n\n// Zod schemas for bash commands\nexport const Bash20250124ExecuteCommandSchema = z.object({\n command: z.string().describe(\"The bash command to run\"),\n});\n\nexport const Bash20250124RestartCommandSchema = z.object({\n restart: z.literal(true).describe(\"Set to true to restart the bash session\"),\n});\n\n// Union schema for all bash commands\nexport const Bash20250124CommandSchema = z.union([\n Bash20250124ExecuteCommandSchema,\n Bash20250124RestartCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Bash20250124ExecuteCommand = z.infer<\n typeof Bash20250124ExecuteCommandSchema\n>;\nexport type Bash20250124RestartCommand = z.infer<\n typeof Bash20250124RestartCommandSchema\n>;\nexport type Bash20250124Command = z.infer<typeof Bash20250124CommandSchema>;\n"],"mappings":";;;;;;;;AAUA,MAAa,kCAAkCA,OAAAA,EAAE,OAAO;CACtD,SAASA,OAAAA,EAAE,QAAQ,OAAO;CAC1B,MAAMA,OAAAA,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAa,oCAAoCA,OAAAA,EAAE,OAAO;CACxD,SAASA,OAAAA,EAAE,QAAQ,SAAS;CAC5B,MAAMA,OAAAA,EAAE,QAAQ;CAChB,WAAWA,OAAAA,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAa,wCAAwCA,OAAAA,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;EAAEA,OAAAA,EAAE,QAAQ;EAAC,CAAC;CAClE,CAAC;AAGF,MAAa,+BAA+BA,OAAAA,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,+BAA+BA,OAAAA,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;AA6DF,MAAa,mCAAmCA,OAAAA,EAAE,OAAO,EACvD,SAASA,OAAAA,EAAE,QAAQ,CAAC,SAAS,0BAA0B,EACxD,CAAC;AAEF,MAAa,mCAAmCA,OAAAA,EAAE,OAAO,EACvD,SAASA,OAAAA,EAAE,QAAQ,KAAK,CAAC,SAAS,0CAA0C,EAC7E,CAAC;AAGF,MAAa,4BAA4BA,OAAAA,EAAE,MAAM,CAC/C,kCACA,iCACD,CAAC"}
1
+ {"version":3,"file":"types.cjs","names":["z"],"sources":["../../src/tools/types.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { z } from \"zod/v4\";\n\n/**\n * Memory tool command types as defined by Anthropic's memory tool API.\n * @beta\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\n\n// Zod schemas for memory commands\nexport const Memory20250818ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n});\n\nexport const Memory20250818CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const Memory20250818StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const Memory20250818InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n insert_text: z.string(),\n});\n\nexport const Memory20250818DeleteCommandSchema = z.object({\n command: z.literal(\"delete\"),\n path: z.string(),\n});\n\nexport const Memory20250818RenameCommandSchema = z.object({\n command: z.literal(\"rename\"),\n old_path: z.string(),\n new_path: z.string(),\n});\n\n// Discriminated union schema for all memory commands\nexport const Memory20250818CommandSchema = z.discriminatedUnion(\"command\", [\n Memory20250818ViewCommandSchema,\n Memory20250818CreateCommandSchema,\n Memory20250818StrReplaceCommandSchema,\n Memory20250818InsertCommandSchema,\n Memory20250818DeleteCommandSchema,\n Memory20250818RenameCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Memory20250818ViewCommand = z.infer<\n typeof Memory20250818ViewCommandSchema\n>;\nexport type Memory20250818CreateCommand = z.infer<\n typeof Memory20250818CreateCommandSchema\n>;\nexport type Memory20250818StrReplaceCommand = z.infer<\n typeof Memory20250818StrReplaceCommandSchema\n>;\nexport type Memory20250818InsertCommand = z.infer<\n typeof Memory20250818InsertCommandSchema\n>;\nexport type Memory20250818DeleteCommand = z.infer<\n typeof Memory20250818DeleteCommandSchema\n>;\nexport type Memory20250818RenameCommand = z.infer<\n typeof Memory20250818RenameCommandSchema\n>;\n\nexport type Memory20250818Command = z.infer<typeof Memory20250818CommandSchema>;\n\n/**\n * Options for creating a memory tool.\n */\nexport interface MemoryTool20250818Options {\n /**\n * Optional execute function that handles memory command execution.\n * In LangChain, this is typically handled separately when processing tool calls,\n * but this option is provided for compatibility with the AI SDK pattern.\n * Note: This option is currently unused but reserved for future use.\n */\n execute: (action: Memory20250818Command) => Promise<string> | string;\n}\n\n/**\n * Memory tool type definition.\n */\nexport type MemoryTool20250818 = Anthropic.Beta.BetaMemoryTool20250818;\n\n/**\n * Text editor tool command types for Claude 4.x models.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\n\n// Zod schemas for text editor commands\nexport const TextEditor20250728ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n view_range: z.tuple([z.number(), z.number()]).optional(),\n});\n\nexport const TextEditor20250728StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const TextEditor20250728CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const TextEditor20250728InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n new_str: z.string(),\n});\n\n// Discriminated union schema for all text editor commands\nexport const TextEditor20250728CommandSchema = z.discriminatedUnion(\"command\", [\n TextEditor20250728ViewCommandSchema,\n TextEditor20250728StrReplaceCommandSchema,\n TextEditor20250728CreateCommandSchema,\n TextEditor20250728InsertCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type TextEditor20250728ViewCommand = z.infer<\n typeof TextEditor20250728ViewCommandSchema\n>;\nexport type TextEditor20250728StrReplaceCommand = z.infer<\n typeof TextEditor20250728StrReplaceCommandSchema\n>;\nexport type TextEditor20250728CreateCommand = z.infer<\n typeof TextEditor20250728CreateCommandSchema\n>;\nexport type TextEditor20250728InsertCommand = z.infer<\n typeof TextEditor20250728InsertCommandSchema\n>;\nexport type TextEditor20250728Command = z.infer<\n typeof TextEditor20250728CommandSchema\n>;\n\n/**\n * Computer use tool action types for Claude Opus 4.5.\n * Includes zoom action which is not available in earlier versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20251124Action =\n | Computer20250124Action\n | ComputerZoomAction;\n\n/**\n * Computer use tool action types for Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20250124Action =\n | ComputerScreenshotAction\n | ComputerLeftClickAction\n | ComputerRightClickAction\n | ComputerMiddleClickAction\n | ComputerDoubleClickAction\n | ComputerTripleClickAction\n | ComputerLeftClickDragAction\n | ComputerLeftMouseDownAction\n | ComputerLeftMouseUpAction\n | ComputerScrollAction\n | ComputerTypeAction\n | ComputerKeyAction\n | ComputerMouseMoveAction\n | ComputerHoldKeyAction\n | ComputerWaitAction;\n\n// Zod schemas for computer actions\nconst coordinateSchema = z.tuple([z.number(), z.number()]);\n\nexport const ComputerScreenshotActionSchema = z.object({\n action: z.literal(\"screenshot\"),\n});\n\nexport const ComputerLeftClickActionSchema = z.object({\n action: z.literal(\"left_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerRightClickActionSchema = z.object({\n action: z.literal(\"right_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerMiddleClickActionSchema = z.object({\n action: z.literal(\"middle_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerDoubleClickActionSchema = z.object({\n action: z.literal(\"double_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerTripleClickActionSchema = z.object({\n action: z.literal(\"triple_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftClickDragActionSchema = z.object({\n action: z.literal(\"left_click_drag\"),\n start_coordinate: coordinateSchema,\n end_coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseDownActionSchema = z.object({\n action: z.literal(\"left_mouse_down\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseUpActionSchema = z.object({\n action: z.literal(\"left_mouse_up\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerScrollActionSchema = z.object({\n action: z.literal(\"scroll\"),\n coordinate: coordinateSchema,\n scroll_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]),\n scroll_amount: z.number(),\n});\n\nexport const ComputerTypeActionSchema = z.object({\n action: z.literal(\"type\"),\n text: z.string(),\n});\n\nexport const ComputerKeyActionSchema = z.object({\n action: z.literal(\"key\"),\n key: z.string(),\n});\n\nexport const ComputerMouseMoveActionSchema = z.object({\n action: z.literal(\"mouse_move\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerHoldKeyActionSchema = z.object({\n action: z.literal(\"hold_key\"),\n key: z.string(),\n});\n\nexport const ComputerWaitActionSchema = z.object({\n action: z.literal(\"wait\"),\n duration: z.number().optional(),\n});\n\nexport const ComputerZoomActionSchema = z.object({\n action: z.literal(\"zoom\"),\n region: z.tuple([z.number(), z.number(), z.number(), z.number()]),\n});\n\n// Discriminated union schemas\nexport const Computer20250124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n]);\n\nexport const Computer20251124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n ComputerZoomActionSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type ComputerScreenshotAction = z.infer<\n typeof ComputerScreenshotActionSchema\n>;\n\nexport type ComputerLeftClickAction = z.infer<\n typeof ComputerLeftClickActionSchema\n>;\n\nexport type ComputerRightClickAction = z.infer<\n typeof ComputerRightClickActionSchema\n>;\n\nexport type ComputerMiddleClickAction = z.infer<\n typeof ComputerMiddleClickActionSchema\n>;\n\nexport type ComputerDoubleClickAction = z.infer<\n typeof ComputerDoubleClickActionSchema\n>;\n\nexport type ComputerTripleClickAction = z.infer<\n typeof ComputerTripleClickActionSchema\n>;\n\nexport type ComputerLeftClickDragAction = z.infer<\n typeof ComputerLeftClickDragActionSchema\n>;\n\nexport type ComputerLeftMouseDownAction = z.infer<\n typeof ComputerLeftMouseDownActionSchema\n>;\n\nexport type ComputerLeftMouseUpAction = z.infer<\n typeof ComputerLeftMouseUpActionSchema\n>;\n\nexport type ComputerScrollAction = z.infer<typeof ComputerScrollActionSchema>;\n\nexport type ComputerTypeAction = z.infer<typeof ComputerTypeActionSchema>;\n\nexport type ComputerKeyAction = z.infer<typeof ComputerKeyActionSchema>;\n\nexport type ComputerMouseMoveAction = z.infer<\n typeof ComputerMouseMoveActionSchema\n>;\n\nexport type ComputerHoldKeyAction = z.infer<typeof ComputerHoldKeyActionSchema>;\n\nexport type ComputerWaitAction = z.infer<typeof ComputerWaitActionSchema>;\n\nexport type ComputerZoomAction = z.infer<typeof ComputerZoomActionSchema>;\n\n/**\n * Bash tool command types for Claude 4 models and Claude 3.7.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\n\n// Zod schemas for bash commands\nexport const Bash20250124ExecuteCommandSchema = z.object({\n command: z.string().describe(\"The bash command to run\"),\n});\n\nexport const Bash20250124RestartCommandSchema = z.object({\n restart: z.literal(true).describe(\"Set to true to restart the bash session\"),\n});\n\n// Union schema for all bash commands\nexport const Bash20250124CommandSchema = z.union([\n Bash20250124ExecuteCommandSchema,\n Bash20250124RestartCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Bash20250124ExecuteCommand = z.infer<\n typeof Bash20250124ExecuteCommandSchema\n>;\nexport type Bash20250124RestartCommand = z.infer<\n typeof Bash20250124RestartCommandSchema\n>;\nexport type Bash20250124Command = z.infer<typeof Bash20250124CommandSchema>;\n"],"mappings":";;;;;;;AAUA,MAAa,kCAAkCA,OAAAA,EAAE,OAAO;CACtD,SAASA,OAAAA,EAAE,QAAQ,MAAM;CACzB,MAAMA,OAAAA,E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AAO;CAC/C,QAAQA,OAAAA,EAAE,QAAQ,MAAM;CACxB,QAAQA,OAAAA,EAAE,MAAM;EAACA,OAAAA,EAAE,OAAO;EAAGA,OAAAA,EAAE,OAAO;EAAGA,OAAAA,EAAE,OAAO;EAAGA,OAAAA,EAAE,OAAO;CAAC,CAAC;AAClE,CAAC;AAGD,MAAa,+BAA+BA,OAAAA,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,+BAA+BA,OAAAA,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AA6DD,MAAa,mCAAmCA,OAAAA,EAAE,OAAO,EACvD,SAASA,OAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB,EACxD,CAAC;AAED,MAAa,mCAAmCA,OAAAA,EAAE,OAAO,EACvD,SAASA,OAAAA,EAAE,QAAQ,IAAI,CAAC,CAAC,SAAS,yCAAyC,EAC7E,CAAC;AAGD,MAAa,4BAA4BA,OAAAA,EAAE,MAAM,CAC/C,kCACA,gCACF,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { z } from "zod/v4";
3
-
4
3
  //#region src/tools/types.d.ts
5
4
  /**
6
5
  * Memory tool command types as defined by Anthropic's memory tool API.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/tools/types.ts"],"mappings":";;;;;;AAUA;;;cAAa,+BAAA,EAA+B,CAAA,CAAA,SAAA;;;;cAK/B,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;;cAMjC,qCAAA,EAAqC,CAAA,CAAA,SAAA;;;;;;cAOrC,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;;;cAOjC,iCAAA,EAAiC,CAAA,CAAA,S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E,aAC/B;KAGG,wBAAwB,EAAE,aAAa;KAEvC,qBAAqB,EAAE,aAAa;KAEpC,qBAAqB,EAAE,aAAa;;;;;cAQnC,kCAAgC,EAAA;;GAE3C,EAAA,KAAA;cAEW,kCAAgC,EAAA;;GAE3C,EAAA,KAAA;cAGW,2BAAyB,EAAA,mBAAA,EAAA;;;;GAGpC,EAAA,KAAA;KAGU,6BAA6B,EAAE,aAClC;KAEG,6BAA6B,EAAE,aAClC;KAEG,sBAAsB,EAAE,aAAa"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { z } from "zod/v4";
3
-
4
3
  //#region src/tools/types.d.ts
5
4
  /**
6
5
  * Memory tool command types as defined by Anthropic's memory tool API.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/tools/types.ts"],"mappings":";;;;;;AAUA;;;cAAa,+BAAA,EAA+B,CAAA,CAAA,SAAA;;;;cAK/B,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;;cAMjC,qCAAA,EAAqC,CAAA,CAAA,SAAA;;;;;;cAOrC,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;;;cAOjC,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;cAKjC,iCAAA,EAAiC,CAAA,CAAA,SAAA;;;;;cAOjC,2BAAA,EAA2B,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAU5B,yBAAA,GAA4B,CAAA,CAAE,KAAA,QACjC,+BAAA;AAAA,KAEG,2BAAA,GAA8B,CAAA,CAAE,KAAA,QACnC,iCAAA;AAAA,KAEG,+BAAA,GAAkC,CAAA,CAAE,KAAA,QACvC,qCAAA;AAAA,KAEG,2BAAA,GAA8B,CAAA,CAAE,KAAA,QACnC,iCAAA;AAAA,KAEG,2BAAA,GAA8B,CAAA,CAAE,KAAA,QACnC,iCAAA;AAAA,KAEG,2BAAA,GAA8B,CAAA,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AA;;;GAGlC,EAAA,KAAA;cAEW,+BAA6B,EAAA;;;GAGxC,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;GAGtC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;;GAGnC,EAAA,KAAA;cAEW,0BAAwB,EAAA;;;GAGnC,EAAA,KAAA;cAGW,8BAA4B,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBvC,EAAA,KAAA;cAEW,8BAA4B,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBvC,EAAA,KAAA;KAGU,2BAA2B,EAAE,aAChC;KAGG,0BAA0B,EAAE,aAC/B;KAGG,2BAA2B,EAAE,aAChC;KAGG,4BAA4B,EAAE,aACjC;KAGG,4BAA4B,EAAE,aACjC;KAGG,4BAA4B,EAAE,aACjC;KAGG,8BAA8B,EAAE,aACnC;KAGG,8BAA8B,EAAE,aACnC;KAGG,4BAA4B,EAAE,aACjC;KAGG,uBAAuB,EAAE,aAAa;KAEtC,qBAAqB,EAAE,aAAa;KAEpC,oBAAoB,EAAE,aAAa;KAEnC,0BAA0B,EAAE,aAC/B;KAGG,wBAAwB,EAAE,aAAa;KAEvC,qBAAqB,EAAE,aAAa;KAEpC,qBAAqB,EAAE,aAAa;;;;;cAQnC,kCAAgC,EAAA;;GAE3C,EAAA,KAAA;cAEW,kCAAgC,EAAA;;GAE3C,EAAA,KAAA;cAGW,2BAAyB,EAAA,mBAAA,EAAA;;;;GAGpC,EAAA,KAAA;KAGU,6BAA6B,EAAE,aAClC;KAEG,6BAA6B,EAAE,aAClC;KAEG,sBAAsB,EAAE,aAAa"}
@@ -193,6 +193,6 @@ const Bash20250124ExecuteCommandSchema = z.object({ command: z.string().describe
193
193
  const Bash20250124RestartCommandSchema = z.object({ restart: z.literal(true).describe("Set to true to restart the bash session") });
194
194
  const Bash20250124CommandSchema = z.union([Bash20250124ExecuteCommandSchema, Bash20250124RestartCommandSchema]);
195
195
  //#endregion
196
- export { Bash20250124CommandSchema, Computer20250124ActionSchema, Computer20251124ActionSchema, Memory20250818CommandSchema, TextEditor20250728CommandSchema };
196
+ export { Bash20250124CommandSchema, Bash20250124ExecuteCommandSchema, Bash20250124RestartCommandSchema, Computer20250124ActionSchema, Computer20251124ActionSchema, ComputerDoubleClickActionSchema, ComputerHoldKeyActionSchema, ComputerKeyActionSchema, ComputerLeftClickActionSchema, ComputerLeftClickDragActionSchema, ComputerLeftMouseDownActionSchema, ComputerLeftMouseUpActionSchema, ComputerMiddleClickActionSchema, ComputerMouseMoveActionSchema, ComputerRightClickActionSchema, ComputerScreenshotActionSchema, ComputerScrollActionSchema, ComputerTripleClickActionSchema, ComputerTypeActionSchema, ComputerWaitActionSchema, ComputerZoomActionSchema, Memory20250818CommandSchema, Memory20250818CreateCommandSchema, Memory20250818DeleteCommandSchema, Memory20250818InsertCommandSchema, Memory20250818RenameCommandSchema, Memory20250818StrReplaceCommandSchema, Memory20250818ViewCommandSchema, TextEditor20250728CommandSchema, TextEditor20250728CreateCommandSchema, TextEditor20250728InsertCommandSchema, TextEditor20250728StrReplaceCommandSchema, TextEditor20250728ViewCommandSchema };
197
197
 
198
198
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/tools/types.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { z } from \"zod/v4\";\n\n/**\n * Memory tool command types as defined by Anthropic's memory tool API.\n * @beta\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\n\n// Zod schemas for memory commands\nexport const Memory20250818ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n});\n\nexport const Memory20250818CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const Memory20250818StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const Memory20250818InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n insert_text: z.string(),\n});\n\nexport const Memory20250818DeleteCommandSchema = z.object({\n command: z.literal(\"delete\"),\n path: z.string(),\n});\n\nexport const Memory20250818RenameCommandSchema = z.object({\n command: z.literal(\"rename\"),\n old_path: z.string(),\n new_path: z.string(),\n});\n\n// Discriminated union schema for all memory commands\nexport const Memory20250818CommandSchema = z.discriminatedUnion(\"command\", [\n Memory20250818ViewCommandSchema,\n Memory20250818CreateCommandSchema,\n Memory20250818StrReplaceCommandSchema,\n Memory20250818InsertCommandSchema,\n Memory20250818DeleteCommandSchema,\n Memory20250818RenameCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Memory20250818ViewCommand = z.infer<\n typeof Memory20250818ViewCommandSchema\n>;\nexport type Memory20250818CreateCommand = z.infer<\n typeof Memory20250818CreateCommandSchema\n>;\nexport type Memory20250818StrReplaceCommand = z.infer<\n typeof Memory20250818StrReplaceCommandSchema\n>;\nexport type Memory20250818InsertCommand = z.infer<\n typeof Memory20250818InsertCommandSchema\n>;\nexport type Memory20250818DeleteCommand = z.infer<\n typeof Memory20250818DeleteCommandSchema\n>;\nexport type Memory20250818RenameCommand = z.infer<\n typeof Memory20250818RenameCommandSchema\n>;\n\nexport type Memory20250818Command = z.infer<typeof Memory20250818CommandSchema>;\n\n/**\n * Options for creating a memory tool.\n */\nexport interface MemoryTool20250818Options {\n /**\n * Optional execute function that handles memory command execution.\n * In LangChain, this is typically handled separately when processing tool calls,\n * but this option is provided for compatibility with the AI SDK pattern.\n * Note: This option is currently unused but reserved for future use.\n */\n execute: (action: Memory20250818Command) => Promise<string> | string;\n}\n\n/**\n * Memory tool type definition.\n */\nexport type MemoryTool20250818 = Anthropic.Beta.BetaMemoryTool20250818;\n\n/**\n * Text editor tool command types for Claude 4.x models.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\n\n// Zod schemas for text editor commands\nexport const TextEditor20250728ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n view_range: z.tuple([z.number(), z.number()]).optional(),\n});\n\nexport const TextEditor20250728StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const TextEditor20250728CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const TextEditor20250728InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n new_str: z.string(),\n});\n\n// Discriminated union schema for all text editor commands\nexport const TextEditor20250728CommandSchema = z.discriminatedUnion(\"command\", [\n TextEditor20250728ViewCommandSchema,\n TextEditor20250728StrReplaceCommandSchema,\n TextEditor20250728CreateCommandSchema,\n TextEditor20250728InsertCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type TextEditor20250728ViewCommand = z.infer<\n typeof TextEditor20250728ViewCommandSchema\n>;\nexport type TextEditor20250728StrReplaceCommand = z.infer<\n typeof TextEditor20250728StrReplaceCommandSchema\n>;\nexport type TextEditor20250728CreateCommand = z.infer<\n typeof TextEditor20250728CreateCommandSchema\n>;\nexport type TextEditor20250728InsertCommand = z.infer<\n typeof TextEditor20250728InsertCommandSchema\n>;\nexport type TextEditor20250728Command = z.infer<\n typeof TextEditor20250728CommandSchema\n>;\n\n/**\n * Computer use tool action types for Claude Opus 4.5.\n * Includes zoom action which is not available in earlier versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20251124Action =\n | Computer20250124Action\n | ComputerZoomAction;\n\n/**\n * Computer use tool action types for Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20250124Action =\n | ComputerScreenshotAction\n | ComputerLeftClickAction\n | ComputerRightClickAction\n | ComputerMiddleClickAction\n | ComputerDoubleClickAction\n | ComputerTripleClickAction\n | ComputerLeftClickDragAction\n | ComputerLeftMouseDownAction\n | ComputerLeftMouseUpAction\n | ComputerScrollAction\n | ComputerTypeAction\n | ComputerKeyAction\n | ComputerMouseMoveAction\n | ComputerHoldKeyAction\n | ComputerWaitAction;\n\n// Zod schemas for computer actions\nconst coordinateSchema = z.tuple([z.number(), z.number()]);\n\nexport const ComputerScreenshotActionSchema = z.object({\n action: z.literal(\"screenshot\"),\n});\n\nexport const ComputerLeftClickActionSchema = z.object({\n action: z.literal(\"left_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerRightClickActionSchema = z.object({\n action: z.literal(\"right_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerMiddleClickActionSchema = z.object({\n action: z.literal(\"middle_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerDoubleClickActionSchema = z.object({\n action: z.literal(\"double_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerTripleClickActionSchema = z.object({\n action: z.literal(\"triple_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftClickDragActionSchema = z.object({\n action: z.literal(\"left_click_drag\"),\n start_coordinate: coordinateSchema,\n end_coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseDownActionSchema = z.object({\n action: z.literal(\"left_mouse_down\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseUpActionSchema = z.object({\n action: z.literal(\"left_mouse_up\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerScrollActionSchema = z.object({\n action: z.literal(\"scroll\"),\n coordinate: coordinateSchema,\n scroll_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]),\n scroll_amount: z.number(),\n});\n\nexport const ComputerTypeActionSchema = z.object({\n action: z.literal(\"type\"),\n text: z.string(),\n});\n\nexport const ComputerKeyActionSchema = z.object({\n action: z.literal(\"key\"),\n key: z.string(),\n});\n\nexport const ComputerMouseMoveActionSchema = z.object({\n action: z.literal(\"mouse_move\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerHoldKeyActionSchema = z.object({\n action: z.literal(\"hold_key\"),\n key: z.string(),\n});\n\nexport const ComputerWaitActionSchema = z.object({\n action: z.literal(\"wait\"),\n duration: z.number().optional(),\n});\n\nexport const ComputerZoomActionSchema = z.object({\n action: z.literal(\"zoom\"),\n region: z.tuple([z.number(), z.number(), z.number(), z.number()]),\n});\n\n// Discriminated union schemas\nexport const Computer20250124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n]);\n\nexport const Computer20251124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n ComputerZoomActionSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type ComputerScreenshotAction = z.infer<\n typeof ComputerScreenshotActionSchema\n>;\n\nexport type ComputerLeftClickAction = z.infer<\n typeof ComputerLeftClickActionSchema\n>;\n\nexport type ComputerRightClickAction = z.infer<\n typeof ComputerRightClickActionSchema\n>;\n\nexport type ComputerMiddleClickAction = z.infer<\n typeof ComputerMiddleClickActionSchema\n>;\n\nexport type ComputerDoubleClickAction = z.infer<\n typeof ComputerDoubleClickActionSchema\n>;\n\nexport type ComputerTripleClickAction = z.infer<\n typeof ComputerTripleClickActionSchema\n>;\n\nexport type ComputerLeftClickDragAction = z.infer<\n typeof ComputerLeftClickDragActionSchema\n>;\n\nexport type ComputerLeftMouseDownAction = z.infer<\n typeof ComputerLeftMouseDownActionSchema\n>;\n\nexport type ComputerLeftMouseUpAction = z.infer<\n typeof ComputerLeftMouseUpActionSchema\n>;\n\nexport type ComputerScrollAction = z.infer<typeof ComputerScrollActionSchema>;\n\nexport type ComputerTypeAction = z.infer<typeof ComputerTypeActionSchema>;\n\nexport type ComputerKeyAction = z.infer<typeof ComputerKeyActionSchema>;\n\nexport type ComputerMouseMoveAction = z.infer<\n typeof ComputerMouseMoveActionSchema\n>;\n\nexport type ComputerHoldKeyAction = z.infer<typeof ComputerHoldKeyActionSchema>;\n\nexport type ComputerWaitAction = z.infer<typeof ComputerWaitActionSchema>;\n\nexport type ComputerZoomAction = z.infer<typeof ComputerZoomActionSchema>;\n\n/**\n * Bash tool command types for Claude 4 models and Claude 3.7.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\n\n// Zod schemas for bash commands\nexport const Bash20250124ExecuteCommandSchema = z.object({\n command: z.string().describe(\"The bash command to run\"),\n});\n\nexport const Bash20250124RestartCommandSchema = z.object({\n restart: z.literal(true).describe(\"Set to true to restart the bash session\"),\n});\n\n// Union schema for all bash commands\nexport const Bash20250124CommandSchema = z.union([\n Bash20250124ExecuteCommandSchema,\n Bash20250124RestartCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Bash20250124ExecuteCommand = z.infer<\n typeof Bash20250124ExecuteCommandSchema\n>;\nexport type Bash20250124Restart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A6DF,MAAa,mCAAmC,EAAE,OAAO,EACvD,SAAS,EAAE,QAAQ,CAAC,SAAS,0BAA0B,EACxD,CAAC;AAEF,MAAa,mCAAmC,EAAE,OAAO,EACvD,SAAS,EAAE,QAAQ,KAAK,CAAC,SAAS,0CAA0C,EAC7E,CAAC;AAGF,MAAa,4BAA4B,EAAE,MAAM,CAC/C,kCACA,iCACD,CAAC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/tools/types.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { z } from \"zod/v4\";\n\n/**\n * Memory tool command types as defined by Anthropic's memory tool API.\n * @beta\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\n\n// Zod schemas for memory commands\nexport const Memory20250818ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n});\n\nexport const Memory20250818CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const Memory20250818StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const Memory20250818InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n insert_text: z.string(),\n});\n\nexport const Memory20250818DeleteCommandSchema = z.object({\n command: z.literal(\"delete\"),\n path: z.string(),\n});\n\nexport const Memory20250818RenameCommandSchema = z.object({\n command: z.literal(\"rename\"),\n old_path: z.string(),\n new_path: z.string(),\n});\n\n// Discriminated union schema for all memory commands\nexport const Memory20250818CommandSchema = z.discriminatedUnion(\"command\", [\n Memory20250818ViewCommandSchema,\n Memory20250818CreateCommandSchema,\n Memory20250818StrReplaceCommandSchema,\n Memory20250818InsertCommandSchema,\n Memory20250818DeleteCommandSchema,\n Memory20250818RenameCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Memory20250818ViewCommand = z.infer<\n typeof Memory20250818ViewCommandSchema\n>;\nexport type Memory20250818CreateCommand = z.infer<\n typeof Memory20250818CreateCommandSchema\n>;\nexport type Memory20250818StrReplaceCommand = z.infer<\n typeof Memory20250818StrReplaceCommandSchema\n>;\nexport type Memory20250818InsertCommand = z.infer<\n typeof Memory20250818InsertCommandSchema\n>;\nexport type Memory20250818DeleteCommand = z.infer<\n typeof Memory20250818DeleteCommandSchema\n>;\nexport type Memory20250818RenameCommand = z.infer<\n typeof Memory20250818RenameCommandSchema\n>;\n\nexport type Memory20250818Command = z.infer<typeof Memory20250818CommandSchema>;\n\n/**\n * Options for creating a memory tool.\n */\nexport interface MemoryTool20250818Options {\n /**\n * Optional execute function that handles memory command execution.\n * In LangChain, this is typically handled separately when processing tool calls,\n * but this option is provided for compatibility with the AI SDK pattern.\n * Note: This option is currently unused but reserved for future use.\n */\n execute: (action: Memory20250818Command) => Promise<string> | string;\n}\n\n/**\n * Memory tool type definition.\n */\nexport type MemoryTool20250818 = Anthropic.Beta.BetaMemoryTool20250818;\n\n/**\n * Text editor tool command types for Claude 4.x models.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool\n */\n\n// Zod schemas for text editor commands\nexport const TextEditor20250728ViewCommandSchema = z.object({\n command: z.literal(\"view\"),\n path: z.string(),\n view_range: z.tuple([z.number(), z.number()]).optional(),\n});\n\nexport const TextEditor20250728StrReplaceCommandSchema = z.object({\n command: z.literal(\"str_replace\"),\n path: z.string(),\n old_str: z.string(),\n new_str: z.string(),\n});\n\nexport const TextEditor20250728CreateCommandSchema = z.object({\n command: z.literal(\"create\"),\n path: z.string(),\n file_text: z.string(),\n});\n\nexport const TextEditor20250728InsertCommandSchema = z.object({\n command: z.literal(\"insert\"),\n path: z.string(),\n insert_line: z.number(),\n new_str: z.string(),\n});\n\n// Discriminated union schema for all text editor commands\nexport const TextEditor20250728CommandSchema = z.discriminatedUnion(\"command\", [\n TextEditor20250728ViewCommandSchema,\n TextEditor20250728StrReplaceCommandSchema,\n TextEditor20250728CreateCommandSchema,\n TextEditor20250728InsertCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type TextEditor20250728ViewCommand = z.infer<\n typeof TextEditor20250728ViewCommandSchema\n>;\nexport type TextEditor20250728StrReplaceCommand = z.infer<\n typeof TextEditor20250728StrReplaceCommandSchema\n>;\nexport type TextEditor20250728CreateCommand = z.infer<\n typeof TextEditor20250728CreateCommandSchema\n>;\nexport type TextEditor20250728InsertCommand = z.infer<\n typeof TextEditor20250728InsertCommandSchema\n>;\nexport type TextEditor20250728Command = z.infer<\n typeof TextEditor20250728CommandSchema\n>;\n\n/**\n * Computer use tool action types for Claude Opus 4.5.\n * Includes zoom action which is not available in earlier versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20251124Action =\n | Computer20250124Action\n | ComputerZoomAction;\n\n/**\n * Computer use tool action types for Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n * @see https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool\n */\nexport type Computer20250124Action =\n | ComputerScreenshotAction\n | ComputerLeftClickAction\n | ComputerRightClickAction\n | ComputerMiddleClickAction\n | ComputerDoubleClickAction\n | ComputerTripleClickAction\n | ComputerLeftClickDragAction\n | ComputerLeftMouseDownAction\n | ComputerLeftMouseUpAction\n | ComputerScrollAction\n | ComputerTypeAction\n | ComputerKeyAction\n | ComputerMouseMoveAction\n | ComputerHoldKeyAction\n | ComputerWaitAction;\n\n// Zod schemas for computer actions\nconst coordinateSchema = z.tuple([z.number(), z.number()]);\n\nexport const ComputerScreenshotActionSchema = z.object({\n action: z.literal(\"screenshot\"),\n});\n\nexport const ComputerLeftClickActionSchema = z.object({\n action: z.literal(\"left_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerRightClickActionSchema = z.object({\n action: z.literal(\"right_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerMiddleClickActionSchema = z.object({\n action: z.literal(\"middle_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerDoubleClickActionSchema = z.object({\n action: z.literal(\"double_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerTripleClickActionSchema = z.object({\n action: z.literal(\"triple_click\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftClickDragActionSchema = z.object({\n action: z.literal(\"left_click_drag\"),\n start_coordinate: coordinateSchema,\n end_coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseDownActionSchema = z.object({\n action: z.literal(\"left_mouse_down\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerLeftMouseUpActionSchema = z.object({\n action: z.literal(\"left_mouse_up\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerScrollActionSchema = z.object({\n action: z.literal(\"scroll\"),\n coordinate: coordinateSchema,\n scroll_direction: z.enum([\"up\", \"down\", \"left\", \"right\"]),\n scroll_amount: z.number(),\n});\n\nexport const ComputerTypeActionSchema = z.object({\n action: z.literal(\"type\"),\n text: z.string(),\n});\n\nexport const ComputerKeyActionSchema = z.object({\n action: z.literal(\"key\"),\n key: z.string(),\n});\n\nexport const ComputerMouseMoveActionSchema = z.object({\n action: z.literal(\"mouse_move\"),\n coordinate: coordinateSchema,\n});\n\nexport const ComputerHoldKeyActionSchema = z.object({\n action: z.literal(\"hold_key\"),\n key: z.string(),\n});\n\nexport const ComputerWaitActionSchema = z.object({\n action: z.literal(\"wait\"),\n duration: z.number().optional(),\n});\n\nexport const ComputerZoomActionSchema = z.object({\n action: z.literal(\"zoom\"),\n region: z.tuple([z.number(), z.number(), z.number(), z.number()]),\n});\n\n// Discriminated union schemas\nexport const Computer20250124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n]);\n\nexport const Computer20251124ActionSchema = z.discriminatedUnion(\"action\", [\n ComputerScreenshotActionSchema,\n ComputerLeftClickActionSchema,\n ComputerRightClickActionSchema,\n ComputerMiddleClickActionSchema,\n ComputerDoubleClickActionSchema,\n ComputerTripleClickActionSchema,\n ComputerLeftClickDragActionSchema,\n ComputerLeftMouseDownActionSchema,\n ComputerLeftMouseUpActionSchema,\n ComputerScrollActionSchema,\n ComputerTypeActionSchema,\n ComputerKeyActionSchema,\n ComputerMouseMoveActionSchema,\n ComputerHoldKeyActionSchema,\n ComputerWaitActionSchema,\n ComputerZoomActionSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type ComputerScreenshotAction = z.infer<\n typeof ComputerScreenshotActionSchema\n>;\n\nexport type ComputerLeftClickAction = z.infer<\n typeof ComputerLeftClickActionSchema\n>;\n\nexport type ComputerRightClickAction = z.infer<\n typeof ComputerRightClickActionSchema\n>;\n\nexport type ComputerMiddleClickAction = z.infer<\n typeof ComputerMiddleClickActionSchema\n>;\n\nexport type ComputerDoubleClickAction = z.infer<\n typeof ComputerDoubleClickActionSchema\n>;\n\nexport type ComputerTripleClickAction = z.infer<\n typeof ComputerTripleClickActionSchema\n>;\n\nexport type ComputerLeftClickDragAction = z.infer<\n typeof ComputerLeftClickDragActionSchema\n>;\n\nexport type ComputerLeftMouseDownAction = z.infer<\n typeof ComputerLeftMouseDownActionSchema\n>;\n\nexport type ComputerLeftMouseUpAction = z.infer<\n typeof ComputerLeftMouseUpActionSchema\n>;\n\nexport type ComputerScrollAction = z.infer<typeof ComputerScrollActionSchema>;\n\nexport type ComputerTypeAction = z.infer<typeof ComputerTypeActionSchema>;\n\nexport type ComputerKeyAction = z.infer<typeof ComputerKeyActionSchema>;\n\nexport type ComputerMouseMoveAction = z.infer<\n typeof ComputerMouseMoveActionSchema\n>;\n\nexport type ComputerHoldKeyAction = z.infer<typeof ComputerHoldKeyActionSchema>;\n\nexport type ComputerWaitAction = z.infer<typeof ComputerWaitActionSchema>;\n\nexport type ComputerZoomAction = z.infer<typeof ComputerZoomActionSchema>;\n\n/**\n * Bash tool command types for Claude 4 models and Claude 3.7.\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/bash-tool\n */\n\n// Zod schemas for bash commands\nexport const Bash20250124ExecuteCommandSchema = z.object({\n command: z.string().describe(\"The bash command to run\"),\n});\n\nexport const Bash20250124RestartCommandSchema = z.object({\n restart: z.literal(true).describe(\"Set to true to restart the bash session\"),\n});\n\n// Union schema for all bash commands\nexport const Bash20250124CommandSchema = z.union([\n Bash20250124ExecuteCommandSchema,\n Bash20250124RestartCommandSchema,\n]);\n\n// TypeScript types derived from Zod schemas\nexport type Bash20250124ExecuteCommand = z.infer<\n typeof Bash20250124ExecuteCommandSchema\n>;\nexport type Bash20250124RestartCommand = z.infer<\n typeof Bash20250124RestartCommandSchema\n>;\nexport type Bash20250124Command = z.infer<typeof Bash20250124CommandSchema>;\n"],"mappings":";;;;;;;AAUA,MAAa,kCAAkC,EAAE,OAAO;CACtD,SAAS,EAAE,QAAQ,MAAM;CACzB,MAAM,EAAE,OAAO;AACjB,CAAC;AAED,MAAa,oCAAoC,EAAE,OAAO;CACxD,SAAS,EAAE,QAAQ,QAAQ;CAC3B,MAAM,EAAE,OAAO;CACf,WAAW,EAAE,OAAO;AACtB,CAAC;AAED,MAAa,wCAAwC,EAAE,OAAO;CAC5D,SAAS,EAAE,QAAQ,aAAa;CAChC,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO;AACpB,CAAC;AAED,MAAa,oCAAoC,EAAE,OAAO;CACxD,SAAS,EAAE,QAAQ,QAAQ;CAC3B,MAAM,EAAE,OAAO;CACf,aAAa,EAAE,O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EAAE,OAAO;AAChB,CAAC;AAED,MAAa,2BAA2B,EAAE,OAAO;CAC/C,QAAQ,EAAE,QAAQ,MAAM;CACxB,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAED,MAAa,2BAA2B,EAAE,OAAO;CAC/C,QAAQ,EAAE,QAAQ,MAAM;CACxB,QAAQ,EAAE,MAAM;EAAC,EAAE,OAAO;EAAG,EAAE,OAAO;EAAG,EAAE,OAAO;EAAG,EAAE,OAAO;CAAC,CAAC;AAClE,CAAC;AAGD,MAAa,+BAA+B,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,+BAA+B,EAAE,mBAAmB,UAAU;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AA6DD,MAAa,mCAAmC,EAAE,OAAO,EACvD,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,yBAAyB,EACxD,CAAC;AAED,MAAa,mCAAmC,EAAE,OAAO,EACvD,SAAS,EAAE,QAAQ,IAAI,CAAC,CAAC,SAAS,yCAAyC,EAC7E,CAAC;AAGD,MAAa,4BAA4B,EAAE,MAAM,CAC/C,kCACA,gCACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"webFetch.cjs","names":[],"sources":["../../src/tools/webFetch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web fetch tool.\n */\nexport interface WebFetch20250910Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be fetched. Cannot be used\n * alongside `blockedDomains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never be fetched. Cannot be used\n * alongside `allowedDomains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Enable citations for fetched content. Unlike web search where citations\n * are always enabled, citations are optional for web fetch.\n */\n citations?: {\n enabled: boolean;\n };\n /**\n * Maximum content length in tokens. If the fetched content exceeds this limit,\n * it will be truncated. This helps control token usage when fetching large documents.\n */\n maxContentTokens?: number;\n}\n\n/**\n * Creates a web fetch tool that allows Claude to retrieve full content from specified\n * web pages and PDF documents. Claude can only fetch URLs that have been explicitly\n * provided by the user or that come from previous web search or web fetch results.\n *\n * @warning Enabling the web fetch tool in environments where Claude processes untrusted\n * input alongside sensitive data poses data exfiltration risks. We recommend only using\n * this tool in trusted environments or when handling non-sensitive data.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-fetch-tool | Anthropic Web Fetch Documentation}\n * @param options - Configuration options for the web fetch tool\n * @returns A web fetch tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - fetch content from a URL\n * const response = await model.invoke(\n * \"Please analyze the content at https://example.com/article\",\n * { tools: [tools.webFetch_20250910()] }\n * );\n *\n * // With options\n * const responseWithOptions = await model.invoke(\n * \"Summarize this research paper: https://arxiv.org/abs/2024.12345\",\n * {\n * tools: [tools.webFetch_20250910({\n * maxUses: 5,\n * allowedDomains: [\"arxiv.org\", \"example.com\"],\n * citations: { enabled: true },\n * maxContentTokens: 50000,\n * })],\n * }\n * );\n *\n * // Combined with web search for comprehensive information gathering\n * const combinedResponse = await model.invoke(\n * \"Find recent articles about quantum computing and analyze the most relevant one\",\n * {\n * tools: [\n * tools.webSearch_20250305({ maxUses: 3 }),\n * tools.webFetch_20250910({ maxUses: 5, citations: { enabled: true } }),\n * ],\n * }\n * );\n * ```\n */\nexport function webFetch_20250910(\n options?: WebFetch20250910Options\n): ServerTool {\n return {\n type: \"web_fetch_20250910\",\n name: \"web_fetch\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n citations: options?.citations,\n max_content_tokens: options?.maxContentTokens,\n } satisfies Anthropic.Beta.BetaWebFetchTool20250910;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,kBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,WAAW,SAAS;EACpB,oBAAoB,SAAS;EAC9B"}
1
+ {"version":3,"file":"webFetch.cjs","names":[],"sources":["../../src/tools/webFetch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web fetch tool.\n */\nexport interface WebFetch20250910Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be fetched. Cannot be used\n * alongside `blockedDomains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never be fetched. Cannot be used\n * alongside `allowedDomains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Enable citations for fetched content. Unlike web search where citations\n * are always enabled, citations are optional for web fetch.\n */\n citations?: {\n enabled: boolean;\n };\n /**\n * Maximum content length in tokens. If the fetched content exceeds this limit,\n * it will be truncated. This helps control token usage when fetching large documents.\n */\n maxContentTokens?: number;\n}\n\n/**\n * Creates a web fetch tool that allows Claude to retrieve full content from specified\n * web pages and PDF documents. Claude can only fetch URLs that have been explicitly\n * provided by the user or that come from previous web search or web fetch results.\n *\n * @warning Enabling the web fetch tool in environments where Claude processes untrusted\n * input alongside sensitive data poses data exfiltration risks. We recommend only using\n * this tool in trusted environments or when handling non-sensitive data.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-fetch-tool | Anthropic Web Fetch Documentation}\n * @param options - Configuration options for the web fetch tool\n * @returns A web fetch tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - fetch content from a URL\n * const response = await model.invoke(\n * \"Please analyze the content at https://example.com/article\",\n * { tools: [tools.webFetch_20250910()] }\n * );\n *\n * // With options\n * const responseWithOptions = await model.invoke(\n * \"Summarize this research paper: https://arxiv.org/abs/2024.12345\",\n * {\n * tools: [tools.webFetch_20250910({\n * maxUses: 5,\n * allowedDomains: [\"arxiv.org\", \"example.com\"],\n * citations: { enabled: true },\n * maxContentTokens: 50000,\n * })],\n * }\n * );\n *\n * // Combined with web search for comprehensive information gathering\n * const combinedResponse = await model.invoke(\n * \"Find recent articles about quantum computing and analyze the most relevant one\",\n * {\n * tools: [\n * tools.webSearch_20250305({ maxUses: 3 }),\n * tools.webFetch_20250910({ maxUses: 5, citations: { enabled: true } }),\n * ],\n * }\n * );\n * ```\n */\nexport function webFetch_20250910(\n options?: WebFetch20250910Options\n): ServerTool {\n return {\n type: \"web_fetch_20250910\",\n name: \"web_fetch\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n citations: options?.citations,\n max_content_tokens: options?.maxContentTokens,\n } satisfies Anthropic.Beta.BetaWebFetchTool20250910;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,kBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,WAAW,SAAS;EACpB,oBAAoB,SAAS;CAC/B;AACF"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/webFetch.d.ts
5
4
  /**
6
5
  * Options for the web fetch tool.
@@ -1 +1 @@
1
- {"version":3,"file":"webFetch.d.cts","names":[],"sources":["../../src/tools/webFetch.ts"],"mappings":";;;;;;AAMA;UAAiB,uBAAA;;;;EAIf,OAAA;EAUA;;;;EALA,cAAA;EAcA;;;;EATA,cAAA;EAuEc;;;EAnEd,YAAA,GAAe,WAAA,CAAU,IAAA,CAAK,yBAAA;EAoEpB;;;;EA/DV,SAAA;IACE,OAAA;EAAA;;;;;EAMF,gBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuDc,iBAAA,CACd,OAAA,GAAU,uBAAA,GACT,UAAA"}
1
+ {"version":3,"file":"webFetch.d.cts","names":[],"sources":["../../src/tools/webFetch.ts"],"mappings":";;;;;;UAMiB;;;;EAIf;;;;;EAKA;;;;;EAKA;;;;EAIA,eAAe,YAAU,KAAK;;;;;EAK9B;IACE;;;;;;EAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuDc,kBACd,UAAU,0BACT"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/webFetch.d.ts
5
4
  /**
6
5
  * Options for the web fetch tool.
@@ -1 +1 @@
1
- {"version":3,"file":"webFetch.d.ts","names":[],"sources":["../../src/tools/webFetch.ts"],"mappings":";;;;;;AAMA;UAAiB,uBAAA;;;;EAIf,OAAA;EAUA;;;;EALA,cAAA;EAcA;;;;EATA,cAAA;EAuEc;;;EAnEd,YAAA,GAAe,WAAA,CAAU,IAAA,CAAK,yBAAA;EAoEpB;;;;EA/DV,SAAA;IACE,OAAA;EAAA;;;;;EAMF,gBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuDc,iBAAA,CACd,OAAA,GAAU,uBAAA,GACT,UAAA"}
1
+ {"version":3,"file":"webFetch.d.ts","names":[],"sources":["../../src/tools/webFetch.ts"],"mappings":";;;;;;UAMiB;;;;EAIf;;;;;EAKA;;;;;EAKA;;;;EAIA,eAAe,YAAU,KAAK;;;;;EAK9B;IACE;;;;;;EAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuDc,kBACd,UAAU,0BACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"webFetch.js","names":[],"sources":["../../src/tools/webFetch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web fetch tool.\n */\nexport interface WebFetch20250910Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be fetched. Cannot be used\n * alongside `blockedDomains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never be fetched. Cannot be used\n * alongside `allowedDomains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Enable citations for fetched content. Unlike web search where citations\n * are always enabled, citations are optional for web fetch.\n */\n citations?: {\n enabled: boolean;\n };\n /**\n * Maximum content length in tokens. If the fetched content exceeds this limit,\n * it will be truncated. This helps control token usage when fetching large documents.\n */\n maxContentTokens?: number;\n}\n\n/**\n * Creates a web fetch tool that allows Claude to retrieve full content from specified\n * web pages and PDF documents. Claude can only fetch URLs that have been explicitly\n * provided by the user or that come from previous web search or web fetch results.\n *\n * @warning Enabling the web fetch tool in environments where Claude processes untrusted\n * input alongside sensitive data poses data exfiltration risks. We recommend only using\n * this tool in trusted environments or when handling non-sensitive data.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-fetch-tool | Anthropic Web Fetch Documentation}\n * @param options - Configuration options for the web fetch tool\n * @returns A web fetch tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - fetch content from a URL\n * const response = await model.invoke(\n * \"Please analyze the content at https://example.com/article\",\n * { tools: [tools.webFetch_20250910()] }\n * );\n *\n * // With options\n * const responseWithOptions = await model.invoke(\n * \"Summarize this research paper: https://arxiv.org/abs/2024.12345\",\n * {\n * tools: [tools.webFetch_20250910({\n * maxUses: 5,\n * allowedDomains: [\"arxiv.org\", \"example.com\"],\n * citations: { enabled: true },\n * maxContentTokens: 50000,\n * })],\n * }\n * );\n *\n * // Combined with web search for comprehensive information gathering\n * const combinedResponse = await model.invoke(\n * \"Find recent articles about quantum computing and analyze the most relevant one\",\n * {\n * tools: [\n * tools.webSearch_20250305({ maxUses: 3 }),\n * tools.webFetch_20250910({ maxUses: 5, citations: { enabled: true } }),\n * ],\n * }\n * );\n * ```\n */\nexport function webFetch_20250910(\n options?: WebFetch20250910Options\n): ServerTool {\n return {\n type: \"web_fetch_20250910\",\n name: \"web_fetch\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n citations: options?.citations,\n max_content_tokens: options?.maxContentTokens,\n } satisfies Anthropic.Beta.BetaWebFetchTool20250910;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,kBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,WAAW,SAAS;EACpB,oBAAoB,SAAS;EAC9B"}
1
+ {"version":3,"file":"webFetch.js","names":[],"sources":["../../src/tools/webFetch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web fetch tool.\n */\nexport interface WebFetch20250910Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be fetched. Cannot be used\n * alongside `blockedDomains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never be fetched. Cannot be used\n * alongside `allowedDomains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Enable citations for fetched content. Unlike web search where citations\n * are always enabled, citations are optional for web fetch.\n */\n citations?: {\n enabled: boolean;\n };\n /**\n * Maximum content length in tokens. If the fetched content exceeds this limit,\n * it will be truncated. This helps control token usage when fetching large documents.\n */\n maxContentTokens?: number;\n}\n\n/**\n * Creates a web fetch tool that allows Claude to retrieve full content from specified\n * web pages and PDF documents. Claude can only fetch URLs that have been explicitly\n * provided by the user or that come from previous web search or web fetch results.\n *\n * @warning Enabling the web fetch tool in environments where Claude processes untrusted\n * input alongside sensitive data poses data exfiltration risks. We recommend only using\n * this tool in trusted environments or when handling non-sensitive data.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-fetch-tool | Anthropic Web Fetch Documentation}\n * @param options - Configuration options for the web fetch tool\n * @returns A web fetch tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage - fetch content from a URL\n * const response = await model.invoke(\n * \"Please analyze the content at https://example.com/article\",\n * { tools: [tools.webFetch_20250910()] }\n * );\n *\n * // With options\n * const responseWithOptions = await model.invoke(\n * \"Summarize this research paper: https://arxiv.org/abs/2024.12345\",\n * {\n * tools: [tools.webFetch_20250910({\n * maxUses: 5,\n * allowedDomains: [\"arxiv.org\", \"example.com\"],\n * citations: { enabled: true },\n * maxContentTokens: 50000,\n * })],\n * }\n * );\n *\n * // Combined with web search for comprehensive information gathering\n * const combinedResponse = await model.invoke(\n * \"Find recent articles about quantum computing and analyze the most relevant one\",\n * {\n * tools: [\n * tools.webSearch_20250305({ maxUses: 3 }),\n * tools.webFetch_20250910({ maxUses: 5, citations: { enabled: true } }),\n * ],\n * }\n * );\n * ```\n */\nexport function webFetch_20250910(\n options?: WebFetch20250910Options\n): ServerTool {\n return {\n type: \"web_fetch_20250910\",\n name: \"web_fetch\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n citations: options?.citations,\n max_content_tokens: options?.maxContentTokens,\n } satisfies Anthropic.Beta.BetaWebFetchTool20250910;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,kBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,WAAW,SAAS;EACpB,oBAAoB,SAAS;CAC/B;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"webSearch.cjs","names":[],"sources":["../../src/tools/webSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web search tool.\n */\nexport interface WebSearch20250305Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be included in results. Cannot be used\n * alongside `blocked_domains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never appear in results. Cannot be used\n * alongside `allowed_domains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Parameters for the user's location. Used to provide more relevant search\n * results.\n */\n userLocation?: Anthropic.Beta.BetaWebSearchTool20250305.UserLocation;\n /**\n * If true, tool will not be included in initial system prompt. Only loaded when\n * returned via tool_reference from tool search.\n */\n deferLoading?: boolean;\n /**\n * If true, tool will only return results from the allowed domains.\n */\n strict?: boolean;\n}\n\n/**\n * Creates a web search tool that gives Claude direct access to real-time web content,\n * allowing it to answer questions with up-to-date information beyond its knowledge cutoff.\n * Claude automatically cites sources from search results as part of its answer.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-search-tool | Anthropic Web Search Documentation}\n * @param options - Configuration options for the web search tool\n * @returns A web search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage\n * const response = await model.invoke(\"What is the weather in NYC?\", {\n * tools: [tools.webSearch_20250305()],\n * });\n *\n * // With options\n * const responseWithOptions = await model.invoke(\"Latest news about AI?\", {\n * tools: [tools.webSearch_20250305({\n * maxUses: 5,\n * allowedDomains: [\"reuters.com\", \"bbc.com\"],\n * userLocation: {\n * type: \"approximate\",\n * city: \"San Francisco\",\n * region: \"California\",\n * country: \"US\",\n * timezone: \"America/Los_Angeles\",\n * },\n * })],\n * });\n * ```\n */\nexport function webSearch_20250305(\n options?: WebSearch20250305Options\n): ServerTool {\n return {\n type: \"web_search_20250305\",\n name: \"web_search\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n defer_loading: options?.deferLoading,\n strict: options?.strict,\n user_location: options?.userLocation,\n } satisfies Anthropic.Beta.BetaWebSearchTool20250305;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,SAAgB,mBACd,SACY;AACZ,QAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,eAAe,SAAS;EACxB,QAAQ,SAAS;EACjB,eAAe,SAAS;EACzB"}
1
+ {"version":3,"file":"webSearch.cjs","names":[],"sources":["../../src/tools/webSearch.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n\n/**\n * Options for the web search tool.\n */\nexport interface WebSearch20250305Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be included in results. Cannot be used\n * alongside `blocked_domains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never appear in results. Cannot be used\n * alongside `allowed_domains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Parameters for the user's location. Used to provide more relevant search\n * results.\n */\n userLocation?: Anthropic.Beta.BetaWebSearchTool20250305.UserLocation;\n /**\n * If true, tool will not be included in initial system prompt. Only loaded when\n * returned via tool_reference from tool search.\n */\n deferLoading?: boolean;\n /**\n * If true, tool will only return results from the allowed domains.\n */\n strict?: boolean;\n}\n\n/**\n * Creates a web search tool that gives Claude direct access to real-time web content,\n * allowing it to answer questions with up-to-date information beyond its knowledge cutoff.\n * Claude automatically cites sources from search results as part of its answer.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-search-tool | Anthropic Web Search Documentation}\n * @param options - Configuration options for the web search tool\n * @returns A web search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage\n * const response = await model.invoke(\"What is the weather in NYC?\", {\n * tools: [tools.webSearch_20250305()],\n * });\n *\n * // With options\n * const responseWithOptions = await model.invoke(\"Latest news about AI?\", {\n * tools: [tools.webSearch_20250305({\n * maxUses: 5,\n * allowedDomains: [\"reuters.com\", \"bbc.com\"],\n * userLocation: {\n * type: \"approximate\",\n * city: \"San Francisco\",\n * region: \"California\",\n * country: \"US\",\n * timezone: \"America/Los_Angeles\",\n * },\n * })],\n * });\n * ```\n */\nexport function webSearch_20250305(\n options?: WebSearch20250305Options\n): ServerTool {\n return {\n type: \"web_search_20250305\",\n name: \"web_search\",\n max_uses: options?.maxUses,\n allowed_domains: options?.allowedDomains,\n blocked_domains: options?.blockedDomains,\n cache_control: options?.cacheControl,\n defer_loading: options?.deferLoading,\n strict: options?.strict,\n user_location: options?.userLocation,\n } satisfies Anthropic.Beta.BetaWebSearchTool20250305;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,SAAgB,mBACd,SACY;CACZ,OAAO;EACL,MAAM;EACN,MAAM;EACN,UAAU,SAAS;EACnB,iBAAiB,SAAS;EAC1B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,eAAe,SAAS;EACxB,QAAQ,SAAS;EACjB,eAAe,SAAS;CAC1B;AACF"}
@@ -1,6 +1,5 @@
1
1
  import Anthropic$1 from "@anthropic-ai/sdk";
2
2
  import { ServerTool } from "@langchain/core/tools";
3
-
4
3
  //#region src/tools/webSearch.d.ts
5
4
  /**
6
5
  * Options for the web search tool.