Add tool use to the orchestrator (#4)

Add tool use without sandboxing.

Currently available tools are list dir, read file, write file and exec bash.

Reviewed-on: #4
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
Drew 2026-03-02 03:00:13 +00:00 committed by Drew
parent 6b85ff3cb8
commit 797d7564b7
20 changed files with 1822 additions and 129 deletions

View file

@ -4,16 +4,18 @@ pub use claude::ClaudeProvider;
use futures::Stream;
use crate::core::types::{ConversationMessage, StreamEvent};
use crate::core::types::{ConversationMessage, StreamEvent, ToolDefinition};
/// Trait for model providers that can stream conversation responses.
///
/// Implementors take a conversation history and return a stream of [`StreamEvent`]s.
/// The trait is provider-agnostic -- no Claude-specific types appear here.
pub trait ModelProvider: Send + Sync {
/// Stream a response from the model given the conversation history.
/// Stream a response from the model given the conversation history and
/// available tool definitions. Pass an empty slice if no tools are available.
fn stream<'a>(
&'a self,
messages: &'a [ConversationMessage],
tools: &'a [ToolDefinition],
) -> impl Stream<Item = StreamEvent> + Send + 'a;
}