@gavin-hu/my-pi-agent 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/README.md +46 -30
  2. package/README.zh-CN.md +40 -25
  3. package/assets/screens/board.png +0 -0
  4. package/assets/screens/chrome.png +0 -0
  5. package/assets/screens/file-browse.png +0 -0
  6. package/assets/screens/plan-review.png +0 -0
  7. package/assets/screens/plan.png +0 -0
  8. package/docs/extensions/README.md +22 -23
  9. package/docs/extensions/board.md +397 -168
  10. package/docs/extensions/bytefly.md +234 -197
  11. package/docs/extensions/check.md +15 -17
  12. package/docs/extensions/context.md +35 -15
  13. package/docs/extensions/file-browse.md +57 -63
  14. package/docs/extensions/file-open.md +9 -11
  15. package/docs/extensions/file-read.md +12 -14
  16. package/docs/extensions/goal.md +15 -17
  17. package/docs/extensions/job.md +54 -42
  18. package/docs/extensions/memory.md +17 -19
  19. package/docs/extensions/plan.md +197 -140
  20. package/docs/extensions/question.md +16 -18
  21. package/docs/extensions/rewind.md +17 -19
  22. package/docs/extensions/serve.md +145 -0
  23. package/docs/extensions/session-bus.md +38 -16
  24. package/docs/extensions/subagent.md +23 -25
  25. package/docs/extensions/team.md +83 -44
  26. package/docs/extensions/todo.md +18 -18
  27. package/docs/extensions/watch.md +31 -31
  28. package/docs/extensions/web-access.md +2 -4
  29. package/docs/extensions/wechat.md +34 -35
  30. package/docs/extensions/worktree.md +56 -50
  31. package/extensions/board/commands.ts +79 -25
  32. package/extensions/board/format.ts +43 -24
  33. package/extensions/board/index.ts +17 -4
  34. package/extensions/board/input.ts +4 -9
  35. package/extensions/board/join.ts +5 -20
  36. package/extensions/board/lazy-page.ts +40 -0
  37. package/extensions/board/page.ts +65 -93
  38. package/extensions/board/result.ts +30 -39
  39. package/extensions/board/rows.ts +62 -25
  40. package/extensions/board/schema.ts +49 -11
  41. package/extensions/board/snapshot.ts +8 -6
  42. package/extensions/board/tone.ts +22 -0
  43. package/extensions/board/tools.ts +154 -55
  44. package/extensions/board/transport/router.ts +3 -5
  45. package/extensions/board/transport/server.ts +59 -28
  46. package/extensions/board/types.ts +36 -42
  47. package/extensions/board/view/card.ts +229 -0
  48. package/extensions/board/view/client.ts +35 -16
  49. package/extensions/board/view/dialog.ts +169 -6
  50. package/extensions/board/view/empty.ts +47 -0
  51. package/extensions/board/view/keys.ts +13 -2
  52. package/extensions/board/view/live.ts +90 -28
  53. package/extensions/board/view/names.ts +13 -4
  54. package/extensions/board/view/page.ts +38 -13
  55. package/extensions/board/view/render.ts +219 -277
  56. package/extensions/board/view/styles.ts +130 -32
  57. package/extensions/board/view/team.ts +297 -76
  58. package/extensions/bytefly/block/fallback.ts +1 -1
  59. package/extensions/bytefly/doctor/runtime.ts +5 -2
  60. package/extensions/bytefly/footer/collect/label.ts +60 -0
  61. package/extensions/bytefly/footer/collect/snapshot.ts +8 -1
  62. package/extensions/bytefly/footer/config.ts +7 -8
  63. package/extensions/bytefly/footer/register.ts +33 -4
  64. package/extensions/bytefly/footer/render/footer.ts +18 -4
  65. package/extensions/bytefly/footer/render/key.ts +46 -0
  66. package/extensions/bytefly/footer/render/layout.ts +13 -3
  67. package/extensions/bytefly/footer/render/lines.ts +10 -7
  68. package/extensions/bytefly/footer/render/segments.ts +41 -38
  69. package/extensions/bytefly/footer/render/status.ts +0 -11
  70. package/extensions/bytefly/footer/types.ts +7 -0
  71. package/extensions/bytefly/header/component.ts +4 -20
  72. package/extensions/bytefly/header/config.ts +1 -1
  73. package/extensions/bytefly/index.ts +32 -6
  74. package/extensions/bytefly/mode/editor.ts +115 -0
  75. package/extensions/bytefly/panel/commands.ts +210 -120
  76. package/extensions/bytefly/panel/format.ts +4 -4
  77. package/extensions/bytefly/panel/settings.ts +73 -6
  78. package/extensions/bytefly/panel/tui/keys.ts +2 -6
  79. package/extensions/bytefly/update/cache.ts +1 -1
  80. package/extensions/bytefly/update/register.ts +4 -4
  81. package/extensions/bytefly/working/config.ts +5 -7
  82. package/extensions/bytefly/working/format.ts +10 -13
  83. package/extensions/bytefly/working/register.ts +22 -27
  84. package/extensions/check/commands.ts +3 -2
  85. package/extensions/check/render.ts +10 -1
  86. package/extensions/check/{tui.ts → view/check-screens.ts} +14 -19
  87. package/extensions/context/commands.ts +2 -2
  88. package/extensions/context/{tui.ts → view/context-report.ts} +51 -19
  89. package/extensions/file-browse/config/config.ts +4 -19
  90. package/extensions/file-browse/index.ts +89 -79
  91. package/extensions/file-browse/live/live.ts +1 -1
  92. package/extensions/file-browse/transport/router.ts +12 -4
  93. package/extensions/file-browse/transport/server.ts +61 -28
  94. package/extensions/file-browse/view/chrome.ts +4 -4
  95. package/extensions/file-browse/view/client.ts +3 -1
  96. package/extensions/file-browse/view/html.ts +73 -40
  97. package/extensions/file-browse/view/live-client.ts +2 -2
  98. package/extensions/file-browse/view/markdown.ts +13 -14
  99. package/extensions/file-browse/view/palette.ts +2 -2
  100. package/extensions/file-browse/view/raw-html.ts +9 -9
  101. package/extensions/file-browse/view/tree.ts +1 -1
  102. package/extensions/file-browse/view/urls.ts +20 -6
  103. package/extensions/file-read/render.ts +4 -4
  104. package/extensions/goal/plan-route.ts +2 -2
  105. package/extensions/goal/tui.ts +12 -2
  106. package/extensions/job/child.ts +527 -0
  107. package/extensions/job/clock.ts +142 -0
  108. package/extensions/job/commands.ts +4 -2
  109. package/extensions/job/config.ts +8 -1
  110. package/extensions/job/format.ts +22 -1
  111. package/extensions/job/log-writer.ts +13 -2
  112. package/extensions/job/registry.ts +63 -7
  113. package/extensions/job/render.ts +34 -0
  114. package/extensions/job/runtime.ts +296 -655
  115. package/extensions/job/session.ts +132 -19
  116. package/extensions/job/store.ts +7 -7
  117. package/extensions/job/tools.ts +21 -9
  118. package/extensions/job/types.ts +47 -0
  119. package/extensions/job/{tui.ts → view/jobs-screen.ts} +19 -99
  120. package/extensions/job/waiters.ts +44 -1
  121. package/extensions/memory/commands.ts +4 -2
  122. package/extensions/memory/{tui.ts → view/memory-picker.ts} +12 -12
  123. package/extensions/plan/commands.ts +12 -9
  124. package/extensions/plan/feedback.ts +62 -16
  125. package/extensions/plan/format.ts +8 -2
  126. package/extensions/plan/git-bash.ts +115 -16
  127. package/extensions/plan/index.ts +58 -51
  128. package/extensions/plan/plan-index.ts +4 -2
  129. package/extensions/plan/plan-text.ts +114 -0
  130. package/extensions/plan/plans.ts +5 -54
  131. package/extensions/plan/policy.ts +8 -10
  132. package/extensions/plan/review-lazy.ts +85 -0
  133. package/extensions/plan/review.ts +2 -2
  134. package/extensions/plan/runtime.ts +61 -41
  135. package/extensions/plan/sections.ts +1 -1
  136. package/extensions/plan/steps.ts +3 -3
  137. package/extensions/plan/todos.ts +1 -1
  138. package/extensions/plan/tools/cancel.ts +27 -62
  139. package/extensions/plan/tools/enter.ts +55 -81
  140. package/extensions/plan/tools/exit.ts +221 -238
  141. package/extensions/plan/tools/refusal.ts +18 -0
  142. package/extensions/plan/tools/steps.ts +75 -92
  143. package/extensions/plan/tools/write.ts +77 -120
  144. package/extensions/plan/tools.ts +188 -30
  145. package/extensions/plan/tui.ts +5 -5
  146. package/extensions/plan/types.ts +48 -5
  147. package/extensions/plan/web-blocks.ts +76 -5
  148. package/extensions/plan/web-chrome.ts +4 -0
  149. package/extensions/plan/web-client.ts +102 -2
  150. package/extensions/plan/web-collab.ts +4 -4
  151. package/extensions/plan/web-comments.ts +39 -8
  152. package/extensions/plan/web-composer.ts +14 -3
  153. package/extensions/plan/web-keys.ts +149 -25
  154. package/extensions/plan/web-lazy.ts +53 -0
  155. package/extensions/plan/web-markdown.ts +10 -68
  156. package/extensions/plan/web-outline.ts +22 -2
  157. package/extensions/plan/web-page.ts +56 -86
  158. package/extensions/plan/web-payload.ts +188 -0
  159. package/extensions/plan/web-plan.ts +23 -13
  160. package/extensions/plan/web-router.ts +18 -9
  161. package/extensions/plan/web-settle.ts +14 -7
  162. package/extensions/plan/web-share-session.ts +24 -55
  163. package/extensions/plan/web-share.ts +19 -37
  164. package/extensions/plan/web-write.ts +112 -0
  165. package/extensions/plan/web.ts +67 -131
  166. package/extensions/question/tools.ts +6 -2
  167. package/extensions/question/{tui.ts → view/question-screen.ts} +11 -11
  168. package/extensions/rewind/commands/commands.ts +6 -3
  169. package/extensions/rewind/state/runtime.ts +1 -1
  170. package/extensions/rewind/{view/status.ts → status.ts} +4 -4
  171. package/extensions/rewind/view/review-tui.ts +4 -4
  172. package/extensions/serve/config.ts +39 -0
  173. package/extensions/serve/index.ts +85 -0
  174. package/extensions/serve/registry.ts +260 -0
  175. package/extensions/session-bus/commands.ts +11 -6
  176. package/extensions/session-bus/join-request.ts +17 -9
  177. package/extensions/session-bus/mail-watch.ts +26 -17
  178. package/extensions/session-bus/protocol.ts +15 -3
  179. package/extensions/session-bus/resolve.ts +5 -7
  180. package/extensions/session-bus/result.ts +1 -27
  181. package/extensions/session-bus/runtime.ts +40 -12
  182. package/extensions/session-bus/store.ts +101 -19
  183. package/extensions/session-bus/tools.ts +5 -4
  184. package/extensions/session-bus/types.ts +19 -0
  185. package/extensions/session-bus/{tui.ts → view/session-list.ts} +16 -16
  186. package/extensions/subagent/agents.ts +1 -1
  187. package/extensions/subagent/commands.ts +4 -2
  188. package/extensions/subagent/format.ts +15 -15
  189. package/extensions/subagent/index.ts +1 -1
  190. package/extensions/subagent/render.ts +3 -3
  191. package/extensions/subagent/{background-tui.ts → view/agents-board.ts} +11 -11
  192. package/extensions/team/commands.ts +24 -5
  193. package/extensions/team/dispatch.ts +18 -4
  194. package/extensions/team/format.ts +17 -2
  195. package/extensions/team/index.ts +9 -8
  196. package/extensions/team/schema.ts +6 -5
  197. package/extensions/team/tools.ts +107 -45
  198. package/extensions/team/types.ts +3 -2
  199. package/extensions/todo/commands.ts +4 -2
  200. package/extensions/todo/format.ts +11 -0
  201. package/extensions/todo/render.ts +57 -0
  202. package/extensions/todo/runtime.ts +1 -1
  203. package/extensions/todo/tools.ts +1 -1
  204. package/extensions/todo/{tui.ts → view/todo-screen.ts} +18 -90
  205. package/extensions/todo/widget.ts +47 -0
  206. package/extensions/watch/commands.ts +4 -2
  207. package/extensions/watch/format.ts +36 -7
  208. package/extensions/watch/render.ts +57 -0
  209. package/extensions/watch/runtime.ts +27 -22
  210. package/extensions/watch/tools.ts +4 -4
  211. package/extensions/watch/{tui.ts → view/watch-screen.ts} +18 -80
  212. package/extensions/web-access/fetch/tool.ts +12 -4
  213. package/extensions/wechat/commands/commands.ts +18 -14
  214. package/extensions/wechat/index.ts +72 -37
  215. package/extensions/wechat/state/credentials.ts +1 -1
  216. package/extensions/wechat/state/state.ts +1 -1
  217. package/extensions/wechat/text/status.ts +112 -0
  218. package/extensions/wechat/types.ts +2 -2
  219. package/extensions/wechat/view/status-screen.ts +4 -103
  220. package/extensions/worktree/commands.ts +11 -9
  221. package/extensions/worktree/enter.ts +2 -2
  222. package/extensions/worktree/exit.ts +2 -2
  223. package/extensions/worktree/index.ts +5 -5
  224. package/extensions/worktree/screen.ts +3 -3
  225. package/extensions/worktree/status.ts +2 -2
  226. package/extensions/worktree/tools.ts +113 -116
  227. package/lib/README.md +28 -13
  228. package/lib/board/actions.ts +111 -0
  229. package/lib/board/artifact.ts +149 -0
  230. package/lib/board/card.ts +163 -52
  231. package/lib/board/config.ts +58 -0
  232. package/lib/board/contract.ts +113 -0
  233. package/lib/board/join.ts +38 -0
  234. package/lib/board/lanes.ts +182 -0
  235. package/lib/board/lead.ts +130 -0
  236. package/lib/board/limits.ts +78 -0
  237. package/lib/board/links.ts +31 -10
  238. package/lib/board/page-pointer.ts +30 -5
  239. package/lib/board/read.ts +83 -0
  240. package/lib/board/reason.ts +102 -0
  241. package/lib/board/round-text.ts +68 -6
  242. package/lib/board/round.ts +31 -15
  243. package/lib/board/rules.ts +151 -307
  244. package/lib/board/seat.ts +35 -0
  245. package/lib/board/session.ts +199 -51
  246. package/lib/board/skipped.ts +22 -0
  247. package/lib/board/steps.ts +487 -0
  248. package/lib/board/store.ts +119 -36
  249. package/lib/board/tone.ts +92 -0
  250. package/lib/board/view.ts +81 -63
  251. package/lib/bus-request.ts +83 -0
  252. package/{extensions/watch → lib}/child.ts +40 -21
  253. package/lib/env.ts +65 -7
  254. package/lib/format.ts +13 -0
  255. package/lib/http/index.ts +17 -11
  256. package/lib/http/mount.ts +142 -0
  257. package/lib/http/port.ts +30 -0
  258. package/lib/http/serve.ts +170 -46
  259. package/lib/http/server.ts +3 -3
  260. package/lib/lazy.ts +45 -0
  261. package/lib/plan-entry.ts +46 -21
  262. package/lib/plans/paths.ts +82 -0
  263. package/lib/policy.ts +9 -6
  264. package/lib/report.ts +3 -2
  265. package/lib/requirements.ts +10 -10
  266. package/lib/session-label.ts +129 -7
  267. package/lib/session-roster.ts +43 -1
  268. package/lib/session-tool.ts +39 -22
  269. package/lib/stray-fields.ts +7 -2
  270. package/lib/tool-names.ts +5 -10
  271. package/lib/tui/README.md +29 -11
  272. package/lib/tui/chrome.ts +16 -15
  273. package/lib/tui/cursor.ts +18 -3
  274. package/lib/tui/glyphs.ts +11 -11
  275. package/lib/tui/render-cache.ts +29 -0
  276. package/lib/tui/tokens.ts +33 -2
  277. package/lib/tui/tool.ts +33 -4
  278. package/lib/web/README.md +21 -0
  279. package/lib/web/client-runtime.ts +27 -1
  280. package/lib/web/components.ts +5 -1
  281. package/lib/web/index.ts +1 -0
  282. package/lib/web/markdown.ts +83 -0
  283. package/lib/web/markup.ts +20 -2
  284. package/lib/web/runtime.ts +9 -10
  285. package/package.json +8 -2
  286. package/skills/init/SKILL.md +5 -5
  287. package/skills/next/SKILL.md +3 -5
  288. package/extensions/board/config.ts +0 -36
  289. package/extensions/board/seat.ts +0 -28
  290. package/lib/tui/index.ts +0 -34
  291. package/skills/project-docs/SKILL.md +0 -133
  292. package/skills/project-docs/references/audit.md +0 -131
  293. package/skills/project-docs/references/changelog.md +0 -105
  294. package/skills/project-docs/references/discovery.md +0 -127
  295. package/skills/project-docs/references/readme.md +0 -80
  296. package/skills/project-docs/references/release.md +0 -84
  297. package/skills/project-docs/references/roadmap.md +0 -93
  298. package/skills/project-docs/scripts/state.ts +0 -316
