pi-do-always 0.13.0 → 0.16.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
CHANGED
|
@@ -20,6 +20,7 @@ type to filter, scroll or click, or navigate with arrows + Enter → the task's
|
|
|
20
20
|
|`/do-always review changes`|Fill the prompt for the task named `review changes` (task names autocomplete after `/do-always`)|
|
|
21
21
|
|`/do-always list`|Print the task list|
|
|
22
22
|
|`/do-always list-details`|Show the full rendered prompt text each task will inject|
|
|
23
|
+
|`/do-always replan`|Re-open the plan questionnaire for the last offered proposal (e.g. after an accidental Esc)|
|
|
23
24
|
|
|
24
25
|
The selector supports direct number-pick (1-9), live type-to-filter, arrow/Enter navigation,
|
|
25
26
|
mouse-wheel scrolling, and click-to-select. While a filter is active, typed digits refine the
|
|
@@ -136,6 +137,68 @@ substituted in; any other prompt gets the block appended under
|
|
|
136
137
|
the latest commit is selected and the first eligible `Plan` task (not
|
|
137
138
|
`notForCommits`) whose guards pass runs on it.
|
|
138
139
|
|
|
140
|
+
## Plan questionnaire
|
|
141
|
+
|
|
142
|
+
Auto-run `Plan` tasks (⚡) are asked to end their reply with a
|
|
143
|
+
machine-readable `plan` block: a one-line summary plus the proposed action
|
|
144
|
+
items grouped into priority tiers (`P0`, `P1`, …). When the run settles, the
|
|
145
|
+
reply is parsed and — if a plan block is present — a **questionnaire** opens
|
|
146
|
+
in the TUI. The block is the data channel, but by default it is hidden: as
|
|
147
|
+
soon as the reply is finalized, the extension strips the block from the
|
|
148
|
+
transcript in the TUI (the prose around it is the human-facing summary), so
|
|
149
|
+
the conversation stays clean — the questionnaire still works, because the
|
|
150
|
+
raw text is captured before the strip. In non-TUI modes the block stays in
|
|
151
|
+
the transcript, so the model can resolve the item-number replies the
|
|
152
|
+
notification offers. Set `hidePlan` to `false` (per task or
|
|
153
|
+
globally) to keep the block visible. With the questionnaire disabled the
|
|
154
|
+
block is not requested at all:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
Plan proposal — Review changes
|
|
158
|
+
2 critical bugs, 3 cleanups
|
|
159
|
+
|
|
160
|
+
[·] P0 — Critical (0/2)
|
|
161
|
+
· Fix null deref in parse()
|
|
162
|
+
· Validate input length
|
|
163
|
+
[◐] P1 — Important (1/3)
|
|
164
|
+
✓ Remove unused imports
|
|
165
|
+
· Drop dead config flag
|
|
166
|
+
· Tighten error message
|
|
167
|
+
|
|
168
|
+
─────────────────────────────
|
|
169
|
+
Confirm (1/5)
|
|
170
|
+
space/⏎ toggle • a all • ctrl+u clear • e note • ⏎ confirm • esc withdraw
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- **↑/↓** (wrapping), **Home/End** move the cursor; **Space** or **Enter**
|
|
174
|
+
toggles the row under the cursor — a tier row toggles the whole tier
|
|
175
|
+
(`·` none → `◐` partial → `✓` all), an item row toggles just that item.
|
|
176
|
+
- **a** (or **Ctrl+A**) selects everything; **Ctrl+U** clears the selection.
|
|
177
|
+
- **e** on an item row opens a note editor for that item (Enter saves, Esc
|
|
178
|
+
cancels). The note is shown on the row (`✎ …`) and appended to that item
|
|
179
|
+
in the execution prompt — a way to steer an item without retyping it.
|
|
180
|
+
- Long plans scroll: the list shows 12 rows at a time and the window follows
|
|
181
|
+
the cursor (**↑/↓**, **Home/End**, or the mouse wheel); a `(n/N)` marker
|
|
182
|
+
shows the position. The `Confirm` row stays pinned.
|
|
183
|
+
- **Enter** (or a mouse click) on the pinned `Confirm (n/N)` row sends the
|
|
184
|
+
selection as a single follow-up turn: the agent executes exactly the
|
|
185
|
+
selected items, in tier order, and nothing else. **Esc** withdraws —
|
|
186
|
+
nothing is sent and the proposal is kept in memory; re-open it with
|
|
187
|
+
`/do-always replan` (an accidental Esc is cheap to undo).
|
|
188
|
+
- Mouse: clicking a tier/item row toggles it; clicking the Confirm row
|
|
189
|
+
confirms.
|
|
190
|
+
|
|
191
|
+
Nothing is preselected. A Plan run that finds nothing to do replies with an
|
|
192
|
+
empty tier list, and you just get the usual one-line summary. If the reply
|
|
193
|
+
has no parseable `plan` block, the questionnaire is disabled, or the mode is
|
|
194
|
+
not the TUI, the extension falls back to the plain summary notification —
|
|
195
|
+
and when a questionnaire was expected, the notification says why (no plan
|
|
196
|
+
block in the reply, or the block is not valid JSON), so a fallback is never
|
|
197
|
+
a silent mystery. In non-TUI modes a parseable proposal is listed as a
|
|
198
|
+
notification instead, so you can reply with the item numbers to execute. The
|
|
199
|
+
questionnaire is offered only on the single auto-run path (selector pick,
|
|
200
|
+
`/do-always <n>`, commit picker) — chain steps never get it.
|
|
201
|
+
|
|
139
202
|
## Install
|
|
140
203
|
|
|
141
204
|
Install it from npm as a Pi package, which loads the bundled `index.ts` (and its `tasks.ts`) without
|
|
@@ -190,6 +253,8 @@ Fields:
|
|
|
190
253
|
- `browser` (optional) — a browser to open on selection instead of injecting the prompt. Only `"commits"` is supported: it opens the date-grouped commit browser, and after the selection the task runs on the selected commits — directly when its prompt references `{{selected_commits}}`, otherwise via a picker of `Plan` tasks (see [Commit browser](#commit-browser)). An invalid value is ignored with a warning.
|
|
191
254
|
- `hidden` (optional) — when `true`, the task is not shown in the selector or in `/do-always list` / `list-details`. Unlike a `when` condition, a hidden task can still be run by name (`/do-always <name>`), and it is offered as a candidate by the commit picker. The built-in `Review commits` uses this: it is a pick-after-browse option, not a standalone entry.
|
|
192
255
|
- `notForCommits` (optional) — when `true`, the task is excluded from the commit picker (the “run on the selected commits” list) because it does not operate on a set of commits. The task is otherwise unaffected (selector, lists, CLI). The built-in `Review changes`, `Review code`, and `Propose features` use this.
|
|
256
|
+
- `questionnaire` (optional) — whether the plan questionnaire is offered after this task's completed run (see [Plan questionnaire](#plan-questionnaire)). Default `true`; set `false` to keep the plain summary notification.
|
|
257
|
+
- `hidePlan` (optional) — whether the raw `plan` block is hidden from the transcript after this task's completed run: the fenced block is stripped from the finalized reply (TUI only — in non-TUI modes the block is always kept so the model can resolve item-number replies). Default `true`; set `false` to keep the block visible in the conversation.
|
|
193
258
|
- `when` (optional) — a condition that hides the task from the selector and lists when it is not met (see [Conditionals](#conditionals)).
|
|
194
259
|
- `guards` (optional) — an array of selection-time guards that block the task (with a message, not a hide) when a condition is unmet (see [Guards](#guards)). The legacy `requireDirty` (boolean) still works and is combined with any `guards`.
|
|
195
260
|
|
|
@@ -198,6 +263,8 @@ In the object form you can also configure the selector shortcut:
|
|
|
198
263
|
- `shortcut` (optional) — key that opens the selector, e.g. `"f4"`. Set to `null` to disable the shortcut. Defaults to `F4`. The project file's value wins over the global one.
|
|
199
264
|
- `merge` (optional) — how project tasks combine with the global tasks: `"override"` (default) replaces a global task with the same `name`; `"append"` keeps the global tasks and only adds new project task names (a cascade, like CSS). The project file's value wins over the global one; when neither sets it, the default is `override` (the historical behavior).
|
|
200
265
|
- `report` (optional) — whether chain runs write a Markdown report file in the project root (one per run, appended as each step finishes). Default `true`; set `false` to disable. The project file's value wins over the global one. See [Chains](#chains).
|
|
266
|
+
- `questionnaire` (optional) — whether completed auto-run tasks whose reply carries a plan block offer the selection questionnaire. Default `true`; set `false` to keep the plain summary notification. The project file's value wins over the global one. See [Plan questionnaire](#plan-questionnaire).
|
|
267
|
+
- `hidePlan` (optional) — whether the raw `plan` block is stripped from the transcript after a completed auto-run task (TUI only — in non-TUI modes the block is always kept). Default `true`; set `false` to keep the block visible in the conversation. The project file's value wins over the global one.
|
|
201
268
|
|
|
202
269
|
Example project file that only *adds* tasks without overriding the global set:
|
|
203
270
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"category": "Ops",
|
|
81
81
|
"description": "Prepare a release (version, changelog, tag)",
|
|
82
82
|
"when": "git",
|
|
83
|
-
"prompt": "Prepare a release for this project (branch {{branch}}): check `git log` since the last tag,
|
|
83
|
+
"prompt": "Prepare a release for this project (branch {{branch}}): check `git log` since the last tag, then bump the version in package.json (or the equivalent location) to the next version, and add a changelog entry under that exact version summarizing the changes. The changelog entry must use the same version number now set in package.json — never add a changelog section for a version that package.json does not yet contain, and never leave an 'Unreleased' or placeholder version heading. Create a git tag if git present. Do not push."
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"name": "Commit",
|