@te-river/opencode-team-mode 1.5.14 → 1.6.0

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.
Files changed (101) hide show
  1. package/README.md +788 -674
  2. package/README.zh-CN.md +712 -618
  3. package/dist/agents.d.ts +5 -3
  4. package/dist/agents.d.ts.map +1 -1
  5. package/dist/agents.js +19 -8
  6. package/dist/agents.js.map +1 -1
  7. package/dist/capabilities.d.ts +1 -1
  8. package/dist/capabilities.js +2 -2
  9. package/dist/capabilities.js.map +1 -1
  10. package/dist/host-hooks.d.ts +13 -2
  11. package/dist/host-hooks.d.ts.map +1 -1
  12. package/dist/host-hooks.js +19 -5
  13. package/dist/host-hooks.js.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +54 -14
  16. package/dist/index.js.map +1 -1
  17. package/dist/prompts/lead.d.ts +1 -1
  18. package/dist/prompts/lead.d.ts.map +1 -1
  19. package/dist/prompts/lead.js +135 -17
  20. package/dist/prompts/lead.js.map +1 -1
  21. package/dist/prompts/shared.d.ts +2 -2
  22. package/dist/prompts/shared.d.ts.map +1 -1
  23. package/dist/prompts/shared.js +94 -16
  24. package/dist/prompts/shared.js.map +1 -1
  25. package/dist/prompts/specialists.d.ts +2 -2
  26. package/dist/prompts/specialists.d.ts.map +1 -1
  27. package/dist/prompts/specialists.js +43 -10
  28. package/dist/prompts/specialists.js.map +1 -1
  29. package/dist/task-offload.d.ts +67 -0
  30. package/dist/task-offload.d.ts.map +1 -0
  31. package/dist/task-offload.js +123 -0
  32. package/dist/task-offload.js.map +1 -0
  33. package/dist/tm/args-schema.d.ts +4 -0
  34. package/dist/tm/args-schema.d.ts.map +1 -1
  35. package/dist/tm/args-schema.js +44 -3
  36. package/dist/tm/args-schema.js.map +1 -1
  37. package/dist/tm/board.d.ts +113 -0
  38. package/dist/tm/board.d.ts.map +1 -0
  39. package/dist/tm/board.js +275 -0
  40. package/dist/tm/board.js.map +1 -0
  41. package/dist/tm/browser.d.ts +325 -6
  42. package/dist/tm/browser.d.ts.map +1 -1
  43. package/dist/tm/browser.js +1329 -135
  44. package/dist/tm/browser.js.map +1 -1
  45. package/dist/tm/config.d.ts +36 -1
  46. package/dist/tm/config.d.ts.map +1 -1
  47. package/dist/tm/config.js +29 -1
  48. package/dist/tm/config.js.map +1 -1
  49. package/dist/tm/dispatch.d.ts +118 -31
  50. package/dist/tm/dispatch.d.ts.map +1 -1
  51. package/dist/tm/dispatch.js +385 -131
  52. package/dist/tm/dispatch.js.map +1 -1
  53. package/dist/tm/dupe-guard.js +1 -1
  54. package/dist/tm/dupe-guard.js.map +1 -1
  55. package/dist/tm/egress.d.ts +44 -0
  56. package/dist/tm/egress.d.ts.map +1 -0
  57. package/dist/tm/egress.js +191 -0
  58. package/dist/tm/egress.js.map +1 -0
  59. package/dist/tm/guard.js +1 -1
  60. package/dist/tm/guard.js.map +1 -1
  61. package/dist/tm/index.d.ts +28 -2
  62. package/dist/tm/index.d.ts.map +1 -1
  63. package/dist/tm/index.js +198 -10
  64. package/dist/tm/index.js.map +1 -1
  65. package/dist/tm/perm-ask.d.ts +47 -5
  66. package/dist/tm/perm-ask.d.ts.map +1 -1
  67. package/dist/tm/perm-ask.js +98 -7
  68. package/dist/tm/perm-ask.js.map +1 -1
  69. package/dist/tm/pipelines.d.ts.map +1 -1
  70. package/dist/tm/pipelines.js +24 -2
  71. package/dist/tm/pipelines.js.map +1 -1
  72. package/dist/tm/ptc/tool.d.ts.map +1 -1
  73. package/dist/tm/ptc/tool.js +2 -4
  74. package/dist/tm/ptc/tool.js.map +1 -1
  75. package/dist/tm/pty.d.ts.map +1 -1
  76. package/dist/tm/pty.js +6 -3
  77. package/dist/tm/pty.js.map +1 -1
  78. package/dist/tm/search.d.ts +5 -0
  79. package/dist/tm/search.d.ts.map +1 -1
  80. package/dist/tm/search.js +19 -17
  81. package/dist/tm/search.js.map +1 -1
  82. package/dist/tm/stats.d.ts +46 -0
  83. package/dist/tm/stats.d.ts.map +1 -1
  84. package/dist/tm/stats.js +124 -7
  85. package/dist/tm/stats.js.map +1 -1
  86. package/dist/tm/store.d.ts +3 -0
  87. package/dist/tm/store.d.ts.map +1 -1
  88. package/dist/tm/store.js +6 -1
  89. package/dist/tm/store.js.map +1 -1
  90. package/dist/tm/webfetch.d.ts +52 -0
  91. package/dist/tm/webfetch.d.ts.map +1 -1
  92. package/dist/tm/webfetch.js +128 -22
  93. package/dist/tm/webfetch.js.map +1 -1
  94. package/dist/tool-coerce.d.ts +24 -0
  95. package/dist/tool-coerce.d.ts.map +1 -0
  96. package/dist/tool-coerce.js +63 -0
  97. package/dist/tool-coerce.js.map +1 -0
  98. package/dist/types.d.ts +7 -1
  99. package/dist/types.d.ts.map +1 -1
  100. package/docs/installation.md +69 -2
  101. package/package.json +61 -59