@@ -8,22 +8,20 @@ framework, or CI system.
8
8
 
9
9
  ## Capabilities
10
10
 
11
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
12
-
13
- | Capability | How | What you get | Status |
14
- |---|---|---|---|
15
- | Plan-mode refusal | `/check`, the read-only policy | Plan mode refuses a check because tests still write caches, snapshots, or generated files; approve the plan first. | Shipped |
16
- | Single active run | `run_check`, `/check` | A second run is refused with the corrective action while one process is active, instead of starting a parallel check. | Shipped |
17
- | Supervised run | `/check`, `run_check` | One process per command, with a wall-clock timeout, a bounded log, and `Esc` to cancel the process tree. | Shipped |
18
- | Command detection | a project manifest, `check.command` | The project's test, lint, and typecheck commands are found without configuration, with a shell command override. | Shipped |
19
- | Target selection | `/check` with a target, `run_check.target` | Run `test`, `lint`, `typecheck`, or `all`; `all` is the default. | Shipped |
20
- | Structured failures | `run_check` | The model gets `path`, `line`, `column`, `test`, `message`, and `command` instead of a wall of log text. | Shipped |
21
- | Failure list | `/check` | A navigable list with a detail view for the focused failure, drawn from a source excerpt or the bounded tail. | Shipped |
22
- | Rerun from the list | `r` in the failure list | Rerun the same check after reading a failure; `Enter` opens its detail and `Esc` closes. | Shipped |
23
- | Live run screen | `/check` | A scrolling tail that repaints while the command runs, so a silent compiler still shows progress. | Shipped |
24
- | Capped transcript | `run_check` | One status summary and at most five failure rows, expanded with `ctrl+o` to the model's 20-failure cap. | Shipped |
25
- | Headless report | `/check`, `run_check` | RPC, JSON, and print sessions post the summary plus the failure list, with no screen. | Shipped |
26
- | Honest fallback | `/check`, `run_check` | An unparsed failure names the exit status and the last output lines, never an invented location. | Shipped |
11
+ | Capability | How | What you get |
12
+ |---|---|---|
13
+ | Plan-mode refusal | `/check`, the read-only policy | Plan mode refuses a check because tests still write caches, snapshots, or generated files; approve the plan first. |
14
+ | Single active run | `run_check`, `/check` | A second run is refused with the corrective action while one process is active, instead of starting a parallel check. |
15
+ | Supervised run | `/check`, `run_check` | One process per command, with a wall-clock timeout, a bounded log, and `Esc` to cancel the process tree. |
16
+ | Command detection | a project manifest, `check.command` | The project's test, lint, and typecheck commands are found without configuration, with a shell command override. |
17
+ | Target selection | `/check` with a target, `run_check.target` | Run `test`, `lint`, `typecheck`, or `all`; `all` is the default. |
18
+ | Structured failures | `run_check` | The model gets `path`, `line`, `column`, `test`, `message`, and `command` instead of a wall of log text. |
19
+ | Failure list | `/check` | A navigable list with a detail view for the focused failure, drawn from a source excerpt or the bounded tail. |
20
+ | Rerun from the list | `r` in the failure list | Rerun the same check after reading a failure; `Enter` opens its detail and `Esc` closes. |
21
+ | Live run screen | `/check` | A scrolling tail that repaints while the command runs, so a silent compiler still shows progress. |
22
+ | Capped transcript | `run_check` | One status summary and at most five failure rows, expanded with `ctrl+o` to the model's 20-failure cap. |
23
+ | Headless report | `/check`, `run_check` | RPC, JSON, and print sessions post the summary plus the failure list, with no screen. |
24
+ | Honest fallback | `/check`, `run_check` | An unparsed failure names the exit status and the last output lines, never an invented location. |
27
25
 
