mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
81f2b4026d
Add an Agent Client Protocol (ACP) v1 agent mode so ACP clients such as Zed can drive devices from the agent panel. agent-device has no LLM, so the agent is deterministic: each prompt line is one agent-device command in CLI syntax, executed through the same AgentDeviceClient path as MCP tools. - Hand-rolled protocol layer in src/acp/ mirroring src/mcp/ (zero new runtime dependencies), reusing the MCP newline-delimited JSON-RPC stdio transport, payload queue, and error formatting. - Prompt lines are tokenized with the replay-script tokenizer and parsed with the real CLI parser; target flags (--platform, --device, --udid, --session, --state-dir) are sticky within an ACP session. - Command executions stream as tool_call/tool_call_update notifications with daemon progress forwarding; screenshots attach as inline images; errors keep the code/hint/supportedOn contract. - session/cancel is intercepted ahead of the serialized queue so it takes effect between command lines of a running prompt; the command already in flight runs to completion (documented v1 limitation). - Natural-language prompts are refused with guidance instead of guessed at; available commands are advertised per session after session/new. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>