agent-relay 17.2.1 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +74 -266
  2. package/dist/cli/agent-relay-mcp.d.ts.map +1 -1
  3. package/dist/cli/agent-relay-mcp.js +6 -5
  4. package/dist/cli/agent-relay-mcp.js.map +1 -1
  5. package/dist/cli/bootstrap.d.ts +1 -1
  6. package/dist/cli/bootstrap.d.ts.map +1 -1
  7. package/dist/cli/bootstrap.js +11 -29
  8. package/dist/cli/bootstrap.js.map +1 -1
  9. package/dist/cli/commands/agent.d.ts.map +1 -1
  10. package/dist/cli/commands/agent.js +3 -2
  11. package/dist/cli/commands/agent.js.map +1 -1
  12. package/dist/cli/commands/cloud-integration.d.ts.map +1 -1
  13. package/dist/cli/commands/cloud-integration.js +2 -1
  14. package/dist/cli/commands/cloud-integration.js.map +1 -1
  15. package/dist/cli/commands/cloud-room.d.ts.map +1 -1
  16. package/dist/cli/commands/cloud-room.js +2 -1
  17. package/dist/cli/commands/cloud-room.js.map +1 -1
  18. package/dist/cli/commands/cloud-v1-deprecations.d.ts +4 -6
  19. package/dist/cli/commands/cloud-v1-deprecations.d.ts.map +1 -1
  20. package/dist/cli/commands/cloud-v1-deprecations.js +4 -6
  21. package/dist/cli/commands/cloud-v1-deprecations.js.map +1 -1
  22. package/dist/cli/commands/cloud-worker.d.ts +6 -2
  23. package/dist/cli/commands/cloud-worker.d.ts.map +1 -1
  24. package/dist/cli/commands/cloud-worker.js +74 -37
  25. package/dist/cli/commands/cloud-worker.js.map +1 -1
  26. package/dist/cli/commands/cloud.d.ts.map +1 -1
  27. package/dist/cli/commands/cloud.js +20 -18
  28. package/dist/cli/commands/cloud.js.map +1 -1
  29. package/dist/cli/commands/core.d.ts +3 -91
  30. package/dist/cli/commands/core.d.ts.map +1 -1
  31. package/dist/cli/commands/core.js +5 -254
  32. package/dist/cli/commands/core.js.map +1 -1
  33. package/dist/cli/commands/fleet-agent.d.ts +9 -54
  34. package/dist/cli/commands/fleet-agent.d.ts.map +1 -1
  35. package/dist/cli/commands/fleet-agent.js +105 -314
  36. package/dist/cli/commands/fleet-agent.js.map +1 -1
  37. package/dist/cli/commands/fleet.d.ts +0 -3
  38. package/dist/cli/commands/fleet.d.ts.map +1 -1
  39. package/dist/cli/commands/fleet.js +48 -267
  40. package/dist/cli/commands/fleet.js.map +1 -1
  41. package/dist/cli/commands/init.js +1 -1
  42. package/dist/cli/commands/init.js.map +1 -1
  43. package/dist/cli/commands/integration-cleanup-journal.d.ts +6 -2
  44. package/dist/cli/commands/integration-cleanup-journal.d.ts.map +1 -1
  45. package/dist/cli/commands/integration-cleanup-journal.js +611 -134
  46. package/dist/cli/commands/integration-cleanup-journal.js.map +1 -1
  47. package/dist/cli/commands/integration-recipient.d.ts +0 -17
  48. package/dist/cli/commands/integration-recipient.d.ts.map +1 -1
  49. package/dist/cli/commands/integration-recipient.js +1 -104
  50. package/dist/cli/commands/integration-recipient.js.map +1 -1
  51. package/dist/cli/commands/integration.d.ts +7 -3
  52. package/dist/cli/commands/integration.d.ts.map +1 -1
  53. package/dist/cli/commands/integration.js +37 -82
  54. package/dist/cli/commands/integration.js.map +1 -1
  55. package/dist/cli/commands/local-workflow.d.ts +1 -1
  56. package/dist/cli/commands/local-workflow.d.ts.map +1 -1
  57. package/dist/cli/commands/local-workflow.js +20 -6
  58. package/dist/cli/commands/local-workflow.js.map +1 -1
  59. package/dist/cli/commands/node.d.ts +18 -20
  60. package/dist/cli/commands/node.d.ts.map +1 -1
  61. package/dist/cli/commands/node.js +42 -272
  62. package/dist/cli/commands/node.js.map +1 -1
  63. package/dist/cli/commands/product-surfaces.js +2 -2
  64. package/dist/cli/commands/session.d.ts.map +1 -1
  65. package/dist/cli/commands/session.js +2 -1
  66. package/dist/cli/commands/session.js.map +1 -1
  67. package/dist/cli/commands/skills.d.ts.map +1 -1
  68. package/dist/cli/commands/skills.js +2 -1
  69. package/dist/cli/commands/skills.js.map +1 -1
  70. package/dist/cli/commands/status.d.ts +1 -7
  71. package/dist/cli/commands/status.d.ts.map +1 -1
  72. package/dist/cli/commands/status.js +2 -28
  73. package/dist/cli/commands/status.js.map +1 -1
  74. package/dist/cli/commands/workspace.d.ts.map +1 -1
  75. package/dist/cli/commands/workspace.js +2 -2
  76. package/dist/cli/commands/workspace.js.map +1 -1
  77. package/dist/cli/index.d.ts.map +1 -1
  78. package/dist/cli/index.js +1 -3
  79. package/dist/cli/index.js.map +1 -1
  80. package/dist/cli/lib/agent-relay-cli-reentry.d.ts +40 -0
  81. package/dist/cli/lib/agent-relay-cli-reentry.d.ts.map +1 -0
  82. package/dist/cli/lib/agent-relay-cli-reentry.js +47 -0
  83. package/dist/cli/lib/agent-relay-cli-reentry.js.map +1 -0
  84. package/dist/cli/lib/agent-tools-mcp.d.ts.map +1 -1
  85. package/dist/cli/lib/agent-tools-mcp.js +3 -2
  86. package/dist/cli/lib/agent-tools-mcp.js.map +1 -1
  87. package/dist/cli/lib/cloud-worker-authored-runtime.d.ts +3 -0
  88. package/dist/cli/lib/cloud-worker-authored-runtime.d.ts.map +1 -0
  89. package/dist/cli/lib/cloud-worker-authored-runtime.js +67 -0
  90. package/dist/cli/lib/cloud-worker-authored-runtime.js.map +1 -0
  91. package/dist/cli/lib/cloud-worker-enrollment-token.d.ts +13 -0
  92. package/dist/cli/lib/cloud-worker-enrollment-token.d.ts.map +1 -0
  93. package/dist/cli/lib/cloud-worker-enrollment-token.js +88 -0
  94. package/dist/cli/lib/cloud-worker-enrollment-token.js.map +1 -0
  95. package/dist/cli/lib/core-maintenance.d.ts +2 -3
  96. package/dist/cli/lib/core-maintenance.d.ts.map +1 -1
  97. package/dist/cli/lib/core-maintenance.js +3 -37
  98. package/dist/cli/lib/core-maintenance.js.map +1 -1
  99. package/dist/cli/lib/desktop-presence.js +1 -1
  100. package/dist/cli/lib/desktop-presence.js.map +1 -1
  101. package/dist/cli/lib/install-paths.d.ts +100 -0
  102. package/dist/cli/lib/install-paths.d.ts.map +1 -0
  103. package/dist/cli/lib/install-paths.js +157 -0
  104. package/dist/cli/lib/install-paths.js.map +1 -0
  105. package/dist/cli/lib/product-surface-store.d.ts.map +1 -1
  106. package/dist/cli/lib/product-surface-store.js +4 -1
  107. package/dist/cli/lib/product-surface-store.js.map +1 -1
  108. package/dist/cli/lib/relay-node.d.ts +7 -34
  109. package/dist/cli/lib/relay-node.d.ts.map +1 -1
  110. package/dist/cli/lib/relay-node.js +7 -182
  111. package/dist/cli/lib/relay-node.js.map +1 -1
  112. package/dist/cli/lib/removed-broker-command.d.ts +7 -0
  113. package/dist/cli/lib/removed-broker-command.d.ts.map +1 -0
  114. package/dist/cli/lib/removed-broker-command.js +13 -0
  115. package/dist/cli/lib/removed-broker-command.js.map +1 -0
  116. package/dist/cli/lib/sdk-client.d.ts +4 -4
  117. package/dist/cli/lib/sdk-client.js +4 -4
  118. package/dist/cli/lib/self-update.d.ts +8 -19
  119. package/dist/cli/lib/self-update.d.ts.map +1 -1
  120. package/dist/cli/lib/self-update.js +14 -28
  121. package/dist/cli/lib/self-update.js.map +1 -1
  122. package/dist/cli/lib/skills-install.d.ts.map +1 -1
  123. package/dist/cli/lib/skills-install.js +3 -2
  124. package/dist/cli/lib/skills-install.js.map +1 -1
  125. package/dist/cli/telemetry/events.d.ts +4 -1
  126. package/dist/cli/telemetry/events.d.ts.map +1 -1
  127. package/package.json +9 -14
  128. package/dist/auto/classifier.d.ts +0 -29
  129. package/dist/auto/classifier.d.ts.map +0 -1
  130. package/dist/auto/classifier.js +0 -126
  131. package/dist/auto/classifier.js.map +0 -1
  132. package/dist/auto/composer.d.ts +0 -105
  133. package/dist/auto/composer.d.ts.map +0 -1
  134. package/dist/auto/composer.js +0 -454
  135. package/dist/auto/composer.js.map +0 -1
  136. package/dist/auto/director-prompt.d.ts +0 -25
  137. package/dist/auto/director-prompt.d.ts.map +0 -1
  138. package/dist/auto/director-prompt.js +0 -53
  139. package/dist/auto/director-prompt.js.map +0 -1
  140. package/dist/auto/index.d.ts +0 -15
  141. package/dist/auto/index.d.ts.map +0 -1
  142. package/dist/auto/index.js +0 -13
  143. package/dist/auto/index.js.map +0 -1
  144. package/dist/cli/commands/local-agent.d.ts +0 -74
  145. package/dist/cli/commands/local-agent.d.ts.map +0 -1
  146. package/dist/cli/commands/local-agent.js +0 -969
  147. package/dist/cli/commands/local-agent.js.map +0 -1
  148. package/dist/cli/lib/attach-broker.d.ts +0 -17
  149. package/dist/cli/lib/attach-broker.d.ts.map +0 -1
  150. package/dist/cli/lib/attach-broker.js +0 -27
  151. package/dist/cli/lib/attach-broker.js.map +0 -1
  152. package/dist/cli/lib/attach-drive.d.ts +0 -376
  153. package/dist/cli/lib/attach-drive.d.ts.map +0 -1
  154. package/dist/cli/lib/attach-drive.js +0 -1212
  155. package/dist/cli/lib/attach-drive.js.map +0 -1
  156. package/dist/cli/lib/attach-fleet-node.d.ts +0 -85
  157. package/dist/cli/lib/attach-fleet-node.d.ts.map +0 -1
  158. package/dist/cli/lib/attach-fleet-node.js +0 -1347
  159. package/dist/cli/lib/attach-fleet-node.js.map +0 -1
  160. package/dist/cli/lib/attach-input-recovery.d.ts +0 -190
  161. package/dist/cli/lib/attach-input-recovery.d.ts.map +0 -1
  162. package/dist/cli/lib/attach-input-recovery.js +0 -559
  163. package/dist/cli/lib/attach-input-recovery.js.map +0 -1
  164. package/dist/cli/lib/attach-mode.d.ts +0 -2
  165. package/dist/cli/lib/attach-mode.d.ts.map +0 -1
  166. package/dist/cli/lib/attach-mode.js +0 -2
  167. package/dist/cli/lib/attach-mode.js.map +0 -1
  168. package/dist/cli/lib/attach-native.d.ts +0 -27
  169. package/dist/cli/lib/attach-native.d.ts.map +0 -1
  170. package/dist/cli/lib/attach-native.js +0 -267
  171. package/dist/cli/lib/attach-native.js.map +0 -1
  172. package/dist/cli/lib/attach-passthrough.d.ts +0 -193
  173. package/dist/cli/lib/attach-passthrough.d.ts.map +0 -1
  174. package/dist/cli/lib/attach-passthrough.js +0 -778
  175. package/dist/cli/lib/attach-passthrough.js.map +0 -1
  176. package/dist/cli/lib/attach-remote-node.d.ts +0 -21
  177. package/dist/cli/lib/attach-remote-node.d.ts.map +0 -1
  178. package/dist/cli/lib/attach-remote-node.js +0 -133
  179. package/dist/cli/lib/attach-remote-node.js.map +0 -1
  180. package/dist/cli/lib/attach-view.d.ts +0 -177
  181. package/dist/cli/lib/attach-view.d.ts.map +0 -1
  182. package/dist/cli/lib/attach-view.js +0 -455
  183. package/dist/cli/lib/attach-view.js.map +0 -1
  184. package/dist/cli/lib/attach.d.ts +0 -555
  185. package/dist/cli/lib/attach.d.ts.map +0 -1
  186. package/dist/cli/lib/attach.js +0 -1180
  187. package/dist/cli/lib/attach.js.map +0 -1
  188. package/dist/cli/lib/broker-connection.d.ts +0 -65
  189. package/dist/cli/lib/broker-connection.d.ts.map +0 -1
  190. package/dist/cli/lib/broker-connection.js +0 -144
  191. package/dist/cli/lib/broker-connection.js.map +0 -1
  192. package/dist/cli/lib/broker-lifecycle.d.ts +0 -220
  193. package/dist/cli/lib/broker-lifecycle.d.ts.map +0 -1
  194. package/dist/cli/lib/broker-lifecycle.js +0 -2290
  195. package/dist/cli/lib/broker-lifecycle.js.map +0 -1
  196. package/dist/cli/lib/broker-process-identity.d.ts +0 -38
  197. package/dist/cli/lib/broker-process-identity.d.ts.map +0 -1
  198. package/dist/cli/lib/broker-process-identity.js +0 -304
  199. package/dist/cli/lib/broker-process-identity.js.map +0 -1
  200. package/dist/cli/lib/client-factory.d.ts +0 -44
  201. package/dist/cli/lib/client-factory.d.ts.map +0 -1
  202. package/dist/cli/lib/client-factory.js +0 -64
  203. package/dist/cli/lib/client-factory.js.map +0 -1
  204. package/dist/cli/lib/collect-with-retry.d.ts +0 -24
  205. package/dist/cli/lib/collect-with-retry.d.ts.map +0 -1
  206. package/dist/cli/lib/collect-with-retry.js +0 -33
  207. package/dist/cli/lib/collect-with-retry.js.map +0 -1
  208. package/dist/cli/lib/fleet-attach-target.d.ts +0 -18
  209. package/dist/cli/lib/fleet-attach-target.d.ts.map +0 -1
  210. package/dist/cli/lib/fleet-attach-target.js +0 -57
  211. package/dist/cli/lib/fleet-attach-target.js.map +0 -1
  212. package/dist/cli/lib/fleet-hint.d.ts +0 -49
  213. package/dist/cli/lib/fleet-hint.d.ts.map +0 -1
  214. package/dist/cli/lib/fleet-hint.js +0 -113
  215. package/dist/cli/lib/fleet-hint.js.map +0 -1
  216. package/dist/cli/lib/fleet-sidecar.d.ts +0 -43
  217. package/dist/cli/lib/fleet-sidecar.d.ts.map +0 -1
  218. package/dist/cli/lib/fleet-sidecar.js +0 -84
  219. package/dist/cli/lib/fleet-sidecar.js.map +0 -1
  220. package/dist/cli/lib/join-ticket.d.ts +0 -22
  221. package/dist/cli/lib/join-ticket.d.ts.map +0 -1
  222. package/dist/cli/lib/join-ticket.js +0 -96
  223. package/dist/cli/lib/join-ticket.js.map +0 -1
  224. package/dist/cli/lib/node-claim.d.ts +0 -468
  225. package/dist/cli/lib/node-claim.d.ts.map +0 -1
  226. package/dist/cli/lib/node-claim.js +0 -1349
  227. package/dist/cli/lib/node-claim.js.map +0 -1
  228. package/dist/cli/lib/node-definition-loader.d.ts +0 -19
  229. package/dist/cli/lib/node-definition-loader.d.ts.map +0 -1
  230. package/dist/cli/lib/node-definition-loader.js +0 -143
  231. package/dist/cli/lib/node-definition-loader.js.map +0 -1
  232. package/dist/cli/lib/node-provider-child.d.ts +0 -129
  233. package/dist/cli/lib/node-provider-child.d.ts.map +0 -1
  234. package/dist/cli/lib/node-provider-child.js +0 -755
  235. package/dist/cli/lib/node-provider-child.js.map +0 -1
  236. package/dist/cli/lib/predictive-echo-screen.d.ts +0 -48
  237. package/dist/cli/lib/predictive-echo-screen.d.ts.map +0 -1
  238. package/dist/cli/lib/predictive-echo-screen.js +0 -74
  239. package/dist/cli/lib/predictive-echo-screen.js.map +0 -1
  240. package/dist/cli/lib/project-broker-client.d.ts +0 -4
  241. package/dist/cli/lib/project-broker-client.d.ts.map +0 -1
  242. package/dist/cli/lib/project-broker-client.js +0 -12
  243. package/dist/cli/lib/project-broker-client.js.map +0 -1
  244. package/dist/cli/lib/reflex-capture.d.ts +0 -41
  245. package/dist/cli/lib/reflex-capture.d.ts.map +0 -1
  246. package/dist/cli/lib/reflex-capture.js +0 -128
  247. package/dist/cli/lib/reflex-capture.js.map +0 -1
  248. package/dist/cli/lib/workspace-env.d.ts +0 -8
  249. package/dist/cli/lib/workspace-env.d.ts.map +0 -1
  250. package/dist/cli/lib/workspace-env.js +0 -16
  251. package/dist/cli/lib/workspace-env.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # agent-relay
