@thincoder/core 0.11.3 → 0.11.5

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 (183) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/advisor/compaction.mjs +40 -17
  3. package/advisor/loop.mjs +14 -6
  4. package/advisor/notice.mjs +1 -1
  5. package/advisor/timeline.mjs +4 -4
  6. package/agent/completion.mjs +19 -0
  7. package/agent/dispatch-gates.mjs +2 -0
  8. package/agent/dispatch.mjs +2 -2
  9. package/agent/family-tools.mjs +13 -9
  10. package/agent/helpers.mjs +10 -6
  11. package/agent/planning-step.mjs +453 -0
  12. package/agent/post-turn.mjs +70 -2
  13. package/agent/run-stages.mjs +22 -50
  14. package/agent/run-start.mjs +17 -0
  15. package/agent/setup-reminders.mjs +71 -8
  16. package/agent/setup.mjs +8 -39
  17. package/agent/spawn-child.mjs +6 -2
  18. package/agent/task-lifecycle.mjs +146 -0
  19. package/agent/turn-loop.mjs +73 -11
  20. package/agent-tools/batch-closeout.mjs +21 -34
  21. package/agent-tools/batch-gate.mjs +7 -5
  22. package/agent-tools/batch-ledger-bind.mjs +21 -1
  23. package/agent-tools/batch-lifecycle.mjs +7 -7
  24. package/agent-tools/batch-record-write.mjs +237 -280
  25. package/agent-tools/batch-supersede.mjs +3 -3
  26. package/agent-tools/batch.mjs +42 -9
  27. package/agent-tools/context.mjs +0 -13
  28. package/agent-tools/escalate-async.mjs +7 -1
  29. package/agent-tools/parent-channel.mjs +7 -6
  30. package/agent-tools/plan.mjs +103 -67
  31. package/agent-tools/review-facts.mjs +3 -3
  32. package/agent-tools/settings.mjs +2 -0
  33. package/agent-tools/spawn-gates.mjs +37 -11
  34. package/agent-tools/ssh-session.mjs +68 -25
  35. package/agent-tools/ssh-transfer.mjs +7 -2
  36. package/agent-tools/ssh-transport.mjs +2 -2
  37. package/agent-tools/ssh-vault.mjs +2 -2
  38. package/agent-tools/step.mjs +462 -0
  39. package/agent-tools/subagent-actions.mjs +6 -1
  40. package/agent-tools/subagent-run.mjs +7 -0
  41. package/agent-tools/subagent-spawn.mjs +1 -1
  42. package/agent-tools/subagent.mjs +17 -11
  43. package/agent-tools/task.mjs +178 -26
  44. package/agent-tools.mjs +1 -0
  45. package/agent.mjs +2 -0
  46. package/config-defaults.mjs +17 -1
  47. package/config-migrate.mjs +8 -5
  48. package/config.mjs +7 -0
  49. package/context.mjs +5 -4
  50. package/declaration.mjs +4 -4
  51. package/generate-title.mjs +0 -6
  52. package/i18n.mjs +4 -0
  53. package/ledger-cmd.mjs +11 -1
  54. package/ledger-tools.mjs +15 -4
  55. package/manifest-schema.mjs +1 -0
  56. package/model-context.mjs +34 -11
  57. package/model-specs.mjs +5 -2
  58. package/package.json +1 -1
  59. package/prompt-files.mjs +48 -11
  60. package/prompt-overlays.mjs +79 -8
  61. package/prompts/advisor-design.md +253 -206
  62. package/prompts/advisor-round1.md +151 -145
  63. package/prompts/advisor-round2.md +136 -130
  64. package/prompts/advisor-round3.md +140 -134
  65. package/prompts/common.md +244 -96
  66. package/prompts/consult-base.md +29 -30
  67. package/prompts/discipline-engineering.md +73 -519
  68. package/prompts/discipline-normal.md +28 -136
  69. package/prompts/knowledge/batch-before-write.md +8 -0
  70. package/prompts/knowledge/batch-cycle-register.md +15 -0
  71. package/prompts/knowledge/batch-progress-ledger.md +29 -0
  72. package/prompts/knowledge/business-gates.md +24 -24
  73. package/prompts/knowledge/decision-quality.md +8 -19
  74. package/prompts/knowledge/doc-discipline-d-rules.md +63 -0
  75. package/prompts/knowledge/doc-lookup.md +25 -24
  76. package/prompts/knowledge/document-writing.md +11 -32
  77. package/prompts/knowledge/documentation-evaluation.md +42 -42
  78. package/prompts/knowledge/eng-dispatch-ops.md +34 -0
  79. package/prompts/knowledge/eng-ledger-ops.md +26 -0
  80. package/prompts/knowledge/evidence-discipline.md +10 -32
  81. package/prompts/knowledge/normal-batch-discipline.md +13 -0
  82. package/prompts/knowledge/normal-coding-workflow.md +97 -99
  83. package/prompts/knowledge/normal-delivery-collaboration.md +107 -112
  84. package/prompts/knowledge/normal-work-management.md +44 -44
  85. package/prompts/knowledge/product-security.md +7 -26
  86. package/prompts/knowledge/project-records.md +69 -64
  87. package/prompts/knowledge/tool-advisor.md +17 -17
  88. package/prompts/knowledge/tool-apply-patch.md +14 -14
  89. package/prompts/knowledge/tool-bash.md +32 -31
  90. package/prompts/knowledge/tool-batch-eng-coder.md +19 -13
  91. package/prompts/knowledge/tool-batch-eng-designer.md +21 -14
  92. package/prompts/knowledge/tool-batch-review.md +18 -12
  93. package/prompts/knowledge/tool-batch.md +93 -85
  94. package/prompts/knowledge/tool-browser.md +59 -59
  95. package/prompts/knowledge/tool-code-search.md +2 -2
  96. package/prompts/knowledge/tool-consult-start.md +6 -6
  97. package/prompts/knowledge/tool-consult-stop.md +3 -3
  98. package/prompts/knowledge/tool-context.md +4 -4
  99. package/prompts/knowledge/tool-delete.md +16 -16
  100. package/prompts/knowledge/tool-doc-check.md +39 -39
  101. package/prompts/knowledge/tool-doc-graph-read.md +11 -11
  102. package/prompts/knowledge/tool-doc-graph.md +48 -48
  103. package/prompts/knowledge/tool-doc-search.md +3 -3
  104. package/prompts/knowledge/tool-edit.md +30 -30
  105. package/prompts/knowledge/tool-eng.md +1 -1
  106. package/prompts/knowledge/tool-execute.md +16 -16
  107. package/prompts/knowledge/tool-fetch.md +15 -15
  108. package/prompts/knowledge/tool-file-ops.md +15 -15
  109. package/prompts/knowledge/tool-get-current-time.md +3 -3
  110. package/prompts/knowledge/tool-git-read.md +15 -15
  111. package/prompts/knowledge/tool-git.md +26 -26
  112. package/prompts/knowledge/tool-glob.md +14 -14
  113. package/prompts/knowledge/tool-goal.md +5 -5
  114. package/prompts/knowledge/tool-grep.md +19 -18
  115. package/prompts/knowledge/tool-hashline-edit.md +13 -13
  116. package/prompts/knowledge/tool-insert-after.md +14 -14
  117. package/prompts/knowledge/tool-instance-list.md +3 -3
  118. package/prompts/knowledge/tool-instance-send.md +5 -5
  119. package/prompts/knowledge/tool-knowledge.md +12 -12
  120. package/prompts/knowledge/tool-ledger-read.md +20 -20
  121. package/prompts/knowledge/tool-ledger.md +44 -44
  122. package/prompts/knowledge/tool-lint.md +10 -10
  123. package/prompts/knowledge/tool-ls.md +11 -11
  124. package/prompts/knowledge/tool-lsp.md +8 -8
  125. package/prompts/knowledge/tool-main-history.md +1 -1
  126. package/prompts/knowledge/tool-manifest-read.md +7 -7
  127. package/prompts/knowledge/tool-manifest.md +43 -32
  128. package/prompts/knowledge/tool-memory-read.md +12 -12
  129. package/prompts/knowledge/tool-memory.md +14 -14
  130. package/prompts/knowledge/tool-notify-parent.md +10 -10
  131. package/prompts/knowledge/tool-operations.md +88 -88
  132. package/prompts/knowledge/tool-peek.md +10 -0
  133. package/prompts/knowledge/tool-peer-instances.md +1 -1
  134. package/prompts/knowledge/tool-plan.md +6 -3
  135. package/prompts/knowledge/tool-process-read.md +8 -8
  136. package/prompts/knowledge/tool-process.md +11 -11
  137. package/prompts/knowledge/tool-question.md +11 -13
  138. package/prompts/knowledge/tool-read-history-batch.md +13 -13
  139. package/prompts/knowledge/tool-read-history.md +19 -19
  140. package/prompts/knowledge/tool-read-image.md +8 -8
  141. package/prompts/knowledge/tool-read.md +17 -17
  142. package/prompts/knowledge/tool-recent-changes.md +4 -4
  143. package/prompts/knowledge/tool-repo-outline.md +2 -2
  144. package/prompts/knowledge/tool-settings-read.md +5 -7
  145. package/prompts/knowledge/tool-settings.md +10 -10
  146. package/prompts/knowledge/tool-skill.md +4 -4
  147. package/prompts/knowledge/tool-ssh.md +66 -66
  148. package/prompts/knowledge/tool-step.md +26 -0
  149. package/prompts/knowledge/tool-subagent.md +52 -50
  150. package/prompts/knowledge/tool-task.md +14 -11
  151. package/prompts/knowledge/tool-team-ledger-read.md +7 -7
  152. package/prompts/knowledge/tool-team-ledger.md +13 -13
  153. package/prompts/knowledge/tool-timer.md +14 -14
  154. package/prompts/knowledge/tool-tree.md +11 -11
  155. package/prompts/knowledge/tool-verify.md +11 -11
  156. package/prompts/knowledge/tool-wait-for.md +20 -20
  157. package/prompts/knowledge/tool-websearch.md +16 -14
  158. package/prompts/knowledge/tool-write.md +10 -10
  159. package/prompts/knowledge/upstream-protocol.md +37 -38
  160. package/prompts/persona-coder.md +22 -22
  161. package/prompts/persona-eng-coder.md +87 -81
  162. package/prompts/persona-eng-designer.md +173 -153
  163. package/prompts/persona-engineering.md +53 -554
  164. package/prompts/persona-explore.md +18 -15
  165. package/prompts/persona-normal.md +62 -63
  166. package/prompts/persona-plan.md +36 -32
  167. package/prompts/persona-tester.md +39 -39
  168. package/prompts/planning-next-moves.md +9 -0
  169. package/prompts/subagent-base.md +4 -16
  170. package/provider/errors.mjs +0 -24
  171. package/provider/list-models.mjs +20 -2
  172. package/session-lifecycle.mjs +4 -3
  173. package/tool-args.mjs +25 -0
  174. package/tool-docs/peek.md +3 -0
  175. package/tool-docs/plan.md +1 -1
  176. package/tool-docs/question.md +1 -1
  177. package/tool-docs/step.md +3 -0
  178. package/tools/edit-diff.mjs +4 -4
  179. package/tools/index.mjs +3 -2
  180. package/tools/peek.mjs +447 -0
  181. package/tools/question.mjs +87 -9
  182. package/tools/ssh.mjs +1 -1
  183. package/window-policy.mjs +107 -80
