@henryqw/pi-herdr-tools 1.1.0 → 1.2.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 +21 -2
- package/extensions/index.ts +23 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@henryqw/pi-herdr-tools`
|
|
2
2
|
|
|
3
|
-
Clone a conversation into a Herdr tab or worktree, ask a side question and merge its answer back, name the conversation, and finish the worktree safely. One package and one extension entry point provide `/clone-tab`, `/clone-worktree`, `/btw`, `/rename`, and `/done`.
|
|
3
|
+
Clone a conversation into a Herdr tab or worktree, ask a side question and merge its answer back, name the conversation, and finish the worktree safely. One package and one extension entry point provide `/clone-tab`, `/clone-worktree`, `/btw`, `/rename`, and `/done`. Herdr also shows the pane as blocked while a Pi dialog waits for your answer.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ pi install npm:@henryqw/pi-task-models
|
|
|
11
11
|
pi install npm:@henryqw/pi-herdr-tools
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Requires Pi 1.1.0 or later in the 1.x series and Herdr 0.7.4+. Herdr operations require a Herdr-managed Pi pane; outside Herdr, rename still sets the Pi session title. Run `/task-models`, configure `fast`, and verify it no longer says `not configured` before using title generation or side threads.
|
|
14
|
+
Requires Pi 1.1.0 or later in the 1.x series and Herdr 0.7.4+. Herdr operations require a Herdr-managed Pi pane; outside Herdr, rename still sets the Pi session title. Run `/task-models`, configure `fast`, and verify it no longer says `not configured` before using title generation or side threads. Dialog status also requires Herdr's own Pi integration (`~/.pi/agent/extensions/herdr-agent-state.ts`), which Herdr installs; this package only publishes the status event.
|
|
15
15
|
|
|
16
16
|
### Migrating from the merged packages
|
|
17
17
|
|
|
@@ -58,6 +58,7 @@ Run `/clone-tab` to open a new Herdr tab with a clone of the active conversation
|
|
|
58
58
|
| Rename progress and result widgets | ui | For people who run `/rename`: shows `renaming...`, then `renamed to <title>` for two seconds on success. |
|
|
59
59
|
| First real user prompt | ui | For people in a new, untitled conversation: starts title generation once the expanded prompt is ready. |
|
|
60
60
|
| `pi-herdr-rename/rename` | model task | Title-generation route; users configure its profile through `/task-models`. |
|
|
61
|
+
| Dialog blocked status | ui | For people watching Herdr: while a TUI dialog is open, the pane shows blocked with the label `Input required`. |
|
|
61
62
|
|
|
62
63
|
### Clone conversations and finish worktrees
|
|
63
64
|
|
|
@@ -73,6 +74,18 @@ From a Herdr-managed Pi pane with a conversation, run `/btw Why is this test fai
|
|
|
73
74
|
|
|
74
75
|
In a new, untitled conversation, send the first real prompt. Pi generates a title in the background without delaying the reply.
|
|
75
76
|
|
|
77
|
+
### Show open dialogs in Herdr
|
|
78
|
+
|
|
79
|
+
When any extension opens a select, confirm, input, editor, or custom dialog in Pi's interactive TUI, Herdr marks the pane as blocked with the fixed label `Input required`. The status clears when the dialog is answered, cancelled, or fails. This covers dialogs from other packages too, for example `pi-memory` review conflicts, `/task-models`, `/pr`, and `/cron`. This bridge never sends dialog titles or content to Herdr.
|
|
80
|
+
|
|
81
|
+
| Mode | Dialog status |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Interactive TUI | Reported. |
|
|
84
|
+
| RPC, even when the client provides UI | Not reported. |
|
|
85
|
+
| JSON and print | Not reported. |
|
|
86
|
+
|
|
87
|
+
Nested dialogs count as one block. `ask_question` from `@henryqw/pi-ask-question` publishes its own status; the two overlap without clearing each other early.
|
|
88
|
+
|
|
76
89
|
## Flow
|
|
77
90
|
|
|
78
91
|
### Clone conversations and finish worktrees
|
|
@@ -205,3 +218,9 @@ Display titles are natural task phrases, preferably two or three words, and alwa
|
|
|
205
218
|
A missing shared task-model config warns once at session start. Run `/task-models` to configure rename routing. No viable route leaves titles unchanged. `/rename` warns if the session has no user text to rename.
|
|
206
219
|
|
|
207
220
|
Herdr and Git synchronization failures appear as warnings. Fix the reported issue, then run `/rename` to try again. Cancellation by a newer rename remains silent. Older titles receive no migration.
|
|
221
|
+
|
|
222
|
+
### Dialog status
|
|
223
|
+
|
|
224
|
+
- Without Herdr's Pi integration, the status event has no listener and Herdr shows no blocked state.
|
|
225
|
+
- On `/reload`, session switch, or exit, this package clears any block it still holds once. Pi can hide a dialog that was open during reload; that old dialog no longer affects Herdr status, and late events from it are ignored.
|
|
226
|
+
- Another listener of the same event can still show blocked status for its own reasons; this package clears only its own contribution.
|
package/extensions/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import registerBtwExtension from "../internal/btw.ts";
|
|
3
3
|
import herdrCloneExtension from "../internal/clone-tab.ts";
|
|
4
4
|
import herdrDoneExtension from "../internal/done.ts";
|
|
@@ -9,4 +9,26 @@ export default async function herdrToolsExtension(pi: ExtensionAPI): Promise<voi
|
|
|
9
9
|
await registerBtwExtension(pi);
|
|
10
10
|
herdrCloneExtension(pi);
|
|
11
11
|
herdrDoneExtension(pi);
|
|
12
|
+
registerDialogStatus(pi);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Report open TUI dialogs through Herdr's blocked-status event, contributing at most one block. */
|
|
16
|
+
function registerDialogStatus(pi: ExtensionAPI): void {
|
|
17
|
+
// An earlier async ui_prompt_start handler can delay this start until after its end,
|
|
18
|
+
// so a signed balance returns to zero instead of leaving a stale block.
|
|
19
|
+
let balance = 0;
|
|
20
|
+
let closed = false;
|
|
21
|
+
const track = (delta: 1 | -1) => (_event: unknown, ctx: ExtensionContext) => {
|
|
22
|
+
if (closed || ctx.mode !== "tui") return;
|
|
23
|
+
const wasBlocked = balance > 0;
|
|
24
|
+
balance += delta;
|
|
25
|
+
if ((balance > 0) === wasBlocked) return;
|
|
26
|
+
pi.events.emit("herdr:blocked", wasBlocked ? { active: false } : { active: true, label: "Input required" });
|
|
27
|
+
};
|
|
28
|
+
pi.on("ui_prompt_start", track(1));
|
|
29
|
+
pi.on("ui_prompt_end", track(-1));
|
|
30
|
+
pi.on("session_shutdown", () => {
|
|
31
|
+
closed = true;
|
|
32
|
+
if (balance > 0) pi.events.emit("herdr:blocked", { active: false });
|
|
33
|
+
});
|
|
12
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-herdr-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Clone, name, and finish Pi conversations in Herdr, with mergeable side questions.",
|
|
5
5
|
"keywords": ["pi-package", "pi", "herdr", "session", "clone", "side-thread", "title"],
|
|
6
6
|
"type": "module",
|