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

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 (150) hide show
  1. package/README.md +80 -15
  2. package/README.zh-CN.md +67 -18
  3. package/dist/host/note.d.ts +7 -0
  4. package/dist/host/note.d.ts.map +1 -0
  5. package/dist/host/note.js +28 -0
  6. package/dist/host/note.js.map +1 -0
  7. package/dist/host/v1.d.ts +14 -0
  8. package/dist/host/v1.d.ts.map +1 -0
  9. package/dist/host/v1.js +340 -0
  10. package/dist/host/v1.js.map +1 -0
  11. package/dist/host/v2-browser-gate.d.ts +45 -0
  12. package/dist/host/v2-browser-gate.d.ts.map +1 -0
  13. package/dist/host/v2-browser-gate.js +319 -0
  14. package/dist/host/v2-browser-gate.js.map +1 -0
  15. package/dist/host/v2-capabilities.d.ts +68 -0
  16. package/dist/host/v2-capabilities.d.ts.map +1 -0
  17. package/dist/host/v2-capabilities.js +146 -0
  18. package/dist/host/v2-capabilities.js.map +1 -0
  19. package/dist/host/v2-client.d.ts +53 -0
  20. package/dist/host/v2-client.d.ts.map +1 -0
  21. package/dist/host/v2-client.js +193 -0
  22. package/dist/host/v2-client.js.map +1 -0
  23. package/dist/host/v2-events.d.ts +56 -0
  24. package/dist/host/v2-events.d.ts.map +1 -0
  25. package/dist/host/v2-events.js +158 -0
  26. package/dist/host/v2-events.js.map +1 -0
  27. package/dist/host/v2-guard.d.ts +101 -0
  28. package/dist/host/v2-guard.d.ts.map +1 -0
  29. package/dist/host/v2-guard.js +199 -0
  30. package/dist/host/v2-guard.js.map +1 -0
  31. package/dist/host/v2-offload.d.ts +148 -0
  32. package/dist/host/v2-offload.d.ts.map +1 -0
  33. package/dist/host/v2-offload.js +288 -0
  34. package/dist/host/v2-offload.js.map +1 -0
  35. package/dist/host/v2-permissions.d.ts +123 -0
  36. package/dist/host/v2-permissions.d.ts.map +1 -0
  37. package/dist/host/v2-permissions.js +190 -0
  38. package/dist/host/v2-permissions.js.map +1 -0
  39. package/dist/host/v2-probe.d.ts +85 -0
  40. package/dist/host/v2-probe.d.ts.map +1 -0
  41. package/dist/host/v2-probe.js +268 -0
  42. package/dist/host/v2-probe.js.map +1 -0
  43. package/dist/host/v2-scope.d.ts +51 -0
  44. package/dist/host/v2-scope.d.ts.map +1 -0
  45. package/dist/host/v2-scope.js +58 -0
  46. package/dist/host/v2-scope.js.map +1 -0
  47. package/dist/host/v2-session-client.d.ts +74 -0
  48. package/dist/host/v2-session-client.d.ts.map +1 -0
  49. package/dist/host/v2-session-client.js +171 -0
  50. package/dist/host/v2-session-client.js.map +1 -0
  51. package/dist/host/v2-session.d.ts +85 -0
  52. package/dist/host/v2-session.d.ts.map +1 -0
  53. package/dist/host/v2-session.js +171 -0
  54. package/dist/host/v2-session.js.map +1 -0
  55. package/dist/host/v2-subagent.d.ts +157 -0
  56. package/dist/host/v2-subagent.d.ts.map +1 -0
  57. package/dist/host/v2-subagent.js +286 -0
  58. package/dist/host/v2-subagent.js.map +1 -0
  59. package/dist/host/v2-tool.d.ts +67 -0
  60. package/dist/host/v2-tool.d.ts.map +1 -0
  61. package/dist/host/v2-tool.js +209 -0
  62. package/dist/host/v2-tool.js.map +1 -0
  63. package/dist/host/v2-transcript.d.ts +73 -0
  64. package/dist/host/v2-transcript.d.ts.map +1 -0
  65. package/dist/host/v2-transcript.js +151 -0
  66. package/dist/host/v2-transcript.js.map +1 -0
  67. package/dist/host/v2-types.d.ts +229 -0
  68. package/dist/host/v2-types.d.ts.map +1 -0
  69. package/dist/host/v2-types.js +17 -0
  70. package/dist/host/v2-types.js.map +1 -0
  71. package/dist/host/v2.d.ts +42 -0
  72. package/dist/host/v2.d.ts.map +1 -0
  73. package/dist/host/v2.js +706 -0
  74. package/dist/host/v2.js.map +1 -0
  75. package/dist/index.d.ts +23 -17
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +29 -366
  78. package/dist/index.js.map +1 -1
  79. package/dist/prompts/lead.d.ts +1 -1
  80. package/dist/prompts/lead.d.ts.map +1 -1
  81. package/dist/prompts/lead.js +452 -426
  82. package/dist/prompts/lead.js.map +1 -1
  83. package/dist/prompts/shared.d.ts +2 -2
  84. package/dist/prompts/shared.d.ts.map +1 -1
  85. package/dist/prompts/shared.js +30 -10
  86. package/dist/prompts/shared.js.map +1 -1
  87. package/dist/prompts/specialists.d.ts +2 -2
  88. package/dist/prompts/specialists.d.ts.map +1 -1
  89. package/dist/prompts/specialists.js +7 -6
  90. package/dist/prompts/specialists.js.map +1 -1
  91. package/dist/task-offload.d.ts +16 -0
  92. package/dist/task-offload.d.ts.map +1 -1
  93. package/dist/task-offload.js +51 -0
  94. package/dist/task-offload.js.map +1 -1
  95. package/dist/tm/browser.d.ts.map +1 -1
  96. package/dist/tm/browser.js +41 -10
  97. package/dist/tm/browser.js.map +1 -1
  98. package/dist/tm/dispatch.d.ts +47 -0
  99. package/dist/tm/dispatch.d.ts.map +1 -1
  100. package/dist/tm/dispatch.js +230 -31
  101. package/dist/tm/dispatch.js.map +1 -1
  102. package/dist/tm/dupe-guard.d.ts +16 -3
  103. package/dist/tm/dupe-guard.d.ts.map +1 -1
  104. package/dist/tm/dupe-guard.js +27 -7
  105. package/dist/tm/dupe-guard.js.map +1 -1
  106. package/dist/tm/index.d.ts +40 -1
  107. package/dist/tm/index.d.ts.map +1 -1
  108. package/dist/tm/index.js +40 -11
  109. package/dist/tm/index.js.map +1 -1
  110. package/dist/tm/ledger.d.ts +114 -0
  111. package/dist/tm/ledger.d.ts.map +1 -0
  112. package/dist/tm/ledger.js +308 -0
  113. package/dist/tm/ledger.js.map +1 -0
  114. package/dist/tm/perm-ask.d.ts +1 -3
  115. package/dist/tm/perm-ask.d.ts.map +1 -1
  116. package/dist/tm/perm-ask.js +10 -1
  117. package/dist/tm/perm-ask.js.map +1 -1
  118. package/dist/tm/preview.d.ts +55 -0
  119. package/dist/tm/preview.d.ts.map +1 -1
  120. package/dist/tm/preview.js +225 -0
  121. package/dist/tm/preview.js.map +1 -1
  122. package/dist/tm/search.d.ts.map +1 -1
  123. package/dist/tm/search.js +40 -10
  124. package/dist/tm/search.js.map +1 -1
  125. package/dist/tm/serp-loop.d.ts +45 -0
  126. package/dist/tm/serp-loop.d.ts.map +1 -0
  127. package/dist/tm/serp-loop.js +80 -0
  128. package/dist/tm/serp-loop.js.map +1 -0
  129. package/dist/tm/stats.d.ts +10 -0
  130. package/dist/tm/stats.d.ts.map +1 -1
  131. package/dist/tm/stats.js +160 -0
  132. package/dist/tm/stats.js.map +1 -1
  133. package/dist/tm/webfetch.d.ts +4 -0
  134. package/dist/tm/webfetch.d.ts.map +1 -1
  135. package/dist/tm/webfetch.js +75 -8
  136. package/dist/tm/webfetch.js.map +1 -1
  137. package/docs/installation-v2.md +436 -0
  138. package/docs/installation.md +12 -0
  139. package/docs/research/agent-data-exchange.md +117 -0
  140. package/docs/research/browser-pane.md +89 -0
  141. package/docs/research/host-http-api.md +132 -0
  142. package/docs/research/host-subagent-injection.md +187 -0
  143. package/docs/research/plugin-loader-contract.md +261 -0
  144. package/docs/research/v2-builtin-tools.md +447 -0
  145. package/docs/v2-port-notes.md +315 -0
  146. package/index.js +7 -0
  147. package/package.json +64 -61
  148. package/scripts/gen-v2-config.mjs +304 -0
  149. package/scripts/lib/config-surgery.cjs +239 -0
  150. package/scripts/lib/fake-ctx.mjs +146 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2.js","sourceRoot":"","sources":["../../src/host/v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,C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S;oBACpD,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,IAAI,QAAQ;oBAC7D,oBAAoB,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ;oBACnD,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS;oBAClD,oBAAoB,EAAE,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;oBAChE,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE;oBAC5F,wBAAwB,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY;oBACxD,uBAAuB,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW;oBACtD,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;oBAC7C,oBAAoB,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;oBAC5C,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO;oBAC7C,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;iBAC9B,CAAC,CAAA;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,iEAAiE;YACnE,CAAC;YACD,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;gBAC9B,IAAI,CAAC;oBACH,MAAM,CAAC,CAAC,OAAO,EAAE,CAAA;gBACnB,CAAC;gBAAC,MAAM,CAAC;oBACP,6EAA6E;gBAC/E,CAAC;YACH,CAAC;YACD,iFAAiF;YACjF,MAAM,SAAS,CAAC,OAAO,EAAE,CAAA;QAC3B,CAAC,CAAA;IACH,CAAC;CACF,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,24 +1,29 @@
