agent-relay 1.0.8 → 1.0.9

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 (113) hide show
  1. package/README.md +158 -0
  2. package/dist/bridge/config.d.ts +41 -0
  3. package/dist/bridge/config.d.ts.map +1 -0
  4. package/dist/bridge/config.js +143 -0
  5. package/dist/bridge/config.js.map +1 -0
  6. package/dist/bridge/index.d.ts +10 -0
  7. package/dist/bridge/index.d.ts.map +1 -0
  8. package/dist/bridge/index.js +10 -0
  9. package/dist/bridge/index.js.map +1 -0
  10. package/dist/bridge/multi-project-client.d.ts +99 -0
  11. package/dist/bridge/multi-project-client.d.ts.map +1 -0
  12. package/dist/bridge/multi-project-client.js +386 -0
  13. package/dist/bridge/multi-project-client.js.map +1 -0
  14. package/dist/bridge/spawner.d.ts +46 -0
  15. package/dist/bridge/spawner.d.ts.map +1 -0
  16. package/dist/bridge/spawner.js +223 -0
  17. package/dist/bridge/spawner.js.map +1 -0
  18. package/dist/bridge/types.d.ts +55 -0
  19. package/dist/bridge/types.d.ts.map +1 -0
  20. package/dist/bridge/types.js +6 -0
  21. package/dist/bridge/types.js.map +1 -0
  22. package/dist/bridge/utils.d.ts +30 -0
  23. package/dist/bridge/utils.d.ts.map +1 -0
  24. package/dist/bridge/utils.js +54 -0
  25. package/dist/bridge/utils.js.map +1 -0
  26. package/dist/cli/index.js +564 -5
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/daemon/agent-registry.d.ts.map +1 -1
  29. package/dist/daemon/agent-registry.js +6 -1
  30. package/dist/daemon/agent-registry.js.map +1 -1
  31. package/dist/daemon/connection.d.ts +22 -0
  32. package/dist/daemon/connection.d.ts.map +1 -1
  33. package/dist/daemon/connection.js +59 -13
  34. package/dist/daemon/connection.js.map +1 -1
  35. package/dist/daemon/router.d.ts +27 -0
  36. package/dist/daemon/router.d.ts.map +1 -1
  37. package/dist/daemon/router.js +108 -3
  38. package/dist/daemon/router.js.map +1 -1
  39. package/dist/daemon/server.d.ts +8 -0
  40. package/dist/daemon/server.d.ts.map +1 -1
  41. package/dist/daemon/server.js +95 -23
  42. package/dist/daemon/server.js.map +1 -1
  43. package/dist/dashboard/metrics.d.ts +105 -0
  44. package/dist/dashboard/metrics.d.ts.map +1 -0
  45. package/dist/dashboard/metrics.js +192 -0
  46. package/dist/dashboard/metrics.js.map +1 -0
  47. package/dist/dashboard/needs-attention.d.ts +24 -0
  48. package/dist/dashboard/needs-attention.d.ts.map +1 -0
  49. package/dist/dashboard/needs-attention.js +78 -0
  50. package/dist/dashboard/needs-attention.js.map +1 -0
  51. package/dist/dashboard/public/bridge.html +1272 -0
  52. package/dist/dashboard/public/index.html +2017 -879
  53. package/dist/dashboard/public/js/app.js +184 -0
  54. package/dist/dashboard/public/js/app.js.map +7 -0
  55. package/dist/dashboard/public/metrics.html +999 -0
  56. package/dist/dashboard/server.d.ts +13 -0
  57. package/dist/dashboard/server.d.ts.map +1 -1
  58. package/dist/dashboard/server.js +568 -13
  59. package/dist/dashboard/server.js.map +1 -1
  60. package/dist/dashboard/start.js +1 -1
  61. package/dist/dashboard/start.js.map +1 -1
  62. package/dist/dashboard-v2/index.d.ts +10 -0
  63. package/dist/dashboard-v2/index.d.ts.map +1 -0
  64. package/dist/dashboard-v2/index.js +54 -0
  65. package/dist/dashboard-v2/index.js.map +1 -0
  66. package/dist/dashboard-v2/lib/api.d.ts +95 -0
  67. package/dist/dashboard-v2/lib/api.d.ts.map +1 -0
  68. package/dist/dashboard-v2/lib/api.js +270 -0
  69. package/dist/dashboard-v2/lib/api.js.map +1 -0
  70. package/dist/dashboard-v2/lib/colors.d.ts +61 -0
  71. package/dist/dashboard-v2/lib/colors.d.ts.map +1 -0
  72. package/dist/dashboard-v2/lib/colors.js +198 -0
  73. package/dist/dashboard-v2/lib/colors.js.map +1 -0
  74. package/dist/dashboard-v2/lib/hierarchy.d.ts +74 -0
  75. package/dist/dashboard-v2/lib/hierarchy.d.ts.map +1 -0
  76. package/dist/dashboard-v2/lib/hierarchy.js +196 -0
  77. package/dist/dashboard-v2/lib/hierarchy.js.map +1 -0
  78. package/dist/dashboard-v2/types/index.d.ts +154 -0
  79. package/dist/dashboard-v2/types/index.d.ts.map +1 -0
  80. package/dist/dashboard-v2/types/index.js +6 -0
  81. package/dist/dashboard-v2/types/index.js.map +1 -0
  82. package/dist/storage/adapter.d.ts +21 -1
  83. package/dist/storage/adapter.d.ts.map +1 -1
  84. package/dist/storage/adapter.js +36 -0
  85. package/dist/storage/adapter.js.map +1 -1
  86. package/dist/storage/sqlite-adapter.d.ts +34 -0
  87. package/dist/storage/sqlite-adapter.d.ts.map +1 -1
  88. package/dist/storage/sqlite-adapter.js +253 -12
  89. package/dist/storage/sqlite-adapter.js.map +1 -1
  90. package/dist/utils/agent-config.d.ts +45 -0
  91. package/dist/utils/agent-config.d.ts.map +1 -0
  92. package/dist/utils/agent-config.js +118 -0
  93. package/dist/utils/agent-config.js.map +1 -0
  94. package/dist/wrapper/client.d.ts +8 -0
  95. package/dist/wrapper/client.d.ts.map +1 -1
  96. package/dist/wrapper/client.js +26 -0
  97. package/dist/wrapper/client.js.map +1 -1
  98. package/dist/wrapper/parser.d.ts +17 -0
  99. package/dist/wrapper/parser.d.ts.map +1 -1
  100. package/dist/wrapper/parser.js +334 -10
  101. package/dist/wrapper/parser.js.map +1 -1
  102. package/dist/wrapper/tmux-wrapper.d.ts +37 -2
  103. package/dist/wrapper/tmux-wrapper.d.ts.map +1 -1
  104. package/dist/wrapper/tmux-wrapper.js +178 -18
  105. package/dist/wrapper/tmux-wrapper.js.map +1 -1
  106. package/docs/AGENTS.md +105 -0
  107. package/docs/ARCHITECTURE_DECISIONS.md +175 -0
  108. package/docs/COMPETITIVE_ANALYSIS.md +897 -0
  109. package/docs/DESIGN_BRIDGE_STAFFING.md +878 -0
  110. package/docs/MONETIZATION.md +1679 -0
  111. package/docs/agent-relay-snippet.md +61 -0
  112. package/docs/dashboard-v2-plan.md +179 -0
  113. package/package.json +5 -2
