This PR adds two new tools to Assistant 2: - `list-worktrees` - Lists the worktrees in a project - `read-file` - Reads a file at the given path in the project I don't see `list-worktrees` sticking around long-term, as when we have tools for listing files those will include the worktree IDs along with the path, but making this tool available allows the model to utilize `read-file` when it otherwise wouldn't be able to. Release Notes: - N/A
20 lines
465 B
Rust
20 lines
465 B
Rust
mod list_worktrees_tool;
|
|
mod now_tool;
|
|
mod read_file_tool;
|
|
|
|
use assistant_tool::ToolRegistry;
|
|
use gpui::App;
|
|
|
|
use crate::list_worktrees_tool::ListWorktreesTool;
|
|
use crate::now_tool::NowTool;
|
|
use crate::read_file_tool::ReadFileTool;
|
|
|
|
pub fn init(cx: &mut App) {
|
|
assistant_tool::init(cx);
|
|
|
|
let registry = ToolRegistry::global(cx);
|
|
registry.register_tool(NowTool);
|
|
registry.register_tool(ListWorktreesTool);
|
|
registry.register_tool(ReadFileTool);
|
|
}
|