Expand description
acp — lattice as an Agent Client Protocol client.
The ACP adapter half of lattice-ai (AG‑5): spawns an AI coding agent
(opencode, and later claude-code-acp / gemini) as a stdio subprocess and
drives it over JSON-RPC. Architecturally a network peer like lattice-lsp;
runs no agent in-process. Gated behind feature = "acp".
Shares the protocol-neutral editor-capability port (lattice-agent) and the
transport-neutral AI-log substrate with the MCP adapter in super::mcp. The
:ai-log command is NOT here – it is port-owned and lives in the crate-root
commands module.
Re-exports§
pub use commands::register_ai_ex_commands;pub use connection::Connection;pub use connection::SessionId;pub use conversation::Block;pub use conversation::Conversation;pub use conversation::ConversationStore;pub use conversation::ConversationUpdated;pub use conversation::Cost;pub use conversation::EditStatus;pub use conversation::PendingPermissionView;pub use conversation::PermissionStatus;pub use conversation::Role;pub use conversation::SessionStatus;pub use conversation::ToolStatus;pub use conversation::Turn;pub use conversation::UsageSnapshot;pub use error::AiError;pub use error::Result;pub use handle::AiClientHandle;pub use handle::AiState;
Modules§
- commands
- ACP lifecycle ex-commands:
:opencode/:ai-prompt/:ai-stop. - connection
- ACP connection adapter over the
agent-client-protocolcrate. - conversation
- Structured conversation model for the ACP agent UI (AU‑1).
- conversation_
mode ai-conversationmajor mode (AU‑2).- error
- Error surface for the
lattice-aiACP client. - handle
- Editor-thread handle onto the AI supervisor task (AI-1b).
- install
- ACP transport boot wiring.
- permission_
mode ai-permission-mode— the ACP permission menu (PU-B).- providers
- Provider launch configs — the crate’s extension point. Adding an agent is a new constructor here, not a new subsystem.
- session
- ACP session lifecycle: the
initialize -> session/newhandshake and prompt, as free functions over aConnection(Tasks 6/7 import these paths). - supervisor
- The AI supervisor: an idle tokio task owning the provider child process,
the ACP
Connection, and the activeSessionId(AI-1b). - tool_
fold - TCF: fold sources for the
*ai:opencode*conversation buffer.