@rrr2010/opencode-roundtable 0.2.0 → 0.3.2
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 +244 -198
- package/dist/index.js +139 -100
- package/dist/index.js.map +8 -8
- package/docs/SPEC.md +974 -979
- package/package.json +60 -53
- package/src/tui/tui.tsx +89 -0
package/README.md
CHANGED
|
@@ -1,198 +1,244 @@
|
|
|
1
|
-
# opencode-roundtable
|
|
2
|
-
|
|
3
|
-
OpenCode plugin that orchestrates **multi-agent round-robin debates**.
|
|
4
|
-
Agents with different personalities debate a topic turn by turn, sharing
|
|
5
|
-
context while keeping their own system prompts and tools.
|
|
6
|
-
|
|
7
|
-
A built-in observer automatically consolidates every debate into an
|
|
8
|
-
executive summary.
|
|
9
|
-
|
|
10
|
-
## Installation
|
|
11
|
-
|
|
12
|
-
###
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
prompt: "
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
# opencode-roundtable
|
|
2
|
+
|
|
3
|
+
OpenCode plugin that orchestrates **multi-agent round-robin debates**.
|
|
4
|
+
Agents with different personalities debate a topic turn by turn, sharing
|
|
5
|
+
context while keeping their own system prompts and tools.
|
|
6
|
+
|
|
7
|
+
A built-in observer automatically consolidates every debate into an
|
|
8
|
+
executive summary.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### npm (recommended)
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"plugin": ["@rrr2010/opencode-roundtable@latest"]
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
OpenCode auto-installs npm plugins on startup. No manual copy needed.
|
|
21
|
+
|
|
22
|
+
### Local (dev)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/opencode-ai/roundtable
|
|
26
|
+
cd roundtable
|
|
27
|
+
bun run build
|
|
28
|
+
npm link
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then add `"@rrr2010/opencode-roundtable"` to your opencode.json `plugin` array.
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **Round-robin debate** — agents speak in sequence, each seeing the full discussion history
|
|
36
|
+
- **Shared context** — tool outputs and discoveries are visible to all participants
|
|
37
|
+
- **Built-in observer** — automatically consolidates the debate into an executive summary (overridable with a specific agent)
|
|
38
|
+
- **Isolated session** — the debate runs in a child session, keeping the main session clean
|
|
39
|
+
- **File persistence** — state stored on disk, survives restarts
|
|
40
|
+
- **Extend mode** — continue a concluded roundtable with more rounds or a new topic
|
|
41
|
+
- **Agent discovery** — `available_agents` tool helps the orchestrator know which agents exist
|
|
42
|
+
- **Active roundtables** — `active_roundtables` tool lists current debates with status
|
|
43
|
+
- **TUI plugin** — badge `[RT]`, `← Back` link, `/roundtables` command
|
|
44
|
+
- **Auto-navigate** — optional auto-navigation between sessions on create/conclude
|
|
45
|
+
- **Parallel roundtables** — multiple independent debates can run simultaneously
|
|
46
|
+
- **User intervention** — the human can jump into the debate at any time
|
|
47
|
+
- **Loop detection** — Jaccard bigram similarity detects agent impasses early
|
|
48
|
+
|
|
49
|
+
## Tool API
|
|
50
|
+
|
|
51
|
+
### `roundtable()`
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
roundtable({
|
|
55
|
+
agents?: string[], // Names in speaking order (min 2). Required for new debates.
|
|
56
|
+
prompt: string, // Topic or challenge. For multi-round, include per-round instructions.
|
|
57
|
+
rounds?: number, // Complete rounds (default: 1, max: 50)
|
|
58
|
+
observer?: string, // Agent for final consolidation (default: built-in)
|
|
59
|
+
sessionID?: string, // ses_xxxx — pass to extend a concluded debate
|
|
60
|
+
title?: string, // Custom title (default: auto-generated from prompt)
|
|
61
|
+
observerPrompt?: string, // Override the observer consolidation prompt (e.g., "Save a detailed report to report.md")
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Returns:** `{ sessionID: string, summary: string }` after the debate concludes.
|
|
66
|
+
|
|
67
|
+
**Side effect:** injects system-level prompts into each agent's context during
|
|
68
|
+
the debate (role-setting, topic, turn routing, and lifecycle signals).
|
|
69
|
+
|
|
70
|
+
### `available_agents()`
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
available_agents()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Returns:** `"Available agents: pm, dev, rv, ..."` — a formatted string of agent names.
|
|
77
|
+
|
|
78
|
+
### `active_roundtables()`
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
active_roundtables()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Returns:** clickable session listings with status, e.g.:
|
|
85
|
+
```
|
|
86
|
+
Active roundtables:
|
|
87
|
+
- #ses_xxx · pm→dev→rv (R1/2) · debating
|
|
88
|
+
- #ses_yyy · pm→dev (R2/2) · consolidating
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Usage Examples
|
|
92
|
+
|
|
93
|
+
### Basic — one round, built-in observer
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
roundtable({
|
|
97
|
+
agents: ["pm", "dev"],
|
|
98
|
+
prompt: "What architecture should we use?",
|
|
99
|
+
})
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Multi-round with per-round instructions
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
roundtable({
|
|
106
|
+
agents: ["pm", "dev"],
|
|
107
|
+
prompt: "Round 1: list pros. Round 2: list cons. Round 3: propose an implementation plan.",
|
|
108
|
+
rounds: 3,
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Explicit observer
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
roundtable({
|
|
116
|
+
agents: ["pm", "dev"],
|
|
117
|
+
prompt: "Should we migrate to microservices?",
|
|
118
|
+
rounds: 2,
|
|
119
|
+
observer: "rv",
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Extend a concluded debate
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
roundtable({
|
|
127
|
+
sessionID: "ses_abc123",
|
|
128
|
+
rounds: 2,
|
|
129
|
+
prompt: "Dive deeper into operational costs",
|
|
130
|
+
})
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The session ID is shown in the S1 noReply message when the roundtable
|
|
134
|
+
starts — check S1 context to find it.
|
|
135
|
+
|
|
136
|
+
### Discover agents first
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const agents = available_agents()
|
|
140
|
+
// agents => "Available agents: pm, dev, rv, build, plan"
|
|
141
|
+
roundtable({
|
|
142
|
+
agents: ["pm", "dev"],
|
|
143
|
+
prompt: "...",
|
|
144
|
+
})
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### List active roundtables
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
const active = active_roundtables()
|
|
151
|
+
// active => "Active roundtables:\n- #ses_xxx · pm→dev (R1/2) · debating"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
Place `~/.config/opencode/roundtable.json` to override defaults:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"$schema": "https://raw.githubusercontent.com/opencode-ai/roundtable/main/docs/roundtable.schema.json",
|
|
161
|
+
"defaultTimeoutMs": 300000,
|
|
162
|
+
"loopSimilarityThreshold": 0.85,
|
|
163
|
+
"toolOutputPreviewMax": 500,
|
|
164
|
+
"maxRounds": 10,
|
|
165
|
+
"defaultObserverPrompt": "You are an impartial roundtable observer...",
|
|
166
|
+
"navigation": "link"
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
If the file doesn't exist, it's created automatically with defaults.
|
|
171
|
+
|
|
172
|
+
### Navigation modes
|
|
173
|
+
|
|
174
|
+
| Value | Behavior |
|
|
175
|
+
|-------|----------|
|
|
176
|
+
| `"link"` (default) | No auto-navigation. Relies on native `#ses_xxx` link rendering |
|
|
177
|
+
| `"auto"` | Auto-navigates S1→S2 on create, S2→S1 on conclude |
|
|
178
|
+
| `"none"` | No automatic navigation |
|
|
179
|
+
|
|
180
|
+
### TUI Features
|
|
181
|
+
|
|
182
|
+
The plugin registers a TUI component that provides:
|
|
183
|
+
|
|
184
|
+
- **`[RT]` badge** — shown in the sidebar for roundtable sessions
|
|
185
|
+
- **`← Back` link** — clickable link on child sessions, navigates to parent
|
|
186
|
+
- **`/roundtables` command** — slash command opens a dialog with clickable session list
|
|
187
|
+
|
|
188
|
+
## Tips
|
|
189
|
+
|
|
190
|
+
### Agent selection
|
|
191
|
+
|
|
192
|
+
Choose agents whose expertise matches the topic:
|
|
193
|
+
|
|
194
|
+
| Agent | Best for |
|
|
195
|
+
|-------|----------|
|
|
196
|
+
| `pm` | Product decisions, strategy, trade-offs |
|
|
197
|
+
| `dev` | Technical complexity, implementation effort |
|
|
198
|
+
| `rv` | Code review, docs quality, inconsistency detection |
|
|
199
|
+
| `plan` | Architecture planning, scope definition |
|
|
200
|
+
| `build` | Implementation details, execution |
|
|
201
|
+
|
|
202
|
+
### Multi-round strategy
|
|
203
|
+
|
|
204
|
+
For complex topics, structure rounds progressively:
|
|
205
|
+
|
|
206
|
+
1. **Round 1:** Explore — each agent lists their perspective
|
|
207
|
+
2. **Round 2:** Challenge — agents critique each other's positions
|
|
208
|
+
3. **Round 3+:** Converge — propose concrete solutions
|
|
209
|
+
|
|
210
|
+
Include all round instructions in the `prompt` parameter — all agents see the full agenda.
|
|
211
|
+
|
|
212
|
+
### Extend mode
|
|
213
|
+
|
|
214
|
+
- Use the session ID from the S1 noReply message when the roundtable starts
|
|
215
|
+
- Original topic is preserved; new prompt becomes the continuation
|
|
216
|
+
- Agents must be the same as the original debate (validated)
|
|
217
|
+
- Continue an extend for iterative refinement
|
|
218
|
+
|
|
219
|
+
## Agent colors (recommended)
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"agent": {
|
|
224
|
+
"pm": { "color": "#3498db" },
|
|
225
|
+
"dev": { "color": "#2ecc71" },
|
|
226
|
+
"rv": { "color": "#e74c3c" },
|
|
227
|
+
"plan": { "color": "#f39c12" },
|
|
228
|
+
"build": { "color": "#9b59b6" }
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Documentation
|
|
234
|
+
|
|
235
|
+
- [docs/SPEC.md](./docs/SPEC.md) — Full technical specification
|
|
236
|
+
|
|
237
|
+
## Requirements
|
|
238
|
+
|
|
239
|
+
- OpenCode (latest version)
|
|
240
|
+
- No external dependencies
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT
|