@thincoder/core 0.11.1 → 0.11.3

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 (382) hide show
  1. package/CHANGELOG.md +64 -2
  2. package/advisor/compaction.mjs +7 -5
  3. package/advisor/convergence.mjs +34 -3
  4. package/advisor/history.mjs +24 -11
  5. package/advisor/loop.mjs +49 -12
  6. package/advisor/messages.mjs +114 -33
  7. package/advisor/project-context.mjs +171 -42
  8. package/advisor/run.mjs +24 -10
  9. package/advisor.mjs +36 -46
  10. package/agent/batch-attribution.mjs +87 -0
  11. package/agent/batch-changed-surface.mjs +129 -0
  12. package/agent/chat-call.mjs +14 -9
  13. package/agent/completion.mjs +70 -41
  14. package/agent/continue-decision.mjs +14 -8
  15. package/agent/digest-account.mjs +133 -59
  16. package/agent/dispatch-gates.mjs +6 -0
  17. package/agent/dispatch-run.mjs +1 -1
  18. package/agent/dispatch.mjs +10 -4
  19. package/agent/family-tools.mjs +37 -23
  20. package/agent/helpers.mjs +139 -73
  21. package/agent/image-heal.mjs +18 -4
  22. package/agent/offload.mjs +25 -29
  23. package/agent/post-turn.mjs +36 -35
  24. package/agent/record-results.mjs +39 -7
  25. package/agent/run-stages.mjs +132 -52
  26. package/agent/run-start.mjs +150 -78
  27. package/agent/setup-reminders.mjs +194 -91
  28. package/agent/setup.mjs +219 -140
  29. package/agent/spawn-child.mjs +40 -3
  30. package/agent/suspension.mjs +43 -15
  31. package/agent/timers.mjs +9 -4
  32. package/agent/turn-domain-text.mjs +105 -0
  33. package/agent/turn-loop.mjs +84 -27
  34. package/agent/turn-projection.mjs +286 -0
  35. package/agent/turn-task-state.mjs +274 -0
  36. package/agent/turn-tool-process.mjs +163 -0
  37. package/agent/write-gate-ledger.mjs +569 -0
  38. package/agent/write-gate.mjs +29 -352
  39. package/agent-tools/advisor-async.mjs +35 -172
  40. package/agent-tools/advisor-launch.mjs +178 -0
  41. package/agent-tools/advisor-settle.mjs +28 -1
  42. package/agent-tools/advisor.mjs +37 -48
  43. package/agent-tools/async-discard.mjs +7 -2
  44. package/agent-tools/async-settle.mjs +18 -12
  45. package/agent-tools/audit-block.mjs +6 -6
  46. package/agent-tools/bash-async.mjs +5 -2
  47. package/agent-tools/batch-closeout.mjs +223 -35
  48. package/agent-tools/batch-gate.mjs +142 -342
  49. package/agent-tools/batch-ledger-bind.mjs +240 -20
  50. package/agent-tools/batch-ledger-view.mjs +109 -0
  51. package/agent-tools/batch-lifecycle.mjs +197 -48
  52. package/agent-tools/batch-paths.mjs +29 -8
  53. package/agent-tools/batch-read.mjs +151 -4
  54. package/agent-tools/batch-record-write.mjs +417 -0
  55. package/agent-tools/batch-regions.mjs +215 -0
  56. package/agent-tools/batch-reopen.mjs +23 -11
  57. package/agent-tools/batch-segment-vocab.mjs +459 -0
  58. package/agent-tools/batch-skeleton.mjs +196 -239
  59. package/agent-tools/batch-supersede.mjs +232 -0
  60. package/agent-tools/batch-tier-gate.mjs +214 -0
  61. package/agent-tools/batch.mjs +192 -439
  62. package/agent-tools/browser-async.mjs +5 -2
  63. package/agent-tools/consult.mjs +17 -11
  64. package/agent-tools/context.mjs +76 -33
  65. package/agent-tools/design-review-record.mjs +225 -0
  66. package/agent-tools/design-slots.mjs +1 -1
  67. package/agent-tools/design-token.mjs +279 -81
  68. package/agent-tools/digest-budget.mjs +10 -9
  69. package/agent-tools/doc-check.mjs +43 -33
  70. package/agent-tools/doc-graph.mjs +140 -0
  71. package/agent-tools/eng.mjs +12 -12
  72. package/agent-tools/escalate-async.mjs +5 -5
  73. package/agent-tools/goal.mjs +5 -2
  74. package/agent-tools/judge-domain.mjs +347 -0
  75. package/agent-tools/manifest.mjs +34 -18
  76. package/agent-tools/parent-channel.mjs +6 -3
  77. package/agent-tools/plan.mjs +11 -10
  78. package/agent-tools/read-history.mjs +112 -11
  79. package/agent-tools/review-facts.mjs +19 -6
  80. package/agent-tools/settings.mjs +23 -2
  81. package/agent-tools/skill.mjs +7 -8
  82. package/agent-tools/spawn-gates.mjs +14 -24
  83. package/agent-tools/ssh-session.mjs +8 -5
  84. package/agent-tools/ssh-text.mjs +155 -0
  85. package/agent-tools/ssh-transfer.mjs +1 -1
  86. package/agent-tools/ssh-transport.mjs +19 -148
  87. package/agent-tools/subagent-actions-query.mjs +10 -6
  88. package/agent-tools/subagent-actions.mjs +2 -2
  89. package/agent-tools/subagent-async.mjs +19 -17
  90. package/agent-tools/subagent-brief.mjs +76 -0
  91. package/agent-tools/subagent-design-token.mjs +168 -0
  92. package/agent-tools/subagent-run.mjs +1 -1
  93. package/agent-tools/subagent-scheduler.mjs +13 -13
  94. package/agent-tools/subagent-spawn.mjs +92 -112
  95. package/agent-tools/subagent.mjs +16 -28
  96. package/agent-tools/task.mjs +0 -8
  97. package/agent-tools/taskbook-block.mjs +94 -0
  98. package/agent-tools/timer.mjs +12 -8
  99. package/agent-tools/verify.mjs +13 -4
  100. package/agent-tools.mjs +7 -3
  101. package/agent.mjs +26 -7
  102. package/attachments.mjs +3 -3
  103. package/auto-think.mjs +5 -2
  104. package/browser/actions.mjs +9 -3
  105. package/browser/cdp.mjs +45 -17
  106. package/browser/launch.mjs +25 -43
  107. package/browser/pool.mjs +299 -0
  108. package/browser/queue.mjs +2 -0
  109. package/browser/session-state.mjs +450 -0
  110. package/browser/session.mjs +127 -151
  111. package/browser/snapshot.mjs +89 -0
  112. package/client-identity.mjs +1 -1
  113. package/compaction-work-state.mjs +230 -0
  114. package/compress-form.mjs +41 -6
  115. package/config-defaults.mjs +7 -3
  116. package/config-migrate.mjs +40 -0
  117. package/config-normalize.mjs +28 -2
  118. package/config-reload.mjs +59 -0
  119. package/config.mjs +110 -110
  120. package/context-degrade.mjs +93 -34
  121. package/context-echo.mjs +6 -15
  122. package/context-push.mjs +328 -31
  123. package/context.mjs +298 -170
  124. package/conventions.mjs +11 -9
  125. package/declaration.mjs +126 -22
  126. package/declared-repos.mjs +94 -0
  127. package/doc-check/doc-names.mjs +73 -0
  128. package/doc-check/doc-tokens.mjs +110 -0
  129. package/doc-check/existence.mjs +160 -0
  130. package/doc-check/index.mjs +309 -213
  131. package/doc-check/line-refs.mjs +27 -101
  132. package/doc-check/paragraph.mjs +218 -102
  133. package/doc-graph/anchors.mjs +474 -0
  134. package/doc-graph/doc-batch-face.mjs +59 -0
  135. package/doc-graph/doc-suffix.mjs +27 -0
  136. package/doc-graph/graph-tokens.mjs +160 -0
  137. package/doc-graph.mjs +778 -0
  138. package/escape.mjs +6 -5
  139. package/explore-distill.mjs +41 -8
  140. package/generate-title.mjs +10 -1
  141. package/i18n.mjs +1 -1
  142. package/instance-inbox-watch.mjs +272 -0
  143. package/instance-inbox.mjs +218 -0
  144. package/instance-registry.mjs +179 -0
  145. package/knowledge/README.md +3 -0
  146. package/knowledge/prompt-resources.md +10 -0
  147. package/ledger-close-proof.mjs +100 -49
  148. package/ledger-close.mjs +188 -0
  149. package/ledger-cmd.mjs +47 -91
  150. package/ledger-consistency.mjs +113 -0
  151. package/ledger-db.mjs +47 -15
  152. package/ledger-executors.mjs +1 -1
  153. package/ledger-tools.mjs +121 -62
  154. package/ledger-write-ops.mjs +162 -46
  155. package/ledger.mjs +1 -1
  156. package/manifest-discovery.mjs +3 -1
  157. package/manifest-schema.mjs +27 -5
  158. package/memory/docs.mjs +51 -15
  159. package/memory/file-list.mjs +6 -0
  160. package/memory/schema.mjs +2 -2
  161. package/model-specs.mjs +87 -21
  162. package/origin-guard.mjs +190 -0
  163. package/package.json +3 -1
  164. package/path-resolve.mjs +338 -57
  165. package/prompt-files.mjs +114 -2
  166. package/prompt-overlays.mjs +21 -11
  167. package/prompts/advisor-design.md +96 -36
  168. package/prompts/advisor-round1.md +48 -4
  169. package/prompts/advisor-round2.md +54 -10
  170. package/prompts/advisor-round3.md +53 -9
  171. package/prompts/common.md +99 -434
  172. package/prompts/consult-base.md +7 -4
  173. package/prompts/discipline-engineering.md +504 -295
  174. package/prompts/discipline-normal.md +106 -281
  175. package/prompts/knowledge/business-gates.md +30 -0
  176. package/prompts/knowledge/decision-quality.md +21 -0
  177. package/prompts/knowledge/doc-lookup.md +30 -0
  178. package/prompts/knowledge/document-writing.md +33 -0
  179. package/prompts/knowledge/documentation-evaluation.md +48 -0
  180. package/prompts/knowledge/evidence-discipline.md +38 -0
  181. package/prompts/knowledge/normal-coding-workflow.md +110 -0
  182. package/prompts/knowledge/normal-delivery-collaboration.md +124 -0
  183. package/prompts/knowledge/normal-work-management.md +60 -0
  184. package/prompts/knowledge/product-security.md +28 -0
  185. package/prompts/knowledge/project-records.md +73 -0
  186. package/prompts/knowledge/tool-advisor.md +29 -0
  187. package/prompts/knowledge/tool-apply-patch.md +17 -0
  188. package/prompts/knowledge/tool-bash.md +48 -0
  189. package/prompts/knowledge/tool-batch-eng-coder.md +19 -0
  190. package/prompts/knowledge/tool-batch-eng-designer.md +20 -0
  191. package/prompts/knowledge/tool-batch-review.md +18 -0
  192. package/prompts/knowledge/tool-batch.md +94 -0
  193. package/prompts/knowledge/tool-browser.md +68 -0
  194. package/prompts/knowledge/tool-code-search.md +4 -0
  195. package/prompts/knowledge/tool-consult-start.md +12 -0
  196. package/prompts/knowledge/tool-consult-stop.md +6 -0
  197. package/prompts/knowledge/tool-context.md +6 -0
  198. package/prompts/knowledge/tool-delete.md +21 -0
  199. package/prompts/knowledge/tool-doc-check.md +71 -0
  200. package/prompts/knowledge/tool-doc-graph-read.md +20 -0
  201. package/prompts/knowledge/tool-doc-graph.md +49 -0
  202. package/prompts/knowledge/tool-doc-search.md +6 -0
  203. package/prompts/knowledge/tool-edit.md +41 -0
  204. package/prompts/knowledge/tool-eng.md +2 -0
  205. package/prompts/knowledge/tool-execute.md +21 -0
  206. package/prompts/knowledge/tool-fetch.md +18 -0
  207. package/prompts/knowledge/tool-file-ops.md +21 -0
  208. package/prompts/knowledge/tool-get-current-time.md +7 -0
  209. package/prompts/knowledge/tool-git-read.md +21 -0
  210. package/prompts/knowledge/tool-git.md +29 -0
  211. package/prompts/knowledge/tool-glob.md +17 -0
  212. package/prompts/knowledge/tool-goal.md +8 -0
  213. package/prompts/knowledge/tool-grep.md +21 -0
  214. package/prompts/knowledge/tool-hashline-edit.md +16 -0
  215. package/prompts/knowledge/tool-insert-after.md +17 -0
  216. package/prompts/knowledge/tool-instance-list.md +6 -0
  217. package/prompts/knowledge/tool-instance-send.md +10 -0
  218. package/prompts/knowledge/tool-knowledge.md +18 -0
  219. package/prompts/knowledge/tool-ledger-read.md +28 -0
  220. package/prompts/knowledge/tool-ledger.md +46 -0
  221. package/prompts/knowledge/tool-lint.md +16 -0
  222. package/prompts/knowledge/tool-ls.md +15 -0
  223. package/prompts/knowledge/tool-lsp.md +11 -0
  224. package/prompts/knowledge/tool-main-history.md +2 -0
  225. package/prompts/knowledge/tool-manifest-read.md +14 -0
  226. package/prompts/knowledge/tool-manifest.md +34 -0
  227. package/prompts/knowledge/tool-memory-read.md +20 -0
  228. package/prompts/knowledge/tool-memory.md +19 -0
  229. package/prompts/knowledge/tool-notify-parent.md +12 -0
  230. package/prompts/knowledge/tool-operations.md +102 -0
  231. package/prompts/knowledge/tool-peer-instances.md +2 -0
  232. package/prompts/knowledge/tool-plan.md +5 -0
  233. package/prompts/knowledge/tool-process-read.md +13 -0
  234. package/prompts/knowledge/tool-process.md +15 -0
  235. package/prompts/knowledge/tool-question.md +16 -0
  236. package/prompts/knowledge/tool-read-history-batch.md +22 -0
  237. package/prompts/knowledge/tool-read-history.md +35 -0
  238. package/prompts/knowledge/tool-read-image.md +11 -0
  239. package/prompts/knowledge/tool-read.md +22 -0
  240. package/prompts/knowledge/tool-recent-changes.md +6 -0
  241. package/prompts/knowledge/tool-repo-outline.md +4 -0
  242. package/prompts/knowledge/tool-settings-read.md +12 -0
  243. package/prompts/knowledge/tool-settings.md +17 -0
  244. package/prompts/knowledge/tool-skill.md +6 -0
  245. package/prompts/knowledge/tool-ssh.md +74 -0
  246. package/prompts/knowledge/tool-subagent.md +57 -0
  247. package/prompts/knowledge/tool-task.md +14 -0
  248. package/prompts/knowledge/tool-team-ledger-read.md +11 -0
  249. package/prompts/knowledge/tool-team-ledger.md +15 -0
  250. package/prompts/knowledge/tool-timer.md +23 -0
  251. package/prompts/knowledge/tool-tree.md +16 -0
  252. package/prompts/knowledge/tool-verify.md +19 -0
  253. package/prompts/knowledge/tool-wait-for.md +25 -0
  254. package/prompts/knowledge/tool-websearch.md +19 -0
  255. package/prompts/knowledge/tool-write.md +12 -0
  256. package/prompts/knowledge/upstream-protocol.md +45 -0
  257. package/prompts/persona-coder.md +1 -3
  258. package/prompts/persona-eng-coder.md +24 -6
  259. package/prompts/persona-eng-designer.md +150 -171
  260. package/prompts/persona-engineering.md +531 -442
  261. package/prompts/persona-explore.md +1 -3
  262. package/prompts/persona-normal.md +17 -9
  263. package/prompts/persona-plan.md +5 -3
  264. package/prompts/persona-tester.md +0 -2
  265. package/prompts/subagent-base.md +2 -2
  266. package/provider/anthropic.mjs +10 -6
  267. package/provider/core.mjs +8 -5
  268. package/provider/errors.mjs +63 -4
  269. package/provider/google.mjs +29 -10
  270. package/provider/reasoning-echo.mjs +16 -0
  271. package/provider/responses.mjs +7 -3
  272. package/provider/sse.mjs +11 -6
  273. package/provider-flows.mjs +2 -2
  274. package/rules.mjs +11 -10
  275. package/session-index-build.mjs +1 -1
  276. package/session-index-pass.mjs +1 -1
  277. package/session-index-query.mjs +1 -1
  278. package/session-index.mjs +1 -1
  279. package/session-lifecycle.mjs +131 -42
  280. package/session-slot-write.mjs +38 -6
  281. package/session.mjs +30 -11
  282. package/shell-identity.mjs +129 -22
  283. package/skip-dirs.mjs +26 -2
  284. package/team-ledger.mjs +34 -30
  285. package/text-budget.mjs +1 -1
  286. package/think-off.mjs +27 -0
  287. package/token-ttl.mjs +74 -5
  288. package/token-window.mjs +371 -47
  289. package/tool-docs/advisor.md +2 -27
  290. package/tool-docs/apply_patch.md +1 -15
  291. package/tool-docs/bash.md +2 -43
  292. package/tool-docs/batch-eng-coder.md +3 -0
  293. package/tool-docs/batch-eng-designer.md +3 -0
  294. package/tool-docs/batch-review.md +3 -0
  295. package/tool-docs/batch.md +2 -84
  296. package/tool-docs/browser.md +2 -49
  297. package/tool-docs/code_search.md +2 -2
  298. package/tool-docs/consult_start.md +2 -8
  299. package/tool-docs/consult_stop.md +2 -4
  300. package/tool-docs/context.md +1 -5
  301. package/tool-docs/delete.md +2 -17
  302. package/tool-docs/doc_check.md +2 -107
  303. package/tool-docs/doc_graph-read.md +3 -0
  304. package/tool-docs/doc_graph.md +3 -0
  305. package/tool-docs/doc_search.md +2 -4
  306. package/tool-docs/edit.md +1 -38
  307. package/tool-docs/eng.md +3 -1
  308. package/tool-docs/execute.md +2 -18
  309. package/tool-docs/fetch.md +2 -14
  310. package/tool-docs/file_ops.md +2 -18
  311. package/tool-docs/get_current_time.md +1 -6
  312. package/tool-docs/git-read.md +3 -0
  313. package/tool-docs/git.md +2 -35
  314. package/tool-docs/glob.md +2 -10
  315. package/tool-docs/goal.md +1 -6
  316. package/tool-docs/grep.md +2 -18
  317. package/tool-docs/hashline_edit.md +2 -15
  318. package/tool-docs/insert_after.md +2 -16
  319. package/tool-docs/instance_list.md +3 -0
  320. package/tool-docs/instance_send.md +3 -0
  321. package/tool-docs/knowledge.md +3 -0
  322. package/tool-docs/ledger-read.md +3 -0
  323. package/tool-docs/ledger.md +3 -8
  324. package/tool-docs/lint.md +2 -10
  325. package/tool-docs/ls.md +2 -11
  326. package/tool-docs/lsp.md +2 -9
  327. package/tool-docs/main_history.md +3 -1
  328. package/tool-docs/manifest-read.md +2 -8
  329. package/tool-docs/manifest.md +2 -35
  330. package/tool-docs/memory-read.md +3 -0
  331. package/tool-docs/memory.md +2 -20
  332. package/tool-docs/notify_parent.md +2 -13
  333. package/tool-docs/peer_instances.md +3 -1
  334. package/tool-docs/plan.md +1 -5
  335. package/tool-docs/process-read.md +3 -0
  336. package/tool-docs/process.md +2 -13
  337. package/tool-docs/question.md +3 -17
  338. package/tool-docs/read.md +2 -19
  339. package/tool-docs/read_history-batch.md +3 -0
  340. package/tool-docs/read_history.md +2 -18
  341. package/tool-docs/read_image.md +2 -9
  342. package/tool-docs/recent_changes.md +2 -2
  343. package/tool-docs/repo_outline.md +2 -2
  344. package/tool-docs/settings-read.md +3 -0
  345. package/tool-docs/settings.md +1 -12
  346. package/tool-docs/skill.md +2 -6
  347. package/tool-docs/ssh.md +1 -62
  348. package/tool-docs/subagent.md +2 -100
  349. package/tool-docs/task.md +1 -7
  350. package/tool-docs/team_ledger-read.md +3 -0
  351. package/tool-docs/team_ledger.md +3 -9
  352. package/tool-docs/timer.md +2 -19
  353. package/tool-docs/tree.md +2 -13
  354. package/tool-docs/verify.md +2 -12
  355. package/tool-docs/wait_for.md +2 -32
  356. package/tool-docs/websearch.md +2 -19
  357. package/tool-docs/write.md +2 -12
  358. package/tools/browser.mjs +54 -9
  359. package/tools/doc-write-gate.mjs +73 -0
  360. package/tools/edit-batch.mjs +170 -92
  361. package/tools/edit-diff.mjs +78 -62
  362. package/tools/edit-receipt.mjs +39 -0
  363. package/tools/execute.mjs +3 -3
  364. package/tools/file.mjs +28 -14
  365. package/tools/git.mjs +36 -21
  366. package/tools/index.mjs +6 -0
  367. package/tools/knowledge.mjs +143 -0
  368. package/tools/linter.mjs +3 -3
  369. package/tools/ops.mjs +5 -3
  370. package/tools/patch.mjs +124 -44
  371. package/tools/process-doc-mark.mjs +33 -4
  372. package/tools/repomap.mjs +25 -3
  373. package/tools/search.mjs +74 -26
  374. package/tools/shared.mjs +29 -27
  375. package/tools/ssh.mjs +5 -5
  376. package/tools/tree.mjs +32 -10
  377. package/tools/web-deepseek.mjs +1 -1
  378. package/tools/web.mjs +2 -2
  379. package/tools/write-gate-params.mjs +31 -0
  380. package/tools/write-path.mjs +16 -4
  381. package/window-policy.mjs +243 -0
  382. package/doc-check/anchors.mjs +0 -235
