@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
|
@@ -4,37 +4,48 @@ A single model-facing tool, `ask_user_question`, that lets the model ask the
|
|
|
4
4
|
human one or more structured questions mid-turn and wait for typed answers.
|
|
5
5
|
Modelled on Claude Code's `AskUserQuestion`.
|
|
6
6
|
|
|
7
|
-
<img src="../../assets/question.png" alt="The ask_user_question dialog: Auth and Scope tabs, a question, four numbered options with descriptions, and the navigation hint" width="100%">
|
|
7
|
+
<img src="../../assets/screens/question.png" alt="The ask_user_question dialog: Auth and Scope tabs, a question, four numbered options with descriptions, and the navigation hint" width="100%">
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Capabilities
|
|
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
|
+
| Mid-turn asking | `ask_user_question` | The model asks 1–4 questions and the turn waits until you answer or cancel. | Shipped |
|
|
16
|
+
| Labelled options | `questions[].options` | Each question offers up to four choices, each with an optional second line describing it. | Shipped |
|
|
17
|
+
| Free-form answers | the automatic `Other (type something)` row, `questions[].options` omitted | You can type an answer the options do not cover, and a question with no options asks for plain text. | Shipped |
|
|
18
|
+
| Multiple selections | `questions[].multiSelect` | `Space` toggles options and `Enter` confirms the set. | Shipped |
|
|
19
|
+
| Batched questions | `questions[]` | Up to four questions ride in one call and are answered in one pass. | Shipped |
|
|
20
|
+
| Submit gating | the `Submit` tab | Submit refuses until every question is answered and names the missing ones; a single question submits on `Enter` without a Submit tab. | Shipped |
|
|
21
|
+
| Tab headers | `questions[].header` | Each question gets a short tab label, defaulted to `Q{n}` and clipped to 12 columns. | Shipped |
|
|
22
|
+
| Language-aware batch | `dialogUI.language` | A remote turn in Chinese gets the batch prompt, retry text, and format line in Chinese. | Shipped |
|
|
23
|
+
| Dialog fallback | `select`, `input`, `editor` | RPC and remote turns answer the same questions without the TUI screen. | Shipped |
|
|
24
|
+
| No-UI degradation | `print`, `json` | The tool returns `unavailable` with an error instead of hanging when no dialog channel exists. | Shipped |
|
|
25
|
+
| Cancelling | `Esc` | The model is told you cancelled and can continue or ask in prose. | Shipped |
|
|
26
|
+
| Branch-scoped answers | tool-result `details` | The answers stay with the transcript, so `/resume` and `/tree` show the same history. | Shipped |
|
|
27
|
+
|
|
28
|
+
## Quickstart
|
|
29
|
+
|
|
30
|
+
```bash
|
|
10
31
|
pi --extension ./extensions/question # load just this extension
|
|
11
32
|
pi -e . # load the whole @gavin-hu/my-pi-agent package
|
|
12
33
|
pi install ./ # install the package
|
|
13
34
|
```
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
The tool is declared in every session and activated where a UI exists, so ask
|
|
37
|
+
the model for a decision and the questionnaire takes the screen.
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
## Tool
|
|
18
40
|
|
|
19
41
|
<img src="../../assets/tools/ask_user_question.png" alt="The ask_user_question tool's call and result: the call line and an indented body with the question headers, the options, and the answers" width="100%">
|
|
20
42
|
|
|
21
|
-
## What it does
|
|
22
|
-
|
|
23
43
|
The model calls `ask_user_question` with 1–4 questions. Each question offers up
|
|
24
44
|
to four labelled options (plus an automatic **“Other (type something)”** free-form
|
|
25
45
|
entry); a question with no options asks for free-form text. The tool blocks until
|
|
26
46
|
the user answers or cancels, then returns the answers as text the model can act
|
|
27
47
|
on.
|
|
28
48
|
|
|
29
|
-
- Multiple questions: a tab bar, per-question answered indicators, and a Submit
|
|
30
|
-
tab that refuses to submit until every question is answered.
|
|
31
|
-
- `multiSelect: true`: `Space` toggles options, `Enter` confirms the set. On the
|
|
32
|
-
`Other` row `Space` opens the editor, like `Enter`.
|
|
33
|
-
- `Esc` cancels; the model receives “User cancelled the question.” and can
|
|
34
|
-
continue or ask in prose.
|
|
35
|
-
|
|
36
|
-
## Tool
|
|
37
|
-
|
|
38
49
|
| | |
|
|
39
50
|
|---|---|
|
|
40
51
|
| Name | `ask_user_question` |
|
|
@@ -87,22 +98,37 @@ ask_user_question 2 questions (Auth, Scope)
|
|
|
87
98
|
✓ Format: (wrote) json for logs
|
|
88
99
|
```
|
|
89
100
|
|
|
101
|
+
### The questionnaire
|
|
102
|
+
|
|
103
|
+
- Multiple questions: a tab bar, per-question answered indicators, and a Submit
|
|
104
|
+
tab that refuses to submit until every question is answered.
|
|
105
|
+
- `multiSelect: true`: `Space` toggles options, `Enter` confirms the set. On the
|
|
106
|
+
`Other` row `Space` opens the editor, like `Enter`.
|
|
107
|
+
- `Esc` cancels; the model receives “User cancelled the question.” and can
|
|
108
|
+
continue or ask in prose.
|
|
109
|
+
|
|
90
110
|
## Behaviour by mode
|
|
91
111
|
|
|
92
|
-
| Mode |
|
|
112
|
+
| Mode | Behaviour |
|
|
93
113
|
|---|---|
|
|
94
114
|
| Interactive TUI (local turn) | Full tabbed questionnaire with descriptions, multi-select, and an inline editor |
|
|
95
115
|
| RPC (`hasUI`) | Forwarded dialogs: `select` per question, `input` for “Other”/free-form, `editor` for multi-select |
|
|
96
116
|
| Remote turn (WeChat) | Same forwarded dialogs, routed to the remote channel by the `ctx.ui` adapter; the full-screen component is skipped |
|
|
97
117
|
| `print` / `json` | The tool is registered inactive (`defaultActive: false`) and never switched on; if invoked anyway it returns a clear error telling the model to ask in prose |
|
|
98
118
|
|
|
119
|
+
On a dialog-only host, two or more questions become one batch editor prompt and
|
|
120
|
+
one reply (`1: 2; 2: A, B`), with one retry if the format is unclear; the TUI
|
|
121
|
+
keeps its tabbed screen.
|
|
122
|
+
|
|
99
123
|
Whether a turn uses the rich component or dialogs is decided by
|
|
100
|
-
`askHuman(ctx, { custom, dialogs })` from
|
|
101
|
-
`ctx.mode`; a
|
|
124
|
+
`askHuman(ctx, { custom, dialogs })` from
|
|
125
|
+
[`lib/interaction.ts`](../../lib/interaction.ts), not by reading `ctx.mode`; a
|
|
126
|
+
remote-answered turn reports no custom-UI support.
|
|
102
127
|
|
|
103
128
|
## Configuration
|
|
104
129
|
|
|
105
|
-
None
|
|
130
|
+
None. There are no keys: the tool is available exactly when the session has a
|
|
131
|
+
UI.
|
|
106
132
|
|
|
107
133
|
## Limitations
|
|
108
134
|
|
|
@@ -170,7 +196,7 @@ None in v1 — the tool is either available (a UI exists) or not.
|
|
|
170
196
|
- **Transcript rendering is driven by `details`.** `renderCall` summarises the
|
|
171
197
|
question count and headers and lists one option line per question;
|
|
172
198
|
`renderResult` renders `✓ Auth: 1. OAuth` per answer, `(wrote)` for custom
|
|
173
|
-
text, warning-
|
|
199
|
+
text, warning-coloured `Cancelled`, and error-coloured `No UI` when unavailable
|
|
174
200
|
(matching the result rail its `isError` draws). The call
|
|
175
201
|
summary reads the call's *streaming* args, so a field that has not arrived yet
|
|
176
202
|
— a question `header`, an option `label` — reads as absent instead of
|
|
@@ -181,14 +207,14 @@ None in v1 — the tool is either available (a UI exists) or not.
|
|
|
181
207
|
|
|
182
208
|
| File | Responsibility |
|
|
183
209
|
|---|---|
|
|
184
|
-
| `index.ts` | Extension factory: register the tool, gate it by UI availability |
|
|
185
|
-
| `schema.ts` | TypeBox parameters, validation, defaulting (pure) |
|
|
186
|
-
| `types.ts` | Shared raw/normalized types |
|
|
187
|
-
| `answers.ts` | Answer normalization and model-facing formatting (pure) |
|
|
188
|
-
| `tui-state.ts` | Pure keyboard/navigation state machine |
|
|
189
|
-
| `tui.ts` | Custom terminal component (render + input), drawn from the `lib/tui/` kit (`titleRule`/`plainRule`, `checkbox`, `flowCells`, `screenHint`, `editorTheme`). |
|
|
190
|
-
| `dialogs.ts` | `select`/`input`/`editor` fallback driver |
|
|
191
|
-
| `tools.ts` | Tool registration and transcript renderers |
|
|
210
|
+
| [`index.ts`](../../extensions/question/index.ts) | Extension factory: register the tool, gate it by UI availability |
|
|
211
|
+
| [`schema.ts`](../../extensions/question/schema.ts) | TypeBox parameters, validation, defaulting (pure) |
|
|
212
|
+
| [`types.ts`](../../extensions/question/types.ts) | Shared raw/normalized types |
|
|
213
|
+
| [`answers.ts`](../../extensions/question/answers.ts) | Answer normalization and model-facing formatting (pure) |
|
|
214
|
+
| [`tui-state.ts`](../../extensions/question/tui-state.ts) | Pure keyboard/navigation state machine |
|
|
215
|
+
| [`tui.ts`](../../extensions/question/tui.ts) | Custom terminal component (render + input), drawn from the `lib/tui/` kit (`titleRule`/`plainRule`, `checkbox`, `flowCells`, `screenHint`, `editorTheme`). |
|
|
216
|
+
| [`dialogs.ts`](../../extensions/question/dialogs.ts) | `select`/`input`/`editor` fallback driver |
|
|
217
|
+
| [`tools.ts`](../../extensions/question/tools.ts) | Tool registration and transcript renderers |
|
|
192
218
|
|
|
193
219
|
## Testing
|
|
194
220
|
|
|
@@ -2,92 +2,93 @@
|
|
|
2
2
|
|
|
3
3
|
Snapshot the working tree at the start of each task and return to an earlier
|
|
4
4
|
prompt from a menu — restoring the **code**, the **conversation**, or **both**.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
Snapshots are git commits under `refs/pi/rewind/<id>`, so restoring one rewrites
|
|
6
|
+
the working tree without touching the real index or moving HEAD, and a
|
|
7
|
+
conversation rewind moves Pi's session tree without erasing the branch you leave.
|
|
8
|
+
`/review` uses the same snapshot to show the latest turn's changes and revert a
|
|
9
|
+
file, a selection, or the whole turn.
|
|
10
|
+
|
|
11
|
+
<img src="../../assets/screens/rewind.png" alt="The /rewind screen: prompt rows newest first, a diamond marking prompts with a code snapshot, and a detail line naming the snapshot the focused prompt holds" width="100%">
|
|
12
|
+
|
|
13
|
+
## Capabilities
|
|
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
|
+
| Automatic snapshots | the `autoSnapshots` key | One snapshot per prompt, taken before its first mutating call, so every task has a restore point. | Shipped |
|
|
20
|
+
| Durable snapshots | `refNamespace` | Snapshots survive the session and are listed from git rather than from session state. | Shipped |
|
|
21
|
+
| Prompt timeline | `/rewind` | Every user prompt on the active branch, newest first, marked `⬥` where a code snapshot was captured. | Shipped |
|
|
22
|
+
| Scoped restore | `/rewind` | Code, conversation, or both, from the prompt you pick. | Shipped |
|
|
23
|
+
| Undoable restore | the `safetySnapshot` key | A code restore snapshots the state it replaces first, so it can itself be undone. | Shipped |
|
|
24
|
+
| Partial restore | `/rewind` | The changed paths grouped by directory, chosen with a checklist, and previewed as the subset you selected. | Shipped |
|
|
25
|
+
| Latest-turn review | `/review` | The changed files of the latest prompt, with `M`/`A`/`D`/`R` marks and line counts. | Shipped |
|
|
26
|
+
| File, batch, and hunk revert | `/review` | Revert one file, a selection, the whole turn, or chosen hunks, each with its own safety snapshot. | Shipped |
|
|
27
|
+
| Busy-git refusal | `/rewind`, `/review` | A merge, rebase, cherry-pick, revert, or bisect in progress refuses the restore instead of fighting it. | Shipped |
|
|
28
|
+
| Root-scoped snapshots | `refs/pi/rewind` | Worktrees share the ref store, while another root's snapshot is filtered out and refused. | Shipped |
|
|
29
|
+
| Untracked capture | `autoSnapshots` | Non-ignored untracked files are captured, and a restore removes the ones that appeared after the snapshot. | Shipped |
|
|
30
|
+
| Ref cap and auto-prune | `max`, `autoPrune` | The snapshot store is bounded and pruned instead of growing without limit. | Shipped |
|
|
31
|
+
| Review plan guard | `/review` in plan mode | Review refuses while plan mode is on, matching the read-only planning rule. | Shipped |
|
|
32
|
+
| Prompt-count chip | `↺ N`, the `showStatus` key | The status bar counts the prompts on the active branch, whether or not each has a snapshot. | Shipped |
|
|
33
|
+
|
|
34
|
+
## Quickstart
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pi --extension ./extensions/rewind # load just this extension
|
|
21
38
|
pi -e . # load the whole @gavin-hu/my-pi-agent package
|
|
22
39
|
pi install ./ # install the package
|
|
23
40
|
```
|
|
24
41
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `/review` compares the working tree with the snapshot taken before the latest
|
|
30
|
-
prompt on the active branch. The file list carries `M`/`A`/`D`/`R` and line
|
|
31
|
-
counts; `Enter` opens a scrollable patch, `Space` selects files, `r` reverts
|
|
32
|
-
the selection (or the focused file when nothing is selected), and `R` reverts
|
|
33
|
-
every changed path. A modified text file's diff offers `h`, which opens a hunk
|
|
34
|
-
checklist; the chosen hunks revert as one reverse patch with its own
|
|
35
|
-
pre-restore safety snapshot. A rename is one `R` row, so reverting it restores
|
|
36
|
-
the old path and removes the new one together. A selected batch is one restore
|
|
37
|
-
and one pre-restore safety snapshot, not one per file. When the working tree
|
|
38
|
-
matches HEAD, the screen says the changes are already committed and a revert
|
|
39
|
-
leaves the commits in place.
|
|
40
|
-
- `/rewind` lists **every user prompt on the active branch** (newest first), each
|
|
41
|
-
marked `⬥` when a code snapshot was captured for it.
|
|
42
|
-
- Picking a point asks what to restore: **Code and conversation**,
|
|
43
|
-
**Conversation only**, or **Code only**.
|
|
44
|
-
- *Code* rewrites the working tree to the snapshot and is itself undoable
|
|
45
|
-
(a `pre-restore` safety snapshot is taken first).
|
|
46
|
-
- When code moves, a second step asks **Restore what?** — **Everything (N
|
|
47
|
-
files)** or **Choose paths…**. The checklist lists every changed path
|
|
48
|
-
grouped by directory (`M` modified, `D` deleted since the snapshot, `A`
|
|
49
|
-
created after it, `R` renamed), with all of them selected, so `Enter` twice
|
|
50
|
-
reproduces a whole-tree restore. `Space` toggles a file or a directory,
|
|
51
|
-
`a`/`n` select all/none, and the confirm that follows previews only the
|
|
52
|
-
chosen subset.
|
|
53
|
-
- *Conversation* moves the session tree back to that prompt and puts the
|
|
54
|
-
prompt text back in the editor; the abandoned branch stays in the session.
|
|
55
|
-
- Shows a `↺ N` status chip counting the prompts on the active branch — the
|
|
56
|
-
same points `/rewind` lists (its list size), whether or not each has a code
|
|
57
|
-
snapshot.
|
|
58
|
-
- Stores metadata in the commit body, so snapshots survive across sessions and
|
|
59
|
-
are listed from git rather than from session state.
|
|
42
|
+
```text
|
|
43
|
+
/rewind # pick a prompt, then a scope, then the paths
|
|
44
|
+
/review # the latest turn's changes, ready to revert
|
|
45
|
+
```
|
|
60
46
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
directory, a snapshot taken inside a [`worktree`](../worktree/) is visible from
|
|
64
|
-
the main checkout; `list`/matching filter to the current root by default.
|
|
47
|
+
Nothing is registered for the model: snapshots are taken automatically, and both
|
|
48
|
+
commands are user-driven.
|
|
65
49
|
|
|
66
|
-
##
|
|
50
|
+
## Commands
|
|
67
51
|
|
|
68
52
|
| Command | What it does |
|
|
69
53
|
|---|---|
|
|
70
54
|
| `/rewind` | Open the timeline; pick a prompt, then a restore scope, then (for code) the paths. |
|
|
71
55
|
| `/review` | Review the latest prompt's changes; open a diff, select files with `Space`, revert the selection or all files, or revert chosen hunks with `h`. |
|
|
72
56
|
|
|
73
|
-
The
|
|
74
|
-
|
|
75
|
-
the
|
|
57
|
+
The timeline is keyboard-driven: `↑`/`↓` or `j`/`k` move,
|
|
58
|
+
`PgUp`/`PgDn`/`Home`/`End` jump, `Enter` chooses the focused prompt, the mouse
|
|
59
|
+
wheel scrolls, and `Esc` closes. The scope choice and the confirmation (with a
|
|
60
|
+
diff preview) run after the screen closes. Picking a point asks what to restore:
|
|
61
|
+
**Code and conversation**, **Conversation only**, or **Code only**. A conversation
|
|
62
|
+
rewind moves the session tree back to that prompt and puts the prompt text back in
|
|
63
|
+
the editor; the abandoned branch stays in the session.
|
|
64
|
+
|
|
65
|
+
When code moves and more than one path changed, a second step asks **Restore
|
|
66
|
+
what?** — **Everything (N files)** or **Choose paths…**. The path checklist is
|
|
67
|
+
its own `ctx.ui.custom` screen: it lists every changed path grouped by directory
|
|
68
|
+
(`M` modified, `D` deleted since the snapshot, `A` created after it, `R`
|
|
69
|
+
renamed), with all of them selected, so `Enter` twice reproduces a whole-tree
|
|
70
|
+
restore. `Space` toggles a file or a directory, `a`/`n` select all or none, and
|
|
71
|
+
`Enter` returns the selection. The confirm that follows previews only the chosen
|
|
72
|
+
subset.
|
|
73
|
+
|
|
74
|
+
<img src="../../assets/screens/review.png" alt="The /review screen: changed files with M, A, and D marks, line counts, and the focused file's detail" width="100%">
|
|
75
|
+
|
|
76
|
+
`/review` compares the working tree with the snapshot taken before the latest
|
|
77
|
+
prompt on the active branch. The list is keyboard-driven too: `↑`/`↓` or `j`/`k`
|
|
78
|
+
move, `PgUp`/`PgDn` and `Home`/`End` jump, `Space` toggles the focused file,
|
|
79
|
+
`a`/`n` select all or none, `Enter` opens the focused file's diff, `r` reverts the
|
|
80
|
+
selection (or the focused file when nothing is selected), `R` reverts every
|
|
81
|
+
changed path, and `Esc` closes. A selected batch is one restore and one
|
|
82
|
+
pre-restore safety snapshot, not one per file. A rename is one `R` row, so
|
|
83
|
+
reverting it restores the old path and removes the new one together.
|
|
76
84
|
|
|
77
|
-
The timeline is keyboard-driven: `↑`/`↓` or `j`/`k` move, `PgUp`/`PgDn`/`Home`/`End`
|
|
78
|
-
jump, `Enter` chooses the focused prompt, the mouse wheel scrolls, `Esc` closes.
|
|
79
|
-
The scope choice and the confirmation (with a diff preview) run after the screen
|
|
80
|
-
closes. The path checklist is the same grammar: `Space` toggles, `a`/`n` select
|
|
81
|
-
all or none, `Enter` restores the selection, `Esc` cancels the rewind.
|
|
82
|
-
|
|
83
|
-
The review list is keyboard-driven too: `↑`/`↓` or `j`/`k` move, `PgUp`/`PgDn` and
|
|
84
|
-
`Home`/`End` jump, `Space` toggles the focused file, `a`/`n` select all or none,
|
|
85
|
-
`Enter` opens the focused file's diff, `r` reverts the selection (or the focused
|
|
86
|
-
file when nothing is selected), `R` reverts every changed path, and `Esc` closes.
|
|
87
85
|
In the diff, `j`/`k`, the arrows, `PgUp`/`PgDn`, and `g`/`G` scroll, `r` reverts
|
|
88
86
|
the file, and `Esc` goes back. A modified text file's diff offers `h` for the
|
|
89
87
|
hunk checklist: `Space` toggles, `a`/`n` select all or none, `Enter` reverts the
|
|
90
|
-
chosen hunks, and `Esc` cancels back to the diff.
|
|
88
|
+
chosen hunks, and `Esc` cancels back to the diff. The chosen hunks revert as one
|
|
89
|
+
reverse patch with its own pre-restore safety snapshot. When the working tree
|
|
90
|
+
matches HEAD, the screen says the changes are already committed and a revert
|
|
91
|
+
leaves the commits in place.
|
|
91
92
|
|
|
92
93
|
## Behaviour by mode
|
|
93
94
|
|
|
@@ -99,40 +100,32 @@ chosen hunks, and `Esc` cancels back to the diff.
|
|
|
99
100
|
|
|
100
101
|
## Configuration
|
|
101
102
|
|
|
102
|
-
The `rewind` section of the shared `bytefly.json
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"refNamespace": "refs/pi/rewind"
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
| Key | Meaning |
|
|
121
|
-
|---|---|
|
|
122
|
-
| `autoSnapshots` | Take one automatic snapshot per prompt. Default `true`. |
|
|
123
|
-
| `max` | Snapshot refs kept per root; automatic and pre-restore safety snapshots both count. |
|
|
124
|
-
| `includeUntracked` | Capture untracked, non-ignored files. |
|
|
125
|
-
| `safetySnapshot` | Save the current state before a code restore. |
|
|
126
|
-
| `autoPrune` | Delete the oldest refs beyond `max` after an automatic snapshot. |
|
|
127
|
-
| `showStatus` | Draw the `↺ N` status chip. |
|
|
128
|
-
| `watch` | Extra tool names to treat as mutating. |
|
|
129
|
-
| `ignore` | Tool names never to snapshot; this package's own tools are always excluded. |
|
|
130
|
-
| `refNamespace` | Ref namespace for stored snapshots. |
|
|
103
|
+
The `rewind` section of the shared `bytefly.json`; resolution rules are in
|
|
104
|
+
[`../configuration.md`](../configuration.md#rewind--snapshots).
|
|
105
|
+
|
|
106
|
+
| Key | Default | Meaning |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `autoSnapshots` | `true` | Take one automatic snapshot per prompt. |
|
|
109
|
+
| `max` | `20` | Snapshot refs kept per root; automatic and pre-restore safety snapshots both count. |
|
|
110
|
+
| `includeUntracked` | `true` | Capture untracked, non-ignored files. |
|
|
111
|
+
| `safetySnapshot` | `true` | Save the current state before a code restore. |
|
|
112
|
+
| `autoPrune` | `true` | Delete the oldest refs beyond `max` after an automatic snapshot. |
|
|
113
|
+
| `showStatus` | `true` | Draw the `↺ N` status chip. |
|
|
114
|
+
| `watch` | `[]` | Extra tool names to treat as mutating. |
|
|
115
|
+
| `ignore` | `[]` | Tool names never to snapshot; this package's own tools are always excluded. |
|
|
116
|
+
| `refNamespace` | `"refs/pi/rewind"` | Ref namespace for stored snapshots. |
|
|
131
117
|
|
|
132
118
|
A restore's safety snapshot is not pruned immediately, so the snapshot it
|
|
133
119
|
restored from stays available for a follow-up restore; the next automatic
|
|
134
120
|
snapshot applies the cap.
|
|
135
121
|
|
|
122
|
+
## What a snapshot captures
|
|
123
|
+
|
|
124
|
+
Snapshots include tracked files plus (by default) untracked, non-ignored files.
|
|
125
|
+
`.gitignore`d files are never captured. Because refs live in the shared git
|
|
126
|
+
directory, a snapshot taken inside a [`worktree`](./worktree.md) is visible from
|
|
127
|
+
the main checkout; `list`/matching filter to the current root by default.
|
|
128
|
+
|
|
136
129
|
## How snapshots are stored
|
|
137
130
|
|
|
138
131
|
Each snapshot is a commit under `refs/pi/rewind/<id>` whose body carries a
|
|
@@ -272,26 +265,26 @@ commit. These refs are not branches and are not touched by `git push --all`.
|
|
|
272
265
|
|---|---|
|
|
273
266
|
| `index.ts` | Registrar: wire the runtime, the commands, and the run-state module to Pi's events (`registerRewind`). |
|
|
274
267
|
| `types.ts` | `Snapshot`, `SnapshotReason`, `RestoreSummary`. |
|
|
275
|
-
| `config.ts` | Config defaults and merge/normalize over `lib/config.ts`. |
|
|
276
|
-
| `git.ts` | Single git entry point: rewind plumbing, the shared read helpers rewind consumes (name status, stat, patch, and `--numstat`), the reverse apply a hunk revert uses, and the production `RunGit`. |
|
|
277
|
-
| `snapshot.ts` | Create a snapshot (tree from a temporary index → commit → ref). |
|
|
278
|
-
| `snapshot-run.ts` | Per-run automatic-snapshot state: one snapshot per prompt, with a synchronous guard. |
|
|
279
|
-
| `restore.ts` | Plan and apply a working-tree rewind, whole or for a chosen subset of paths, recreating a rename's source and removing its destination. |
|
|
280
|
-
| `paths.ts` | Pure: the changed-path list from `git diff --name-status` (a rename is one paired entry), its directory grouping, the change marks, the `--numstat` counts, and the restore counts. |
|
|
281
|
-
| `checklist.ts` | The shared multi-select checklist screen: the cursor, `Space`/`a`/`n`/`Enter`, the height math, and the dock frame. The three checklists below supply only their rows and their words. |
|
|
282
|
-
| `path-picker.ts` | The partial restore's checklist, a `ChecklistScreen` over grouped paths: directory toggles, the change marks, and the selection it returns. |
|
|
283
|
-
| `patch.ts` | Pure: split a single-file unified diff into its header and hunks, and rebuild a patch from chosen hunks. |
|
|
284
|
-
| `hunk-picker.ts` | The hunk checklist a modified file's diff opens, a `ChecklistScreen` over the hunks: previews, the indices it returns, and its own row budget. |
|
|
285
|
-
| `store.ts` | Versioned metadata encoding and ref-backed listing/pruning. |
|
|
286
|
-
| `policy.ts` | Which tool calls are worth a snapshot. |
|
|
287
|
-
| `temp-index.ts` | Per-process `GIT_INDEX_FILE` paths: create, release, and sweep stale files. |
|
|
288
|
-
| `status.ts` | The `↺ N` status chip. |
|
|
289
|
-
| `queue.ts` | The serialized git operation queue for staging calls (`GIT_INDEX_FILE`). |
|
|
290
|
-
| `runtime.ts` | Root/config caches and the snapshot/list/plan/patch/numstat/restore/hunk-revert operations. |
|
|
291
|
-
| `timeline.ts` | Pure: prompts on the branch, paired with their snapshots. |
|
|
292
|
-
| `rewind.ts` | Scope choice, the path step, confirmation, and applying code + conversation rewind. |
|
|
293
|
-
| `review.ts` | The `/review` orchestration: the latest snapshot, the list/diff loop, the hunk step, confirmations, and the reverts. |
|
|
294
|
-
| `review-tui.ts` | The changed-file list (a `ChecklistScreen`) and the scrollable per-file diff, which offers the hunk checklist. |
|
|
295
|
-
| `rewind-tui.ts` | The selectable, width-safe timeline component, drawn from the `lib/tui/` kit (`titleRule`, `dockListFrame`, `listRow`, `emptyState`). |
|
|
296
|
-
| `commands.ts` | The `/rewind` and `/review` commands. |
|
|
297
|
-
| `format.ts` | Pure rewind and review text, including diff bounding and the hunk prompt. |
|
|
268
|
+
| `config/config.ts` | Config defaults and merge/normalize over `lib/config.ts`. |
|
|
269
|
+
| `transport/git.ts` | Single git entry point: rewind plumbing, the shared read helpers rewind consumes (name status, stat, patch, and `--numstat`), the reverse apply a hunk revert uses, and the production `RunGit`. |
|
|
270
|
+
| `transport/snapshot.ts` | Create a snapshot (tree from a temporary index → commit → ref). |
|
|
271
|
+
| `state/snapshot-run.ts` | Per-run automatic-snapshot state: one snapshot per prompt, with a synchronous guard. |
|
|
272
|
+
| `transport/restore.ts` | Plan and apply a working-tree rewind, whole or for a chosen subset of paths, recreating a rename's source and removing its destination. |
|
|
273
|
+
| `text/paths.ts` | Pure: the changed-path list from `git diff --name-status` (a rename is one paired entry), its directory grouping, the change marks, the `--numstat` counts, and the restore counts. |
|
|
274
|
+
| `view/checklist.ts` | The shared multi-select checklist screen: the cursor, `Space`/`a`/`n`/`Enter`, the height math, and the dock frame. The three checklists below supply only their rows and their words. |
|
|
275
|
+
| `view/path-picker.ts` | The partial restore's checklist, a `ChecklistScreen` over grouped paths: directory toggles, the change marks, and the selection it returns. |
|
|
276
|
+
| `text/patch.ts` | Pure: split a single-file unified diff into its header and hunks, and rebuild a patch from chosen hunks. |
|
|
277
|
+
| `view/hunk-picker.ts` | The hunk checklist a modified file's diff opens, a `ChecklistScreen` over the hunks: previews, the indices it returns, and its own row budget. |
|
|
278
|
+
| `transport/store.ts` | Versioned metadata encoding and ref-backed listing/pruning. |
|
|
279
|
+
| `state/policy.ts` | Which tool calls are worth a snapshot. |
|
|
280
|
+
| `transport/temp-index.ts` | Per-process `GIT_INDEX_FILE` paths: create, release, and sweep stale files. |
|
|
281
|
+
| `view/status.ts` | The `↺ N` status chip. |
|
|
282
|
+
| `transport/queue.ts` | The serialized git operation queue for staging calls (`GIT_INDEX_FILE`). |
|
|
283
|
+
| `state/runtime.ts` | Root/config caches and the snapshot/list/plan/patch/numstat/restore/hunk-revert operations. |
|
|
284
|
+
| `state/timeline.ts` | Pure: prompts on the branch, paired with their snapshots. |
|
|
285
|
+
| `commands/rewind.ts` | Scope choice, the path step, confirmation, and applying code + conversation rewind. |
|
|
286
|
+
| `commands/review.ts` | The `/review` orchestration: the latest snapshot, the list/diff loop, the hunk step, confirmations, and the reverts. |
|
|
287
|
+
| `view/review-tui.ts` | The changed-file list (a `ChecklistScreen`) and the scrollable per-file diff, which offers the hunk checklist. |
|
|
288
|
+
| `view/rewind-tui.ts` | The selectable, width-safe timeline component, drawn from the `lib/tui/` kit (`titleRule`, `dockListFrame`, `listRow`, `emptyState`). |
|
|
289
|
+
| `commands/commands.ts` | The `/rewind` and `/review` commands. |
|
|
290
|
+
| `text/format.ts` | Pure rewind and review text, including diff bounding and the hunk prompt. |
|