@@ -1,102 +1,102 @@
1
1
  aliases: 工具纪律, 工具选择, 检索优先级
2
- ## Tool discipline
3
- ### Search tool priority
4
- Check the tool table before searching: MCP search tools (`*_web_search*`, `*_search_prime`) are primary for technical verification and general search.
5
- Use `websearch` only when MCP search is not configured or its call failed.
6
- It is not Bing-only: a configured DeepSeek provider answers first, then Tavily when `websearch.apiKey` is set and returned results, then Bing.
7
- `websearch.backend: "local"` skips the DeepSeek leg, as does a query over 128 characters; an empty or failed DeepSeek answer falls through and adds one note beside the results a fallback leg carried.
8
- Switch to an MCP search tool immediately after two consecutive junk or unrelated `websearch` results.
9
- Use a mirror path for a blocked or unreachable site, such as gh-proxy.com for GitHub SDK source or type definitions.
10
- Cite the page actually fetched, not a guessed official-doc URL.
11
- Check for an existing fetch or search tool before scraping a page by hand: `fetch` or MCP search before `curl`-style scraping.
12
- Pick search and fetch tools by the stated priority and network reachability, not by a hard-coded name.
13
- Translate Chinese into English first when needed for search.
2
+ ## 工具纪律
3
+ ### 搜索工具优先级
4
+ 搜索之前先看工具表:MCP 搜索工具(`*_web_search*`、`*_search_prime`)是技术核实与一般搜索的首选。
5
+ 只在 MCP 搜索未配置、或它的调用失败时,才用 `websearch`。
6
+ 它不只走 Bing:配置了 DeepSeek 提供方就先由它作答,然后当 `websearch.apiKey` 已设置且返回了结果时走 Tavily,最后才是 Bing。
7
+ `websearch.backend: "local"` 跳过 DeepSeek 那条腿,超过 128 字符的查询也一样;DeepSeek 答空或失败会往下落,并在回退腿带回的结果旁边加一句说明。
8
+ 连续两条 `websearch` 结果是垃圾或无关时,立刻改用 MCP 搜索工具。
9
+ 站点被挡或不可达时走镜像路径,例如 GitHub SDK 源码或类型定义用 gh-proxy.com。
10
+ 引用真正抓到的那个页面,不要引用一个猜出来的官方文档 URL。
11
+ 手工刮页面之前先看有没有现成的抓取或搜索工具:先 `fetch` 或 MCP 搜索,再考虑 `curl` 式刮取。
12
+ 按写明的优先级与网络可达性挑搜索与抓取工具,不要按写死的一个名字挑。
13
+ 搜索需要时先把中文翻成英文。
14
14
 