@@ -0,0 +1,16 @@
1
+ aliases: 提问, 询问用户
2
+ Use when the task is ambiguous, you need a design decision, or you are stuck and need human judgment.
3
+
4
+ Parameters:
5
+ - `question` (required): the question to ask the user.
6
+ - `options`: an array of single-choice options for the user to pick from (optional). They MUST be plain strings, e.g. `["A", "B", "C"]` - never objects.
7
+
8
+ Notes:
9
+ - The agent loop pauses until the user answers, and their reply arrives as the next user message: the chosen option or free text. The loop resumes when it arrives.
10
+ - Use it sparingly - prefer making a reasonable decision when one exists.
11
+ - Ask ONE question per call - never bundle several sub-questions into one question string; ask the next one after the answer arrives.
12
+ - Keep the question text short, one or two sentences. Background, context and analysis belong in your normal reply text, NOT in the question.
13
+ - Routine confirmations (confirm gates) belong in your plain reply text, where the user answers in their next message. Use this tool ONLY when you need the user's decision or input to proceed.
14
+ - Ask here when no default can carry the work forward (new scope, a ruling on a criterion) - this call blocks. When a reasonable default exists, ask in your ordinary reply text and keep working; a reply that arrives while you work steers the work from there.
15
+ Read the materials first and carry the evidence you already checked (the file path plus the exact words you read) - the user should not have to re-read for you.
16
+ - After an answer about a design convention, a tool preference or a recurring pattern, save it with the `memory` tool (action: put) - the user should not have to repeat the same preference in a later session.
@@ -0,0 +1,22 @@
1
+ aliases: 历史, 批次窗口, 会话历史
2
+ The window is fixed by the batch, not by you.
3
+
4
+ This face cannot leave the batch: there is no `path`, no other session, no older batch.
5
+
6
+ Use it to answer "what did the parent decide before dispatching me, and what did it already rule out" — the part of the task that the task book did not carry.
7
+
8
+ When the answer is not in the window, say so in your report instead of guessing; the parent can carry the fact next round.
9
+
10
+ It starts where the batch record was created (or where its first spawn bound it), and ends at the next batch's start — or now, if this is the latest batch.
11
+
12
+ Messages with no timestamp never fall inside a window, so a fact that must not be missed belongs in the task book's `knownFacts`, not here.
13
+
14
+ Filters combine with AND, and every one of them narrows inside that window:
15
+
16
+ - `role` — user / assistant / tool.
17
+ - `keyword` — case-insensitive substring of the message text.
18
+ - `tool` — tool messages by name, plus assistant messages that declared the call.
19
+ - `since` / `until` — epoch ms, inclusive. The batch window still applies on top: the later start and the earlier end win.
20
+ - `direction` — take the limit window from the oldest or newest end of the matched set.
21
+
22
+ `limit` is REQUIRED and carries no default — say how many messages you need (1–50). The window is the caller's decision; nothing supplies it for you.
@@ -0,0 +1,35 @@
1
+ aliases: 历史, 会话历史, 回看
2
+ Recall what was said or done earlier: design decisions, tool-call timing, past rulings.
3
+
4
+ Default (no `path`): this session's full record — never compacted, audit-complete.
5
+
6
+ Sub-agent face: eng-coder / eng-designer children get a bounded form instead — the parent session only, limited to this batch's window (its creation, or where its first spawn bound it, up to the next batch's start), `limit` required and capped at 50, and no `path`.
7
+
8
+ Everything else (explore / plan / coder / tester / consult) carries no history tool: the facts it needs ride the task book's `knownFacts`.
9
+
10
+ Filters combine with AND (`role` / `keyword` / `tool` / `since`-`until` / `limit` / `direction` — semantics per parameter; `keyword` with `path="all"` matches words and phrases, not only an exact substring).
11
+
12
+ Returns a JSON array in chronological order:
13
+
14
+ ```text
15
+ [{ts, role, name?, tool_call_id?, content (≈500 chars, truncated marker), tool_calls ([{name, arguments}] - arguments capped at 300 chars)}]
16
+ ```
17
+
18
+ Messages without `ts` return `ts: null`. `content` is truncated to ≈500 chars, and the marker states what is actually retrievable — `user` / `assistant` bodies: the full text is in the session file; `tool` results: the session file keeps only those first 500 chars, so re-run the tool for more.
19
+
20
+ Cross-session (`path`, optional): a session file path deep-queries THAT session with the same filters (a relative path resolves against the project cwd). A session too large to deep-query is refused as `session too large`.
21
+
22
+ `cwd:<dir>` lists that directory's session slots (slot + file path + title + count + updatedAt; copy one into `path` to deep-query it).
23
+
24
+ `all` searches every INDEXED session (cross-project; rows carry `session.file`). A session never indexed yet is invisible — query it with `path=<file>`, or index first with `thincoder session index --rebuild`.
25
+
26
+ Which tool for which question:
27
+ - what was said or ruled in THIS session → `read_history` (default).
28
+ - an older conversation in another session or project → `read_history` with `path` / `cwd`.
29
+ - which files changed in this run → `recent_changes`.
30
+ - stored knowledge and conventions (cross-session) → `memory search`.
31
+ - project design documents → `doc_search`.
32
+ - the code as implemented → `code_search`.
33
+ - a git snapshot → `checkpoint cat` / `versions`.
34
+
35
+ `read_history` reads session messages only; file-level changes belong to `recent_changes`, knowledge and conventions to `memory` — none substitutes for another.
@@ -0,0 +1,11 @@
1
+ aliases: 图片, 看图, 截图
2
+ Use this for screenshots, UI mockups, diagrams, or any visual content: the model only sees images through this tool, never by reading a file.
3
+
4
+ Parameters:
5
+ - path (required): Path to image file (relative to cwd or absolute).
6
+
7
+ Notes:
8
+ - Raster formats only: png, jpg, gif, webp. A file over 15MB is rejected.
9
+ - svg is returned as text source instead, which works even with a text-only model.
10
+ - bmp is rejected: convert it to PNG first.
11
+ - Requires a model that accepts image input. Any other model gets an error; svg is the only exception.
@@ -0,0 +1,22 @@
1
+ aliases: 读文档, 读文件, 查看文件
2
+ Use `offset` / `limit` to page through a large file.
3
+
4
+ **Route to read instead of bash:** `cat file` / `type file` / `node -e "fs.readFileSync(...)"` → read. Reading a file is a read - never shell out for it.
5
+
6
+ **Routing:**
7
+ - Don't know which file? → `repo_outline` / `code_search` / `glob` first.
8
+ - Know the symbol but not the location? → `code_search` or `lsp definition`.
9
+ - Know the file but not the lines? → `grep` to find line numbers, then read that range with `offset` / `limit`.
10
+ - Reading an image? → `read_image` instead.
11
+
12
+ Parameters:
13
+ - `path` (required): file path, relative to cwd or absolute (alias: `filePath`).
14
+ - `offset`: 1-based line number to start reading from.
15
+ - `limit`: max lines to return (default 2000). A window over a file longer than that returns the head, a `…(truncated: K lines in middle, use offset to continue)` marker, and the file's real tail lines - the file end is never hidden.
16
+ - `hashes`: include a content hash per line (`hashes: true`), for `hashline_edit`. Set it on the read you take before using `hashline_edit`.
17
+
18
+ Notes:
19
+ - Always prefer this over `cat` or shell-based reading - it caps output and avoids large dumps.
20
+ - Use `offset` for pagination when the file is large.
21
+ - The first output line is the document's layer label, e.g. `[design]`: it names the doc layer this file belongs to under the project's doc-root declaration, and reads `[unlayered]` when the file sits under none of the declared roots. Read it as "which kind of document this is", never as file content.
22
+ - When you plan to edit the file, take `hashes: true` in the same read: hash-based editing is immune to whitespace and encoding mismatches.
@@ -0,0 +1,6 @@
1
+ aliases: 最近改动, 改过哪些档
2
+ - Tracked tools: write / edit / insert_after / apply_patch / delete / hashline_edit.
3
+ - Use it when you need to remember which files you have already touched; during long multi-file tasks it is easy to lose track.
4
+ - Scoped to this run only, unlike `git status`, which shows all uncommitted changes.
5
+
6
+ For session-level history (what was said in a session), use read_history.
@@ -0,0 +1,4 @@
1
+ aliases: 项目结构, 依赖图, 大纲
2
+ Use when you need to understand the project structure, find where a function is defined, or see what files depend on a module.
3
+
4
+ Pass a path to focus on a single file's relationships. Find code by keyword or snippet with code_search.
@@ -0,0 +1,12 @@
1
+ aliases: 配置, 只读配置
2
+ Nothing here writes: no key is written or cleared.
3
+
4
+ Two actions: `list` (all keys and values, flattened) and `get <key>` — dot paths into config.json, at any nesting.
5
+
6
+ SENSITIVE keys are NEVER echoed in plaintext: list / get replies show `••••(masked)`.
7
+
8
+ A key counts as sensitive when a path segment looks like a credential (`apiKey`, `token`, `secret`, `password`, `authorization`, `cookie`, `credential` …), or when it sits under a `headers` / `env` segment.
9
+
10
+ Use it to answer "how is this session configured" with a reading instead of a guess — which provider and model, which limits, which switches are on.
11
+
12
+ Changing configuration belongs to the main agent. It is a side effect that persists to config.json and hot-applies to the live session, so it is not part of this tool face — calling it directly is refused before anything is written.
@@ -0,0 +1,17 @@
1
+ aliases: 配置, 设置, 改配置
2
+ Actions: `list` (all keys and values, flattened) | `get <key>` | `set <key> <value>` — dot paths into config.json, at any nesting.
3
+
4
+ `set` persists to disk (only the key you set is written; defaults are never baked in), takes effect in the running session at once — keys that apply at a turn boundary apply from the next turn — and the value survives restarts.
5
+
6
+ `list` / `get` are read-only (fine in planMode, no approval); `set` is a side effect behind the approval gate. The `/config` TUI command is the human equivalent.
7
+
8
+ Known keys are type-checked, so a value the app would silently drop is refused:
9
+ - scalar keys against their built-in default (`agent.maxTurns` a number, `traces.enabled` a boolean);
10
+ - `agent.mode` accepts exactly `tiny`, `normal` or `engineering`, sets the new-session default and leaves the current session alone; `agent.engineering` is a derived read-only view, not settable directly or through an agent object;
11
+ - keys whose default is null against their real consumption shape (`defaultModel` in `"provider:model"` form, `agent.subagentModel` / `shell` a non-empty string, `memory.team` an object carrying a repo).
12
+
13
+ `null` clears a key: the entry leaves config.json and the built-in default applies. String-typed keys refuse `null` — there is no "unset" state to fall back to. Unknown keys under a known section are stored as given.
14
+
15
+ SENSITIVE keys are NEVER echoed in plaintext: list / get / set replies show `••••(masked)`; setting one is allowed and stored.
16
+
17
+ A key counts as sensitive when a path segment looks like a credential (`apiKey`, `token`, `secret`, `password`, `authorization`, `cookie`, `credential` …), or when it sits under a `headers` / `env` segment.
@@ -0,0 +1,6 @@
1
+ aliases: 技能, 能力
2
+ Skills contain reusable instructions, workflows, or reference material.
3
+ Use this when the user references a skill by name, or when a task matches a known skill's description.
4
+
5
+ Call with action='list' to see available skills; call with action='load' and name=<skill> to activate one.
6
+ Returns the skill list ('list'), the load confirmation ('load' — instructions arrive in the next message), or Error: ... with the available skills.
@@ -0,0 +1,74 @@
1
+ aliases: 远程, 网络设备, 登录
2
+ A session survives across tool calls. Password hosts get a credential window, or reuse a saved credential silently — the value never appears in tool args or results.
3
+
4
+ **Route to ssh instead of bash:**
5
+ - a one-shot non-interactive command over ssh on a key / ssh-agent host → `bash` with `ssh host <command>` (cheaper, no session); a password host takes the session's long wait instead
6
+ - an interactive shell that must survive several calls (network device CLI, interactive prompts) → ssh
7
+ - one file to or from a host you already have a session on → `put` / `get` (they reuse the session's host and credential chain, which `bash scp` cannot reach)
8
+ - a whole directory tree, a resumable transfer or a progress bar → not this tool (single file only)
9
+ - port forwarding (`ssh -L` / `-R`) → `bash`
10
+
11
+ **Long waits:**
12
+ - Two triggers: the wait is expected to run past 30 seconds, or two consecutive reads of the same observation show no change.
13
+ Either one means change shape — never send the next identical read of that observation.
14
+ - Key or ssh-agent host (a connect that showed no credential window and reused no saved credential): run the wait as a `bash` background task (`async`).
15
+ It returns an ack at once and opens a round with the result when the process exits.
16
+ - Password host (a connect that showed the credential window, or one that reused a saved credential): keep the session and wait once — `send` with a large enough `timeoutMs`.
17
+ `timeoutMs` bounds that wait, so give the remote command a hard bound of its own that makes it return.
18
+ - Never run `bash ssh` against a password host: that shell has no terminal, the password prompt has nowhere to answer, and the process hangs.
19
+ - The auth face is known only after the first connect: reach an untouched host with the session `connect`, then split by auth face from its next wait on.
20
+
21
+ **Session reuse:**
22
+ - `list` before `connect`: reuse the live session for that host through its `ssh#N`, and `connect` only when `list` shows no session for the host.
23
+ - Never keep a second session on a host that already has one.
24
+ - `close` when the task ends; do not leave it to the idle sweep.
25
+ - When the session id is lost, take it back from `list` instead of reconnecting.
26
+ - A `connect` refused because the pool is full names every live session: `close` one of those and continue.
27
+ A retry meets the same refusal and frees nothing.
28
+ - When a long wait outlives the round, end the round with user-facing text that says what you are waiting for and what wakes you.
29
+ A long wait is no exception to that close.
30
+ - A subagent has neither this tool nor the background channel: hand the long wait up to the parent instead of polling in its own layer.
31
+
32
+ Parameters:
33
+ - action (required): connect | send | read | secret_input | close | list | credentials | forget | put | get
34
+ - host: connect / forget — target host (IP or name)
35
+ - user: connect — login user (optional: your local ssh config decides, else the user recorded for this host locally)
36
+ - port: connect / forget — TCP port (optional, default 22)
37
+ - label: connect — short human label for this session (optional); secret_input — label for the value being sent
38
+ - promptPattern: connect — regex marking the shell prompt as ready (optional). Give it when the device's prompt does not look like a shell prompt, or every command waits out the full timeout. Left out, a line ending in `#` `>` `$` `%` counts as the prompt.
39
+ - identityFile: connect — private-key path to offer as `-i` (`~` expands); remembered for this host and reused when omitted (optional)
40
+ - id: send / read / secret_input / close / put / get — session id from connect (`ssh#N`)
41
+ - data: send — text to type into the session (a trailing newline is passed as-is; otherwise Enter is sent as `\r`)
42
+ - settle: send — wait for the ready verdict before returning (default true); false returns right after the bytes are written
43
+ - timeoutMs: send / read — wait budget override (default 60000; the wait ends as soon as the device waits for input — a prompt, `--More--`, a y/n or password prompt); put / get — transfer budget override (default 600000; on expiry the process tree is killed)
44
+ - maxChars: read — return-window override (default 8000): head 60% + a note + tail 40%, and the omitted middle stays in the session for the next read
45
+ - localPath: put / get — local file path (`~` expands; a file, never a directory)
46
+ - remotePath: put / get — path of that file on the session host (e.g. `/flash/img.bin`)
47
+ - overwrite: get — replace an existing local file (default false: an existing target is refused, never overwritten silently). put follows scp's own semantics: a same-named remote file is replaced
48
+ - protocol: put / get — `scp` (classic SCP protocol, the default, what network devices speak) | `sftp` (for hosts that only offer that). No automatic fallback between them
49
+ - ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`. `ledger` is needed on `get` only — `get` writes into the project, `put` writes the remote host.
50
+
51
+ Output:
52
+ - connect / send / read / secret_input / close / list / put / get start with the session status line: `[ssh (ssh#3) 10.0.0.5 — ready · idle 3s]`
53
+ - connect returns the first screen; send returns the round's output plus the ready verdict (answer prompt such as `--More--` | prompt matched | timeout); read returns what arrived since the last read
54
+ - put / get return the status line, then exactly one more line — `put <localPath> → <remotePath> · N bytes · exit 0` (mirrored for get). The file's content never enters context: the bytes travel over the disk only, never through a result, a log or a message. On failure you get an `Error:` line plus the tail of scp's stderr — its last 600 characters, absent when stderr is empty, and escaped for markup after the cut, so the tail you read can run past 600 characters. The exit code is named only when the failure matches no known class — an auth failure or another recognised class reports that class's message instead.
55
+
56
+ Notes:
57
+ - Key-first: keys, your ssh config and ssh-agent are always tried before any saved credential, so a connect succeeds without a window when a key works. To make a password host prompt-free, install a key once: `ssh-keygen -t ed25519` (if you have none), then `ssh-copy-id user@host`, then reconnect.
58
+ - Credential discipline: the password is asked for in a window and reaches ssh only through its child-process environment — never echoed in a result, never stored in plaintext. Any captured output containing that value (or a value given to secret_input) is scrubbed from the returned text and the session log.
59
+ - Saving a credential is opt-in and belongs to `connect`: the window carries a `save` checkbox (off by default). When checked and authentication succeeds, the password is stored encrypted under your OS user account in a per-user file outside the repository and reused silently — the next connect skips the window, and only after key authentication fails. Another process running as the same logged-in user could decrypt it. Saving is Windows-only for now; elsewhere the checkbox does not appear.
60
+ - Fail-soft: an unreadable or undecryptable entry, a damaged store or a missing backend falls back to the credential window (the connection is not broken, and undecryptable entries are kept). If the server rejects a saved credential it is deleted and the window is shown. A failed save never affects the connection.
61
+ - secret_input is for device prompts (enable password, sudo, key passphrases): it opens the same kind of window, writes the value plus Enter, and returns only the output — the value is never shown.
62
+ - Sessions: at most 4 live at once (a connect beyond the cap is refused — close one first). A session idle for 600s with no send/read closes automatically. `close` ends it. Ctrl+I (interrupt) does not kill sessions; a user Stop does.
63
+ - Output is a cleaned text stream: terminal escape sequences and CRLF noise are stripped. Each return is a window (8000 chars: head + a note + tail); the omitted middle stays in the session, so another read collects it and a large configuration comes back in full.
64
+ - Not for full-screen terminal UIs (vim/top/screen): output is read as a text stream — paged output such as `--More--` is shown as-is, not driven for you.
65
+ - Transfers are binary safe and single-file: no recursive directory sync, no resume, no progress bar, and the parameters take files only (a directory is not a valid `localPath` / `remotePath`).
66
+ - `get` never overwrites silently and never creates directories: an existing local file is refused unless you pass `overwrite:true`, and the local parent directory must already exist.
67
+ - `put` on a password host runs the same credential decision as connect: keys first, then the saved credential (no window), then the credential window. That window asks for user / password only and carries no save checkbox; a session built by typing a password without saving keeps no password, so the next transfer asks again.
68
+ - A transfer killed at `timeoutMs`: a `get` removes the partial local file only when that transfer wrote it (an existing file scp never touched is kept, and the receipt says so); after a `put` the remote host may keep a partial file — resend the whole file with `overwrite:true`, or delete it on the host.
69
+ - Ready means the device waits for you, not that output stopped: a prompt or an answer prompt (`--More--`, y/n, password) ends the wait, and a slow operation that goes quiet keeps waiting instead of returning half its output.
70
+ - Host keys follow your local ssh config — the tool never rewrites known_hosts. A changed or untrusted key stops the connect with a readable error before any credential is asked for.
71
+ - read / list / credentials are read-only (no approval prompt); connect / send / secret_input / close / forget / put / get pass the approval gate like any side-effecting tool, and secret_input shows a masked placeholder — the value itself is never in the approval text. A transfer's approval text names both ends (`localPath` → `remotePath`), never the file's content.
72
+ - credentials lists saved entries (host / user / saved / last used — never a value); forget deletes the entry for a host (and optional port) and is idempotent — the next connect asks in the window again.
73
+
74
+ Availability: where the end has no UI to collect a credential (headless / ACP), connecting to a password host fails with a readable error — use keys or an ssh-agent there.
@@ -0,0 +1,57 @@
1
+ aliases: 子代理, 派单, 派活
2
+ ONE tool, NINE actions — pick by what you need:
3
+
4
+ - `spawn` (default): run a sub-agent in its own isolated context — only the final report reaches your history. Spawn several in the SAME response; they run concurrently.
5
+ - `status`: non-blocking progress query; returns immediately and consumes nothing. With a spawn id: role, state (running | queued | done), model, elapsed, turn, position, touched files (first 5 plus a count). Without: the pool overview. Background advisor reviews share this surface — pass the review id; an id that belongs to no live spawn, review or settled row is refused with it named.
6
+ - `observe`: what a running async child is doing now — state, turn, the tools executing, and the last `recent` (required, 1..20) one-line summaries, newest first. Read-only; queued returns a placeholder, done gives the activity summary, not the report.
7
+ - `send`: steer a running async child — id + message, consumed at its next turn boundary as an ordinary user instruction (non-interrupting guidance, not a deviation waiver). Returns {id, status:'delivered', queued}. Sync / queued / settled / unknown error clearly; a child that settles first carries an 'undelivered' note.
8
+ - `escalate`: hand an implementation task to a STRONGER model from your consult models; it gets write access, does the work, then returns a post-op report (what changed, why, verification). Not available in engineering mode. Omission still means the async flight and `false` asks for the blocking one; at depth 0 pass `async: true` — ack `{id, role:'escalate', status:'running'}` returns immediately and the report arrives automatically.
9
+ - `cancel`: stop ONE background child — the spawn id is required. Running aborts (`{id, status:'cancelled'}`); queued is removed (`{id, status:'cancelled', was:'queued'}`) and later positions shift. Last resort: in-flight work dies and partial changes stay unmerged and unaudited. Advisor reviews cancel the same way.
10
+ - `consume-design` (engineering mode, parent side): chain-terminal token consumption. Pass exactly ONE selector — designId / designIds / expired:true / olderThanDays:N. A consumed slot rejects further spawns for that designId, deviation fixes included: new work needs a fresh review and token. Idempotent (unknown or already consumed = a no-op notice); batch calls report per-slot lines plus a `consumed N` count line. Do not call while the chain is open — fix rounds reuse the same slot.
11
+ - `design-slots` (engineering mode, parent side): read-only inventory of this session's approved design tokens, oldest first — designId, live|expired, ageDays, expiresAt, batch, designToken — ending with a total/live/expired line. Malformed records show designToken=—. Copy designId + designToken verbatim onto the eng-coder spawn; the gate checks exact equality.
12
+ - `panel`: diagnose and fix the subagent panel (headless / VS Code degrade to a 'no panel' pool view). `view`: the live blocks (`running` | `queued` | `done` | `awaitingDigest`). `freeze`: pass a digested-stuck block key — passes only for awaitingDigest blocks with no live pool entry and no pending report.
13
+
14
+ Available roles (exposed per mode; `spawn` requires one — missing or misspelled is refused):
15
+ - explore — read-only search and analysis; git access read-only; no working-tree context injected, so evidence comes from reads and the task book. Its report must list what it searched and what it did NOT find. Say quick / medium / thorough (default medium).
16
+ - plan — read-only planning; never edits; returns a step-by-step plan.
17
+ - coder — full implementation: the parent's toolset minus the interactive main-session tools (`question` · `ssh`), plus verify and advisor self-review. Its report carries the requirement-point table, one row per requirement (Done / Simplified / Not done — no deferred column). Normal mode: an optional `batchDoc` binds this spawn's §5 write channel.
18
+ - eng-coder — engineering mode only (replaces coder): the same toolset plus the design-driven overlay, and the delivery protocol runs fully inside the child. REQUIRES a valid designToken from a passed `advisor(type='design')` review. Missing or mismatched is refused; expired is refused with expired named. Echo the designId in the delivery report. REQUIRES a batchDoc that resolves to a readable record with no spawn in flight.
19
+ - eng-designer — engineering mode only: the SOLE author of design documents and of the batch record's design section (requirement docs stay with the main agent). Writes no code, edits no prompts, fires no reviews, needs NO designToken. Surveys on its own; may only spawn read-only explore children (sync, ≤6 per batch). REQUIRES a batchDoc.
20
+ - tester — both modes: the readings seat. Runs the verification commands the task book puts in `goal` and hands the readings back as they stand — no verdict, no fix, no document. Tool face: read-only tools plus `execute` / `bash` (dependency installs, compiles and fixtures included), minus `verify`. Run only, never change is a role contract, not a sandbox — `bash` can write, so a tester that edits anything is a defect.
21
+
22
+ Task book, non-engineering roles (explore / plan / coder / tester): five required parameters — a missing, blank or non-string value is refused with it named. A free-text task is an optional supplement, never the whole brief.
23
+ - goal — the goal and why.
24
+ - knownFacts — the facts you already verified.
25
+ - acceptance — machine-verifiable criteria.
26
+ - reportFormat — the delivery-report format.
27
+ - scope — what to read, and what not to touch.
28
+
29
+ Engineering roles take their task book from the batch record; no other task text reaches either:
30
+ - batchDoc — the record path. An eng-coder's task book is that record's §2, written and owned by eng-designer; an eng-designer reads the whole record — §1's rulings bind it, §2 is its own pen.
31
+ - round — initial | fix.
32
+ - files / dependsOn — scheduling.
33
+ - An eng-coder spawn also carries designToken and, when several designs are open, designId.
34
+
35
+ A record carries one concurrent spawn: a second spawn on a record in flight is refused, naming the occupant. Sequential hand-offs (design → implementation → fix round) pass, because the previous spawn settled first.
36
+
37
+ Pass one parameter per field — contents only, the runtime adds the labels:
38
+ subagent(role="eng-coder", round="initial", batchDoc="<batch record>", designToken="…", files=[…], async=true)
39
+ subagent(role="explore", goal="…", knownFacts="…", scope="…", acceptance="…", reportFormat="…", async=true)
40
+
41
+ Mode filtering: normal mode exposes explore / plan / coder / tester; engineering mode exposes explore / eng-designer / eng-coder / tester. A role the mode does not expose is refused (plan is normal-mode only, coder is replaced by eng-coder, tester is dispatchable in both).
42
+
43
+ Async spawn:
44
+ - Pass `async: true` — the spawn returns {id, status:"running"} immediately and the report arrives automatically; if your next step needs it, end the turn and let the digest deliver it. Omitting `async` is refused.
45
+ - At depth>0 spawns are always synchronous: pass `async: false` (an explicit `async: true` is refused).
46
+
47
+ Pool: async spawns pool per role domain — 4 concurrent eng-coders plus 4 concurrent other-role spawns by default (agent.poolLimits overrides both). A full domain queues with a position while the other keeps starting.
48
+
49
+ Scheduling: declare `files` (the paths this task will modify) and `dependsOn` (ids from prior async returns whose outcome this task needs).
50
+ - Overlapping-file tasks serialize and dependents start in order: a conflicting or dependent spawn queues (position / reason) and auto-starts when the conflict clears or the dependency settles.
51
+ - A cancelled or failed dependency leaves it queued marked "dependency cancelled" until you decide. Unknown ids error; a consumed id counts as satisfied.
52
+ - Omit both for a plain immediate spawn.
53
+
54
+ The child starts with zero context, so brief it like a colleague who just walked in.
55
+ - Put exact paths and commands in — do not make it search for what you already know.
56
+ - Do not delegate understanding: resolve the paths and symbols the task hinges on first.
57
+ - Once it runs, leave that scope to it — do not redo its searches in parallel or finish manually midway.
@@ -0,0 +1,14 @@
1
+ aliases: 任务清单, 待办列表
2
+ Each call replaces the entire list.
3
+
4
+ Statuses: pending | in_progress | done - synonyms (completed/finished/complete, todo/open/waiting, active/running/working, …) are accepted and normalized with a warning.
5
+
6
+ - Keep exactly one item in_progress at a time.
7
+ - Mark items done as you complete them; never mark done while tests fail or the work is partial.
8
+ - title is required and must be non-empty: an item whose title is empty is dropped, and the receipt names it.
9
+
10
+ Modes: normal mode (tiny and normal) provides `task` as a lightweight progress checklist only - the batch record and the ledger stay the tracking authority.
11
+ Engineering mode does not provide `task` - the tool is not in that mode's tool table, so its description is not assembled into engineering contexts.
12
+ A pending item neither triggers a completion push-back nor extends the turn. For cross-session / project-level tracking in any mode, use `/ledger`.
13
+
14
+ Returns a one-line receipt - `Task list updated: N/M done` - plus a warning naming every status or title that was normalized or dropped.
@@ -0,0 +1,11 @@
1
+ aliases: 团队台账, 只读, 团队待办
2
+ It is a separate book from the local `ledger` — two independent accounts, no sync between them, and this one keeps no offline copy.
3
+
4
+ The actions this tool face carries: `query` (filtered entries) and `count` (how many). Both are read-only.
5
+
6
+ - The repo tag is derived for you from the current project root's git origin; with no git repo, or no `remote.origin.url`, the call fails explicitly and sends no request. You cannot pick or change the repo.
7
+ - `query`: `scope` = `"repo"` (default — the current repo) or `"team"` (every repo in the team); filters `status` (one of the six states `待讨论` / `待设计` / `在途` / `待核销` / `已核销` / `已废弃`) and `owner` (exact username). Each row carries `aged` when it sits in an unsettled state and is older than 30 days.
8
+ - `count`: the same filters as `query`, and returns the total.
9
+ - Login gate: not logged in ⇒ the call fails with a message saying so, and sends no request; 401 (token expired) ⇒ login expired, log in again; server unreachable ⇒ reported as such, with no offline fallback: a retry never serves an old value.
10
+
11
+ Use it to see what the rest of the team already has queued on this repo before proposing the same work again. Adding, moving or settling an entry belongs to the main agent — those actions are not part of this tool face, and calling one directly is refused before any request goes out.
@@ -0,0 +1,15 @@
1
+ aliases: 团队台账, 团队待办
2
+ It is a separate book from the local `ledger` - two independent accounts, no sync between them, and this one keeps no offline copy. `action` = query / count / add / update / close.
3
+
4
+ - `query` / `count` are read-only and open to every role; `add` / `update` / `close` write and reach the main agent only (a subagent gets the read-only two).
5
+ - The repo tag is derived for you from the current project root's git origin; with no git repo, or no `remote.origin.url`, the call fails explicitly and sends no request. You cannot pick or change the repo.
6
+ - `query`: `scope` = `"repo"` (default - the current repo) / `"team"` (every repo in the team); filters `status` (one of the six states `待讨论` / `待设计` / `在途` / `待核销` / `已核销` / `已废弃`) and `owner` (exact username). Each row carries `aged` when it sits in an unsettled state and is older than 30 days.
7
+ - `count`: the same filters as `query`, and returns the total.
8
+ - `add`: `title` required (non-blank, ≤200), `detail` (≤4000), `owner` (default = yourself). A new entry always lands in `待讨论`.
9
+ - `update`: `id` required; `title` / `detail` / `owner` / `status` are each optional, and an omitted one stays unchanged. The client checks nothing beyond `id` — an `update` that changes no field is still sent, and the server alone judges the result.
10
+ `status` is judged by the server, not by this client: the client sends the target state and an illegal edge comes back as a 400.
11
+ The local `ledger` tool's own table allows `待讨论→待设计` / `待讨论→在途` / `待设计→在途` / `在途→待核销` / `在途→待讨论` /
12
+ `待核销→已核销` / `待核销→在途` / `待核销→待讨论` / `待讨论→已废弃` / `待设计→已废弃` / `在途→已废弃` / `待核销→已废弃`,
13
+ and there `已核销` and `已废弃` are both final; this book's server table is not readable from here, so take that list as the client-side reference, not as a copy of the server's.
14
+ - `close`: `id` + `status` (`已核销` / `已废弃`). `已核销` settles, and only from `待核销` - from any other state it is refused, and the way out is to `update` that entry to `待核销` first. `已废弃` withdraws an entry from any non-archived state.
15
+ - Login gate: not logged in ⇒ the call fails with a message saying so, and sends no request; 401 (token expired) ⇒ login expired, log in again; server unreachable ⇒ reported as such, with no offline fallback: a retry never serves an old value.
@@ -0,0 +1,23 @@
1
+ aliases: 定时器, 提醒, 计时
2
+ Set it before you start analyzing code: when the timer fires, a system reminder is injected suggesting you run code or add debug logs — N seconds to reason, then the reminder to act.
3
+
4
+ Four schedule forms, one per call (`seconds`, `at`, `every` and `daily` are mutually exclusive - passing more than one is a validation error):
5
+
6
+ - `seconds` - a one-shot countdown, a finite positive number of seconds.
7
+ - `at` - a local clock time such as `"2026-10-13T09:00"`, firing once at that moment; a time already past fires immediately.
8
+ - `every` - a fixed interval in seconds (minimum 60): the first reminder comes N seconds after setting, then every N seconds, until cancelled.
9
+ - `daily` - a local `"HH:MM"`, repeating every day at that time until cancelled; a time already past today fires tomorrow.
10
+
11
+ All times are local to the host.
12
+
13
+ - `cancel` takes the id from the set confirmation and stops that timer; `list` shows every pending timer with its next due time.
14
+ - A repeating timer holds one pending slot for as long as it stands.
15
+ - A pending timer survives across runs. At most 8 may be pending at once, and further timer calls are rejected until some expire.
16
+
17
+ Returns the set confirmation; the reminder itself fires at the deadline.
18
+
19
+ Delivery: when the session is idle the reminder is delivered on the spot and starts a turn - on the CLI / VSC / desktop foregrounds, and in a suspension window.
20
+
21
+ Headless is structurally unsupported.
22
+
23
+ A running session turn gets no delivery: an expired timer waits for the next delivery round.
@@ -0,0 +1,16 @@
1
+ aliases: 目录树, 结构
2
+ Use it to see quickly which modules exist and where files live. Skips dotfiles, .git/node_modules/dist/build/obj and other build/vendor dirs, and binary files.
3
+
4
+ **Route to tree instead of bash:**
5
+ - `tree` / `find .` / `dir /s` → tree
6
+
7
+ Parameters:
8
+ - path: Root directory (default cwd)
9
+ - depth: Tree depth (default 3, max 6)
10
+ - includeProcessDocs: include docs from process layers (batch records, archived material) - excluded by default; pass `true` to get them back
11
+
12
+ Notes:
13
+ - Returns the tree as text: directories first (each ending with `/`), files after, both sorted, capped at 200 entries.
14
+ - Tree-drawing uses `├──`/`└──`/`│`.
15
+ - A file row carries its layer label after the name (`TOOLS.md [design]`); directory rows carry none and process-layer directories stay reachable. When file rows from process layers are excluded (or included on request), a final line reports how many; excluded rows spend none of the 200-entry cap.
16
+ - Use depth for a shallow overview; use `ls` for one directory, `glob` for a specific file pattern.
@@ -0,0 +1,19 @@
1
+ aliases: 交付前校验, 验证门
2
+ verify does NOT run any test or verification command for you, and does NOT require a test per change.
3
+
4
+ You DECLARE your verification status through the `verification` argument, `{ status: 'passed' | 'failed' | 'skipped', command?, summary?, basis? }` - the declaration is self-reported evidence.
5
+
6
+ The three outcomes and what each does to your completion:
7
+ - `passed` → allowed.
8
+ - `failed` → blocked.
9
+ - `skipped` → allowed, but needs a `summary` giving the reason.
10
+
11
+ `basis` (optional) is the "what it stands on" dimension of the declaration: a judgment source, the exact words you read at their path, or an explicit `unverified`. It is declaration-only - no format is enforced and nothing is machine-checked.
12
+
13
+ A `passed` / `skipped` declaration with no `basis` gets one advisory hint line in the report: never blocking, never changing the outcome. A `failed` declaration gets no basis hint - it is already blocked.
14
+
15
+ Whether and how to verify is described in natural language in the project's AGENTS.md, and is decided and executed by you.
16
+
17
+ The report also carries the changed files (git diff), an advisory `node --check` hint on changed .js / .mjs files (not gating), the task list, and a self-review checklist.
18
+
19
+ Call this BEFORE declaring a coding task complete - do not say "done" until verify passes.
@@ -0,0 +1,25 @@
1
+ aliases: 等待, 轮询, 等条件
2
+ Polls every interval_ms and returns as soon as the condition holds or timeout_ms passes.
3
+
4
+ **Use it only for states that cannot announce themselves**: a file appearing, a port opening, a background bash or browser task finishing. Nothing delivers those into the session, so a blocking wait is the only way to learn about them.
5
+
6
+ **Never wait for a subagent, a review report or a timer.** Those arrive on their own when the session is idle, so waiting costs the whole budget and learns nothing. Before calling it, ask: will this state announce itself to me anyway? If yes, end the turn.
7
+
8
+ Parameters:
9
+ - condition (required), one semantic expression:
10
+ - `advisor settled` — an in-flight advisor review finished. Discouraged: the report is delivered automatically, so end the turn instead.
11
+ - `subagent id:N done` — async subagent N (the id from the spawn ack) settled. Discouraged, same reason.
12
+ - `consult done` — every consult_start session drained. Wait only when a synchronous caller cannot proceed without the verdict.
13
+ - `bash id:N done` — background bash task N (id from the ack, `bash#N`) finished, or already left the pool.
14
+ - `browser id:N done` — background browser task N (id from the ack, `browser#N`) settled, or already left the pool.
15
+ - `file exists:path` — the file at path exists (relative to cwd).
16
+ - `port open:N` — something is listening on 127.0.0.1 port N.
17
+ - The agent-internal conditions (advisor / subagent / consult / bash) apply to ASYNC sessions only — a synchronous call already completed before it returned.
18
+ - An unknown condition is an explicit error (`wait_for: unsupported condition "..."`), never a silent wait.
19
+ - interval_ms: poll interval (default 1000, floor 100 — polling never busy-spins).
20
+ - timeout_ms: overall ceiling (default 30000; config.json `agent.waitForTimeoutMs` overrides it; hard cap 600000 like execute).
21
+
22
+ Returns:
23
+ - `wait_for: condition satisfied after Nms (N checks): "<condition>"` — condition held.
24
+ - `wait_for: timed out after Nms waiting for "<condition>" ...` — ceiling passed, condition still false; it never burns beyond the ceiling.
25
+ - Interrupts (Ctrl+C / cancel) exit immediately; malformed conditions and unsupported syntax error out explicitly.
@@ -0,0 +1,19 @@
1
+ aliases: 联网搜索, 网页搜索, 搜索
2
+ DeepSeek results also carry a `date · authority (0-4) · rerank (0-3)` line and a long summary.
3
+
4
+ Search goes to DeepSeek when a DeepSeek provider is configured, otherwise to Tavily when a key is set, otherwise to Bing - `websearch.backend: "local"` takes DeepSeek out of the chain.
5
+
6
+ Use it for information that is not in the local codebase: current docs, release status, error messages, API references.
7
+
8
+ Parameters:
9
+ - `query` (required): the search query. DeepSeek operators pass through as given - `site:`, `lang:`, `after:` / `before:`, and quoted phrases.
10
+ - `limit`: max results (default 8, max 20).
11
+ - `engine`: a specific engine - `"bing"`. Omit it to search all engines and merge their results.
12
+ - `page`: page number for pagination (1-based, default 1). Only used when `engine` is given.
13
+ - `proxy`: `http://host:port`, an explicit proxy - pass it only when you mean to use one; no `proxy` argument means a direct connection. A proxy configured in config.json is NOT applied here: Bing and foreign sites usually need one passed explicitly, domestic targets do not.
14
+
15
+ Notes:
16
+ - Before searching the web, call the `memory` tool (action: search) first - you may already know the answer from a previous session. Reach for websearch only when memory comes up empty.
17
+ - It runs synchronously: the call returns when the search finishes.
18
+ - Follow up with `fetch` to read a result page in full.
19
+ - **Weak engine warning**: Bing's index is noisy for technical queries. If a first websearch returns irrelevant, townhall-grade results, do NOT retry the same query - configure a search MCP tool (e.g. `glm-websearch` via the MCP config) and use it for technical lookups; websearch is the fallback.
@@ -0,0 +1,12 @@
1
+ aliases: 写文件, 新建文件
2
+ Parameters:
3
+ - path (required): File path (relative to cwd or absolute)
4
+ - content (required): Full content to write
5
+ - ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
6
+ - project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
7
+
8
+ Notes:
9
+ - write replaces the WHOLE file: read it first and confirm you intend to rewrite it entirely. For a targeted change use edit / insert_after instead.
10
+ - The content lands in one write with no temp file and no rename, so the two-phase stage-then-commit form is `apply_patch`'s, not this tool's.
11
+ The route is the host editor's own write when an editor is wired in, and an in-place `writeFile` otherwise; neither has a crash-safe swap behind it.
12
+ - Returns `Wrote N chars to <path>` + git diff + syntax-check note.
@@ -0,0 +1,45 @@
1
+ aliases: 上抛, 子代理, 父代理, 请示
2
+ ## Upstream channel — subagents and their parent
3
+
4
+ Use `notify_parent` for decision-grade questions to the parent.
5
+ The parent cannot approve actions and is not a confirmation gate.
6
+ Read the task book, design doc and repository code/docs before escalating.
7
+ Ask only when the answer changes your next step and those materials cannot supply it.
8
+ Otherwise decide and record the call in your report.
9
+ Include the checked file paths and exact words with every escalation.
10
+
11
+ Send an `ask` for these decision-grade cases:
12
+ - facts contradict a stated premise;
13
+ - two requirements conflict and you cannot arbitrate;
14
+ - you need to know whether an action is inside your task domain;
15
+ - a choice would waste work already done.
16
+ Treat two requirement, design or batch-record documents that describe one mechanism differently as a conflict.
17
+ Quote both sides, give your leaning and do not select one yourself.
18
+ Send a conflict `ask` immediately; further weighing does not resolve it.
19
+
20
+ Do not escalate naming, implementation, structure or wording details.
21
+ Do not escalate anything a read or command can answer, a trade-off already settled in the task book, or a request for reassurance.
22
+
23
+ Send the question without blocking.
24
+ Continue unaffected work while the affected part stays pending.
25
+ Do not idle-wait or poll for the reply.
26
+ If no reply arrives before you finish, skip the affected part and report it as not done.
27
+ Keep only one `ask` waiting per child; send another after the parent picks up the first.
28
+ `note` messages do not have that per-child limit.
29
+ The parent's queue has a configured ceiling and reports overflow explicitly.
30
+ Combine related questions into one `ask` when useful.
31
+ If unsure whether a question qualifies, state the conflict or gap and stop under the stop-and-report rule.
32
+
33
+ On the parent side, receive in-flight child messages as `[System reminder: ...]` user messages at an idle wake or suspension window.
34
+ User turns do not receive these messages.
35
+ Answer a decision-grade message with `subagent action:'send'`, including the id and message.
36
+ The running child consumes the answer at its next turn boundary without changing its other discipline.
37
+ `send` reaches only running async children.
38
+ For a synchronous child, including a nested spawn or `async:false`, dispatch a follow-up task instead.
39
+ That child follows the no-reply rule: continue unaffected work and report the pending part as not done.
40
+
41
+ Treat `[上抛·待裁]` as a question awaiting a decision and `[上抛·知会]` as an FYI.
42
+ Neither is a user ruling or an already-made decision.
43
+ Keep the marker when relaying or recording it.
44
+ When disposing of one, distinguish its source: literal user words, a user ruling, your own disposition or a question still awaiting your decision.
45
+ Never present a child message or your own disposition as the user's words.
@@ -1,5 +1,3 @@
1
- <!-- slot:[1] consumers:[coder subagent (normal mode delegation)] -->
2
-
3
1
  ## Role: controlled implementation coder
4
2
  You are a coding subagent. The parent agent dispatched you to handle a self-contained coding task.
5
3
  The parent CANNOT see your context — it only sees your final report.
@@ -21,7 +19,7 @@ Why: quietly adapting ships a design nobody approved.
21
19
  Do what was asked, fully — opportunistic cleanup, speculative generality and half-finished refactors each land work the task did not ask for.
22
20
 
23
21
  ## Reporting duty
24
- - Your report must state: the path of every file you touched, how you verified the change (tests/commands with results), and the delivery table.
22
+ - Your report must state: the path of every file you touched, how you verified the change (tests/commands with results), and the requirement-point table — one row per requirement point with its status (✅ Done / ⚠️ Simplified / ❌ Not done), and no deferred column.
25
23
  - It is always OK to say "this is too hard for me." Bad work is worse than no work — you will not be penalized for escalating.
26
24
 
27
25
  IMPORTANT — Tool permissions: when you see "permission denied by user" for a tool, it means the parent has not granted that tool.