2
2
 
3
- A thin operator console for a local agent workforce: stand up the broker, staff it with off-the-shelf agent CLIs, and watch/steer them from the terminal. Each command is a shallow wrapper over a backing package (`@agent-relay/sdk`, `@agent-relay/harness-driver`, `@agent-relay/cloud`).
3
+ A thin operator console for an agent workforce: connect your agent tools with `relay init`, message and coordinate the agents in a workspace, and place workers on fleet nodes or Cloud sandboxes. Each command is a shallow wrapper over a backing package (`@agent-relay/sdk`, `@agent-relay/cloud`).
4
4
 
5
5
  ## Install
6
6
 
@@ -13,112 +13,47 @@ npm install -g agent-relay
13
13
  ## Common commands
14
14
 
15
15
  ```bash
16
- agent-relay status # workspace + cloud login + local broker
16
+ agent-relay init # set up Relay, your agent tools, and the Agent Relay core
17
+ agent-relay status # workspace + cloud login
17
18
  agent-relay mcp # MCP stdio server
18
19
 
19
20
  agent-relay message post --channel general --text "hello"
20
21
  agent-relay workspace list
21
22
  ```
22
23
 
23
- ## This machine's node
24
+ ## Agents on this machine
24
25
 
25
- The `node` command group manages the broker on your machine and the agents it runs:
26
+ `relay init` installs and starts the Agent Relay core, which injects messages
27
+ into running Claude Code, Codex, OpenCode, Grok, Pi, Devin and Cursor sessions
28
+ and spawns, lists and releases agents on this machine. Spawn agents through the
29
+ Agent Relay MCP spawn tools (or the desktop app).
26
30
 