15
- ### What counts as a source
16
- Use a verbatim sentence or code fragment from official docs, an official repo or a specification, with its specific page or file.
17
- Treat blogs, Q&A and aggregators as leads; trace them to a first-hand source or confirm by measurement.
18
- Say when no first-hand source is available and mark the assertion `unverified`.
19
- If no usable search tool exists, say "no search tool in the environment" and mark the assertion `unverified`.
20
- If searches find no first-hand source, keep switching sources until that is established, then state "checked, no first-hand source" and mark `unverified`.
21
- Never fabricate a source.
22
- Verify facts rather than copying an industry checklist.
23
- Online verification requires a usable online entry in the tool table.
15
+ ### 什么算来源
16
+ 用官方文档、官方仓库或规范里的一句原文或一段代码,附上它具体的页面或文件。
17
+ 把博客、问答与聚合站当线索;追到第一手来源,或用测量确认。
18
+ 拿不到第一手来源时就说出来,并把该断言标 `unverified`。
19
+ 环境里没有可用的搜索工具时,说「环境里没有搜索工具」,并把该断言标 `unverified`。
20
+ 搜索找不到第一手来源时,不断换来源直到这一点被确认,然后写明「已查,无第一手来源」并标 `unverified`。
21
+ 绝不编造来源。
22
+ 核实事实,而不是照抄一份行业检查清单。
23
+ 在线核实要求工具表里有一个可用的在线入口。
24
24
 
25
- ### Codebase exploration order
26
- repo_outline → doc_search → code_search. Structure → intent → details.
25
+ ### 代码库探索顺序
26
+ repo_outline → doc_search → code_search。结构 → 意图 → 细节。
27
27
 
28
- ### Document search — finding a document vs locating a line
29
- Use `doc_search` for discovery: which document states a rule, whether a standard exists, where a decision was made, which repository holds it.
30
- Use `grep` to locate exact wording once repository, directory and file are known, then read the matching text.
31
- The doc-lookup rules decide when to look; these decide which tool to use.
28
+ ### 文档搜索 —— 找一份文档 vs 定位一行
29
+ `doc_search` 用于发现:哪份文档写了某条规则、某个标准存不存在、某个决策在哪里做出、它落在哪个仓库。
30
+ 仓库、目录与文件已知之后,用 `grep` 定位确切措辞,然后读匹配的文本。
31
+ 查文档的规则决定什么时候查;这里的规则决定用哪个工具。
32
32
 
33
- `doc_search` covers this project's documents and repositories declared under `index.publicRepos` in one query.
34
- `grep` searches only the supplied `path`, defaulting to `.` in the session's working directory; no repository boundary applies — `path: "../<repo>"` and an absolute path are searched like any other directory.
35
- Treat a `grep` empty result as limited to its actual reach, not proof of cross-repository absence.
36
- Report when a search finds nothing.
37
- After an empty `doc_search`, `grep` is appropriate for alternate spelling or a phrase in a known file; report `doc_search: none found` beside that `grep` result.
33
+ `doc_search` 一次查询覆盖本项目的文档,以及 `index.publicRepos` 下声明过的仓库。
34
+ `grep` 只搜索给到的 `path`,默认是会话工作目录下的 `.`;没有仓库边界 —— `path: "../<repo>"` 与绝对路径都像任何其他目录一样被搜索。
35
+ 把 `grep` 的空结果读成只限于它实际够到的范围,不是跨仓库缺席的证明。
36
+ 搜索什么都没找到时要报告。
37
+ `doc_search` 空手之后,为另一种拼写或某个已知文件里的短语跑 `grep` 是合适的;在那个 `grep` 结果旁边注明 `doc_search: none found`。
38
38
 
39
- A hit in a process document is neither a criterion nor a lead: it grounds no finding and never stands in for the requirement or design document's own words.
40
- Batch records and project-declared archived pages are outside the declared index domain.
41
- Open the requirement or design state document identified by such a hit before relying on it.
42
- Do not turn a past batch draft into the current standard.
39
+ 过程文档里的一处命中既不是判据也不是线索:它支撑不起任何发现,也绝不代替需求或设计文档自己的话。
40
+ 批次档与项目声明归档的页面在已声明索引域之外。
41
+ 依赖它之前,先打开那处命中指出的需求或设计状态文档。
42
+ 不要把一个过去的批次草稿变成当前标准。
43
43
 
44
- A repository outside `index.publicRepos` is neither searchable through `doc_search` nor citable.
45
- A reference into an undeclared repository is reported as missing and fails the delivery gate.
46
- When a sibling-repository topic is possible but the answer is empty, report `cross-repo: not indexed`.
44
+ `index.publicRepos` 之外的仓库既不能经 `doc_search` 搜索,也不能引用。
45
+ 引用一个未声明的仓库会被报成缺失,并让交付门不通过。
46
+ 兄弟仓库的话题可能存在而答案是空的时候,报 `cross-repo: not indexed`。
47
47
 
48
- ### Parallel call principles
49
- Batch independent read-only calls into one reply so they run concurrently.
50
- A top-level spawn returns immediately and its report arrives when the session is idle.
51
- The scheduler queues file conflicts and `dependsOn` dependencies automatically.
52
- After dispatching a subagent, end the turn if its report is needed next; otherwise continue other work immediately.
53
- Do not hold later spawns until earlier ones finish, and do not poll progress.
48
+ ### 并行调用原则
49
+ 把独立的只读调用并进一次回复,让它们并发跑。
50
+ 顶层派生立即返回,它的报告在会话空闲时送达。
51
+ 调度器会自动排队文件冲突与 `dependsOn` 依赖。
52
+ 派出一个子代理之后,如果下一步需要它的报告,就结束这一轮;否则立刻继续别的活。
53
+ 不要为了等前面的派生完成而扣住后面的派生,也不要轮询进度。
54
54
 
