// text_editor_20250728 view /tmp — executes nothing. STATUS: UNVERIFIED as a script (raw request LIVE_VERIFIED 2026-09-18, h6). // Run: node --env-file=.env --experimental-strip-types examples/anthropic/tools/text-editor/basic.ts import Anthropic from "@anthropic-ai/sdk"; import { logRequest } from "../../../shared/tool-loop/log.ts"; const client = new Anthropic(); const resp: any = await client.messages.create({ model: "claude-haiku-4-5-20251001", max_tokens: 120, tools: [{ type: "text_editor_20250728", name: "str_replace_based_edit_tool" }], messages: [{ role: "user", content: "View the directory /tmp." }] } as any); logRequest("anthropic", "POST", "/v1/messages", 200, 0.002, "basic.ts"); console.log(resp.stop_reason, JSON.stringify(resp.content.map((b: any) => ({ type: b.type, name: b.name, toolset_name: b.toolset_name, input: b.input, caller: b.caller, text: b.text, content: typeof b.content === "object" ? "[…]" : b.content })), null, 1).slice(0, 1500)); console.log("usage", resp.usage, "container", resp.container);