agent-relay 1.0.7 → 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.
- package/README.md +176 -6
- package/dist/bridge/config.d.ts +41 -0
- package/dist/bridge/config.d.ts.map +1 -0
- package/dist/bridge/config.js +143 -0
- package/dist/bridge/config.js.map +1 -0
- package/dist/bridge/index.d.ts +10 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +10 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/multi-project-client.d.ts +99 -0
- package/dist/bridge/multi-project-client.d.ts.map +1 -0
- package/dist/bridge/multi-project-client.js +386 -0
- package/dist/bridge/multi-project-client.js.map +1 -0
- package/dist/bridge/spawner.d.ts +46 -0
- package/dist/bridge/spawner.d.ts.map +1 -0
- package/dist/bridge/spawner.js +223 -0
- package/dist/bridge/spawner.js.map +1 -0
- package/dist/bridge/types.d.ts +55 -0
- package/dist/bridge/types.d.ts.map +1 -0
- package/dist/bridge/types.js +6 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/bridge/utils.d.ts +30 -0
- package/dist/bridge/utils.d.ts.map +1 -0
- package/dist/bridge/utils.js +54 -0
- package/dist/bridge/utils.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +906 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/daemon/agent-registry.d.ts +60 -0
- package/dist/daemon/agent-registry.d.ts.map +1 -0
- package/dist/daemon/agent-registry.js +163 -0
- package/dist/daemon/agent-registry.js.map +1 -0
- package/dist/daemon/connection.d.ts +33 -1
- package/dist/daemon/connection.d.ts.map +1 -1
- package/dist/daemon/connection.js +86 -11
- package/dist/daemon/connection.js.map +1 -1
- package/dist/daemon/index.d.ts +2 -0
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +2 -0
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/registry.d.ts +9 -0
- package/dist/daemon/registry.d.ts.map +1 -0
- package/dist/daemon/registry.js +9 -0
- package/dist/daemon/registry.js.map +1 -0
- package/dist/daemon/router.d.ts +61 -2
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js +219 -4
- package/dist/daemon/router.js.map +1 -1
- package/dist/daemon/server.d.ts +9 -0
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +135 -16
- package/dist/daemon/server.js.map +1 -1
- package/dist/dashboard/metrics.d.ts +105 -0
- package/dist/dashboard/metrics.d.ts.map +1 -0
- package/dist/dashboard/metrics.js +192 -0
- package/dist/dashboard/metrics.js.map +1 -0
- package/dist/dashboard/needs-attention.d.ts +24 -0
- package/dist/dashboard/needs-attention.d.ts.map +1 -0
- package/dist/dashboard/needs-attention.js +78 -0
- package/dist/dashboard/needs-attention.js.map +1 -0
- package/dist/dashboard/public/bridge.html +1272 -0
- package/dist/dashboard/public/index.html +2094 -347
- package/dist/dashboard/public/js/app.js +184 -0
- package/dist/dashboard/public/js/app.js.map +7 -0
- package/dist/dashboard/public/metrics.html +999 -0
- package/dist/dashboard/server.d.ts +14 -1
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +689 -16
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/start.js +1 -1
- package/dist/dashboard/start.js.map +1 -1
- package/dist/dashboard-v2/index.d.ts +10 -0
- package/dist/dashboard-v2/index.d.ts.map +1 -0
- package/dist/dashboard-v2/index.js +54 -0
- package/dist/dashboard-v2/index.js.map +1 -0
- package/dist/dashboard-v2/lib/api.d.ts +95 -0
- package/dist/dashboard-v2/lib/api.d.ts.map +1 -0
- package/dist/dashboard-v2/lib/api.js +270 -0
- package/dist/dashboard-v2/lib/api.js.map +1 -0
- package/dist/dashboard-v2/lib/colors.d.ts +61 -0
- package/dist/dashboard-v2/lib/colors.d.ts.map +1 -0
- package/dist/dashboard-v2/lib/colors.js +198 -0
- package/dist/dashboard-v2/lib/colors.js.map +1 -0
- package/dist/dashboard-v2/lib/hierarchy.d.ts +74 -0
- package/dist/dashboard-v2/lib/hierarchy.d.ts.map +1 -0
- package/dist/dashboard-v2/lib/hierarchy.js +196 -0
- package/dist/dashboard-v2/lib/hierarchy.js.map +1 -0
- package/dist/dashboard-v2/types/index.d.ts +154 -0
- package/dist/dashboard-v2/types/index.d.ts.map +1 -0
- package/dist/dashboard-v2/types/index.js +6 -0
- package/dist/dashboard-v2/types/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/protocol/types.d.ts +15 -1
- package/dist/protocol/types.d.ts.map +1 -1
- package/dist/storage/adapter.d.ts +74 -1
- package/dist/storage/adapter.d.ts.map +1 -1
- package/dist/storage/adapter.js +39 -0
- package/dist/storage/adapter.js.map +1 -1
- package/dist/storage/sqlite-adapter.d.ts +92 -1
- package/dist/storage/sqlite-adapter.d.ts.map +1 -1
- package/dist/storage/sqlite-adapter.js +615 -47
- package/dist/storage/sqlite-adapter.js.map +1 -1
- package/dist/utils/agent-config.d.ts +45 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/agent-config.js +118 -0
- package/dist/utils/agent-config.js.map +1 -0
- package/dist/utils/project-namespace.d.ts.map +1 -1
- package/dist/utils/project-namespace.js +22 -1
- package/dist/utils/project-namespace.js.map +1 -1
- package/dist/wrapper/client.d.ts +30 -3
- package/dist/wrapper/client.d.ts.map +1 -1
- package/dist/wrapper/client.js +85 -9
- package/dist/wrapper/client.js.map +1 -1
- package/dist/wrapper/parser.d.ts +127 -4
- package/dist/wrapper/parser.d.ts.map +1 -1
- package/dist/wrapper/parser.js +622 -86
- package/dist/wrapper/parser.js.map +1 -1
- package/dist/wrapper/tmux-wrapper.d.ts +136 -10
- package/dist/wrapper/tmux-wrapper.d.ts.map +1 -1
- package/dist/wrapper/tmux-wrapper.js +599 -79
- package/dist/wrapper/tmux-wrapper.js.map +1 -1
- package/docs/AGENTS.md +132 -27
- package/docs/ARCHITECTURE_DECISIONS.md +175 -0
- package/docs/CHANGELOG.md +1 -1
- package/docs/COMPETITIVE_ANALYSIS.md +897 -0
- package/docs/DESIGN_BRIDGE_STAFFING.md +878 -0
- package/docs/DESIGN_V2.md +1079 -0
- package/docs/INTEGRATION-GUIDE.md +926 -0
- package/docs/MONETIZATION.md +1679 -0
- package/docs/PROPOSAL-trajectories.md +1582 -0
- package/docs/PROTOCOL.md +3 -3
- package/docs/SCALING_ANALYSIS.md +280 -0
- package/docs/TMUX_IMPLEMENTATION_NOTES.md +9 -9
- package/docs/TMUX_IMPROVEMENTS.md +968 -0
- package/docs/agent-relay-snippet.md +61 -0
- package/docs/competitive-analysis-mcp-agent-mail.md +389 -0
- package/docs/dashboard-v2-plan.md +179 -0
- package/package.json +10 -3
package/docs/PROTOCOL.md
CHANGED
|
@@ -290,15 +290,15 @@ Client should send fresh HELLO.
|
|
|
290
290
|
### Inline Format (single line only)
|
|
291
291
|
|
|
292
292
|
```
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
->relay:codex-1 Your turn to play
|
|
294
|
+
->thinking:* Considering the Queen...
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
### Rules
|
|
298
298
|
|
|
299
299
|
1. Block: Only parse when `[[RELAY]]` at start of line
|
|
300
300
|
2. Inline: Only at start of line, not in code fences
|
|
301
|
-
3. Escape:
|
|
301
|
+
3. Escape: `\->relay:` outputs literal `->relay:`
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Scaling Analysis: Is the TUI Dashboard Worth It?
|
|
2
|
+
|
|
3
|
+
## The Question
|
|
4
|
+
|
|
5
|
+
The proposed changes add significant complexity:
|
|
6
|
+
- TUI dashboard with `blessed` library
|
|
7
|
+
- Daemon event streaming
|
|
8
|
+
- Activity state reporting from wrappers
|
|
9
|
+
- New CLI commands
|
|
10
|
+
|
|
11
|
+
**Is this the right approach, or is there a simpler path?**
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Behavior Comparison
|
|
16
|
+
|
|
17
|
+
### Current (2-3 Agents)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Terminal 1
|
|
21
|
+
agent-relay -n Alice claude
|
|
22
|
+
# You're IN Alice's tmux, working
|
|
23
|
+
|
|
24
|
+
# Terminal 2
|
|
25
|
+
agent-relay -n Bob claude
|
|
26
|
+
# You're IN Bob's tmux
|
|
27
|
+
|
|
28
|
+
# To switch: Alt+Tab between terminal windows
|
|
29
|
+
# To see status: mentally track what each is doing
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Works fine because:** You can hold 2-3 contexts in your head.
|
|
33
|
+
|
|
34
|
+
### Proposed (5-10 Agents)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Terminal 1
|
|
38
|
+
agent-relay up # Start daemon
|
|
39
|
+
agent-relay watch # TUI dashboard
|
|
40
|
+
|
|
41
|
+
┌─ Agent Relay ───────────────────────────────┐
|
|
42
|
+
│ ● Alice active 12↑ 8↓ │
|
|
43
|
+
│ ● Bob typing 5↑ 14↓ │
|
|
44
|
+
│ ○ Charlie offline queued: 3 │
|
|
45
|
+
│ ... │
|
|
46
|
+
└─────────────────────────────────────────────┘
|
|
47
|
+
|
|
48
|
+
# Press 'a' → attach to native tmux
|
|
49
|
+
# Ctrl+B d → back to TUI
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Adds complexity:**
|
|
53
|
+
- blessed dependency (~500KB)
|
|
54
|
+
- Event stream protocol
|
|
55
|
+
- Activity reporting
|
|
56
|
+
- More state to track in daemon
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Alternative: Just Use tmux Better
|
|
61
|
+
|
|
62
|
+
tmux already has multi-pane and multi-window support. Why not leverage it?
|
|
63
|
+
|
|
64
|
+
### Simpler Approach: Native tmux Layout
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Start all agents in one tmux session with multiple windows
|
|
68
|
+
agent-relay team start
|
|
69
|
+
|
|
70
|
+
# Creates tmux session "relay-team" with:
|
|
71
|
+
# - Window 0: Alice (claude)
|
|
72
|
+
# - Window 1: Bob (claude)
|
|
73
|
+
# - Window 2: Charlie (claude)
|
|
74
|
+
# - Window 3: Status pane (tail -f on logs)
|
|
75
|
+
|
|
76
|
+
# Switch windows: Ctrl+B 0, Ctrl+B 1, Ctrl+B 2...
|
|
77
|
+
# Or use: Ctrl+B w (window list)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Implementation (50 lines, not 500):**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
#!/bin/bash
|
|
84
|
+
# agent-relay team start
|
|
85
|
+
|
|
86
|
+
TEAM_SESSION="relay-team"
|
|
87
|
+
AGENTS=$(cat teams.json | jq -r '.agents[].name')
|
|
88
|
+
|
|
89
|
+
tmux new-session -d -s "$TEAM_SESSION"
|
|
90
|
+
|
|
91
|
+
i=0
|
|
92
|
+
for agent in $AGENTS; do
|
|
93
|
+
if [ $i -eq 0 ]; then
|
|
94
|
+
tmux send-keys -t "$TEAM_SESSION" "agent-relay -n $agent claude" Enter
|
|
95
|
+
else
|
|
96
|
+
tmux new-window -t "$TEAM_SESSION"
|
|
97
|
+
tmux send-keys -t "$TEAM_SESSION" "agent-relay -n $agent claude" Enter
|
|
98
|
+
fi
|
|
99
|
+
((i++))
|
|
100
|
+
done
|
|
101
|
+
|
|
102
|
+
# Add status window
|
|
103
|
+
tmux new-window -t "$TEAM_SESSION" -n "status"
|
|
104
|
+
tmux send-keys -t "$TEAM_SESSION:status" "watch -n1 agent-relay agents" Enter
|
|
105
|
+
|
|
106
|
+
tmux attach -t "$TEAM_SESSION"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**User experience:**
|
|
110
|
+
```
|
|
111
|
+
Ctrl+B w → Shows window list:
|
|
112
|
+
0: Alice (attached)
|
|
113
|
+
1: Bob
|
|
114
|
+
2: Charlie
|
|
115
|
+
3: status
|
|
116
|
+
|
|
117
|
+
Ctrl+B 1 → Jump to Bob
|
|
118
|
+
Ctrl+B 3 → See status (agent-relay agents output)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Comparison: TUI vs Native tmux
|
|
124
|
+
|
|
125
|
+
| Aspect | TUI Dashboard (blessed) | Native tmux Windows |
|
|
126
|
+
|--------|------------------------|---------------------|
|
|
127
|
+
| **Lines of code** | ~500 | ~50 |
|
|
128
|
+
| **Dependencies** | blessed (~500KB) | None (tmux built-in) |
|
|
129
|
+
| **Learning curve** | New UI to learn | tmux you already know |
|
|
130
|
+
| **Real-time updates** | Yes (event stream) | Yes (watch command) |
|
|
131
|
+
| **Quick switch** | Press 'a', select | Ctrl+B {number} |
|
|
132
|
+
| **See all at once** | TUI list | Ctrl+B w (window list) |
|
|
133
|
+
| **Native experience** | Detach TUI → attach tmux | Already in tmux |
|
|
134
|
+
| **Maintenance** | blessed updates, bugs | tmux is stable |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## What We Actually Need for Scaling
|
|
139
|
+
|
|
140
|
+
Let's separate "nice to have" from "essential":
|
|
141
|
+
|
|
142
|
+
### Essential (for 5-10 agents)
|
|
143
|
+
|
|
144
|
+
1. **Quick overview of all agents** → `agent-relay agents` (already proposed)
|
|
145
|
+
2. **Know who's busy vs idle** → Activity state in agents output
|
|
146
|
+
3. **Message history** → `agent-relay history` (already proposed)
|
|
147
|
+
4. **Quick attach** → `agent-relay attach Alice`
|
|
148
|
+
5. **Group messaging** → `->relay:@backend` (already proposed)
|
|
149
|
+
|
|
150
|
+
### Nice to Have (but complex)
|
|
151
|
+
|
|
152
|
+
1. **Real-time TUI dashboard** → Use `watch` instead
|
|
153
|
+
2. **Event streaming** → Poll daemon status instead
|
|
154
|
+
3. **Typing indicators** → Not critical for coordination
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Recommended Simpler Approach
|
|
159
|
+
|
|
160
|
+
### Phase 5 Revised: Minimal Scaling
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 1. Better status command (essential)
|
|
164
|
+
$ agent-relay agents
|
|
165
|
+
NAME STATUS MESSAGES LAST SEEN
|
|
166
|
+
Alice active 12↑ 8↓ now
|
|
167
|
+
Bob idle 5↑ 14↓ 30s ago
|
|
168
|
+
Charlie offline queued: 3 5m ago
|
|
169
|
+
|
|
170
|
+
# 2. Quick attach (essential)
|
|
171
|
+
$ agent-relay attach Alice
|
|
172
|
+
# Attaches to relay-Alice-* session
|
|
173
|
+
|
|
174
|
+
# 3. Team layout (essential)
|
|
175
|
+
$ agent-relay team start
|
|
176
|
+
# Creates multi-window tmux session
|
|
177
|
+
# Use Ctrl+B w to see all, Ctrl+B {n} to switch
|
|
178
|
+
|
|
179
|
+
# 4. Live status (nice to have, zero code)
|
|
180
|
+
$ watch -n2 agent-relay agents
|
|
181
|
+
# Updates every 2 seconds
|
|
182
|
+
|
|
183
|
+
# 5. Message history (essential)
|
|
184
|
+
$ agent-relay history --last 20
|
|
185
|
+
14:23:01 Alice → Bob: Can you check the API?
|
|
186
|
+
14:23:15 Bob → Alice: On it
|
|
187
|
+
...
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Implementation Effort
|
|
191
|
+
|
|
192
|
+
| Feature | Complex TUI Approach | Simpler Approach |
|
|
193
|
+
|---------|---------------------|------------------|
|
|
194
|
+
| TUI dashboard | 2 days + blessed dep | 0 (use `watch`) |
|
|
195
|
+
| Event stream | 1 day + protocol change | 0 (poll status) |
|
|
196
|
+
| Activity reporting | 1 day | 0.5 day (just in status) |
|
|
197
|
+
| Team layout | Already proposed | Same (0.5 day) |
|
|
198
|
+
| Better agents cmd | Same | Same (0.5 day) |
|
|
199
|
+
| History command | Same | Same (0.5 day) |
|
|
200
|
+
| **Total** | **5+ days** | **2 days** |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Verdict: Skip the TUI, Use tmux
|
|
205
|
+
|
|
206
|
+
The TUI dashboard is over-engineered. tmux already provides:
|
|
207
|
+
- Multi-window switching (Ctrl+B w)
|
|
208
|
+
- Split panes (Ctrl+B %)
|
|
209
|
+
- Session persistence
|
|
210
|
+
- Window list
|
|
211
|
+
|
|
212
|
+
**What we actually need:**
|
|
213
|
+
|
|
214
|
+
1. **`agent-relay agents`** - Show status with activity state
|
|
215
|
+
2. **`agent-relay attach <name>`** - Quick attach helper
|
|
216
|
+
3. **`agent-relay team start`** - Multi-window tmux layout
|
|
217
|
+
4. **`agent-relay history`** - Query past messages
|
|
218
|
+
|
|
219
|
+
**What we DON'T need:**
|
|
220
|
+
|
|
221
|
+
1. ❌ blessed TUI dependency
|
|
222
|
+
2. ❌ Event streaming from daemon
|
|
223
|
+
3. ❌ Complex activity reporting protocol
|
|
224
|
+
4. ❌ Real-time typing indicators
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Updated Design Recommendation
|
|
229
|
+
|
|
230
|
+
### Keep from Phase 5:
|
|
231
|
+
- Agent groups (`->relay:@backend`)
|
|
232
|
+
- Message priority (`!`, `?`)
|
|
233
|
+
- `agent-relay agents` command
|
|
234
|
+
- `agent-relay history` command
|
|
235
|
+
|
|
236
|
+
### Replace TUI with:
|
|
237
|
+
```bash
|
|
238
|
+
# Multi-window tmux session
|
|
239
|
+
agent-relay team start # Creates relay-team session
|
|
240
|
+
agent-relay team attach # Attach to existing
|
|
241
|
+
agent-relay team add Bob # Add agent to running team
|
|
242
|
+
|
|
243
|
+
# Quick attach to single agent
|
|
244
|
+
agent-relay attach Alice
|
|
245
|
+
|
|
246
|
+
# Live status (zero code, just docs)
|
|
247
|
+
watch -n2 agent-relay agents
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Effort Saved:
|
|
251
|
+
- No blessed dependency
|
|
252
|
+
- No event streaming protocol
|
|
253
|
+
- No TUI code maintenance
|
|
254
|
+
- 3+ days of implementation saved
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Behavior Impact Summary
|
|
259
|
+
|
|
260
|
+
| Scenario | TUI Approach | Simpler Approach |
|
|
261
|
+
|----------|--------------|------------------|
|
|
262
|
+
| See all agents | Open TUI, see list | `agent-relay agents` or `Ctrl+B w` |
|
|
263
|
+
| Switch to Bob | Press 'a', select Bob | `Ctrl+B 1` or `agent-relay attach Bob` |
|
|
264
|
+
| Check if Alice is busy | See "typing..." in TUI | Check status column in agents |
|
|
265
|
+
| Send message to group | Same | Same (`->relay:@backend`) |
|
|
266
|
+
| View history | Press 'h' in TUI | `agent-relay history` |
|
|
267
|
+
|
|
268
|
+
**The simpler approach does everything the TUI does, with 80% less code.**
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Final Recommendation
|
|
273
|
+
|
|
274
|
+
1. **Don't build the TUI dashboard** - It's solving a problem tmux already solves
|
|
275
|
+
2. **Do add `agent-relay team`** - Leverages tmux's native multi-window
|
|
276
|
+
3. **Do improve `agent-relay agents`** - Add activity state, message counts
|
|
277
|
+
4. **Do add `agent-relay history`** - Query past messages
|
|
278
|
+
5. **Document `watch` trick** - Free live updates
|
|
279
|
+
|
|
280
|
+
This keeps the simplicity advantage while scaling to 10+ agents.
|
|
@@ -47,7 +47,7 @@ The previous tmux implementation had these issues:
|
|
|
47
47
|
│ TmuxWrapper (this process) │
|
|
48
48
|
│ - Polls capture-pane @ 100ms │
|
|
49
49
|
│ - Detects new output (diff) │
|
|
50
|
-
│ - Parses
|
|
50
|
+
│ - Parses ->relay: commands │
|
|
51
51
|
│ - Writes to stdout for user │
|
|
52
52
|
│ - Injects messages via send-keys│
|
|
53
53
|
│ - Forwards user stdin to tmux │
|
|
@@ -103,12 +103,12 @@ process.stdin.on('data', (data) => {
|
|
|
103
103
|
- Solution: Use -S - to get full scrollback, diff against last capture
|
|
104
104
|
|
|
105
105
|
2. **Binary/escape sequences**: Output might contain control characters
|
|
106
|
-
- Solution: Strip ANSI codes before parsing
|
|
106
|
+
- Solution: Strip ANSI codes before parsing ->relay:
|
|
107
107
|
|
|
108
108
|
3. **Session death**: tmux session might exit
|
|
109
109
|
- Solution: Monitor with `tmux has-session -t session`
|
|
110
110
|
|
|
111
|
-
4. **Multiple messages**: Several
|
|
111
|
+
4. **Multiple messages**: Several ->relay: in one capture
|
|
112
112
|
- Solution: Track last processed line/position
|
|
113
113
|
|
|
114
114
|
5. **Stdin race conditions**: User types while we inject
|
|
@@ -119,7 +119,7 @@ process.stdin.on('data', (data) => {
|
|
|
119
119
|
1. **Basic session start**: Does claude actually launch in tmux?
|
|
120
120
|
2. **Output capture**: Can we see claude's output?
|
|
121
121
|
3. **Input injection**: Can we send text and get response?
|
|
122
|
-
4.
|
|
122
|
+
4. **->relay detection**: Does parser find ->relay: commands?
|
|
123
123
|
5. **Full game**: Two agents playing tic-tac-toe
|
|
124
124
|
|
|
125
125
|
## Rollback Plan
|
|
@@ -194,10 +194,10 @@ node dist/cli/index.js send -f Coordinator -t PlayerX -m "Hello from Coordinator
|
|
|
194
194
|
node dist/cli/index.js start -f
|
|
195
195
|
|
|
196
196
|
# Terminal 2: PlayerX
|
|
197
|
-
node dist/cli/index.js wrap --tmux2 -n PlayerX -- claude -p "You are PlayerX playing tic-tac-toe. Use
|
|
197
|
+
node dist/cli/index.js wrap --tmux2 -n PlayerX -- claude -p "You are PlayerX playing tic-tac-toe. Use ->relay:PlayerO to send moves. Start with your first move."
|
|
198
198
|
|
|
199
199
|
# Terminal 3: PlayerO
|
|
200
|
-
node dist/cli/index.js wrap --tmux2 -n PlayerO -- claude -p "You are PlayerO playing tic-tac-toe. Use
|
|
200
|
+
node dist/cli/index.js wrap --tmux2 -n PlayerO -- claude -p "You are PlayerO playing tic-tac-toe. Use ->relay:PlayerX to send moves. Wait for PlayerX to start."
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
### Debugging
|
|
@@ -253,7 +253,7 @@ The message was successfully typed into the bash terminal via tmux send-keys.
|
|
|
253
253
|
|
|
254
254
|
1. Test with Claude CLI (replace bash with claude)
|
|
255
255
|
2. Test full tic-tac-toe game between two agents
|
|
256
|
-
3. Verify
|
|
256
|
+
3. Verify ->relay: command parsing works in both directions
|
|
257
257
|
4. Check if multi-round injection remains stable (previous implementations failed after 2-3 rounds)
|
|
258
258
|
|
|
259
259
|
### Critical Question
|
|
@@ -306,10 +306,10 @@ The critical test is whether injection remains stable over multiple rounds:
|
|
|
306
306
|
node dist/cli/index.js start -f
|
|
307
307
|
|
|
308
308
|
# Terminal 2: PlayerX
|
|
309
|
-
node dist/cli/index.js wrap --tmux2 -n PlayerX -- claude -p "Play tic-tac-toe. Use
|
|
309
|
+
node dist/cli/index.js wrap --tmux2 -n PlayerX -- claude -p "Play tic-tac-toe. Use ->relay:PlayerO to send moves."
|
|
310
310
|
|
|
311
311
|
# Terminal 3: PlayerO
|
|
312
|
-
node dist/cli/index.js wrap --tmux2 -n PlayerO -- claude -p "Play tic-tac-toe. Use
|
|
312
|
+
node dist/cli/index.js wrap --tmux2 -n PlayerO -- claude -p "Play tic-tac-toe. Use ->relay:PlayerX to send moves."
|
|
313
313
|
```
|
|
314
314
|
|
|
315
315
|
If this works for a full game (5-9 moves), we've solved the problem.
|