55
- ### Steering your own context (a session whose tool table carries `context`)
56
- Use `context` to inspect usage, composition and distance from the compaction line.
57
- Start compaction yourself when direction changes or context becomes noisy, and state the focus needed for upcoming work.
58
- Compacted material remains retrievable through the receipt's anchor.
59
- Automatic compaction at the line is a fallback, not a signal to stop; continue after compaction until the task is done.
55
+ ### 掌管你自己的上下文(工具表带 `context` 的会话)
56
+ 用 `context` 查看占用、构成与到压缩线的距离。
57
+ 方向改变或上下文变吵时自己启动压缩,并说明接下来要干的活需要什么焦点。
58
+ 被压缩的材料仍可通过回执里的锚取回。
59
+ 到达压缩线时的自动压缩是回退,不是停下的信号;压缩之后继续,直到任务做完。
60
60
 
61
- ## Tool routing — write-type scenarios route per the table, not bash
62
- | Tool | Use it for | Not (use the dedicated tool instead) |
61
+ ## 工具路由 —— 写入类场景按这张表路由,不走 bash
62
+ | 工具 | 用它做 | 不用它(改用专用工具) |
63
63
  |---|---|---|
64
- | `read` | read a text file (paged / hashes=true for editing) | `cat`, `type`, `node -e fs.readFileSync` |
65
- | `write` | create/overwrite a file | `echo >`, `printf >`, heredocs |
66
- | `edit` | region replacement (line-number or content targeting — exact → fuzzy) | `sed -i`, `perl -p` |
67
- | `hashline_edit` | content-hash-addressed edit (position-independent) | `sed` by line number |
68
- | `insert_after` | insert a block after a known line / regex anchor | `sed` insertion, line-number surgery |
69
- | `apply_patch` | multi-file unified diff (all-or-nothing) | `git apply` by hand |
70
- | `delete` | delete one file, or an empty directory (tracked files need force) | `del`, `rm` |
71
- | `file_ops` | move / copy / rename files or dirs | `mv`, `cp`, `ren` |
72
- | `ls` / `glob` / `grep` / `tree` | list dirs / find files by pattern / regex search / directory tree | bash `dir`/`find`/`findstr`/`grep -rn` |
73
- | `repo_outline` / `code_search` / `doc_search` | module dependency graph / code search / doc search | ad-hoc scripts, grep gymnastics |
74
- | `read_image` | view an image (vision models) | external viewers |
75
- | `execute` | run JS (inline or scriptFile; + nodeArgs for `node --test`/`--check`) | `bash node -e` |
76
- | `bash` | package-manager/CLI subprocesses, servers, TTY programs, one-off pipelines no dedicated tool expresses | see table — dedicated tools first |
77
- | `git` | ALL git operations | `git` in bash |
78
- | `process` / `get_current_time` / `wait_for` | list processes / current time / condition waits | `tasklist`/`ps`, `date`, `sleep` hacks |
79
- | `timer` | set a thinking-budget reminder — non-blocking; a system reminder lands at the deadline | `sleep` hacks / pushing work to later turns |
80
- | `verify` | pre-completion gate (you declare verification.status; it gates mechanically — it does not run checks) | expecting it to run your tests |
81
- | `memory` | long-term memory (search/put/list/delete/clear/maintain) | session notes |
82
- | `fetch` / `websearch` / MCP search | fetch a URL (explicit proxy) / search with a provider chain (DeepSeek → Tavily → Bing) / technical lookups primary | `curl` scraping |
83
- | `checkpoint` | git snapshots / rewind safety | manual branches |
84
- | `subagent` / `advisor` / `consult_*` | delegation / independent review / consultation | inlining exploration, self-review only, single-model guessing |
85
- | `question` | ask the user (ambiguity, design decisions) | guessing; routine confirm-gates (those go in your plain reply text) |
64
+ | `read` | 读一个文本文件(分页 / 改档前用 hashes=true) | `cat`、`type`、`node -e fs.readFileSync` |
65
+ | `write` | 创建 / 覆盖一个文件 | `echo >`、`printf >`、heredoc、`Set-Content` |
66
+ | `edit` | 区域替换(按行号或按内容定位 —— 精确 → 模糊) | `sed -i`、`perl -p`、`-replace`、管道写回 |
67
+ | `hashline_edit` | 按内容哈希寻址的编辑(与位置无关) | 按行号 `sed` |
68
+ | `insert_after` | 在一行已知行 / 正则锚之后插入一个块 | `sed` 插入、行号手术 |
69
+ | `apply_patch` | 多文件 unified diff(全有或全无) | 手写 `git apply` |
70
+ | `delete` | 删一个文件,或一个空目录(追踪文件需要 force) | `del`、`rm` |
71
+ | `file_ops` | 移动 / 复制 / 改名文件或目录 | `mv`、`cp`、`ren` |
72
+ | `ls` / `glob` / `grep` / `tree` | 列目录 / 按模式找文件 / 正则搜索 / 目录树 | bash 的 `dir`/`find`/`findstr`/`grep -rn` |
73
+ | `repo_outline` / `code_search` / `doc_search` | 模块依赖图 / 代码搜索 / 文档搜索 | 临时脚本、grep 体操 |
74
+ | `read_image` | 看一张图(视觉模型) | 外部看图程序 |
75
+ | `execute` | 跑 JS(内联或 scriptFile;`node --test`/`--check` 另加 nodeArgs) | `bash node -e` |
76
+ | `bash` | 包管理器 / CLI 子进程、服务器、TTY 程序、没有专用工具能表达的临时管道 | 看这张表 —— 专用工具优先 |
77
+ | `git` | **所有** git 操作 | 在 bash 里跑 `git` |
78
+ | `process` / `get_current_time` / `wait_for` | 列进程 / 当前时间 / 条件等待 | `tasklist`/`ps`、`date`、`sleep` 小把戏 |
79
+ | `timer` | 设一个思考预算提醒 —— 非阻塞;到期时落一条系统提醒 | `sleep` 小把戏 / 把活推到后面的轮次 |
80
+ | `verify` | 完成前的闸(你声明 verification.status;它机械地把关 —— 它不跑检查) | 指望它去跑你的测试 |
81
+ | `memory` | 长期记忆(search/put/list/delete/clear/maintain) | 会话笔记 |
82
+ | `fetch` / `websearch` / MCP 搜索 | 抓一个 URL(显式代理)/ 按提供方链搜索(DeepSeek → Tavily → Bing)/ 技术查证首选 | `curl` 刮取 |
83
+ | `checkpoint` | git 快照 / 回退安全网 | 手工建分支 |
84
+ | `subagent` / `advisor` / `consult_*` | 委派 / 独立评审 / 会诊 | 内联探索、只做自审、单模型猜测 |
85
+ | `question` | 问用户(关键业务约束、互斥路线取舍;2–4 个正交分叉用 `questions` 合并成一张表单卡,每题带自由输入) | 盲猜互斥路线;能自查代码/文档/联网的事;例行确认闸(走普通回复) |
86
86
 
