New crate wrapping agent-client-protocol 2.1 in the client role. spawn() resolves claude-code-acp on the PATH the child would run with, starts it in the session cwd with the session env, runs initialize + session/new, and returns an AcpSession holding the connection, the ACP session id, and an unbounded channel of raw session/update notifications for #135. initialize declares fs.readTextFile, fs.writeTextFile and terminal as false so the adapter uses Claude Code's own tools. request_permission is a stub that declines until #139. terminate() sends session/cancel, waits, SIGTERMs, then SIGKILLs. The child stays in the daemon's process group and gets SIGTERM on daemon death via PR_SET_PDEATHSIG. CLAUDECODE is stripped from the child env: the adapter refuses to start when it believes it is nested in another Claude Code session, which is how a daemon launched from one behaves. Tests run against tests/fake_acp_agent.py, a JSON-RPC-over-stdio stand-in that logs what it receives; real_adapter_handshake is #[ignore]d.
21 lines
495 B
TOML
21 lines
495 B
TOML
[package]
|
|
name = "maestro-acp"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish.workspace = true
|
|
description = "ACP client role: one claude-code-acp child per structured session"
|
|
|
|
[dependencies]
|
|
agent-client-protocol.workspace = true
|
|
libc.workspace = true
|
|
serde_json.workspace = true
|
|
thiserror.workspace = true
|
|
tokio.workspace = true
|
|
tokio-util.workspace = true
|
|
tracing.workspace = true
|
|
|
|
[dev-dependencies]
|
|
tempfile.workspace = true
|