@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 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
- ### Local (dev)
13
-
14
- ```bash
15
- cp src/roundtable.ts ~/.config/opencode/plugins/roundtable.ts
16
- ```
17
-
18
- Restart OpenCode. The plugin is auto-loaded from the plugins directory.
19
-
20
- ### npm (coming soon)
21
-
22
- ```json
23
- {
24
- "plugin": ["@your-ns/opencode-roundtable"]
25
- }
26
- ```
27
-
28
- Add to `opencode.json` — OpenCode installs it with Bun on startup.
29
-
30
- ## Features
31
-
32
- - **Round-robin debate** — agents speak in sequence, each seeing the full discussion history
33
- - **Shared context** — tool outputs and discoveries are visible to all participants
34
- - **Built-in observer** — automatically consolidates the debate into an executive summary (overridable with a specific agent)
35
- - **Isolated session** — the debate runs in a child session, keeping the main session clean
36
- - **Extend mode** — continue a concluded roundtable with more rounds or a new topic
37
- - **Agent discovery** — `available_agents` tool helps the orchestrator know which agents exist
38
- - **Parallel roundtables** — multiple independent debates can run simultaneously
39
- - **User intervention** — the human can jump into the debate at any time
40
- - **Stuck session recovery** — if an extend is aborted mid-way, the next call auto-recovers
41
-
42
- ## Tool API
43
-
44
- ### `roundtable()`
45
-
46
- ```typescript
47
- roundtable({
48
- agents?: string[], // Names in speaking order (min 2). Required for new debates.
49
- prompt: string, // Topic or challenge. For multi-round, include per-round instructions.
50
- rounds?: number, // Complete rounds (default: 1, max: 50)
51
- observer?: string, // Agent for final consolidation (default: built-in)
52
- sessionID?: string, // ses_xxxx — pass to extend a concluded debate
53
- title?: string, // Custom title (default: auto-generated from prompt)
54
- })
55
- ```
56
-
57
- **Returns:** `{ sessionID: string, summary: string }` after the debate concludes.
58
-
59
- **Side effect:** injects system-level prompts into each agent's context (role, topic, turn routing, lifecycle signals).
60
-
61
- ### `available_agents()`
62
-
63
- ```typescript
64
- available_agents()
65
- ```
66
-
67
- **Returns:** `"Available agents: pm, dev, rv, ..."` a formatted string of agent names.
68
-
69
- ## Usage Examples
70
-
71
- ### Basic — one round, built-in observer
72
-
73
- ```typescript
74
- roundtable({
75
- agents: ["pm", "dev"],
76
- prompt: "What architecture should we use?",
77
- })
78
- ```
79
-
80
- ### Multi-round with per-round instructions
81
-
82
- ```typescript
83
- roundtable({
84
- agents: ["pm", "dev"],
85
- prompt: "Round 1: list pros. Round 2: list cons. Round 3: propose an implementation plan.",
86
- rounds: 3,
87
- })
88
- ```
89
-
90
- ### Explicit observer
91
-
92
- ```typescript
93
- roundtable({
94
- agents: ["pm", "dev"],
95
- prompt: "Should we migrate to microservices?",
96
- rounds: 2,
97
- observer: "rv",
98
- })
99
- ```
100
-
101
- ### Extend a concluded debate
102
-
103
- ```typescript
104
- roundtable({
105
- sessionID: "ses_abc123",
106
- rounds: 2,
107
- prompt: "Dive deeper into operational costs",
108
- })
109
- ```
110
-
111
- The session ID is injected into S1 as a noReply when the roundtable starts — check S1 context to find it.
112
-
113
- ### Discover agents first
114
-
115
- ```typescript
116
- const agents = available_agents()
117
- // agents => "Available agents: pm, dev, rv, build, plan"
118
- roundtable({
119
- agents: ["pm", "dev"],
120
- prompt: "...",
121
- })
122
- ```
123
-
124
- ## Configuration
125
-
126
- Place `~/.config/opencode/roundtable.json` to override defaults:
127
-
128
- ```json
129
- {
130
- "$schema": "https://raw.githubusercontent.com/opencode-ai/roundtable/main/docs/roundtable.schema.json",
131
- "defaultTimeoutMs": 300000,
132
- "loopSimilarityThreshold": 0.85,
133
- "toolOutputPreviewMax": 500,
134
- "maxRounds": 10,
135
- "defaultObserverPrompt": "You are an impartial roundtable observer..."
136
- }
137
- ```
138
-
139
- If the file doesn't exist, it's created automatically with defaults.
140
-
141
- ## Tips
142
-
143
- ### Agent selection
144
-
145
- Choose agents whose expertise matches the topic:
146
-
147
- | Agent | Best for |
148
- |-------|----------|
149
- | `pm` | Product decisions, strategy, trade-offs |
150
- | `dev` | Technical complexity, implementation effort |
151
- | `rv` | Code review, docs quality, inconsistency detection |
152
- | `plan` | Architecture planning, scope definition |
153
- | `build` | Implementation details, execution |
154
-
155
- ### Multi-round strategy
156
-
157
- For complex topics, structure rounds progressively:
158
-
159
- 1. **Round 1:** Explore — each agent lists their perspective
160
- 2. **Round 2:** Challenge — agents critique each other's positions
161
- 3. **Round 3+:** Converge — propose concrete solutions
162
-
163
- Include all round instructions in the `prompt` parameter — all agents see the full agenda.
164
-
165
- ### Extend mode
166
-
167
- - Use the session ID from the S1 noReply message
168
- - Original topic is preserved; new prompt becomes the continuation
169
- - Agents must be the same as the original debate
170
- - Continue an extend for iterative refinement
171
-
172
- ## Agent colors (recommended)
173
-
174
- ```json
175
- {
176
- "agent": {
177
- "pm": { "color": "#3498db" },
178
- "dev": { "color": "#2ecc71" },
179
- "rv": { "color": "#e74c3c" },
180
- "plan": { "color": "#f39c12" },
181
- "build": { "color": "#9b59b6" }
182
- }
183
- }
184
- ```
185
-
186
- ## Documentation
187
-
188
- - [docs/SPEC.md](./docs/SPEC.md) — Full technical specification
189
- - [docs/IMPLEMENTATION.md](./docs/IMPLEMENTATION.md) — Phased implementation plan
190
-
191
- ## Requirements
192
-
193
- - OpenCode (latest version)
194
- - No external dependencies
195
-
196
- ## License
197
-
198
- MIT
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