@@ -0,0 +1,61 @@
1
+ # Agent Relay
2
+
3
+ Real-time agent-to-agent messaging. Output `->relay:` patterns to communicate.
4
+
5
+ ## Sending Messages
6
+
7
+ ```
8
+ ->relay:AgentName Your message here
9
+ ->relay:* Broadcast to all agents
10
+ ```
11
+
12
+ ### Multi-line Messages
13
+
14
+ For messages with blank lines or code:
15
+
16
+ ```
17
+ ->relay:AgentName <<<
18
+ Your multi-line message here.
19
+
20
+ Can include blank lines and code.
21
+ >>>
22
+ ```
23
+
24
+ **CRITICAL:** Always end with `>>>` on its own line!
25
+
26
+ ## Receiving Messages
27
+
28
+ Messages appear as:
29
+ ```
30
+ Relay message from Alice [abc123]: Message content here
31
+ ```
32
+
33
+ If truncated, read full message:
34
+ ```bash
35
+ agent-relay read abc123
36
+ ```
37
+
38
+ ## Spawning Agents
39
+
40
+ Spawn workers to delegate tasks:
41
+
42
+ ```
43
+ ->relay:spawn WorkerName claude "task description"
44
+ ->relay:release WorkerName
45
+ ```
46
+
47
+ ## Common Patterns
48
+
49
+ ```
50
+ ->relay:* STATUS: Starting work on auth module
51
+ ->relay:* DONE: Auth module complete
52
+ ->relay:Developer TASK: Implement /api/register
53
+ ->relay:Reviewer REVIEW: Please check src/auth/*.ts
54
+ ->relay:Architect QUESTION: JWT or sessions?
55
+ ```
56
+
57
+ ## Rules
58
+
59
+ - Pattern must be at line start (whitespace OK)
60
+ - Escape with `\->relay:` to output literally
61
+ - Check daemon status: `agent-relay status`
@@ -0,0 +1,179 @@
1
+ # Dashboard V2 Architecture Plan
2
+
3
+ ## Overview
4
+
5
+ Migrate from vanilla TypeScript to Next.js with enhanced fleet control capabilities.
6
+ Inspired by AI Maestro's hierarchical naming and color coding system.
7
+
8
+ ## Key Features
9
+
10
+ ### 1. Fleet Overview
11
+ - Multi-server visualization with expandable project cards
12
+ - Agent cards with real-time status indicators
13
+ - Hierarchical grouping based on agent naming (e.g., `backend-api`, `frontend-ui`)
14
+
15
+ ### 2. Agent Status Cards
16
+ - Color-coded by project/role hierarchy
17
+ - Status badge (online/offline/busy)
18
+ - Unread message indicator (red dot, iPhone-style)
19
+ - Current task summary from [[SUMMARY]] blocks
20
+ - Quick actions: message, spawn similar, view trajectory
21
+
22
+ ### 3. Task Assignment UI
23
+ - Drag-and-drop task assignment to agents
24
+ - Integration with beads task system
25
+ - Visual dependency graph
26
+ - Priority indicators (P1-P4 color coding)
27
+
28
+ ### 4. Trajectory Viewer
29
+ - Timeline visualization of agent decisions
30
+ - Expandable decision nodes
31
+ - Context diff viewer
32
+ - Replay capability
33
+
34
+ ### 5. Decision Queue
35
+ - Pending decisions requiring human input
36
+ - Priority-sorted list
37
+ - One-click approve/reject
38
+ - Bulk actions
39
+
40
+ ## Color Coding System
41
+
42
+ ### Hierarchical Colors (from agent name prefix)
43
+ ```
44
+ backend-* → Blue (#1264a3)
45
+ frontend-* → Purple (#7c3aed)
46
+ infra-* → Orange (#ea580c)
47
+ lead-* → Green (#2bac76)
48
+ test-* → Teal (#0d9488)
49
+ (default) → Gray (#6b7280)
50
+ ```
51
+
52
+ ### Status Colors
53
+ ```
54
+ online → Green dot
55
+ offline → Gray dot
56
+ busy → Yellow dot
57
+ error → Red dot
58
+ attention → Red badge overlay
59
+ ```
60
+
61
+ ## Tech Stack
62
+
63
+ ### Frontend
64
+ - Next.js 14 (App Router)
65
+ - React Server Components where applicable
66
+ - Tailwind CSS for styling
67
+ - Framer Motion for animations
68
+ - React Query for data fetching
69
+ - WebSocket for real-time updates
70
+
71
+ ### State Management
72
+ - Zustand for client state
73
+ - React Query for server state
74
+ - WebSocket context for real-time
75
+
76
+ ## Directory Structure
77
+
78
+ ```
79
+ src/dashboard-v2/
80
+ ├── app/
81
+ │ ├── layout.tsx
82
+ │ ├── page.tsx # Main dashboard
83
+ │ ├── fleet/
84
+ │ │ └── page.tsx # Fleet overview
85
+ │ ├── agent/[name]/
86
+ │ │ └── page.tsx # Agent detail view
87
+ │ ├── trajectory/
88
+ │ │ └── page.tsx # Trajectory viewer
89
+ │ └── decisions/
90
+ │ └── page.tsx # Decision queue
91
+ ├── components/
92
+ │ ├── layout/
93
+ │ │ ├── Sidebar.tsx
94
+ │ │ ├── Header.tsx
95
+ │ │ └── CommandPalette.tsx
96
+ │ ├── agents/
97
+ │ │ ├── AgentCard.tsx
98
+ │ │ ├── AgentList.tsx
99
+ │ │ └── AgentStatus.tsx
100
+ │ ├── fleet/
101
+ │ │ ├── FleetOverview.tsx
102
+ │ │ ├── ProjectCard.tsx
103
+ │ │ └── ServerStatus.tsx
104
+ │ ├── messages/
105
+ │ │ ├── MessageList.tsx
106
+ │ │ ├── MessageComposer.tsx
107
+ │ │ └── ThreadPanel.tsx
108
+ │ ├── tasks/
109
+ │ │ ├── TaskBoard.tsx
110
+ │ │ ├── TaskCard.tsx
111
+ │ │ └── TaskAssignment.tsx
112
+ │ ├── trajectory/
113
+ │ │ ├── Timeline.tsx
114
+ │ │ ├── DecisionNode.tsx
115
+ │ │ └── ContextDiff.tsx
116
+ │ └── decisions/
117
+ │ ├── DecisionQueue.tsx
118
+ │ └── DecisionCard.tsx
119
+ ├── hooks/
120
+ │ ├── useWebSocket.ts
121
+ │ ├── useAgents.ts
122
+ │ ├── useMessages.ts
123
+ │ └── useFleet.ts
124
+ ├── lib/
125
+ │ ├── api.ts
126
+ │ ├── colors.ts # Color coding logic
127
+ │ └── hierarchy.ts # Agent name parsing
128
+ └── types/
129
+ └── index.ts
130
+ ```
131
+
132
+ ## API Endpoints Needed
133
+
134
+ ### Existing (keep)
135
+ - `GET /ws` - WebSocket for real-time updates
136
+ - `POST /api/send` - Send message
137
+ - `POST /api/spawn` - Spawn agent
138
+ - `GET /api/spawned` - List spawned agents
139
+ - `DELETE /api/spawned/:name` - Release agent
140
+
141
+ ### New (for v2)
142
+ - `GET /api/trajectory/:agent` - Agent decision history
143
+ - `GET /api/decisions` - Pending decisions queue
144
+ - `POST /api/decisions/:id/resolve` - Resolve a decision
145
+ - `GET /api/tasks` - Beads integration for task list
146
+ - `POST /api/tasks/:id/assign` - Assign task to agent
147
+
148
+ ## Implementation Phases
149
+
150
+ ### Phase 1: Foundation (Current Sprint)
151
+ - [ ] Set up Next.js project structure
152
+ - [ ] Implement color coding system
153
+ - [ ] Create basic layout components
154
+ - [ ] Port existing WebSocket logic
155
+
156
+ ### Phase 2: Core Features
157
+ - [ ] Agent cards with hierarchy grouping
158
+ - [ ] Enhanced message view
159
+ - [ ] Fleet overview page
160
+ - [ ] Real-time status updates
161
+
162
+ ### Phase 3: Advanced Features
163
+ - [ ] Trajectory viewer
164
+ - [ ] Decision queue
165
+ - [ ] Task assignment UI
166
+ - [ ] Beads integration
167
+
168
+ ### Phase 4: Polish
169
+ - [ ] Animations and transitions
170
+ - [ ] Keyboard shortcuts
171
+ - [ ] Mobile responsiveness
172
+ - [ ] Performance optimization
173
+
174
+ ## Migration Strategy
175
+
176
+ 1. Build v2 alongside existing dashboard
177
+ 2. New route: `/v2` or separate port during development
178
+ 3. Feature parity checkpoint before switching
179
+ 4. Gradual rollout with feature flags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,8 @@
20
20
  },
21
21
  "scripts": {
22
22
  "postinstall": "npm rebuild better-sqlite3",
23
- "build": "npm run clean && tsc",
23
+ "build": "npm run clean && tsc && npm run build:frontend",
24
+ "build:frontend": "esbuild src/dashboard/frontend/app.ts --bundle --outfile=src/dashboard/public/js/app.js --format=esm --target=es2022 --minify --sourcemap",
24
25
  "postbuild": "cp -r src/dashboard/public dist/dashboard/ && chmod +x dist/cli/index.js",
25
26
  "dev": "tsc -w",
26
27
  "dev:local": "npm run build && npm link && echo '✓ agent-relay linked globally'",
@@ -76,7 +77,9 @@
76
77
  "@typescript-eslint/eslint-plugin": "^8.18.2",
77
78
  "@typescript-eslint/parser": "^8.18.2",
78
79
  "@vitest/coverage-v8": "^2.1.8",
80
+ "esbuild": "^0.24.0",
79
81
  "eslint": "^8.57.1",
82
+ "jsdom": "^25.0.1",
80
83
  "typescript": "^5.7.2",
81
84
  "vitest": "^2.1.8"
82
85
  },