28
26
  ## Quickstart
29
27
 
@@ -252,7 +250,7 @@ never turned into an invented location.
252
250
  | `source.ts` | Guarded source excerpt around a failure's `path:line`. |
253
251
  | `runtime.ts` | Planning, sequencing, aggregation, live lines, cancel/shutdown. |
254
252
  | `format.ts` | Summary, failure rows, source-excerpt/detail text, model report. |
255
- | `tui.ts` | `CheckRunComponent` (a live tail) and `CheckResultComponent` (a `DockListScreen` over the failures). |
253
+ | `view/check-screens.ts` | `CheckRunComponent` (a live tail) and `CheckResultComponent` (a `DockListScreen` over the failures), loaded on first use. |
256
254
  | `tools.ts` | `run_check` schema, registration, the running partial result, and the call/result renderers. |
257
255
  | `render.ts` | The transcript result block: status summary, capped failure rows, tail fallback. |
258
256
  | `commands.ts` | `/check`, target parsing, completions, TUI/headless flow. |
@@ -7,20 +7,18 @@ untouched.
7
7
 
8
8
  ## Capabilities
9
9
 
10
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
11
-
12
- | Capability | How | What you get | Status |
13
- |---|---|---|---|
14
- | Window headline | `/context` | Pi's own estimate: tokens, window, percentage, free space, and the auto-compaction threshold with the headroom left before it. | Shipped |
15
- | Composition breakdown | `/context` | Where the window went — system prompt, active tool definitions, the conversation by role, injected pack context, summaries, and shell output. | Shipped |
16
- | Guarded compaction | `/context compact [instructions]`, `c` on the screen | Compact from the report without interrupting a streaming turn or a running compaction. | Shipped |
17
- | Compact result | `/context compact` result | The before and after token counts are reported, so the effect of the compaction is visible. | Shipped |
18
- | Honest drift | `/context` | The difference between Pi's total and the composition estimate, named instead of hidden by forcing the parts to add up. | Shipped |
19
- | Compaction history | `/context` | How many compactions the branch has, what the newest one cut from and to, and what its summary costs. | Shipped |
20
- | Largest messages | `/context` | The five largest single messages, so a report that is mostly one tool result says so. | Shipped |
21
- | Gauge rendering | the `/context` screen | The window and composition bars show ten or eight cells, colored by role, instead of leaving the reader to infer the shape. | Shipped |
22
- | Pending total | `/context` after a compaction | The report shows a pending total instead of a fabricated estimate while Pi recalculates the window. | Shipped |
23
- | Mode coverage | `/context` | A scrollable screen in the TUI, the same facts as plain text in `rpc`, `json`, and `print`. | Shipped |
10
+ | Capability | How | What you get |
11
+ |---|---|---|
12
+ | Window headline | `/context` | Pi's own estimate: tokens, window, percentage, free space, and the auto-compaction threshold with the headroom left before it. |
13
+ | Composition breakdown | `/context` | Where the window went — system prompt, active tool definitions, the conversation by role, injected pack context, summaries, and shell output. |
14
+ | Guarded compaction | `/context compact [instructions]`, `c` on the screen | Compact from the report without interrupting a streaming turn or a running compaction. |
15
+ | Compact result | `/context compact` result | The before and after token counts are reported, so the effect of the compaction is visible. |
16
+ | Honest drift | `/context` | The difference between Pi's total and the composition estimate, named instead of hidden by forcing the parts to add up. |
17
+ | Compaction history | `/context` | How many compactions the branch has, what the newest one cut from and to, and what its summary costs. |
18
+ | Largest messages | `/context` | The five largest single messages, so a report that is mostly one tool result says so. |
19
+ | Gauge rendering | the `/context` screen | The window and composition bars show ten or eight cells, colored by the row's category — the same hue in the composition table and in the largest-message list — instead of leaving the reader to infer the shape. |
20
+ | Pending total | `/context` after a compaction | The report shows a pending total instead of a fabricated estimate while Pi recalculates the window. |
21
+ | Mode coverage | `/context` | A scrollable screen in the TUI, the same facts as plain text in `rpc`, `json`, and `print`. |
24
22
 
