@gavin-hu/my-pi-agent 0.17.0 → 0.19.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 +61 -45
- package/README.zh-CN.md +54 -42
- package/docs/extensions/README.md +34 -0
- package/docs/extensions/board.md +344 -0
- package/{extensions/bytefly/README.md → docs/extensions/bytefly.md} +465 -416
- package/{extensions/check/README.md → docs/extensions/check.md} +83 -68
- package/{extensions/context/README.md → docs/extensions/context.md} +40 -23
- package/docs/extensions/file-browse.md +554 -0
- package/{extensions/file-open/README.md → docs/extensions/file-open.md} +31 -23
- package/{extensions/file-read/README.md → docs/extensions/file-read.md} +47 -55
- package/{extensions/goal/README.md → docs/extensions/goal.md} +115 -131
- package/{extensions/job/README.md → docs/extensions/job.md} +66 -53
- package/{extensions/memory/README.md → docs/extensions/memory.md} +74 -63
- package/docs/extensions/plan.md +976 -0
- package/{extensions/question/README.md → docs/extensions/question.md} +54 -28
- package/{extensions/rewind/README.md → docs/extensions/rewind.md} +115 -122
- package/docs/extensions/session-bus.md +285 -0
- package/{extensions/subagent/README.md → docs/extensions/subagent.md} +166 -119
- package/docs/extensions/team.md +226 -0
- package/{extensions/todo/README.md → docs/extensions/todo.md} +85 -88
- package/{extensions/watch/README.md → docs/extensions/watch.md} +60 -38
- package/{extensions/web-access/README.md → docs/extensions/web-access.md} +93 -50
- package/{extensions/wechat/README.md → docs/extensions/wechat.md} +275 -192
- package/{extensions/worktree/README.md → docs/extensions/worktree.md} +115 -72
- package/extensions/board/commands.ts +87 -0
- package/extensions/board/config.ts +36 -0
- package/extensions/board/format.ts +72 -0
- package/extensions/board/index.ts +40 -0
- package/extensions/board/input.ts +54 -0
- package/extensions/board/join.ts +42 -0
- package/extensions/board/page.ts +312 -0
- package/extensions/board/result.ts +99 -0
- package/extensions/board/rows.ts +48 -0
- package/extensions/board/schema.ts +75 -0
- package/extensions/board/seat.ts +29 -0
- package/extensions/board/snapshot.ts +41 -0
- package/extensions/board/tools.ts +279 -0
- package/extensions/board/transport/router.ts +172 -0
- package/extensions/board/transport/server.ts +149 -0
- package/extensions/board/types.ts +54 -0
- package/extensions/board/view/actions.ts +306 -0
- package/extensions/board/view/client.ts +41 -0
- package/extensions/board/view/keys.ts +121 -0
- package/extensions/board/view/live.ts +397 -0
- package/extensions/board/view/page.ts +158 -0
- package/extensions/board/view/render.ts +496 -0
- package/extensions/board/view/styles.ts +211 -0
- package/extensions/board/view/team.ts +305 -0
- package/extensions/board/writes.ts +99 -0
- package/extensions/bytefly/notify/types.ts +1 -1
- package/extensions/bytefly/panel/commands.ts +40 -7
- package/extensions/bytefly/panel/settings-runtime.ts +0 -6
- package/extensions/bytefly/panel/settings.ts +11 -21
- package/extensions/bytefly/panel/tui/settings-view.ts +1 -1
- package/extensions/bytefly/picker/discovery.ts +0 -2
- package/extensions/bytefly/picker/types.ts +0 -2
- package/extensions/bytefly/update/check.ts +39 -0
- package/extensions/bytefly/update/format.ts +15 -0
- package/extensions/bytefly/update/register.ts +73 -34
- package/extensions/bytefly/update/state.ts +6 -3
- package/extensions/context/tui.ts +1 -1
- package/extensions/file-browse/{config.ts → config/config.ts} +13 -4
- package/extensions/file-browse/{files.ts → files/files.ts} +1 -14
- package/extensions/file-browse/{paths.ts → files/paths.ts} +1 -1
- package/extensions/file-browse/{git.ts → git/git.ts} +10 -3
- package/extensions/file-browse/index.ts +4 -4
- package/extensions/file-browse/{live.ts → live/live.ts} +54 -82
- package/extensions/file-browse/live/rev.ts +42 -0
- package/extensions/file-browse/{router.ts → transport/router.ts} +44 -17
- package/extensions/file-browse/transport/server.ts +110 -0
- package/extensions/file-browse/view/chrome.ts +83 -0
- package/extensions/file-browse/{client.ts → view/client.ts} +63 -1
- package/extensions/file-browse/view/diff-html.ts +94 -0
- package/extensions/file-browse/{html.ts → view/html.ts} +32 -158
- package/extensions/file-browse/{icons.ts → view/icons.ts} +1 -1
- package/extensions/file-browse/{live-client.ts → view/live-client.ts} +47 -1
- package/extensions/file-browse/{markdown.ts → view/markdown.ts} +7 -7
- package/extensions/file-browse/{raw-html.ts → view/raw-html.ts} +1 -1
- package/extensions/file-browse/{styles.ts → view/styles.ts} +31 -5
- package/extensions/file-browse/{tree.ts → view/tree.ts} +1 -1
- package/extensions/file-browse/{urls.ts → view/urls.ts} +1 -1
- package/extensions/file-read/schema.ts +2 -1
- package/extensions/goal/plan-route.ts +8 -2
- package/extensions/job/index.ts +15 -7
- package/extensions/memory/store.ts +12 -5
- package/extensions/plan/blocks.ts +23 -2
- package/extensions/plan/commands.ts +77 -21
- package/extensions/plan/feedback.ts +409 -63
- package/extensions/plan/index.ts +7 -5
- package/extensions/plan/plan-index.ts +44 -10
- package/extensions/plan/plan-text.ts +51 -24
- package/extensions/plan/plans.ts +162 -57
- package/extensions/plan/policy.ts +20 -12
- package/extensions/plan/review-prompt.ts +93 -0
- package/extensions/plan/review.ts +51 -95
- package/extensions/plan/runtime.ts +22 -10
- package/extensions/plan/sections.ts +112 -0
- package/extensions/plan/steps.ts +63 -95
- package/extensions/plan/tools/enter.ts +8 -3
- package/extensions/plan/tools/exit.ts +13 -19
- package/extensions/plan/tools/write.ts +8 -3
- package/extensions/plan/tools.ts +1 -1
- package/extensions/plan/tui.ts +29 -15
- package/extensions/plan/types.ts +29 -3
- package/extensions/plan/web-chrome.ts +2 -1
- package/extensions/plan/web-client.ts +122 -178
- package/extensions/plan/web-collab.ts +207 -0
- package/extensions/plan/web-comments.ts +269 -0
- package/extensions/plan/web-page.ts +96 -17
- package/extensions/plan/web-router.ts +109 -47
- package/extensions/plan/web-share-session.ts +191 -0
- package/extensions/plan/web-share.ts +169 -0
- package/extensions/plan/web-streams.ts +124 -0
- package/extensions/plan/web-tokens.ts +63 -0
- package/extensions/plan/web.ts +245 -151
- package/extensions/question/dialogs.ts +91 -1
- package/extensions/question/tools.ts +2 -1
- package/extensions/rewind/{commands.ts → commands/commands.ts} +5 -5
- package/extensions/rewind/{review.ts → commands/review.ts} +13 -13
- package/extensions/rewind/{rewind.ts → commands/rewind.ts} +6 -6
- package/extensions/rewind/{config.ts → config/config.ts} +1 -1
- package/extensions/rewind/index.ts +3 -3
- package/extensions/rewind/{policy.ts → state/policy.ts} +4 -4
- package/extensions/rewind/{runtime.ts → state/runtime.ts} +11 -11
- package/extensions/rewind/{snapshot-run.ts → state/snapshot-run.ts} +1 -1
- package/extensions/rewind/{timeline.ts → state/timeline.ts} +2 -2
- package/extensions/rewind/{format.ts → text/format.ts} +3 -3
- package/extensions/rewind/{git.ts → transport/git.ts} +2 -2
- package/extensions/rewind/{restore.ts → transport/restore.ts} +2 -2
- package/extensions/rewind/{snapshot.ts → transport/snapshot.ts} +1 -1
- package/extensions/rewind/{store.ts → transport/store.ts} +1 -1
- package/extensions/rewind/{checklist.ts → view/checklist.ts} +6 -6
- package/extensions/rewind/{hunk-picker.ts → view/hunk-picker.ts} +8 -8
- package/extensions/rewind/{path-picker.ts → view/path-picker.ts} +7 -7
- package/extensions/rewind/{review-tui.ts → view/review-tui.ts} +11 -11
- package/extensions/rewind/{rewind-tui.ts → view/rewind-tui.ts} +17 -11
- package/extensions/rewind/{status.ts → view/status.ts} +4 -4
- package/extensions/session-bus/commands.ts +113 -0
- package/extensions/session-bus/format.ts +101 -0
- package/extensions/session-bus/index.ts +75 -0
- package/extensions/session-bus/join-request.ts +40 -0
- package/extensions/session-bus/mail-watch.ts +134 -0
- package/extensions/session-bus/notice.ts +86 -0
- package/extensions/session-bus/overlap.ts +36 -0
- package/extensions/session-bus/protocol.ts +104 -0
- package/extensions/session-bus/resolve.ts +67 -0
- package/extensions/session-bus/result.ts +208 -0
- package/extensions/session-bus/rows.ts +171 -0
- package/extensions/session-bus/runtime.ts +466 -0
- package/extensions/session-bus/store.ts +365 -0
- package/extensions/session-bus/tools.ts +192 -0
- package/extensions/session-bus/tui.ts +394 -0
- package/extensions/session-bus/types.ts +98 -0
- package/extensions/subagent/agents.ts +9 -8
- package/extensions/subagent/invocation.ts +4 -2
- package/extensions/team/commands.ts +112 -0
- package/extensions/team/dispatch.ts +133 -0
- package/extensions/team/format.ts +105 -0
- package/extensions/team/index.ts +33 -0
- package/extensions/team/schema.ts +29 -0
- package/extensions/team/tools.ts +246 -0
- package/extensions/team/types.ts +48 -0
- package/extensions/watch/index.ts +15 -9
- package/extensions/web-access/fetch/page.ts +4 -1
- package/extensions/web-access/fetch/structured.ts +447 -0
- package/extensions/web-access/fetch/tool.ts +2 -1
- package/extensions/web-access/search/tool.ts +2 -1
- package/extensions/wechat/bridge.ts +76 -92
- package/extensions/wechat/{commands.ts → commands/commands.ts} +26 -18
- package/extensions/wechat/{doctor.ts → commands/doctor.ts} +5 -5
- package/extensions/wechat/{history.ts → commands/history.ts} +1 -1
- package/extensions/wechat/{login.ts → commands/login.ts} +3 -3
- package/extensions/wechat/{slash.ts → commands/slash.ts} +38 -2
- package/extensions/wechat/dialog/channels.ts +136 -0
- package/extensions/wechat/{interaction.ts → dialog/interaction.ts} +66 -51
- package/extensions/wechat/{prompt.ts → dialog/prompt.ts} +40 -25
- package/extensions/wechat/{remote-ui.ts → dialog/remote-ui.ts} +1 -1
- package/extensions/wechat/index.ts +10 -10
- package/extensions/wechat/{admission.ts → peer/admission.ts} +2 -2
- package/extensions/wechat/{peer-session.ts → peer/peer-session.ts} +2 -2
- package/extensions/wechat/{peer-worker.ts → peer/peer-worker.ts} +119 -56
- package/extensions/wechat/{presence.ts → peer/presence.ts} +11 -11
- package/extensions/wechat/{reply-pipeline.ts → peer/reply-pipeline.ts} +13 -5
- package/extensions/wechat/{credentials.ts → state/credentials.ts} +2 -2
- package/extensions/wechat/{state.ts → state/state.ts} +14 -2
- package/extensions/wechat/{format.ts → text/format.ts} +3 -3
- package/extensions/wechat/{notices.ts → text/notices.ts} +15 -7
- package/extensions/wechat/tools.ts +29 -12
- package/extensions/wechat/{client.ts → transport/client.ts} +26 -2
- package/extensions/wechat/{deliver.ts → transport/deliver.ts} +104 -40
- package/extensions/wechat/{inbound.ts → transport/inbound.ts} +5 -5
- package/extensions/wechat/{media.ts → transport/media.ts} +11 -5
- package/extensions/wechat/transport/outbound.ts +142 -0
- package/extensions/wechat/{poll.ts → transport/poll.ts} +3 -3
- package/extensions/wechat/types.ts +10 -1
- package/extensions/wechat/{login-screen.ts → view/login-screen.ts} +4 -4
- package/extensions/wechat/{status-screen.ts → view/status-screen.ts} +31 -26
- package/extensions/worktree/git.ts +5 -0
- package/extensions/worktree/guard.ts +3 -5
- package/extensions/worktree/registry.ts +11 -5
- package/extensions/worktree/status.ts +1 -3
- package/lib/README.md +12 -6
- package/lib/board/card.ts +290 -0
- package/lib/board/links.ts +117 -0
- package/lib/board/page-pointer.ts +256 -0
- package/lib/board/round-text.ts +72 -0
- package/lib/board/round.ts +89 -0
- package/lib/board/rules.ts +304 -0
- package/lib/board/session.ts +105 -0
- package/lib/board/store.ts +310 -0
- package/lib/board/view.ts +150 -0
- package/lib/errors.ts +12 -4
- package/lib/format.ts +13 -0
- package/lib/http/guard.ts +112 -0
- package/lib/http/index.ts +16 -5
- package/lib/http/router.ts +40 -13
- package/lib/http/serve.ts +234 -0
- package/lib/http/server.ts +29 -13
- package/lib/http/sink.ts +110 -0
- package/lib/http/token.ts +38 -0
- package/lib/interaction.ts +10 -0
- package/lib/notice.ts +29 -2
- package/lib/plan-entry.ts +7 -2
- package/lib/policy.ts +12 -2
- package/lib/qr.ts +64 -0
- package/lib/repo-key.ts +74 -0
- package/lib/report.ts +52 -33
- package/lib/requirements.ts +7 -9
- package/lib/session-label.ts +64 -0
- package/lib/session-roster.ts +130 -0
- package/lib/session-tool.ts +184 -0
- package/lib/tool-names.ts +25 -2
- package/lib/tui/README.md +16 -2
- package/lib/tui/dock-screen.ts +85 -17
- package/lib/tui/glyphs.ts +2 -0
- package/lib/tui/line-pane.ts +15 -4
- package/lib/tui/tool.ts +23 -4
- package/lib/web/README.md +5 -2
- package/lib/web/components.ts +6 -1
- package/lib/web/runtime.ts +7 -1
- package/lib/web/tokens.ts +25 -2
- package/package.json +27 -14
- package/skills/init/SKILL.md +80 -45
- package/skills/init/references/agents-md-quality.md +26 -2
- package/skills/init/references/interview-questions.md +36 -14
- package/skills/next/SKILL.md +77 -51
- package/skills/project-docs/SKILL.md +133 -0
- package/skills/project-docs/references/audit.md +131 -0
- package/skills/project-docs/references/changelog.md +105 -0
- package/skills/project-docs/references/discovery.md +127 -0
- package/skills/project-docs/references/readme.md +80 -0
- package/skills/project-docs/references/release.md +84 -0
- package/skills/project-docs/references/roadmap.md +93 -0
- package/skills/project-docs/scripts/state.ts +316 -0
- package/skills/refactor/SKILL.md +100 -125
- package/skills/refactor/references/handoff.md +35 -0
- package/skills/refactor/references/signals.md +54 -0
- package/skills/refactor/scripts/inventory.ts +587 -0
- package/extensions/file-browse/README.md +0 -467
- package/extensions/file-browse/server.ts +0 -134
- package/extensions/plan/README.md +0 -709
- package/extensions/plan/config.ts +0 -27
- package/extensions/wechat/outbound.ts +0 -100
- package/extensions/wechat/qrcode.ts +0 -46
- package/skills/changelog/SKILL.md +0 -148
- /package/extensions/file-browse/{diff.ts → text/diff.ts} +0 -0
- /package/extensions/file-browse/{fuzzy.ts → text/fuzzy.ts} +0 -0
- /package/extensions/file-browse/{palette.ts → view/palette.ts} +0 -0
- /package/extensions/rewind/{patch.ts → text/patch.ts} +0 -0
- /package/extensions/rewind/{paths.ts → text/paths.ts} +0 -0
- /package/extensions/rewind/{queue.ts → transport/queue.ts} +0 -0
- /package/extensions/rewind/{temp-index.ts → transport/temp-index.ts} +0 -0
- /package/extensions/wechat/{lock.ts → state/lock.ts} +0 -0
- /package/extensions/wechat/{channel.ts → text/channel.ts} +0 -0
|
@@ -1,27 +1,65 @@
|
|
|
1
1
|
# check — cross-stack verification runs
|
|
2
2
|
|
|
3
3
|
Run the project's test, lint, or typecheck command from Pi, watch it live, and
|
|
4
|
-
turn its output into a navigable `file:line` list. The
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
turn its output into a navigable `file:line` list. The model gets the same run
|
|
5
|
+
as `run_check`, with structured failures instead of a wall of log text. Detection
|
|
6
|
+
is manifest-driven and deliberately generic: `check` assumes no language, test
|
|
7
|
+
framework, or CI system.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
manifest or takes `check.command`, and it does not assume Node, Bun, a test
|
|
10
|
-
framework, or a particular CI system.
|
|
9
|
+
## Capabilities
|
|
11
10
|
|
|
12
|
-
|
|
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 |
|
|
27
|
+
|
|
28
|
+
## Quickstart
|
|
29
|
+
|
|
30
|
+
```bash
|
|
13
31
|
pi --extension ./extensions/check # load just this extension
|
|
14
32
|
pi -e . # load the whole @gavin-hu/my-pi-agent package
|
|
15
33
|
pi install ./ # install the package
|
|
16
34
|
```
|
|
17
35
|
|
|
18
|
-
|
|
36
|
+
```text
|
|
37
|
+
/check # run every detected command
|
|
38
|
+
/check test # run the detected test command
|
|
39
|
+
```
|
|
19
40
|
|
|
20
|
-
|
|
41
|
+
The model calls `run_check` with the same four targets.
|
|
21
42
|
|
|
22
|
-
|
|
43
|
+
## Tool
|
|
23
44
|
|
|
24
|
-
|
|
45
|
+
<img src="../../assets/tools/run_check.png" alt="The run_check transcript block: a status summary and two failure rows under a rail" width="100%">
|
|
46
|
+
|
|
47
|
+
`run_check` — direct exposure (the default), `executionMode: "sequential"`,
|
|
48
|
+
annotations `readOnlyHint: false`, `destructiveHint: false`,
|
|
49
|
+
`openWorldHint: false`. It takes one optional parameter:
|
|
50
|
+
|
|
51
|
+
| Parameter | Type | Meaning |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `target` | `test` \| `lint` \| `typecheck` \| `all` | Which command to run; defaults to `all`. |
|
|
54
|
+
|
|
55
|
+
Result (`details` / `structuredContent`): `{ target, status, commands, exitCode,
|
|
56
|
+
durationMs, truncated, failures[] }`. `details` also carries the bounded `tail`,
|
|
57
|
+
which the transcript block reads and the structured mirror deliberately omits.
|
|
58
|
+
|
|
59
|
+
`content` is a short summary plus up to 20 failures. A failing check is a normal
|
|
60
|
+
result (`isError: false`) so the model can fix it; a check that cannot run — no
|
|
61
|
+
detected command, a spawn failure, or another run already active — is an error
|
|
62
|
+
with the corrective action.
|
|
25
63
|
|
|
26
64
|
The call line is `run_check <target>`. While the command runs, the result is one
|
|
27
65
|
line — `Running bun run check… · 12s` — and it repaints once a second, so a
|
|
@@ -30,47 +68,19 @@ a capped view of the run: a status summary, at most five failure rows, and the
|
|
|
30
68
|
bounded tail when nothing parsed. `ctrl+o` expands it to the model's 20-failure
|
|
31
69
|
cap; `/check` remains the full navigable list.
|
|
32
70
|
|
|
33
|
-
<img src="../../assets/tools/run_check.png" alt="The run_check transcript block: a status summary and two failure rows under a rail" width="100%">
|
|
34
|
-
|
|
35
71
|
A failed command whose output parsed no location names the exit status in the
|
|
36
72
|
summary, prints `no parsed failure; last output:`, and shows the last five tail
|
|
37
73
|
lines instead of an exit-status row. The transcript never prints the model
|
|
38
74
|
report; the full failure list and the tail stay in `details`.
|
|
39
75
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
- **Detects a command** from `package.json`, `Cargo.toml`, `go.mod`, a pytest
|
|
43
|
-
configuration, a `justfile`, or a `Makefile`, or uses `check.command`.
|
|
44
|
-
- **Runs it in a supervised process** with a wall-clock timeout and a bounded
|
|
45
|
-
log; `Esc` cancels the process tree.
|
|
46
|
-
- **Shows a live tail** while the command runs, then a failure list with a
|
|
47
|
-
detail view for the focused failure: a source excerpt around `path:line` when
|
|
48
|
-
the file is readable, otherwise the bounded tail.
|
|
49
|
-
- **Returns structured failures** to the model with `path`, `line`, `column`,
|
|
50
|
-
`test`, `message`, and `command`.
|
|
51
|
-
- **Falls back honestly**: a failed command with no recognizable failure becomes
|
|
52
|
-
one “Command exited with status N” entry, with the bounded tail in its detail.
|
|
53
|
-
- **One line on success**: `Check passed: bun run check · 12.4s`.
|
|
54
|
-
|
|
55
|
-
## Tool
|
|
76
|
+
## Commands
|
|
56
77
|
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
| Field | Value |
|
|
60
|
-
|---|---|
|
|
61
|
-
| `target` | `test`, `lint`, `typecheck`, or `all`; defaults to `all`. |
|
|
62
|
-
| `exposure` | `direct`, active by default. |
|
|
63
|
-
| `executionMode` | `sequential` — one run owns the process and the live buffer. |
|
|
64
|
-
| `annotations` | `readOnlyHint: false`, `destructiveHint: false`, `openWorldHint: false`. |
|
|
65
|
-
| `outputSchema` | `{ target, status, commands, exitCode, durationMs, truncated, failures[] }`, mirrored by `structuredContent`. |
|
|
78
|
+
`/check [target]` runs one target, or every detected command, with the same
|
|
79
|
+
timeout, bounded log, and failure list as `run_check`.
|
|
66
80
|
|
|
67
|
-
|
|
68
|
-
bounded failure list and the tail, which the transcript block reads. A failing
|
|
69
|
-
check is a normal result (`isError: false`) so the model can fix it; a check
|
|
70
|
-
that cannot run — no detected command, a spawn failure, or another run already
|
|
71
|
-
active — is an error with the corrective action.
|
|
81
|
+
<img src="../../assets/screens/check.png" alt="The /check screen: a failed run with failure rows and the focused failure's message" width="100%">
|
|
72
82
|
|
|
73
|
-
|
|
83
|
+
<img src="../../assets/screens/check-detail.png" alt="The /check failure detail: the location and message over a source excerpt with the failing line marked by >" width="100%">
|
|
74
84
|
|
|
75
85
|
| Command | What it does |
|
|
76
86
|
|---|---|
|
|
@@ -80,23 +90,27 @@ active — is an error with the corrective action.
|
|
|
80
90
|
| `/check typecheck` | Run the detected typecheck command. |
|
|
81
91
|
| `/check all` | Same as `/check`. |
|
|
82
92
|
|
|
83
|
-
`getArgumentCompletions` offers the four targets.
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
`getArgumentCompletions` offers the four targets. In the TUI the run screen
|
|
94
|
+
shows a scrolling tail and `Esc cancel`; a failed run then opens the failure
|
|
95
|
+
list, where `Enter` opens the focused failure's detail, `r` reruns, and `Esc`
|
|
96
|
+
closes. The command refuses while plan mode is on: relying on tests is still
|
|
97
|
+
writing to the project (caches, snapshots, generated files), so the plan must be
|
|
98
|
+
approved first.
|
|
86
99
|
|
|
87
100
|
## Behaviour by mode
|
|
88
101
|
|
|
89
102
|
| Mode | Behaviour |
|
|
90
103
|
|---|---|
|
|
91
|
-
| Interactive TUI |
|
|
92
|
-
| RPC
|
|
104
|
+
| Interactive TUI | The run screen, then the failure list; a pass posts one notice. |
|
|
105
|
+
| RPC | Runs headless and posts the summary plus the failure list; no custom screen. |
|
|
93
106
|
| `print` / `json` | Runs headless and posts the same report. |
|
|
94
107
|
| `run_check` | No UI of its own. Returns the summary in `content`, the structured result, and a capped transcript block drawn from `details`. |
|
|
95
108
|
|
|
96
109
|
## Configuration
|
|
97
110
|
|
|
98
|
-
The `check` section of the shared `bytefly.json
|
|
99
|
-
|
|
111
|
+
The `check` section of the shared `bytefly.json`; resolution rules are in
|
|
112
|
+
[`../configuration.md`](../configuration.md#check--verification-runs). All keys
|
|
113
|
+
are JSON-only; none has a `/bytefly settings` row.
|
|
100
114
|
|
|
101
115
|
| Key | Default | Bounds | Meaning |
|
|
102
116
|
|---|---|---|---|
|
|
@@ -107,6 +121,19 @@ wins). All keys are JSON-only; none has a `/bytefly settings` row.
|
|
|
107
121
|
`command` is the escape hatch for any stack without a detector. It is a shell
|
|
108
122
|
command and runs with the project root as its working directory.
|
|
109
123
|
|
|
124
|
+
## Security
|
|
125
|
+
|
|
126
|
+
`check` executes project scripts. That is the same trust boundary as running the
|
|
127
|
+
command yourself or letting the agent call `bash`: a project with a hostile
|
|
128
|
+
`test` script can do anything your user can do. The extension does not add a
|
|
129
|
+
sandbox. `/check` is user-invoked and refuses in plan mode; `run_check` declares
|
|
130
|
+
`readOnlyHint: false`, so a permission policy can gate it, and plan mode blocks
|
|
131
|
+
it.
|
|
132
|
+
|
|
133
|
+
The extension adds no network calls of its own. The command's environment is
|
|
134
|
+
made non-interactive (`CI=1`, `NO_COLOR=1`, `FORCE_COLOR=0`, `TERM=dumb`,
|
|
135
|
+
`GIT_PAGER=cat`, `PAGER=cat`).
|
|
136
|
+
|
|
110
137
|
## Detection
|
|
111
138
|
|
|
112
139
|
Detection order stops at the first family that declares a command:
|
|
@@ -141,25 +168,12 @@ the fallback for everything else:
|
|
|
141
168
|
| `File "path", line N, in test` | Python tracebacks |
|
|
142
169
|
| `FAILED path::test - message` | pytest |
|
|
143
170
|
| `--- FAIL: Test` and `path:line:` | Go |
|
|
144
|
-
| `panicked at path:line`
|
|
171
|
+
| `thread 'test' panicked at path:line` | Cargo |
|
|
145
172
|
| anything else on a non-zero exit | one fallback entry with the bounded tail |
|
|
146
173
|
|
|
147
174
|
Failures are deduped and capped at 200; the model report shows 20. A miss is
|
|
148
175
|
never turned into an invented location.
|
|
149
176
|
|
|
150
|
-
## Security
|
|
151
|
-
|
|
152
|
-
`check` executes project scripts. That is the same trust boundary as running the
|
|
153
|
-
command yourself or letting the agent call `bash`: a project with a hostile
|
|
154
|
-
`test` script can do anything your user can do. The extension does not add a
|
|
155
|
-
sandbox. `/check` is user-invoked and refuses in plan mode; `run_check` declares
|
|
156
|
-
`readOnlyHint: false`, so a permission policy can gate it, and plan mode blocks
|
|
157
|
-
it.
|
|
158
|
-
|
|
159
|
-
The extension adds no network calls of its own. The command's environment is
|
|
160
|
-
made non-interactive (`CI=1`, `NO_COLOR=1`, `FORCE_COLOR=0`, `TERM=dumb`,
|
|
161
|
-
`GIT_PAGER=cat`, `PAGER=cat`).
|
|
162
|
-
|
|
163
177
|
## Limitations
|
|
164
178
|
|
|
165
179
|
- Detection covers the families above. Other stacks need `check.command`.
|
|
@@ -188,7 +202,7 @@ made non-interactive (`CI=1`, `NO_COLOR=1`, `FORCE_COLOR=0`, `TERM=dumb`,
|
|
|
188
202
|
|
|
189
203
|
| Aspect | Contract |
|
|
190
204
|
|---|---|
|
|
191
|
-
| Registration | `
|
|
205
|
+
| Registration | `checkExtension(pi)` guards on `isExtensionEnabled("check")` and calls `registerCheck(pi)`, which registers `run_check`, `/check`, and one `session_shutdown` hook. The factory only registers. |
|
|
192
206
|
| Tool | `run_check`, `exposure: "direct"`, `executionMode: "sequential"`, annotations `{ readOnlyHint: false, destructiveHint: false, openWorldHint: false }`, TypeBox `parameters` and `outputSchema`, `structuredContent` mirror. |
|
|
193
207
|
| Command | `/check [target]` with `getArgumentCompletions` for the four targets; reports through `ctx.ui.notify`. |
|
|
194
208
|
| State | None persisted. The runtime closure owns the single active child, its controller, and the live line buffer; `session_shutdown` aborts it. |
|
|
@@ -249,5 +263,6 @@ Co-located tests cover config clamps, every detector family, the runner's
|
|
|
249
263
|
streaming/timeout/cancel/log cap, the parsers, command planning, aggregation,
|
|
250
264
|
the tool's output contract and transcript block, the command's guards and
|
|
251
265
|
headless path, and both screens' keys and width bounds.
|
|
252
|
-
`extensions/check/
|
|
253
|
-
so the process path is exercised without depending on Bun or a test
|
|
266
|
+
`extensions/check/extension.test.ts` runs a real Node script through the
|
|
267
|
+
extension, so the process path is exercised without depending on Bun or a test
|
|
268
|
+
framework.
|
|
@@ -5,37 +5,41 @@ the conversation is too full, the report is where you decide to compact. It is
|
|
|
5
5
|
command-only on purpose — no tool is declared, so the model's prompt budget is
|
|
6
6
|
untouched.
|
|
7
7
|
|
|
8
|
+
## Capabilities
|
|
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 |
|
|
24
|
+
|
|
25
|
+
## Quickstart
|
|
26
|
+
|
|
8
27
|
```bash
|
|
9
28
|
pi --extension ./extensions/context # load just this extension
|
|
10
29
|
pi -e . # load the whole @gavin-hu/my-pi-agent package
|
|
11
30
|
pi install ./ # install the package
|
|
12
31
|
```
|
|
13
32
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Reports Pi's own estimate first — tokens, window, percentage, free space, the
|
|
19
|
-
auto-compaction threshold, and the headroom left before it while compaction is
|
|
20
|
-
on — then the composition under a header that names the composition's own
|
|
21
|
-
estimate: the system prompt, the active tool definitions, the conversation by
|
|
22
|
-
role, injected pack context grouped by type, summaries, and shell output.
|
|
23
|
-
- Names the difference between Pi's total and the composition estimate instead
|
|
24
|
-
of forcing the parts to add up: one line with both figures, `unattributed` when
|
|
25
|
-
the host's total is the larger one, and `host counts messages only` before the
|
|
26
|
-
first reply, when Pi's fallback leaves the prompt and the tools out.
|
|
27
|
-
- Rounds each bar to the nearest cell, so a bar sits within half a cell of the
|
|
28
|
-
percentage printed beside it; the percentage itself is exact.
|
|
29
|
-
- Reads the branch's compaction history: how many compactions there have been,
|
|
30
|
-
what the newest one cut from and to, and how much its summary costs.
|
|
31
|
-
- Lists the five largest single messages, so a report that is mostly one tool
|
|
32
|
-
result says so.
|
|
33
|
-
- Compacts from the report: `c` on the screen asks first, `/context compact
|
|
34
|
-
[instructions]` runs directly. Both refuse while the agent is busy — a
|
|
35
|
-
streaming turn or a running compaction.
|
|
33
|
+
```text
|
|
34
|
+
/context # the report
|
|
35
|
+
/context compact focus on the parser # compact from it, with instructions
|
|
36
|
+
```
|
|
36
37
|
|
|
37
38
|
## Commands
|
|
38
39
|
|
|
40
|
+
One command, two forms: `/context` reports, `/context compact` acts on the
|
|
41
|
+
report.
|
|
42
|
+
|
|
39
43
|
| Command | What it does |
|
|
40
44
|
|---|---|
|
|
41
45
|
| `/context` | The report: a screen in the TUI, a notification elsewhere |
|
|
@@ -67,6 +71,18 @@ largest messages. `/context compact` is the same in every mode and reports throu
|
|
|
67
71
|
|
|
68
72
|
## How the numbers are computed
|
|
69
73
|
|
|
74
|
+
The report gives Pi's own estimate first — tokens, window, percentage, free
|
|
75
|
+
space, the auto-compaction threshold, and the headroom left before it while
|
|
76
|
+
compaction is on — then the composition under a header that names the
|
|
77
|
+
composition's own estimate.
|
|
78
|
+
|
|
79
|
+
It names the difference between Pi's total and the composition estimate instead
|
|
80
|
+
of forcing the parts to add up: one line with both figures, `unattributed` when
|
|
81
|
+
the host's total is the larger one, and `host counts messages only` before the
|
|
82
|
+
first reply, when Pi's fallback leaves the prompt and the tools out. Each bar
|
|
83
|
+
rounds to the nearest cell, so a bar sits within half a cell of the percentage
|
|
84
|
+
printed beside it; the percentage itself is exact.
|
|
85
|
+
|
|
70
86
|
| Row | Source |
|
|
71
87
|
|---|---|
|
|
72
88
|
| 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. |
|
|
@@ -76,6 +92,7 @@ largest messages. `/context compact` is the same in every mode and reports throu
|
|
|
76
92
|
| Tool definitions | `pi.getAllTools()` filtered to `pi.getActiveTools()`, over each active tool's name, description, and parameter schema at characters/4. `promptGuidelines` are counted in the system prompt instead, because Pi renders them into its rules section. |
|
|
77
93
|
| Conversation rows | `sessionManager.buildSessionProjection().messages`, each counted with Pi's own `estimateTokens` (characters/4; an image is 4800 characters; a tool call is its name plus its JSON arguments). |
|
|
78
94
|
| Injected context | `custom` messages grouped by `customType`, biggest first; the five largest types are named and the rest fold into one row. |
|
|
95
|
+
| Largest messages | The five highest `estimateTokens` values in the projection, each with its role and a bounded descriptor: a tool name, a custom type, a command, or the first line of text. |
|
|
79
96
|
| Threshold | `compaction.modelOverrides["provider/id"]`, then `compaction`, then `DEFAULT_COMPACTION_SETTINGS` — the same three-step fallback Pi uses. |
|
|
80
97
|
| Compaction history | `getLatestCompactionEntry(branch)` and the branch's `compaction` count. The summary's cost is the summary text at characters/4. |
|
|
81
98
|
| Drift | `tokens - estimate`, printed with both figures. A positive value appends `+… unattributed` — usage the rows do not explain; a negative one appends `host counts messages only` while the projection holds no assistant message, because Pi's message-only fallback omits the system prompt and the tool definitions. |
|
|
@@ -119,7 +136,7 @@ largest messages. `/context compact` is the same in every mode and reports throu
|
|
|
119
136
|
|
|
120
137
|
| Contract | Detail |
|
|
121
138
|
|---|---|
|
|
122
|
-
| Registration | The default export registers the `/context` command and nothing else. No tool, no flag, no shortcut, no session hook. |
|
|
139
|
+
| Registration | The default export registers the `/context` command and nothing else, behind the `PI_DISABLED_EXTENSIONS` gate. No tool, no flag, no shortcut, no session hook. |
|
|
123
140
|
| Tool surface | None. Command-only, so there is no `promptSnippet`, `annotations`, `executionMode`, or `outputSchema`. |
|
|
124
141
|
| Host reads | `ctx.getContextUsage()`, `ctx.getSystemPrompt()`, `ctx.model`, `ctx.isIdle()`, `ctx.sessionManager.buildSessionProjection()` / `getBranch()`, `pi.getActiveTools()` / `getAllTools()` / `getSettings()`. All in `collect.ts`. |
|
|
125
142
|
| Action | `ctx.compact({ customInstructions, onComplete, onError })`. It is fire-and-forget; the callbacks repaint the screen or notify the command's caller. |
|