Skip to main content

Generic remote WebSocket transport for ACP agents and clients.

Project description

acpremote

acpremote is the generic remote transport package for ACP.

It exposes any existing acp.interfaces.Agent over WebSocket and can also turn a remote ACP server back into a local ACP agent proxy. It can also mirror any stdio ACP command by spawning it as a child process.

Note: Used 0.8.2 as initial release for compatibility with acpkit monorepo. This is an early release and might have issues.

Docs:

Install:

uv add acpremote
pip install acpremote

Server

Expose any ACP agent:

from acpremote import serve_acp

server = await serve_acp(agent=my_acp_agent, host='127.0.0.1', port=8080)
await server.serve_forever()

Expose a stdio ACP command instead of an in-memory agent:

from acpremote import serve_command

server = await serve_command(
    ['npx', '@zed-industries/codex-acp'],
    host='127.0.0.1',
    port=8080,
)
await server.serve_forever()

env={...} overrides selected variables while inheriting the parent process environment. That keeps command lookup through PATH intact while still letting the caller inject tokens or runtime flags.

Default routes:

  • metadata: http://127.0.0.1:8080/acp
  • health: http://127.0.0.1:8080/healthz
  • websocket: ws://127.0.0.1:8080/acp/ws

Client Proxy

Turn a remote ACP endpoint back into a local ACP agent:

from acp import run_agent
from acpremote import connect_acp

agent = connect_acp('ws://127.0.0.1:8080/acp/ws')
await run_agent(agent)

That pattern is what powers a local stdio ACP façade in front of a remote ACP server.

When the remote server advertises a remote_cwd in its metadata, connect_acp(...) treats that directory as authoritative for session lifecycle calls. This keeps a mirrored local ACP server from accidentally sending the local machine's spawn directory back to the remote host.

By default connect_acp(...) also treats host-backed capabilities as remote-owned. Local client filesystem and terminal capabilities aren't forwarded unless TransportOptions(host_ownership="client_passthrough") is set explicitly.

Transport Timing

TransportOptions can attach proxy-observed latency information to the ACP stream:

from acpremote import TransportOptions, connect_acp

agent = connect_acp(
    'ws://127.0.0.1:8080/acp/ws',
    options=TransportOptions(
        emit_latency_meta=True,
        emit_latency_projection=True,
    ),
)

TransportOptions also controls host ownership policy:

  • host_ownership="remote" is the default
  • host_ownership="client_passthrough" re-enables forwarding local filesystem and terminal client capabilities

Available signals:

  • streamed updates can carry field_meta["acpremote"]["transport_latency"]
  • a visible Transport Latency ACP card can be emitted after each prompt turn

The metrics are proxy-observed timings, not synchronized end-to-end host clock measurements.

Transport Notes

Current transport behavior:

  • one WebSocket text message carries one ACP JSON message
  • binary frames are rejected
  • bearer-token auth is supported
  • stdio ACP commands can be mirrored with serve_command(...)
  • transport limits are configurable through TransportOptions

This package is transport-focused. It doesn't assume ACP Kit adapters or ACP Kit-owned runtime semantics.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acpremote-0.8.3.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acpremote-0.8.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file acpremote-0.8.3.tar.gz.

File metadata

  • Download URL: acpremote-0.8.3.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for acpremote-0.8.3.tar.gz
Algorithm Hash digest
SHA256 5c82847fce80f7ee35b60abf4020a2d302ffb48d29118b73c7e68d02eeae97b4
MD5 d82a4dae5f2bc50c247156f270a4a959
BLAKE2b-256 4cd8a22c2ac94c53903f38c143a354d25886e7a3ebb80aeec5acef01927b52a3

See more details on using hashes here.

File details

Details for the file acpremote-0.8.3-py3-none-any.whl.

File metadata

  • Download URL: acpremote-0.8.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for acpremote-0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 18501f1c1deb372a80b7a8a186cf33e7737ae184244b14c2e755c1d2d24851ce
MD5 d6f1f8f5ec54f624cf983cc177e55b97
BLAKE2b-256 d1657265bda0a5d45f5e1b798b0f02eccdad53cd4dfe30694e8b4084515e437c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page