25
23
  ## Quickstart
26
24
 
@@ -83,6 +81,28 @@ first reply, when Pi's fallback leaves the prompt and the tools out. Each bar
83
81
  rounds to the nearest cell, so a bar sits within half a cell of the percentage
84
82
  printed beside it; the percentage itself is exact.
85
83
 
84
+ ## The table is a chart
85
+
86
+ A row's bar and its percentage wear the hue of its category, and the
87
+ largest-message list uses the same table, so a tool result is one colour wherever
88
+ it appears. A hue identifies; it never judges — the gauge is the only verdict on
89
+ the screen, and the footer's feedback line is the transient one. Labels, token
90
+ counts, and notes stay in the body, secondary, and faint roles, so the text still
91
+ reads on its own and the colour repeats an order the row already has.
92
+
93
+ | Category | Hue | Bucket ids |
94
+ |---|---|---|
95
+ | System prompt | blue (`hue1`) | `system` |
96
+ | Tool definitions | purple (`hue2`) | `tools` |
97
+ | User messages | pink (`hue3`) | `user` |
98
+ | Assistant | green (`hue4`) | `assistant` |
99
+ | Tool results | amber (`hue5`) | `toolResults`, the `tool result` rows |
100
+ | Everything else | neutral (`meta`, children `faint`) | injected context and its children, summaries, shell output |
101
+
102
+ A category with no entry — an injected type, a role a future Pi adds — reads
103
+ neutral rather than borrowing a hue, so the coloured rows always mean the five
104
+ categories above.
105
+
86
106
  | Row | Source |
87
107
  |---|---|
88
108
  | Headline (`tokens`, `percent`) | `ctx.getContextUsage()`: the last valid provider usage plus Pi's estimate of the messages after it. `tokens` is `null` between a compaction and the next successful reply, because the last usage describes the pre-compaction context. |
@@ -175,7 +195,7 @@ printed beside it; the percentage itself is exact.
175
195
  | `collect.ts` | The host boundary: one read of usage, prompt, tools, settings, projection, and branch. |
