agent: Create TerminalToolCard
and display shell output while it's running (#29546)
Also, don't require a worktree to run the terminal tool. Release Notes: - N/A
This commit is contained in:
parent
5afb89ca93
commit
83b8530e1f
15 changed files with 560 additions and 343 deletions
|
@ -23,7 +23,6 @@ pub struct WebSearchToolInput {
|
|||
query: String,
|
||||
}
|
||||
|
||||
#[derive(RegisterComponent)]
|
||||
pub struct WebSearchTool;
|
||||
|
||||
impl Tool for WebSearchTool {
|
||||
|
@ -84,6 +83,7 @@ impl Tool for WebSearchTool {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(RegisterComponent)]
|
||||
struct WebSearchToolCard {
|
||||
response: Option<Result<WebSearchResponse>>,
|
||||
_task: Task<()>,
|
||||
|
@ -185,15 +185,11 @@ impl ToolCard for WebSearchToolCard {
|
|||
}
|
||||
}
|
||||
|
||||
impl Component for WebSearchTool {
|
||||
impl Component for WebSearchToolCard {
|
||||
fn scope() -> ComponentScope {
|
||||
ComponentScope::Agent
|
||||
}
|
||||
|
||||
fn sort_name() -> &'static str {
|
||||
"ToolWebSearch"
|
||||
}
|
||||
|
||||
fn preview(window: &mut Window, cx: &mut App) -> Option<AnyElement> {
|
||||
let in_progress_search = cx.new(|cx| WebSearchToolCard {
|
||||
response: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue