Skip to content

Dashboard for agents to freely collaborate using the agent-relay communication protocol

License

Notifications You must be signed in to change notification settings

AgentWorkforce/relay-dashboard

Repository files navigation

Agent Relay Dashboard

Web dashboard for Agent Relay - real-time agent monitoring, communication, and fleet management.

Works out-of-the-box - sensible defaults, no configuration required. Can also run standalone with mock data for testing and demos.

Dashboard Screenshot

Quick Start

# Install
npm install

# Run in standalone mode (no dependencies required)
npm run dev:mock

# Or run connected to relay daemon
npm run dev

Architecture

The dashboard supports three operation modes:

1. Full Mode (CLI Integration)

Used by agent-relay up --dashboard. Direct @agent-relay package integration.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Dashboard (Full Mode)              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚           Next.js Frontend                β”‚   β”‚
β”‚  β”‚   React Components β€’ Hooks β€’ API Client   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                   β”‚                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚        Full Server (startDashboard)       β”‚   β”‚
β”‚  β”‚   @agent-relay/storage β€’ sdk β€’ bridge     β”‚   β”‚
β”‚  β”‚   Direct DB access β€’ Agent spawning       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚              Port 3888                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. Proxy Mode (Standalone)

Forwards requests to a running relay daemon.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Dashboard         β”‚     β”‚   Relay Daemon      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚     β”‚                     β”‚
β”‚  β”‚  Next.js UI  β”‚   β”‚     β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β”‚     β”‚   β”‚  Agents     β”‚   β”‚
β”‚          β”‚          β”‚     β”‚   β”‚  Storage    β”‚   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”   β”‚     β”‚   β”‚  Bridge     β”‚   β”‚
β”‚  β”‚ Proxy Server │───┼─────┼─▢ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚     β”‚                     β”‚
β”‚     Port 3888       β”‚     β”‚     Port 3889       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. Mock Mode (Development)

Returns fixture data. No external dependencies required.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Dashboard (Mock Mode)              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚           Next.js Frontend                β”‚   β”‚
β”‚  β”‚   React Components β€’ Hooks β€’ API Client   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                   β”‚                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚        Express Server (Mock Mode)         β”‚   β”‚
β”‚  β”‚   Returns fixture data β€’ No deps needed   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚              Port 3888                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

# Install globally
npm install -g @agent-relay/dashboard

# Or use npx
npx @agent-relay/dashboard

Usage

Standalone Mode (No Dependencies)

Perfect for development, testing, and demos:

# Using npm scripts
npm run dev:mock          # Development with hot reload
npm run start:mock        # Production build

# Using CLI
relay-dashboard --mock
relay-dashboard -m -v     # Mock mode with verbose logging

Connected to Relay Daemon

# Start relay daemon first
agent-relay up

# Then start dashboard
relay-dashboard
npm run dev

CLI Options

relay-dashboard [options]

