http_relay
Class info¶
🛈 DocStrings¶
Relay a stdio ACP client to a remote agent (Streamable HTTP or WebSocket).
ACP clients that can only launch local agents (Zed, JetBrains, ...) spawn this as their
agent; it forwards the newline-delimited JSON-RPC from stdin to the remote /acp
endpoint and the server's messages back to stdout, unchanged. http(s):// URLs use
Streamable HTTP, ws(s):// URLs the WebSocket transport.
aclientp-connect https://example.com/api/acp -H 'X-API-Key: ${MY_API_KEY}'
aclientp-connect wss://example.com/acp -H 'Authorization: Bearer ${MY_TOKEN}'
Header values may reference environment variables (${NAME}), so secrets can stay in
the client's agent environment instead of its arguments. stdout carries protocol
messages only; diagnostics go to stderr.
parse_header
¶
Parse Name: value, expanding ${VAR} references in the value.
Raises:
| Type | Description |
|---|---|
ValueError
|
The header is malformed or references an unset variable. |
Source code in src/aclientp/http_relay.py
relay
async
¶
Forward stdin to the remote agent and its messages to stdout until either side ends.