agent-relay 17.2.0 → 18.0.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.
- package/README.md +45 -270
- package/dist/cli/agent-relay-mcp.d.ts.map +1 -1
- package/dist/cli/agent-relay-mcp.js +6 -5
- package/dist/cli/agent-relay-mcp.js.map +1 -1
- package/dist/cli/bootstrap.d.ts +1 -1
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +11 -29
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +3 -2
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/cloud-integration.d.ts.map +1 -1
- package/dist/cli/commands/cloud-integration.js +2 -1
- package/dist/cli/commands/cloud-integration.js.map +1 -1
- package/dist/cli/commands/cloud-room.d.ts.map +1 -1
- package/dist/cli/commands/cloud-room.js +2 -1
- package/dist/cli/commands/cloud-room.js.map +1 -1
- package/dist/cli/commands/cloud-v1-deprecations.d.ts +4 -6
- package/dist/cli/commands/cloud-v1-deprecations.d.ts.map +1 -1
- package/dist/cli/commands/cloud-v1-deprecations.js +4 -6
- package/dist/cli/commands/cloud-v1-deprecations.js.map +1 -1
- package/dist/cli/commands/cloud-worker.d.ts +1 -1
- package/dist/cli/commands/cloud-worker.d.ts.map +1 -1
- package/dist/cli/commands/cloud-worker.js +42 -31
- package/dist/cli/commands/cloud-worker.js.map +1 -1
- package/dist/cli/commands/cloud.d.ts.map +1 -1
- package/dist/cli/commands/cloud.js +6 -7
- package/dist/cli/commands/cloud.js.map +1 -1
- package/dist/cli/commands/core.d.ts +3 -91
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/core.js +5 -254
- package/dist/cli/commands/core.js.map +1 -1
- package/dist/cli/commands/fleet-agent.d.ts +9 -54
- package/dist/cli/commands/fleet-agent.d.ts.map +1 -1
- package/dist/cli/commands/fleet-agent.js +105 -314
- package/dist/cli/commands/fleet-agent.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +0 -3
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +48 -267
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/integration-cleanup-journal.d.ts +6 -2
- package/dist/cli/commands/integration-cleanup-journal.d.ts.map +1 -1
- package/dist/cli/commands/integration-cleanup-journal.js +611 -134
- package/dist/cli/commands/integration-cleanup-journal.js.map +1 -1
- package/dist/cli/commands/integration-recipient.d.ts +0 -17
- package/dist/cli/commands/integration-recipient.d.ts.map +1 -1
- package/dist/cli/commands/integration-recipient.js +1 -104
- package/dist/cli/commands/integration-recipient.js.map +1 -1
- package/dist/cli/commands/integration.d.ts +7 -3
- package/dist/cli/commands/integration.d.ts.map +1 -1
- package/dist/cli/commands/integration.js +37 -82
- package/dist/cli/commands/integration.js.map +1 -1
- package/dist/cli/commands/local-workflow.d.ts +1 -1
- package/dist/cli/commands/local-workflow.d.ts.map +1 -1
- package/dist/cli/commands/local-workflow.js +20 -6
- package/dist/cli/commands/local-workflow.js.map +1 -1
- package/dist/cli/commands/node.d.ts +18 -20
- package/dist/cli/commands/node.d.ts.map +1 -1
- package/dist/cli/commands/node.js +42 -272
- package/dist/cli/commands/node.js.map +1 -1
- package/dist/cli/commands/product-surfaces.js +4 -4
- package/dist/cli/commands/product-surfaces.js.map +1 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +2 -1
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/skills.d.ts.map +1 -1
- package/dist/cli/commands/skills.js +2 -1
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/status.d.ts +1 -7
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +2 -28
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/workspace.d.ts.map +1 -1
- package/dist/cli/commands/workspace.js +2 -2
- package/dist/cli/commands/workspace.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/agent-relay-cli-reentry.d.ts +37 -0
- package/dist/cli/lib/agent-relay-cli-reentry.d.ts.map +1 -0
- package/dist/cli/lib/agent-relay-cli-reentry.js +40 -0
- package/dist/cli/lib/agent-relay-cli-reentry.js.map +1 -0
- package/dist/cli/lib/agent-tools-mcp.d.ts.map +1 -1
- package/dist/cli/lib/agent-tools-mcp.js +3 -2
- package/dist/cli/lib/agent-tools-mcp.js.map +1 -1
- package/dist/cli/lib/core-maintenance.d.ts +2 -3
- package/dist/cli/lib/core-maintenance.d.ts.map +1 -1
- package/dist/cli/lib/core-maintenance.js +3 -37
- package/dist/cli/lib/core-maintenance.js.map +1 -1
- package/dist/cli/lib/desktop-presence.js +1 -1
- package/dist/cli/lib/desktop-presence.js.map +1 -1
- package/dist/cli/lib/install-paths.d.ts +100 -0
- package/dist/cli/lib/install-paths.d.ts.map +1 -0
- package/dist/cli/lib/install-paths.js +157 -0
- package/dist/cli/lib/install-paths.js.map +1 -0
- package/dist/cli/lib/product-surface-store.d.ts.map +1 -1
- package/dist/cli/lib/product-surface-store.js +4 -1
- package/dist/cli/lib/product-surface-store.js.map +1 -1
- package/dist/cli/lib/relay-node.d.ts +7 -34
- package/dist/cli/lib/relay-node.d.ts.map +1 -1
- package/dist/cli/lib/relay-node.js +7 -182
- package/dist/cli/lib/relay-node.js.map +1 -1
- package/dist/cli/lib/removed-broker-command.d.ts +7 -0
- package/dist/cli/lib/removed-broker-command.d.ts.map +1 -0
- package/dist/cli/lib/removed-broker-command.js +13 -0
- package/dist/cli/lib/removed-broker-command.js.map +1 -0
- package/dist/cli/lib/sdk-client.d.ts +4 -4
- package/dist/cli/lib/sdk-client.js +4 -4
- package/dist/cli/lib/self-update.d.ts +8 -19
- package/dist/cli/lib/self-update.d.ts.map +1 -1
- package/dist/cli/lib/self-update.js +14 -28
- package/dist/cli/lib/self-update.js.map +1 -1
- package/dist/cli/lib/skills-install.d.ts.map +1 -1
- package/dist/cli/lib/skills-install.js +3 -2
- package/dist/cli/lib/skills-install.js.map +1 -1
- package/dist/cli/telemetry/events.d.ts +4 -1
- package/dist/cli/telemetry/events.d.ts.map +1 -1
- package/package.json +10 -15
- package/dist/auto/classifier.d.ts +0 -29
- package/dist/auto/classifier.d.ts.map +0 -1
- package/dist/auto/classifier.js +0 -126
- package/dist/auto/classifier.js.map +0 -1
- package/dist/auto/composer.d.ts +0 -105
- package/dist/auto/composer.d.ts.map +0 -1
- package/dist/auto/composer.js +0 -454
- package/dist/auto/composer.js.map +0 -1
- package/dist/auto/director-prompt.d.ts +0 -25
- package/dist/auto/director-prompt.d.ts.map +0 -1
- package/dist/auto/director-prompt.js +0 -53
- package/dist/auto/director-prompt.js.map +0 -1
- package/dist/auto/index.d.ts +0 -15
- package/dist/auto/index.d.ts.map +0 -1
- package/dist/auto/index.js +0 -13
- package/dist/auto/index.js.map +0 -1
- package/dist/cli/commands/local-agent.d.ts +0 -74
- package/dist/cli/commands/local-agent.d.ts.map +0 -1
- package/dist/cli/commands/local-agent.js +0 -969
- package/dist/cli/commands/local-agent.js.map +0 -1
- package/dist/cli/lib/attach-broker.d.ts +0 -17
- package/dist/cli/lib/attach-broker.d.ts.map +0 -1
- package/dist/cli/lib/attach-broker.js +0 -27
- package/dist/cli/lib/attach-broker.js.map +0 -1
- package/dist/cli/lib/attach-drive.d.ts +0 -376
- package/dist/cli/lib/attach-drive.d.ts.map +0 -1
- package/dist/cli/lib/attach-drive.js +0 -1212
- package/dist/cli/lib/attach-drive.js.map +0 -1
- package/dist/cli/lib/attach-fleet-node.d.ts +0 -85
- package/dist/cli/lib/attach-fleet-node.d.ts.map +0 -1
- package/dist/cli/lib/attach-fleet-node.js +0 -1347
- package/dist/cli/lib/attach-fleet-node.js.map +0 -1
- package/dist/cli/lib/attach-input-recovery.d.ts +0 -190
- package/dist/cli/lib/attach-input-recovery.d.ts.map +0 -1
- package/dist/cli/lib/attach-input-recovery.js +0 -559
- package/dist/cli/lib/attach-input-recovery.js.map +0 -1
- package/dist/cli/lib/attach-mode.d.ts +0 -2
- package/dist/cli/lib/attach-mode.d.ts.map +0 -1
- package/dist/cli/lib/attach-mode.js +0 -2
- package/dist/cli/lib/attach-mode.js.map +0 -1
- package/dist/cli/lib/attach-native.d.ts +0 -27
- package/dist/cli/lib/attach-native.d.ts.map +0 -1
- package/dist/cli/lib/attach-native.js +0 -267
- package/dist/cli/lib/attach-native.js.map +0 -1
- package/dist/cli/lib/attach-passthrough.d.ts +0 -193
- package/dist/cli/lib/attach-passthrough.d.ts.map +0 -1
- package/dist/cli/lib/attach-passthrough.js +0 -778
- package/dist/cli/lib/attach-passthrough.js.map +0 -1
- package/dist/cli/lib/attach-remote-node.d.ts +0 -21
- package/dist/cli/lib/attach-remote-node.d.ts.map +0 -1
- package/dist/cli/lib/attach-remote-node.js +0 -133
- package/dist/cli/lib/attach-remote-node.js.map +0 -1
- package/dist/cli/lib/attach-view.d.ts +0 -177
- package/dist/cli/lib/attach-view.d.ts.map +0 -1
- package/dist/cli/lib/attach-view.js +0 -455
- package/dist/cli/lib/attach-view.js.map +0 -1
- package/dist/cli/lib/attach.d.ts +0 -555
- package/dist/cli/lib/attach.d.ts.map +0 -1
- package/dist/cli/lib/attach.js +0 -1180
- package/dist/cli/lib/attach.js.map +0 -1
- package/dist/cli/lib/broker-connection.d.ts +0 -65
- package/dist/cli/lib/broker-connection.d.ts.map +0 -1
- package/dist/cli/lib/broker-connection.js +0 -144
- package/dist/cli/lib/broker-connection.js.map +0 -1
- package/dist/cli/lib/broker-lifecycle.d.ts +0 -220
- package/dist/cli/lib/broker-lifecycle.d.ts.map +0 -1
- package/dist/cli/lib/broker-lifecycle.js +0 -2290
- package/dist/cli/lib/broker-lifecycle.js.map +0 -1
- package/dist/cli/lib/broker-process-identity.d.ts +0 -38
- package/dist/cli/lib/broker-process-identity.d.ts.map +0 -1
- package/dist/cli/lib/broker-process-identity.js +0 -304
- package/dist/cli/lib/broker-process-identity.js.map +0 -1
- package/dist/cli/lib/client-factory.d.ts +0 -44
- package/dist/cli/lib/client-factory.d.ts.map +0 -1
- package/dist/cli/lib/client-factory.js +0 -64
- package/dist/cli/lib/client-factory.js.map +0 -1
- package/dist/cli/lib/collect-with-retry.d.ts +0 -24
- package/dist/cli/lib/collect-with-retry.d.ts.map +0 -1
- package/dist/cli/lib/collect-with-retry.js +0 -33
- package/dist/cli/lib/collect-with-retry.js.map +0 -1
- package/dist/cli/lib/fleet-attach-target.d.ts +0 -18
- package/dist/cli/lib/fleet-attach-target.d.ts.map +0 -1
- package/dist/cli/lib/fleet-attach-target.js +0 -57
- package/dist/cli/lib/fleet-attach-target.js.map +0 -1
- package/dist/cli/lib/fleet-hint.d.ts +0 -49
- package/dist/cli/lib/fleet-hint.d.ts.map +0 -1
- package/dist/cli/lib/fleet-hint.js +0 -113
- package/dist/cli/lib/fleet-hint.js.map +0 -1
- package/dist/cli/lib/fleet-sidecar.d.ts +0 -43
- package/dist/cli/lib/fleet-sidecar.d.ts.map +0 -1
- package/dist/cli/lib/fleet-sidecar.js +0 -84
- package/dist/cli/lib/fleet-sidecar.js.map +0 -1
- package/dist/cli/lib/join-ticket.d.ts +0 -22
- package/dist/cli/lib/join-ticket.d.ts.map +0 -1
- package/dist/cli/lib/join-ticket.js +0 -96
- package/dist/cli/lib/join-ticket.js.map +0 -1
- package/dist/cli/lib/node-claim.d.ts +0 -468
- package/dist/cli/lib/node-claim.d.ts.map +0 -1
- package/dist/cli/lib/node-claim.js +0 -1349
- package/dist/cli/lib/node-claim.js.map +0 -1
- package/dist/cli/lib/node-definition-loader.d.ts +0 -19
- package/dist/cli/lib/node-definition-loader.d.ts.map +0 -1
- package/dist/cli/lib/node-definition-loader.js +0 -143
- package/dist/cli/lib/node-definition-loader.js.map +0 -1
- package/dist/cli/lib/node-provider-child.d.ts +0 -129
- package/dist/cli/lib/node-provider-child.d.ts.map +0 -1
- package/dist/cli/lib/node-provider-child.js +0 -755
- package/dist/cli/lib/node-provider-child.js.map +0 -1
- package/dist/cli/lib/predictive-echo-screen.d.ts +0 -48
- package/dist/cli/lib/predictive-echo-screen.d.ts.map +0 -1
- package/dist/cli/lib/predictive-echo-screen.js +0 -74
- package/dist/cli/lib/predictive-echo-screen.js.map +0 -1
- package/dist/cli/lib/project-broker-client.d.ts +0 -4
- package/dist/cli/lib/project-broker-client.d.ts.map +0 -1
- package/dist/cli/lib/project-broker-client.js +0 -12
- package/dist/cli/lib/project-broker-client.js.map +0 -1
- package/dist/cli/lib/reflex-capture.d.ts +0 -41
- package/dist/cli/lib/reflex-capture.d.ts.map +0 -1
- package/dist/cli/lib/reflex-capture.js +0 -128
- package/dist/cli/lib/reflex-capture.js.map +0 -1
- package/dist/cli/lib/workspace-env.d.ts +0 -8
- package/dist/cli/lib/workspace-env.d.ts.map +0 -1
- package/dist/cli/lib/workspace-env.js +0 -16
- 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
|
|
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,39 @@ npm install -g agent-relay
|
|
|
13
13
|
## Common commands
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
agent-relay
|
|
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
|
-
##
|
|
24
|
+
## Agents on this machine
|
|
24
25
|
|
|
25
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
49
|
-
|
|
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`.
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
```
|
|
45
|
+
### Workspace selection
|
|
62
46
|
|
|
63
|
-
|
|
64
|
-
|
|
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:
|
|
47
|
+
Commands resolve the workspace through one precedence ladder. The first source
|
|
48
|
+
that resolves wins:
|
|
122
49
|
|
|
123
50
|
| # | Source | Where it comes from |
|
|
124
51
|
| --- | ------------------------------- | ----------------------------------------------------------------------------- |
|
|
@@ -126,105 +53,10 @@ precedence ladder. The first source that resolves wins:
|
|
|
126
53
|
| 2 | Environment | `RELAY_WORKSPACE_KEY`, then `AGENT_RELAY_WORKSPACE_KEY`, then `RELAY_API_KEY` |
|
|
127
54
|
| 3 | Repository pin | `<project>/.agentworkforce/relay/workspace-key.json` |
|
|
128
55
|
| 4 | Machine-global active workspace | the `active` entry in `~/.agentworkforce/relay/workspaces.json` |
|
|
129
|
-
| 5 | Created workspace | created only when nothing above resolves |
|
|
130
56
|
|
|
131
57
|
The repository pin always beats the machine-global active workspace, so
|
|
132
58
|
`agent-relay workspace switch <name>` never silently re-homes a checkout that
|
|
133
|
-
already pinned one.
|
|
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.
|
|
59
|
+
already pinned one.
|
|
228
60
|
|
|
229
61
|
`workspace create`, `join`, and `switch` select a named workspace globally and
|
|
230
62
|
pin it to the current project. A changed selection records the old name, so an
|
|
@@ -234,27 +66,14 @@ accidental create can be undone:
|
|
|
234
66
|
agent-relay workspace restore
|
|
235
67
|
```
|
|
236
68
|
|
|
237
|
-
To change only the workspace this project
|
|
238
|
-
|
|
69
|
+
To change only the workspace this project uses, without changing the
|
|
70
|
+
machine-global active workspace, use:
|
|
239
71
|
|
|
240
72
|
```bash
|
|
241
73
|
agent-relay workspace rebind default
|
|
242
|
-
agent-relay node down
|
|
243
|
-
agent-relay node up
|
|
244
74
|
```
|
|
245
75
|
|
|
246
|
-
|
|
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.
|
|
251
|
-
|
|
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.
|
|
256
|
-
|
|
257
|
-
## Local and remote fleet agents
|
|
76
|
+
## Fleet agents
|
|
258
77
|
|
|
259
78
|
The `fleet` command group lists and controls agents across all live nodes in
|
|
260
79
|
the active project workspace:
|
|
@@ -278,9 +97,6 @@ agent-relay fleet spawn codex \
|
|
|
278
97
|
--node sf-mini \
|
|
279
98
|
--session-ref <actual-codex-thread-id>
|
|
280
99
|
|
|
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
100
|
# Opt into automatic eligible-node placement.
|
|
285
101
|
agent-relay fleet spawn codex --name api-worker --task "Review the current diff." --auto-place
|
|
286
102
|
|
|
@@ -292,8 +108,6 @@ agent-relay fleet spawn codex \
|
|
|
292
108
|
--name e2b-worker \
|
|
293
109
|
--task "Review the current workspace and wait for follow-up."
|
|
294
110
|
|
|
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
111
|
|
|
298
112
|
agent-relay message dm send api-worker "Detailed task instructions"
|
|
299
113
|
# wait is the default: it queues for the recipient's next safe idle boundary and
|
|
@@ -334,17 +148,14 @@ confirmed), `failed` (the node reported a terminal failure), `accepted`
|
|
|
334
148
|
still has not reported — not evidence that nothing started). Polling never
|
|
335
149
|
dispatches another agent.
|
|
336
150
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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.
|
|
151
|
+
`fleet spawn` needs a placement: `--node`, `--auto-place`, or `--sandbox`.
|
|
152
|
+
Spawning on this machine without one went away with the local broker; the
|
|
153
|
+
command now says so and points to `relay init`, whose core spawns agents here.
|
|
154
|
+
Invocations with an explicit `--workspace-key`/`--wk`, `--token`,
|
|
155
|
+
`--base-url`, or `--persona` keep automatic fleet placement when no node or
|
|
156
|
+
sandbox is selected. Ambient credentials and persisted Cloud routing never turn
|
|
157
|
+
a flag-free spawn remote. Automatic placement and release need only the
|
|
158
|
+
workspace key.
|
|
348
159
|
|
|
349
160
|
The sandbox path provisions a fresh hosted instance. Inside a GitHub checkout,
|
|
350
161
|
Relay infers the Git root, repository identity, exact pushed `HEAD`, and caller-relative
|
|
@@ -395,17 +206,6 @@ push-and-retry error. The temporary isolated
|
|
|
395
206
|
Relaycast credential stays in the machine store under
|
|
396
207
|
`~/.agentworkforce/relay`; the project file stores only a non-secret reference.
|
|
397
208
|
|
|
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
209
|
From a clean repository already pinned to a Relay workspace, the checkout-first
|
|
410
210
|
path is:
|
|
411
211
|
|
|
@@ -414,7 +214,6 @@ agent-relay fleet spawn codex \
|
|
|
414
214
|
--name cloud-zero-config \
|
|
415
215
|
--task "Inspect this repository and report its current commit" \
|
|
416
216
|
--sandbox
|
|
417
|
-
agent-relay node agent attach cloud-zero-config --mode drive
|
|
418
217
|
agent-relay fleet agent list
|
|
419
218
|
agent-relay fleet release cloud-zero-config
|
|
420
219
|
```
|
|
@@ -460,9 +259,7 @@ placing `.git` in the mirror. When a live mount is requested at startup, workspa
|
|
|
460
259
|
CLIs' usual skill directories, and the worker's task context identifies the
|
|
461
260
|
mirror and exact source revision.
|
|
462
261
|
|
|
463
|
-
|
|
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.
|
|
262
|
+
Releasing a worker does not delete its sandbox.
|
|
466
263
|
To resume its retained sandbox, repeat spawn with the reported
|
|
467
264
|
`--sandbox-id <id>`; when using `--checkout`, the retained clone must still have
|
|
468
265
|
the same clean HEAD.
|
|
@@ -517,32 +314,6 @@ back to the node process's own working directory.
|
|
|
517
314
|
Omit it to start a new CLI session. The project’s Agent Relay workspace remains
|
|
518
315
|
pinned independently until you explicitly create or select another workspace.
|
|
519
316
|
|
|
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
317
|
`agent-relay cloud whoami` also prints the current organization and workspace IDs.
|
|
547
318
|
|
|
548
319
|
## Cloud multiplayer rooms
|
|
@@ -613,9 +384,9 @@ RELAYFILE_LOCAL_DIR="$PWD/.integrations" relayfile status
|
|
|
613
384
|
RELAYFILE_LOCAL_DIR="$PWD/.integrations" relayfile writeback status
|
|
614
385
|
```
|
|
615
386
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
`not_a_relay_session`:
|
|
387
|
+
Relay workers can subscribe to provider feedback using their own identity
|
|
388
|
+
(`RELAY_AGENT_NAME`), including workers that the desktop session socket rejects
|
|
389
|
+
with `not_a_relay_session`:
|
|
619
390
|
|
|
620
391
|
```bash
|
|
621
392
|
agent-relay integration subscribe github \
|
|
@@ -625,14 +396,15 @@ agent-relay integration subscribe github \
|
|
|
625
396
|
|
|
626
397
|
`--to self` resolves `RELAY_AGENT_NAME` and uses the existing server-side agent
|
|
627
398
|
subscription channel. It requires a connected provider, a compatible Relayfile
|
|
628
|
-
daemon, and workspace-owner credentials, supplied to
|
|
399
|
+
daemon, and workspace-owner credentials, supplied to the worker through its
|
|
629
400
|
environment. An agent token alone cannot provision subscriptions. This route does
|
|
630
401
|
not depend on desktop Claude/Codex session discovery. From outside the worker,
|
|
631
|
-
use `--to @worker-name` with the same workspace credentials
|
|
632
|
-
|
|
633
|
-
|
|
402
|
+
use `--to @worker-name` with the same workspace credentials; the recipient must
|
|
403
|
+
already exist (`--spawn`, which launched it through the local broker, was
|
|
404
|
+
removed). Events reach the worker through Relay's normal delivery; wait for
|
|
405
|
+
pushed feedback instead of polling `gh`.
|
|
634
406
|
|
|
635
|
-
`local` remains as a deprecated hidden alias of `node` (it prints a one-time warning).
|
|
407
|
+
`local` remains as a deprecated hidden alias of `node` for `local run|logs|sync` (it prints a one-time warning).
|
|
636
408
|
|
|
637
409
|
Node workflow runs use Relayflows for YAML and TypeScript workflow files.
|
|
638
410
|
|
|
@@ -641,9 +413,12 @@ Hosted equivalents live under `agent-relay cloud …`.
|
|
|
641
413
|
## Packages
|
|
642
414
|
|
|
643
415
|
- `@agent-relay/sdk`: messaging, delivery contracts, and actions.
|
|
644
|
-
- `@agent-relay/harness-driver`: optional managed harness runtime.
|
|
645
416
|
- `agent-relay`: CLI and MCP entry point.
|
|
646
417
|
|
|
418
|
+
`@agent-relay/harness-driver`, `@agent-relay/harnesses`, `@agent-relay/fleet`
|
|
419
|
+
and the `@agent-relay/broker-<platform>` packages were retired with the broker.
|
|
420
|
+
Their published versions stay installable from npm; no new versions ship.
|
|
421
|
+
|
|
647
422
|
### Pending fleet spawns and name reuse
|
|
648
423
|
|
|
649
424
|
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;
|
|
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 (${
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
1254
|
+
unavailable = describeError(error);
|
|
1254
1255
|
}
|
|
1255
1256
|
const removal = workspace
|
|
1256
1257
|
? await waitForAgentRemoval({
|