87
- Use the `git` tool for every git operation: it snapshots before `checkout -- <path>`, `restore`, `reset --hard`, `stash pop`, `clean -f` and branch/tag deletion.
88
- Recover a mistaken rollback with `checkpoint` `list` → `rewind`.
89
- Do not rely on the bash guard: it checks the process `cwd`, which may be a non-repo workspace root even when the repo is in a child directory, and a shell `cd` or `Set-Location` does not change the `cwd` that guard uses.
90
- Pass an explicit `workdir` to the git tool when the anchor is ambiguous.
87
+ 每一次 git 操作都用 `git` 工具:它在 `checkout -- <path>`、`restore`、`reset --hard`、`stash pop`、`clean -f` 与分支 / 标签删除之前打快照。
88
+ 用 `checkpoint` 的 `list` → `rewind` 挽回一次误操作的回滚。
89
+ 不要依赖 bash 守卫:它检查进程的 `cwd`,而仓库在子目录里时那个 `cwd` 可能是个非仓库的工作区根,何况 shell 的 `cd` 或 `Set-Location` 也不会改变那道守卫用的 `cwd`。
90
+ 锚点有歧义时,给 git 工具传一个显式的 `workdir`。
91
91
 
92
- Use `wait_for` only for states without their own delivery channel, such as a port opening or a file appearing.
93
- Do not use it for an async subagent report, which arrives when the session is idle.
94
- A blocking `wait_for` parks the whole session.
92
+ 只在没有自己投递通道的状态上用 `wait_for`,例如端口打开或文件出现。
93
+ 不要用它等一个异步子代理报告,那份报告在会话空闲时自己会到。
94
+ 一次阻塞的 `wait_for` 会把整个会话停住。
95
95
 
96
- **Destructive commands — the tool layer catches none of this**:
97
- - **Deletions go through the tool face**: use `delete`, `git rm` or a very narrow allowlist instead of `rm`, `rmdir`, `del`, `rd`, `Remove-Item` and similar commands.
98
- - **Diagnostics are read-only**: only read-only existence and state commands such as `dir`, `ls`, `where` and `type`; never smuggle in a write or delete verb.
99
- Follow the routing table when a dedicated tool exists; this bullet covers bare commands.
100
- - **Keep failures visible**: no `2>nul` or `2>/dev/null` on destructive or write commands, and no chaining with `&` or `;` instead of `&&`.
101
- - **Confirm before irreversible actions**: the main session asks the user; a subagent raises `notify_parent` `ask`.
102
- - **Take responsibility for the command**: no tool-layer gate replaces your own check.
96
+ **破坏性命令 —— 工具层一个都不拦**:
97
+ - **删除走工具面**:用 `delete`、`git rm`,或一份极窄的白名单,而不是 `rm`、`rmdir`、`del`、`rd`、`Remove-Item` 之类命令。
98
+ - **诊断是只读的**:只允许 `dir`、`ls`、`where`、`type` 这类只读的存在与状态命令;绝不夹带写入或删除动词。
99
+ 有专用工具时按路由表走;这一条管的是裸命令。
100
+ - **让失败可见**:破坏性或写入命令上不写 `2>nul` 或 `2>/dev/null`,也不用 `&` 或 `;` 代替 `&&` 来串联。
101
+ - **不可逆动作之前先确认**:主会话问用户;子代理上抛 `notify_parent` 的 `ask`。
102
+ - **对命令负责**:没有哪道工具层的闸能替代你自己的检查。
@@ -0,0 +1,10 @@
1
+ aliases: 批量骨架, 文档大纲, 按节抽取, 符号抽取, 快速探查
2
+ 本地毫秒级多文件探查工具(零额外模型调用),用于在不把整批全文灌进主上下文的前提下快速看清结构或精准取片段:
3
+
4
+ - `mode="outline"`(默认):一次扫多份 `.md`(提取 H1–H4 标题树、节行数、表头、首句)或代码文件(顶部注释 + 导出/顶层函数与类签名)。
5
+ - `mode="sections"` + `query`:跨多份 `.md` 只抽取标题命中关键词的完整章节正文(支持逗号分隔多关键词),免去逐个全文 `read`。
6
+ - `mode="symbols"` + `query`:跨多份代码文件精准抽取目标函数/类/类型定义体。
7
+
8
+ 选工具分工:
9
+ - 批量看目录/多份文档结构、找要改哪几节/哪个函数 ⇒ 第一步直接用 `peek`(毫秒级、极低 token)。
10
+ - 准备精确 `edit` 某文件 ⇒ `read` 目标片段拿最新原文。
@@ -1,2 +1,2 @@
1
1
  aliases: 实例, 同工作区, 多实例
2
- Returns [{ pid, end, sessionId, slots }]; never includes self; pure read — writes nothing.
2
+ 返回 [{ pid, end, sessionId, slots }];从不包含自己;纯读 —— 不写任何东西。
@@ -1,5 +1,8 @@
1
1
  aliases: 计划模式, 只读计划
2
- In plan mode you are restricted to READ-ONLY tools: read files, search code, run read-only shell commands.
3
- Use plan mode before complex multi-step tasks — explore the codebase, design the architecture, present a plan to the user.
2
+ 计划模式里你只能用只读工具:读文件、搜代码、并行查证(含 `peek`、`step(readonly=true)`、只读 `explore`)。
3
+ 复杂多步任务在动手改盘前可先进入计划模式,完成四步查证(拆需求、查文档与先例、全仓扫调用方与同族逻辑、核对排除项/边界退路/定向验证命令),整理出决策完备的 Markdown 计划。
4
4
 
