luft-adapters
ACP (Agent Communication Protocol) backend for Luft.
[AcpAdapter] connects to an opencode acp subprocess as an ACP client
and implements the AgentBackend trait from luft-core.
Architecture
Luft Runtime AcpAdapter
│ │
│ AgentTask │ spawn `opencode acp`
├──────────────────────────────────►│
│ ├──── ACP Session.Create ────► opencode
│ │◄─── SessionUpdate(event) ─── opencode
│ AgentEvent::AgentProgress │
│◄──────────────────────────────────┤
│ ├──── Session.Stop ───────────► opencode
│ AgentResult │
│◄──────────────────────────────────┘
Module Layout
| Module | Responsibility |
|---|---|
acp_adapter |
Config, adapter, one-shot session lifecycle |
update_mapper |
ACP SessionUpdate → Luft ProgressDelta |
permission |
Non-interactive request_permission decisions |
result_collector |
Stop reason + message → AgentResult |
Quick Start
use luft_adapters::{AcpAdapter, AcpConfig, register_acp_backend};
use luft_core::BackendRegistry;
let mut registry = BackendRegistry::new();
register_acp_backend(&mut registry, AcpConfig::default());