@langchain/anthropic 1.3.6-dev-1767748783694 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/tools/computer.d.ts +101 -101
- package/dist/tools/computer.d.ts.map +1 -1
- package/dist/tools/textEditor.d.ts +21 -21
- package/dist/tools/textEditor.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @langchain/anthropic
|
|
2
2
|
|
|
3
|
+
## 1.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`a46a249`](https://github.com/langchain-ai/langchainjs/commit/a46a24983fd0fea649d950725a2673b3c435275f)]:
|
|
8
|
+
- @langchain/core@1.1.11
|
|
9
|
+
|
|
3
10
|
## 1.3.5
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/tools/computer.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Computer20250124Action, Computer20251124Action } from "./types.js";
|
|
2
2
|
import { ToolMessage } from "@langchain/core/messages";
|
|
3
3
|
import { DynamicStructuredTool, ToolRuntime } from "@langchain/core/tools";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as zod46 from "zod";
|
|
5
|
+
import * as zod_v4_core9 from "zod/v4/core";
|
|
6
6
|
|
|
7
7
|
//#region src/tools/computer.d.ts
|
|
8
8
|
type ComputerUseReturnType = string | Promise<string> | ToolMessage<any> | Promise<ToolMessage<any>>;
|
|
@@ -94,62 +94,62 @@ interface Computer20251124Options<TState = any, TContext = any> {
|
|
|
94
94
|
* @param options - Configuration options for the computer use tool
|
|
95
95
|
* @returns The computer use tool object that can be passed to `bindTools`
|
|
96
96
|
*/
|
|
97
|
-
declare function computer_20251124(options: Computer20251124Options): DynamicStructuredTool<
|
|
98
|
-
action:
|
|
99
|
-
},
|
|
100
|
-
action:
|
|
101
|
-
coordinate:
|
|
102
|
-
},
|
|
103
|
-
action:
|
|
104
|
-
coordinate:
|
|
105
|
-
},
|
|
106
|
-
action:
|
|
107
|
-
coordinate:
|
|
108
|
-
},
|
|
109
|
-
action:
|
|
110
|
-
coordinate:
|
|
111
|
-
},
|
|
112
|
-
action:
|
|
113
|
-
coordinate:
|
|
114
|
-
},
|
|
115
|
-
action:
|
|
116
|
-
start_coordinate:
|
|
117
|
-
end_coordinate:
|
|
118
|
-
},
|
|
119
|
-
action:
|
|
120
|
-
coordinate:
|
|
121
|
-
},
|
|
122
|
-
action:
|
|
123
|
-
coordinate:
|
|
124
|
-
},
|
|
125
|
-
action:
|
|
126
|
-
coordinate:
|
|
127
|
-
scroll_direction:
|
|
97
|
+
declare function computer_20251124(options: Computer20251124Options): DynamicStructuredTool<zod46.ZodDiscriminatedUnion<[zod46.ZodObject<{
|
|
98
|
+
action: zod46.ZodLiteral<"screenshot">;
|
|
99
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
100
|
+
action: zod46.ZodLiteral<"left_click">;
|
|
101
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
102
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
103
|
+
action: zod46.ZodLiteral<"right_click">;
|
|
104
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
105
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
106
|
+
action: zod46.ZodLiteral<"middle_click">;
|
|
107
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
108
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
109
|
+
action: zod46.ZodLiteral<"double_click">;
|
|
110
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
111
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
112
|
+
action: zod46.ZodLiteral<"triple_click">;
|
|
113
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
114
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
115
|
+
action: zod46.ZodLiteral<"left_click_drag">;
|
|
116
|
+
start_coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
117
|
+
end_coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
118
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
119
|
+
action: zod46.ZodLiteral<"left_mouse_down">;
|
|
120
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
121
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
122
|
+
action: zod46.ZodLiteral<"left_mouse_up">;
|
|
123
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
124
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
125
|
+
action: zod46.ZodLiteral<"scroll">;
|
|
126
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
127
|
+
scroll_direction: zod46.ZodEnum<{
|
|
128
128
|
down: "down";
|
|
129
129
|
left: "left";
|
|
130
130
|
right: "right";
|
|
131
131
|
up: "up";
|
|
132
132
|
}>;
|
|
133
|
-
scroll_amount:
|
|
134
|
-
},
|
|
135
|
-
action:
|
|
136
|
-
text:
|
|
137
|
-
},
|
|
138
|
-
action:
|
|
139
|
-
key:
|
|
140
|
-
},
|
|
141
|
-
action:
|
|
142
|
-
coordinate:
|
|
143
|
-
},
|
|
144
|
-
action:
|
|
145
|
-
key:
|
|
146
|
-
},
|
|
147
|
-
action:
|
|
148
|
-
duration:
|
|
149
|
-
},
|
|
150
|
-
action:
|
|
151
|
-
region:
|
|
152
|
-
},
|
|
133
|
+
scroll_amount: zod46.ZodNumber;
|
|
134
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
135
|
+
action: zod46.ZodLiteral<"type">;
|
|
136
|
+
text: zod46.ZodString;
|
|
137
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
138
|
+
action: zod46.ZodLiteral<"key">;
|
|
139
|
+
key: zod46.ZodString;
|
|
140
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
141
|
+
action: zod46.ZodLiteral<"mouse_move">;
|
|
142
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
143
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
144
|
+
action: zod46.ZodLiteral<"hold_key">;
|
|
145
|
+
key: zod46.ZodString;
|
|
146
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
147
|
+
action: zod46.ZodLiteral<"wait">;
|
|
148
|
+
duration: zod46.ZodOptional<zod46.ZodNumber>;
|
|
149
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
150
|
+
action: zod46.ZodLiteral<"zoom">;
|
|
151
|
+
region: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber, zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
152
|
+
}, zod_v4_core9.$strip>], "action">, Computer20251124Action, any, ToolMessage<any>>;
|
|
153
153
|
/**
|
|
154
154
|
* Options for the computer use tool.
|
|
155
155
|
*
|
|
@@ -231,59 +231,59 @@ interface Computer20250124Options<TState = any, TContext = any> {
|
|
|
231
231
|
* @param options - Configuration options for the computer use tool
|
|
232
232
|
* @returns The computer use tool object that can be passed to `bindTools`
|
|
233
233
|
*/
|
|
234
|
-
declare function computer_20250124(options: Computer20250124Options): DynamicStructuredTool<
|
|
235
|
-
action:
|
|
236
|
-
},
|
|
237
|
-
action:
|
|
238
|
-
coordinate:
|
|
239
|
-
},
|
|
240
|
-
action:
|
|
241
|
-
coordinate:
|
|
242
|
-
},
|
|
243
|
-
action:
|
|
244
|
-
coordinate:
|
|
245
|
-
},
|
|
246
|
-
action:
|
|
247
|
-
coordinate:
|
|
248
|
-
},
|
|
249
|
-
action:
|
|
250
|
-
coordinate:
|
|
251
|
-
},
|
|
252
|
-
action:
|
|
253
|
-
start_coordinate:
|
|
254
|
-
end_coordinate:
|
|
255
|
-
},
|
|
256
|
-
action:
|
|
257
|
-
coordinate:
|
|
258
|
-
},
|
|
259
|
-
action:
|
|
260
|
-
coordinate:
|
|
261
|
-
},
|
|
262
|
-
action:
|
|
263
|
-
coordinate:
|
|
264
|
-
scroll_direction:
|
|
234
|
+
declare function computer_20250124(options: Computer20250124Options): DynamicStructuredTool<zod46.ZodDiscriminatedUnion<[zod46.ZodObject<{
|
|
235
|
+
action: zod46.ZodLiteral<"screenshot">;
|
|
236
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
237
|
+
action: zod46.ZodLiteral<"left_click">;
|
|
238
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
239
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
240
|
+
action: zod46.ZodLiteral<"right_click">;
|
|
241
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
242
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
243
|
+
action: zod46.ZodLiteral<"middle_click">;
|
|
244
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
245
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
246
|
+
action: zod46.ZodLiteral<"double_click">;
|
|
247
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
248
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
249
|
+
action: zod46.ZodLiteral<"triple_click">;
|
|
250
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
251
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
252
|
+
action: zod46.ZodLiteral<"left_click_drag">;
|
|
253
|
+
start_coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
254
|
+
end_coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
255
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
256
|
+
action: zod46.ZodLiteral<"left_mouse_down">;
|
|
257
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
258
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
259
|
+
action: zod46.ZodLiteral<"left_mouse_up">;
|
|
260
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
261
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
262
|
+
action: zod46.ZodLiteral<"scroll">;
|
|
263
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
264
|
+
scroll_direction: zod46.ZodEnum<{
|
|
265
265
|
down: "down";
|
|
266
266
|
left: "left";
|
|
267
267
|
right: "right";
|
|
268
268
|
up: "up";
|
|
269
269
|
}>;
|
|
270
|
-
scroll_amount:
|
|
271
|
-
},
|
|
272
|
-
action:
|
|
273
|
-
text:
|
|
274
|
-
},
|
|
275
|
-
action:
|
|
276
|
-
key:
|
|
277
|
-
},
|
|
278
|
-
action:
|
|
279
|
-
coordinate:
|
|
280
|
-
},
|
|
281
|
-
action:
|
|
282
|
-
key:
|
|
283
|
-
},
|
|
284
|
-
action:
|
|
285
|
-
duration:
|
|
286
|
-
},
|
|
270
|
+
scroll_amount: zod46.ZodNumber;
|
|
271
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
272
|
+
action: zod46.ZodLiteral<"type">;
|
|
273
|
+
text: zod46.ZodString;
|
|
274
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
275
|
+
action: zod46.ZodLiteral<"key">;
|
|
276
|
+
key: zod46.ZodString;
|
|
277
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
278
|
+
action: zod46.ZodLiteral<"mouse_move">;
|
|
279
|
+
coordinate: zod46.ZodTuple<[zod46.ZodNumber, zod46.ZodNumber], null>;
|
|
280
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
281
|
+
action: zod46.ZodLiteral<"hold_key">;
|
|
282
|
+
key: zod46.ZodString;
|
|
283
|
+
}, zod_v4_core9.$strip>, zod46.ZodObject<{
|
|
284
|
+
action: zod46.ZodLiteral<"wait">;
|
|
285
|
+
duration: zod46.ZodOptional<zod46.ZodNumber>;
|
|
286
|
+
}, zod_v4_core9.$strip>], "action">, Computer20250124Action, any, ComputerUseReturnType>;
|
|
287
287
|
//#endregion
|
|
288
288
|
export { Computer20250124Options, Computer20251124Options, ComputerUseReturnType, computer_20250124, computer_20251124 };
|
|
289
289
|
//# sourceMappingURL=computer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computer.d.ts","names":["zod_v4_core5","ToolMessage","DynamicStructuredTool","ToolRuntime","Computer20251124Action","Computer20250124Action","ComputerUseReturnType","Promise","Computer20251124Options","TState","TContext","computer_20251124","zod24","ZodLiteral","$strip","ZodObject","ZodNumber","ZodTuple","ZodEnum","ZodString","ZodOptional","ZodDiscriminatedUnion","Computer20250124Options","computer_20250124"],"sources":["../../src/tools/computer.d.ts"],"sourcesContent":["import { ToolMessage } from \"@langchain/core/messages\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\nimport type { Computer20251124Action, Computer20250124Action } from \"./types.js\";\nexport type ComputerUseReturnType = string | Promise<string> | ToolMessage<any> | Promise<ToolMessage<any>>;\n/**\n * Options for the computer use tool (Claude Opus 4.5 only version).\n *\n * @template TState - The type of the state schema (when used with `ReactAgent`)\n * @template TContext - The type of the context schema (when used with `ReactAgent`)\n */\nexport interface Computer20251124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Enable zoom action for detailed screen region inspection.\n * When enabled, Claude can zoom into specific screen regions.\n * @default false\n */\n enableZoom?: boolean;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (args: Computer20251124Action, runtime: ToolRuntime<TState, TContext>) => ComputerUseReturnType;\n}\n/**\n * Creates an Anthropic computer use tool for Claude Opus 4.5 that provides\n * screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n * - **Zoom**: View specific screen regions at full resolution (when enabled)\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-opus-4-5-20251101\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-11-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20251124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * enableZoom: true,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport declare function computer_20251124(options: Computer20251124Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"screenshot\">;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"right_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"middle_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"double_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"triple_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click_drag\">;\n start_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n end_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_down\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_up\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"scroll\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n scroll_direction: import(\"zod\").ZodEnum<{\n down: \"down\";\n left: \"left\";\n right: \"right\";\n up: \"up\";\n }>;\n scroll_amount: import(\"zod\").ZodNumber;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"type\">;\n text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"mouse_move\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"hold_key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"wait\">;\n duration: import(\"zod\").ZodOptional<import(\"zod\").ZodNumber>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"zoom\">;\n region: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber, import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>], \"action\">, Computer20251124Action, any, ToolMessage<any>>;\n/**\n * Options for the computer use tool.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n */\nexport interface Computer20250124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (args: Computer20250124Action, runtime: ToolRuntime<TState, TContext>) => ComputerUseReturnType;\n}\n/**\n * Creates an Anthropic computer use tool that provides screenshot capabilities and mouse/keyboard control\n * for autonomous desktop interaction.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-01-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20250124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport declare function computer_20250124(options: Computer20250124Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"screenshot\">;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"right_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"middle_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"double_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"triple_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click_drag\">;\n start_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n end_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_down\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_up\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"scroll\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n scroll_direction: import(\"zod\").ZodEnum<{\n down: \"down\";\n left: \"left\";\n right: \"right\";\n up: \"up\";\n }>;\n scroll_amount: import(\"zod\").ZodNumber;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"type\">;\n text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"mouse_move\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"hold_key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"wait\">;\n duration: import(\"zod\").ZodOptional<import(\"zod\").ZodNumber>;\n}, import(\"zod/v4/core\").$strip>], \"action\">, Computer20250124Action, any, ComputerUseReturnType>;\n//# sourceMappingURL=computer.d.ts.map"],"mappings":";;;;;;;KAGYM,qBAAAA,YAAiCC,kBAAkBN,mBAAmBM,QAAQN;;;;AAA1F;;;AAA0FA,UAOzEO,uBAPyEP,CAAAA,SAAAA,GAAAA,EAAAA,WAAAA,GAAAA,CAAAA,CAAAA;EAARM;AAAO;AAOzF;EAwBqBH,cAAAA,EAAAA,MAAAA;EAA6CK;;;EAAsBH,eAAAA,EAAAA,MAAAA;EAAqB;AA0D7G;;EAA0EM,aAChDC,CAAAA,EAAAA,MAAAA;EAAUb;;;;;EAGoDY,UAA1DK,CAAAA,EAAAA,OAAAA;EAAQjB;;;;;EAGkDY,OAA1DK,CAAAA,EAAAA,CAAAA,IAAAA,EAjETb,sBAiESa,EAAAA,OAAAA,EAjEwBd,WAiExBc,CAjEoCR,MAiEpCQ,EAjE4CP,QAiE5CO,CAAAA,EAAAA,GAjE0DX,qBAiE1DW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCJJ,iBA5CFF,iBAAAA,CA4CEE,OAAAA,EA5CyBL,uBA4CzBK,CAAAA,EA5CmDX,qBA4CnDW,CAQ+BD,KAAAA,CApDwDS,qBA4CvFR,CAAAA,CA1CKD,KAAAA,CAFuHG,SA4C5HF,CAAAA;EAAUD,MACkBI,EA7CoBJ,KAAAA,CAChDC,UA4C4BG,CAAAA,YAAAA,CAAAA;CAASJ,EA5C3BZ,YAAAA,CACXc,MAAAA,CA2CsDE,EAxChDJ,KAAAA,CAHiBG,SA2C+BC,CAAAA;EAASJ,MAA1DK,EA7CiIL,KAAAA,CAGrIC,UA0CII,CAAAA,YAAAA,CAAAA;EAAQjB,UACbc,EA1C+DF,KAAAA,CAA1DK,QA0C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BC"}
|
|
1
|
+
{"version":3,"file":"computer.d.ts","names":["zod_v4_core9","ToolMessage","DynamicStructuredTool","ToolRuntime","Computer20251124Action","Computer20250124Action","ComputerUseReturnType","Promise","Computer20251124Options","TState","TContext","computer_20251124","zod46","ZodLiteral","$strip","ZodObject","ZodNumber","ZodTuple","ZodEnum","ZodString","ZodOptional","ZodDiscriminatedUnion","Computer20250124Options","computer_20250124"],"sources":["../../src/tools/computer.d.ts"],"sourcesContent":["import { ToolMessage } from \"@langchain/core/messages\";\nimport type { DynamicStructuredTool, ToolRuntime } from \"@langchain/core/tools\";\nimport type { Computer20251124Action, Computer20250124Action } from \"./types.js\";\nexport type ComputerUseReturnType = string | Promise<string> | ToolMessage<any> | Promise<ToolMessage<any>>;\n/**\n * Options for the computer use tool (Claude Opus 4.5 only version).\n *\n * @template TState - The type of the state schema (when used with `ReactAgent`)\n * @template TContext - The type of the context schema (when used with `ReactAgent`)\n */\nexport interface Computer20251124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Enable zoom action for detailed screen region inspection.\n * When enabled, Claude can zoom into specific screen regions.\n * @default false\n */\n enableZoom?: boolean;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (args: Computer20251124Action, runtime: ToolRuntime<TState, TContext>) => ComputerUseReturnType;\n}\n/**\n * Creates an Anthropic computer use tool for Claude Opus 4.5 that provides\n * screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n * - **Zoom**: View specific screen regions at full resolution (when enabled)\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-opus-4-5-20251101\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-11-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20251124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * enableZoom: true,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport declare function computer_20251124(options: Computer20251124Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"screenshot\">;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"right_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"middle_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"double_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"triple_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click_drag\">;\n start_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n end_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_down\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_up\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"scroll\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n scroll_direction: import(\"zod\").ZodEnum<{\n down: \"down\";\n left: \"left\";\n right: \"right\";\n up: \"up\";\n }>;\n scroll_amount: import(\"zod\").ZodNumber;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"type\">;\n text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"mouse_move\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"hold_key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"wait\">;\n duration: import(\"zod\").ZodOptional<import(\"zod\").ZodNumber>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"zoom\">;\n region: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber, import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>], \"action\">, Computer20251124Action, any, ToolMessage<any>>;\n/**\n * Options for the computer use tool.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n */\nexport interface Computer20250124Options<TState = any, TContext = any> {\n /**\n * The width of the display in pixels.\n */\n displayWidthPx: number;\n /**\n * The height of the display in pixels.\n */\n displayHeightPx: number;\n /**\n * Optional display number for X11 environments.\n */\n displayNumber?: number;\n /**\n * Optional execute function that handles computer action execution.\n * This function receives the action input and should return the result\n * (typically a base64-encoded screenshot or action confirmation).\n */\n execute?: (args: Computer20250124Action, runtime: ToolRuntime<TState, TContext>) => ComputerUseReturnType;\n}\n/**\n * Creates an Anthropic computer use tool that provides screenshot capabilities and mouse/keyboard control\n * for autonomous desktop interaction.\n *\n * Supported models: Claude Sonnet 4.5, Haiku 4.5, Opus 4.1, Sonnet 4, Opus 4, and Sonnet 3.7 versions.\n *\n * The computer use tool enables Claude to interact with desktop environments through:\n * - **Screenshot capture**: See what's currently displayed on screen\n * - **Mouse control**: Click, drag, and move the cursor\n * - **Keyboard input**: Type text and use keyboard shortcuts\n *\n * @warning Computer use is a beta feature with unique risks. Use a dedicated virtual machine\n * or container with minimal privileges. Avoid giving access to sensitive data.\n *\n * @see {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool | Anthropic Computer Use Documentation}\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * clientOptions: {\n * defaultHeaders: {\n * \"anthropic-beta\": \"computer-use-2025-01-24\",\n * },\n * },\n * });\n *\n * const computer = tools.computer_20250124({\n * displayWidthPx: 1024,\n * displayHeightPx: 768,\n * displayNumber: 1,\n * execute: async (action) => {\n * if (action.action === \"screenshot\") {\n * // Capture and return base64-encoded screenshot\n * return captureScreenshot();\n * }\n * if (action.action === \"left_click\") {\n * // Click at the specified coordinates\n * await click(action.coordinate[0], action.coordinate[1]);\n * return captureScreenshot();\n * }\n * // Handle other actions...\n * },\n * });\n *\n * const llmWithComputer = llm.bindTools([computer]);\n * const response = await llmWithComputer.invoke(\n * \"Save a picture of a cat to my desktop.\"\n * );\n * ```\n *\n * @param options - Configuration options for the computer use tool\n * @returns The computer use tool object that can be passed to `bindTools`\n */\nexport declare function computer_20250124(options: Computer20250124Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"screenshot\">;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"right_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"middle_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"double_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"triple_click\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_click_drag\">;\n start_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n end_coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_down\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"left_mouse_up\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"scroll\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n scroll_direction: import(\"zod\").ZodEnum<{\n down: \"down\";\n left: \"left\";\n right: \"right\";\n up: \"up\";\n }>;\n scroll_amount: import(\"zod\").ZodNumber;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"type\">;\n text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"mouse_move\">;\n coordinate: import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"hold_key\">;\n key: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n action: import(\"zod\").ZodLiteral<\"wait\">;\n duration: import(\"zod\").ZodOptional<import(\"zod\").ZodNumber>;\n}, import(\"zod/v4/core\").$strip>], \"action\">, Computer20250124Action, any, ComputerUseReturnType>;\n//# sourceMappingURL=computer.d.ts.map"],"mappings":";;;;;;;KAGYM,qBAAAA,YAAiCC,kBAAkBN,mBAAmBM,QAAQN;;;;AAA1F;;;AAA0FA,UAOzEO,uBAPyEP,CAAAA,SAAAA,GAAAA,EAAAA,WAAAA,GAAAA,CAAAA,CAAAA;EAARM;AAAO;AAOzF;EAwBqBH,cAAAA,EAAAA,MAAAA;EAA6CK;;;EAAsBH,eAAAA,EAAAA,MAAAA;EAAqB;AA0D7G;;EAA0EM,aAChDC,CAAAA,EAAAA,MAAAA;EAAUb;;;;;EAGoDY,UAA1DK,CAAAA,EAAAA,OAAAA;EAAQjB;;;;;EAGkDY,OAA1DK,CAAAA,EAAAA,CAAAA,IAAAA,EAjETb,sBAiESa,EAAAA,OAAAA,EAjEwBd,WAiExBc,CAjEoCR,MAiEpCQ,EAjE4CP,QAiE5CO,CAAAA,EAAAA,GAjE0DX,q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AUD,KAAAA,CACZO;GAASnB,YAAAA,CACRc,MAAAA,GAGMF,KAAAA,CAHiBG;UAHSH,KAAAA,CAI/BC;OAAUD,KAAAA,CACbO;GAASnB,YAAAA,CACPc,MAAAA,GAGMF,KAAAA,CAHiBG;UAHSH,KAAAA,CAI/BC;cAC8DD,KAAAA,CAA1DK,UADML,KAAAA,CACkBI,SAAAA,EAASJ,KAAAA,CAAgBI,SAAAA;GAAzChB,YAAAA,CACbc,MAAAA,GAGMF,KAAAA,CAHiBG;UAHSH,KAAAA,CAI/BC;OAAUD,KAAAA,CACbO;GAASnB,YAAAA,CACPc,MAAAA,GAGMF,KAAAA,CAHiBG;UAHSH,KAAAA,CAI/BC;YACqCD,KAAAA,CAAnCQ,YADQR,KAAAA,CACkBI,SAAAA;GAAfhB,YAAAA,CACdc,MAAAA,eAAqBT,6BAA6BC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextEditor20250728Command } from "./types.js";
|
|
2
2
|
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as zod24 from "zod";
|
|
4
|
+
import * as zod_v4_core5 from "zod/v4/core";
|
|
5
5
|
|
|
6
6
|
//#region src/tools/textEditor.d.ts
|
|
7
7
|
/**
|
|
@@ -72,25 +72,25 @@ interface TextEditor20250728Options {
|
|
|
72
72
|
*
|
|
73
73
|
* @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool
|
|
74
74
|
*/
|
|
75
|
-
declare function textEditor_20250728(options?: TextEditor20250728Options): DynamicStructuredTool<
|
|
76
|
-
command:
|
|
77
|
-
path:
|
|
78
|
-
view_range:
|
|
79
|
-
},
|
|
80
|
-
command:
|
|
81
|
-
path:
|
|
82
|
-
old_str:
|
|
83
|
-
new_str:
|
|
84
|
-
},
|
|
85
|
-
command:
|
|
86
|
-
path:
|
|
87
|
-
file_text:
|
|
88
|
-
},
|
|
89
|
-
command:
|
|
90
|
-
path:
|
|
91
|
-
insert_line:
|
|
92
|
-
new_str:
|
|
93
|
-
},
|
|
75
|
+
declare function textEditor_20250728(options?: TextEditor20250728Options): DynamicStructuredTool<zod24.ZodDiscriminatedUnion<[zod24.ZodObject<{
|
|
76
|
+
command: zod24.ZodLiteral<"view">;
|
|
77
|
+
path: zod24.ZodString;
|
|
78
|
+
view_range: zod24.ZodOptional<zod24.ZodTuple<[zod24.ZodNumber, zod24.ZodNumber], null>>;
|
|
79
|
+
}, zod_v4_core5.$strip>, zod24.ZodObject<{
|
|
80
|
+
command: zod24.ZodLiteral<"str_replace">;
|
|
81
|
+
path: zod24.ZodString;
|
|
82
|
+
old_str: zod24.ZodString;
|
|
83
|
+
new_str: zod24.ZodString;
|
|
84
|
+
}, zod_v4_core5.$strip>, zod24.ZodObject<{
|
|
85
|
+
command: zod24.ZodLiteral<"create">;
|
|
86
|
+
path: zod24.ZodString;
|
|
87
|
+
file_text: zod24.ZodString;
|
|
88
|
+
}, zod_v4_core5.$strip>, zod24.ZodObject<{
|
|
89
|
+
command: zod24.ZodLiteral<"insert">;
|
|
90
|
+
path: zod24.ZodString;
|
|
91
|
+
insert_line: zod24.ZodNumber;
|
|
92
|
+
new_str: zod24.ZodString;
|
|
93
|
+
}, zod_v4_core5.$strip>], "command">, {
|
|
94
94
|
command: "view";
|
|
95
95
|
path: string;
|
|
96
96
|
view_range?: [number, number] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textEditor.d.ts","names":["
|
|
1
|
+
{"version":3,"file":"textEditor.d.ts","names":["zod_v4_core5","DynamicStructuredTool","TextEditor20250728Command","TextEditor20250728Options","Promise","textEditor_20250728","zod24","ZodLiteral","ZodString","ZodNumber","ZodTuple","ZodOptional","$strip","ZodObject","ZodDiscriminatedUnion"],"sources":["../../src/tools/textEditor.d.ts"],"sourcesContent":["import type { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { type TextEditor20250728Command } from \"./types.js\";\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 * 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 declare function textEditor_20250728(options?: TextEditor20250728Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"view\">;\n path: import(\"zod\").ZodString;\n view_range: import(\"zod\").ZodOptional<import(\"zod\").ZodTuple<[import(\"zod\").ZodNumber, import(\"zod\").ZodNumber], null>>;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"str_replace\">;\n path: import(\"zod\").ZodString;\n old_str: import(\"zod\").ZodString;\n new_str: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"create\">;\n path: import(\"zod\").ZodString;\n file_text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"insert\">;\n path: import(\"zod\").ZodString;\n insert_line: import(\"zod\").ZodNumber;\n new_str: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>], \"command\">, {\n command: \"view\";\n path: string;\n view_range?: [number, number] | undefined;\n} | {\n command: \"str_replace\";\n path: string;\n old_str: string;\n new_str: string;\n} | {\n command: \"create\";\n path: string;\n file_text: string;\n} | {\n command: \"insert\";\n path: string;\n insert_line: number;\n new_str: string;\n}, unknown, string | Promise<string>>;\n//# sourceMappingURL=textEditor.d.ts.map"],"mappings":";;;;;;;;;UAKiBG,yBAAAA;EAAAA;AAiEjB;;;EACqCG,OACbE,CAAAA,EAAAA,CAAAA,IAAAA,EA9DHN,yBA8DGM,EAAAA,GAAAA,MAAAA,GA9DoCJ,OA8DpCI,CAAAA,MAAAA,CAAAA;EAASF;;;;EACQN,aAChBY,CAAAA,EAAAA,MAAAA;;;;;;;;;;;;;;;;;;;;;;AAJ8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA/EP,mBAAAA,WAA8BF,4BAA4BF,sBAazBK,KAAAA,CAb6DQ,uBAIvFR,KAAAA,CAJ4HO;WAA5EP,KAAAA,CACpDC;QAAUD,KAAAA,CACbE;cACwCF,KAAAA,CAAlCK,YAAoFL,KAAAA,CAA1DI,UADvBJ,KAAAA,CAC+CG,SAAAA,EAASH,KAAAA,CAAgBG,SAAAA;GAAhET,YAAAA,CAChBY,MAAAA,GAKMN,KAAAA,CALiBO;WAJoHP,KAAAA,CAKzIC;QAAUD,KAAAA,CACbE;WAASF,KAAAA,CACNE;WAASF,KAAAA,CACTE;GAASR,YAAAA,CACXY,MAAAA,GAIMN,KAAAA,CAJiBO;WALSP,KAAAA,CAM9BC;QAAUD,KAAAA,CACbE;aAASF,KAAAA,CACJE;GAASR,YAAAA,CACbY,MAAAA,GAKMN,KAAAA,CALiBO;WAJSP,KAAAA,CAK9BC;QAAUD,KAAAA,CACbE;eAASF,KAAAA,CACFG;WAASH,KAAAA,CACbE;GAASR,YAAAA,CACXY,MAAAA;;;;;;;;;;;;;;;;;;qBAkBJR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/anthropic",
|
|
3
|
-
"version": "1.3.6
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Anthropic integrations for LangChain.js",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zod": "^3.25.76 || ^4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@langchain/core": "1.1.11
|
|
21
|
+
"@langchain/core": "1.1.11"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@anthropic-ai/vertex-sdk": "^0.11.5",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"typescript": "~5.8.3",
|
|
34
34
|
"uuid": "^13.0.0",
|
|
35
35
|
"vitest": "^3.2.4",
|
|
36
|
-
"@langchain/core": "1.1.11
|
|
36
|
+
"@langchain/core": "1.1.11",
|
|
37
37
|
"@langchain/eslint": "0.1.1",
|
|
38
|
-
"@langchain/standard-tests": "0.0.14
|
|
38
|
+
"@langchain/standard-tests": "0.0.14",
|
|
39
39
|
"@langchain/tsconfig": "0.0.1"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|