1
1
  /**
2
- * opencode-team-mode — OpenCode plugin entry point.
2
+ * opencode-team-mode — plugin entry point: the DUAL-PERSONALITY export.
3
3
  *
4
- * Contract with the SHIPPED OpenCode Desktop loader (1.18.x, verified by
5
- * reading the binary's own applyPlugin/readV1Plugin code):
4
+ * One module, two host generations. Which one runs is the host's choice, and
5
+ * the two never overlap:
6
6
  *
7
- * export default {
8
- * id: "team-mode", → Desktop plugin display name
9
- * server: async (input, options) => ({
10
- * config(cfg) { ...inject agents/commands... },
11
- * "tool.execute.before"(...) { ...R6 env protection... },
12
- * tool: { tm_read, tm_grep, tm_bash, tm_fetch }, → JIT layer-2 tools
13
- * })
14
- * }
7
+ * OpenCode 1.18.x (v1 loader, verified against the desktop binary's own
8
+ * applyPlugin/readV1Plugin code) calls ONLY
9
+ * default.server(input, options) → v1 Hooks
10
+ * and silently ignores any other property — that is what killed v1.1-v1.3,
11
+ * which shipped a `setup` and no `server` (see the project memory on the
12
+ * loader contract).
15
13
  *
16
- * `server()` is the ONLY function the loader calls; a `setup` property is
17
- * silently ignored (root cause of v1.1-v1.3 not appearing in the picker).
18
- * The v1 `config` hook receives the merged opencode config and is the
19
- * supported way to add agents/commands.
14
+ * OpenCode 2.x (v2) reads
15
+ * default.{id, setup(ctx)} → Plugin.define() is the identity function in
16
+ * @opencode/plugin@2.0.16, so the plain object IS the definition and the v2
17
+ * SDK is never a runtime dependency. It ignores `server()`.
20
18
  *
21
- * Options (via the tuple plugin form):
19
+ * "V1 plugin implementations do not run in V2" is the official statement, so
20
+ * both halves have to be present in the published package or a user upgrading
21
+ * their host simply loses the team.
22
+ *
23
+ * The v1 half lives in `src/host/v1.ts` unchanged from 1.6.0 — a v1 host must
24
+ * not observe one behavioural difference, and test-*.mjs is the oracle.
25
+ *
26
+ * Options (via the tuple plugin form, v1):
22
27
  * "plugin": [["@te-river/opencode-team-mode@latest", { "ttlDays": 7 }]]
23
28
  * - `ttlDays` → blackboard auto-cleanup TTL; default 5.
24
29
  * - `defaultAgent` → Team is the default agent (opt-out: set `false`).
@@ -29,6 +34,7 @@
29
34
  * mutually exclusive by the server's sort).
30
35
  */