27
- ```bash
28
- agent-relay node up # serves an auto-discovered agent-relay.{ts,js,…} node file,
29
- # or the implicit local node from teams.json
30
- agent-relay node up --config ./my-node.ts # serve a specific defineNode(...) file
31
- agent-relay node status
32
- agent-relay node down
31
+ The local Rust broker and the commands that drove it were retired:
32
+ `node up|down|status|metrics|deadletters|redeliver`, `node tail`, and every
33
+ `node agent …` subcommand (and the same verbs on the deprecated `local` alias)
34
+ now print a removal notice that points to `relay init`. `fleet status` was
35
+ retired the same way.
36
+
37
+ The `node` group still carries the local workflow commands:
33
38
 
39
+ ```bash
34
40
  agent-relay node workflow run workflows/my-workflow.ts
35
41
  agent-relay node workflow logs <run-id> --follow
36
42
  agent-relay node workflow sync <run-id>
37
-
38
- agent-relay node agent new claude # spawn + attach
39
- agent-relay node agent new codex --runtime native
40
- agent-relay node agent spawn opencode --runtime pty
41
- agent-relay node agent spawn devin --name reviewer --task "Review the current diff"
42
- agent-relay node agent list
43
- agent-relay node agent list --status # + inbound delivery mode and pending-queue contents per agent
44
- agent-relay node agent attach <name> --mode view
45
- agent-relay node agent release <name>
46
43
  ```
47
44
 
48
- Local-broker `node agent` subcommands and `node tail` accept `--state-dir <dir>`, `--broker-url <url>`, and `--api-key <key>` to target a broker other than the current project's — for example a fleet node started with `node up --state-dir`. `--state-dir` may name the broker state dir or a fleet node directory whose broker state lives in `state/`. An explicit `--state-dir` reads only that broker's `connection.json` (`--broker-url` may still override its URL), ignoring `RELAY_BROKER_URL` / `RELAY_BROKER_API_KEY`. Without flags, a nonblank `RELAY_BROKER_URL` or `RELAY_BROKER_API_KEY` selects the local broker; otherwise the enclosing project's broker is used, except that flag-free `attach` and `message flush|hold|auto` may auto-route to a live fleet placement. Remote routes differ: `attach --node` rejects these flags, `attach --ssh-host` rejects `--broker-url` / `--api-key`, and `message … --node` ignores them.
45
+ ## Headless server in an existing Cloud workspace
49
46
 
50
- `node agent spawn` and `node agent new` accept `--runtime auto|native|pty`. `auto` is the default and keeps experimental dual-runtime adapters on PTY. Claude Code, Codex, and OpenCode support explicit native or PTY selection; Pi and Deep Agents are experimental native-only harnesses and require `--runtime native`.
47
+ For an Ubuntu server that should appear beside your Mac as a spawn target,
48
+ follow [the headless server guide](https://agentrelay.com/docs/headless-server). Use the Linux
49
+ account-aware package and device sign-in to the exact workspace. A v18
50
+ `cloud enroll` node ID alone does not start that service. Older v18.0.0 output
51
+ recommended the removed `node up` command; newer builds link to the guide. `init --hosted` can create a different workspace.
51
52
 
52
- For AI SDK native harnesses, attach renders structured activity, text, tools, approvals, files, usage, and lifecycle events. Add `--json` for NDJSON, `--reasoning` for reasoning events, or `--diagnostics` for sidecar diagnostics. Native harness `drive` is line-oriented and acknowledged; native harness `passthrough` is unsupported because no terminal stream exists. PTY attach behavior is unchanged.
53
+ ### Workspace selection
53
54
 
54
- ### Local operation during a Relaycast outage
55
-
56
- ```bash
57
- agent-relay node up --local-only
58
- agent-relay node status
59
- agent-relay node agent spawn claude --runtime pty
60
- agent-relay node agent attach <name> --mode view
61
- ```
62
-
63
- `--local-only` deliberately starts a **DEGRADED** broker without waiting for
64
- Relaycast. Startup, `/health`, `/api/status`, and `node status` report that mode.
65
- The authenticated `/api/session` exposes `operation_mode: "local_only"` and
66
- `degraded: true`; its existing `mode` still describes persistence.
67
- The standalone broker accepts `init --local-only --persist`; SDK callers can
68
- set `AGENT_RELAY_LOCAL_ONLY=1` and enable persistence. The API must bind to a
69
- loopback IP, and the mode supports a single workspace key.
70
-
71
- Local spawn, terminal view/input, and the durable automatic delivery queue
72
- remain available. `POST /api/send` accepts only a worker currently running on
73
- this broker; channel, cross-workspace, and remote destinations are rejected.
74
- It reports `delivery_status: "queued_local"`, `local: true`, and
75
- `relaycast_published: false`. Acceptance means the work was saved, not that an
76
- agent has read it. Pending work survives restart and waits for an absent local
77
- recipient to respawn without exhausting retries. A restarted recipient gets a
78
- fresh transport retry budget. Explicit release and exhausted transport failures
79
- while the recipient is present still use the dead-letter lifecycle. Manual-flush mode is
80
- unavailable and returns `capability_disabled` explicitly.
81
-
82
- Fleet routing, worker presence, remote terminal attachment, node capability
83
- providers, and injected Relaycast messaging tools are disabled. Local agents
84
- receive a degraded-mode notice. Their model provider and any tools they
85
- configure themselves still have their own connectivity requirements.
86
-
87
- When a workspace key is configured through the normal workspace selection,
88
- the broker retries an independent audit connection in the background. Audit
89
- endpoints require HTTPS, with HTTP allowed only for literal loopback IPs used
90
- in local development. Audit records never follow HTTP redirects. Queued
91
- local delivery records are persisted in `state-<name>.local-outbox.json` beside
92
- broker state, then reconciled as `local.delivery.queued` events under a separate
93
- broker audit identity when Relaycast responds. These events contain the
94
- original delivery/event IDs, sender, recipient, body, and queue timestamp.
95
- They record local acceptance, not model completion. They are **audit replay**,
96
- not re-sent messages: replay must never execute the work twice or address a
97
- local worker name on another machine. Reconciliation is at least once; consumers
98
- can deduplicate by `event_id` after an ambiguous response or crash.
99
-
100
- `node status` reports the reconciliation backlog and the last connection
101
- result. Without a workspace key, local work still runs and records remain on
102
- disk with no upload destination; no workspace is created. A nonempty unscoped
103
- backlog cannot acquire a destination on restart. Keep its state directory and
104
- continue without a key, or select a different state directory for new work
105
- with a configured destination. The outbox
106
- is bounded to 10,000 records / 32 MiB and rejects new sends when full. A digest
107
- pins a configured backlog to its original workspace key and Relaycast base URL;
108
- restore that configuration to drain it before rotating keys or changing the
109
- destination. Corrupt outboxes cause an explicit startup failure rather than
110
- being discarded. Preserve the state directory until reconciliation completes.
111
-
112
- Recovery never silently enables fleet capabilities. Stop the broker and start
113
- normally (without the flag or environment opt-in) to enable them; a normal
114
- restart drains retained audit backlog only when its configured destination and
115
- digest match; an unscoped backlog remains on disk. Restart local workers as needed
116
- to give them Relaycast messaging tools and registered identities.
117
-
118
- ### Workspace binding and recovery
119
-
120
- `agent-relay up` and `agent-relay node up` resolve the workspace through one
121
- precedence ladder. The first source that resolves wins:
55
+ Commands resolve the workspace through one precedence ladder. The first source
56
+ that resolves wins:
122
57
 
123
58
  | # | Source | Where it comes from |
124
59
  | --- | ------------------------------- | ----------------------------------------------------------------------------- |
@@ -126,105 +61,10 @@ precedence ladder. The first source that resolves wins:
126
61
  | 2 | Environment | `RELAY_WORKSPACE_KEY`, then `AGENT_RELAY_WORKSPACE_KEY`, then `RELAY_API_KEY` |
127
62
  | 3 | Repository pin | `<project>/.agentworkforce/relay/workspace-key.json` |
128
63
  | 4 | Machine-global active workspace | the `active` entry in `~/.agentworkforce/relay/workspaces.json` |
129
- | 5 | Created workspace | created only when nothing above resolves |
130
64
 
131
65
  The repository pin always beats the machine-global active workspace, so
132
66
  `agent-relay workspace switch <name>` never silently re-homes a checkout that
133
- already pinned one. A new workspace is a last resort: a fresh directory joins
134
- the machine-global active workspace when one exists, and startup explicitly
135
- announces creation when none of the first four sources resolves.
136
-
137
- Startup and `node status` report the winning source without printing key
138
- material. Status uses the same five labels: command-line flag, environment,
139
- repository pin, machine-global active workspace, or created — but the two
140
- commands print different strings: startup shows the resolved origin
141
- (an absolute path for a repository pin), `node status` shows a fixed,
142
- relative-path label.
143
-
144
- Startup output:
145
-
146
- ```text
147
- Workspace source: repository pin (/repo/.agentworkforce/relay/workspace-key.json)
148
- Workspace: joined rw_7ccfea89
149
- ```
150
-
151
- `node status` output:
152
-
153
- ```text
154
- Workspace source: repository pin (.agentworkforce/relay/workspace-key.json)
155
- ```
156
-
157
- A Cloud enrollment (`RELAY_NODE_TOKEN`, or a record in the Fleet enrollment
158
- store) selects the node's _identity_, not its workspace, so it never appears on
159
- the ladder. If a stored enrollment addresses a different workspace than the
160
- repository pin, `node up` refuses to start and names both source files and
161
- workspace IDs, never their keys.
162
-
163
- ### One live broker per enrolled node
164
-
165
- The Fleet enrollment store is machine-global and is not scoped to a broker state
166
- directory, so a second `node up` — another checkout, or the same one with a
167
- different `--state-dir` — used to adopt the same node id. Both brokers then
168
- registered as that node, the engine handed the node-control delivery socket to
169
- whichever registered last, and the first broker kept running and reporting
170
- healthy while messages silently stopped arriving.
171
-
172
- A start now takes machine-global ownership of its enrolled node id in
173
- `~/.agentworkforce/relay/node-claims/<node-id>.<generation>.json` (pid, state
174
- dir, API port, broker name, claim time) **before** it spawns a broker, because
175
- the broker registers with the engine from its own startup — anything claimed
176
- afterwards is claimed after the delivery socket could already have moved.
177
- Ownership is handed to the broker process once its identity is verified, and is
178
- released only after that process is observed to exit.
179
-
180
- Ownership _is_ the exclusive creation of the next generation file, so concurrent
181
- starts cannot both win and no start ever deletes a record another one might have
182
- replaced: whoever creates `…000002.json` first owns the node, and the others
183
- re-read and refuse. Releasing a claim retires its generation number instead of
184
- freeing it, so a number is never handed out twice and a start that was suspended
185
- across a full release-and-restart cycle cannot wake up and win a node id that
186
- now belongs to somebody else. A crashed start leaves a generation whose pids are
187
- dead, which is stale rather than blocking.
188
-
189
- Each generation also has a `…000002.hold` file that the supervising CLI opens
190
- before it spawns a broker and the broker child inherits. Whether anything still
191
- holds it open is answered by the kernel, not by a file either process has to
192
- survive long enough to write — so a supervisor killed anywhere between the spawn
193
- and the broker's first write still leaves a node id that reads as held, instead
194
- of one that looks free right up until the orphan registers. `node up` refuses to adopt a node id that a
195
- live claim names, printing the holding broker's pid and state directory:
196
-
197
- ```text
198
- Refusing to start: node node_2230437463 is already served by a live broker on this machine.
199
- holding broker pid 48211, state dir /repo/.agentworkforce/relay, API port 3891
200
- ```
201
-
202
- A claim whose pids are gone — or whose pids have since been recycled by other
203
- processes — is stale, so an ordinary restart after a crash or reboot is never
204
- refused. Two exceptions keep a crash from unguarding a running broker: if the
205
- supervising CLI was killed before it could record its broker's pid, the broker's
206
- own `connection.json` in the claimed state directory still names a live process,
207
- and that reads as held; and until a start has recorded which child it spawned,
208
- anything still holding that generation's `.hold` file keeps the node guarded,
209
- because a process that has since `exec`d into another binary is no longer
210
- anything the claim could identify. To run a second node on this machine alongside the live one, enroll a
211
- distinct node (`agent-relay cloud enroll --name <other-node>`) and start from
212
- that enrollment; `node up --force` takes the node over instead, evicting the
213
- live broker's delivery socket.
214
-
215
- An explicit `RELAY_NODE_ID` is the identity the broker sends in `node.register`,
216
- so it is guarded on that basis alone — the CLI does not try to predict which of
217
- the broker's credential routes will resolve. A node token in the environment, one
218
- the broker has already cached, and one it mints for itself from workspace
219
- credentials all end in the same registration, and only `--local-only`, which
220
- registers nothing, is exempt. A start that turns out to have had no credential at
221
- all is refused for a node somebody else is serving, which costs one `--force`.
222
-
223
- Because the claims are machine-global, they also give `node down` a way to point
224
- at a live broker it cannot see: run from the wrong directory it still reports
225
- `Not running`, but now lists the live nodes and the state directories serving
226
- them. Two brokers on _different_ machines sharing one enrollment store (a synced
227
- home directory) are out of scope — nothing local can see the other host's pids.
67
+ already pinned one.
228
68
 
229
69
  `workspace create`, `join`, and `switch` select a named workspace globally and
230
70
  pin it to the current project. A changed selection records the old name, so an
@@ -234,27 +74,39 @@ accidental create can be undone:
234
74
  agent-relay workspace restore
235
75
  ```