176
196
  | `report.ts` | The pure builder: composition, reserve resolution, compaction history, largest messages. |
177
197
  | `format.ts` | The plain-text report for non-TUI modes. |
178
- | `tui.ts` | `ContextComponent`: gauge, rows, scroll, confirmation, feedback. |
198
+ | `view/context-report.ts` | `ContextComponent`: gauge, rows, scroll, confirmation, feedback, loaded on first use. |
179
199
  | `types.ts` | `ContextInputs`, `ContextReport`, buckets, and the host types named through `ReturnType<…>`. |
180
200
 
181
201
  ## Testing
@@ -12,30 +12,28 @@ the shared loopback layer plus one small vanilla script.
12
12
 
13
13
  ## Capabilities
14
14
 
15
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
16
-
17
- | Capability | How | What you get | Status |
18
- |---|---|---|---|
19
- | One-command browsing | `/browse` | The server starts at the effective working directory, prints its URL, and opens the browser. | Shipped |
20
- | Read-only serving | `/browse` | Nothing is edited or written, and the server binds `127.0.0.1` only. | Shipped |
21
- | Two-pane page | `/`, `/browse[/<rel>]` | A collapsible tree beside the current folder's listing, with the tree, filter, and quick-open trigger pinned in their own pane. | Shipped |
22
- | File previews | `/view/<rel>` | Text, rendered Markdown, image thumbnails, and download cards for binary or over-size files, each with a per-language icon. | Shipped |
23
- | Quick open | `/`, `Ctrl/Cmd+K`, `/api/files` | A fuzzy path finder over the tree opens a file without walking the tree. | Shipped |
24
- | Git diff view | `/diff`, `/diff/<rel>` | A change overview and one file's unified diff, scoped to `head`, `staged`, or `worktree`. | Shipped |
25
- | Live status | `/events`, the `◉ live` chip | An open page keeps its branch, change markers, and footer up to date without a reload. | Shipped |
26
- | Reload hint | `/api/dir-rev`, `⟳ reload` | A page whose folder gained or lost a file offers a reload control instead of changing its rows. | Shipped |
27
- | Terminal session chip | `browse` status key | The terminal footer shows `◉ <port>` while the page is served, so the session names its live server. | Shipped |
28
- | Listing controls | the `Name`, `Size`, and `Modified` headers | The current folder sorts by name, size, or modified time, directories first, and the choice is remembered per browser. | Shipped |
29
- | Keyboard navigation | the tree's keymap, `?` | The tree is one tab stop with arrow, fold, and open keys; a shortcut sheet lists the page's own keys. | Shipped |
30
- | Diff hunk navigation | `n`/`p` in `/diff` | Jump between changed hunks without scrolling the whole file. | Shipped |
31
- | Fold and expand all | the `fold all` control | Collapse or expand the whole tree in one click. | Shipped |
32
- | Reading progress | `browse-progress` hairline | A long directory or diff read shows how much has loaded, and printing hides the indicator. | Shipped |
33
- | Printing | `@media print` styles | The page prints without the toolbar, progress hairline, or other screen-only chrome. | Shipped |
34
- | Syntax highlighting | `/view/<rel>`, `/view/<rel>?raw=1` | Supported code files show keywords, strings, numbers, and comments in colour in both themes; other text stays plain. | Shipped |
35
- | Markdown preview | `/view/<rel>`, `/view/<rel>?raw=1` | A README renders as headings, lists, tables, code, and links, with a one-click raw view. | Shipped |
36
- | Copy and wrap | the page toolbar, `y`, `u` | Copy a file's path or contents or a `path:12-30` line reference, and toggle line wrapping for text and raw views. | Shipped |
37
- | Theme toggle | the header button, `/theme.js` | Dark and light palettes, following the system until an explicit choice is remembered per browser. | Shipped |
38
- | Idle stop and port reuse | `/browse stop`, the session port | The server stops when idle and reuses its port for the next session instead of leaking listeners. | Shipped |
15
+ | Capability | How | What you get |
16
+ |---|---|---|
17
+ | One-command browsing | `/browse` | The server starts at the effective working directory, prints its URL, and opens the browser; every later `/browse` opens the page it already serves. |
18
+ | Read-only serving | `/browse` | Nothing is edited or written, and the server binds `127.0.0.1` only. |
19
+ | Two-pane page | `/files/`, `/files/browse[/<rel>]` | A collapsible tree beside the current folder's listing, with the tree, filter, and quick-open trigger pinned in their own pane. |
20
+ | File previews | `/view/<rel>` | Text, rendered Markdown, image thumbnails, and download cards for binary or over-size files, each with a per-language icon. |
21
+ | Quick open | `/files/`, `Ctrl/Cmd+K`, `/files/api/files` | A fuzzy path finder over the tree opens a file without walking the tree. |
22
+ | Git diff view | `/diff`, `/diff/<rel>` | A change overview and one file's unified diff, scoped to `head`, `staged`, or `worktree`. |
23
+ | Live status | `/events`, the `◉ live` chip | An open page keeps its branch, change markers, and footer up to date without a reload. |
24
+ | Reload hint | `/api/dir-rev`, `⟳ reload` | A page whose folder gained or lost a file offers a reload control instead of changing its rows. |
25
+ | The session's page port | `serve`'s `◉ <port>` chip | The footer names the one port every page of the session answers on, this one included. |
26
+ | Listing controls | the `Name`, `Size`, and `Modified` headers | The current folder sorts by name, size, or modified time, directories first, and the choice is remembered per browser. |
27
+ | Keyboard navigation | the tree's keymap, `?` | The tree is one tab stop with arrow, fold, and open keys; a shortcut sheet lists the page's own keys. |
28
+ | Diff hunk navigation | `n`/`p` in `/diff` | Jump between changed hunks without scrolling the whole file. |
29
+ | Fold and expand all | the `fold all` control | Collapse or expand the whole tree in one click. |
30
+ | Reading progress | `browse-progress` hairline | A long directory or diff read shows how much has loaded, and printing hides the indicator. |
31
+ | Printing | `@media print` styles | The page prints without the toolbar, progress hairline, or other screen-only chrome. |
32
+ | Syntax highlighting | `/view/<rel>`, `/view/<rel>?raw=1` | Supported code files show keywords, strings, numbers, and comments in colour in both themes; other text stays plain. |
33
+ | Markdown preview | `/view/<rel>`, `/view/<rel>?raw=1` | A README renders as headings, lists, tables, code, and links, with a one-click raw view. |
34
+ | Copy and wrap | the page toolbar, `y`, `u` | Copy a file's path or contents or a `path:12-30` line reference, and toggle line wrapping for text and raw views. |
35
+ | Theme toggle | the header button, `/theme.js` | Dark and light palettes, following the system until an explicit choice is remembered per browser. |
36
+ | Idle stop and prefix reuse | `/browse stop`, the idle grace | The page gives its prefix back when nobody is reading it, so a closed tab never holds the session's server. |
39
37
 