5
- Exit plan mode to present the plan for the user's approval; implement only after they approve.
5
+ 提交审批时调用 `plan(action="exit", plan="# 标题\n...")`,通过交互审批卡交给用户裁决:
6
+ - 仅用户明确点批准时才退出计划模式并开始实施;
7
+ - 用户要求修订或取消时保持计划模式(不解除只读门禁),吸收反馈修订后重新调用 `plan(action="exit", plan=...)`;
8
+ - 用户的口头确认或回答单个澄清问题不等于批准整份计划,不要只在普通回复里贴计划就跳过 `plan(action="exit", plan=...)`。
@@ -1,13 +1,13 @@
1
1
  aliases: 进程, 只读进程
2
- Nothing here kills: no process tree and no background task is terminated.
2
+ 这里什么都不杀:不终止任何进程树,也不终止任何后台任务。
3
3
 
4
- The action this tool face carries: `list` (the default). It returns one line per process (name / PID, plus memory on Windows).
4
+ 这一工具面承载的动作:`list`(默认)。它每个进程返回一行(名称 / PID,Windows 上另加内存)。
5
5
 
6
- **Route to process instead of bash:**
7
- - `tasklist` (Windows) / `ps aux` (POSIX) → process
6
+ **改用 process,而不是 bash:**
7
+ - `tasklist`(Windows)/ `ps aux`(POSIX)→ process
8
8
 
9
- Parameters:
10
- - action (optional, default 'list'): list — show running processes
11
- - name: (list) substring filter (case-insensitive), e.g. "node", "python"
9
+ 参数:
10
+ - action(可选,默认 'list'):list —— 显示运行中的进程
11
+ - name:(list)子串过滤(不区分大小写),例如 "node"、"python"
12
12
 
13
- Use it to check what a previous run left behind, or whether a server you started is still up. Terminating something (`kill`) is deliberately not part of this tool face: it is destructive and stays with the roles that own it — calling it directly is refused before any process is signalled.
13
+ 用它检查上一次运行留下了什么,或你起的服务器是否还活着。终止某样东西(`kill`)有意不属于这个工具面:它是破坏性的,留在拥有它的角色手里 —— 直接调用它,会在任何进程收到信号之前被拒绝。
@@ -1,15 +1,15 @@
1
1
  aliases: 进程, 结束进程
2
- List returns one line per process (name / PID, plus memory on Windows); kill returns a one-line confirmation.
2
+ list 每个进程返回一行(名称 / PID,Windows 上另加内存);kill 返回一行确认。
3
3
 
4
- **Route to process instead of bash:**
5
- - `tasklist` (Windows) / `ps aux` (POSIX) → process
4
+ **改用 process,而不是 bash:**
5
+ - `tasklist`(Windows)/ `ps aux`(POSIX)→ process
6
6
 
