terminal-use 1.1.0

Headless virtual terminal for AI agents
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use anyhow::Result;

use crate::daemon::protocol::{Request, Response};
use crate::daemon::server::{ensure_daemon, send_request};

pub async fn run(name: String) -> Result<()> {
    ensure_daemon()?;

    match send_request(&Request::Kill { name }).await? {
        Response::Ok => Ok(()),
        Response::Error { message } => anyhow::bail!("{message}"),
        other => anyhow::bail!("Unexpected response: {other:?}"),
    }
}