@@ -58,10 +58,46 @@ After restart, verify in this order:
58
58
 
59
59
  1. The agent picker (`@` mentions) lists: **team, architect, implementer, reviewer, tester, researcher**.
60
60
  2. Slash commands `/team-plan`, `/team-implement`, `/team-review`, `/team-test`, `/team-research`, `/team-run` autocomplete.
61
- 3. Optional deeper check: `npm view @te-river/opencode-team-mode version` shows the latest **published** version — but it queries the npm registry, **not** what OpenCode actually loads, so it misleads after an update. To confirm the **running** version, either read the `version` field of the cached `package.json` (`~/.cache/opencode/packages/@te-river/opencode-team-mode@latest/package.json` in the scoped layout, or `.../packages/@te_river+opencode-team-mode@latest/package.json` flat), or probe a feature that exists only in the new version (e.g. ask an agent to run `tm_memory` with `action: compact` — old builds reject it). Finally, ask the user to start a chat and confirm the **team** agent responds.
61
+ 3. Definitive check for the **running** build: ask an agent to run `tm_stats` and look at which rows appear. `npm view … version` queries the registry, not what OpenCode loads, so it misleads after an update; reading a `package.json` proves only the file, not the loaded code. A feature row (e.g. `宿主后台 task 注入`) either renders or it does not — that is the running build. Finally, ask the user to start a chat and confirm the **team** agent responds.
62
+
63
+ > **Where the loaded copy actually lives.** Under `~/.cache/opencode/packages/` the
64
+ > scoped layout is a **wrapper directory**: `packages/@te-river/opencode-team-mode@latest/`
65
+ > holds only `package.json` (`{"dependencies": {"@te-river/opencode-team-mode": "<version>"}}`),
66
+ > a `package-lock.json` and `node_modules/` — **the real package is the nested
67
+ > `…@latest/node_modules/@te-river/opencode-team-mode/`**, and that is the copy
68
+ > whose `dist/` executes. Overwriting a `dist/` at the wrapper root, or the one
69
+ > under `~/.config/opencode/node_modules/`, does nothing. (Costly to learn: it
70
+ > was found by a `tm_stats` row that refused to appear.)
62
71
 
63
72
  Report which checks passed. If verification fails, see Troubleshooting.
64
73
 