7
- Parameters:
8
- - action (optional, default 'list'): list — show running processes; kill — terminate a process tree (target: pid) or a background task (target: id)
9
- - name: (list) substring filter (case-insensitive), e.g. "node", "python"
10
- - pid: (kill) process id — the whole tree is terminated (taskkill /T /F on win32; POSIX group kill)
11
- - id: (kill) background task id — the N from a `bash#N` or `browser#N` ack, as a number. bash ⇒ its process tree is terminated; browser ⇒ a queued task is dropped, a running one is aborted (the browser itself is not killed); either way the entry leaves the pool and no digest will arrive (a bash task's log so far stays readable).
7
+ 参数:
8
+ - action(可选,默认 'list'):list —— 显示运行中的进程;kill —— 终止一棵进程树(target: pid)或一个后台任务(target: id)
9
+ - name:(list)子串过滤(不区分大小写),例如 "node"、"python"
10
+ - pid:(kill)进程 id —— 整棵树被终止(win32 上是 taskkill /T /F;POSIX 上是整组 kill)
11
+ - id:(kill)后台任务 id —— 来自 `bash#N` 或 `browser#N` 确认里的那个 N,按数字给。bash ⇒ 它的进程树被终止;browser ⇒ 排队中的任务被丢弃,运行中的被中止(浏览器本身不被杀);两种情况下该条目都离开池,也不会再送摘要(bash 任务到目前为止的日志仍可读)。
12
12
 
13
- Notes:
14
- - kill is destructive: pass exactly one target (pid or id — never both), and it goes through the same approval gate as other destructive actions — confirm before killing.
15
- - Repeating a kill is idempotent (same confirmation, no double kill); an unknown or already-finished task id comes back as `Error: ...`.
13
+ 注意:
14
+ - kill 是破坏性的:恰好给一个目标(pid 或 id —— 绝不给两个),它与其他破坏性动作走同一道审批闸 —— 杀之前先确认。
15
+ - 重复 kill 是幂等的(同一次确认,不会杀两次);未知或已经结束的任务 id 以 `Error: ...` 回来。
@@ -1,16 +1,14 @@
1
1
  aliases: 提问, 询问用户
2
- Use when the task is ambiguous, you need a design decision, or you are stuck and need human judgment.
2
+ 任务存在关键业务分叉、缺失只有用户掌握的约束或取舍,或你卡住需要人的判断时用它。
3
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.
4
+ 参数(二选一):
5
+ - 单题:`question`(≤100 字)+ 可选 `options`(最多 4 条普通字符串,例如 `["A", "B", "C"]` —— 绝不要对象)。
6
+ - 多题表单:`questions`(1–4 个独立短问题数组,每项 `{ question, options? }`,每题 ≤100 字、可选最多 4 条纯字符串选项),会在同一张交互表单卡里一次展示给用户作答。
7
+ - **自由输入始终可用**:无论单题还是多题,前端都会为每道题提供预设选项之外的自由文本输入口,让用户随时补充或改写自己的真实答案。
7
8
 
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.
9
+ 注意:
10
+ - agent 循环暂停到用户提交答案为止,回答返回后循环原地恢复继续推进。
11
+ - **什么时候该盘中就问**:当缺失的是**只有用户知道的业务约束、场景形态、规模量级、合规/内外网边界或互斥路线取舍**,且没有安全默认值、猜错会让后续多轮在错误分支上空转时,**趁早盘中调用 `question` 问清再继续深挖**——不要盲猜跑完十几轮最后才在长文末尾反问。
12
+ - **什么时候不该问**:能通过读代码、查项目文档或联网检索自己查明的事实绝不问用户;存在清晰合理默认值且不影响主路线时优先自己决策;例行确认闸走普通回复文字,不弹窗。
13
+ - **优先合并正交分叉、每题保持简短**:若有 2–3 个互相独立的关键决策项(如「能否出内网 + 单证类型 + 月处理量」),用 `questions` 一次表单问清,绝不要把多问塞进同一句 `question`,也不要连续弹多张单题卡打断用户。背景、已查证据与分析写在普通回复或先查完再问,不要塞进题干。
14
+ - 一次关于设计约定、工具偏好或反复出现的模式的回答之后,用 `memory` 工具把它存下来(action: put)—— 用户不该在之后的会话里重复同一个偏好。
@@ -1,22 +1,22 @@
1
1
  aliases: 历史, 批次窗口, 会话历史
2
- The window is fixed by the batch, not by you.
2
+ 窗口由批次固定,不由你定。
3
3
 
4
- This face cannot leave the batch: there is no `path`, no other session, no older batch.
4
+ 这一面离不开批次:没有 `path`,没有别的会话,没有更早的批次。
5
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.
6
+ 用它回答「父侧在派我之前定了什么、已经排除了什么」—— 任务书没带的那部分任务。
7
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.
8
+ 答案不在窗口里时,在报告里说出来,而不是猜;父侧下一轮可以把这个事实带进来。
9
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.
10
+ 窗口从批次档被创建的地方开始(或它的第一次派生绑定它的地方),到下一个批次的起点结束 —— 若这是最新的一批,就到此刻。
11
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.
12
+ 没有时间戳的消息永远不会落进任何窗口,所以一个不容错过的事实属于任务书的 `knownFacts`,不属于这里。
13
13
 
14
- Filters combine with AND, and every one of them narrows inside that window:
14
+ 过滤器按 AND 组合,每一个都在那个窗口之内收窄:
15
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.
16
+ - `role` —— user / assistant / tool。
17
+ - `keyword` —— 消息文本的不区分大小写子串。
18
+ - `tool` —— 按名字匹配工具消息,外加声明了该次调用的 assistant 消息。
19
+ - `since` / `until` —— epoch 毫秒,闭区间。批次窗口仍然叠加在上:更晚的起点与更早的终点胜出。
20
+ - `direction` —— 从匹配集合最旧或最新的那一端取 limit 窗口。
21
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.
22
+ `limit` 必填,没有默认值 —— 说清你要多少条消息(1–50)。窗口是调用方的决定;没有东西替你给。
@@ -1,35 +1,35 @@
1
1
  aliases: 历史, 会话历史, 回看
2
- Recall what was said or done earlier: design decisions, tool-call timing, past rulings.
2
+ 回想之前说过或做过什么:设计决策、工具调用时序、过去的裁决。
3
3
 
4
- Default (no `path`): this session's full record — never compacted, audit-complete.
4
+ 默认(不给 `path`):本会话的完整记录 —— 从不被压缩,审计完整。
5
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`.
6
+ 子代理面:eng-coder / eng-designer 子代理拿到的是有界形式 —— 只看父会话,范围限于本批的窗口(它创建之处,或它的第一次派生绑定它的地方,直到下一个批次的起点),`limit` 必填且上限 50,且不给 `path`。
7
7
 
8
- Everything else (explore / plan / coder / tester / consult) carries no history tool: the facts it needs ride the task book's `knownFacts`.
8
+ 其他一切(explore / plan / coder / tester / consult)不带历史工具:它需要的事实由任务书的 `knownFacts` 承载。
9
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).
10
+ 过滤器按 AND 组合(`role` / `keyword` / `tool` / `since`-`until` / `limit` / `direction` —— 语义逐参数;`keyword` 配 `path="all"` 时匹配词与短语,不只是精确子串)。
11
11
 
12
- Returns a JSON array in chronological order:
12
+ 按时间顺序返回一个 JSON 数组:
13
13
 
14
14
  ```text
15
15
  [{ts, role, name?, tool_call_id?, content (≈500 chars, truncated marker), tool_calls ([{name, arguments}] - arguments capped at 300 chars)}]
16
16
  ```
17
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.
18
+ 没有 `ts` 的消息返回 `ts: null`。`content` 被截到约 500 字符,标记会说明实际能取回什么 —— `user` / `assistant` 的正文:全文在会话文件里;`tool` 结果:会话文件只保留那前 500 字符,更多请重跑那个工具。
19
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`.
20
+ 跨会话(`path`,可选):一个会话文件路径,用同样的过滤器深查**那个**会话(相对路径按项目 cwd 解析)。会话大到无法深查时以 `session too large` 被拒绝。
21
21
 
22
- `cwd:<dir>` lists that directory's session slots (slot + file path + title + count + updatedAt; copy one into `path` to deep-query it).
22
+ `cwd:<dir>` 列出那个目录的会话槽位(槽位 + 文件路径 + 标题 + 条数 + updatedAt;把一个拷进 `path` 去深查它)。
23
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`.
24
+ `all` 搜索每一个**已索引**的会话(跨项目;行里带 `session.file`)。一个从未被索引的会话不可见 —— 用 `path=<file>` 查它,或先跑 `thincoder session index --rebuild` 建索引。
25
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`.
26
+ 哪个问题用哪个工具:
27
+ - 在**本**会话里说过或裁决过什么 → `read_history`(默认)。
28
+ - 另一个会话或项目里更早的一段对话 → `read_history` 配 `path` / `cwd`。
29
+ - 这次运行改了哪些文件 → `recent_changes`。
30
+ - 存下来的知识与约定(跨会话)→ `memory search`。
31
+ - 项目的设计文档 → `doc_search`。
32
+ - 写出来的代码 → `code_search`。
33
+ - 一个 git 快照 → `checkpoint cat` / `versions`。
34
34
 
35
- `read_history` reads session messages only; file-level changes belong to `recent_changes`, knowledge and conventions to `memory` — none substitutes for another.
35
+ `read_history` 只读会话消息;文件级改动归 `recent_changes`,知识与约定归 `memory` —— 谁都不能替代谁。
@@ -1,11 +1,11 @@
1
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.
2
+ 截图、UI 稿、示意图或任何视觉内容都用它:模型只能通过这个工具看图像,绝不通过读文件看。
3
3
 
4
- Parameters:
5
- - path (required): Path to image file (relative to cwd or absolute).
4
+ 参数:
5
+ - path(必填):图像文件的路径(相对于 cwd 或绝对路径)。
6
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.
7
+ 注意:
8
+ - 仅栅格格式:png、jpg、gif、webp。超过 15MB 的文件被拒绝。
9
+ - svg 改以文本源码返回,纯文本模型也能用。
10
+ - bmp 被拒绝:先把它转成 PNG。
11
+ - 需要接受图像输入的模型。其他任何模型都会得到错误;svg 是唯一的例外。
@@ -1,22 +1,22 @@
1
1
  aliases: 读文档, 读文件, 查看文件
2
- Use `offset` / `limit` to page through a large file.
2
+ 大文件用 `offset` / `limit` 分页翻。
3
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.
4
+ **改用 read,而不是 bash:** `cat file` / `type file` / `node -e "fs.readFileSync(...)"` → read。读一个文件是一次读 —— 绝不为它 shell 出去。
5
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.
6
+ **路由:**
7
+ - 不知道是哪个文件?→ 先用 `repo_outline` / `code_search` / `glob`。
8
+ - 知道符号但不知道位置?→ `code_search` 或 `lsp definition`。
9
+ - 知道文件但不知道行号?→ 用 `grep` 找行号,再用 `offset` / `limit` 读那一段。抄 `old_string` 只从这次 `read` 取,不从 grep 的显示文本取。
10
+ - 要读的是图?→ 改用 `read_image`。
11
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`.
12
+ 参数:
13
+ - `path`(必填):文件路径,相对于 cwd 或绝对路径(别名:`filePath`)。
14
+ - `offset`:从第几行开始读,1 起算。
15
+ - `limit`:最多返回几行(默认 2000)。对一个更长的文件开窗口时,返回文件头部、一条 `…(truncated: K lines in middle, use offset to continue)` 标记,以及文件真实的尾部行 —— 文件末尾永远不会被藏起来。
16
+ - `hashes`:每行附带一个内容哈希(`hashes: true`),供 `hashline_edit` 用。在你打算用 `hashline_edit` 之前的那次 read 上打开它。
17
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.
18
+ 注意:
19
+ - 永远优先用它而不是 `cat` 或基于 shell 的读法 —— 它限制输出,避免大段倾倒。
20
+ - 文件很大时用 `offset` 分页。
21
+ - 输出的第一行是文档的层标签,例如 `[design]`:它指明这个文件按项目的文档根声明属于哪一层,文件不在任何已声明根之下时读作 `[unlayered]`。把它读成「这是哪一类文档」,绝不读成文件内容。
22
+ - 你打算改这个文件时,在同一次 read 里带上 `hashes: true`:按哈希的编辑对空白与编码差异免疫。
@@ -1,6 +1,6 @@
1
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.
2
+ - 追踪的工具:write / edit / insert_after / apply_patch / delete / hashline_edit。
3
+ - 你需要记起自己已经碰过哪些文件时用它;长跨文件任务里很容易跟丢。
4
+ - 范围仅限本次运行,与 `git status` 不同,后者显示全部未提交改动。
5
5
 
6
- For session-level history (what was said in a session), use read_history.
6
+ 要会话级的历史(一次会话里说过什么),用 read_history。
@@ -1,4 +1,4 @@
1
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.
2
+ 你需要理解项目结构、找某个函数定义在哪、或看哪些文件依赖某个模块时用它。
3
3
 
4
- Pass a path to focus on a single file's relationships. Find code by keyword or snippet with code_search.
4
+ 传一个路径,就聚焦到单个文件的关系上。按关键词或代码片段找代码用 code_search。
@@ -1,12 +1,10 @@
1
1
  aliases: 配置, 只读配置
2
- Nothing here writes: no key is written or cleared.
2
+ 这里什么都不写:没有键被写入或清除。
3
3
 
4
- Two actions: `list` (all keys and values, flattened) and `get <key>` — dot paths into config.json, at any nesting.
4
+ 两个动作:`list`(所有键与值,摊平)与 `get <key>` —— 进 config.json 的点路径,任意层级都行。
5
5
 
6
- SENSITIVE keys are NEVER echoed in plaintext: list / get replies show `••••(masked)`.
6
+ 敏感键**绝不**明文回显:list / get 的回复显示 `••••(masked)`。
7
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.
8
+ 一个键算敏感,条件是某个路径段看起来像凭据(`apiKey`、`token`、`secret`、`password`、`authorization`、`cookie`、`credential` ……),或它位于某个 `headers` / `env` 段之下。
9
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.
10
+ 用它以一条读数回答「这个会话是怎么配置的」,而不是猜 —— 哪个提供方与模型、哪些上限、哪些开关是开的。
@@ -1,17 +1,17 @@
1
1
  aliases: 配置, 设置, 改配置
2
- Actions: `list` (all keys and values, flattened) | `get <key>` | `set <key> <value>` — dot paths into config.json, at any nesting.
2
+ 动作:`list`(所有键与值,摊平)| `get <key>` | `set <key> <value>` —— 进 config.json 的点路径,任意层级都行。
3
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.
4
+ `set` 持久到磁盘(只写你设的那个键;默认值绝不烘焙进来),在运行中的会话里立刻生效 —— 在轮次边界生效的键从下一轮起生效 —— 且该值活过重启。
5
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.
6
+ `list` / `get` 是只读的(planMode 里可用,无审批);`set` 是审批闸背后的副作用。`/config` TUI 命令是人的等价操作。
7
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).
8
+ 已知键做类型检查,所以一个应用会静默丢弃的值会被拒绝:
9
+ - 标量键对照它们的内建默认值(`agent.maxTurns` 是数字,`traces.enabled` 是布尔);
10
+ - `agent.mode` 只接受 `tiny`、`normal` 或 `engineering`,设的是新会话的默认值,当前会话不动;`agent.engineering` 是一个派生的只读视图,不能直接设,也不能经 agent 对象设;
11
+ - 默认值为 null 的键对照它们真实的消费形状(`defaultModel` 用 `"provider:model"` 形式,`agent.subagentModel` / `shell` 是非空字符串,`memory.team` 是一个带 repo 的对象)。
12
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.
13
+ `null` 清除一个键:该条目离开 config.json,内建默认值生效。字符串类型的键拒绝 `null` —— 没有可回落的“未设置”状态。已知小节下的未知键按原样存储。
14
14
 
15
- SENSITIVE keys are NEVER echoed in plaintext: list / get / set replies show `••••(masked)`; setting one is allowed and stored.
15
+ 敏感键**绝不**明文回显:list / get / set 的回复显示 `••••(masked)`;设置一个敏感键是允许的,且照常存储。
16
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.
17
+ 一个键算敏感,条件是某个路径段看起来像凭据(`apiKey`、`token`、`secret`、`password`、`authorization`、`cookie`、`credential` ……),或它位于某个 `headers` / `env` 段之下。
@@ -1,6 +1,6 @@
1
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.
2
+ 技能里装着可复用的指令、工作流或参考资料。
3
+ 用户按名字提到某个技能,或任务与某个已知技能的描述对得上时,用它。
4
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.
5
+ 用 action='list' 调用看可用技能;用 action='load' 加 name=<skill> 调用激活一个。
6
+ 返回技能清单('list')、加载确认('load' —— 指令在下一条消息里到达),或带可用技能清单的 Error: ...。