Skip to main content

base/interface/
inline_command.rs

1//! A skill's `` !`cmd` ``, run as a `Bash` call of the session — through the
2//! same dispatch a model's call takes — with nobody to ask about it.
3
4use tokio_util::sync::CancellationToken;
5
6use crate::interface::tool_dispatch::SubCallAnswer;
7
8#[async_trait::async_trait]
9pub trait InlineCommands: Send + Sync {
10    /// `Err` is the call not producing an answer: unknown tool, refused,
11    /// invalid, or failed; the text says which.
12    async fn run_bash(
13        &self,
14        command: &str,
15        cancel: CancellationToken,
16    ) -> Result<SubCallAnswer, String>;
17}