236
76
 
237
- To change only the workspace this project's broker will use on its next start,
238
- without changing the machine-global active workspace, use:
77
+ To change only the workspace this project uses, without changing the
78
+ machine-global active workspace, use:
239
79
 
240
80
  ```bash
241
81
  agent-relay workspace rebind default
242
- agent-relay node down
243
- agent-relay node up
244
82
  ```
245
83
 
246
- `rebind` is also the supported recovery command for the conflict above: it
247
- writes the repository pin (which outranks the machine-global active workspace)
248
- and clears the project's stale enrolled-node association so the next start does
249
- not fight the conflict guard. It does not stop a running broker; restart the
250
- broker when you are ready to apply the new pin.
84
+ ## Cloud worker enrollment
85
+
86
+ `agent-relay cloud worker register` accepts exactly one token source. To read
87
+ an enrollment token from a projected Secret file:
88
+
89
+ ```bash
90
+ agent-relay cloud worker register --name worker --base-url https://control.example.com \
91
+ --token-file /var/run/worker-enrollment/token
92
+ ```
93
+
94
+ Piped or redirected stdin is also supported:
95
+
96
+ ```bash
97
+ agent-relay cloud worker register --name worker --base-url https://control.example.com \
98
+ --token-stdin < /var/run/worker-enrollment/token
99
+ ```
251
100
 