31
36
  import type { OpenCodePlugin } from "./types.js";
32
- declare const plugin: OpenCodePlugin;
37
+ import type { V2Plugin } from "./host/v2-types.js";
38
+ declare const plugin: OpenCodePlugin & Pick<V2Plugin, "setup">;
33
39
  export default plugin;
34
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA8C,MAAM,YAAY,CAAA;AA4D5F,QAAA,MAAM,MAAM,EAAE,cAgVb,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAIlD,QAAA,MAAM,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAQpD,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/index.js CHANGED
@@ -1,24 +1,29 @@
1
1
  /**
2
- * opencode-team-mode — OpenCode plugin entry point.
2
+ * opencode-team-mode — plugin entry point: the DUAL-PERSONALITY export.
3
3
  *
4
- * Contract with the SHIPPED OpenCode Desktop loader (1.18.x, verified by
5
- * reading the binary's own applyPlugin/readV1Plugin code):
4
+ * One module, two host generations. Which one runs is the host's choice, and
5
+ * the two never overlap:
6
6
  *
7
- * export default {
8
- * id: "team-mode", → Desktop plugin display name
9
- * server: async (input, options) => ({
10
- * config(cfg) { ...inject agents/commands... },
11
- * "tool.execute.before"(...) { ...R6 env protection... },
12
- * tool: { tm_read, tm_grep, tm_bash, tm_fetch }, → JIT layer-2 tools
13
- * })
14
- * }
7
+ * OpenCode 1.18.x (v1 loader, verified against the desktop binary's own
8
+ * applyPlugin/readV1Plugin code) calls ONLY
9
+ * default.server(input, options) → v1 Hooks
10
+ * and silently ignores any other property — that is what killed v1.1-v1.3,
11
+ * which shipped a `setup` and no `server` (see the project memory on the
12
+ * loader contract).
15
13
  *
16
- * `server()` is the ONLY function the loader calls; a `setup` property is
17
- * silently ignored (root cause of v1.1-v1.3 not appearing in the picker).
18
- * The v1 `config` hook receives the merged opencode config and is the
19
- * supported way to add agents/commands.
14
+ * OpenCode 2.x (v2) reads
15
+ * default.{id, setup(ctx)} → Plugin.define() is the identity function in
16
+ * @opencode/plugin@2.0.16, so the plain object IS the definition and the v2
17
+ * SDK is never a runtime dependency. It ignores `server()`.
20
18
  *
21
- * Options (via the tuple plugin form):
19
+ * "V1 plugin implementations do not run in V2" is the official statement, so
20
+ * both halves have to be present in the published package or a user upgrading
21
+ * their host simply loses the team.
22
+ *
23
+ * The v1 half lives in `src/host/v1.ts` unchanged from 1.6.0 — a v1 host must
24
+ * not observe one behavioural difference, and test-*.mjs is the oracle.
25
+ *
26
+ * Options (via the tuple plugin form, v1):
22
27
  * "plugin": [["@te-river/opencode-team-mode@latest", { "ttlDays": 7 }]]
23
28
  * - `ttlDays` → blackboard auto-cleanup TTL; default 5.
24
29
  * - `defaultAgent` → Team is the default agent (opt-out: set `false`).
@@ -28,358 +33,16 @@
28
33
  * alphabetical slot: build, plan, team (the two are
29
34
  * mutually exclusive by the server's sort).
30
35
  */