74
+ ### Step 5 — the visible sub-agent (the installer enables this)
75
+
76
+ OpenCode's own `task { background: true }` is the only sub-agent its interface
77
+ can **show**: the card links to the live child session, it does not block the
78
+ lead, and the host wakes the parent with the result. TeamMode then keeps that
79
+ result inside the token budget (`TM_TASK_OFFLOAD`).
80
+
81
+ It rides an OpenCode **experimental flag** read from the host process
82
+ environment at startup, so a plugin cannot set it — the installer writes it for
83
+ you:
84
+
85
+ | Platform | What the installer does | Revert |
86
+ |---|---|---|
87
+ | Windows | `setx OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS true` (user scope, survives reboot — **every program you start afterwards sees it, not just OpenCode**) | `REG delete HKCU\Environment /v OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS /f` |
88
+ | macOS | `launchctl setenv …` — reaches GUI apps this login, **not** after a logout | `launchctl unsetenv OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` |
89
+ | Linux | `systemctl --user set-environment …` when a user session exists, else prints the `export` line | `systemctl --user unset-environment OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` |
90
+
91
+ Skip it entirely: run `install.ps1 -NoBackgroundSubagents`, or set
92
+ `TEAMMODE_SKIP_BACKGROUND_SUBAGENTS=1` for a piped install. Without the flag
93
+ nothing breaks — `task` simply blocks the lead, and `tm_join` still collects
94
+ whatever children exist (snapshot, cancel, named-id read-back, restart recovery).
95
+
96
+ Cost, stated plainly: each finished background task wakes the lead and costs a
97
+ turn, and the host injects the child's reply verbatim until TeamMode replaces
98
+ an oversized one with a preview + pointer.
99
+
100
+
65
101
  ### Updating
66
102
 
67
103
  > ⚠️ **OpenCode loads the plugin from this spec-string cache under
@@ -269,10 +305,41 @@ never re-resolved on its own).
269
305
 
270
306
  1. Agent 选择器(`@` 提及)里出现:**team、architect、implementer、reviewer、tester、researcher**。
271
307
  2. 斜杠命令 `/team-plan`、`/team-implement`、`/team-review`、`/team-test`、`/team-research`、`/team-run` 可以自动补全。
272
- 3. 可选的深度检查:`npm view @te-river/opencode-team-mode version` 显示**已发布**的最新版本——但它查的是 npm registry,**不是** OpenCode 实际加载的东西,升级后会造成误判。要确认**运行版本**:读缓存目录里 `package.json` 的 `version`(作用域式 `~/.cache/opencode/packages/@te-river/opencode-team-mode@latest/package.json`,扁平式 `.../packages/@te_river+opencode-team-mode@latest/package.json`),或用只存在于新版的特性做探针(例:让 agent 调用 `tm_memory` 的 `action: compact`——旧版没有该 action 会报错)。最后请用户开一个会话确认 **team** agent 能正常响应。
308
+ 3. 判定**运行版本**最可靠的办法:让 agent 跑一次 `tm_stats`,看表里出现了哪些行。`npm view … version` 查的是 registry,不是 OpenCode 实际加载的东西,升级后会误判;读 `package.json` 也只证明文件、不证明被执行的代码。而某一行特性(例如 `宿主后台 task 注入`)要么在要么不在——那就是正在运行的构建。最后请用户开一个会话确认 **team** agent 能正常响应。
309
+
310
+ > **被加载的那份到底在哪。** `~/.cache/opencode/packages/` 下的作用域式目录是一个
311
+ > **包装层**:`packages/@te-river/opencode-team-mode@latest/` 里只有 `package.json`
312
+ > (内容仅是 `{"dependencies": {"@te-river/opencode-team-mode": "<版本>"}}`)、
313
+ > `package-lock.json` 和 `node_modules/`——**真正的包是嵌套在里面的
314
+ > `…@latest/node_modules/@te-river/opencode-team-mode/`**,被执行的是它的 `dist/`。
315
+ > 覆盖包装层根上的 `dist/`、或覆盖 `~/.config/opencode/node_modules/` 里那份,都不生效。
316
+ > (这条是踩出来的:覆盖后 `tm_stats` 里新行死活不出现,才发现还有一层。)
273
317
 
274
318
  报告哪些检查通过。验证失败时看"故障排查"。
275
319
 
