Skip to main content

Crate mixtape_acp

Crate mixtape_acp 

Source
Expand description

ACP (Agent Client Protocol) adapter for mixtape agents.

This crate bridges mixtape-core agents to the Agent Client Protocol, enabling editors and IDEs — VS Code, Zed, Neovim, JetBrains, Emacs, etc. — to use mixtape agents.

§Architecture

The ACP SDK returns !Send futures (uses RPITIT without + Send bounds), while mixtape’s Agent is Send + Sync. The bridge works as follows:

  1. The ACP protocol loop runs on a tokio::task::LocalSet
  2. MixtapeAcpAgent implements acp::Agent — its methods run in !Send context
  3. Inside prompt(), Agent::run() is dispatched via tokio::spawn() onto the multi-threaded runtime
  4. Events flow back via mpsc channels to a spawn_local relay task that calls conn.session_notification()
  5. Permission requests carry an Arc<Agent> — the relay task calls conn.request_permission() to show a dialog in the IDE, then delivers the result via agent.respond_to_authorization(), unblocking the agent’s request_authorization() which is waiting on an mpsc channel

§Example

use mixtape_acp::{MixtapeAcpBuilder, serve_stdio};
use mixtape_core::Agent;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let server = MixtapeAcpBuilder::new("my-agent", "0.1.0")
        .with_agent_factory(|| async {
            Agent::builder()
                // .bedrock(ClaudeSonnet4)
                .build()
                .await
        })
        .build()?;

    serve_stdio(server).await?;
    Ok(())
}

Re-exports§

pub use error::AcpError;

Modules§

error

Structs§

MixtapeAcpBuilder
Builder for configuring and constructing an ACP server.
MixtapeAcpServer
The server bundle returned by MixtapeAcpBuilder::build.

Functions§

serve_stdio
Serve the ACP protocol over stdin/stdout.