diff options
| author | Michelle Tilley <michelle@michelletilley.net> | 2026-04-21 10:32:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 10:32:54 -0700 |
| commit | 0f20ee4eb871907defe7848f0d3e2203cfff057e (patch) | |
| tree | cda9034c4c6e7b5ecf0fe957978284e9138b80ff /crates/atuin-ai/src/tools/descriptor.rs | |
| parent | chore: Clarified note about regular expressions matching in path. (#3427) (diff) | |
| download | atuin-0f20ee4eb871907defe7848f0d3e2203cfff057e.zip | |
feat: AI tool rendering overhaul + edit_file tool (#3423)
Overhaul of how AI tool calls are modeled, rendered, and displayed in
the Atuin AI TUI. Fixes bugs in shell command output capture, implements
the `edit_file` tool with full safety infrastructure, and adds a diff
preview for edits.
Diffstat (limited to 'crates/atuin-ai/src/tools/descriptor.rs')
| -rw-r--r-- | crates/atuin-ai/src/tools/descriptor.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/crates/atuin-ai/src/tools/descriptor.rs b/crates/atuin-ai/src/tools/descriptor.rs index fc44ec10..6ccb595f 100644 --- a/crates/atuin-ai/src/tools/descriptor.rs +++ b/crates/atuin-ai/src/tools/descriptor.rs @@ -16,6 +16,7 @@ pub(crate) struct ToolDescriptor { /// Past-tense verb for summaries (e.g. "Read file"). pub past_verb: &'static str, /// Whether this tool is executed client-side (by the CLI). + #[expect(dead_code)] pub is_client: bool, } @@ -30,9 +31,18 @@ pub(crate) const READ: &ToolDescriptor = &ToolDescriptor { is_client: true, }; +pub(crate) const EDIT: &ToolDescriptor = &ToolDescriptor { + canonical_names: &["edit_file"], + capability: Some("client_v1_edit_file"), + display_verb: "edit", + progressive_verb: "Editing file...", + past_verb: "Edited file", + is_client: true, +}; + pub(crate) const WRITE: &ToolDescriptor = &ToolDescriptor { - canonical_names: &["str_replace", "file_create", "file_insert"], - capability: Some("client_v1_write"), + canonical_names: &["write_file"], + capability: Some("client_v1_write_file"), display_verb: "write to", progressive_verb: "Writing file...", past_verb: "Wrote file", @@ -41,7 +51,7 @@ pub(crate) const WRITE: &ToolDescriptor = &ToolDescriptor { pub(crate) const SHELL: &ToolDescriptor = &ToolDescriptor { canonical_names: &["execute_shell_command"], - capability: Some("client_v1_shell"), + capability: Some("client_v1_execute_shell_command"), display_verb: "run", progressive_verb: "Running command...", past_verb: "Ran command", @@ -81,6 +91,7 @@ pub(crate) const SERVER_SCRAPE: &ToolDescriptor = &ToolDescriptor { /// All known tool descriptors, for lookup by name. const ALL_DESCRIPTORS: &[&ToolDescriptor] = &[ READ, + EDIT, WRITE, SHELL, ATUIN_HISTORY, |
