@te-river/opencode-team-mode 1.5.5 → 1.5.7
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 +544 -634
- package/README.zh-CN.md +511 -576
- package/dist/agents.d.ts +6 -1
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +113 -533
- package/dist/agents.js.map +1 -1
- package/dist/approval-gate.d.ts +16 -0
- package/dist/approval-gate.d.ts.map +1 -1
- package/dist/approval-gate.js +8 -1
- package/dist/approval-gate.js.map +1 -1
- package/dist/blackboard.d.ts.map +1 -1
- package/dist/blackboard.js +3 -2
- package/dist/blackboard.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +7 -6
- package/dist/commands.js.map +1 -1
- package/dist/envprotect/bash-classify.d.ts +42 -0
- package/dist/envprotect/bash-classify.d.ts.map +1 -0
- package/dist/envprotect/bash-classify.js +221 -0
- package/dist/envprotect/bash-classify.js.map +1 -0
- package/dist/envprotect/gate-predicates.d.ts +57 -0
- package/dist/envprotect/gate-predicates.d.ts.map +1 -0
- package/dist/envprotect/gate-predicates.js +174 -0
- package/dist/envprotect/gate-predicates.js.map +1 -0
- package/dist/envprotect/hook.d.ts +45 -0
- package/dist/envprotect/hook.d.ts.map +1 -0
- package/dist/envprotect/hook.js +158 -0
- package/dist/envprotect/hook.js.map +1 -0
- package/dist/envprotect/path-classify.d.ts +16 -0
- package/dist/envprotect/path-classify.d.ts.map +1 -0
- package/dist/envprotect/path-classify.js +72 -0
- package/dist/envprotect/path-classify.js.map +1 -0
- package/dist/envprotect/patterns.d.ts +77 -0
- package/dist/envprotect/patterns.d.ts.map +1 -0
- package/dist/envprotect/patterns.js +182 -0
- package/dist/envprotect/patterns.js.map +1 -0
- package/dist/envprotect.d.ts +19 -217
- package/dist/envprotect.d.ts.map +1 -1
- package/dist/envprotect.js +18 -803
- package/dist/envprotect.js.map +1 -1
- package/dist/fs-safe.d.ts +16 -0
- package/dist/fs-safe.d.ts.map +1 -0
- package/dist/fs-safe.js +56 -0
- package/dist/fs-safe.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/prompts/lead.d.ts +7 -0
- package/dist/prompts/lead.d.ts.map +1 -0
- package/dist/prompts/lead.js +233 -0
- package/dist/prompts/lead.js.map +1 -0
- package/dist/prompts/shared.d.ts +8 -0
- package/dist/prompts/shared.d.ts.map +1 -0
- package/dist/prompts/shared.js +120 -0
- package/dist/prompts/shared.js.map +1 -0
- package/dist/prompts/specialists.d.ts +12 -0
- package/dist/prompts/specialists.d.ts.map +1 -0
- package/dist/prompts/specialists.js +241 -0
- package/dist/prompts/specialists.js.map +1 -0
- package/dist/shell-text.d.ts +14 -0
- package/dist/shell-text.d.ts.map +1 -0
- package/dist/shell-text.js +16 -0
- package/dist/shell-text.js.map +1 -0
- package/dist/tm/args-schema.d.ts +42 -0
- package/dist/tm/args-schema.d.ts.map +1 -0
- package/dist/tm/args-schema.js +213 -0
- package/dist/tm/args-schema.js.map +1 -0
- package/dist/tm/browser.d.ts +52 -0
- package/dist/tm/browser.d.ts.map +1 -0
- package/dist/tm/browser.js +361 -0
- package/dist/tm/browser.js.map +1 -0
- package/dist/tm/client-unwrap.d.ts +38 -0
- package/dist/tm/client-unwrap.d.ts.map +1 -0
- package/dist/tm/client-unwrap.js +113 -0
- package/dist/tm/client-unwrap.js.map +1 -0
- package/dist/tm/config.d.ts +55 -19
- package/dist/tm/config.d.ts.map +1 -1
- package/dist/tm/config.js +74 -19
- package/dist/tm/config.js.map +1 -1
- package/dist/tm/guard.d.ts.map +1 -1
- package/dist/tm/guard.js +4 -7
- package/dist/tm/guard.js.map +1 -1
- package/dist/tm/index.d.ts +24 -7
- package/dist/tm/index.d.ts.map +1 -1
- package/dist/tm/index.js +111 -21
- package/dist/tm/index.js.map +1 -1
- package/dist/tm/memory.d.ts +88 -0
- package/dist/tm/memory.d.ts.map +1 -0
- package/dist/tm/memory.js +360 -0
- package/dist/tm/memory.js.map +1 -0
- package/dist/tm/pipelines.d.ts +58 -0
- package/dist/tm/pipelines.d.ts.map +1 -0
- package/dist/tm/pipelines.js +308 -0
- package/dist/tm/pipelines.js.map +1 -0
- package/dist/tm/preview.d.ts +6 -1
- package/dist/tm/preview.d.ts.map +1 -1
- package/dist/tm/preview.js +63 -13
- package/dist/tm/preview.js.map +1 -1
- package/dist/tm/ptc/budgets.d.ts +38 -0
- package/dist/tm/ptc/budgets.d.ts.map +1 -0
- package/dist/tm/ptc/budgets.js +59 -0
- package/dist/tm/ptc/budgets.js.map +1 -0
- package/dist/tm/ptc/contract.d.ts +131 -0
- package/dist/tm/ptc/contract.d.ts.map +1 -0
- package/dist/tm/ptc/contract.js +47 -0
- package/dist/tm/ptc/contract.js.map +1 -0
- package/dist/tm/ptc/driver.d.ts +37 -0
- package/dist/tm/ptc/driver.d.ts.map +1 -0
- package/dist/tm/ptc/driver.js +181 -0
- package/dist/tm/ptc/driver.js.map +1 -0
- package/dist/tm/ptc/engines.d.ts +32 -0
- package/dist/tm/ptc/engines.d.ts.map +1 -0
- package/dist/tm/ptc/engines.js +201 -0
- package/dist/tm/ptc/engines.js.map +1 -0
- package/dist/tm/ptc/gate.d.ts +28 -0
- package/dist/tm/ptc/gate.d.ts.map +1 -0
- package/dist/tm/ptc/gate.js +130 -0
- package/dist/tm/ptc/gate.js.map +1 -0
- package/dist/tm/ptc/index.d.ts +19 -0
- package/dist/tm/ptc/index.d.ts.map +1 -0
- package/dist/tm/ptc/index.js +15 -0
- package/dist/tm/ptc/index.js.map +1 -0
- package/dist/tm/ptc/pscan.d.ts +11 -0
- package/dist/tm/ptc/pscan.d.ts.map +1 -0
- package/dist/tm/ptc/pscan.js +27 -0
- package/dist/tm/ptc/pscan.js.map +1 -0
- package/dist/tm/ptc/summary.d.ts +17 -0
- package/dist/tm/ptc/summary.d.ts.map +1 -0
- package/dist/tm/ptc/summary.js +112 -0
- package/dist/tm/ptc/summary.js.map +1 -0
- package/dist/tm/ptc/tool.d.ts +35 -0
- package/dist/tm/ptc/tool.d.ts.map +1 -0
- package/dist/tm/ptc/tool.js +136 -0
- package/dist/tm/ptc/tool.js.map +1 -0
- package/dist/tm/ptc.d.ts +45 -26
- package/dist/tm/ptc.d.ts.map +1 -1
- package/dist/tm/ptc.js +71 -45
- package/dist/tm/ptc.js.map +1 -1
- package/dist/tm/result.d.ts +34 -0
- package/dist/tm/result.d.ts.map +1 -0
- package/dist/tm/result.js +87 -0
- package/dist/tm/result.js.map +1 -0
- package/dist/tm/search.d.ts +58 -0
- package/dist/tm/search.d.ts.map +1 -0
- package/dist/tm/search.js +229 -0
- package/dist/tm/search.js.map +1 -0
- package/dist/tm/shell-bridge.d.ts +22 -0
- package/dist/tm/shell-bridge.d.ts.map +1 -0
- package/dist/tm/shell-bridge.js +116 -0
- package/dist/tm/shell-bridge.js.map +1 -0
- package/dist/tm/store.d.ts.map +1 -1
- package/dist/tm/store.js +2 -1
- package/dist/tm/store.js.map +1 -1
- package/dist/tm/tools.d.ts +13 -71
- package/dist/tm/tools.d.ts.map +1 -1
- package/dist/tm/tools.js +22 -656
- package/dist/tm/tools.js.map +1 -1
- package/dist/tm/webfetch.d.ts +109 -0
- package/dist/tm/webfetch.d.ts.map +1 -0
- package/dist/tm/webfetch.js +305 -0
- package/dist/tm/webfetch.js.map +1 -0
- package/docs/installation.md +201 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,634 +1,544 @@
|
|
|
1
|
-
# OpenCode TeamMode
|
|
2
|
-
|
|
3
|
-
**[English](./README.md)** | **[中文](./README.zh-CN.md)**
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@te-river/opencode-team-mode)
|
|
6
|
-
[](https://www.npmjs.com/package/@te-river/opencode-team-mode)
|
|
7
|
-
[](./LICENSE)
|
|
8
|
-
|
|
9
|
-
> 🤝 **
|
|
10
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
content-aware preview
|
|
232
|
-
code signatures / binary metadata, hard-capped at
|
|
233
|
-
actually needs the payload it pages through
|
|
234
|
-
HMAC-signed, run-scoped, expiring handle. `tm_bash` only
|
|
235
|
-
commands (allowlist), and failures come back as structured
|
|
236
|
-
raw dumps.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
- **
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
- **
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
// Team Lead — orchestration earns your best model
|
|
546
|
-
"team": { "model": "anthropic/claude-opus-4-5" },
|
|
547
|
-
// specialists — cheaper models are usually fine
|
|
548
|
-
"implementer": { "model": "anthropic/claude-sonnet-4-6" }
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
(Model IDs above are placeholders — use whatever your provider exposes.
|
|
554
|
-
Your own `agent.team` definition always takes precedence over the plugin's.)
|
|
555
|
-
|
|
556
|
-
### Override an agent
|
|
557
|
-
|
|
558
|
-
Add an agent with the same name in your `opencode.json` — your definition takes precedence:
|
|
559
|
-
|
|
560
|
-
```jsonc
|
|
561
|
-
{
|
|
562
|
-
"agent": {
|
|
563
|
-
"reviewer": {
|
|
564
|
-
"model": "anthropic/claude-sonnet-4-6",
|
|
565
|
-
"prompt": "You are an extremely strict reviewer. Reject anything with a lint warning."
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
```
|
|
570
|
-
|
|
571
|
-
### Add your own agents
|
|
572
|
-
|
|
573
|
-
TeamMode does not prevent you from adding more agents. Define them alongside the team:
|
|
574
|
-
|
|
575
|
-
```jsonc
|
|
576
|
-
{
|
|
577
|
-
"agent": {
|
|
578
|
-
"devops": {
|
|
579
|
-
"mode": "subagent",
|
|
580
|
-
"description": "Handles CI/CD, Docker, and deployment tasks.",
|
|
581
|
-
"prompt": "You are the DevOps engineer..."
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
### Disable an agent
|
|
588
|
-
|
|
589
|
-
```jsonc
|
|
590
|
-
{
|
|
591
|
-
"agent": {
|
|
592
|
-
"researcher": { "disable": true }
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
---
|
|
598
|
-
|
|
599
|
-
## 📦 Publishing to npm
|
|
600
|
-
|
|
601
|
-
If you want to publish your own fork:
|
|
602
|
-
|
|
603
|
-
```bash
|
|
604
|
-
npm run build # compile TypeScript → dist/
|
|
605
|
-
npm version patch # bump version
|
|
606
|
-
npm publish # publish to npm registry
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
---
|
|
610
|
-
|
|
611
|
-
## 🤝 Contributing
|
|
612
|
-
|
|
613
|
-
Contributions are welcome! Areas where we need help:
|
|
614
|
-
|
|
615
|
-
- 🌐 **Localization** — Translate agent prompts to other languages
|
|
616
|
-
- 🎨 **More agent roles** — DevOps, DBA, Security Specialist, UX Designer
|
|
617
|
-
- 🔧 **Additional commands** — `/team-deploy`, `/team-docs`, `/team-refactor`
|
|
618
|
-
- 📝 **Better prompts** — Improve agent behavior through prompt engineering
|
|
619
|
-
|
|
620
|
-
---
|
|
621
|
-
|
|
622
|
-
## 📄 License
|
|
623
|
-
|
|
624
|
-
[Apache License 2.0](./LICENSE)
|
|
625
|
-
|
|
626
|
-
---
|
|
627
|
-
|
|
628
|
-
## 🔗 Links
|
|
629
|
-
|
|
630
|
-
- [npm Package](https://www.npmjs.com/package/@te-river/opencode-team-mode) — `@te-river/opencode-team-mode` on npm
|
|
631
|
-
- [OpenCode Desktop](https://opencode.ai) — Official website & download
|
|
632
|
-
- [OpenCode Docs](https://opencode.ai/docs) — Configuration & plugin documentation
|
|
633
|
-
- [OpenCode Plugin API](https://opencode.ai/docs/plugins) — Build your own plugins
|
|
634
|
-
- [OpenCode GitHub](https://github.com/anomalyco/opencode) — Source code for OpenCode itself
|
|
1
|
+
# OpenCode TeamMode
|
|
2
|
+
|
|
3
|
+
**[English](./README.md)** | **[中文](./README.zh-CN.md)**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@te-river/opencode-team-mode)
|
|
6
|
+
[](https://www.npmjs.com/package/@te-river/opencode-team-mode)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
> 🤝 **Your OpenCode just hired a team.**
|
|
10
|
+
>
|
|
11
|
+
> Six specialized agents — a Lead, an Architect, an Implementer, a Reviewer, a Tester and a Researcher — with governed tools, structured handoffs, and a plan-first approval gate. One plugin, zero config files to copy.
|
|
12
|
+
|
|
13
|
+
> 💡 **Best for medium-to-large projects.** The governance layer (approval gate, context offload, tool allowlists) is an asset once a codebase has real surface area — and mostly overhead on tiny scripts and one-off questions. Use it where the work is.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## TL;DR — skip the docs
|
|
18
|
+
|
|
19
|
+
> **The lazy path:** paste this to any coding agent and let it do the work:
|
|
20
|
+
>
|
|
21
|
+
> ```text
|
|
22
|
+
> Install the OpenCode plugin @te-river/opencode-team-mode following
|
|
23
|
+
> https://raw.githubusercontent.com/Te-River/Opencode-TeamMode/main/docs/installation.md
|
|
24
|
+
> Then verify the install using the checks in that guide.
|
|
25
|
+
> ```
|
|
26
|
+
>
|
|
27
|
+
> **The one command to remember afterwards:** `/team-run <task>` — the Team Lead
|
|
28
|
+
> plans it, shows you the plan, waits for your approval, then runs the whole team.
|
|
29
|
+
|
|
30
|
+
Everything else below is detail. When you're ready for it, here's the map:
|
|
31
|
+
|
|
32
|
+
**[Why](#-why-teammode) · [The team](#-the-team) · [Install](#-install) · [Usage](#-usage) · [Tools & security](#-governed-tools--security) · [Search](#-web-search-that-actually-works-in-china) · [Config](#️-configuration) · [How it works](#-how-the-team-works) · [FAQ](#-faq) · [Uninstall](#-uninstall)**
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 🤔 Why TeamMode?
|
|
37
|
+
|
|
38
|
+
Because a single agent doing everything is how you get: a context window stuffed
|
|
39
|
+
with 5000-line file dumps, twenty round-trips to `bash` for what one script could
|
|
40
|
+
do, sub-agents that silently read `.env`, and web "research" that is really just
|
|
41
|
+
the model's imagination.
|
|
42
|
+
|
|
43
|
+
TeamMode's answer to each:
|
|
44
|
+
|
|
45
|
+
| Pain | TeamMode's answer |
|
|
46
|
+
|---|---|
|
|
47
|
+
| 🔥 **Context flooding** | Every governed tool output over 2000 tokens is offloaded to a local run store and replaced by an 80-token preview + an HMAC handle. The agent pages through what it needs — the window never drowns. |
|
|
48
|
+
| 🐌 **Round-trip overhead** | `tm_ptc_run`: the agent writes ONE program that makes N governed calls in a single turn. Zero LLM round-trips during the run. |
|
|
49
|
+
| 🕳️ **Silent side effects** | R6/R2 approval gate: env-var reads and dangerous ops route through OpenCode's official confirmation dialog, auto-rejected after 10 unanswered minutes. The plugin never approves on its own — it only ever rejects. |
|
|
50
|
+
| 🌫️ **Hallucinated research** | Web access is a two-role grant with an allowlisted, governed tool chain. A fact that couldn't be fetched is reported as a gap — never fabricated. |
|
|
51
|
+
|
|
52
|
+
And the workflow discipline underneath: deterministic routing, a ≤30-line plan
|
|
53
|
+
you approve before ≥2 dispatches execute, structured `STATUS/CHANGES/FINDINGS/
|
|
54
|
+
EVIDENCE/HANDOFF` replies between agents, and static verification (build /
|
|
55
|
+
typecheck / tests) instead of vibes.
|
|
56
|
+
|
|
57
|
+
That discipline is also why the recommendation is **medium-to-large
|
|
58
|
+
projects**: on a two-file script the team simply has less to govern.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 👥 The team
|
|
63
|
+
|
|
64
|
+
| Agent | Role | When to use |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| 🎯 **Team Lead** (`@team`) | Orchestrator | Complex tasks that need planning + multi-step execution |
|
|
67
|
+
| 🏗️ **Architect** | System designer | Design docs, module structure, API contracts |
|
|
68
|
+
| 💻 **Implementer** | Code writer | Building features, writing production code |
|
|
69
|
+
| 🔍 **Reviewer** | Dimension-focused auditor | Single-dimension review by default; 3 in parallel only for high-risk changes |
|
|
70
|
+
| 🧪 **Tester** | Test engineer | Tests with real edge cases; static verification (build / typecheck / lint); governed UI verification via `tm_browser` |
|
|
71
|
+
| 🔎 **Researcher** | Knowledge finder | Local repo first, then the web — one of the two network roles (with the Lead) |
|
|
72
|
+
|
|
73
|
+
Out of the box, **Team is your default agent** — new chats open straight into the
|
|
74
|
+
orchestrator (opt-out in [Configuration](#-configuration)).
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 📦 Install
|
|
79
|
+
|
|
80
|
+
### Option 1 — Let your agent do it (recommended)
|
|
81
|
+
|
|
82
|
+
Copy this into any coding agent — it will edit your config, restart-remind you, and verify:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Install the OpenCode plugin @te-river/opencode-team-mode following
|
|
86
|
+
https://raw.githubusercontent.com/Te-River/Opencode-TeamMode/main/docs/installation.md
|
|
87
|
+
Then verify the install using the checks in that guide.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
(The guide is the complete manual procedure — config file locations, plugin
|
|
91
|
+
entry, restart, verification, update and uninstall. Your agent reads it and
|
|
92
|
+
executes it faithfully; there is nothing else it needs.)
|
|
93
|
+
|
|
94
|
+
### Option 2 — One-line script
|
|
95
|
+
|
|
96
|
+
macOS / Linux (bash):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
curl -fsSL https://ghproxy.net/https://raw.githubusercontent.com/Te-River/Opencode-TeamMode/main/scripts/install.sh | bash
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Windows (PowerShell):
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
irm https://ghproxy.net/https://raw.githubusercontent.com/Te-River/Opencode-TeamMode/main/scripts/install.ps1 | iex
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Option 3 — Manual
|
|
109
|
+
|
|
110
|
+
Add the plugin to your `opencode.jsonc`:
|
|
111
|
+
|
|
112
|
+
```jsonc
|
|
113
|
+
{
|
|
114
|
+
"$schema": "https://opencode.ai/config.json",
|
|
115
|
+
"plugin": [
|
|
116
|
+
"@te-river/opencode-team-mode@latest"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
OpenCode installs the plugin on next startup.
|
|
122
|
+
|
|
123
|
+
### ⚠️ Read this once, save yourself an hour later
|
|
124
|
+
|
|
125
|
+
- **Restart to activate.** After touching `opencode.json`, fully quit and restart OpenCode (Desktop: quit from tray, not just the window).
|
|
126
|
+
- **Plugin updates: re-run the installer.** It is idempotent — a re-run re-patches the config (no-op when present), purges the stale plugin cache, and re-resolves any npm-installed copy. This exists because OpenCode caches plugins by spec string and does NOT re-resolve `@latest` when a new version publishes (upstream limitation). Manual recipe, if you prefer:
|
|
127
|
+
|
|
128
|
+
| OS | Cache location |
|
|
129
|
+
|---|---|
|
|
130
|
+
| macOS / Linux | `rm -rf ~/.cache/opencode/packages/@te_river+opencode-team-mode@latest` |
|
|
131
|
+
| Windows | `Remove-Item -Recurse -Force "$env:LOCALAPPDATA\opencode\cache\packages\@te_river+opencode-team-mode@latest"` |
|
|
132
|
+
|
|
133
|
+
If you also npm-installed the plugin into `~/.config/opencode`, its package-lock pins the version — run `npm install @te-river/opencode-team-mode@latest` there too. Full recipe (including an agent-driven update prompt): [installation guide, Updating](./docs/installation.md).
|
|
134
|
+
- **Prerequisites:** [OpenCode](https://opencode.ai) (Desktop or CLI) and Node ≥ 18.
|
|
135
|
+
|
|
136
|
+
### Verify
|
|
137
|
+
|
|
138
|
+
Restart, open the agent picker, and look for **team, architect, implementer,
|
|
139
|
+
reviewer, tester, researcher**. That's it — the team is hired.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 📖 Usage
|
|
144
|
+
|
|
145
|
+
### Slash commands
|
|
146
|
+
|
|
147
|
+
| Command | Agent | Description |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| `/team-plan <task>` | Architect | Implementation plan with architecture, file manifest, task breakdown |
|
|
150
|
+
| `/team-implement <task>` | Implementer | Production code for a feature or task |
|
|
151
|
+
| `/team-review [scope]` | Reviewer | Audit for bugs, security issues, quality problems |
|
|
152
|
+
| `/team-test [scope]` | Tester | Comprehensive tests with edge-case coverage |
|
|
153
|
+
| `/team-research <topic>` | Researcher | Local repo first; web via the governed tools |
|
|
154
|
+
| `/team-run <task>` | Team Lead | **The full workflow** — plan → approval → orchestration → verification |
|
|
155
|
+
|
|
156
|
+
Or `@`-mention agents directly: `@team`, `@architect`, `@implementer`,
|
|
157
|
+
`@reviewer`, `@tester`, `@researcher`.
|
|
158
|
+
|
|
159
|
+
### What a run feels like
|
|
160
|
+
|
|
161
|
+
Team is the default agent out of the box, so you just type into a fresh chat:
|
|
162
|
+
|
|
163
|
+
> **You:** Add token-bucket rate limiting to our Express API — 100 requests per minute per user, return 429 when exceeded. Don't touch anything under `src/legacy/`.
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
team Route: product behavior change → implementer → tester → reviewer
|
|
167
|
+
(3 dispatches → approval gate applies)
|
|
168
|
+
|
|
169
|
+
PLAN
|
|
170
|
+
Goal: token-bucket limiter, 100 req/min/user, 429 + Retry-After
|
|
171
|
+
Scope: src/middleware/rateLimit.ts (new), src/app.ts (+3 lines)
|
|
172
|
+
Pipeline: implementer → tester → reviewer (correctness)
|
|
173
|
+
Assumption: in-memory bucket, not Redis — say the word to change
|
|
174
|
+
Boundary: src/legacy/** untouched
|
|
175
|
+
Approve to proceed?
|
|
176
|
+
|
|
177
|
+
you approved, go
|
|
178
|
+
|
|
179
|
+
team ▸ @implementer — STATUS: done
|
|
180
|
+
CHANGES: src/middleware/rateLimit.ts (new) · src/app.ts (+3)
|
|
181
|
+
EVIDENCE: tsc clean
|
|
182
|
+
|
|
183
|
+
▸ @tester — STATUS: done · VERDICT: pass (14/14)
|
|
184
|
+
FINDINGS: burst edge, window expiry, concurrent refill covered;
|
|
185
|
+
src/legacy/** byte-identical
|
|
186
|
+
|
|
187
|
+
▸ @reviewer — STATUS: done · VERDICT: approve (correctness)
|
|
188
|
+
|
|
189
|
+
team Done. rateLimit.ts (new) · app.ts (+3) · 14 tests green
|
|
190
|
+
review: approve · assumption: in-memory only · src/legacy/ untouched
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
You typed the task and four words. The plan was a routing-table lookup,
|
|
194
|
+
execution waited for your approval, and every handoff between agents traveled
|
|
195
|
+
as a structured skeleton — nothing landed in your repo, nothing was guessed.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🧰 Governed tools & security
|
|
200
|
+
|
|
201
|
+
Every tool TeamMode adds runs under ONE governance pipeline: outputs above
|
|
202
|
+
`TM_OFFLOAD_THRESHOLD` tokens never enter the context window — they are
|
|
203
|
+
offloaded to a run store and replaced by a content-aware preview plus an
|
|
204
|
+
HMAC-signed handle that the agent pages through with `tm_fetch` when it
|
|
205
|
+
genuinely needs the payload.
|
|
206
|
+
|
|
207
|
+
| Tool | What it does | Roles |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| `tm_read` / `tm_grep` / `tm_bash` / `tm_fetch` | Governed file read / regex search / read-only shell (allowlist) / paged handle retrieval | all six agents |
|
|
210
|
+
| `tm_memory` | Project + global memory store (Markdown + frontmatter): add / search / list / forget | all six agents |
|
|
211
|
+
| `tm_ptc_run` | Batch orchestration: one program, N governed calls, zero LLM round-trips | all six agents |
|
|
212
|
+
| `tm_search` | Multi-engine web search with extracted, deduplicated hit lists | Lead + Researcher |
|
|
213
|
+
| `tm_webfetch` | Single governed GET of an allowlisted page (search pages auto-extracted) | Lead + Researcher |
|
|
214
|
+
| `tm_browser` | Interactive browser session (headful CDP): open / navigate / read / screenshot / close | Lead + Researcher + Tester (UI verification) |
|
|
215
|
+
|
|
216
|
+
> **Fixed tool priority ladder (every task): ① TeamMode governed tools
|
|
217
|
+
> (`tm_*`) → ② user MCP/plugin tools → ③ the model's own reasoning.**
|
|
218
|
+
> It doubles as the fallback chain: when a governed tool errors (no browser
|
|
219
|
+
> on this host, blocked host), the agent says so and drops to the next rung.
|
|
220
|
+
|
|
221
|
+
All governed tools are **parallel-safe**: the host may run a batch of
|
|
222
|
+
`tm_search` / `tm_webfetch` / `tm_fetch` calls concurrently — each call gets
|
|
223
|
+
its own step id and its own payload, and nothing cross-contaminates
|
|
224
|
+
(proven by the parallel test suite).
|
|
225
|
+
|
|
226
|
+
### Context governance: offload, handles, previews
|
|
227
|
+
|
|
228
|
+
Large tool outputs are context cost's main driver — every step re-sends the
|
|
229
|
+
whole window. So results above `TM_OFFLOAD_THRESHOLD` tokens are written to a
|
|
230
|
+
local run store (`<repo>/.git/opencode-team/`, never your working tree) and
|
|
231
|
+
replaced by a handle with a content-aware preview: JSON keys / CSV header +
|
|
232
|
+
shape / log ERROR×N stats / code signatures / binary metadata, hard-capped at
|
|
233
|
+
80 tokens. When the agent actually needs the payload, it pages through with
|
|
234
|
+
`tm_fetch` using an HMAC-signed, run-scoped, expiring handle. `tm_bash` only
|
|
235
|
+
allows read-only commands (allowlist), and failures come back as structured
|
|
236
|
+
errors instead of raw dumps.
|
|
237
|
+
|
|
238
|
+
### Project + global memory (tm_memory)
|
|
239
|
+
|
|
240
|
+
Durable facts — build commands, environment quirks, architecture decisions,
|
|
241
|
+
your conventions — live as human-editable Markdown with frontmatter:
|
|
242
|
+
|
|
243
|
+
- **`project`** (default): `<repo>/.git/opencode-team/memories/…` — per checkout, git-adjacent.
|
|
244
|
+
- **`global`**: `~/.opencode-team/memories/global/` (override `TM_MEMORY_GLOBAL_DIR`) — **follows you across ALL projects**.
|
|
245
|
+
|
|
246
|
+
Actions: `add` / `search` (deterministic keyword scoring) / `list` / `forget`;
|
|
247
|
+
4000 chars per memory. Agents are prompted to search before assuming
|
|
248
|
+
conventions and to save hard-won facts for the next conversation.
|
|
249
|
+
|
|
250
|
+
### 🌐 Web search that actually works (in China)
|
|
251
|
+
|
|
252
|
+
`tm_search` is the open-ended-lookup front: **one call, one query, clean
|
|
253
|
+
results**. The engine URL is built for you, fetched through the governed
|
|
254
|
+
pipeline, and collapsed into a numbered title+URL hit list — the agent never
|
|
255
|
+
sees raw SERP chrome.
|
|
256
|
+
|
|
257
|
+
| Engine | Notes |
|
|
258
|
+
|---|---|
|
|
259
|
+
| `bing` (default) | cn.bing.com; `bing-int` forces international results (`ensearch=1`) |
|
|
260
|
+
| `sogou` / `so` (360) | CN-native engines, good for CJK content |
|
|
261
|
+
| `baidu` | flakiest (anti-bot) but sometimes the only CN-specific index; failures name alternatives |
|
|
262
|
+
| `bilibili` | video search |
|
|
263
|
+
| `moegirl` | MediaWiki search API — entry titles + snippets, structured |
|
|
264
|
+
| `npm` | registry search → name@version + description, structured |
|
|
265
|
+
| `github` | repo search API → stars + description, structured |
|
|
266
|
+
|
|
267
|
+
All nine engines are reachable from mainland China **without API keys**, and
|
|
268
|
+
every one of them sits on the seeded domain allowlist. On an empty result
|
|
269
|
+
(an anti-bot shell), the error names the alternative engines instead of
|
|
270
|
+
leaving the agent stuck. Two more channels complete the surface:
|
|
271
|
+
|
|
272
|
+
- `tm_webfetch` — a known URL, one governed GET. Search-engine pages it
|
|
273
|
+
fetches are auto-extracted to hit lists too. JSON endpoints like
|
|
274
|
+
`registry.npmjs.org/<pkg>/latest` pass through untouched.
|
|
275
|
+
- `tm_browser` — JS-rendered pages: your own Chromium-family browser, headful
|
|
276
|
+
via CDP pipe, isolated temp profile, **domain allowlist enforced at the
|
|
277
|
+
network layer** per request (`Fetch.requestPaused` → non-allowlisted hosts
|
|
278
|
+
get `BlockedByClient`).
|
|
279
|
+
|
|
280
|
+
Seeded allowlist (both tools): `mobile.moegirl.org.cn`, `search.bilibili.com`,
|
|
281
|
+
`cn.bing.com`, `www.bing.com`, `www.baidu.com`, `www.sogou.com`, `www.so.com`,
|
|
282
|
+
`registry.npmjs.org`, `api.github.com` — extend via
|
|
283
|
+
`TM_WEBFETCH_ALLOWED_DOMAINS` (`"*"` opens every host). Architect /
|
|
284
|
+
implementer / reviewer have NO network grant — web questions come back as a
|
|
285
|
+
reported gap, never simulated. The tester carries `tm_browser` ONLY, for
|
|
286
|
+
governed UI verification of the project (local dev servers, preview routes);
|
|
287
|
+
open web fetching stays with the two network roles.
|
|
288
|
+
|
|
289
|
+
### Security: the R6 + R2 approval gate
|
|
290
|
+
|
|
291
|
+
**R6 environment protection.** With TeamMode active, the model cannot read
|
|
292
|
+
environment variables silently. Env reads (`printenv`, `env`, `Get-ChildItem
|
|
293
|
+
env:`, …) and env files (`.env`, shell rc) route through OpenCode's official
|
|
294
|
+
confirmation dialog; unanswered prompts are **auto-rejected after
|
|
295
|
+
`TM_ASK_TIMEOUT_MIN` (default 10 min)**. Env reads no wildcard can express
|
|
296
|
+
(embedded `$VAR` / `${VAR}` / `$env:` inside another command, command
|
|
297
|
+
substitution) and the `tm_*` wrapper channel stay a **hard block** — no dialog
|
|
298
|
+
to slip through. The audit log records only tool name + pattern category +
|
|
299
|
+
verdict — never command text, paths, variable names or values.
|
|
300
|
+
|
|
301
|
+
**R2 dangerous operations (same dialog).** Delete, git publish, network
|
|
302
|
+
fetch, package install/publish, process/system, privilege changes — none are
|
|
303
|
+
silently allowed. The normal verification stack (`npm test`, `tsc`,
|
|
304
|
+
`git status`) is NOT gated, so day-to-day work runs uninterrupted.
|
|
305
|
+
|
|
306
|
+
> ⚠️ **When you approve a dialog, pick "once" — not "always".** Verified on
|
|
307
|
+
> the live host, "always" records a far broader rule than the command you
|
|
308
|
+
> saw: approving `Get-ChildItem env:PATH` with "always" stores `Get-ChildItem
|
|
309
|
+
> *`, so every later `Get-ChildItem` runs with no dialog at all.
|
|
310
|
+
|
|
311
|
+
> Deferral to the dialog is per-session: env reads only route to the dialog
|
|
312
|
+
> in sessions running TeamMode's injected agents. In any other session the
|
|
313
|
+
> guard keeps hard-blocking env reads. `headless opencode run` auto-rejects
|
|
314
|
+
> unanswered `ask`s immediately (there is no human to prompt).
|
|
315
|
+
|
|
316
|
+
### Repo hygiene
|
|
317
|
+
|
|
318
|
+
The offload/trajectory/memory stores live under `<repo>/.git/opencode-team/`
|
|
319
|
+
(or the OS temp dir outside a git repo) — **never your working tree**. Every
|
|
320
|
+
agent is instructed to delete scratch files before reporting done and to keep
|
|
321
|
+
throwaway work in the OS temp dir. A TTL sweeper reclaims old task dirs at
|
|
322
|
+
startup + hourly; the Team Lead never deletes boards itself, so you can audit
|
|
323
|
+
any run.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## ⚙️ Configuration
|
|
328
|
+
|
|
329
|
+
The plugin injects everything at startup — no agent files to copy.
|
|
330
|
+
|
|
331
|
+
> **Model choice matters.** Every judgment — triage, decomposition, dispatch
|
|
332
|
+
> briefs, synthesis, review verdicts — flows through the Team Lead. A weak
|
|
333
|
+
> model in that seat degrades the whole pipeline no matter how strong the
|
|
334
|
+
> specialists are. Pin your best reasoning model to `team`:
|
|
335
|
+
|
|
336
|
+
```jsonc
|
|
337
|
+
{
|
|
338
|
+
"agent": {
|
|
339
|
+
"team": { "model": "anthropic/claude-opus-4-5" }, // Lead earns your best model
|
|
340
|
+
"implementer": { "model": "anthropic/claude-sonnet-4-6" } // specialists tolerate cheaper
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Global install** — put the plugin entry in `~/.config/opencode/opencode.jsonc` and every project gets the team.
|
|
346
|
+
|
|
347
|
+
**Keep Team off the default slot:**
|
|
348
|
+
|
|
349
|
+
```jsonc
|
|
350
|
+
{
|
|
351
|
+
"plugin": [
|
|
352
|
+
["@te-river/opencode-team-mode@latest", { "defaultAgent": false }]
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Your own agents named `team` / `architect` / … always take precedence; the
|
|
358
|
+
plugin never clobbers user definitions. See [Customization](#-customization)
|
|
359
|
+
for overrides, extra agents and disabling roles.
|
|
360
|
+
|
|
361
|
+
### Environment variables
|
|
362
|
+
|
|
363
|
+
| Env var | Default | Purpose |
|
|
364
|
+
|---|---|---|
|
|
365
|
+
| `TM_ENV_PROTECT` | `strict` | R6 mode: `strict` / `standard` / `off` (off also disarms the approval timer) |
|
|
366
|
+
| `TM_ASK_TIMEOUT_MIN` | `10` | minutes before an unanswered dialog is auto-rejected (hard floor 3 — the host's reply event reaches the plugin ~120 s late) |
|
|
367
|
+
| `TM_ENV_PROTECT_EXTRA_DENY` | — | extra block patterns (regex; always hard block, never dialog-governed) |
|
|
368
|
+
| `TM_OFFLOAD_THRESHOLD` | `2000` | offload threshold (tokens, CJK-aware estimate) |
|
|
369
|
+
| `TM_PREVIEW_MAX_TOKENS` | `80` | preview hard cap |
|
|
370
|
+
| `TM_FETCH_MAX_LINES` | `2000` | tm_fetch page cap |
|
|
371
|
+
| `TM_BLACKBOARD_DIR` / `TM_TRAJECTORY_DIR` | `<repo>/.git/opencode-team/…` | offload store / trajectory ledger (tmpdir fallback; explicit = absolute or project-relative) |
|
|
372
|
+
| `TM_BLACKBOARD_TTL` | `7` | store retention (days) |
|
|
373
|
+
| `TM_BASH_READONLY_ALLOWED` | built-in table | tm_bash allowlist |
|
|
374
|
+
| `TM_WEBFETCH_ALLOWED_DOMAINS` | the nine seeded hosts | tm_webfetch / tm_search / tm_browser allowlist (`"*"` opens all; empty = deny all) |
|
|
375
|
+
| `TM_BROWSER_PATH` | auto-detect | tm_browser executable override (Edge/Chrome/Chromium per OS) |
|
|
376
|
+
| `TM_BROWSER_HEADLESS` | `auto` | `1` headless (CI) / `0` headful / `auto` (headless only on display-less Linux) |
|
|
377
|
+
| `TM_MEMORY_GLOBAL_DIR` | `~/.opencode-team/memories/global/` | tm_memory GLOBAL scope store |
|
|
378
|
+
| `TM_PTC_MAX_PROGRAM_CHARS` | `4000` | PTC program source cap |
|
|
379
|
+
| `TM_PTC_MAX_CALLS` | `20` | PTC per-run bridge-call budget (1–200) |
|
|
380
|
+
| `TM_PTC_MAX_ERRORS` | `3` | PTC per-run error budget (1–50) |
|
|
381
|
+
| `TM_PTC_TIMEOUT_MS` | `60000` | PTC per-run wall-clock timeout (5s–10min) |
|
|
382
|
+
| `TM_PTC_ENGINE` | `auto` | `auto` (worker→inline degrade) / `worker` / `inline` |
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 🏗️ How the team works
|
|
387
|
+
|
|
388
|
+
Sub-agents can't message each other live (platform limitation), so TeamMode
|
|
389
|
+
coordinates them through a **structured reply skeleton** — every specialist
|
|
390
|
+
reply is `STATUS: / CHANGES: / FINDINGS: / EVIDENCE: / HANDOFF:`, ≤50 lines,
|
|
391
|
+
relayed verbatim by the Lead into the next dispatch. Files are the exception,
|
|
392
|
+
not the rule: a deliverable over ~50 lines goes to ONE named board file under
|
|
393
|
+
`<repo>/.git/opencode-team/` (round-suffixed, working tree untouched).
|
|
394
|
+
|
|
395
|
+
- **Routing table:** question → direct answer; docs-only → implementer;
|
|
396
|
+
product change → implementer → tester → reviewer; multi-module →
|
|
397
|
+
architect → implementer → tester → reviewer(s); unknown tech → researcher
|
|
398
|
+
first. Fixed minimums — a product change routed below 3 dispatches is a
|
|
399
|
+
routing bug.
|
|
400
|
+
- **Approval gate (count-based):** ≥2 dispatches → plan (≤30 lines) → **your
|
|
401
|
+
approval** → execute. Blocking questions are batched and asked immediately.
|
|
402
|
+
- **Adaptive review:** one reviewer by default; three parallel dimensions
|
|
403
|
+
only for high-risk profiles (auth/security, cross-module contracts, public APIs).
|
|
404
|
+
- **Static verification:** build / typecheck / lint / tests. Improvised
|
|
405
|
+
browser automation is banned; unverified UI work ends with
|
|
406
|
+
`UI NOT VERIFIED: <what to check>`.
|
|
407
|
+
- **Evidence standard:** "done / fixed / passed" claims need verifiable
|
|
408
|
+
evidence — output, logs, diffs.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## 🔧 Customization
|
|
413
|
+
|
|
414
|
+
**Override an agent** — same name in your config wins:
|
|
415
|
+
|
|
416
|
+
```jsonc
|
|
417
|
+
{
|
|
418
|
+
"agent": {
|
|
419
|
+
"reviewer": {
|
|
420
|
+
"model": "anthropic/claude-sonnet-4-6",
|
|
421
|
+
"prompt": "You are an extremely strict reviewer. Reject anything with a lint warning."
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
**Add your own agents** alongside the team:
|
|
428
|
+
|
|
429
|
+
```jsonc
|
|
430
|
+
{
|
|
431
|
+
"agent": {
|
|
432
|
+
"devops": {
|
|
433
|
+
"mode": "subagent",
|
|
434
|
+
"description": "Handles CI/CD, Docker, and deployment tasks.",
|
|
435
|
+
"prompt": "You are the DevOps engineer..."
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**Disable one:** `"researcher": { "disable": true }`.
|
|
442
|
+
|
|
443
|
+
**Board retention** via the tuple form: `["@te-river/opencode-team-mode@latest", { "ttlDays": 7 }]` (valid range (0, 365], invalid values fall back to 5).
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## ❓ FAQ
|
|
448
|
+
|
|
449
|
+
**Will this eat my tokens?**
|
|
450
|
+
The opposite is the point. Offload + 80-token previews + PTC batch programs
|
|
451
|
+
exist because a five-agent pipeline naively bolted onto one context window
|
|
452
|
+
*would* eat your tokens. The governance is the token-saver.
|
|
453
|
+
|
|
454
|
+
**Is the web access safe?**
|
|
455
|
+
It's the most guarded surface in the plugin: two full web roles plus a
|
|
456
|
+
browser-only tester grant, domain
|
|
457
|
+
allowlist, redirects re-checked per hop, network-layer enforcement in the
|
|
458
|
+
browser, env-file URL refusal, and every payload rides the same offload
|
|
459
|
+
governance. No allowlisted page can bounce the fetch off-site.
|
|
460
|
+
|
|
461
|
+
**Why doesn't the plugin auto-update?**
|
|
462
|
+
OpenCode caches plugins by spec string and never re-resolves `@latest`
|
|
463
|
+
(upstream limitation, not ours). **Re-run the installer — that IS the
|
|
464
|
+
update** (it purges the cache and re-resolves npm copies); or delete the
|
|
465
|
+
cache dir by hand. Recipe above and in the
|
|
466
|
+
[installation guide](./docs/installation.md).
|
|
467
|
+
|
|
468
|
+
**Can agents run tools in parallel?**
|
|
469
|
+
Yes — and they're *engineered* for it: parallel `tm_search` / `tm_webfetch` /
|
|
470
|
+
`tm_fetch` calls get distinct step ids and isolated payloads. A regression
|
|
471
|
+
here fails the test suite before it ever reaches you.
|
|
472
|
+
|
|
473
|
+
**Does it work in the CLI (TUI), or only Desktop?**
|
|
474
|
+
Both. Desktop adds the color-coded picker and panels; the governed tools and
|
|
475
|
+
the whole workflow are host-agnostic. On display-less Linux, `tm_browser`
|
|
476
|
+
runs headless automatically.
|
|
477
|
+
|
|
478
|
+
**What happens if I don't answer a confirmation dialog?**
|
|
479
|
+
It auto-rejects after `TM_ASK_TIMEOUT_MIN` (default 10). The plugin never
|
|
480
|
+
self-approves — the only side it can take is yours or nobody's.
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## 🗑️ Uninstall
|
|
485
|
+
|
|
486
|
+
1. Remove the entry from the `"plugin"` array in your config file.
|
|
487
|
+
2. Delete the cache dir (table in [Install](#-read-this-once-save-yourself-an-hour-later)) if you want the disk space back.
|
|
488
|
+
3. Restart OpenCode. The agents, commands and tools are gone; the stores under `<repo>/.git/opencode-team/` (and `~/.opencode-team/` for global memories) are plain files you can delete whenever.
|
|
489
|
+
|
|
490
|
+
No DLLs were harmed. Nothing was written to your working tree.
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## 🏛️ Architecture (for the curious)
|
|
495
|
+
|
|
496
|
+
```
|
|
497
|
+
opencode-team-mode/
|
|
498
|
+
├── src/
|
|
499
|
+
│ ├── index.ts ← Plugin entry (config + R6 guard + approval gate + tool segment)
|
|
500
|
+
│ ├── agents.ts ← Agent structure (modes, colors, temperatures, whitelist matrix)
|
|
501
|
+
│ ├── prompts/ ← Agent prompts (lead / specialists / shared) — pinned by tests
|
|
502
|
+
│ ├── commands.ts ← Slash command definitions
|
|
503
|
+
│ ├── blackboard.ts ← Shared blackboard + TTL sweeper
|
|
504
|
+
│ ├── envprotect.ts ← R6 facade (patterns / classifiers / gate predicates / hook)
|
|
505
|
+
│ ├── approval-gate.ts ← Unified approval gate (dialog timeout auto-reject)
|
|
506
|
+
│ ├── tm/ ← Governed tools: pipelines / store / preview / guard / refs /
|
|
507
|
+
│ │ webfetch / search / memory / browser / shell-bridge / ptc/ (9 modules)
|
|
508
|
+
│ └── types.ts ← Loader-contract types (1.18.x)
|
|
509
|
+
├── docs/installation.md ← The agent-consumable install guide
|
|
510
|
+
├── scripts/ ← One-line installers (bash / PowerShell)
|
|
511
|
+
├── pt07/ ← PT-07 baseline suite (seeded A/B token measurement)
|
|
512
|
+
└── README.*.md ← You are here (twice)
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
The loader calls `server(input, options)` once: the `config` hook injects the
|
|
516
|
+
six agents and six commands, the same call installs the R6
|
|
517
|
+
`tool.execute.before` guard, arms the approval gate through an `event` hook,
|
|
518
|
+
and registers the `tm_*` tools. User-defined agents with the same name always
|
|
519
|
+
win — the plugin never clobbers.
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## 🤝 Contributing
|
|
524
|
+
|
|
525
|
+
Issues and PRs welcome. Especially wanted: localization of agent prompts,
|
|
526
|
+
more agent roles, more command templates, and real-world reports of the
|
|
527
|
+
search engines' behavior (they rearrange their markup; the extractor filters
|
|
528
|
+
are intentionally loose but not psychic).
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## 📄 License
|
|
533
|
+
|
|
534
|
+
[Apache License 2.0](./LICENSE)
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## 🔗 Links
|
|
539
|
+
|
|
540
|
+
- [npm Package](https://www.npmjs.com/package/@te-river/opencode-team-mode) — `@te-river/opencode-team-mode`
|
|
541
|
+
- [Installation guide](./docs/installation.md) — the complete manual / agent-consumable procedure
|
|
542
|
+
- [OpenCode Desktop](https://opencode.ai) — Official website & download
|
|
543
|
+
- [OpenCode Docs](https://opencode.ai/docs) — Configuration & plugin documentation
|
|
544
|
+
- [OpenCode Plugin API](https://opencode.ai/docs/plugins) — Build your own plugins
|