40
38
  ## Quickstart
41
39
 
@@ -66,33 +64,33 @@ selects the root.
66
64
 
67
65
  - The root is the effective cwd, so an active `worktree` session serves the
68
66
  worktree. `<path>` must resolve inside it.
69
- - The port is fixed for the session: the first `/browse` picks a random port
70
- in `4780`–`5779` and every later `/browse` in that session reuses it, so the
71
- URL stays stable across roots and restarts. Set `"port"` to pin an explicit
72
- port; a busy port is reported, not silently changed.
73
- - Starting while already running with the same root reprints the URL without
74
- restarting; a different root (or a changed pinned port) restarts the server.
67
+ - The port is the project's: `serve` hashes the repository key into `4780`–`5779`
68
+ (and `serve.port` pins it), so the origin stays stable across roots and restarts. A
69
+ busy pinned port is reported, not silently changed.
70
+ - Starting while already running with the same root opens that page again and
71
+ reprints its URL, without restarting the server; a different root restarts the page.
72
+ With `autoOpen` off, the second `/browse` only reprints the URL.
75
73
  - The server is closed when its last page has been gone for ten seconds, so
76
74
  closing the browser window ends the session's browse server and `/browse`
77
- starts it again on the same port. A reload or a new tab inside that grace keeps
75
+ starts it again on the session's port. A reload or a new tab inside that grace keeps
78
76
  it. `session_shutdown` closes it too, and `/browse stop` closes it at once.
79
77
 
80
78
  ## Routes
81
79
 
82
80
  | Route | Result |
83
81
  |---|---|
84
- | `/`, `/browse[/<rel>]` | tree + directory listing |
85
- | `/view/<rel>` | tree + file page (text, Markdown, image, binary, or over-size) |
86
- | `/view/<rel>?raw=1` | raw Markdown/text source instead of the rendered view |
87
- | `/raw/<rel>` | raw bytes, streamed; downloads and image sources |
88
- | `/diff[?mode=head\|staged\|worktree]` | changed-file overview with `--stat` |
89
- | `/diff/<rel>[?mode=…]` | one file's unified diff |
90
- | `/api/tree?path=<rel>` | JSON children for lazy tree expansion |
91
- | `/api/files?q=<query>` | JSON fuzzy path matches for the quick-open palette |
92
- | `/api/dir-rev?path=<rel>` | JSON listing revision for the reload check |
93
- | `/events` | Server-Sent Events stream of `status` frames for the open page |
94
- | `/app.js` | the first-party client script |
95
- | `/theme.js` | the pre-paint theme bootstrap |
82
+ | `/files/`, `/files/browse[/<rel>]` | tree + directory listing |
83
+ | `/files/view/<rel>` | tree + file page (text, Markdown, image, binary, or over-size) |
84
+ | `/files/view/<rel>?raw=1` | raw Markdown/text source instead of the rendered view |
85
+ | `/files/raw/<rel>` | raw bytes, streamed; downloads and image sources |
86
+ | `/files/diff[?mode=head\|staged\|worktree]` | changed-file overview with `--stat` |
87
+ | `/files/diff/<rel>[?mode=…]` | one file's unified diff |
88
+ | `/files/api/tree?path=<rel>` | JSON children for lazy tree expansion |
89
+ | `/files/api/files?q=<query>` | JSON fuzzy path matches for the quick-open palette |
90
+ | `/files/api/dir-rev?path=<rel>` | JSON listing revision for the reload check |
91
+ | `/files/events` | Server-Sent Events stream of `status` frames for the open page |
92
+ | `/files/app.js` | the first-party client script |
93
+ | `/files/theme.js` | the pre-paint theme bootstrap |
96
94
 
97
95
  ## Configuration
98
96
 
@@ -102,8 +100,7 @@ global document then project document, project wins — are in
102
100
 
103
101
  | Key | Default | Meaning |
104
102
  |---|---|---|
105
- | `port` | `0` | `0` picks one random port fixed for the session; a positive value pins it. |
106
- | `autoOpen` | `true` | Open the browser on start; `false` for headless. |
103
+ | `autoOpen` | `true` | Open the browser on start and on every later `/browse`; `false` for headless. |
107
104
  | `maxFileBytes` | `1048576` | Larger files show a download card only. |
108
105
  | `maxThumbBytes` | `5242880` | Larger images get an icon, not a thumbnail. |
109
106
  | `maxTextLines` | `5000` | Rendered lines before truncation. |
@@ -342,12 +339,11 @@ old and new sides for `lib/highlight`.
342
339
 
343
340
  ## Live status
344
341
 
345
- While a server is running, the extension publishes a two-tone `◉ <port>` chip
346
- (a green circle-dot and a blue port) under the shared `browse` status key. The
347
- [`bytefly`](./bytefly.md) extension routes it to line 1's right zone, after
348
- `⎇ branch` and `⑂ worktree` and in the same run as the board page's port chip;
349
- it is cleared on stop and on `session_shutdown`. The chip is session-local: it
350
- reflects only this session's server, with no cross-session sharing.
342
+ The page answers at `/files` on the session's one server, so the footer's one
343
+ `◉ <port>` chip is the session's, not this page's: [`serve`](./serve.md) publishes it
344
+ while anything is mounted, and [`bytefly`](./bytefly.md) routes it to line 1's right
345
+ zone, after `⎇ branch` and `⑂ worktree`. It is cleared when the session's server closes,
346
+ so a session with no page open shows nothing at all.
351
347
 
352
348
  The page has its own live status, which is what a left-open tab reads. A `◉ live`
353
349
  chip beside `read-only` says whether status is flowing (green), still
@@ -452,22 +448,20 @@ stops at the first difference because the control, not the checker, is the fix.
452
448
  | Integration point | How |
453
449
  |---|---|
454
450
  | Command | `/browse` registers a single command from the factory; no tools are exposed. |
455
- | State | The running server, its root, and the session port live in a module-local closure; nothing is persisted and no session entries are written. |
451
+ | State | The running mount, its root, and the session id live in a module-local closure; nothing is persisted and no session entries are written. The port is `serve`'s, not this extension's. |
456
452
  | Lifecycle | The factory opens no socket; the server is created on `/browse` and closed idempotently by `/browse stop`, by `session_shutdown`, and once its last page has been gone for the idle grace, which also ends every attached status stream. |
457
453
 
458
454
  ## Design notes
459
455
 
460
456
  - **Lifecycle.** `/browse` resolves `resolveEffectiveCwd(ctx.cwd)`, loads config,
