claude-code-best/packages/acp-link
James Feng 27682acf63 feat(bridge): tsc 全绿 — 补齐 Bridge/UDS/TCP/ACP 远程控制链类型
tsc --noEmit: 26 → 0 
bun run build: 562 files 
bun test: 3338 pass (0 regression)

变更 (9 files, +128/-12):
- udsClient.ts: 补 sendToUdsSocket, listAllLiveSessions, LiveSession 类型, PeerInfo 扩展字段
- peerAddress.ts: scheme 联合加 'tcp', 补 parseTcpTarget stub
- peerSessions.ts: 补 listBridgePeers() stub
- channelNotification.ts: 补 ChannelPermissionRequestNotificationSchema + channel_context
- acp-link/command.ts: @stricli/core 类型断言 (as any + optional)
- acp/agent.ts: 完整 AcpAgent stub (implement Agent interface)
- computer-use-swift/types.ts: ScreenshotAPI 加 captureWindowTarget?
- ListPeersTool: bridge peer address 映射
- disconnect-monitor.test.ts: status 字段 as any

Bridge 远程控制链 (Daemon→UDS/TCP→Bridge→ACP) 类型层已完整就绪。
2026-06-02 11:26:11 +08:00
..
src feat(bridge): tsc 全绿 — 补齐 Bridge/UDS/TCP/ACP 远程控制链类型 2026-06-02 11:26:11 +08:00
.gitignore feat: pull in Vite build system + complete packages/builtin-tools/ 2026-06-01 18:18:03 +08:00
package.json chore(typecheck): tsc 基线 62→26,补 @agentclientprotocol/sdk,daemon 可用 2026-06-02 11:12:38 +08:00
README.md feat: pull in Vite build system + complete packages/builtin-tools/ 2026-06-01 18:18:03 +08:00
tsconfig.json feat: pull in Vite build system + complete packages/builtin-tools/ 2026-06-01 18:18:03 +08:00

acp-link

ACP proxy server that bridges WebSocket clients to ACP (Agent Client Protocol) agents.

Source code adapted from chrome-acp.

Installation

From source

# From monorepo root
bun install

Usage

# Via global install
acp-link /path/to/agent

# Via source
bun src/cli/bin.ts /path/to/agent

Examples

# Basic usage
acp-link /path/to/agent

# With custom port and host
acp-link --port 9000 --host 0.0.0.0 /path/to/agent

# With debug logging
acp-link --debug /path/to/agent

# Enable HTTPS with self-signed certificate
acp-link --https /path/to/agent

# Disable authentication (dangerous)
acp-link --no-auth /path/to/agent

# Register to RCS with a specific channel group
acp-link --group my-team /path/to/agent

# Pass arguments to the agent (use -- to separate)
acp-link /path/to/agent -- --verbose --model gpt-4

CLI Reference

USAGE
  acp-link [--port value] [--host value] [--debug] [--no-auth] [--https] [--group value] <command>...
  acp-link --help
  acp-link --version

FLAGS
       [--port]     Port to listen on                  [default = 9315]
       [--host]     Host to bind to                    [default = localhost]
       [--debug]    Enable debug logging to file
       [--no-auth]  Disable authentication (dangerous)
       [--https]    Enable HTTPS with self-signed cert
       [--group]    Channel group ID for RCS registration (letters, digits, hyphens, underscores only)
    -h  --help      Print help information and exit
    -v  --version   Print version information and exit

ARGUMENTS
  command...  Agent command followed by its arguments

How It Works

  1. Listens for WebSocket connections from clients
  2. When a "connect" message is received, spawns the configured ACP agent as a subprocess
  3. Bridges messages between the WebSocket (client) and stdin/stdout (agent via ACP protocol)
  4. Supports session management: create, load, resume, list sessions
  5. Handles permission approval flow and heartbeat keepalive

Authentication

By default, a random token is auto-generated on startup. Connect to the WebSocket endpoint without putting the token in the URL:

ws://localhost:9315/ws

Set ACP_AUTH_TOKEN env var to use a fixed token, or use --no-auth to disable (not recommended). Clients that cannot send an Authorization header must send the token in a WebSocket subprotocol named rcs.auth.<base64url-token>.

RCS Upstream

acp-link can register to a Remote Control Server (RCS) for remote access. Set the following environment variables:

Variable Description
ACP_RCS_URL RCS server URL (e.g. http://rcs.example.com:3000)
ACP_RCS_TOKEN API token for RCS authentication
ACP_RCS_GROUP Channel group ID to lock the agent into (letters, digits, -, _ only)

You can also use --group <id> on the CLI. The CLI flag takes priority over the env var.

Manager UI

通过 --manager flag 启动独立的管理服务(不启动代理):

# 启动 Manager默认端口 9315
acp-link --manager

# 指定端口
acp-link --manager --port 3210

在浏览器打开 http://localhost:<port> 即可访问管理界面,创建、停止、删除多个 acp-link 子进程实例并实时查看日志。

通过 Manager UI 创建的子进程会自动跳过 Manager UI。

License

MIT