feat: add agent relay bridge plugin

Merged
KH
3mo ago
+1333-0

Summary

  • add an optional Node 22 Herdr pane plugin backed by @agent-relay/sdk
  • forward status transitions only for explicitly configured Herdr workspaces to an existing Relay channel
  • expose a read-only herdr.session_summary action with strict input/output schemas
  • reconnect through a private persisted token, serialize state writes, retry failed delivery safely, and prevent duplicate bridge processes
  • keep pane output, cwd, environment, titles, prompts, shell input, and raw socket controls outside the integration boundary
  • test the plugin on Linux, macOS, and Windows with full-SHA-pinned Actions

Validation

  • mise x node@22 -- node --test — 9/9 passed
  • npm audit --omit=dev --audit-level=high — 0 vulnerabilities
  • syntax checks for all plugin modules — passed
  • actionlint .github/workflows/agent-relay-plugin.yml — passed
  • git diff --check — passed
  • isolated public install from AgentWorkforce/herdr/plugins/agent-relay --ref feat/agent-relay-sdk — passed at b033ea3
  • hosted core checks on Ubuntu, macOS, and Windows — passed

Scope and workflow

The stable root docs/changelog are intentionally unchanged; setup and security documentation is plugin-local. The implementation was built by a Fleet team on finn-mini, transferred with checksums over Agent Relay, and independently reviewed across Fleet nodes without SSH.


Summary by cubic

Adds the optional agent-relay.herdr-bridge plugin to forward selected Herdr agent status updates to Agent Relay and provide a read-only herdr.session_summary action. Improves restart reliability and hardens runtime/tests; core behavior is unchanged.

  • New Features

    • Node 22 sidecar using @agent-relay/sdk forwards pane.agent_status_changed for allowlisted workspaceIds to the configured channel, and registers herdr.session_summary with strict input/output schemas.
    • Simple config via agent-relay.json (workspaceKey, HTTPS baseUrl with loopback exception, #channel, unique workspaceIds); includes plugin manifest, README, and a CI workflow running tests on Linux/macOS/Windows.
  • Safety and Reliability

    • Avoids lifecycle replay loops by rebuilding per-pane subscriptions from session.snapshot; auto-resubscribes on socket drop; supports Windows named pipe sockets.
    • Persists and reuses the Relay agent token; prevents duplicate bridge processes with a state lock and secure file permissions; releases the lock early for fast restarts and cleans up stale/stuck locks.
    • Idempotent, deduped transitions per pane with rollback on delivery failure; serialized state writes; keeps pane output, cwd, environment, titles, prompts, shell input, and raw socket controls outside the integration boundary.
    • Scopes the lifecycle-replay test fixture to its specific test to avoid cross-test replays.