1- import { z } from "zod/v4" ;
21import Anthropic from "@anthropic-ai/sdk" ;
32import { tool } from "@langchain/core/tools" ;
43import type { DynamicStructuredTool , ToolRuntime } from "@langchain/core/tools" ;
@@ -77,9 +76,7 @@ export interface TextEditor20250728Options {
7776 *
7877 * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool
7978 */
80- export function textEditor_20250728 (
81- options ?: TextEditor20250728Options
82- ) : DynamicStructuredTool {
79+ export function textEditor_20250728 ( options ?: TextEditor20250728Options ) {
8380 const name = "str_replace_based_edit_tool" ;
8481 const textEditorTool = tool (
8582 options ?. execute as (
@@ -89,7 +86,7 @@ export function textEditor_20250728(
8986 {
9087 name,
9188 description : "A tool for editing text files" ,
92- schema : z . toJSONSchema ( TextEditor20250728CommandSchema ) ,
89+ schema : TextEditor20250728CommandSchema ,
9390 }
9491 ) ;
9592
@@ -104,5 +101,10 @@ export function textEditor_20250728(
104101 } satisfies Anthropic . Beta . Messages . BetaToolTextEditor20250728 ,
105102 } ;
106103
107- return textEditorTool ;
104+ return textEditorTool as DynamicStructuredTool <
105+ typeof TextEditor20250728CommandSchema ,
106+ TextEditor20250728Command ,
107+ unknown ,
108+ string | Promise < string >
109+ > ;
108110}
0 commit comments