@thincoder/core 0.11.2 → 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.
- package/CHANGELOG.md +18 -0
- package/advisor/compaction.mjs +7 -5
- package/advisor/history.mjs +24 -11
- package/advisor/loop.mjs +13 -8
- package/advisor/messages.mjs +72 -8
- package/advisor/run.mjs +24 -13
- package/advisor.mjs +7 -3
- package/agent/chat-call.mjs +14 -9
- package/agent/completion.mjs +28 -40
- package/agent/continue-decision.mjs +14 -8
- package/agent/digest-account.mjs +133 -59
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +2 -1
- package/agent/family-tools.mjs +12 -13
- package/agent/helpers.mjs +17 -72
- package/agent/image-heal.mjs +18 -4
- package/agent/post-turn.mjs +13 -26
- package/agent/record-results.mjs +21 -6
- package/agent/run-stages.mjs +72 -37
- package/agent/run-start.mjs +148 -113
- package/agent/setup-reminders.mjs +187 -91
- package/agent/setup.mjs +204 -138
- package/agent/spawn-child.mjs +2 -2
- package/agent/suspension.mjs +43 -15
- package/agent/timers.mjs +4 -1
- package/agent/turn-domain-text.mjs +105 -0
- package/agent/turn-loop.mjs +54 -22
- package/agent/turn-projection.mjs +127 -227
- package/agent/turn-tool-process.mjs +32 -37
- package/agent-tools/advisor-async.mjs +6 -3
- package/agent-tools/advisor-launch.mjs +5 -5
- package/agent-tools/advisor.mjs +1 -1
- package/agent-tools/async-discard.mjs +7 -2
- package/agent-tools/async-settle.mjs +18 -12
- package/agent-tools/bash-async.mjs +5 -2
- package/agent-tools/batch-closeout.mjs +12 -62
- package/agent-tools/batch-ledger-bind.mjs +19 -8
- package/agent-tools/batch-lifecycle.mjs +37 -11
- package/agent-tools/batch-read.mjs +151 -4
- package/agent-tools/batch-record-write.mjs +5 -5
- package/agent-tools/batch-segment-vocab.mjs +84 -4
- package/agent-tools/batch-skeleton.mjs +18 -14
- package/agent-tools/batch-supersede.mjs +1 -1
- package/agent-tools/batch-tier-gate.mjs +36 -119
- package/agent-tools/batch.mjs +30 -20
- package/agent-tools/browser-async.mjs +5 -2
- package/agent-tools/consult.mjs +10 -7
- package/agent-tools/context.mjs +47 -31
- package/agent-tools/digest-budget.mjs +10 -9
- package/agent-tools/eng.mjs +3 -4
- package/agent-tools/escalate-async.mjs +3 -3
- package/agent-tools/goal.mjs +5 -2
- package/agent-tools/judge-domain.mjs +347 -0
- package/agent-tools/manifest.mjs +2 -2
- package/agent-tools/parent-channel.mjs +6 -3
- package/agent-tools/plan.mjs +11 -10
- package/agent-tools/review-facts.mjs +9 -3
- package/agent-tools/skill.mjs +7 -8
- package/agent-tools/spawn-gates.mjs +5 -16
- package/agent-tools/ssh-session.mjs +6 -3
- package/agent-tools/ssh-transfer.mjs +1 -1
- package/agent-tools/subagent-actions.mjs +2 -2
- package/agent-tools/subagent-async.mjs +11 -8
- package/agent-tools/subagent-scheduler.mjs +9 -9
- package/agent-tools/subagent-spawn.mjs +2 -2
- package/agent-tools/subagent.mjs +5 -18
- package/agent-tools/task.mjs +0 -8
- package/agent.mjs +15 -15
- package/auto-think.mjs +5 -2
- package/compaction-work-state.mjs +230 -0
- package/compress-form.mjs +41 -6
- package/config-defaults.mjs +5 -2
- package/config.mjs +53 -17
- package/context-degrade.mjs +79 -48
- package/context-echo.mjs +6 -26
- package/context-push.mjs +328 -31
- package/context.mjs +203 -141
- package/conventions.mjs +1 -1
- package/declaration.mjs +95 -17
- package/escape.mjs +6 -5
- package/explore-distill.mjs +35 -8
- package/generate-title.mjs +10 -1
- package/knowledge/prompt-resources.md +5 -1
- package/ledger-tools.mjs +50 -50
- package/ledger-write-ops.mjs +43 -16
- package/memory/docs.mjs +51 -15
- package/memory/file-list.mjs +6 -0
- package/model-specs.mjs +87 -21
- package/origin-guard.mjs +190 -0
- package/package.json +1 -1
- package/prompt-files.mjs +33 -11
- package/prompt-overlays.mjs +12 -5
- package/prompts/advisor-design.md +55 -36
- package/prompts/advisor-round1.md +18 -7
- package/prompts/advisor-round2.md +18 -7
- package/prompts/advisor-round3.md +18 -7
- package/prompts/common.md +89 -51
- package/prompts/consult-base.md +2 -3
- package/prompts/discipline-engineering.md +474 -440
- package/prompts/discipline-normal.md +107 -31
- package/prompts/knowledge/business-gates.md +23 -15
- package/prompts/knowledge/decision-quality.md +16 -18
- package/prompts/knowledge/doc-lookup.md +22 -27
- package/prompts/knowledge/document-writing.md +31 -49
- package/prompts/knowledge/documentation-evaluation.md +37 -45
- package/prompts/knowledge/evidence-discipline.md +36 -55
- package/prompts/knowledge/normal-coding-workflow.md +27 -21
- package/prompts/knowledge/normal-delivery-collaboration.md +33 -17
- package/prompts/knowledge/normal-work-management.md +10 -7
- package/prompts/knowledge/product-security.md +22 -17
- package/prompts/knowledge/project-records.md +63 -52
- package/prompts/knowledge/tool-apply-patch.md +12 -13
- package/prompts/knowledge/tool-bash.md +13 -4
- package/prompts/knowledge/tool-batch-eng-coder.md +13 -6
- package/prompts/knowledge/tool-batch-eng-designer.md +14 -6
- package/prompts/knowledge/tool-batch-review.md +12 -6
- package/prompts/knowledge/tool-batch.md +76 -62
- package/prompts/knowledge/tool-browser.md +45 -34
- package/prompts/knowledge/tool-context.md +2 -2
- package/prompts/knowledge/tool-delete.md +5 -1
- package/prompts/knowledge/tool-doc-check.md +25 -24
- package/prompts/knowledge/tool-doc-graph-read.md +3 -3
- package/prompts/knowledge/tool-doc-graph.md +15 -15
- package/prompts/knowledge/tool-edit.md +26 -23
- package/prompts/knowledge/tool-execute.md +9 -4
- package/prompts/knowledge/tool-fetch.md +7 -1
- package/prompts/knowledge/tool-file-ops.md +6 -1
- package/prompts/knowledge/tool-git-read.md +3 -1
- package/prompts/knowledge/tool-git.md +1 -1
- package/prompts/knowledge/tool-glob.md +3 -1
- package/prompts/knowledge/tool-grep.md +5 -2
- package/prompts/knowledge/tool-hashline-edit.md +4 -2
- package/prompts/knowledge/tool-insert-after.md +3 -1
- package/prompts/knowledge/tool-ledger-read.md +6 -13
- package/prompts/knowledge/tool-ledger.md +14 -10
- package/prompts/knowledge/tool-ls.md +2 -0
- package/prompts/knowledge/tool-manifest.md +10 -7
- package/prompts/knowledge/tool-memory.md +15 -11
- package/prompts/knowledge/tool-operations.md +59 -71
- package/prompts/knowledge/tool-plan.md +1 -2
- package/prompts/knowledge/tool-process.md +1 -1
- package/prompts/knowledge/tool-read-history.md +6 -7
- package/prompts/knowledge/tool-read.md +1 -0
- package/prompts/knowledge/tool-settings.md +6 -7
- package/prompts/knowledge/tool-ssh.md +37 -15
- package/prompts/knowledge/tool-subagent.md +37 -39
- package/prompts/knowledge/tool-task.md +3 -1
- package/prompts/knowledge/tool-team-ledger.md +5 -1
- package/prompts/knowledge/tool-tree.md +2 -0
- package/prompts/knowledge/tool-wait-for.md +16 -16
- package/prompts/knowledge/tool-write.md +4 -1
- package/prompts/knowledge/upstream-protocol.md +39 -37
- package/prompts/persona-coder.md +1 -3
- package/prompts/persona-eng-coder.md +5 -5
- package/prompts/persona-eng-designer.md +34 -17
- package/prompts/persona-engineering.md +532 -501
- package/prompts/persona-explore.md +0 -2
- package/prompts/persona-normal.md +17 -9
- package/prompts/persona-plan.md +0 -2
- package/prompts/persona-tester.md +0 -2
- package/prompts/subagent-base.md +0 -2
- package/provider/anthropic.mjs +4 -2
- package/provider/core.mjs +5 -3
- package/provider/errors.mjs +41 -7
- package/provider/google.mjs +5 -3
- package/provider/reasoning-echo.mjs +16 -0
- package/provider/responses.mjs +4 -2
- package/provider/sse.mjs +11 -6
- package/rules.mjs +11 -10
- package/session-lifecycle.mjs +115 -81
- package/session-slot-write.mjs +1 -1
- package/session.mjs +23 -20
- package/shell-identity.mjs +129 -22
- package/skip-dirs.mjs +24 -0
- package/team-ledger.mjs +22 -22
- package/text-budget.mjs +1 -1
- package/think-off.mjs +27 -0
- package/token-ttl.mjs +1 -1
- package/token-window.mjs +278 -88
- package/tool-docs/bash.md +0 -2
- package/tool-docs/consult_start.md +2 -2
- package/tool-docs/consult_stop.md +2 -2
- package/tools/browser.mjs +8 -8
- package/tools/execute.mjs +2 -2
- package/tools/file.mjs +17 -11
- package/tools/git.mjs +12 -12
- package/tools/ops.mjs +2 -2
- package/tools/patch.mjs +1 -1
- package/tools/process-doc-mark.mjs +33 -4
- package/tools/repomap.mjs +25 -3
- package/tools/search.mjs +74 -26
- package/tools/shared.mjs +4 -3
- package/tools/ssh.mjs +5 -5
- package/tools/tree.mjs +32 -10
- package/tools/web-deepseek.mjs +1 -1
- package/tools/web.mjs +2 -2
- package/tools/write-gate-params.mjs +3 -3
- package/window-policy.mjs +118 -78
|
@@ -1,71 +1,62 @@
|
|
|
1
1
|
aliases: 工具纪律, 工具选择, 检索优先级
|
|
2
2
|
## Tool discipline
|
|
3
3
|
### Search tool priority
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
9
14
|
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
**What if you can't find it**: **no usable search tool in the environment** (not configured ∥ no online entry in the tool table) ⇒ say "no search tool in the environment" and mark `unverified`;
|
|
20
|
-
**searchable but no first-hand source** ⇒ switch sources and try once or twice more, still none ⇒ state "checked, no first-hand source" in the conclusion and mark `unverified` — a fabricated source is worse than none, because downstream cannot tell it from a real one.
|
|
21
|
-
**Boundary**: verification = **taking facts**, not **copying an industry checklist** — the criterion is evidence, not "I searched, so I checked". **Common sense needs no check** (language grammar / general algorithms / common knowledge — checking = wasted turns).
|
|
22
|
-
**The online prerequisite** = the environment has a usable search tool (the tool table lists an online entry).
|
|
23
|
-
**A hard-coded tool name points at the wrong place once the tool is renamed or replaced** — which search / fetch tool to use, **take it per the existing priority** (this spot only judges "should this be checked"),
|
|
24
|
-
constrained by network reachability (overseas sites may be unreachable; if needed, translate the Chinese into English first, then search) — getting the facts is what counts; the path follows the environment.
|
|
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.
|
|
25
24
|
|
|
26
25
|
### Codebase exploration order
|
|
27
26
|
repo_outline → doc_search → code_search. Structure → intent → details.
|
|
28
27
|
|
|
29
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.
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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.
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
That is a structural limit across repositories, not a search done carelessly: `grep` answers "nothing here" with only the reach it was given, and that empty answer arrives in the same shape as a checked absence.
|
|
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.
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
**A hit in a process document** is a lead, not a finding. The declared domain leaves process documents out — batch records always stay out of the index, archived pages wherever the project declares them excluded.
|
|
47
|
-
So a hit in an excluded document tells you the search ran outside the domain: a secondary cost next to the blind spot a `grep`-only search has across repositories.
|
|
48
|
-
It records where something was discussed once, while the state lives in the requirement and design documents, and a batch record can be dropped whole.
|
|
49
|
-
Before an answer rests on such a hit, open the state document it points at: the batch record names the change, the state document carries the rule as it stands.
|
|
50
|
-
Answering from the batch line turns a past round's draft into this round's standard.
|
|
51
|
-
|
|
52
|
-
**Documents in other repositories** count once declared. A repository outside `index.publicRepos` adds nothing to the searchable domain, and a `grep` result from the current repo says nothing about it either way.
|
|
53
|
-
**One key, two consequences**: the same declaration that lets a repo be searched is what lets it be cited — a reference into an undeclared repo is not merely un-indexed, it is refused (reported as a missing document, and a delivery gate fails).
|
|
54
|
-
So when a topic may live in a sibling repository and the answer found nothing, the answer carries `cross-repo: not indexed` beside it.
|
|
55
|
-
That records which surface was searched, and keeps an unsearched repository from reading as a settled absence.
|
|
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`.
|
|
56
47
|
|
|
57
48
|
### Parallel call principles
|
|
58
|
-
Batch independent read-only
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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.
|
|
63
54
|
|
|
64
|
-
### Steering your own context
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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.
|
|
69
60
|
|
|
70
61
|
## Tool routing — write-type scenarios route per the table, not bash
|
|
71
62
|
| Tool | Use it for | Not (use the dedicated tool instead) |
|
|
@@ -76,7 +67,7 @@ The same goes for repeatedly checking progress midway: the report arrives on its
|
|
|
76
67
|
| `hashline_edit` | content-hash-addressed edit (position-independent) | `sed` by line number |
|
|
77
68
|
| `insert_after` | insert a block after a known line / regex anchor | `sed` insertion, line-number surgery |
|
|
78
69
|
| `apply_patch` | multi-file unified diff (all-or-nothing) | `git apply` by hand |
|
|
79
|
-
| `delete` | delete
|
|
70
|
+
| `delete` | delete one file, or an empty directory (tracked files need force) | `del`, `rm` |
|
|
80
71
|
| `file_ops` | move / copy / rename files or dirs | `mv`, `cp`, `ren` |
|
|
81
72
|
| `ls` / `glob` / `grep` / `tree` | list dirs / find files by pattern / regex search / directory tree | bash `dir`/`find`/`findstr`/`grep -rn` |
|
|
82
73
|
| `repo_outline` / `code_search` / `doc_search` | module dependency graph / code search / doc search | ad-hoc scripts, grep gymnastics |
|
|
@@ -88,27 +79,24 @@ The same goes for repeatedly checking progress midway: the report arrives on its
|
|
|
88
79
|
| `timer` | set a thinking-budget reminder — non-blocking; a system reminder lands at the deadline | `sleep` hacks / pushing work to later turns |
|
|
89
80
|
| `verify` | pre-completion gate (you declare verification.status; it gates mechanically — it does not run checks) | expecting it to run your tests |
|
|
90
81
|
| `memory` | long-term memory (search/put/list/delete/clear/maintain) | session notes |
|
|
91
|
-
| `fetch` / `websearch` / MCP search | fetch a URL (explicit proxy) / Bing
|
|
82
|
+
| `fetch` / `websearch` / MCP search | fetch a URL (explicit proxy) / search with a provider chain (DeepSeek → Tavily → Bing) / technical lookups primary | `curl` scraping |
|
|
92
83
|
| `checkpoint` | git snapshots / rewind safety | manual branches |
|
|
93
84
|
| `subagent` / `advisor` / `consult_*` | delegation / independent review / consultation | inlining exploration, self-review only, single-model guessing |
|
|
94
85
|
| `question` | ask the user (ambiguity, design decisions) | guessing; routine confirm-gates (those go in your plain reply text) |
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Changing directory *inside* the command (a shell `cd` / `Set-Location`, or any prefix of that kind) does not change the `cwd` the guard sees.
|
|
101
|
-
The same holds for the git tool: it demands an explicit `workdir` when the anchor is ambiguous — **pass it; that friction is the guard working, not an obstacle**.
|
|
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.
|
|
102
91
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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.
|
|
106
95
|
|
|
107
96
|
**Destructive commands — the tool layer catches none of this**:
|
|
108
|
-
- **Deletions go through the tool face**:
|
|
109
|
-
- **Diagnostics are read-only**: existence
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- **
|
|
113
|
-
- **
|
|
114
|
-
- **Boundary**: nothing at the tool layer catches this for you (no mechanical gate, no tool-semantics change) — you write the command, so you are the first line of defense.
|
|
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.
|
|
@@ -2,5 +2,4 @@ aliases: 计划模式, 只读计划
|
|
|
2
2
|
In plan mode you are restricted to READ-ONLY tools: read files, search code, run read-only shell commands.
|
|
3
3
|
Use plan mode before complex multi-step tasks — explore the codebase, design the architecture, present a plan to the user.
|
|
4
4
|
|
|
5
|
-
Exit plan mode to present the plan for the user's approval; implement only after they approve.
|
|
6
|
-
For simple single-file edits, skip plan mode and just make the change.
|
|
5
|
+
Exit plan mode to present the plan for the user's approval; implement only after they approve.
|
|
@@ -8,7 +8,7 @@ Parameters:
|
|
|
8
8
|
- action (optional, default 'list'): list — show running processes; kill — terminate a process tree (target: pid) or a background task (target: id)
|
|
9
9
|
- name: (list) substring filter (case-insensitive), e.g. "node", "python"
|
|
10
10
|
- pid: (kill) process id — the whole tree is terminated (taskkill /T /F on win32; POSIX group kill)
|
|
11
|
-
- id: (kill) background task id — a `bash#N`
|
|
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).
|
|
12
12
|
|
|
13
13
|
Notes:
|
|
14
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.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
aliases: 历史, 会话历史, 回看
|
|
2
2
|
Recall what was said or done earlier: design decisions, tool-call timing, past rulings.
|
|
3
3
|
|
|
4
|
-
Default (no `path`): this session's full record
|
|
4
|
+
Default (no `path`): this session's full record — never compacted, audit-complete.
|
|
5
5
|
|
|
6
|
-
Sub-agent face: eng-coder / eng-designer children get a bounded form
|
|
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
7
|
|
|
8
8
|
Everything else (explore / plan / coder / tester / consult) carries no history tool: the facts it needs ride the task book's `knownFacts`.
|
|
9
9
|
|
|
10
|
-
Filters combine with AND (`role` / `keyword` / `tool` / `since`-`until` / `limit` / `direction`
|
|
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
11
|
|
|
12
12
|
Returns a JSON array in chronological order:
|
|
13
13
|
|
|
@@ -15,14 +15,13 @@ Returns a JSON array in chronological order:
|
|
|
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 -
|
|
19
|
-
`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 if you need more.
|
|
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.
|
|
20
19
|
|
|
21
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`.
|
|
22
21
|
|
|
23
22
|
`cwd:<dir>` lists that directory's session slots (slot + file path + title + count + updatedAt; copy one into `path` to deep-query it).
|
|
24
23
|
|
|
25
|
-
`all` searches every INDEXED session (cross-project;
|
|
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`.
|
|
26
25
|
|
|
27
26
|
Which tool for which question:
|
|
28
27
|
- what was said or ruled in THIS session → `read_history` (default).
|
|
@@ -33,4 +32,4 @@ Which tool for which question:
|
|
|
33
32
|
- the code as implemented → `code_search`.
|
|
34
33
|
- a git snapshot → `checkpoint cat` / `versions`.
|
|
35
34
|
|
|
36
|
-
`read_history`
|
|
35
|
+
`read_history` reads session messages only; file-level changes belong to `recent_changes`, knowledge and conventions to `memory` — none substitutes for another.
|
|
@@ -18,4 +18,5 @@ Parameters:
|
|
|
18
18
|
Notes:
|
|
19
19
|
- Always prefer this over `cat` or shell-based reading - it caps output and avoids large dumps.
|
|
20
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.
|
|
21
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.
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
aliases: 配置, 设置, 改配置
|
|
2
|
-
Actions: `list` (all keys and values, flattened) | `get <key>` | `set <key> <value>`
|
|
2
|
+
Actions: `list` (all keys and values, flattened) | `get <key>` | `set <key> <value>` — dot paths into config.json, at any nesting.
|
|
3
3
|
|
|
4
|
-
`set` persists to disk (only the key you set is written
|
|
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
5
|
|
|
6
|
-
`list` / `get` are read-only (fine in planMode, no approval); `set` is a side effect
|
|
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
7
|
|
|
8
8
|
Known keys are type-checked, so a value the app would silently drop is refused:
|
|
9
|
-
|
|
10
9
|
- scalar keys against their built-in default (`agent.maxTurns` a number, `traces.enabled` a boolean);
|
|
11
|
-
- `agent.mode` accepts exactly `tiny`, `normal` or `engineering
|
|
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;
|
|
12
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).
|
|
13
12
|
|
|
14
|
-
`null` clears a key: the entry
|
|
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.
|
|
15
14
|
|
|
16
|
-
SENSITIVE keys are NEVER echoed in plaintext: list / get / set replies show `••••(masked
|
|
15
|
+
SENSITIVE keys are NEVER echoed in plaintext: list / get / set replies show `••••(masked)`; setting one is allowed and stored.
|
|
17
16
|
|
|
18
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.
|
|
@@ -1,52 +1,74 @@
|
|
|
1
1
|
aliases: 远程, 网络设备, 登录
|
|
2
|
-
A session survives across tool calls. Password hosts get a credential window — the value never appears in tool args or results.
|
|
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
3
|
|
|
4
4
|
**Route to ssh instead of bash:**
|
|
5
|
-
- a one-shot non-interactive command over ssh → `bash` with `ssh host <command>` (cheaper, no session)
|
|
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
6
|
- an interactive shell that must survive several calls (network device CLI, interactive prompts) → ssh
|
|
7
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
8
|
- a whole directory tree, a resumable transfer or a progress bar → not this tool (single file only)
|
|
9
9
|
- port forwarding (`ssh -L` / `-R`) → `bash`
|
|
10
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
|
+
|
|
11
32
|
Parameters:
|
|
12
33
|
- action (required): connect | send | read | secret_input | close | list | credentials | forget | put | get
|
|
13
34
|
- host: connect / forget — target host (IP or name)
|
|
14
35
|
- user: connect — login user (optional: your local ssh config decides, else the user recorded for this host locally)
|
|
15
36
|
- port: connect / forget — TCP port (optional, default 22)
|
|
16
37
|
- label: connect — short human label for this session (optional); secret_input — label for the value being sent
|
|
17
|
-
- promptPattern: connect — regex
|
|
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.
|
|
18
39
|
- identityFile: connect — private-key path to offer as `-i` (`~` expands); remembered for this host and reused when omitted (optional)
|
|
19
40
|
- id: send / read / secret_input / close / put / get — session id from connect (`ssh#N`)
|
|
20
41
|
- data: send — text to type into the session (a trailing newline is passed as-is; otherwise Enter is sent as `\r`)
|
|
21
42
|
- settle: send — wait for the ready verdict before returning (default true); false returns right after the bytes are written
|
|
22
|
-
- timeoutMs: send / read — wait budget override (default 60000; the wait ends as soon as the device
|
|
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)
|
|
23
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
|
|
24
45
|
- localPath: put / get — local file path (`~` expands; a file, never a directory)
|
|
25
46
|
- remotePath: put / get — path of that file on the session host (e.g. `/flash/img.bin`)
|
|
26
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
|
|
27
|
-
- protocol: put / get — `scp` (classic SCP protocol, the default, what network devices speak) | `sftp` (for hosts that only offer that).
|
|
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.
|
|
28
50
|
|
|
29
51
|
Output:
|
|
30
|
-
- connect / send / read / secret_input / close / list / put / get
|
|
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]`
|
|
31
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
|
|
32
|
-
- put / get return the status line, then exactly one more line — `put <localPath> → <remotePath> · N bytes · exit 0` (
|
|
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.
|
|
33
55
|
|
|
34
56
|
Notes:
|
|
35
|
-
- Key-first: keys, your ssh config and ssh-agent are always tried before any saved credential
|
|
36
|
-
- Credential discipline: the password is asked for in a window and reaches ssh only through its child-process environment —
|
|
37
|
-
- 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
|
|
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.
|
|
38
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.
|
|
39
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.
|
|
40
|
-
- 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
|
|
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.
|
|
41
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.
|
|
42
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.
|
|
43
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`).
|
|
44
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.
|
|
45
|
-
- `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
|
|
46
|
-
-
|
|
47
|
-
- Ready means the device
|
|
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.
|
|
48
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.
|
|
49
|
-
- 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`)
|
|
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.
|
|
50
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.
|
|
51
73
|
|
|
52
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.
|
|
@@ -1,59 +1,57 @@
|
|
|
1
1
|
aliases: 子代理, 派单, 派活
|
|
2
2
|
ONE tool, NINE actions — pick by what you need:
|
|
3
3
|
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
Available roles (exposed per mode;
|
|
15
|
-
- explore — read-only search
|
|
16
|
-
- plan — read-only planning;
|
|
17
|
-
- coder — full implementation
|
|
18
|
-
- eng-coder — engineering mode only (replaces coder): the same toolset plus the design-driven
|
|
19
|
-
- eng-designer — engineering mode only: the SOLE author of
|
|
20
|
-
- tester —
|
|
21
|
-
|
|
22
|
-
Task book
|
|
23
|
-
- goal — the goal
|
|
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
24
|
- knownFacts — the facts you already verified.
|
|
25
25
|
- acceptance — machine-verifiable criteria.
|
|
26
26
|
- reportFormat — the delivery-report format.
|
|
27
|
-
- scope —
|
|
27
|
+
- scope — what to read, and what not to touch.
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Engineering roles (eng-coder / eng-designer) take their task book from the batch record, and the part that is their task book differs by seat — no other task text is passed to either:
|
|
32
|
-
- 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, and §2 is its own pen.
|
|
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.
|
|
33
31
|
- round — initial | fix.
|
|
34
|
-
- files / dependsOn —
|
|
35
|
-
- An eng-coder spawn also carries designToken
|
|
32
|
+
- files / dependsOn — scheduling.
|
|
33
|
+
- An eng-coder spawn also carries designToken and, when several designs are open, designId.
|
|
36
34
|
|
|
37
|
-
A record carries one concurrent spawn
|
|
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.
|
|
38
36
|
|
|
39
|
-
Pass one parameter per field — contents only
|
|
37
|
+
Pass one parameter per field — contents only, the runtime adds the labels:
|
|
40
38
|
subagent(role="eng-coder", round="initial", batchDoc="<batch record>", designToken="…", files=[…], async=true)
|
|
41
39
|
subagent(role="explore", goal="…", knownFacts="…", scope="…", acceptance="…", reportFormat="…", async=true)
|
|
42
40
|
|
|
43
|
-
Mode filtering: normal mode exposes explore/plan/
|
|
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).
|
|
44
42
|
|
|
45
43
|
Async spawn:
|
|
46
|
-
- 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
|
|
47
|
-
-
|
|
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).
|
|
48
46
|
|
|
49
|
-
Pool: async spawns
|
|
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.
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
- 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
|
|
53
|
-
- A cancelled
|
|
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.
|
|
54
52
|
- Omit both for a plain immediate spawn.
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
The child starts with zero context, so brief it like a colleague who just walked in.
|
|
57
55
|
- Put exact paths and commands in — do not make it search for what you already know.
|
|
58
|
-
- Do not delegate understanding: resolve the paths and
|
|
59
|
-
- Once it runs, leave that scope to it —
|
|
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.
|
|
@@ -7,6 +7,8 @@ Statuses: pending | in_progress | done - synonyms (completed/finished/complete,
|
|
|
7
7
|
- Mark items done as you complete them; never mark done while tests fail or the work is partial.
|
|
8
8
|
- title is required and must be non-empty: an item whose title is empty is dropped, and the receipt names it.
|
|
9
9
|
|
|
10
|
-
|
|
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`.
|
|
11
13
|
|
|
12
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.
|
|
@@ -6,6 +6,10 @@ It is a separate book from the local `ledger` - two independent accounts, no syn
|
|
|
6
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
7
|
- `count`: the same filters as `query`, and returns the total.
|
|
8
8
|
- `add`: `title` required (non-blank, ≤200), `detail` (≤4000), `owner` (default = yourself). A new entry always lands in `待讨论`.
|
|
9
|
-
- `update`: `id` required;
|
|
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.
|
|
10
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.
|
|
11
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.
|
|
@@ -7,8 +7,10 @@ Use it to see quickly which modules exist and where files live. Skips dotfiles,
|
|
|
7
7
|
Parameters:
|
|
8
8
|
- path: Root directory (default cwd)
|
|
9
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
|
|
10
11
|
|
|
11
12
|
Notes:
|
|
12
13
|
- Returns the tree as text: directories first (each ending with `/`), files after, both sorted, capped at 200 entries.
|
|
13
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.
|
|
14
16
|
- Use depth for a shallow overview; use `ls` for one directory, `glob` for a specific file pattern.
|