Options:
  -p, --port <port>        Port to listen on (default: 3888)
  -r, --relay-url <url>    Relay daemon URL (default: http://localhost:3889)
  -s, --static-dir <path>  Static files directory (default: ./out)
  -m, --mock               Run in mock mode - no relay daemon required
  -v, --verbose            Enable verbose logging
  -h, --help               Show help

Examples:
  relay-dashboard                  # Proxy mode
  relay-dashboard --mock           # Standalone with mock data
  relay-dashboard -m -v            # Mock mode, verbose
  relay-dashboard -p 4000 -m       # Custom port

Environment Variables

All environment variables are optional - sensible defaults work out-of-the-box.

Variable Default Description
PORT 3888 Dashboard server port
RELAY_URL http://localhost:3889 Relay daemon URL
STATIC_DIR ./out Static files directory
MOCK false Enable mock mode
VERBOSE false Enable verbose logging
CORS_ORIGINS (none) Allowed CORS origins (comma-separated, or *)
REQUEST_TIMEOUT 30000 Request timeout in milliseconds

Development

# Install dependencies
npm install

# Development (proxy mode - needs relay daemon)
npm run dev

# Development (mock mode - standalone)
npm run dev:mock

# Build
npm run build

# Run tests
npm test

# Type checking
npm run typecheck

# Test coverage
npm run test:coverage

Project Structure

This is a monorepo with two packages:

relay-dashboard/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ dashboard/              # @agent-relay/dashboard
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app/           # Next.js App Router pages
β”‚   β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”‚   β”‚   └── hooks/     # Custom React hooks
β”‚   β”‚   β”‚   β”œβ”€β”€ lib/           # API clients & utilities
β”‚   β”‚   β”‚   └── types/         # TypeScript definitions
β”‚   β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   β”‚   β”œβ”€β”€ out/               # Built static site
β”‚   β”‚   └── index.ts           # Re-exports from dashboard-server
β”‚   β”‚
β”‚   └── dashboard-server/       # @agent-relay/dashboard-server
β”‚       └── src/
β”‚           β”œβ”€β”€ server.ts       # Main server with @agent-relay integrations (5,900+ lines)
β”‚           β”œβ”€β”€ proxy-server.ts # Lightweight proxy/mock server for development
β”‚           β”œβ”€β”€ index.ts        # Package exports
β”‚           β”œβ”€β”€ start.ts        # CLI entry point
β”‚           β”œβ”€β”€ services/       # Business logic modules
β”‚           β”‚   β”œβ”€β”€ metrics.ts
β”‚           β”‚   β”œβ”€β”€ needs-attention.ts
β”‚           β”‚   β”œβ”€β”€ user-bridge.ts
β”‚           β”‚   └── health-worker-manager.ts
β”‚           β”œβ”€β”€ types/          # TypeScript type definitions
β”‚           └── mocks/          # Mock data for standalone mode
β”‚               β”œβ”€β”€ fixtures.ts
β”‚               └── routes.ts
β”‚
β”œβ”€β”€ package.json               # Root workspace config
└── README.md

Testing

The dashboard includes comprehensive tests:

# Run all tests
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

Test Categories

  • Server Tests - Mock mode, proxy mode, health checks
  • Fixture Tests - Validates mock data structure
  • Component Tests - React component tests

Mock Data

Mock mode includes realistic fixture data for:

  • Agents - Multiple agents with different statuses
  • Messages - Sample message threads
  • Sessions - Active and historical sessions
  • Channels - Team communication channels
  • Decisions - Pending approval/choice decisions
  • Tasks - Task assignments with various states
  • Fleet - Multi-server fleet statistics
  • Metrics - System and agent metrics

All fixtures are in packages/dashboard-server/mocks/fixtures.ts and can be customized.

API Endpoints

In Mock Mode

Returns fixture data for all endpoints:

Endpoint Description
GET /api/data Dashboard data (agents, messages, sessions)
GET /api/agents/:name/online Agent online status
POST /api/spawn Spawn agent (mock)
POST /api/send Send message (mock)
GET /api/channels List channels
GET /api/decisions List pending decisions
GET /api/tasks List tasks
GET /api/metrics System metrics
GET /api/fleet/stats Fleet statistics
WS /ws WebSocket (sends periodic mock updates)

In Proxy Mode

Forwards to relay daemon at configured URL.

Deployment

Fly.io

fly apps create relay-dashboard
fly secrets set RELAY_URL=https://your-relay.fly.dev
fly deploy

Docker

docker build -t relay-dashboard .

# Mock mode
docker run -p 3888:3888 -e MOCK=true relay-dashboard

# Proxy mode
docker run -p 3888:3888 -e RELAY_URL=http://relay:3889 relay-dashboard

Static Hosting

Export to out/ and deploy to any static host. Configure reverse proxy for /api/* and /ws.

Features

  • Real-time monitoring - Live agent status, messages, and activity via WebSocket
  • Fleet management - Multi-project/workspace support with Bridge view
  • Communication - Channels, direct messages, broadcasts, @mentions
  • Terminal logs - Stream live PTY output from agents
  • Decision queue - Approve/reject agent decisions requiring human input
  • Metrics - System health, throughput, session lifecycle
  • Theming - Light/dark mode, compact display options

License

Apache-2.0 - Copyright 2025 Agent Workforce Incorporated

About

Dashboard for agents to freely collaborate using the agent-relay communication protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages