@te-river/opencode-team-mode 1.5.1 â 1.5.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 +109 -14
- package/README.zh-CN.md +92 -13
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +128 -26
- package/dist/agents.js.map +1 -1
- package/dist/approval-gate.d.ts +147 -0
- package/dist/approval-gate.d.ts.map +1 -0
- package/dist/approval-gate.js +471 -0
- package/dist/approval-gate.js.map +1 -0
- package/dist/commands.js +3 -3
- package/dist/commands.js.map +1 -1
- package/dist/envprotect.d.ts +115 -4
- package/dist/envprotect.d.ts.map +1 -1
- package/dist/envprotect.js +364 -11
- package/dist/envprotect.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -2
- package/dist/index.js.map +1 -1
- package/dist/tm/config.d.ts +34 -0
- package/dist/tm/config.d.ts.map +1 -1
- package/dist/tm/config.js +21 -0
- package/dist/tm/config.js.map +1 -1
- package/dist/tm/guard.js +4 -4
- package/dist/tm/guard.js.map +1 -1
- package/dist/tm/index.d.ts +4 -2
- package/dist/tm/index.d.ts.map +1 -1
- package/dist/tm/index.js +32 -2
- package/dist/tm/index.js.map +1 -1
- package/dist/tm/ptc.d.ts +279 -0
- package/dist/tm/ptc.d.ts.map +1 -0
- package/dist/tm/ptc.js +839 -0
- package/dist/tm/ptc.js.map +1 -0
- package/dist/tm/tools.d.ts +16 -0
- package/dist/tm/tools.d.ts.map +1 -1
- package/dist/tm/tools.js +5 -1
- package/dist/tm/tools.js.map +1 -1
- package/dist/types.d.ts +104 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ In **OpenCode Desktop**, you get additional UX benefits:
|
|
|
218
218
|
|
|
219
219
|
---
|
|
220
220
|
|
|
221
|
-
## đ§Ż Context governance (tm_* + R6) â new in v1.5.1
|
|
221
|
+
## đ§Ż Context governance (tm_* + R6 + R2) â new in v1.5.1
|
|
222
222
|
|
|
223
223
|
> â ď¸ Requires `@te-river/opencode-team-mode@1.5.1` or later (released
|
|
224
224
|
> 2026-09-08). If your config pins `@latest`, OpenCode upgrades on next start.
|
|
@@ -235,18 +235,56 @@ HMAC-signed, run-scoped, expiring handle. `tm_bash` only allows read-only
|
|
|
235
235
|
commands (allowlist), and failures come back as structured errors instead of
|
|
236
236
|
raw dumps.
|
|
237
237
|
|
|
238
|
-
**R6 environment protection.** With TeamMode active,
|
|
239
|
-
model
|
|
240
|
-
`Get-ChildItem env:`, âŚ)
|
|
241
|
-
files
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
**R6 environment protection (now an approval gate).** With TeamMode active,
|
|
239
|
+
the model cannot read environment variables silently. Env-var reads
|
|
240
|
+
(`printenv`, `env`, `Get-ChildItem env:`, âŚ) and env files (`.env`, shell rc
|
|
241
|
+
files) route through OpenCode's **official confirmation dialog**: you get a
|
|
242
|
+
native prompt to approve or deny, and an unanswered prompt is **auto-rejected
|
|
243
|
+
after `TM_ASK_TIMEOUT_MIN` (default 10 min)** â the plugin only ever rejects
|
|
244
|
+
on timeout, never approves on the model's behalf. Env reads that no wildcard
|
|
245
|
+
can express (embedded `$VAR` / `${VAR}` / `$env:` inside another command,
|
|
246
|
+
command substitution, subshell/escaped forms) and the `tm_*` wrapper channel
|
|
247
|
+
stay a **hard block** (no dialog to slip through). tm_* wrappers route through
|
|
248
|
+
the same checks (no backdoor via the wrappers). Audit lines record only tool
|
|
249
|
+
name + pattern category + the verdict (`ask` / `allowed-once` /
|
|
250
|
+
`allowed-always` / `rejected` / `timeout-rejected` / `degraded`) â never
|
|
251
|
+
command text, paths, variable names or values.
|
|
252
|
+
|
|
253
|
+
**R2 dangerous operations (same dialog).** Delete (`rm`/`del`/`Remove-Item`/
|
|
254
|
+
`rmdir`), git publishing (`git push`/`git commit`), network fetch (`curl`/
|
|
255
|
+
`wget`/`Invoke-WebRequest`/`Invoke-RestMethod`), package installs/publishes
|
|
256
|
+
(`npm install`/`npm publish`/`pip install`/`winget`/`choco`), process/system
|
|
257
|
+
(`taskkill`/`Stop-Process`/`kill`/`shutdown`/`format`) and privilege changes
|
|
258
|
+
(`chmod`/`takeown`/`icacls`) â none are silently allowed. They pop the same
|
|
259
|
+
official dialog and are auto-rejected if you don't answer within the timeout.
|
|
260
|
+
The normal verification stack (`npm test`, `tsc`, `git status`/`diff`) is NOT
|
|
261
|
+
gated, so day-to-day team work runs without interruption.
|
|
262
|
+
|
|
263
|
+
> â ď¸ **When you approve a dialog, pick "once" â not "always".** Verified on
|
|
264
|
+
> the live host, "always" records a far broader rule than the command you
|
|
265
|
+
> saw: approving `Get-ChildItem env:PATH` with "always" stores `Get-ChildItem
|
|
266
|
+
> *`, so every later `Get-ChildItem` runs with no dialog at all. Only the
|
|
267
|
+
> once-verdict keeps each gated operation individually human-checked.
|
|
268
|
+
|
|
269
|
+
> Deferral is per-session: env reads only route to the dialog in sessions
|
|
270
|
+
> running TeamMode's injected agents (or after such a session has shown one
|
|
271
|
+
> of these dialogs). In any other session (e.g. a stock `build`/`plan` chat)
|
|
272
|
+
> TeamMode's guard keeps hard-blocking env reads, since no dialog would back
|
|
273
|
+
> them there. Compound commands (`a; b`) are evaluated per segment by the
|
|
274
|
+
> host and approved through one dialog; the guard blocks them outright
|
|
275
|
+
> whenever any segment is an env read.
|
|
276
|
+
|
|
277
|
+
> The permission protocol was verified against a live `opencode serve` host
|
|
278
|
+
> (1.18.29) via SSE event capture; the Desktop dialog rendering itself is the
|
|
279
|
+
> one leg that still needs eyeballing in a real Desktop session. Headless
|
|
280
|
+
> `opencode run` auto-rejects an unanswered `ask` immediately (there is no
|
|
281
|
+
> human to prompt).
|
|
245
282
|
|
|
246
283
|
| Env var | Default | Purpose |
|
|
247
284
|
|---|---|---|
|
|
248
|
-
| `TM_ENV_PROTECT` | `strict` | R6 mode: `strict` / `standard` / `off` |
|
|
249
|
-
| `
|
|
285
|
+
| `TM_ENV_PROTECT` | `strict` | R6 mode: `strict` / `standard` / `off` (off also disarms the approval timer) |
|
|
286
|
+
| `TM_ASK_TIMEOUT_MIN` | `10` | minutes before an unanswered R6/R2 confirmation dialog is auto-rejected; minimum 3 minutes (the host's `permission.replied` reaches the plugin ~120 s late on the event bus â shorter values would auto-reject a just-approved request) |
|
|
287
|
+
| `TM_ENV_PROTECT_EXTRA_DENY` | â | extra block patterns (regex list; always a hard block, never dialog-governed) |
|
|
250
288
|
| `TM_OFFLOAD_THRESHOLD` | `2000` | offload threshold (tokens, chars/4 estimate) |
|
|
251
289
|
| `TM_PREVIEW_MAX_TOKENS` | `80` | preview hard cap |
|
|
252
290
|
| `TM_FETCH_MAX_LINES` | `2000` | tm_fetch page cap |
|
|
@@ -254,6 +292,62 @@ category â never command text, paths, variable names or values.
|
|
|
254
292
|
| `TM_TRAJECTORY_DIR` | `.trajectory/` | append-only tool-call ledger |
|
|
255
293
|
| `TM_BLACKBOARD_TTL` | `7` | store retention (days) |
|
|
256
294
|
| `TM_BASH_READONLY_ALLOWED` | built-in table | tm_bash allowlist |
|
|
295
|
+
| `TM_PTC_MAX_PROGRAM_CHARS` | `4000` | PTC program source length cap (chars) |
|
|
296
|
+
| `TM_PTC_MAX_CALLS` | `20` | PTC per-run bridge-call budget (1â200) |
|
|
297
|
+
| `TM_PTC_MAX_ERRORS` | `3` | PTC per-run error budget (1â50) |
|
|
298
|
+
| `TM_PTC_TIMEOUT_MS` | `60000` | PTC per-run wall-clock timeout (5sâ10min) |
|
|
299
|
+
| `TM_PTC_ENGINE` | `auto` | PTC engine: `auto` (workerâinline degrade) / `worker` / `inline` |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## ⥠Batch orchestration (`tm_ptc_run`) â new in v1.5.2
|
|
304
|
+
|
|
305
|
+
> Shipped in **v1.5.2** (2026-09-10). Requires `@te-river/opencode-team-mode@1.5.2`
|
|
306
|
+
> or later.
|
|
307
|
+
|
|
308
|
+
`tm_ptc_run` lets a specialist agent write **one async program** that makes N
|
|
309
|
+
governed `tm_*` calls in a single turn â zero LLM round-trips during the run,
|
|
310
|
+
only an aggregation summary returns to context. It is designed for batch
|
|
311
|
+
read-only tasks: multi-file reconnaissance, bulk grep + read aggregation,
|
|
312
|
+
cross-referencing search results.
|
|
313
|
+
|
|
314
|
+
### How it works
|
|
315
|
+
|
|
316
|
+
The agent writes a program body using `tm.read(args)`, `tm.grep(args)`,
|
|
317
|
+
`tm.bash(args)`, `tm.fetch(args)` â same args as the four governed tools.
|
|
318
|
+
Each call returns `{ok:true, data}` (governed: inline text or an offload
|
|
319
|
+
handle) or `{ok:false, error:{tool,phase,line?,message}}`. The program
|
|
320
|
+
`return`s a value; it is JSON-serialized into the aggregation summary.
|
|
321
|
+
|
|
322
|
+
Programs containing `require`, `import`, `process`, `globalThis`, `Deno`,
|
|
323
|
+
`Bun`, `fs`, `net`, or `child_process` are rejected before execution (static
|
|
324
|
+
pre-scan, auxiliary guard).
|
|
325
|
+
|
|
326
|
+
### Budgets (tighten-only)
|
|
327
|
+
|
|
328
|
+
The caller may tighten `max_calls`, `max_errors`, and `timeout_ms` â values
|
|
329
|
+
above the `TM_PTC_*` ceilings are clamped down; values below the floor are
|
|
330
|
+
clamped up. Hitting any budget stops the whole run; produced output is NOT
|
|
331
|
+
lost.
|
|
332
|
+
|
|
333
|
+
### Engine (`TM_PTC_ENGINE`)
|
|
334
|
+
|
|
335
|
+
| Mode | Behavior |
|
|
336
|
+
|---|---|
|
|
337
|
+
| `auto` (default) | Tries `worker_threads` first; on failure degrades to `node:vm` with a `degraded-engine` mark in the summary |
|
|
338
|
+
| `worker` | Forces the worker engine (engine-error on failure) |
|
|
339
|
+
| `inline` | Forces the `node:vm` engine (30s compile timeout for sync busy-loops; await-gap residual documented) |
|
|
340
|
+
|
|
341
|
+
The worker engine runs the program in a dedicated thread with `env:{}`
|
|
342
|
+
(process.env emptied), `resourceLimits`, and hard wall-clock `terminate()`.
|
|
343
|
+
All governance (P2 path scope, P3 allowlist, R6, threshold offload, TTL)
|
|
344
|
+
applies to every bridged call â PTC is not a bypass layer.
|
|
345
|
+
|
|
346
|
+
### Access
|
|
347
|
+
|
|
348
|
+
Five specialist agents (`implementer`, `tester`, `architect`, `reviewer`,
|
|
349
|
+
`researcher`) have `tm_ptc_run` in their whitelist. The `team` lead does
|
|
350
|
+
not â it orchestrates, it does not run batch programs itself.
|
|
257
351
|
|
|
258
352
|
---
|
|
259
353
|
|
|
@@ -264,12 +358,13 @@ opencode-team-mode/
|
|
|
264
358
|
âââ package.json â npm package definition
|
|
265
359
|
âââ tsconfig.json â TypeScript config
|
|
266
360
|
âââ src/
|
|
267
|
-
â âââ index.ts â Plugin entry (server(): config + R6 tool.execute.before + tool segment)
|
|
361
|
+
â âââ index.ts â Plugin entry (server(): config + R6 tool.execute.before + approval-gate event + tool segment)
|
|
268
362
|
â âââ agents.ts â Agent definitions (prompts, modes, colors)
|
|
269
363
|
â âââ commands.ts â Command definitions (templates, agent bindings)
|
|
270
364
|
â âââ blackboard.ts â Shared blackboard + TTL auto-cleanup sweeper
|
|
271
|
-
â âââ envprotect.ts â R6 env-var read protection
|
|
272
|
-
â âââ
|
|
365
|
+
â âââ envprotect.ts â R6 env-var read protection + R2 ask-pattern sets (dialog vs hard-block)
|
|
366
|
+
â âââ approval-gate.ts â Unified approval gate: host-dialog timeout auto-reject (never self-allows)
|
|
367
|
+
â âââ tm/ â JIT layer-2 tools (tm_read / tm_grep / tm_bash / tm_fetch / tm_ptc_run)
|
|
273
368
|
â âââ types.ts â Loader-contract type definitions (1.18.x)
|
|
274
369
|
âââ scripts/
|
|
275
370
|
â âââ install.sh â One-click installer (bash)
|
|
@@ -284,7 +379,7 @@ opencode-team-mode/
|
|
|
284
379
|
|
|
285
380
|
1. OpenCode Desktop starts and loads `opencode.json(c)`.
|
|
286
381
|
2. It sees `"@te-river/opencode-team-mode@latest"` in the `plugin` array and loads the npm package.
|
|
287
|
-
3. The loader calls the plugin's `server(input, options)`, which registers a `config` hook; the hook injects 6 agents and 6 commands into the merged config. The same call installs the R6 `tool.execute.before` guard and registers the governed `tm_*` tools (see [Context governance](#-context-governance-tm--r6--new-in-v151) below).
|
|
382
|
+
3. The loader calls the plugin's `server(input, options)`, which registers a `config` hook; the hook injects 6 agents and 6 commands into the merged config. The same call installs the R6 `tool.execute.before` guard, arms the unified R6/R2 approval gate (official dialog + `TM_ASK_TIMEOUT_MIN` auto-reject, wired through an `event` hook), and registers the governed `tm_*` tools (see [Context governance](#-context-governance-tm--r6--r2--new-in-v151) below).
|
|
288
383
|
4. The plugin's `id: "team-mode"` is displayed as the plugin name in the Desktop UI.
|
|
289
384
|
5. Agents and commands are immediately available in the Desktop UI â no file copying needed. User-defined agents with the same name always win (the plugin never clobbers them).
|
|
290
385
|
|
package/README.zh-CN.md
CHANGED
|
@@ -213,7 +213,7 @@ team ĺŽćă
|
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
216
|
-
## đ§Ż ä¸ä¸ć沝çďźtm_* + R6ďźââ v1.5.1 辡ćäž
|
|
216
|
+
## đ§Ż ä¸ä¸ć沝çďźtm_* + R6 + R2ďźââ v1.5.1 辡ćäž
|
|
217
217
|
|
|
218
218
|
> â ď¸ é `@te-river/opencode-team-mode@1.5.1` ćć´ć°ďź2026-09-08 ĺĺ¸ďźă
|
|
219
219
|
> é
罎éé `@latest` çç¨ćˇďźä¸ćŹĄĺŻĺ¨čŞĺ¨ĺçş§ă
|
|
@@ -227,17 +227,47 @@ ERRORĂN çťčŽĄ / 䝣ç çžĺć¸
ĺ / äşčżĺśĺ
俥ćŻďźçĄŹä¸é 80 token
|
|
|
227
227
|
祎ĺŽéčŚĺ
¨ććśďźç¨ HMAC çžĺăéćŹ rună希ćććçĺĽćçť `tm_fetch`
|
|
228
228
|
ĺ掾ĺĺă`tm_bash` äť
ćžčĄĺŞčŻťĺ˝äť¤ç˝ĺĺďźĺ¤ąč´ĽäťĽçťćĺé误čżĺă
|
|
229
229
|
|
|
230
|
-
**R6
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
**R6 çŻĺ˘ĺéäżć¤ďźç°ĺˇ˛ĺ级为厥ćšé¨ć§ďźă** TeamMode ćżć´ťćśďźć¨Ąĺć ćł
|
|
231
|
+
ééťčŻťĺçŻĺ˘ĺéăenv 察ĺşĺ˝äť¤ďź`printenv`ă`env`ă`Get-ChildItem env:`
|
|
232
|
+
çďźä¸çŻĺ˘ćäťśďź`.env`ăshell rc ćäťśďźäźčľ° OpenCode **ĺŽćšçĄŽčŽ¤ĺźšçŞ**ďź
|
|
233
|
+
ä˝ äźĺ¨ćĄé˘ćśĺ°ä¸ćŹĄĺç祎莤ďźčś
čż `TM_ASK_TIMEOUT_MIN`ďźéťčޤ 10 ĺéďź
|
|
234
|
+
ć äşşĺĺşĺł**čŞĺ¨ćçť**ââćäťśčś
ćśĺŞäźćçťďźçťä¸ä¸şć¨ĄĺčŞććžčĄăéé
珌
|
|
235
|
+
襨螞ä¸äşç形ćďźĺ˝äť¤éĺ
ĺľç `$VAR` / `${VAR}` / `$env:`ăĺ˝äť¤ćżć˘ă
|
|
236
|
+
ĺ shell/轏äšĺćłďźäťĽĺ `tm_*` ĺ
čŁ
ééäťçť´ć**䝣ç 级祏ćŚ**ďźć˛ĄćĺźšçŞ
|
|
237
|
+
ĺŻéťďźătm_* ĺ
čŁ
塼ĺ
ˇĺć ˇčżčżĺĽćŁćĽďźä¸çťĺ
čŁ
ĺąçĺé¨ďźă厥莥ćĽĺżĺŞčް
|
|
238
|
+
塼ĺ
ˇĺ + 樥ĺźçąťĺŤ + čŁĺłäşäťśďź`ask` / `allowed-once` / `allowed-always` /
|
|
239
|
+
`rejected` / `timeout-rejected` / `degraded`ďźââçťä¸čްĺ˝ĺ˝äť¤ććŹă衯ĺžă
|
|
240
|
+
ĺéĺćĺźă
|
|
241
|
+
|
|
242
|
+
**R2 ĺąéŠćä˝ďźĺä¸ä¸ŞçĄŽčŽ¤ĺźšçŞďźă** ĺ é¤ďź`rm`/`del`/`Remove-Item`/
|
|
243
|
+
`rmdir`ďźăgit ĺĺ¸ďź`git push`/`git commit`ďźăç˝çťďź`curl`/`wget`/
|
|
244
|
+
`Invoke-WebRequest`/`Invoke-RestMethod`ďźăĺ
ĺŽčŁ
ä¸ĺĺ¸ďź`npm install`/
|
|
245
|
+
`npm publish`/`pip install`/`winget`/`choco`ďźăčżç¨/çłťçťďź`taskkill`/
|
|
246
|
+
`Stop-Process`/`kill`/`shutdown`/`format`ďźăćéďź`chmod`/`takeown`/
|
|
247
|
+
`icacls`ďźââé˝ä¸ĺééťćžčĄďźčćŻĺźšĺä¸ä¸ŞĺŽćšçĄŽčޤćĄďźčś
ćśćŞĺĺşĺłčŞĺ¨
|
|
248
|
+
ćçťăćĽĺ¸¸éŞčŻć ďź`npm test`ă`tsc`ă`git status`/`diff`ďź**ä¸ĺ¨**é¨ć§
|
|
249
|
+
äšĺďźĺ˘éĺä˝ç
§ĺ¸¸ć ćć°čżčĄă
|
|
250
|
+
|
|
251
|
+
> â ď¸ **ćšĺĺźšçŞćśčݎé onceďźäť
ć¤ä¸ćŹĄďźďźä¸čŚé alwaysă** çĺŽĺŽżä¸ťĺŽćľďź
|
|
252
|
+
> always 莰ĺ˝çćłĺč§ĺčżćŻĺ˝ćŹĄĺ˝äť¤ĺŽ˝ââ寚 `Get-ChildItem env:PATH` é
|
|
253
|
+
> always äźčŽ°ä¸ `Get-ChildItem *`ďźć¤ĺćć `Get-ChildItem` é˝ä¸ĺĺźšçŞă
|
|
254
|
+
> ĺŞć once č˝čŽŠćŻćŹĄĺąéŠćä˝çť§çťĺçŹčżäşşćă
|
|
255
|
+
|
|
256
|
+
> ĺťśĺćŻ**ćäźčŻ**çćçďźĺŞćčżčĄ TeamMode 注ĺ
Ľč§č˛çäźčŻďźć塲埚čżčżçąť
|
|
257
|
+
> 祎莤ćĄçäźčŻďźéç env 话ĺćäźč˘ŤćžčĄçťĺźšçŞďźĺ
śäťäźčŻďźĺŚĺç
|
|
258
|
+
> `build`/`plan`ďźéĺŽć¤äťçśç´ćĽçĄŹćŚââéŁéć šćŹć˛ĄćĺźšçŞĺ
ĺşă县丝寚ĺ¤ĺ
|
|
259
|
+
> ĺ˝äť¤ďź`a; b`ďźć掾čŻäź°ăĺ揥埚çŞćšĺć´ćĄďźäťťä¸ĺćŽľćŻ env 话ĺćśĺŽć¤ć´ćĄ
|
|
260
|
+
> ćŚćŞă
|
|
261
|
+
|
|
262
|
+
> ćéĺ莎塲ĺ¨çĺŽ `opencode serve` 县丝ďź1.18.29ďźä¸çť SSE äşäťśćčˇĺŽćľ
|
|
263
|
+
> ć ¸éŞďźćĄé˘ĺźšçŞç渲ććŹčşŤäťéĺ¨çĺŽ Desktop äźčŻéçŽč§çĄŽčޤä¸ćŹĄăé交äş
|
|
264
|
+
> `opencode run` ä¸ďźć äşşĺşçç `ask` äźč˘ŤçŤĺłčŞĺ¨ćçťďźć˛ĄćäşşçąťĺŻĺźšďźă
|
|
236
265
|
|
|
237
266
|
| çŻĺ˘ĺé | éťčޤ | ä˝ç¨ |
|
|
238
267
|
|---|---|---|
|
|
239
|
-
| `TM_ENV_PROTECT` | `strict` | R6 樥ĺźďź`strict` / `standard` / `off
|
|
240
|
-
| `
|
|
268
|
+
| `TM_ENV_PROTECT` | `strict` | R6 樥ĺźďź`strict` / `standard` / `off`ďźoff ĺćśč§Łé¤ĺŽĄćščŽĄćśĺ¨ďź |
|
|
269
|
+
| `TM_ASK_TIMEOUT_MIN` | `10` | R6/R2 祎莤埚çŞć äşşĺşçĺčŞĺ¨ćçťçĺéć°ďźćĺ° 3 ĺéďźĺŽżä¸ťç `permission.replied` çťäşäťśćťçşżĺ°čžžćäťśçşŚĺťśčż ~120 ç§ââć´ĺ°çĺźäźćĺčˇćšç诡ćąčŻŻćďź |
|
|
270
|
+
| `TM_ENV_PROTECT_EXTRA_DENY` | â | čż˝ĺ ćŚćŞćŁĺďźĺĺˇĺéďźĺ§çťçĄŹćŚďźä¸čľ°ĺźšçŞďź |
|
|
241
271
|
| `TM_OFFLOAD_THRESHOLD` | `2000` | ĺ¸č˝˝éĺźďźtokenďźchars/4 äź°çŽďź |
|
|
242
272
|
| `TM_PREVIEW_MAX_TOKENS` | `80` | é˘č§çĄŹä¸é |
|
|
243
273
|
| `TM_FETCH_MAX_LINES` | `2000` | tm_fetch ĺ掾ä¸é |
|
|
@@ -245,6 +275,54 @@ ERRORĂN çťčŽĄ / 䝣ç çžĺć¸
ĺ / äşčżĺśĺ
俥ćŻďźçĄŹä¸é 80 token
|
|
|
245
275
|
| `TM_TRAJECTORY_DIR` | `.trajectory/` | ĺŞčż˝ĺ 塼ĺ
ˇč°ç¨č´ŚćŹ |
|
|
246
276
|
| `TM_BLACKBOARD_TTL` | `7` | ĺĺ¨äżçĺ¤Šć° |
|
|
247
277
|
| `TM_BASH_READONLY_ALLOWED` | ĺ
罎襨 | tm_bash ĺŞčŻťç˝ĺĺ |
|
|
278
|
+
| `TM_PTC_MAX_PROGRAM_CHARS` | `4000` | PTC ç¨ĺşćşç éżĺşŚä¸éďźĺçŹŚďź |
|
|
279
|
+
| `TM_PTC_MAX_CALLS` | `20` | PTC ĺ揥čżčĄćĄĽćĽč°ç¨ć°ä¸éďź1â200ďź |
|
|
280
|
+
| `TM_PTC_MAX_ERRORS` | `3` | PTC ĺ揥čżčĄé误ć°ä¸éďź1â50ďź |
|
|
281
|
+
| `TM_PTC_TIMEOUT_MS` | `60000` | PTC ĺ揥čżčĄĺ˘éčś
ćśďź5 ç§â10 ĺéďź |
|
|
282
|
+
| `TM_PTC_ENGINE` | `auto` | PTC ĺźćďź`auto`ďźworkerâinline éçş§ďź/ `worker` / `inline` |
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## ⥠ćšéçźćďź`tm_ptc_run`ďźââ v1.5.2 辡ćäž
|
|
287
|
+
|
|
288
|
+
> 塲é **v1.5.2**ďź2026-09-10ďźĺĺ¸ăé `@te-river/opencode-team-mode@1.5.2` ćć´ć°ă
|
|
289
|
+
|
|
290
|
+
`tm_ptc_run` 莊ä¸ĺŽśäťŁççźĺ**ä¸ä¸ŞĺźćĽç¨ĺş**ďźĺ¨ĺ揥ĺĺä¸ć§čĄ N 揥ĺ沝çç
|
|
291
|
+
`tm_*` č°ç¨ââčżčĄćé´éś LLM ĺžčżďźäť
ĺ°čĺćčŚčżĺä¸ä¸ćă莞莥ç¨äşćšé
|
|
292
|
+
ĺŞčŻťäťťĺĄďźĺ¤ć䝜䞌ĺŻăćšé grep + read čĺă交ĺĺźç¨ćç´˘çťćă
|
|
293
|
+
|
|
294
|
+
### 塼ä˝ĺç
|
|
295
|
+
|
|
296
|
+
䝣çä˝żç¨ `tm.read(args)`ă`tm.grep(args)`ă`tm.bash(args)`ă`tm.fetch(args)`
|
|
297
|
+
çźĺç¨ĺşä˝ââĺć°ä¸ĺ个ĺ沝ç塼ĺ
ˇç¸ĺăćŻćŹĄč°ç¨čżĺ `{ok:true, data}`ďźĺˇ˛ĺ
|
|
298
|
+
沝çďźĺ
čććŹćĺ¸č˝˝ĺĽćďźć `{ok:false, error:{tool,phase,line?,message}}`ă
|
|
299
|
+
ç¨ĺş `return` ä¸ä¸ŞĺźďźĺŽäźč˘Ť JSON ĺşĺĺčżčĺćčŚă
|
|
300
|
+
|
|
301
|
+
ĺ
ĺŤ `require`ă`import`ă`process`ă`globalThis`ă`Deno`ă`Bun`ă`fs`ă`net`
|
|
302
|
+
ć `child_process` çç¨ĺşäźĺ¨ć§čĄĺ袍ćçťďźéćé˘ćŤćďźčž
ĺŠé˛ć¤ďźă
|
|
303
|
+
|
|
304
|
+
### é˘çŽďźäť
ćśç´§ďź
|
|
305
|
+
|
|
306
|
+
č°ç¨ćšĺŻćśç´§ `max_calls`ă`max_errors` ĺ `timeout_ms`ââčś
čż `TM_PTC_*` ä¸é
|
|
307
|
+
çĺźäźč˘Ťéłĺśĺ°ä¸éďźä˝äşä¸éçĺźäźč˘Ťéłĺśĺ°ä¸éăč§Śčžžäťťä¸é˘çŽĺłć´ä˝ĺć˘čżčĄďź
|
|
308
|
+
塲产ĺşçčžĺşä¸äźä¸˘ĺ¤ąă
|
|
309
|
+
|
|
310
|
+
### ĺźćďź`TM_PTC_ENGINE`ďź
|
|
311
|
+
|
|
312
|
+
| ć¨Ąĺź | čĄä¸ş |
|
|
313
|
+
|---|---|
|
|
314
|
+
| `auto`ďźéťčŽ¤ďź | äźĺ
ĺ°čŻ `worker_threads`ďźĺ¤ąč´Ľćśé级为 `node:vm`ďźćčŚć 莰 `degraded-engine` |
|
|
315
|
+
| `worker` | ĺźşĺśä˝żç¨ worker ĺźćďźĺ¤ąč´Ľćśčżĺ engine-errorďź |
|
|
316
|
+
| `inline` | ĺźşĺśä˝żç¨ `node:vm` ĺźćďź30 ç§çźčŻčś
ćśćŠćĺćĽĺżçďźawait é´éćŽä˝ĺˇ˛čްĺ˝ďź |
|
|
317
|
+
|
|
318
|
+
worker ĺźćĺ¨ä¸ç¨çşżç¨ä¸čżčĄç¨ĺşďź`env:{}` ć¸
犺 process.envă`resourceLimits`
|
|
319
|
+
ééă祏ĺ˘é `terminate()`ăćć沝çďźP2 衯ĺžčĺ´ăP3 ç˝ĺĺăR6ăéĺźĺ¸č˝˝ă
|
|
320
|
+
TTLďźĺŻšćŻćŹĄćĄĽćĽč°ç¨çćââPTC ä¸ćŻçťčżĺąă
|
|
321
|
+
|
|
322
|
+
### 莿éŽćé
|
|
323
|
+
|
|
324
|
+
äşä¸Şä¸ĺŽśäťŁçďź`implementer`ă`tester`ă`architect`ă`reviewer`ă`researcher`ďź
|
|
325
|
+
çç˝ĺĺä¸ĺ
ĺŤ `tm_ptc_run`ă`team` lead ä¸ĺ
ĺŤââĺŽč´č´Łçźćďźä¸čżčĄćšéç¨ĺşă
|
|
248
326
|
|
|
249
327
|
---
|
|
250
328
|
|
|
@@ -255,12 +333,13 @@ opencode-team-mode/
|
|
|
255
333
|
âââ package.json â npm ĺ
ĺŽäš
|
|
256
334
|
âââ tsconfig.json â TypeScript é
罎
|
|
257
335
|
âââ src/
|
|
258
|
-
â âââ index.ts â ćäťśĺ
ĽĺŁďźserver()ďźconfig + R6 tool.execute.before éŠĺ + tool 掾ďź
|
|
336
|
+
â âââ index.ts â ćäťśĺ
ĽĺŁďźserver()ďźconfig + R6 tool.execute.before + 厥ćšé¨ event éŠĺ + tool 掾ďź
|
|
259
337
|
â âââ agents.ts â Agent ĺŽäšďźpromptsă樥ĺźăé˘č˛ďź
|
|
260
338
|
â âââ commands.ts â ĺ˝äť¤ĺŽäšďźć¨ĄćżăAgent çťĺŽďź
|
|
261
339
|
â âââ blackboard.ts â ĺ
ąäşŤéťćż + TTL čŞĺ¨ć¸
çć¸
ćŤĺ¨
|
|
262
|
-
â âââ envprotect.ts â R6
|
|
263
|
-
â âââ
|
|
340
|
+
â âââ envprotect.ts â R6 çŻĺ˘ĺé话ĺäżć¤ + R2 祎莤埚çŞć¨ĄĺźéďźĺźšçŞ vs 祏ćŚďź
|
|
341
|
+
â âââ approval-gate.ts â çťä¸ĺŽĄćšé¨ďźĺŽćšĺźšçŞčś
ćśčŞĺ¨ćçťďźçťä¸čŞććžčĄďź
|
|
342
|
+
â âââ tm/ â JIT ĺą 2 塼ĺ
ˇďźtm_read / tm_grep / tm_bash / tm_fetch / tm_ptc_runďź
|
|
264
343
|
â âââ types.ts â ĺ č˝˝ĺ¨ĺĽçşŚçąťĺĺŽäšďź1.18.xďź
|
|
265
344
|
âââ scripts/
|
|
266
345
|
â âââ install.sh â ä¸éŽĺŽčŁ
čćŹďźbashďź
|
|
@@ -275,7 +354,7 @@ opencode-team-mode/
|
|
|
275
354
|
|
|
276
355
|
1. OpenCode ćĄé˘çĺŻĺ¨ďźĺ č˝˝ `opencode.json(c)`
|
|
277
356
|
2. ćŁćľĺ° `plugin` ć°çťä¸ç `"@te-river/opencode-team-mode@latest"`ďźĺ č˝˝ npm ĺ
|
|
278
|
-
3. ĺ č˝˝ĺ¨č°ç¨ćäťśç `server(input, options)`ďźćł¨ĺ `config` hookďźhook ĺĺĺšśĺçé
罎注ĺ
Ľ 6 个 Agent ĺ 6 个ĺ˝äť¤ăĺä¸ćŹĄč°ç¨čżäźĺŽčŁ
R6 ç `tool.execute.before`
|
|
357
|
+
3. ĺ č˝˝ĺ¨č°ç¨ćäťśç `server(input, options)`ďźćł¨ĺ `config` hookďźhook ĺĺĺšśĺçé
罎注ĺ
Ľ 6 个 Agent ĺ 6 个ĺ˝äť¤ăĺä¸ćŹĄč°ç¨čżäźĺŽčŁ
R6 ç `tool.execute.before` é˛ć¤ăćŚčŁ
R6/R2 çťä¸ĺŽĄćšé¨ďźĺŽćšçĄŽčŽ¤ĺźšçŞ + `TM_ASK_TIMEOUT_MIN` čś
ćśčŞĺ¨ćçťďźçť `event` éŠĺ銹ĺ¨ďźďźĺšśćł¨ĺĺ沝çç `tm_*` 塼ĺ
ˇďźč§ä¸ćâä¸ä¸ć沝çâďź
|
|
279
358
|
4. ćäťśç `id: "team-mode"` ä˝ä¸şćäťśĺćžç¤şĺ¨ćĄé˘ç UI
|
|
280
359
|
5. Agent ĺĺ˝äť¤çŤĺłĺ¨ćĄé˘ç UI ä¸ĺŻç¨ ââ ć éĺ¤ĺśäťťä˝ćäťśďźĺĺ Agent 䝼ç¨ćˇčŞĺŽäšäźĺ
ďźćäťśçťä¸čŚçďź
|
|
281
360
|
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAA;AAqpB9D,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAO9C,CAAA"}
|
package/dist/agents.js
CHANGED
|
@@ -23,6 +23,75 @@
|
|
|
23
23
|
* - All agents run at temperature 0.2 for format discipline.
|
|
24
24
|
*/
|
|
25
25
|
/* ------------------------------------------------------------------ */
|
|
26
|
+
/* Tool whitelist builder (Phase 2 / T2.1, G2 ruling "ćšćĄç˛") */
|
|
27
|
+
/* ------------------------------------------------------------------ */
|
|
28
|
+
/**
|
|
29
|
+
* Builds the permission block that IS the agent's tool whitelist.
|
|
30
|
+
*
|
|
31
|
+
* Verified live (T0.4â˘): a "deny" permission removes the built-in tool
|
|
32
|
+
* from the model's tool surface entirely â zero bypass, zero hallucinated
|
|
33
|
+
* calls. So a whitelist = deny every excluded built-in + allow the kept
|
|
34
|
+
* set, exactly the shape the D6 probe validated
|
|
35
|
+
* (%TEMP%/opencode/tm-probe/workspace/opencode.json).
|
|
36
|
+
*
|
|
37
|
+
* G2 rulings baked in:
|
|
38
|
+
* - glob/list never enter the whitelist â file enumeration goes through
|
|
39
|
+
* tm_bash (ls / dir / Get-ChildItem);
|
|
40
|
+
* - webfetch/websearch excluded network-wide (P5 network zero);
|
|
41
|
+
* - "tm_*" covers exactly the four governed tools (tm_read / tm_grep /
|
|
42
|
+
* tm_bash / tm_fetch); the R6 env-protection hook aliases onto them
|
|
43
|
+
* unchanged, so narrowing the surface does not weaken the anti-backdoor
|
|
44
|
+
* chain.
|
|
45
|
+
*
|
|
46
|
+
* T2.1 review revision (Critical fix): the built-in bash RETURNS for the
|
|
47
|
+
* execution roles (team / implementer / reviewer / tester). G2 only ruled
|
|
48
|
+
* that glob/list enumeration goes through tm_bash â it never ruled away
|
|
49
|
+
* command execution, and tm_bash is a read-only allowlist that cannot run
|
|
50
|
+
* npm test / tsc / --help probes. R6 keeps governing bash's env surface
|
|
51
|
+
* through the envprotect hook, independently of this matrix.
|
|
52
|
+
*/
|
|
53
|
+
const NEVER_ALLOWED = [
|
|
54
|
+
"read",
|
|
55
|
+
"grep",
|
|
56
|
+
"glob",
|
|
57
|
+
"list",
|
|
58
|
+
"apply_patch",
|
|
59
|
+
"webfetch",
|
|
60
|
+
"websearch",
|
|
61
|
+
"todowrite",
|
|
62
|
+
"lsp",
|
|
63
|
+
"skill",
|
|
64
|
+
"question",
|
|
65
|
+
];
|
|
66
|
+
/** Built-ins granted per agent; every one NOT granted is denied. */
|
|
67
|
+
const PER_AGENT_TOOLS = ["edit", "write", "task", "bash"];
|
|
68
|
+
/** The governed tools, named explicitly next to the "tm_*" wildcard
|
|
69
|
+
* (belt-and-braces: the explicit allows survive even if a host ever
|
|
70
|
+
* stops expanding the wildcard). */
|
|
71
|
+
const TM_TOOLS = ["tm_read", "tm_grep", "tm_bash", "tm_fetch"];
|
|
72
|
+
/** M3: tm_ptc_run â explicit per-agent grant (five specialists = allow,
|
|
73
|
+
* team = deny to override the tm_* wildcard). Design §3: PTC is a
|
|
74
|
+
* governed, read-only bridge; the team lead orchestrates, it does not
|
|
75
|
+
* run batch programs itself. */
|
|
76
|
+
const PTC_TOOL = "tm_ptc_run";
|
|
77
|
+
const whitelist = (...granted) => {
|
|
78
|
+
const permission = {};
|
|
79
|
+
for (const tool of NEVER_ALLOWED)
|
|
80
|
+
permission[tool] = "deny";
|
|
81
|
+
for (const tool of PER_AGENT_TOOLS) {
|
|
82
|
+
permission[tool] = granted.includes(tool) ? "allow" : "deny";
|
|
83
|
+
}
|
|
84
|
+
for (const tool of TM_TOOLS)
|
|
85
|
+
permission[tool] = "allow";
|
|
86
|
+
permission["tm_*"] = "allow";
|
|
87
|
+
return permission;
|
|
88
|
+
};
|
|
89
|
+
/** Apply the M3 tm_ptc_run grant to an agent's permission block. The five
|
|
90
|
+
* specialists get `allow`; the team lead gets `deny` (overrides the wildcard). */
|
|
91
|
+
function applyPtcPermission(permission, isTeamLead) {
|
|
92
|
+
permission[PTC_TOOL] = isTeamLead ? "deny" : "allow";
|
|
93
|
+
}
|
|
94
|
+
/* ------------------------------------------------------------------ */
|
|
26
95
|
/* Reply contract + hybrid blackboard (appended to every specialist) */
|
|
27
96
|
/* ------------------------------------------------------------------ */
|
|
28
97
|
const REPLY_CONTRACT = `
|
|
@@ -74,8 +143,9 @@ process management every run.
|
|
|
74
143
|
## Triage â classify before acting (Step 0, always)
|
|
75
144
|
- Question â work order. When the user asks, analyzes, or consults
|
|
76
145
|
("why does X fail?", "how would we do Y?"), ANSWER it â read code if
|
|
77
|
-
useful, change nothing. If answering needs
|
|
78
|
-
\`researcher\`; don't
|
|
146
|
+
useful, change nothing. If answering needs a deeper dig through the
|
|
147
|
+
codebase than your context affords, dispatch \`researcher\`; don't
|
|
148
|
+
grind through it yourself.
|
|
79
149
|
- Spotted an obvious defect while answering? Propose the fix and WAIT for
|
|
80
150
|
the go-ahead â never fix-on-the-sly.
|
|
81
151
|
- Explicit action request ("fix X", "add Y", "refactor Z") â route via the
|
|
@@ -96,7 +166,7 @@ files â NOT docs, comments, formatting, NOT *.test.* files).
|
|
|
96
166
|
| Docs / comments / formatting only | implementer (or direct edit, see below) |
|
|
97
167
|
| Product behavior change (bug fix, small feature) | implementer â tester â reviewer |
|
|
98
168
|
| Multi-module / cross-interface feature | architect â implementer â tester â reviewer(s) |
|
|
99
|
-
|
|
|
169
|
+
| Unfamiliar tech / dependency in play | researcher first (local-repo evidence: call sites, installed/vendored packages, shipped docs), then the fitting row above |
|
|
100
170
|
|
|
101
171
|
- FIXED MINIMUM PIPELINES: the reviewer may be skipped ONLY for
|
|
102
172
|
non-product artifacts, with a one-line reason. A product change routed
|
|
@@ -123,8 +193,9 @@ Count the dispatches your routing row prescribes:
|
|
|
123
193
|
ONLY when it is genuinely absent. These docs define the conventions
|
|
124
194
|
the whole team must follow; distill the binding ones for your
|
|
125
195
|
dispatches. Then read the relevant source yourself; dispatch
|
|
126
|
-
\`researcher\` ONLY for genuinely
|
|
127
|
-
|
|
196
|
+
\`researcher\` ONLY for genuinely unfamiliar tech â its findings come
|
|
197
|
+
from the local repo (code, docs, installed packages), never the web.
|
|
198
|
+
Done means you can state which files change, in what order, and the risks.
|
|
128
199
|
- Plan (â¤30 lines): Goal / Root cause or scope (file:line evidence) /
|
|
129
200
|
Change list (file â what) / Pipeline (routing row + agents) /
|
|
130
201
|
Assumptions & risks / Open questions.
|
|
@@ -244,8 +315,8 @@ Findings that drive architecture or API usage must be verified before
|
|
|
244
315
|
adoption:
|
|
245
316
|
- The researcher tags each finding High / Medium / Low confidence.
|
|
246
317
|
- Low/medium-confidence claims that affect the design get a second check
|
|
247
|
-
(re-ask the researcher for
|
|
248
|
-
actual codebase).
|
|
318
|
+
(re-ask the researcher for a second local source, or sanity-check against
|
|
319
|
+
the actual codebase).
|
|
249
320
|
- Never let an unverified claim silently become an implementation
|
|
250
321
|
decision; list remaining assumptions explicitly in the final report.
|
|
251
322
|
|
|
@@ -272,12 +343,10 @@ If a target file does not exist, offer to create it; skip both when the
|
|
|
272
343
|
user opted out.
|
|
273
344
|
`,
|
|
274
345
|
color: "#E879F9", // purple
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
task: "allow",
|
|
280
|
-
},
|
|
346
|
+
// Whitelist (7 tools): tm_* x4 + task dispatch + edit (<=10-line
|
|
347
|
+
// non-product edits, see "When you may edit directly") + write (board
|
|
348
|
+
// files) + bash (discovery-gate probes: --help, installed versions).
|
|
349
|
+
permission: whitelist("task", "edit", "write", "bash"),
|
|
281
350
|
temperature: 0.2,
|
|
282
351
|
};
|
|
283
352
|
/* ------------------------------------------------------------------ */
|
|
@@ -320,9 +389,12 @@ When the team lead sends back a design flaw found in review or testing:
|
|
|
320
389
|
of guessing about the codebase.
|
|
321
390
|
`,
|
|
322
391
|
color: "#38BDF8", // sky blue
|
|
323
|
-
//
|
|
324
|
-
//
|
|
325
|
-
|
|
392
|
+
// Whitelist (5 tools): tm_* x4 + task dispatch. Fully read-only by
|
|
393
|
+
// design (T2.1): output lives in the reply; if a board artifact is ever
|
|
394
|
+
// dispatched, the BLACKBOARD WRITE FAILED fallback hands the content to
|
|
395
|
+
// the lead inline (see Blackboard rules). No bash â unchanged from the
|
|
396
|
+
// pre-T2.1 architect bash:deny posture.
|
|
397
|
+
permission: whitelist("task"),
|
|
326
398
|
temperature: 0.2,
|
|
327
399
|
};
|
|
328
400
|
/* ------------------------------------------------------------------ */
|
|
@@ -359,7 +431,9 @@ to you by the team lead.
|
|
|
359
431
|
check, the previously failing test).
|
|
360
432
|
`,
|
|
361
433
|
color: "#4ADE80", // green
|
|
362
|
-
|
|
434
|
+
// Whitelist (7 tools): tm_* x4 + edit/write (code implementation) + bash
|
|
435
|
+
// (narrowest verification for the fix: build / typecheck / failing test).
|
|
436
|
+
permission: whitelist("edit", "write", "bash"),
|
|
363
437
|
temperature: 0.2,
|
|
364
438
|
};
|
|
365
439
|
/* ------------------------------------------------------------------ */
|
|
@@ -417,9 +491,12 @@ the previously flagged scope plus regressions introduced by the fixes;
|
|
|
417
491
|
confirm each prior finding item by item (fixed / not fixed / partial).
|
|
418
492
|
`,
|
|
419
493
|
color: "#FB923C", // orange
|
|
420
|
-
//
|
|
421
|
-
// (
|
|
422
|
-
|
|
494
|
+
// Whitelist (6 tools): tm_* x4 + task dispatch + bash. No edit/write
|
|
495
|
+
// (T2.1): findings travel in the reply skeleton; a dispatched board
|
|
496
|
+
// artifact rides the BLACKBOARD WRITE FAILED inline fallback (see
|
|
497
|
+
// Blackboard rules). bash backs the evidence standard â the reviewer
|
|
498
|
+
// must be able to run npm test / tsc itself.
|
|
499
|
+
permission: whitelist("task", "bash"),
|
|
423
500
|
temperature: 0.2,
|
|
424
501
|
};
|
|
425
502
|
/* ------------------------------------------------------------------ */
|
|
@@ -483,7 +560,9 @@ worse than admitting the gap.
|
|
|
483
560
|
refactor instead of contorting the test.
|
|
484
561
|
`,
|
|
485
562
|
color: "#F472B6", // pink
|
|
486
|
-
|
|
563
|
+
// Whitelist (7 tools): tm_* x4 + edit/write (test files) + bash (the
|
|
564
|
+
// whole verification stack: build / typecheck / lint / test runs).
|
|
565
|
+
permission: whitelist("edit", "write", "bash"),
|
|
487
566
|
temperature: 0.2,
|
|
488
567
|
};
|
|
489
568
|
/* ------------------------------------------------------------------ */
|
|
@@ -491,10 +570,11 @@ worse than admitting the gap.
|
|
|
491
570
|
/* ------------------------------------------------------------------ */
|
|
492
571
|
const researcher = {
|
|
493
572
|
mode: "subagent",
|
|
494
|
-
description: "Researcher â investigates
|
|
495
|
-
"documentation; every finding
|
|
496
|
-
"
|
|
497
|
-
"must inform a
|
|
573
|
+
description: "Researcher â investigates the local repository: code, configs, " +
|
|
574
|
+
"installed/vendored packages, and shipped documentation; every finding " +
|
|
575
|
+
"carries a source (file:line) and confidence tag so the team can decide " +
|
|
576
|
+
"what needs verification. Use for information that must inform a " +
|
|
577
|
+
"technical decision. Web research is out of scope (no network tools).",
|
|
498
578
|
prompt: `You are the **Researcher** on a multi-agent coding team.
|
|
499
579
|
|
|
500
580
|
## Role
|
|
@@ -534,7 +614,13 @@ by the team â flag prominently if that is the case.
|
|
|
534
614
|
of re-deriving.
|
|
535
615
|
`,
|
|
536
616
|
color: "#A78BFA", // violet
|
|
537
|
-
|
|
617
|
+
// Whitelist (4 tools): tm_* x4 ONLY â intentionally below the 5-7 band
|
|
618
|
+
// (T2.1): pure local research. webfetch/websearch are excluded
|
|
619
|
+
// network-wide (P5), which also removes the dangling websearch:allow
|
|
620
|
+
// found in T0.3; file enumeration goes through tm_bash (G2 ćšćĄç˛).
|
|
621
|
+
// No bash / no execution rights is intentional trimming â local
|
|
622
|
+
// research reads, it does not run.
|
|
623
|
+
permission: whitelist(),
|
|
538
624
|
temperature: 0.2,
|
|
539
625
|
};
|
|
540
626
|
/* Shared rules appended to every specialist prompt (after the contract). */
|
|
@@ -545,6 +631,14 @@ Every "done / fixed / passed" claim in your reply must carry its
|
|
|
545
631
|
evidence: command output, log lines, or a diff. No narrative-only
|
|
546
632
|
completions.
|
|
547
633
|
|
|
634
|
+
## Tool surface (do not retry removed tools)
|
|
635
|
+
All file reads / searches / enumeration go through tm_read / tm_grep / tm_bash.
|
|
636
|
+
The built-in read/grep/glob/list tools are removed from the tool surface â
|
|
637
|
+
retrying them only wastes a turn. Built-in bash exists only where granted
|
|
638
|
+
(team / implementer / reviewer / tester run commands: build / test / git);
|
|
639
|
+
architect and researcher have no bash at all â one-off read-only commands
|
|
640
|
+
go through tm_bash or are reported as a gap.
|
|
641
|
+
|
|
548
642
|
## Project conventions
|
|
549
643
|
If the project README (or AGENTS.md) is quoted in your dispatch, treat
|
|
550
644
|
its conventions as binding â they outrank your defaults. Do not re-open
|
|
@@ -555,6 +649,14 @@ belongs to the work.`;
|
|
|
555
649
|
for (const a of [architect, implementer, reviewer, tester, researcher]) {
|
|
556
650
|
a.prompt = (a.prompt ?? "") + REPLY_CONTRACT + SHARED_RULES;
|
|
557
651
|
}
|
|
652
|
+
/* M3: tm_ptc_run permission â five specialists get allow, team gets deny
|
|
653
|
+
* (overrides the tm_* wildcard). Applied once at module init. */
|
|
654
|
+
if (teamLead.permission)
|
|
655
|
+
applyPtcPermission(teamLead.permission, true);
|
|
656
|
+
for (const a of [architect, implementer, reviewer, tester, researcher]) {
|
|
657
|
+
if (a.permission)
|
|
658
|
+
applyPtcPermission(a.permission, false);
|
|
659
|
+
}
|
|
558
660
|
/* ------------------------------------------------------------------ */
|
|
559
661
|
/* Export all agents keyed by name */
|
|
560
662
|
/* ------------------------------------------------------------------ */
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AACxE,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;+DA0BwC,CAAA;AAE/D,wEAAwE;AACxE,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