252
- For detached startup failures, `node up --background` reports the child error
253
- when available and otherwise tells you to retry without `--background`; a child
254
- that already exited is no longer misreported as an unkillable half-started
255
- broker.
101
+ The existing `--token <token>` option remains supported. Token inputs are
102
+ limited to 16 KiB, must contain nonempty UTF-8 text, and have surrounding
103
+ whitespace trimmed. File input follows projected Secret symlinks and requires
104
+ the opened target to be a regular file. Stdin refuses an interactive terminal.
105
+ Input failures occur before registration; the CLI does not echo the token or
106
+ include file paths in input errors. Successful enrollment uses the existing
107
+ worker credential store and start protocol.
256
108
 
257
- ## Local and remote fleet agents
109
+ ## Fleet agents
258
110
 
259
111
  The `fleet` command group lists and controls agents across all live nodes in
260
112
  the active project workspace:
@@ -278,9 +130,6 @@ agent-relay fleet spawn codex \
278
130
  --node sf-mini \
279
131
  --session-ref <actual-codex-thread-id>
280
132
 
281
- # No placement options: use the local broker and this exact working directory.
282
- agent-relay fleet spawn codex --name api-worker --task "Review the current diff."
283
-
284
133
  # Opt into automatic eligible-node placement.
285
134
  agent-relay fleet spawn codex --name api-worker --task "Review the current diff." --auto-place