461
- selects the port, parses args, and `await createFileServer(...)`: `realpath`
462
- the root, bind `127.0.0.1`, await `listening`, return `{ url, port, root,
463
- close }`. The port is chosen once for the session: a pinned config `port`
464
- wins, otherwise a random port is drawn and cached after the first successful
465
- bind, so later starts reuse it (a conflict is reported and the next `/browse`
466
- rolls another). `/browse stop` and `session_shutdown` await the idempotent
467
- `close()`; `session_shutdown` also clears the cached port. The page is the
468
- server's only reader, so the channel reports the last page's departure after
469
- `IDLE_STOP_MS` and the command closes the server and clears the chip — the
470
- cached port survives, so the next `/browse` binds the same one.
457
+ parses args, and mounts the page through `requestMount`: `realpath` the root, claim
458
+ `/files` on the session's server, return `{ url, port, root, close }`. The
459
+ port belongs to `serve` — `serve.port` pins the session's origin — so nothing here
460
+ picks or retries one. `/browse stop` and `session_shutdown` await the idempotent
461
+ `close()`, which gives the prefix back. The page is the mount's only reader, so the
462
+ channel reports the last page's departure after `IDLE_STOP_MS` and the command
463
+ releases the prefix — and the session's port is `serve`'s, remembered per session,
464
+ so the next `/browse` answers on the same origin.
471
465
  - **Pure routing.** `handleRequest(context, method, rawUrl, headers)` validates
472
466
  method and `Host`, parses the URL, matches a route, and runs every path
473
467
  through `paths.ts`. It returns a plain `ServeResponse`, so routing is tested
@@ -529,7 +523,7 @@ stops at the first difference because the control, not the checker, is the fix.
529
523
  | `view/diff-html.ts` | The unified-diff body: the gutter, the sign, the hunk sections, and per-hunk highlighting |
530
524
  | `transport/router.ts` | Pure request handler: routes, the `/raw` sandbox policy, and the error page |
531
525
  | `transport/server.ts` | This extension's routes over `lib/http`'s loopback server: the request count, the stream cap, and the idle policy |
532
- | [`../../lib/http/index.ts`](../../lib/http/index.ts) | Loopback HTTP layer shared with `plan`: one server entry (`serveLoopback`), page/script/JSON/event-stream headers, `ServeResponse`, the request-envelope helpers, the event-stream sink and its idle grace |
526
+ | [`../../lib/http/index.ts`](../../lib/http/index.ts) | The served-page kit shared with `plan`: one server entry (`serveHttp`), page/script/JSON/event-stream headers, `ServeResponse`, the request-envelope helpers, the event-stream sink and its idle grace. The mount contract is the leaf [`mount.ts`](../../lib/http/mount.ts), which is the only one a registration graph may reach |
533
527
  | [`../../lib/browser.ts`](../../lib/browser.ts) | Cross-platform browser opener (shared with `plan`) |
534
528
 
535
529
  ## Testing
@@ -7,17 +7,15 @@ effective working directory.
7
7
 
8
8
  ## Capabilities
9
9
 
10
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
11
-
12
- | Capability | How | What you get | Status |
13
- |---|---|---|---|
14
- | Native open | `/open`, `open_path` | The file or directory opens in the application the OS associates with its type. | Shipped |
15
- | Reveal in the file manager | `/open -r`, `open_path` with `reveal: true` | The target is selected in the file manager instead of opened. | Shipped |
16
- | Working-directory resolution | `/open`, `open_path` | A relative path resolves against the effective working directory, so under [`worktree`](./worktree.md) `/open .` opens the isolated worktree. | Shipped |
17
- | Codemode-only exposure | `exposure: "codemode"` | The model cannot call `open_path` directly unless a codemode script asks for it; the table does not promise otherwise. | Shipped |
18
- | Pasted-path cleanup | `/open`, `open_path` | The editor's `@` mention prefix, surrounding quotes, and control characters are stripped before the path is used. | Shipped |
19
- | Failure reporting | `/open`, `open_path` | A missing path, a launcher that cannot start, and a non-zero exit after a successful start on macOS/Linux are reported. | Shipped |
20
- | Session-outliving launch | `/open`, `open_path` | The handler runs detached, so the application outlives the Pi session. | Shipped |
10
+ | Capability | How | What you get |
11
+ |---|---|---|
12
+ | Native open | `/open`, `open_path` | The file or directory opens in the application the OS associates with its type. |
13
+ | Reveal in the file manager | `/open -r`, `open_path` with `reveal: true` | The target is selected in the file manager instead of opened. |
14
+ | Working-directory resolution | `/open`, `open_path` | A relative path resolves against the effective working directory, so under [`worktree`](./worktree.md) `/open .` opens the isolated worktree. |
15
+ | Codemode-only exposure | `exposure: "codemode"` | The model cannot call `open_path` directly unless a codemode script asks for it; the table does not promise otherwise. |
16
+ | Pasted-path cleanup | `/open`, `open_path` | The editor's `@` mention prefix, surrounding quotes, and control characters are stripped before the path is used. |
17
+ | Failure reporting | `/open`, `open_path` | A missing path, a launcher that cannot start, and a non-zero exit after a successful start on macOS/Linux are reported. |
18
+ | Session-outliving launch | `/open`, `open_path` | The handler runs detached, so the application outlives the Pi session. |
21
19
 
22
20
  ## Quickstart
23
21
 
@@ -10,20 +10,18 @@ path tools use.
10
10
 
11
11
  ## Capabilities
12
12
 
13
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
14
-
15
- | Capability | How | What you get | Status |
16
- |---|---|---|---|
17
- | Document extraction | `read_doc` | Plain text from a document or workbook whose bytes the built-in `read` cannot decode. | Shipped |
18
- | Paged reading | `read_doc` (`startIndex`, `maxChars`) | A long file arrives in slices, and a truncated result names the offset to ask for next. | Shipped |
19
- | Workbook text | `read_doc` on `.xlsx` | One `[Sheet]` heading per worksheet followed by tab-separated rows, so the shape of the file survives. | Shipped |
20
- | Confined reads | `read_doc` | A path outside the effective working directory is refused, symlinks resolved, before any parser runs. | Shipped |
21
- | Progress and cancellation | `startToolProgress`, the abort signal | A slow extraction shows `Reading... <elapsed>` and can be cancelled instead of looking dead. | Shipped |
22
- | Bounded extraction | `file-read.maxFileBytes`, `file-read.extractTimeoutMs` | An over-size file or a parser past its deadline fails the read instead of parking the turn. | Shipped |
23
- | Per-format switches | `file-read.formats` | Any of the six formats can be turned off, and a disabled read names the key that did it. | Shipped |
24
- | Unsupported-format hint | `read_doc` on another extension | The refusal names the supported formats and the legacy `.xls` conversion hint instead of a generic read error. | Shipped |
25
- | Lazy parsers | `read_doc` | Only the format you read loads a library, so registration costs nothing at startup. | Shipped |
26
- | Code-point slicing | `read_doc` (`startIndex`, `maxChars`) | CJK and emoji stay well-formed across a page boundary. | Shipped |
13
+ | Capability | How | What you get |
14
+ |---|---|---|
15
+ | Document extraction | `read_doc` | Plain text from a document or workbook whose bytes the built-in `read` cannot decode. |
16
+ | Paged reading | `read_doc` (`startIndex`, `maxChars`) | A long file arrives in slices, and a truncated result names the offset to ask for next. |
17
+ | Workbook text | `read_doc` on `.xlsx` | One `[Sheet]` heading per worksheet followed by tab-separated rows, so the shape of the file survives. |
18
+ | Confined reads | `read_doc` | A path outside the effective working directory is refused, symlinks resolved, before any parser runs. |
19
+ | Progress and cancellation | `startToolProgress`, the abort signal | A slow extraction shows `Reading... <elapsed>` and can be cancelled instead of looking dead. |
20
+ | Bounded extraction | `file-read.maxFileBytes`, `file-read.extractTimeoutMs` | An over-size file or a parser past its deadline fails the read instead of parking the turn. |
21
+ | Per-format switches | `file-read.formats` | Any of the six formats can be turned off, and a disabled read names the key that did it. |
22
+ | Unsupported-format hint | `read_doc` on another extension | The refusal names the supported formats and the legacy `.xls` conversion hint instead of a generic read error. |
23
+ | Lazy parsers | `read_doc` | Only the format you read loads a library, so registration costs nothing at startup. |
24
+ | Code-point slicing | `read_doc` (`startIndex`, `maxChars`) | CJK and emoji stay well-formed across a page boundary. |
27
25
 
