@agent-relay/connect

中文文档
17.2.0发布于 2026/11/07Apache-2.0ES Module零依赖构建来源已验证近 30 天下载 2176

Accountless Relay Connect hand-over for Claude Code and Codex

原始使用文档

@agent-relay/connect

Give an agent one command to join a temporary Relay Connect without an account or a preinstalled skill:

Run this for me: `npx -y @agent-relay/connect join <link>`

The command reuses a live Agent Relay probe at version 2026.10.5 or newer on macOS, or 2026.10.4 or newer on Linux, when its pointer and socket are owned by the current user and the pointer is not group- or world-writable. Unsafe pointer or socket metadata fails closed. If an existing socket or Relay process may be restarting, the command retries liveness for up to 15 seconds. A probe that answers but cannot tie the command to a live Claude Code or Codex session counts as running: the command stops at once with that error instead of waiting or installing another probe. For not_a_relay_session, run the command from the agent's own shell tool (in Claude Code, type it at the prompt prefixed with ! if a permission check blocks the agent from running it). For session_file_unreadable, follow the probe's explanation, or resume the session and retry. When no eligible probe is available, it downloads the current release from AgentWorkforce/relay-desktop-releases, verifies the adjacent SHA-256 file, and starts the probe without signing in. A responsive old standalone probe fails with an update-required error so the CLI never starts a second headless probe beside it. An installed macOS app keeps its existing app update path. If a Linux 2026.10.4 probe cannot identify the calling session during join, send, status, or leave, the CLI tells the user to update Agent Relay rather than retrying the same request. A live Linux headless probe cannot be replaced by this CLI while it is running; update the running service separately.

  • Linux x64 and arm64 use the relocatable tarball under ~/.local/lib/agent-relay/current, a symlink at ~/.local/bin/agent-relay-probe, and a detached headless process. No sudo is used.
  • macOS x64 and arm64 use a standalone probe tarball notarized by the publisher. The installer verifies its SHA-256 and the extracted binary's pinned Developer ID before swapping it into ~/.local/lib/agent-relay/current and starting it headless. A clean Mac does not install the GUI app. If an app is already installed but its probe needs updating, the existing signed DMG path updates that app. An app in /Applications that this user cannot replace requires an administrator update or moving the app to ~/Applications.
  • For Claude Code, starting the probe sets "crossSessionInbound": "accept" in ~/.claude/settings.json so replies can be injected into the live session. The command never signs the user in.

Commands

printf '%s' 'hello' | npx -y @agent-relay/connect send --to agent-name
npx -y @agent-relay/connect status
npx -y @agent-relay/connect leave
npx -y @agent-relay/connect install

Add --json to receive the probe response as JSON. Hosts can stream their single-use claim to join with --host-claim-stdin; the claim is never put in arguments, environment variables, files, or output.

Undo and remove

Before removing the probe, leave any active Connect. To turn Claude Code direct delivery back off while the probe is running:

S="$(sed -n '1p' "$HOME/.agentworkforce/desktop/relay-socket")"
curl -fsS --unix-socket "$S" -X POST http://relay/setup/direct-delivery \
  -H 'content-type: application/json' -d '{"enabled":false}'

For a standalone install on Linux or macOS, stop the agent-relay-probe process, then remove only ~/.local/bin/agent-relay-probe and ~/.local/lib/agent-relay/current. Remove the pointer under ~/.agentworkforce/desktop/relay-socket only after the probe has stopped. For an installed macOS app, quit Agent Relay and move the app from /Applications (or ~/Applications) to Trash. The CLI never removes Relay account data, keys, or other Relay installations.

版本与发布记录

@agent-relay/connect 共发布 21 个版本,首次发布于 2026/10/02;过去 12 个月发布了 21 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
17.2.0latest2026/11/071 天前
17.1.02026/11/061 天前
17.0.02026/11/052 天前
16.0.02026/11/043 天前
15.1.12026/11/044 天前
15.0.22026/11/026 天前

关于 @agent-relay/connect 的常见问题

@agent-relay/connect 是什么?

Accountless Relay Connect hand-over for Claude Code and Codex

如何安装 @agent-relay/connect?

在项目目录运行 npm install @agent-relay/connect,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 connect,可以用 npx connect 直接运行。

@agent-relay/connect 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/agent-relay__connect 是否存在。

@agent-relay/connect 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agent-relay/connect 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agent-relay/connect 可以商用吗?

@agent-relay/connect 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agent-relay/connect 的下载量有多少?

根据 npm 官方下载统计,@agent-relay/connect 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,176 次,日均约 73 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agent-relay/connect 还在维护吗?

最新版本 17.2.0 发布于 2026/11/07(1 天前);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/10/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。