mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-18 19:03:48 +00:00
feat: acp http adapter
This commit is contained in:
parent
2ba630c180
commit
b4c8564cb2
217 changed files with 18785 additions and 17400 deletions
47
server/packages/acp-http-adapter/README.md
Normal file
47
server/packages/acp-http-adapter/README.md
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# acp-http-adapter
|
||||
|
||||
Minimal ACP HTTP to stdio proxy.
|
||||
|
||||
## Endpoints
|
||||
|
||||
- `GET /v1/health`
|
||||
- `POST /v1/rpc`
|
||||
- `GET /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
|
||||
|
||||
```bash
|
||||
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
|
||||
|
||||
```rust
|
||||
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?;
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue