@te-river/opencode-team-mode 1.5.15 → 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 (97) hide show
  1. package/README.md +788 -690
  2. package/README.zh-CN.md +712 -631
  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 +18 -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 +92 -25
  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 +62 -10
  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 +36 -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 -25
  46. package/dist/tm/config.d.ts.map +1 -1
  47. package/dist/tm/config.js +29 -7
  48. package/dist/tm/config.js.map +1 -1
  49. package/dist/tm/dispatch.d.ts +86 -53
  50. package/dist/tm/dispatch.d.ts.map +1 -1
  51. package/dist/tm/dispatch.js +254 -251
  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 -19
  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 +16 -0
  83. package/dist/tm/stats.d.ts.map +1 -1
  84. package/dist/tm/stats.js +34 -4
  85. package/dist/tm/stats.js.map +1 -1
  86. package/dist/tm/webfetch.d.ts +52 -0
  87. package/dist/tm/webfetch.d.ts.map +1 -1
  88. package/dist/tm/webfetch.js +124 -23
  89. package/dist/tm/webfetch.js.map +1 -1
  90. package/dist/tool-coerce.d.ts +24 -0
  91. package/dist/tool-coerce.d.ts.map +1 -0
  92. package/dist/tool-coerce.js +63 -0
  93. package/dist/tool-coerce.js.map +1 -0
  94. package/dist/types.d.ts +7 -1
  95. package/dist/types.d.ts.map +1 -1
  96. package/docs/installation.md +69 -2
  97. package/package.json +61 -61
@@ -0,0 +1,275 @@
1
+ /**
2
+ * tm_board_write — the write side of the blackboard (2026-09-23).
3
+ *
4
+ * Why it exists: the board is the one place an oversized deliverable is
5
+ * supposed to go, but reaching it needs a file tool — and three of the six
6
+ * roles carry none. `architect` and `researcher` have no write/edit/bash at
7
+ * all (a deliberate permission-matrix decision), so every "write the design
8
+ * doc to the board" dispatch ended as `BLACKBOARD WRITE FAILED` with the
9
+ * document pasted inline anyway — the reply shape this team exists to enforce
10
+ * (skeleton + path, never a wall of text) was un-followable for exactly the two
11
+ * roles that produce the longest artifacts. Even the documented session folder
12
+ * is out of reach: creating it means running `Get-Date`, which those roles
13
+ * cannot run either.
14
+ *
15
+ * What this is NOT: a general file writer. It places a NEW markdown file
16
+ * inside `<board-root>/<session-key>/<task-slug>/` and nothing else — no
17
+ * overwrite (a revision is a new `-rN` round, per the documented layout), no
18
+ * traversal (each segment is a sanitized slug, then realpath-verified against
19
+ * the root), no workspace or user paths, no `.env` family. The reply returns
20
+ * the path plus the byte count, never the content: bytes riding back through
21
+ * the context window is the very thing the board exists to avoid.
22
+ */
23
+ import * as fs from "node:fs";
24
+ import * as path from "node:path";
25
+ import { tmError, toToolResult } from "./result.js";
26
+ /** Content cap for one board file (characters). A deliverable past this is not
27
+ * a board file — it is two, or it is the wrong tool. */
28
+ export const BOARD_MAX_CONTENT_CHARS = 200_000;
29
+ /** Files per session folder (across its task dirs): the TTL sweeper is the only
30
+ * reclaim path by design, so an unbounded count is a disk leak. */
31
+ export const BOARD_MAX_FILES_PER_SESSION = 200;
32
+ export const BOARD_MAX_TASKS_PER_SESSION = 40;
33
+ /** `yyyyMMdd-HHmmss`, local — the SAME shape the blackboard note tells the lead
34
+ * to build with `Get-Date -Format yyyyMMdd-HHmmss` / `date +%Y%m%d-%H%M%S`, so
35
+ * a tool-made session folder is indistinguishable from a hand-made one. */
36
+ export function sessionKeyStamp(now = new Date()) {
37
+ const p = (n) => String(n).padStart(2, "0");
38
+ return (`${now.getFullYear()}${p(now.getMonth() + 1)}${p(now.getDate())}` +
39
+ `-${p(now.getHours())}${p(now.getMinutes())}${p(now.getSeconds())}`);
40
+ }
41
+ /**
42
+ * One path segment out of untrusted model text. Separators and `..` are
43
+ * REWRITTEN rather than rejected (a model that writes `auth/design` means the
44
+ * task `auth-design`), anything that cannot survive a filename is dropped, and
45
+ * CJK is preserved because this project's users write CJK. "" means "nothing
46
+ * usable was given", which the caller turns into an args error.
47
+ */
48
+ export function sanitizeSlug(raw, max = 60) {
49
+ const s = String(raw ?? "")
50
+ .replace(/[\\/]+/g, "-")
51
+ .replace(/\.\./g, "-")
52
+ .replace(/[<>:"|?*\x00-\x1f]/g, "")
53
+ .replace(/\s+/g, "-")
54
+ .replace(/-{2,}/g, "-")
55
+ .replace(/^[-.]+|[-.]+$/g, "")
56
+ .slice(0, max);
57
+ return s === "." || s === ".." ? "" : s;
58
+ }
59
+ /** `NN` for the next file in a task dir: max existing ordinal + 1, so a hand
60
+ * -written `07-…md` the lead created is counted too. */
61
+ export function nextOrdinal(names) {
62
+ let max = 0;
63
+ for (const n of names) {
64
+ const m = /^(\d{1,4})-/.exec(n);
65
+ if (m)
66
+ max = Math.max(max, Number(m[1]));
67
+ }
68
+ return max + 1;
69
+ }
70
+ /** The round suffix for a revision: "" when the base name is free, else
71
+ * `-r2`, `-r3`… — never a rewrite, because the board's history IS the audit
72
+ * trail the lead reads back. */
73
+ export function roundSuffix(names, base) {
74
+ if (!names.includes(`${base}.md`))
75
+ return "";
76
+ let r = 2;
77
+ while (names.includes(`${base}-r${r}.md`))
78
+ r++;
79
+ return `-r${r}`;
80
+ }
81
+ /** The `NN` that anchors a revision: a family keeps the number its first file
82
+ * got, so `01-architect-design.md` and `01-architect-design-r2.md` sit
83
+ * together in a listing. Advancing the ordinal instead (the first version of
84
+ * this code did) means a revision never gets the `-rN` suffix the documented
85
+ * layout promises, and the round history becomes invisible. */
86
+ export function findFamily(names, role, topic) {
87
+ const esc = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
88
+ const re = new RegExp(`^(\\d{1,4})-${esc(role)}-${esc(topic)}(?:-r(\\d+))?\\.md$`);
89
+ let nn = 0;
90
+ let maxRound = 1;
91
+ for (const n of names) {
92
+ const m = re.exec(n);
93
+ if (!m)
94
+ continue;
95
+ if (!nn)
96
+ nn = Number(m[1]);
97
+ maxRound = Math.max(maxRound, Number(m[2] ?? 1));
98
+ }
99
+ if (!nn)
100
+ return null;
101
+ return { base: `${String(nn).padStart(2, "0")}-${role}-${topic}`, round: `-r${maxRound + 1}` };
102
+ }
103
+ /**
104
+ * Plan the write: `<root>/<session>/<task>/<NN>-<role>-<topic><round>.md`.
105
+ * Every segment is sanitized and the resolved session/task pair is checked
106
+ * against the root by REALPATH, because a task dir somebody made earlier could
107
+ * be a symlink pointing at `~/.ssh` — and a writer that only strings paths
108
+ * together would follow it happily.
109
+ */
110
+ export function planBoardWrite(opts) {
111
+ const session = sanitizeSlug(opts.session, 40);
112
+ const task = sanitizeSlug(opts.task, 60);
113
+ const topic = sanitizeSlug(opts.topic, 60);
114
+ const role = sanitizeSlug(opts.role, 24) || "agent";
115
+ if (!session || !task || !topic) {
116
+ return { error: "session / task / topic 里必须各有至少一个可用字符(会被规整成安全的路径段)" };
117
+ }
118
+ const taskDir = path.join(opts.root, session, task);
119
+ // The session folder is the boundary a runaway task name must not cross.
120
+ let realRoot;
121
+ let realSessionParent;
122
+ try {
123
+ realRoot = fs.realpathSync(opts.root);
124
+ const sessionDir = path.join(realRoot, session);
125
+ if (fs.existsSync(sessionDir)) {
126
+ realSessionParent = fs.realpathSync(sessionDir);
127
+ if (realSessionParent !== path.join(realRoot, session)) {
128
+ return { error: `会话目录 ${session} 是一个符号链接,指向黑板之外——不在写入范围` };
129
+ }
130
+ }
131
+ }
132
+ catch {
133
+ realRoot = path.resolve(opts.root);
134
+ realSessionParent = "";
135
+ }
136
+ const resolvedTask = path.resolve(taskDir);
137
+ if (resolvedTask !== taskDir || !resolvedTask.startsWith(realRoot + path.sep)) {
138
+ return { error: "解析后的目标路径越出了黑板根目录,拒绝写入" };
139
+ }
140
+ const files = opts.list(taskDir);
141
+ const fam = findFamily(files, role, topic);
142
+ const base = fam ? fam.base : `${String(nextOrdinal(files)).padStart(2, "0")}-${role}-${topic}`;
143
+ const round = fam ? fam.round : roundSuffix(files, base);
144
+ return { dir: taskDir, file: `${base}${round}.md`, rel: path.join(session, task, `${base}${round}.md`), round };
145
+ }
146
+ /** Count what this session folder already holds, so the caps can be enforced
147
+ * before another 400 files arrive. Never throws: an unreadable tree simply
148
+ * counts as nothing. */
149
+ export function sessionUsage(root, session) {
150
+ let files = 0;
151
+ let tasks = 0;
152
+ try {
153
+ for (const entry of fs.readdirSync(path.join(root, session), { withFileTypes: true })) {
154
+ if (!entry.isDirectory())
155
+ continue;
156
+ tasks++;
157
+ try {
158
+ files += fs.readdirSync(path.join(root, session, entry.name)).filter((f) => f.endsWith(".md")).length;
159
+ }
160
+ catch {
161
+ /* raced — this task contributes nothing */
162
+ }
163
+ }
164
+ }
165
+ catch {
166
+ return { files: 0, tasks: 0 };
167
+ }
168
+ return { files, tasks };
169
+ }
170
+ /** Atomic-ish: write a sibling temp file then rename, so a crash mid-write
171
+ * cannot leave a half-written board file that a reader mistakes for the real
172
+ * deliverable. (win32 rename over an existing target throws — which is fine
173
+ * here, because the name was chosen as unused.) */
174
+ export function writeNewFile(file, text) {
175
+ const tmp = `${file}.tmp-${process.pid}`;
176
+ fs.writeFileSync(tmp, text, "utf8");
177
+ try {
178
+ fs.renameSync(tmp, file);
179
+ }
180
+ catch (e) {
181
+ try {
182
+ fs.rmSync(tmp, { force: true });
183
+ }
184
+ catch {
185
+ /* nothing to clean */
186
+ }
187
+ throw e;
188
+ }
189
+ }
190
+ export function buildBoardWriteTool(deps) {
191
+ const tool = "tm_board_write";
192
+ const { pipelines } = deps;
193
+ const traj = (e) => pipelines.store.appendTrajectory({ tool, ...e });
194
+ const maxChars = Math.max(1000, Number(deps.cfg?.boardMaxChars) || BOARD_MAX_CONTENT_CHARS);
195
+ const maxFiles = Math.max(4, Number(deps.cfg?.boardMaxFiles) || BOARD_MAX_FILES_PER_SESSION);
196
+ const root = path.resolve(deps.boardRoot);
197
+ const execute = async (rawArgs, ctx) => {
198
+ const args = rawArgs ?? {};
199
+ const content = String(args.content ?? args.text ?? "");
200
+ if (!content.trim()) {
201
+ return toToolResult(tmError(tool, "args", "缺少 content——黑板文件放的是交付物本身,不是路径"));
202
+ }
203
+ if (content.length > maxChars) {
204
+ return toToolResult(tmError(tool, "args", `content ${content.length} 字符超过上限 ${maxChars}(TM_BOARD_MAX_CHARS)。拆成多个 topic 各写一个文件,别把一份超长文档塞进一次交付——超限的部分不会写盘。`));
205
+ }
206
+ // The role comes from the host's ctx, never from the model: a child that
207
+ // called itself "implementer" would otherwise file its report under another
208
+ // role's name and the lead would trust the wrong author.
209
+ const role = String(ctx?.agent ?? "").trim() || "agent";
210
+ const session = sanitizeSlug(args.session, 40) || (deps.stamp ? deps.stamp() : sessionKeyStamp());
211
+ const planned = planBoardWrite({
212
+ root,
213
+ session,
214
+ task: String(args.task ?? ""),
215
+ role,
216
+ topic: String(args.topic ?? ""),
217
+ list: (dir) => {
218
+ try {
219
+ return fs.readdirSync(dir);
220
+ }
221
+ catch {
222
+ return [];
223
+ }
224
+ },
225
+ });
226
+ if ("error" in planned)
227
+ return toToolResult(tmError(tool, "args", planned.error));
228
+ const usage = sessionUsage(root, sanitizeSlug(session, 40));
229
+ if (usage.tasks >= BOARD_MAX_TASKS_PER_SESSION || usage.files >= maxFiles) {
230
+ return toToolResult(tmError(tool, "permission", `会话目录 ${session} 已有 ${usage.files} 个文件 / ${usage.tasks} 个任务目录(上限 ${maxFiles} / ${BOARD_MAX_TASKS_PER_SESSION}),本次不写盘。` +
231
+ `黑板只由 TTL 清扫回收(默认 5 天)——请复用已有 task 目录、把交付合并进一份,或在插件选项 ttlDays 里缩短保留期。`));
232
+ }
233
+ try {
234
+ fs.mkdirSync(planned.dir, { recursive: true });
235
+ // A symlink created INSIDE the task dir between the plan and the write is
236
+ // still a way out, so re-check the parent's realpath before any bytes move.
237
+ const real = fs.realpathSync(planned.dir);
238
+ if (real !== planned.dir && !real.startsWith(root + path.sep)) {
239
+ traj({ step_id: "board", event: "refused", reason: "symlink_escape", target: planned.rel });
240
+ return toToolResult(tmError(tool, "permission", "目标目录经符号链接指向黑板之外,拒绝写入"));
241
+ }
242
+ const file = path.join(real, planned.file);
243
+ if (fs.existsSync(file)) {
244
+ // Chosen as unused a moment ago; another writer in the same round got
245
+ // there first. Say so rather than overwriting their deliverable.
246
+ traj({ step_id: "board", event: "refused", reason: "exists", target: planned.rel });
247
+ return toToolResult(tmError(tool, "args", `${planned.rel} 已经存在(同一轮的并发写入)。换一个 topic 名字,或把 round 交给我自动加后缀。`));
248
+ }
249
+ const header = `<!-- tm_board_write · ${new Date().toISOString()} · role=${role} · session=${session} -->\n`;
250
+ const bytes = Buffer.byteLength(header + content, "utf8");
251
+ writeNewFile(file, header + content);
252
+ traj({ step_id: "board", event: "board_write", session, task: path.basename(planned.dir), file: planned.file, bytes, round: planned.round });
253
+ return toToolResult(`已写入黑板:${file}\n(${bytes} 字节 · ${planned.round ? `修订轮次 ${planned.round}` : "首个版本"} · 作者角色 ${role}。` +
254
+ `正文没有回传——它已经在盘上,把上面这个绝对路径原样写进 CHANGES/HANDOFF,别复述内容。)`);
255
+ }
256
+ catch (e) {
257
+ const m = String(e?.message ?? e).slice(0, 200);
258
+ traj({ step_id: "board", event: "error", reason: m });
259
+ return toToolResult(tmError(tool, "execute", `黑板写入失败:${m}`));
260
+ }
261
+ };
262
+ return {
263
+ description: DESCRIPTION,
264
+ args: deps.args ?? FALLBACK_ARGS,
265
+ execute,
266
+ };
267
+ }
268
+ const DESCRIPTION = `Blackboard file writer — the deliverable channel for roles that own no file tools (architect and researcher carry no write/edit/bash, so a board write through the host tools is impossible for them by construction). Writes ONE new markdown file at <board-root>/<session-key>/<task-slug>/NN-<role>-<topic>[-rN].md, where NN and -rN are chosen by this tool (never overwritten: a revision is a new round file, so the board keeps its audit trail). Args: task (slug), topic (slug), content, and optionally session — pass the folder the lead already created so every role in this conversation writes into the SAME folder; omit it and the tool stamps yyyyMMdd-HHmmss for you. The role in the filename comes from the host's ctx, not from what you claim. Scope is enforced, not polite: segments are sanitized, the target's realpath must stay under the board root (a symlinked task dir pointing outside is refused), the name always ends in .md so no .env/rc file can be produced, and content is capped by TM_BOARD_MAX_CHARS with a per-session file cap. The reply is the absolute path plus the byte count and NEVER the content — pasting the deliverable back is the exact thing this channel exists to prevent, so after a successful write the report carries skeleton + path, not the document.`;
269
+ const FALLBACK_ARGS = {
270
+ task: { descriptor: "task: task-slug folder (the one the dispatch named)" },
271
+ topic: { descriptor: "topic: file topic, becomes the name after NN-<role>-" },
272
+ content: { descriptor: "content: the deliverable text itself" },
273
+ session: { descriptor: "session: existing session-key folder from the lead's dispatch (omit to stamp a new one)" },
274
+ };
275
+ //# sourceMappingURL=board.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"board.js","sourceRoot":"","sources":["../../src/tm/board.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,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