31
- import { agents } from "./agents.js";
32
- import { commands } from "./commands.js";
33
- import { startBlackboardMaintenance, resolveTtlMs, DEFAULT_TTL_DAYS, } from "./blackboard.js";
34
- import { createEnvProtectHook, parseExtraDeny, resolveEnvProtectMode, bashAskPatterns, } from "./envprotect.js";
35
- import { createApprovalGate, resolveAskTimeoutMs, hasPermissionReplyCapability, } from "./approval-gate.js";
36
- import { createTmTools } from "./tm/index.js";
37
- import { createBashTimeoutHook } from "./tm/bash-timeout.js";
38
- import { createCapabilityProbe } from "./capabilities.js";
39
- import { createTaskOffload } from "./task-offload.js";
40
- import { coerceToolArgs } from "./tool-coerce.js";
41
- import { ASK_GRACE_MS, setAskBridgeObserver, setAskWaitMs } from "./tm/perm-ask.js";
42
- import { applyToolDefinition, applyChatParams, applySessionCompacting, applyCompactionAutoContinue, applyShellEnv, hookSwitches, TASK_HINT_BACKGROUND, } from "./host-hooks.js";
43
- import { hostBackgroundSubagentsEnabled } from "./tm/dispatch.js";
44
- /** Runtime addendum to the team prompt: concrete board + TTL (hybrid mode). */
45
- function blackboardNote(root, ttlDays) {
46
- return [
47
- "",
48
- "",
49
- "## Team Blackboard — resolved for this workspace",
50
- `Root directory: \`${root}\``,
51
- `- Hybrid channel: specialist replies (the STATUS/CHANGES/FINDINGS/EVIDENCE/HANDOFF`,
52
- ` skeleton) are the PRIMARY transport — normal work needs no files at all.`,
53
- `- Board files exist ONLY for oversized deliverables (>~50 lines), and they`,
54
- ` go through \`tm_board_write { task, topic, content, session? }\` — the board's`,
55
- ` write side, carried by every role including the ones with no file tool. It`,
56
- ` places \`<root>/<session-key>/<task-slug>/NN-<role>-<topic>[-rN].md\`, never`,
57
- ` overwrites, and answers with the PATH (never the content).`,
58
- ` On the FIRST board write of this conversation pass a session folder made from`,
59
- ` a compact clock timestamp (PowerShell: \`Get-Date -Format yyyyMMdd-HHmmss\`;`,
60
- ` POSIX: \`date +%Y%m%d-%H%M%S\`) and reuse it for every later task; omit it and`,
61
- ` the tool stamps one — that is how a role with no bash reaches the board at`,
62
- ` all. Never write into another conversation's session folder.`,
63
- `- Auto-cleanup: the plugin sweeps task directories idle for more than ${ttlDays} days (at startup and hourly).`,
64
- ` This is the ONLY cleanup path — never delete task or session directories yourself.`,
65
- ].join("\n");
66
- }
36
+ import { createV1Personality } from "./host/v1.js";
37
+ import { v2Personality } from "./host/v2.js";
67
38
  const plugin = {
68
39
  id: "team-mode",
69
- server: async (input, options) => {
70
- // ---------- blackboard maintenance (code-level TTL sweeper) ----------
71
- const directory = typeof input?.directory === "string" && input.directory.length > 0
72
- ? input.directory
73
- : process.cwd();
74
- const ttlMs = resolveTtlMs(options);
75
- const ttlDays = Math.round(ttlMs / (24 * 60 * 60 * 1000)) || DEFAULT_TTL_DAYS;
76
- const boardRoot = startBlackboardMaintenance(directory, ttlMs);
77
- const note = blackboardNote(boardRoot, ttlDays);
78
- // ---------- R6 env protection (code-level interception) ----------
79
- // Plugin option envProtect (default false): opt-in env protection.
80
- // When disabled, R6 hook is not installed at all — no interception,
81
- // no approval gate, no audit logging for env reads.
82
- // When enabled, TM_ENV_PROTECT / TM_ENV_PROTECT_EXTRA_DENY still apply.
83
- const envProtectMode = options?.envProtect
84
- ? resolveEnvProtectMode(process.env.TM_ENV_PROTECT)
85
- : "off";
86
- const envProtectExtra = parseExtraDeny(process.env.TM_ENV_PROTECT_EXTRA_DENY);
87
- // ---------- unified approval gate (R6 env face + R2 danger face) ----------
88
- // Layer 2: ONE timer that auto-REJECTS unanswered official-dialog requests
89
- // after TM_ASK_TIMEOUT_MIN and (Layer 3) fails closed if the SDK reply is
90
- // broken. Armed ONLY when R6 is not off AND the client exposes a
91
- // permission-reply path — otherwise there is no live auto-reject and the
92
- // R6 hook must keep hard-throwing every env read (fail-closed).
93
- // Attention hook for EVERY official dialog the plugin observes (bash R2/R6
94
- // asks AND the tm_* ctx.ask web dialogs): the host's `tui.showToast` RPC
95
- // (verified 1.18.30 route: payload { title?, message, variant, duration })
96
- // surfaces a toast so a user not staring at the screen still learns a
97
- // confirmation is waiting. Best-effort — never breaks the gate.
98
- const notifyAsk = (message) => {
99
- try {
100
- const tui = input?.client
101
- ?.tui;
102
- if (typeof tui?.showToast === "function") {
103
- const r = tui.showToast({
104
- title: "OpenCode TeamMode",
105
- message,
106
- variant: "warning",
107
- duration: 15_000,
108
- });
109
- if (r && typeof r.catch === "function") {
110
- ;
111
- r.catch(() => { });
112
- }
113
- }
114
- }
115
- catch {
116
- /* notification is best-effort */
117
- }
118
- };
119
- const approvalGate = envProtectMode !== "off" && hasPermissionReplyCapability(input?.client)
120
- ? createApprovalGate({
121
- client: input?.client,
122
- timeoutMs: resolveAskTimeoutMs(process.env),
123
- notify: notifyAsk,
124
- })
125
- : null;
126
- if (approvalGate)
127
- approvalGate.start();
128
- // Sessions are only allowed to DEFER expressible env reads to the dialog
129
- // once the gate registered them as carrying our injected bash ask set
130
- // (reviewer C1: a global isArmed() deferral let stock build/plan agents
131
- // run printenv silently). The authoritative source of that fact is the
132
- // config hook below: it records exactly which agents got the escalated
133
- // ask object, and a `message.updated`/`chat.message` user prompt routed
134
- // to one of those agents registers its session (live-proven ordering:
135
- // the user message event arrives before the session's first
136
- // tool.execute.before, while permission.asked arrives AFTER it).
137
- const injectedExecAgents = new Set();
138
- const envProtectHook = createEnvProtectHook(input?.client, envProtectMode, envProtectExtra, { deferToApproval: (sessionID) => approvalGate?.canDefer(sessionID) ?? false,
139
- envApproved: (sessionID) => approvalGate?.isEnvApproved(sessionID) ?? false });
140
- // ---------- JIT layer-2 tools (tm_read / tm_grep / tm_bash / tm_fetch) ----------
141
- // T0.4-verified static registration: server() hooks gain a `tool` segment.
142
- // The R6 mode/extra resolved above are passed in so the tm_* pipelines
143
- // share the SAME interception source as the built-in tools (anti-backdoor:
144
- // the global hook ALSO aliases tm_* onto read/grep/bash — see envprotect).
145
- // ---------- host-capability probe (see src/capabilities.ts) ----------
146
- // The plugin's features degrade quietly when a host surface disappears;
147
- // this records what is actually present and says so once, at startup,
148
- // instead of letting an OpenCode upgrade surface as an agent working
149
- // around something the user never agreed to lose.
150
- let capabilityProbe = null;
151
- const tmRuntime = await createTmTools(input, {
152
- mode: envProtectMode,
153
- extra: envProtectExtra,
154
- notify: notifyAsk,
155
- // The capability probe is built from the tm runtime (it needs the run
156
- // store to log into), and tm_stats needs the probe back — a declaration
157
- // before construction breaks the cycle without weakening either side.
158
- capabilities: () => capabilityProbe?.snapshot() ?? [],
159
- // A child session we take over (adopted from the host tree, or named to
160
- // tm_join) is registered the moment it is recognised (the message.updated
161
- // route below re-confirms it): an exec-role sub-agent whose session were
162
- // NOT registered would hard-throw its own protected reads instead of
163
- // opening the dialog.
164
- onChildSession: (sessionID, agent) => {
165
- if (approvalGate && injectedExecAgents.has(agent))
166
- approvalGate.registerExecSession(sessionID);
167
- },
168
- });
169
- // ---------- host-hook switches (TM_TOOL_HINTS / TM_COMPACTION_*) ------
170
- const hostSwitches = hookSwitches(process.env);
171
- capabilityProbe = createCapabilityProbe({
172
- client: input?.client,
173
- hasShellBridge: typeof input?.$ === "function",
174
- hasPermissionReply: hasPermissionReplyCapability(input?.client),
175
- trajectory: (event) => tmRuntime.pipelines.store.appendTrajectory(event),
176
- notify: notifyAsk,
177
- });
178
- // ctx.ask is only observable from inside a tool call — perm-ask reports
179
- // every lookup it makes, which is how this row ever reaches 已验证.
180
- // The tool-side backstop for a dialog nobody answers. It is deliberately
181
- // LONGER than the gate's own auto-reject so the gate stays authoritative when it
182
- // is armed; when it is not (R6 off, no reply capability) this is the only thing
183
- // that keeps a governed call from hanging until the user interrupts the turn.
184
- setAskWaitMs(resolveAskTimeoutMs(process.env) + ASK_GRACE_MS);
185
- setAskBridgeObserver((present) => capabilityProbe?.observeAskBridge(present));
186
- // Plan B's other half: keep the host's background-task result injection
187
- // inside the context budget. Built here because it needs the tm runtime's
188
- // thresholds and its trajectory writer.
189
- const taskOffloadHook = createTaskOffload({
190
- enabled: tmRuntime.config.taskOffload === "on",
191
- thresholdTokens: tmRuntime.config.offloadThresholdText,
192
- previewLines: tmRuntime.config.previewLines,
193
- previewMaxTokens: tmRuntime.config.previewMaxTokens,
194
- log: (event) => tmRuntime.pipelines.store.appendTrajectory(event),
195
- });
196
- // Startup report: one trajectory line always, one toast ONLY when a
197
- // required surface is gone (a missing 待观察 row is not an alarm).
198
- capabilityProbe.report();
199
- // ---------- bash timeout clamp (issue #6, see tm/bash-timeout.ts) ------
200
- const bashTimeoutHook = createBashTimeoutHook({
201
- probeMs: tmRuntime.config.bashTimeoutProbeMs,
202
- maxMs: tmRuntime.config.bashTimeoutMaxMs,
203
- readonlyAllowed: tmRuntime.config.bashReadonlyAllowed,
204
- onClamp: (info) => {
205
- try {
206
- tmRuntime.pipelines.store.appendTrajectory({
207
- tool: "bash",
208
- step_id: "timeout-clamp",
209
- event: info.via,
210
- from_ms: info.from,
211
- to_ms: info.to,
212
- });
213
- }
214
- catch {
215
- /* observability only */
216
- }
217
- },
218
- });
219
- return {
220
- // ---------- v1 config hook: inject agents & commands ----------
221
- config(cfg) {
222
- if (!cfg.agent)
223
- cfg.agent = {};
224
- // Execution roles carry permission.bash === "allow"; escalate it to a
225
- // pattern object so the host opens its official confirmation dialog
226
- // for the R6 env face + R2 danger face (default `*` stays allow). A
227
- // shallow copy keeps the module-level `agents` object pristine. The
228
- // R6 env face is only injected while the approval gate can arm: with
229
- // no arming client the R6 hook hard-throws env reads BEFORE any
230
- // dialog could be satisfied, so those patterns would be dead popups.
231
- const bashAsk = bashAskPatterns(envProtectMode, approvalGate !== null);
232
- for (const [name, def] of Object.entries(agents)) {
233
- // Respect user-defined overrides: never clobber an existing entry.
234
- if (cfg.agent[name])
235
- continue;
236
- const permission = def.permission
237
- ? {
238
- ...def.permission,
239
- ...(def.permission.bash === "allow" ? { bash: bashAsk } : null),
240
- }
241
- : def.permission;
242
- cfg.agent[name] = {
243
- ...def,
244
- permission,
245
- prompt: name === "team" ? (def.prompt ?? "") + note : def.prompt,
246
- };
247
- // deferral-registry seed: agents that ACTUALLY carry our escalated
248
- // bash ask object (user-overridden agents never get added)
249
- if (def.permission && def.permission.bash === "allow")
250
- injectedExecAgents.add(name);
251
- }
252
- if (!cfg.command)
253
- cfg.command = {};
254
- for (const [name, def] of Object.entries(commands)) {
255
- if (cfg.command[name])
256
- continue;
257
- cfg.command[name] = def;
258
- }
259
- // ---------- make Team the default agent (opt-out: defaultAgent:false)
260
- const promote = options?.defaultAgent !== false;
261
- if (promote && (!cfg.default_agent || cfg.default_agent === "build")) {
262
- cfg.default_agent = "team";
263
- }
264
- },
265
- // ---------- R6: block the model's env-var read paths in code ----------
266
- // ONE hook, two independent jobs (the host calls the single
267
- // `tool.execute.before` slot per plugin): first clamp a wasteful
268
- // model-set bash timeout, then run the R6 interception. The clamp
269
- // runs BEFORE R6 so a blocked call is never also a slow one.
270
- "tool.execute.before": async (input, output) => {
271
- capabilityProbe?.observeHook("tool.execute.before");
272
- // First, and narrowest: a built-in boolean the model sent as a string
273
- // (the host's schema rejects it — two dead `task {background}` calls
274
- // proved the trap). Then the timeout clamp, then R6.
275
- const coerced = coerceToolArgs(input, output);
276
- if (coerced.length) {
277
- tmRuntime.pipelines.store.appendTrajectory({
278
- tool: String(input?.tool ?? "task"),
279
- step_id: "args-coerce",
280
- event: "coerced",
281
- keys: coerced.join(","),
282
- });
283
- }
284
- bashTimeoutHook(input, output);
285
- await envProtectHook(input, output);
286
- },
287
- // ---------- host-hook leverage beyond the tool surface (audit #2) ----
288
- // Every one of these rides a published hook and mutates ONLY the
289
- // fields whose shape is verified; each is independently switchable,
290
- // because this host's d.ts has shipped surfaces the runtime never
291
- // fires (permission.ask), so adapters must fail soft, not assume.
292
- // The `observeHook` calls are that "not assume" made observable: a row
293
- // stays 待观察 until the host actually calls the hook, and tm_stats
294
- // reports it either way.
295
- "tool.definition": (input, output) => {
296
- capabilityProbe?.observeHook("tool.definition");
297
- applyToolDefinition(input, output, hostSwitches.toolHints, hostBackgroundSubagentsEnabled() ? TASK_HINT_BACKGROUND : undefined);
298
- },
299
- "chat.params": (input, output) => {
300
- capabilityProbe?.observeHook("chat.params");
301
- applyChatParams(input, output, process.env);
302
- },
303
- "experimental.session.compacting": (input, output) => {
304
- capabilityProbe?.observeHook("session.compacting");
305
- applySessionCompacting(output, hostSwitches.compactionContext);
306
- },
307
- "experimental.compaction.autocontinue": (input, output) => {
308
- capabilityProbe?.observeHook("compaction.autocontinue");
309
- applyCompactionAutoContinue(output, process.env);
310
- },
311
- "shell.env": (input, output) => {
312
- capabilityProbe?.observeHook("shell.env");
313
- applyShellEnv(output, process.env);
314
- },
315
- // ---------- unified approval gate: watch the host permission dialog ---
316
- event: ({ event }) => {
317
- capabilityProbe?.observeEvent(event?.type ?? "");
318
- // Async dispatch bookkeeping runs FIRST and independently of R6:
319
- // session.idle / .error are what tell the lead its children settled.
320
- tmRuntime.observeDispatchEvent(event);
321
- if (!approvalGate)
322
- return;
323
- // Pre-tool session registration: the live host emits message.updated
324
- // with the full UserMessage ({ sessionID, role:"user", agent }) when
325
- // a prompt enters a session — BEFORE any tool.execute.before of that
326
- // turn, which is exactly when the R6 hook needs to know the session
327
- // carries our injected ask set (permission.asked only fires AFTER
328
- // the hook, so it can never be the first-command registration).
329
- if (event?.type === "message.updated") {
330
- const info = event.properties?.info;
331
- if (info &&
332
- info.role === "user" &&
333
- typeof info.agent === "string" &&
334
- typeof info.sessionID === "string") {
335
- // UserMessage.agent is a REQUIRED string in the host schema
336
- // (verified in the desktop binary), so a user prompt always names
337
- // its agent. Deferral stays live only while the CURRENT prompt
338
- // runs an exec-role agent: a prompt routed to any other agent
339
- // revokes the registration (stock agents' sessions would never
340
- // open our dialogs, so a stale registration = silent env reads).
341
- if (injectedExecAgents.has(info.agent)) {
342
- approvalGate.registerExecSession(info.sessionID);
343
- }
344
- else {
345
- approvalGate.revokeExecSession(info.sessionID);
346
- }
347
- }
348
- return;
349
- }
350
- approvalGate.handleEvent(event);
351
- },
352
- // secondary registration channel (official 1.18.x contract; the event
353
- // route above is the one verified against the live 1.18.29 bus)
354
- "chat.message": (input, output) => {
355
- // Plan B: the host's background sub-agent injects the child's FULL
356
- // reply here. Governance first, and independent of the approval gate —
357
- // it only ever touches synthetic parts carrying the host's own
358
- // task envelope (see src/task-offload.ts).
359
- taskOffloadHook(input, output ?? { message: undefined, parts: undefined });
360
- if (!approvalGate)
361
- return;
362
- if (input &&
363
- typeof input.sessionID === "string" &&
364
- typeof input.agent === "string") {
365
- if (injectedExecAgents.has(input.agent)) {
366
- approvalGate.registerExecSession(input.sessionID);
367
- }
368
- else {
369
- approvalGate.revokeExecSession(input.sessionID);
370
- }
371
- }
372
- },
373
- dispose: async () => {
374
- approvalGate?.dispose();
375
- // tm_browser owns a browser child process — kill it on teardown and
376
- // WAIT, or the process can exit with the window still on screen.
377
- await tmRuntime.dispose();
378
- },
379
- // ---------- JIT layer-2: tm_read / tm_grep / tm_bash / tm_fetch ----------
380
- tool: tmRuntime.tools,
381
- };
382
- },
40
+ // read by an OpenCode 1.18.x host
41
+ server: createV1Personality,
42
+ // read by an OpenCode 2.x host; `Plugin.define` is the identity function, so
43
+ // handing over the plain {id, setup} pair IS the definition — no v2 SDK at
44
+ // runtime, which is what keeps this package installable by v1 users.
45
+ setup: v2Personality.setup,
383
46
  };
384
47
  export default plugin;
385
48
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAwB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,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