28
26
  ## Quickstart
29
27
 
@@ -5,21 +5,19 @@ every turn. The goal is the *what*; the [`todo`](./todo.md) list is the *how*.
5
5
 
6
6
  ## Capabilities
7
7
 
8
- Status records what a reader can rely on: **Shipped** is in a tagged release, **Unreleased** is complete in the current tree but not yet tagged, and **Partial** has one released part and one unreleased part. Rows are ordered by user value, highest first.
9
-
10
- | Capability | How | What you get | Status |
11
- |---|---|---|---|
12
- | Goal recording | `goal`, `/goal set`, `/goal raw`, `/goal clear` | The objective is replaced whole, cleared by an empty value, and recorded verbatim when you ask for it. | Shipped |
13
- | Phase tracking | `goal`, `/goal done` | The goal is `planning`, `active`, or `achieved`, and only the workflow can open a draft. | Shipped |
14
- | Plan-first question | `goal`, `/goal <prompt>`, `/goal raw` | One dialog decides whether a new goal enters plan mode before it is pursued. | Shipped |
15
- | Plan-mode allowlist | `goal` in plan mode | The model can record or update the objective while plan mode keeps the rest of the session read-only. | Shipped |
16
- | Plan-phase settlement | `planning` goal, `exit_plan_mode` | Leaving plan mode without approval makes the draft `active`; approving the plan writes its `## Goal` into it. | Shipped |
17
- | Understanding loop | `/goal <prompt>`, `/goal set`, `/goal edit` | A typed goal is restated, questioned when it is unclear, and confirmed in the editor before it is recorded. | Shipped |
18
- | Goal rail | the `Goal · active · …` widget, the `achieved` key | The objective stays one line above the editor while it is pursued. | Shipped |
19
- | Per-turn restatement | the `[SESSION GOAL]` reminder | The model reads the pursued objective before each turn, without it entering the transcript. | Shipped |
20
- | Open-list check | `goal`, `/goal done` | Completing the goal names the todo items the list still has open. | Shipped |
21
- | Branch-following state | tool-result `details`, the `goal` session entry | The goal survives `/resume` and `/tree`, and abandoned branches never leak in. | Shipped |
22
- | Command help | `/goal help`, `/goal -h`, `/goal --help` | The verb list and the usage of each form, without changing the goal. | Shipped |
8
+ | Capability | How | What you get |
9
+ |---|---|---|
10
+ | Goal recording | `goal`, `/goal set`, `/goal raw`, `/goal clear` | The objective is replaced whole, cleared by an empty value, and recorded verbatim when you ask for it. |
11
+ | Phase tracking | `goal`, `/goal done` | The goal is `planning`, `active`, or `achieved`, and only the workflow can open a draft. |
12
+ | Plan-first question | `goal`, `/goal <prompt>`, `/goal raw` | One dialog decides whether a new goal enters plan mode before it is pursued. |
13
+ | Plan-mode allowlist | `goal` in plan mode | The model can record or update the objective while plan mode keeps the rest of the session read-only. |
14
+ | Plan-phase settlement | `planning` goal, `plan` action `exit` | Leaving plan mode without approval makes the draft `active`; approving the plan writes its `## Goal` into it. |
15
+ | Understanding loop | `/goal <prompt>`, `/goal set`, `/goal edit` | A typed goal is restated, questioned when it is unclear, and confirmed in the editor before it is recorded. |
16
+ | Goal rail | the `Goal · active · …` widget, the `achieved` key | The objective stays one line above the editor while it is pursued. |
17
+ | Per-turn restatement | the `[SESSION GOAL]` reminder | The model reads the pursued objective before each turn, without it entering the transcript. |
18
+ | Open-list check | `goal`, `/goal done` | Completing the goal names the todo items the list still has open. |
19
+ | Branch-following state | tool-result `details`, the `goal` session entry | The goal survives `/resume` and `/tree`, and abandoned branches never leak in. |
20
+ | Command help | `/goal help`, `/goal -h`, `/goal --help` | The verb list and the usage of each form, without changing the goal. |
23
21
 
24
22
  ## Quickstart
25
23
 
@@ -137,7 +135,7 @@ and stores the objective as `planning`, so a plan can be designed against it;
137
135
  declining stores it `active`, the final objective. The question is skipped for
138
136
  an update to a goal that is already pursued, without a dialog UI, and when
139
137
  `plan` is not loaded. The question and its consent sentence come from
140
- `lib/plan-entry.ts`, the same ones `enter_plan_mode` shows, so the user answers
138
+ `lib/plan-entry.ts`, the same ones the `enter` action shows, so the user answers
141
139
  once.
142
140
 
143
141
  A draft whose plan never arrived is settled rather than stranded. If plan mode is
@@ -215,7 +213,7 @@ that is what it is. The `goal` tool stays the silent setter.
215
213
  the extension that asks also has to act on the answer — which a command context
216
214
  cannot do, since `ExtensionCommandContext` has no `executeTool`. So the consent
217
215
  sentence and the request channel live in `lib/plan-entry.ts`: `goal` asks, and
218
- `plan` enables silently over `pi.events`. `enter_plan_mode` keeps its own
216
+ `plan` enables silently over `pi.events`. The `enter` action keeps its own
219
217
  confirm for the model-initiated path, using the same sentence, so the user is
220
218
  never asked twice and the two texts cannot drift.
221
219
  - **The draft is settled, not stranded.** A `planning` goal is normalised by the