320
+ ### 第 5 步 — 可见的子代理(安装脚本已默认开启)
321
+
322
+ OpenCode 自带的 `task { background: true }` 是唯一能在它界面上**看见**的子代理:
323
+ 卡片直接链到那个子会话、不阻塞 lead、完成时宿主把父会话唤醒。TeamMode 再把
324
+ 回来的结果压在 token 预算内(`TM_TASK_OFFLOAD`)。
325
+
326
+ 它依赖一个 OpenCode 的**实验性开关**,由宿主进程启动时读环境变量决定,插件无法
327
+ 自己打开——所以安装脚本替你写:
328
+
329
+ | 平台 | 安装脚本做什么 | 撤销 |
330
+ |---|---|---|
331
+ | Windows | `setx OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS true`(用户级,重启仍在——**之后你启动的每个程序都看得到它,不只是 OpenCode**) | `REG delete HKCU\Environment /v OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS /f` |
332
+ | macOS | `launchctl setenv …`——本次登录对 GUI 生效,**注销后失效** | `launchctl unsetenv OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` |
333
+ | Linux | 有用户级 systemd 就 `systemctl --user set-environment …`,否则打印 `export` 那行 | `systemctl --user unset-environment OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS` |
334
+
335
+ 不想开:`install.ps1 -NoBackgroundSubagents`,或管道式安装前设
336
+ `TEAMMODE_SKIP_BACKGROUND_SUBAGENTS=1`。**不开也不会坏**——`task` 只是会阻塞 lead,
337
+ `tm_join` 照样负责回收(状态快照、取消、按 id 取回整篇回复、重启后接管)。
338
+
339
+ 代价说明白:每个后台任务完成都会唤醒 lead 一次、花一轮;而且在 TeamMode 把超限
340
+ 正文换成"预览 + 取回指针"之前,宿主注入的是全文。
341
+
342
+
276
343
  ### 更新
277
344
 
278
345
  > ⚠️ **OpenCode 加载插件用的是这份按 spec 字符串缓存的副本——
package/package.json CHANGED
@@ -1,59 +1,61 @@
1
- {
2
- "name": "@te-river/opencode-team-mode",
3
- "version": "1.5.14",
4
- "description": "Team collaboration mode plugin for OpenCode Desktop — injects specialized agents (architect, reviewer, implementer, tester, researcher) and team workflow commands into your OpenCode workspace.",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md",
17
- "README.zh-CN.md",
18
- "LICENSE",
19
- "docs"
20
- ],
21
- "scripts": {
22
- "build": "tsc",
23
- "test": "tsc && node test-blackboard.mjs && node test-envprotect.mjs && node test-tm-tools.mjs && node test-hosthooks.mjs && node test-default-agent.mjs && node test-memory.mjs && node test-browser.mjs",
24
- "prepublishOnly": "tsc",
25
- "dev": "tsc --watch"
26
- },
27
- "keywords": [
28
- "opencode",
29
- "opencode-plugin",
30
- "plugin",
31
- "team-mode",
32
- "collaboration",
33
- "multi-agent",
34
- "desktop",
35
- "ai-coding"
36
- ],
37
- "author": "",
38
- "license": "Apache-2.0",
39
- "publishConfig": {
40
- "access": "public"
41
- },
42
- "optionalDependencies": {
43
- "playwright-core": "1.63.0"
44
- },
45
- "peerDependencies": {
46
- "@opencode-ai/plugin": ">=0.1.0"
47
- },
48
- "devDependencies": {
49
- "@types/node": "^26.4.0",
50
- "typescript": "^5.5.0"
51
- },
52
- "repository": {
53
- "type": "git",
54
- "url": "https://github.com/Te-River/Opencode-TeamMode.git"
55
- },
56
- "engines": {
57
- "node": ">=18.0.0"
58
- }
59
- }
1
+ {
2
+ "name": "@te-river/opencode-team-mode",
3
+ "version": "1.6.0",
4
+ "description": "Team collaboration mode plugin for OpenCode Desktop — injects specialized agents (architect, reviewer, implementer, tester, researcher) and team workflow commands into your OpenCode workspace.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "README.zh-CN.md",
18
+ "LICENSE",
19
+ "docs"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "test": "node scripts/run-tests.mjs",
24
+ "test:serial": "node scripts/run-tests.mjs --serial",
25
+ "test:one": "node scripts/run-tests.mjs --no-build",
26
+ "prepublishOnly": "tsc",
27
+ "dev": "tsc --watch"
28
+ },
29
+ "keywords": [
30
+ "opencode",
31
+ "opencode-plugin",
32
+ "plugin",
33
+ "team-mode",
34
+ "collaboration",
35
+ "multi-agent",
36
+ "desktop",
37
+ "ai-coding"
38
+ ],
39
+ "author": "",
40
+ "license": "Apache-2.0",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "optionalDependencies": {
45
+ "playwright-core": "1.63.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@opencode-ai/plugin": ">=0.1.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^26.4.0",
52
+ "typescript": "^5.5.0"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "https://github.com/Te-River/Opencode-TeamMode.git"
57
+ },
58
+ "engines": {
59
+ "node": ">=18.0.0"
60
+ }
61
+ }