286
135
 
@@ -292,8 +141,6 @@ agent-relay fleet spawn codex \
292
141
  --name e2b-worker \
293
142
  --task "Review the current workspace and wait for follow-up."
294
143
 
295
- # A uniquely placed sandbox worker can be attached without node or route flags.
296
- agent-relay node agent attach e2b-worker --mode drive
297
144
 
298
145
  agent-relay message dm send api-worker "Detailed task instructions"
299
146
  # wait is the default: it queues for the recipient's next safe idle boundary and
@@ -334,17 +181,14 @@ confirmed), `failed` (the node reported a terminal failure), `accepted`
334
181
  still has not reported — not evidence that nothing started). Polling never
335
182
  dispatches another agent.
336
183
 
337
- Without placement options, `fleet spawn` connects to the local project's broker
338
- and passes the caller's exact directory, including a nested package, to the
339
- worker. Start the local broker with `agent-relay node up` if it is not running;
340
- a local connection failure never falls back to remote placement. `--cwd` selects
341
- a different local directory on this path. Model and channel options stay local.
342
- `--auto-place`, `--node`, and `--sandbox` select remote placement explicitly.
343
- Legacy invocations with an explicit `--workspace-key`/`--wk`, `--token`,
344
- `--base-url`, or `--persona` retain automatic fleet placement when no node or
345
- sandbox is selected. Ambient credentials and persisted Cloud routing do not
346
- change the local default. Workforce reporting metadata requires remote placement.
347
- Automatic placement and release need only the workspace key.
184
+ `fleet spawn` needs a placement: `--node`, `--auto-place`, or `--sandbox`.
185
+ Spawning on this machine without one went away with the local broker; the
186
+ command now says so and points to `relay init`, whose core spawns agents here.
187
+ Invocations with an explicit `--workspace-key`/`--wk`, `--token`,
188
+ `--base-url`, or `--persona` keep automatic fleet placement when no node or
189
+ sandbox is selected. Ambient credentials and persisted Cloud routing never turn
190
+ a flag-free spawn remote. Automatic placement and release need only the
191
+ workspace key.
348
192
 
