Tool Use.

This commit is contained in:
Drew 2026-02-24 18:31:26 -08:00
parent 6b85ff3cb8
commit 0c1c928498
20 changed files with 1822 additions and 129 deletions

View file

@ -72,6 +72,8 @@ pub struct AppState {
pub viewport_height: u16,
/// Transient error message shown in the status bar, cleared on next keypress.
pub status_error: Option<String>,
/// A tool approval request waiting for user input (y/n).
pub pending_approval: Option<events::PendingApproval>,
}
impl AppState {
@ -85,6 +87,7 @@ impl AppState {
pending_keys: Vec::new(),
viewport_height: 0,
status_error: None,
pending_approval: None,
}
}
}
@ -185,6 +188,17 @@ pub async fn run(
Some(input::LoopControl::ClearHistory) => {
let _ = action_tx.send(UserAction::ClearHistory).await;
}
Some(input::LoopControl::ToolApproval {
tool_use_id,
approved,
}) => {
let _ = action_tx
.send(UserAction::ToolApprovalResponse {
tool_use_id,
approved,
})
.await;
}
None => {}
}
}