mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 14:03:52 +00:00
1.1 KiB
1.1 KiB
acp-http-adapter
Minimal ACP HTTP to stdio proxy.
Endpoints
GET /v1/healthPOST /v1/rpcGET /v1/rpc(SSE)DELETE /v1/rpc
Stdio framing
Uses ACP stdio framing from ACP docs:
- UTF-8 JSON-RPC messages
- one message per line
- newline-delimited (
\n) - no embedded newlines in messages
Run
cargo run -p acp-http-adapter -- \
--host 127.0.0.1 \
--port 7591 \
--registry-json '{"distribution":{"npx":{"package":"@zed-industries/codex-acp"}}}'
--registry-json accepts:
- full registry document (
{"agents":[...]}) with--registry-agent-id - single registry entry (
{"id":"...","distribution":...}) - direct distribution object (
{"npx":...}or{"binary":...})
Library
use std::time::Duration;
use acp_http_adapter::{run_server, ServerConfig};
run_server(ServerConfig {
host: "127.0.0.1".to_string(),
port: 7591,
registry_json: r#"{"distribution":{"npx":{"package":"@zed-industries/codex-acp"}}}"#.to_string(),
registry_agent_id: None,
rpc_timeout: Duration::from_secs(120),
}).await?;