349
193
  The sandbox path provisions a fresh hosted instance. Inside a GitHub checkout,
350
194
  Relay infers the Git root, repository identity, exact pushed `HEAD`, and caller-relative
@@ -395,17 +239,6 @@ push-and-retry error. The temporary isolated
395
239
  Relaycast credential stays in the machine store under
396
240
  `~/.agentworkforce/relay`; the project file stores only a non-secret reference.
397
241
 
398
- `node agent attach <name>` automatically routes to the unique live fleet node
399
- advertising that worker. If more than one live node advertises the name, the
400
- command refuses to guess; pass `--node <node>` explicitly. Supplying
401
- `--broker-url`, `--api-key`, or `--state-dir`, or setting a nonblank
402
- `RELAY_BROKER_URL` or `RELAY_BROKER_API_KEY`, keeps attach local and bypasses
403
- automatic Fleet routing. `node agent message flush|hold|auto <name>` uses the
404
- same unique-node lookup when no local broker selection is supplied. Fleet list and
405
- release commands reuse the persisted project route; if that remote session is
406
- unavailable, the command reports the routing failure instead of selecting a
407
- same-named local worker.
408
-
409
242
  From a clean repository already pinned to a Relay workspace, the checkout-first
410
243
  path is:
411
244
 
@@ -414,7 +247,6 @@ agent-relay fleet spawn codex \
414
247
  --name cloud-zero-config \
415
248
  --task "Inspect this repository and report its current commit" \
416
249
  --sandbox
417
- agent-relay node agent attach cloud-zero-config --mode drive
418
250
  agent-relay fleet agent list
419
251
  agent-relay fleet release cloud-zero-config
420
252
  ```
@@ -460,9 +292,7 @@ placing `.git` in the mirror. When a live mount is requested at startup, workspa
460
292
  CLIs' usual skill directories, and the worker's task context identifies the
461
293
  mirror and exact source revision.
462
294
 
463
- Detaching leaves the worker running. Only one drive session can own a worker
464
- at a time; detach the current driver before driving it in another shell, or
465
- use `--mode view` to observe. Releasing a worker does not delete its sandbox.
295
+ Releasing a worker does not delete its sandbox.
466
296
  To resume its retained sandbox, repeat spawn with the reported
467
297
  `--sandbox-id <id>`; when using `--checkout`, the retained clone must still have
468
298
  the same clean HEAD.
@@ -517,32 +347,6 @@ back to the node process's own working directory.
517
347
  Omit it to start a new CLI session. The project’s Agent Relay workspace remains
518
348
  pinned independently until you explicitly create or select another workspace.
519
349
 
520
- To run as a Cloud-managed node, first redeem a one-time enrollment token, then start the node:
521
-
522
- ```bash
523
- agent-relay cloud enroll --token ocl_node_enr_...
524
- agent-relay node up
525
- ```
526
-
527
- With a stored `agent-relay cloud login` you can mint the token yourself instead.
528
- `cloud workspaces` lists the workspaces the login can use, and `--workspace`
529
- takes a name, a Cloud workspace UUID, or a unified `rw_` ID:
530
-
531
- ```bash
532
- agent-relay cloud workspaces
533
- # 50587328-441d-4acb-b8f3-dbe1b3c5de99 chief Chief HQ
534
-
535
- agent-relay cloud enroll --workspace "Chief HQ"
536
- agent-relay node up
537
- ```
538
-
539
- If `/api/session` reports node control as `terminal` with reason
540
- `env_override_rejected`, the active `RELAY_NODE_TOKEN` is stale and shadows a
541
- different credential in the broker's scoped cache. Re-enroll the Cloud node and
542
- restart it, or unset a manually exported `RELAY_NODE_TOKEN`. Deleting only the
543
- Relaycast node row is not enough for a Cloud-enrolled node: its Fleet enrollment
544
- record restores the stored token on the next `agent-relay node up`.
545
-
546
350
  `agent-relay cloud whoami` also prints the current organization and workspace IDs.
547
351
 
548
352
  ## Cloud multiplayer rooms
@@ -613,9 +417,9 @@ RELAYFILE_LOCAL_DIR="$PWD/.integrations" relayfile status
613
417
  RELAYFILE_LOCAL_DIR="$PWD/.integrations" relayfile writeback status
614
418
  ```
615
419
 
616
- Fleet workers can subscribe to provider feedback using their broker-assigned
617
- identity, including workers that the desktop session socket rejects with
618
- `not_a_relay_session`:
420
+ Relay workers can subscribe to provider feedback using their own identity
421
+ (`RELAY_AGENT_NAME`), including workers that the desktop session socket rejects
422
+ with `not_a_relay_session`:
619
423
 
