crates/flocks-driver-yourcli/src/lib.rs
use async_trait::async_trait;
use flocks_driver::*;

pub struct YourCli;

#[async_trait]
impl Driver for YourCli {
    fn id(&self) -> &str { "yourcli" }

    fn capabilities(&self) -> &[Capability] {
        &[Capability::TextOnly, Capability::ToolCallsViaStdout]
    }

    async fn spawn(&self, cfg: SpawnConfig) -> Result<DriverHandle, DriverError> {
        spawn_subprocess(self, cfg).await
    }

    async fn cancel(&self, handle: &DriverHandle) -> Result<(), DriverError> {
        handle.kill().await
    }
    // …
}
Register in flocks-driver’s registry, declare the new crate as a workspace member, and cargo build. That’s the whole loop.

Conventions

  • Drivers don’t talk to the network directly. All I/O flows through the gateway’s tool fabric.
  • Drivers don’t read filesystem paths beyond the run dir.
  • Drivers don’t handle auth — the grant did that already.