@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.
- package/README.md +46 -30
- package/README.zh-CN.md +40 -25
- package/assets/screens/board.png +0 -0
- package/assets/screens/chrome.png +0 -0
- package/assets/screens/file-browse.png +0 -0
- package/assets/screens/plan-review.png +0 -0
- package/assets/screens/plan.png +0 -0
- package/docs/extensions/README.md +22 -23
- package/docs/extensions/board.md +397 -168
- package/docs/extensions/bytefly.md +234 -197
- package/docs/extensions/check.md +15 -17
- package/docs/extensions/context.md +35 -15
- package/docs/extensions/file-browse.md +57 -63
- package/docs/extensions/file-open.md +9 -11
- package/docs/extensions/file-read.md +12 -14
- package/docs/extensions/goal.md +15 -17
- package/docs/extensions/job.md +54 -42
- package/docs/extensions/memory.md +17 -19
- package/docs/extensions/plan.md +197 -140
- package/docs/extensions/question.md +16 -18
- package/docs/extensions/rewind.md +17 -19
- package/docs/extensions/serve.md +145 -0
- package/docs/extensions/session-bus.md +38 -16
- package/docs/extensions/subagent.md +23 -25
- package/docs/extensions/team.md +83 -44
- package/docs/extensions/todo.md +18 -18
- package/docs/extensions/watch.md +31 -31
- package/docs/extensions/web-access.md +2 -4
- package/docs/extensions/wechat.md +34 -35
- package/docs/extensions/worktree.md +56 -50
- package/extensions/board/commands.ts +79 -25
- package/extensions/board/format.ts +43 -24
- package/extensions/board/index.ts +17 -4
- package/extensions/board/input.ts +4 -9
- package/extensions/board/join.ts +5 -20
- package/extensions/board/lazy-page.ts +40 -0
- package/extensions/board/page.ts +65 -93
- package/extensions/board/result.ts +30 -39
- package/extensions/board/rows.ts +62 -25
- package/extensions/board/schema.ts +49 -11
- package/extensions/board/snapshot.ts +8 -6
- package/extensions/board/tone.ts +22 -0
- package/extensions/board/tools.ts +154 -55
- package/extensions/board/transport/router.ts +3 -5
- package/extensions/board/transport/server.ts +59 -28
- package/extensions/board/types.ts +36 -42
- package/extensions/board/view/card.ts +229 -0
- package/extensions/board/view/client.ts +35 -16
- package/extensions/board/view/dialog.ts +169 -6
- package/extensions/board/view/empty.ts +47 -0
- package/extensions/board/view/keys.ts +13 -2
- package/extensions/board/view/live.ts +90 -28
- package/extensions/board/view/names.ts +13 -4
- package/extensions/board/view/page.ts +38 -13
- package/extensions/board/view/render.ts +219 -277
- package/extensions/board/view/styles.ts +130 -32
- package/extensions/board/view/team.ts +297 -76
- package/extensions/bytefly/block/fallback.ts +1 -1
- package/extensions/bytefly/doctor/runtime.ts +5 -2
- package/extensions/bytefly/footer/collect/label.ts +60 -0
- package/extensions/bytefly/footer/collect/snapshot.ts +8 -1
- package/extensions/bytefly/footer/config.ts +7 -8
- package/extensions/bytefly/footer/register.ts +33 -4
- package/extensions/bytefly/footer/render/footer.ts +18 -4
- package/extensions/bytefly/footer/render/key.ts +46 -0
- package/extensions/bytefly/footer/render/layout.ts +13 -3
- package/extensions/bytefly/footer/render/lines.ts +10 -7
- package/extensions/bytefly/footer/render/segments.ts +41 -38
- package/extensions/bytefly/footer/render/status.ts +0 -11
- package/extensions/bytefly/footer/types.ts +7 -0
- package/extensions/bytefly/header/component.ts +4 -20
- package/extensions/bytefly/header/config.ts +1 -1
- package/extensions/bytefly/index.ts +32 -6
- package/extensions/bytefly/mode/editor.ts +115 -0
- package/extensions/bytefly/panel/commands.ts +210 -120
- package/extensions/bytefly/panel/format.ts +4 -4
- package/extensions/bytefly/panel/settings.ts +73 -6
- package/extensions/bytefly/panel/tui/keys.ts +2 -6
- package/extensions/bytefly/update/cache.ts +1 -1
- package/extensions/bytefly/update/register.ts +4 -4
- package/extensions/bytefly/working/config.ts +5 -7
- package/extensions/bytefly/working/format.ts +10 -13
- package/extensions/bytefly/working/register.ts +22 -27
- package/extensions/check/commands.ts +3 -2
- package/extensions/check/render.ts +10 -1
- package/extensions/check/{tui.ts → view/check-screens.ts} +14 -19
- package/extensions/context/commands.ts +2 -2
- package/extensions/context/{tui.ts → view/context-report.ts} +51 -19
- package/extensions/file-browse/config/config.ts +4 -19
- package/extensions/file-browse/index.ts +89 -79
- package/extensions/file-browse/live/live.ts +1 -1
- package/extensions/file-browse/transport/router.ts +12 -4
- package/extensions/file-browse/transport/server.ts +61 -28
- package/extensions/file-browse/view/chrome.ts +4 -4
- package/extensions/file-browse/view/client.ts +3 -1
- package/extensions/file-browse/view/html.ts +73 -40
- package/extensions/file-browse/view/live-client.ts +2 -2
- package/extensions/file-browse/view/markdown.ts +13 -14
- package/extensions/file-browse/view/palette.ts +2 -2
- package/extensions/file-browse/view/raw-html.ts +9 -9
- package/extensions/file-browse/view/tree.ts +1 -1
- package/extensions/file-browse/view/urls.ts +20 -6
- package/extensions/file-read/render.ts +4 -4
- package/extensions/goal/plan-route.ts +2 -2
- package/extensions/goal/tui.ts +12 -2
- package/extensions/job/child.ts +527 -0
- package/extensions/job/clock.ts +142 -0
- package/extensions/job/commands.ts +4 -2
- package/extensions/job/config.ts +8 -1
- package/extensions/job/format.ts +22 -1
- package/extensions/job/log-writer.ts +13 -2
- package/extensions/job/registry.ts +63 -7
- package/extensions/job/render.ts +34 -0
- package/extensions/job/runtime.ts +296 -655
- package/extensions/job/session.ts +132 -19
- package/extensions/job/store.ts +7 -7
- package/extensions/job/tools.ts +21 -9
- package/extensions/job/types.ts +47 -0
- package/extensions/job/{tui.ts → view/jobs-screen.ts} +19 -99
- package/extensions/job/waiters.ts +44 -1
- package/extensions/memory/commands.ts +4 -2
- package/extensions/memory/{tui.ts → view/memory-picker.ts} +12 -12
- package/extensions/plan/commands.ts +12 -9
- package/extensions/plan/feedback.ts +62 -16
- package/extensions/plan/format.ts +8 -2
- package/extensions/plan/git-bash.ts +115 -16
- package/extensions/plan/index.ts +58 -51
- package/extensions/plan/plan-index.ts +4 -2
- package/extensions/plan/plan-text.ts +114 -0
- package/extensions/plan/plans.ts +5 -54
- package/extensions/plan/policy.ts +8 -10
- package/extensions/plan/review-lazy.ts +85 -0
- package/extensions/plan/review.ts +2 -2
- package/extensions/plan/runtime.ts +61 -41
- package/extensions/plan/sections.ts +1 -1
- package/extensions/plan/steps.ts +3 -3
- package/extensions/plan/todos.ts +1 -1
- package/extensions/plan/tools/cancel.ts +27 -62
- package/extensions/plan/tools/enter.ts +55 -81
- package/extensions/plan/tools/exit.ts +221 -238
- package/extensions/plan/tools/refusal.ts +18 -0
- package/extensions/plan/tools/steps.ts +75 -92
- package/extensions/plan/tools/write.ts +77 -120
- package/extensions/plan/tools.ts +188 -30
- package/extensions/plan/tui.ts +5 -5
- package/extensions/plan/types.ts +48 -5
- package/extensions/plan/web-blocks.ts +76 -5
- package/extensions/plan/web-chrome.ts +4 -0
- package/extensions/plan/web-client.ts +102 -2
- package/extensions/plan/web-collab.ts +4 -4
- package/extensions/plan/web-comments.ts +39 -8
- package/extensions/plan/web-composer.ts +14 -3
- package/extensions/plan/web-keys.ts +149 -25
- package/extensions/plan/web-lazy.ts +53 -0
- package/extensions/plan/web-markdown.ts +10 -68
- package/extensions/plan/web-outline.ts +22 -2
- package/extensions/plan/web-page.ts +56 -86
- package/extensions/plan/web-payload.ts +188 -0
- package/extensions/plan/web-plan.ts +23 -13
- package/extensions/plan/web-router.ts +18 -9
- package/extensions/plan/web-settle.ts +14 -7
- package/extensions/plan/web-share-session.ts +24 -55
- package/extensions/plan/web-share.ts +19 -37
- package/extensions/plan/web-write.ts +112 -0
- package/extensions/plan/web.ts +67 -131
- package/extensions/question/tools.ts +6 -2
- package/extensions/question/{tui.ts → view/question-screen.ts} +11 -11
- package/extensions/rewind/commands/commands.ts +6 -3
- package/extensions/rewind/state/runtime.ts +1 -1
- package/extensions/rewind/{view/status.ts → status.ts} +4 -4
- package/extensions/rewind/view/review-tui.ts +4 -4
- package/extensions/serve/config.ts +39 -0
- package/extensions/serve/index.ts +85 -0
- package/extensions/serve/registry.ts +260 -0
- package/extensions/session-bus/commands.ts +11 -6
- package/extensions/session-bus/join-request.ts +17 -9
- package/extensions/session-bus/mail-watch.ts +26 -17
- package/extensions/session-bus/protocol.ts +15 -3
- package/extensions/session-bus/resolve.ts +5 -7
- package/extensions/session-bus/result.ts +1 -27
- package/extensions/session-bus/runtime.ts +40 -12
- package/extensions/session-bus/store.ts +101 -19
- package/extensions/session-bus/tools.ts +5 -4
- package/extensions/session-bus/types.ts +19 -0
- package/extensions/session-bus/{tui.ts → view/session-list.ts} +16 -16
- package/extensions/subagent/agents.ts +1 -1
- package/extensions/subagent/commands.ts +4 -2
- package/extensions/subagent/format.ts +15 -15
- package/extensions/subagent/index.ts +1 -1
- package/extensions/subagent/render.ts +3 -3
- package/extensions/subagent/{background-tui.ts → view/agents-board.ts} +11 -11
- package/extensions/team/commands.ts +24 -5
- package/extensions/team/dispatch.ts +18 -4
- package/extensions/team/format.ts +17 -2
- package/extensions/team/index.ts +9 -8
- package/extensions/team/schema.ts +6 -5
- package/extensions/team/tools.ts +107 -45
- package/extensions/team/types.ts +3 -2
- package/extensions/todo/commands.ts +4 -2
- package/extensions/todo/format.ts +11 -0
- package/extensions/todo/render.ts +57 -0
- package/extensions/todo/runtime.ts +1 -1
- package/extensions/todo/tools.ts +1 -1
- package/extensions/todo/{tui.ts → view/todo-screen.ts} +18 -90
- package/extensions/todo/widget.ts +47 -0
- package/extensions/watch/commands.ts +4 -2
- package/extensions/watch/format.ts +36 -7
- package/extensions/watch/render.ts +57 -0
- package/extensions/watch/runtime.ts +27 -22
- package/extensions/watch/tools.ts +4 -4
- package/extensions/watch/{tui.ts → view/watch-screen.ts} +18 -80
- package/extensions/web-access/fetch/tool.ts +12 -4
- package/extensions/wechat/commands/commands.ts +18 -14
- package/extensions/wechat/index.ts +72 -37
- package/extensions/wechat/state/credentials.ts +1 -1
- package/extensions/wechat/state/state.ts +1 -1
- package/extensions/wechat/text/status.ts +112 -0
- package/extensions/wechat/types.ts +2 -2
- package/extensions/wechat/view/status-screen.ts +4 -103
- package/extensions/worktree/commands.ts +11 -9
- package/extensions/worktree/enter.ts +2 -2
- package/extensions/worktree/exit.ts +2 -2
- package/extensions/worktree/index.ts +5 -5
- package/extensions/worktree/screen.ts +3 -3
- package/extensions/worktree/status.ts +2 -2
- package/extensions/worktree/tools.ts +113 -116
- package/lib/README.md +28 -13
- package/lib/board/actions.ts +111 -0
- package/lib/board/artifact.ts +149 -0
- package/lib/board/card.ts +163 -52
- package/lib/board/config.ts +58 -0
- package/lib/board/contract.ts +113 -0
- package/lib/board/join.ts +38 -0
- package/lib/board/lanes.ts +182 -0
- package/lib/board/lead.ts +130 -0
- package/lib/board/limits.ts +78 -0
- package/lib/board/links.ts +31 -10
- package/lib/board/page-pointer.ts +30 -5
- package/lib/board/read.ts +83 -0
- package/lib/board/reason.ts +102 -0
- package/lib/board/round-text.ts +68 -6
- package/lib/board/round.ts +31 -15
- package/lib/board/rules.ts +151 -307
- package/lib/board/seat.ts +35 -0
- package/lib/board/session.ts +199 -51
- package/lib/board/skipped.ts +22 -0
- package/lib/board/steps.ts +487 -0
- package/lib/board/store.ts +119 -36
- package/lib/board/tone.ts +92 -0
- package/lib/board/view.ts +81 -63
- package/lib/bus-request.ts +83 -0
- package/{extensions/watch → lib}/child.ts +40 -21
- package/lib/env.ts +65 -7
- package/lib/format.ts +13 -0
- package/lib/http/index.ts +17 -11
- package/lib/http/mount.ts +142 -0
- package/lib/http/port.ts +30 -0
- package/lib/http/serve.ts +170 -46
- package/lib/http/server.ts +3 -3
- package/lib/lazy.ts +45 -0
- package/lib/plan-entry.ts +46 -21
- package/lib/plans/paths.ts +82 -0
- package/lib/policy.ts +9 -6
- package/lib/report.ts +3 -2
- package/lib/requirements.ts +10 -10
- package/lib/session-label.ts +129 -7
- package/lib/session-roster.ts +43 -1
- package/lib/session-tool.ts +39 -22
- package/lib/stray-fields.ts +7 -2
- package/lib/tool-names.ts +5 -10
- package/lib/tui/README.md +29 -11
- package/lib/tui/chrome.ts +16 -15
- package/lib/tui/cursor.ts +18 -3
- package/lib/tui/glyphs.ts +11 -11
- package/lib/tui/render-cache.ts +29 -0
- package/lib/tui/tokens.ts +33 -2
- package/lib/tui/tool.ts +33 -4
- package/lib/web/README.md +21 -0
- package/lib/web/client-runtime.ts +27 -1
- package/lib/web/components.ts +5 -1
- package/lib/web/index.ts +1 -0
- package/lib/web/markdown.ts +83 -0
- package/lib/web/markup.ts +20 -2
- package/lib/web/runtime.ts +9 -10
- package/package.json +8 -2
- package/skills/init/SKILL.md +5 -5
- package/skills/next/SKILL.md +3 -5
- package/extensions/board/config.ts +0 -36
- package/extensions/board/seat.ts +0 -28
- package/lib/tui/index.ts +0 -34
- package/skills/project-docs/SKILL.md +0 -133
- package/skills/project-docs/references/audit.md +0 -131
- package/skills/project-docs/references/changelog.md +0 -105
- package/skills/project-docs/references/discovery.md +0 -127
- package/skills/project-docs/references/readme.md +0 -80
- package/skills/project-docs/references/release.md +0 -84
- package/skills/project-docs/references/roadmap.md +0 -93
- package/skills/project-docs/scripts/state.ts +0 -316
package/docs/extensions/check.md
CHANGED
|
@@ -8,22 +8,20 @@ framework, or CI system.
|
|
|
8
8
|
|
|
9
9
|
## Capabilities
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
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
|
-
| `
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
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
|
-
| `
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
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
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
|
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
|
-
|
|
|
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
|
-
| `
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
[`bytefly`](./bytefly.md)
|
|
348
|
-
`⎇ branch` and `⑂ worktree
|
|
349
|
-
|
|
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
|
|
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
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
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) |
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
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
|
|
package/docs/extensions/goal.md
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
| Plan-
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
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 `
|
|
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`. `
|
|
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
|