620
424
  ```bash
621
425
  agent-relay integration subscribe github \
@@ -625,14 +429,15 @@ agent-relay integration subscribe github \
625
429
 
626
430
  `--to self` resolves `RELAY_AGENT_NAME` and uses the existing server-side agent
627
431
  subscription channel. It requires a connected provider, a compatible Relayfile
628
- daemon, and workspace-owner credentials, supplied to broker workers through their
432
+ daemon, and workspace-owner credentials, supplied to the worker through its
629
433
  environment. An agent token alone cannot provision subscriptions. This route does
630
434
  not depend on desktop Claude/Codex session discovery. From outside the worker,
631
- use `--to @worker-name` with the same workspace credentials. Events reach the
632
- worker through Relay's normal broker delivery; wait for pushed feedback instead
633
- of polling `gh`. `--to self` cannot be combined with `--spawn`.
435
+ use `--to @worker-name` with the same workspace credentials; the recipient must
436
+ already exist (`--spawn`, which launched it through the local broker, was
437
+ removed). Events reach the worker through Relay's normal delivery; wait for
438
+ pushed feedback instead of polling `gh`.
634
439
 
635
- `local` remains as a deprecated hidden alias of `node` (it prints a one-time warning).
440
+ `local` remains as a deprecated hidden alias of `node` for `local run|logs|sync` (it prints a one-time warning).
636
441
 
637
442
  Node workflow runs use Relayflows for YAML and TypeScript workflow files.
638
443
 
@@ -641,9 +446,12 @@ Hosted equivalents live under `agent-relay cloud …`.
641
446
  ## Packages
642
447
 
643
448
  - `@agent-relay/sdk`: messaging, delivery contracts, and actions.
644
- - `@agent-relay/harness-driver`: optional managed harness runtime.
645
449
  - `agent-relay`: CLI and MCP entry point.
646
450
 
451
+ `@agent-relay/harness-driver`, `@agent-relay/harnesses`, `@agent-relay/fleet`
452
+ and the `@agent-relay/broker-<platform>` packages were retired with the broker.
453
+ Their published versions stay installable from npm; no new versions ship.
454
+
647
455
  ### Pending fleet spawns and name reuse
648
456
 
649
457
  An accepted spawn whose result is still unknown returns `spawn_unconfirmed` with
@@ -1 +1 @@
1
- {"version":3,"file":"agent-relay-mcp.d.ts","sourceRoot":"","sources":["../../src/cli/agent-relay-mcp.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmEpE,OAAO,KAAK,EAEV,0BAA0B,EAC1B,SAAS,EAGT,mBAAmB,EACnB,aAAa,EACb,aAAa,EAEd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,eAAO,MAAM,uBAAuB,QACuC,CAAC;AAoU5E,eAAO,MAAM,4BAA4B,uxEAgCF,CAAC;AAiBxC,KAAK,2BAA2B,GAAG;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAcF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASrE;AAqCD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOjE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAMnF;AAsID,wBAAsB,uBAAuB,CAAC,EAC5C,OAAO,EACP,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+FhE;AAo3BD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CA0OxF;AAoMD,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CA0BrC;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChG;AAED,wBAAgB,cAAc,IAAI,0BAA0B,CAkD3D"}
1
+ {"version":3,"file":"agent-relay-mcp.d.ts","sourceRoot":"","sources":["../../src/cli/agent-relay-mcp.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmEpE,OAAO,KAAK,EAEV,0BAA0B,EAC1B,SAAS,EAGT,mBAAmB,EACnB,aAAa,EACb,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,eAAO,MAAM,uBAAuB,QACuC,CAAC;AAoU5E,eAAO,MAAM,4BAA4B,uxEAgCF,CAAC;AAiBxC,KAAK,2BAA2B,GAAG;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAcF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASrE;AAqCD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOjE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAMnF;AAsID,wBAAsB,uBAAuB,CAAC,EAC5C,OAAO,EACP,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,qBAAqB,GACtB,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+FhE;AAo3BD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CA0OxF;AAoMD,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CA0BrC;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChG;AAED,wBAAgB,cAAc,IAAI,0BAA0B,CAkD3D"}
@@ -30,6 +30,7 @@ import { McpRequestReplay, replayScopeForCredentials, withReplayScope } from './
30
30
  import { identityOverrideInputShape, messageResult } from './mcp/tool-shapes.js';
31
31
  import { registerSharedSessionTools, requireCompleteSharedSessionToolset, SharedSessionsMcpClient, } from './mcp/shared-sessions-client.js';
32
32
  import { describeClearedEnrollment, persistWorkspaceSession, resolveWorkspaceSessionKey, validateWorkspaceSessionName, } from './lib/workspace-session.js';
33
+ import { describeError } from './lib/describe-error.js';
33
34
  export const AGENT_RELAY_MCP_VERSION = process.env.AGENT_RELAY_CLI_VERSION ?? RELAYCAST_SDK_VERSION ?? 'unknown';
34
35
  let mcpTelemetryExitHookInstalled = false;
35
36
  const EXIT_AFTER_TASK_INSTRUCTION = '## Post-task exit\n' +
@@ -170,7 +171,7 @@ async function pollInvocation(actions, current, deadline) {
170
171
  }
171
172
  catch (error) {
172
173
  if (isInvocationAuthorizationError(error)) {
173
- throw new VerifiedSpawnError(`Spawn confirmation could not be read after acceptance (${error instanceof Error ? error.message : String(error)}). The invocation may still be running; do not retry without checking it first. Invocation: ${current.invocationId}.`, {
174
+ throw new VerifiedSpawnError(`Spawn confirmation could not be read after acceptance (${describeError(error)}). The invocation may still be running; do not retry without checking it first. Invocation: ${current.invocationId}.`, {
174
175
  code: 'spawn_unconfirmed',
175
176
  state: 'unconfirmed_may_be_running',
176
177
  invocationId: current.invocationId,
@@ -730,7 +731,7 @@ async function verifyMetadataLanded(relay, name, metadata, timeoutMs = DEFAULT_A
730
731
  agents = await withDeadline(() => relay.agents.list(), (effectiveTimeoutMs) => new Error(`Reading back the agent listing to verify metadata for "${name}" did not complete within ${effectiveTimeoutMs}ms.`), timeoutMs);
731
732
  }
732
733
  catch (error) {
733
- const detail = error instanceof Error ? error.message : String(error);
734
+ const detail = describeError(error);
734
735
  return {
735
736
  verified: false,
736
737
  warning: `Registered "${name}", but could not read the record back to confirm metadata landed: ${detail}`,
@@ -801,7 +802,7 @@ function registerAgentRelayTools(server, getRelay, getAgentClient, getSession, s
801
802
  persistenceWarning = describeClearedEnrollment(persistWorkspaceSession({ name: workspaceName, workspaceKey }));
802
803
  }
803
804
  catch (error) {
804
- const message = error instanceof Error ? error.message : String(error);
805
+ const message = describeError(error);
805
806
  persistenceWarning =
806
807
  `Workspace created, but its session could not be persisted locally: ${message}. ` +
807
808
  'Keep the returned workspace key and retry persistence before starting another session.';
@@ -867,7 +868,7 @@ function registerAgentRelayTools(server, getRelay, getAgentClient, getSession, s
867
868
  clearedEnrollmentWarning = describeClearedEnrollment(persistWorkspaceSession({ workspaceKey: key }));
868
869
  }
869
870
  catch (error) {
870
- const persistenceError = error instanceof Error ? error.message : String(error);
871
+ const persistenceError = describeError(error);
871
872
  persistenceWarning =
872
873
  `The workspace is active for this process, but its session could not be persisted locally: ` +
873
874
  `${persistenceError}. Retry persistence before restarting this MCP server.`;
@@ -1250,7 +1251,7 @@ function registerAgentRelayTools(server, getRelay, getAgentClient, getSession, s
1250
1251
  workspace = new AgentRelay({ workspaceKey: session.workspaceKey, baseUrl });
1251
1252
  }
1252
1253
  catch (error) {
1253
- unavailable = error instanceof Error ? error.message : String(error);
1254
+ unavailable = describeError(error);
1254
1255
  }
1255
1256
  const removal = workspace
1256
1257
  ? await waitForAgentRemoval({