Release v1.2.0 - **File editing tools** — `ait` can now read and write files via Anthropic's native tool-use API - `read_file(path)` tool: injects file contents into the AI context - `list_files(path)` tool: returns directory listing with file types and sizes - `write_file(path, content)` tool: writes a file with unified diff preview and user confirmation - `patch_file(path, search, replace)` tool: applies targeted search-and-replace edits with diff preview - **File safety layer** — `[safety.files]` config section with whitelist/blacklist glob matching for file paths, mirroring the existing command safety layer - `restrict_to_cwd` option in `[safety.files]` (default `true`) — any file path resolving outside the current working directory requires confirmation, even if whitelisted - `FileAction` enum (`Write`, `Confirm`, `Reject`) and `check_file_path()` in `src/execution/safety.rs` - File write confirmation dialog — same UX pattern as command confirmation: title bar with diff body, `[Ctrl+C]` Cancel / `[e]` Edit / `[Enter]` Accept - Colored unified diff display using the `similar` crate (green additions, red deletions, cyan hunk headers) - `ApiResponse` struct in `src/provider/anthropic.rs` — structured response type carrying text, tool calls, content blocks, and stop reason - `complete_with_tools()` method on `AnthropicProvider` — sends tool definitions to the API and parses `tool_use` content blocks - Tool-use loop in `src/provider/ai_context.rs` — executes tool calls, sends `tool_result` messages back, loops until the model responds with prose (capped at 10 iterations) - `src/provider/tools.rs` module: tool definitions (Anthropic schema), `ToolCall`/`ToolResult` types, `dispatch_tool()` router, file handlers, diff display, and confirmation UI - `push_blocks()` method on `Session` for recording structured content-block messages - `content_blocks` and `output_mode` optional fields on `Message` for tool-use session recording - 20 new unit tests (tool definitions, file read/write/patch, dispatch, diff generation, file safety with restrict_to_cwd) - `send_request()` in `AnthropicProvider` now accepts an optional `tools` array and builds API messages from `content_blocks` when present (required for tool-result messages) - `max_tokens` increased from 1024 to 4096 to accommodate file-editing responses - AI context loop rewritten: sends tool definitions on every call, handles `tool_use` stop reason alongside legacy bash-block extraction - System prompt updated with file-editing instructions (rules 7–12): use `read_file` before editing, prefer `patch_file` for small edits, never use bash blocks to write files - `Message` struct extended with `content_blocks: Option<Vec<Value>>` and `output_mode: Option<String>` (backward-compatible via `skip_serializing_if`) - Default config template now includes `[safety.files]` section with sensible defaults - Added `similar` 2.0 (unified diff generation)