@abhishek944/pi-tasks 0.14.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.
Files changed (52) hide show
  1. package/README.md +59 -12
  2. package/dist/agents/delegation.d.ts +4 -0
  3. package/dist/agents/delegation.js +59 -0
  4. package/dist/agents/herdr.d.ts +10 -3
  5. package/dist/agents/herdr.js +39 -12
  6. package/dist/agents/links.d.ts +3 -3
  7. package/dist/agents/links.js +42 -19
  8. package/dist/auto-continue.js +160 -27
  9. package/dist/command.d.ts +2 -2
  10. package/dist/command.js +8 -4
  11. package/dist/delegated-time.d.ts +11 -0
  12. package/dist/delegated-time.js +51 -2
  13. package/dist/dependency.d.ts +7 -0
  14. package/dist/dependency.js +13 -0
  15. package/dist/durable.d.ts +38 -0
  16. package/dist/durable.js +515 -0
  17. package/dist/herdr-header.d.ts +3 -0
  18. package/dist/herdr-header.js +100 -0
  19. package/dist/herdr-panel.d.ts +7 -0
  20. package/dist/herdr-panel.js +182 -0
  21. package/dist/index.js +98 -56
  22. package/dist/markdown.js +3 -1
  23. package/dist/open-repository.d.ts +5 -3
  24. package/dist/open-repository.js +19 -5
  25. package/dist/panel-settings.d.ts +11 -0
  26. package/dist/panel-settings.js +30 -0
  27. package/dist/snapshot.d.ts +23 -0
  28. package/dist/snapshot.js +123 -0
  29. package/dist/state.d.ts +21 -18
  30. package/dist/state.js +357 -286
  31. package/dist/thoughts.d.ts +11 -0
  32. package/dist/thoughts.js +14 -0
  33. package/dist/timing.js +2 -1
  34. package/dist/tools.js +48 -29
  35. package/dist/tracking.js +18 -11
  36. package/dist/types.d.ts +9 -2
  37. package/dist/ui/panel.d.ts +2 -1
  38. package/dist/ui/panel.js +33 -21
  39. package/dist/ui/task-view.d.ts +7 -0
  40. package/dist/ui/task-view.js +10 -0
  41. package/dist/ui/works-dashboard.d.ts +3 -2
  42. package/dist/ui/works-dashboard.js +33 -24
  43. package/docs/REFERENCE.md +58 -30
  44. package/docs/USAGE_GUIDE.md +129 -51
  45. package/herdr/pi-tasks/README.md +45 -0
  46. package/herdr/pi-tasks/header.js +192 -0
  47. package/herdr/pi-tasks/main.js +413 -0
  48. package/herdr/pi-tasks/mod.json +3 -0
  49. package/herdr/pi-tasks/spinner.svg +1 -0
  50. package/package.json +26 -1
  51. package/dist/agents/tools.d.ts +0 -3
  52. package/dist/agents/tools.js +0 -143
@@ -1,20 +1,64 @@
1
1
  # pi-tasks usage
2
2
 
3
+ ## Session-only storage
4
+
5
+ Tasks belong only to the Pi session ID, not to conversation branches. Pi reads and atomically writes `<agent-directory>/tasks/<sessionId>.json`, normally `~/.pi/agent/tasks/<sessionId>.json`. The Pi TUI and native Herdr pane display the same document. Navigating the conversation tree never rolls tasks back. Resume/reload preserves the session file; a fork with a new session ID starts empty. Do not open the same session in multiple independent Pi writer processes.
6
+
7
+ Existing sessions without a task file import the selected legacy task view once, preserving old session history. Pre-upgrade forks with their own task edits migrate that old view. Fresh interactive and CLI forks start empty; copied-only legacy entries do not count as new-session tasks. Legacy fork migration may need its parent history file to distinguish inherited events; restore that file if migration reports it unavailable. Subsequent edits no longer append task events to that history. Back up the JSON file when upgrading or moving sessions; exporting/sharing conversation JSONL does not include this separate task file. Invalid or mismatched files are reported without overwriting them. If a file disappears after initialization, restore it instead of expecting automatic history replay. Old extension versions do not see post-migration edits.
8
+
9
+ ## Panel visibility and Herdr Tasks pane
10
+
11
+ `/works` alone opens the overlay dashboard. `/works compact-on` and `/works compact-off` show/hide the compact Pi display; `/works herdr-on` and `/works herdr-off` open/focus or close only the native Tasks mod panes bound to this session and terminal. Repeating off is harmless when no matching panel exists. The compact display and native panel are independent; off never disables tracking or changes another session’s panel. The separate `/works-panel` command is removed; its auxiliary directory, delegate, minimize/maximize, and floating/widget actions are now subcommands of `/works`.
12
+
13
+ Set the compact TUI default in global or trusted-project settings, then `/reload`:
14
+
15
+ ```json
16
+ {
17
+ "pi-tasks": {
18
+ "panel": { "enabled": false, "mode": "floating" }
19
+ }
20
+ }
21
+ ```
22
+
23
+ `enabled` defaults to false; the compact TUI stays hidden unless explicitly enabled. `mode` accepts floating (default) or widget. Settings require Pi 1.2+ `getSettings`; older hosts keep defaults. `/works compact-on` shows the last selected visible mode, `/works compact-off` hides it, and floating/widget commands both select and show a layout. Commands override only the running extension instance and do not rewrite settings. Hiding does not disable tools, timing or continuation. `/works` remains an explicit on-demand dashboard.
24
+
25
+ Set the native Herdr pane default in the same settings object:
26
+
27
+ ```json
28
+ {
29
+ "pi-tasks": {
30
+ "herdrPanel": { "enabled": true }
31
+ }
32
+ }
33
+ ```
34
+
35
+ `pi-tasks.herdrPanel.enabled` defaults to false. When true, each new TUI session inside a local Herdr Core terminal installs missing assets and opens/focuses the Tasks pane at session start; a Tasks pane from the same terminal’s earlier session is replaced. Automatic startup keeps setup failures silent. `/works herdr-off` still closes the running session’s pane, and `/works herdr-on` still reports setup problems. Settings apply on startup/reload; commands never rewrite them.
36
+
37
+ The package includes a native read-only mod at `herdr/pi-tasks/`. `/works herdr-on` automatically installs its missing files into your personal Herdr app home as `mods/pi-tasks/` (normally `~/.config/herdr-app/mods/pi-tasks/`; respecting `XDG_CONFIG_HOME` but ignoring inherited `HERDR_APP_HOME` fixture overrides for both app commands and asset installation), then opens the pane. No manual copying is required. Existing files, including customizations, are never overwritten; this is missing-file installation, not automatic mod upgrades. Developers can validate the installed mod with:
38
+
39
+ ```sh
40
+ herdr-app check ~/.config/herdr-app/mods/pi-tasks
41
+ ```
42
+
43
+ From a local Pi terminal already displayed in Herdr, run `/works herdr-on` to install/open the Tasks pane beside that exact terminal, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command first requires an initialized, valid snapshot for the current Pi session; it does not create a pane with missing binding props. If a running instance mixes older task modules with the updated command, restart Pi and resume the session before retrying. The first panel opens beside the source terminal. If same-session Loops/Monitors is already open, Tasks stacks below it instead. Reopening focuses the existing Tasks pane; closing either panel leaves the other in place. The command passes the session ID and authoritative snapshot path explicitly. It does not start another Pi process or choose whichever terminal happens to have focus. Use `/works compact-off` or the setting above to avoid duplicate compact TUI display. The mod reads/watches the file and shows a compact Work→Task tree with inline name-activated Final thoughts, leading running/blocked symbols, right-aligned numeric metrics and adjacent linked-task-only Agent buttons. Its pane header adds one compact status dropdown (All statuses, Active, Blocked, Completed, Cancelled) that shows only matching tasks and the Works containing them; Work progress and effort remain totals for every task, and the selection is per-pane view state read from Herdr's shared store under `pi-tasks-status:<paneId>`, never a settings entry or a task-record write. The opener also writes the hosting pane id to `<agentDir>/tasks/<sessionId>.pane` and passes `paneFile`, because a pane content copy cannot name its own pane; reopening the pane refreshes it. A pane created before that hand-off carries no `paneFile` prop and its stored props never change, so the view falls back to the live pane inventory and adopts the one Tasks pane in the source terminal's tab; anything absent, malformed or ambiguous leaves the view at All statuses instead of guessing another pane's selection. An edited mod reaches existing panes when the Herdr app starts or a pane is closed and reopened, independently of Pi process age. It omits owner/status fact lines, connection/session bars and the bottom Read-only footer. It does not write task state or run model calls. Remote sessions and task editing from the pane are not included.
44
+
45
+ The persistent close button lives in the actual native pane header. First setup creates/selects personal copies of the current visible top-header layout and its header mod; originals remain untouched and non-Tasks header behavior uses the copied original. A minimum 32px header supports the close target. Conflicting custom assets or unsupported header layouts fail with guidance rather than being overwritten. See [native header setup and rollback](../herdr/pi-tasks/README.md). The native content has no three-dot trigger or action menu. Copy and repository actions remain available through the `/works` dashboard and commands; reopen the native pane after a watcher error.
46
+
3
47
  ## Automatic tracking
4
48
 
5
49
  For every normal request that starts or continues work, Pi should:
6
50
 
7
51
  1. Find existing work and todos.
8
52
  2. Create the relevant Work collection, or refresh its shared context when needed.
9
- 3. Create or update detailed todos for the requested scope.
53
+ 3. Create a todo for each distinct new actionable request, or update an existing todo that already owns the same outcome, with hidden coordination metadata and a concise visible Final thoughts when useful. Adding a request to an existing Work does not make it part of an existing todo.
10
54
  4. Mark the current todo active before starting it. For an `owner: self` task, include `working=true` to select it for automatic timing; re-select at the start of each fresh run.
11
- 5. During longer tasks, report interim progress after roughly 5–10 meaningful working steps or a milestone, when an estimate is possible.
12
- 6. Mark the todo blocked immediately if its next step must wait on a dependency; otherwise update it after the attempt as active, completed, or cancelled.
55
+ 5. During longer tasks, report interim progress after roughly 5–10 meaningful working steps or a milestone, when an estimate is possible. Update Final thoughts only when the change is significant.
56
+ 6. Mark the todo blocked only when its next step waits for a user decision or another agent's output or review. Supply the current `blockedReason` and `dependentOn` (`"user-decision"` or `"another-agent"`); otherwise update it after the attempt as active, completed, or cancelled, with a concise result when completing.
13
57
  7. Keep status on tasks only; update Work context when scope or shared decisions change.
14
58
 
15
59
  The extension applies this guidance across all loaded skills and does not skip work merely because it looks small. It does not update tracking during `/ask`, `/btw`, or BTW side threads.
16
60
 
17
- Write `workInfo` and `taskInfo` in normal prose with full sentences and spaces between words. Conversational brevity modes do not apply to stored records; do not concatenate words to shorten them. This is model-facing guidance, not automatic repair of existing text.
61
+ Write `workInfo` in normal prose with full sentences and spaces between words. Conversational brevity modes do not apply to stored records; do not concatenate words to shorten them. `taskInfo` is hidden coordination metadata: the owner declaration, canonical artifact paths, parent IDs, and necessary execution constraints. `finalThoughts` is the only user-visible task text; see [Final thoughts](#final-thoughts). This is model-facing guidance, not automatic repair of existing text.
18
62
 
19
63
  ## Shared workflow and artifacts
20
64
 
@@ -41,9 +85,9 @@ Record the canonical artifact directory and parent session/Work/Task IDs in `tas
41
85
 
42
86
  ### Choose self or delegate
43
87
 
44
- Before each task, start `taskInfo` with `owner: self` or `owner: delegate` and a short reason. Preserve this declaration when updating the details. Delegate only when scope and acceptance criteria are clear, ownership can be isolated, required inputs and verified prerequisites are ready, and useful parallelism or expertise outweighs startup, context transfer, monitoring, and integration costs. The owning skill must permit delegation and required tracking and monitoring must be available. Small straightforward changes, tightly coupled edits, shared-interface design, and expensive-to-explain work normally stay with one owner. Risk alone is not a reason for parallel coding; independent review may still help. Do not use arbitrary file-count, agent-count, or depth thresholds. Reassess if scope changes; each allowed delegating child applies the same rule, and parents retain responsibility for monitoring, integration, verification, and cleanup.
88
+ Before each task, start hidden `taskInfo` with `owner: self` or `owner: delegate` and a short reason. Preserve this declaration when updating the task. Delegate only when scope and acceptance criteria are clear, ownership can be isolated, required inputs and verified prerequisites are ready, and useful parallelism or expertise outweighs startup, context transfer, monitoring, and integration costs. The owning skill must permit delegation and required tracking and monitoring must be available. Small straightforward changes, tightly coupled edits, shared-interface design, and expensive-to-explain work normally stay with one owner. Risk alone is not a reason for parallel coding; independent review may still help. Do not use arbitrary file-count, agent-count, or depth thresholds. Reassess if scope changes; each allowed delegating child applies the same rule, and parents retain responsibility for monitoring, integration, verification, and cleanup.
45
89
 
46
- Name each Herdr subagent root pane exactly with the parent's delegated Todo ID, for example `T34`, without brackets, descriptions, Work IDs, or other prefixes. The worker creates its own session-local tracking after startup; those IDs do not replace this pane label. Rename an owned worker pane if a follow-up assigns a different parent Todo. Names may repeat across parent sessions, so use returned resource IDs for lifecycle commands, never pane names.
90
+ Workers are Core-only by default; no Herdr app, space, tab or adoption label is needed. When the user or the active harness explicitly requires a visible worker, pass `present: true` to AgentCreate, and that Core subagent gets its own Herdr app tab named exactly with the parent's delegated Todo ID, such as T34, without brackets or descriptions. Rename the owned tab when assigning a different parent Todo. The tab label is not the worker's session/Task identity. Use real returned terminalId/tabId handles because labels repeat across parent sessions; `tabId` exists only for a presented worker.
47
91
 
48
92
  These are instructions using existing details fields, not a new schema, shared cross-session task tree, automatic directory creator, or enforcement hook.
49
93
 
@@ -55,7 +99,7 @@ Every subagent must create or resume its own session-local Work and Todos before
55
99
 
56
100
  Works are collections with no status. Tasks use only `active`, `blocked`, `completed`, and `cancelled`. New tasks default to `active`; saved legacy task statuses `planned` and `pending` restore as active but are no longer accepted by tools. Old Work statuses are ignored during replay; no saved history is rewritten.
57
101
 
58
- Use `blocked` immediately when a task cannot proceed until another agent produces output, a review finishes, an external response arrives, the user responds, permission is granted, or another obstacle is resolved. Supply `blockedReason` when creating a blocked task or entering blocked status: explain which dependency it awaits and what will unblock it. Retain its current completion estimate. Other blocked edits preserve the reason; leaving blocked clears it. Older tasks without a reason show “No reason recorded.” Parent delegated tasks stay blocked while awaiting worker output; the worker's own local tasks may be active. AgentCreate automatically blocks the parent task after successful creation, retaining its progress. For manual delegation, mark the parent task blocked explicitly.
102
+ Use `blocked` only when a task cannot proceed until a user decision (a response, approval, or permission) or another agent's output or review arrives. Supply both `blockedReason` and `dependentOn` when creating a blocked task or entering blocked status: `dependentOn` is exactly `"user-decision"` or `"another-agent"`. Explain which dependency it awaits and what will unblock it. That reason is the blocked task's visible Final thoughts, so do not duplicate it; task details show the chosen dependency beside Final thoughts. Retain its current completion estimate. Other blocked edits preserve both fields; leaving blocked clears both. Older blocked tasks without a reason or dependency show no invented values, and no reason falls back to Final thoughts. Do not use blocked for an external service, tool failure, or other obstacle that fits neither category: keep the task active, preserve safety, continue other safe work, and report the unavailable dependency truthfully. A status change clears an unsupplied thought, so resumed and completed rows never show a stale waiting message. Parent delegated tasks stay blocked while awaiting worker output; the worker's own local tasks may be active. AgentCreate automatically blocks the parent task after successful creation, retaining its progress. For manual delegation, mark the parent task blocked explicitly.
59
103
 
60
104
  When the dependency resolves and work resumes, mark the affected tasks active. Do not assign status to the parent Work. To cancel the whole collection, cancel its remaining tasks explicitly. Neither blocked status nor changing it schedules a wake automatically; use the appropriate monitor or event when an automatic notification is needed.
61
105
 
@@ -73,11 +117,27 @@ This is off by default and requires Pi 1.2.0+. Add the following to global `~/.p
73
117
  }
74
118
  ```
75
119
 
76
- Send a normal prompt to start. After success or failure, if any task across all Works on the current session branch is active, the agent receives a message to continue and verify it. Legacy planned/pending task statuses restore as active. Empty Works and blocked, completed, or cancelled tasks do not cause another continuation. Record genuine blockers and resume conditions in `blockedReason` when entering blocked status before handing off.
120
+ Send a normal prompt to start. After success or failure, if any task across all Works in the current Pi session is active, the agent receives a message to continue and verify it. Legacy planned/pending task statuses restore as active. Empty Works and blocked, completed, or cancelled tasks do not cause another continuation. An active task that launched a command `MonitorCreate` with an `onDone` wake is excluded until that wake is delivered or dismissed, including while its notification is queued for idle. The exact task is captured at launch; Core `hcTerminalId` subscriptions and unrelated active tasks still continue. No task status is changed for that wait. Record genuine blockers and resume conditions in `blockedReason` with the required `dependentOn` classification when entering blocked status before handing off.
121
+
122
+ Press Escape/abort to stop. The extension will not restart from a monitor wake or another extension's message; send a new main prompt when you want it to resume. Failed runs do not disarm continuation: after native retries, unfinished records request another run until the 50-continuation limit is reached. Reloading or navigating session branches does not silently resume unfinished work; a tree change preserves the current count and requires fresh user input.
123
+
124
+ Auto-continuation is capped at 50 extra runs per fresh accepted main user run, including when `maxContinuations` is omitted. Add a positive integer such as `"maxContinuations": 10` to lower the cap; values above 50 are clamped to 50 with one visible warning. The final requested continuation is labeled final, and the next unfinished boundary warns with the count and hands control back without changing records. A fresh accepted main user run resets the limit; a rejected prompt, extension wake, session-tree change, or steering/follow-up input queued inside a running activity does not. Set `enabled` to `false` and reload to disable the feature. It checks recorded states, not whether every user requirement was captured or genuinely verified.
125
+
126
+ ## Configure Open and Open Session
127
+
128
+ Both actions share `pi-tasks.openCommand` in global `~/.pi/agent/settings.json` (or your custom agent directory) or a trusted project's `.pi/settings.json`. For example, to use VS Code:
129
+
130
+ ```json
131
+ {
132
+ "pi-tasks": {
133
+ "openCommand": ["code", "--new-window"]
134
+ }
135
+ }
136
+ ```
77
137
 
78
- Press Escape/abort to stop. The extension will not restart from a monitor wake or another extension's message; send a new main prompt when you want it to resume. Failed runs do not disarm continuation: after native retries, unfinished records request another run. Repeated provider failures can therefore keep consuming tokens with no configured limit. Reloading or navigating session branches does not silently resume unfinished work.
138
+ Merge this field into your existing settings, then run `/reload`. The array contains an executable followed by optional fixed arguments; the target directory is appended as a separate `.` argument, with the process working directory set to the repository/session directory or session artifact folder. For example, the setting above runs `code --new-window .`. Use `["cursor"]` for Cursor, `["zed"]` for Zed, or `["open", "-a", "Visual Studio Code"]` on macOS. Executable paths and arguments containing spaces belong in individual array entries; no shell quoting, expansion, pipelines, or command substitution is performed.
79
139
 
80
- Omitting `maxContinuations` means no continuation limit: it can keep consuming tokens while unfinished records remain. Manual abort and all other stopping conditions still apply. To cap it, add a positive integer such as `"maxContinuations": 10`. After the configured number of extra continuations, the extension warns and hands control back without changing records. A fresh accepted main user run resets the limit; a rejected prompt or steering/follow-up input queued inside a running activity does not. Set `enabled` to `false` and reload to disable the feature. It checks recorded states, not whether every user requirement was captured or genuinely verified.
140
+ Omitting the setting retains `["cursor"]`. Empty arrays, blank executables, non-string entries, and NUL characters are rejected visibly without launching anything. The executable must be installed on PATH or specified by absolute path. Configuration requires a Pi host with `pi.getSettings()` (Pi 1.2.0+); older hosts retain the Cursor default. Trusted project settings override global settings through Pi's settings API. The floating panel, widget, `/works` Open/`o`, and `/works open|open-session` all use this setting. Open still targets the current session working directory; Open Session still locates or creates this agent's artifact folder.
81
141
 
82
142
  ## Work tools
83
143
 
@@ -95,19 +155,34 @@ Work tools do not accept `status`; `WorkList` filters by Work ID only. `WorkList
95
155
  ## Todo tools
96
156
 
97
157
  ```text
98
- TodoCreate workId="W1" taskName="Inspect token flow" taskInfo="Detailed context..." completionPercent=0
158
+ TodoCreate workId="W1" taskName="Inspect token flow" taskInfo="owner: self — inspection and implementation." finalThoughts="Inspecting the token flow and call sites." completionPercent=0
99
159
  TodoList workId="W1"
100
160
  TodoList status="active"
101
161
  TodoList workId="W1" limit=10
102
- TodoUpdate taskId="T1" status="active" completionPercent=40 taskInfo="Inspection is complete; implementation and verification remain."
103
- TodoUpdate taskId="T1" status="blocked" blockedReason="Waiting for the review findings. Resume when the reviewer returns them."
104
- TodoUpdate taskId="T1" status="completed" taskInfo="Detailed verified outcome..."
105
- TodoUpdate taskId="T2" completionPercent=null taskInfo="The scope changed; the previous estimate is no longer reliable."
162
+ TodoUpdate taskId="T1" status="active" completionPercent=40 finalThoughts="Inspection is complete; implementation and verification remain."
163
+ TodoUpdate taskId="T1" status="blocked" dependentOn="another-agent" blockedReason="Waiting for the review findings. Resume when the reviewer returns them."
164
+ TodoUpdate taskId="T2" status="blocked" dependentOn="user-decision" blockedReason="Waiting for the user to choose the migration window."
165
+ TodoUpdate taskId="T1" status="completed" finalThoughts="The token flow is fixed; typecheck and build passed. Live provider behavior remains unverified."
166
+ TodoUpdate taskId="T2" completionPercent=null
106
167
  TodoDelete taskId="T1"
107
168
  ```
108
169
 
170
+ `taskInfo` remains required for the hidden owner declaration and coordination metadata. `finalThoughts` is optional; send `finalThoughts=""` to clear it. A blocked task requires both `blockedReason` and `dependentOn`; the reason is its visible Final thoughts, and `dependentOn` accepts only `"user-decision"` or `"another-agent"`. Nonblocked tasks omit both; leaving blocked clears both. Completed tasks should include the short verified result, checks, and remaining limits in `finalThoughts`; a completion without one is accepted for historical callers but remains honestly empty rather than showing old narrative. Changing status clears an unsupplied thought.
171
+
109
172
  `TodoList` returns all matching todos when `limit` is omitted. A positive integer `limit` selects the newest matching todos after filters, displayed oldest-to-newest. The result shows how many todos were returned and how many matched in total. Both list tools can still truncate very long text output at 50KB or 2,000 lines.
110
173
 
174
+ ## Final thoughts
175
+
176
+ Final thoughts is the only task text shown in the compact native Tasks pane, the `/works` task detail, and copied Markdown. `taskInfo` stays stored for ownership, links, artifact paths, and resumption but is never rendered as task text.
177
+
178
+ - **Blocked:** `blockedReason` is authoritative and states what is awaited and what will unblock the task. Do not duplicate it in `finalThoughts`. Details show `Dependent on: User decision` or `Dependent on: Another agent` when the field is stored; a legacy blocked record without a reason or dependency shows no invented values and may fall back to an existing `finalThoughts`.
179
+ - **Completed:** state the short actual result, the verification performed, and any remaining limits. A newly completed task should provide this; historical completed records without it remain honestly empty. Do not synthesize an outcome from old `taskInfo`.
180
+ - **Active:** provide an occasional short update only when something significant changed. There is no required filler on every turn, estimate, or tool call.
181
+ - **Never include:** the goal again, delegation or ownership rationale, `owner:` declarations, terminal/monitor links, artifact paths, parent IDs, sections, lists, or history. Those belong in `taskInfo` or the owning workflow records.
182
+ - **Transitions:** changing status clears an unsupplied thought. This prevents an old active progress note from hiding a new blocker and prevents a resumed or completed task from showing a stale waiting message.
183
+
184
+ No length cap, summarizer, migration, or history mechanism is added. Stored records are not rewritten. The guidance is model-facing; only completed status and its 100% rule are enforced.
185
+
111
186
  ### Active task time
112
187
 
113
188
  ```text
@@ -124,7 +199,9 @@ The compact panel and `/works` show reserved Done and Time columns; `▶` beside
124
199
 
125
200
  ### Delegated timing
126
201
 
127
- AgentCreate creates a unique `delegated-time-<id>.json` descriptor below the existing canonical parent task directory and returns its `reportPath`. Its prepared worker assignment includes export instructions; its monitor callback includes import instructions. Herdr still runs the worker and pi-loop-monitor still reports state changes. The timing file, not the notification or chat response, carries the measured values. Both agents need this version of pi-tasks loaded.
202
+ AgentCreate derives and creates the canonical parent task directory, then creates a unique `delegated-time-<id>.json` descriptor below it and returns its `reportPath`. Its prepared worker assignment includes export instructions; its monitor callback includes import instructions. Herdr still runs the worker and pi-loop-monitor still reports state changes. The timing file, not the notification or chat response, carries the measured values. Both agents need this version of pi-tasks loaded.
203
+
204
+ If startup fails after the worker exists, AgentCreate returns the same descriptor and handles with `status: partial`. AgentResume validates that descriptor through the delegation bridge before registering it: a fresh file with no worker session or tasks is a placeholder, not a measurement, and stays unknown until the worker's TaskTimeExport writes measured effort. A descriptor outside the canonical task directory or belonging to another parent assignment is rejected. Resume never writes or calculates elapsed time.
128
205
 
129
206
  Before returning, the worker pauses or completes its assignment tasks and exports their timing:
130
207
 
@@ -147,7 +224,7 @@ Report files contain parent IDs, worker session identity and task timing values,
147
224
 
148
225
  ### Completion percentages
149
226
 
150
- During longer tasks, Pi should include a `completionPercent` estimate in `TodoUpdate` after roughly 5–10 meaningful working steps or a milestone, rather than waiting until completion or only updating status. Explain the evidence and remaining work in `taskInfo`. Estimates remain optional: use `null` when unknown, and leave a percentage unchanged if there is no new evidence. This is model-facing guidance, not an enforced schedule or an automatic percentage increase. These are approximate AI-reported values, not a fixed percentage for each status and not a time prediction. Use an integer 0–100 or `null` for unknown. Completed status means verified completion and displays 100%; 100 without completed status is rejected. Partial progress requires reopening a completed task; reopening without a fresh estimate makes it unknown. Blocking retains the current estimate.
227
+ During longer tasks, Pi should include a `completionPercent` estimate in `TodoUpdate` after roughly 5–10 meaningful working steps or a milestone, rather than waiting until completion or only updating status. Explain visible evidence in `finalThoughts` only when the change is significant; never use `taskInfo` for progress narrative. Estimates remain optional: use `null` when unknown, and leave a percentage unchanged if there is no new evidence. This is model-facing guidance, not an enforced schedule or an automatic percentage increase. These are approximate AI-reported values, not a fixed percentage for each status and not a time prediction. Use an integer 0–100 or `null` for unknown. Completed status means verified completion and displays 100%; 100 without completed status is rejected. Partial progress requires reopening a completed task; reopening without a fresh estimate makes it unknown. Blocking retains the current estimate.
151
228
 
152
229
  Work progress averages all non-cancelled tasks equally and rounds down. Tasks at 100%, 40%, 0%, 0% produce 35% work completion, not 25% based on finished-task counts. If any eligible task lacks an estimate, the work displays `—`. No eligible tasks (an empty Work or only cancelled tasks) also means unknown. Work progress has no separate status or override. Existing sessions retain their records; legacy completed tasks display 100%, while other missing estimates remain unknown.
153
230
 
@@ -155,74 +232,75 @@ Work progress averages all non-cancelled tasks equally and rounds down. Tasks at
155
232
 
156
233
  Both the compact panel (floating or widget) and `/works` prefix work names with their IDs, such as `[W1] Locate subagent restrictions`. Task rows and dashboard detail headings also include ownership: `[T1] [self] Inspect the implement skill` or `[T2] [delegate] Implement storage`. These are display labels only; stored names and IDs are unchanged. Work IDs use the theme's accent color, task IDs use its type-highlight color, `[self]` uses success, `[delegate]` uses warning, and `[unassigned]` stays muted. Exact hues follow the selected theme; labels remain readable without relying on color.
157
234
 
158
- Ownership is read case-insensitively from explicit line-start `owner: self` or `owner: delegate` declarations in `taskInfo`, optionally followed by a reason or sentence. Incidental prose does not assign ownership. Missing, invalid, or conflicting declarations show `[unassigned]`; repeated declarations with the same valid value are unambiguous. No old records are rewritten and no new tool parameter is required. For example:
235
+ Ownership is read case-insensitively from explicit line-start `owner: self` or `owner: delegate` declarations in hidden `taskInfo`, optionally followed by a reason or sentence. Incidental prose does not assign ownership. Missing, invalid, or conflicting declarations show `[unassigned]`; repeated declarations with the same valid value are unambiguous. No old records are rewritten and no new ownership parameter is required. Final thoughts never carries ownership. For example:
159
236
 
160
237
  ```text
161
238
  owner: self. This is a small, tightly coupled change.
162
239
  The task covers the panel label and its documentation.
163
240
  ```
164
241
 
165
- ### Delegate pane links
242
+ ### Delegate terminal links
166
243
 
167
- `[delegate]` describes the ownership decision; it does not launch an agent. After successful agent startup and monitor creation, AgentCreate automatically marks the parent task blocked and adds `herdr-pane: <paneId>` and `herdr-monitor: <monitorId>` lines to its existing details. The completion estimate is retained; earlier creation failures do not change its status. TodoUpdate keeps those lines when both old and new ownership stay delegate and the new details do not supply replacement link metadata. Explicit metadata takes precedence; changing ownership or AgentClose can clear the link. Set `herdr-pane: none` to explicitly unlink without changing ownership. No new task schema or private agent registry is added. AgentClose clears matching links without changing ownership or completion.
244
+ A linked `[delegate]` badge uses `hc-terminal: <terminalId>` and `hc-monitor: <monitorId>` lines in hidden taskInfo. AgentCreate adds these and blocks the parent task after creation; TodoUpdate preserves them for delegate-to-delegate detail edits. Set `hc-terminal: none` to unlink, or use AgentClose. Historical herdr-pane metadata is inert, never guessed into a Core address. Opening a link uses normal herdr-app focus for a terminal that owns a pane or belongs to another machine. A pane-less Core child opens its own `terminal.peek` screen overlay over the current tab; it never navigates to the parent or reports a silent success. An address Herdr is not showing fails with an explicit error. These helpers classify from the desktop app listing and `hc get` and assume those commands target the same Core (`HC_SESSION`/`HC_SOCKET`); they do not perform Pet Town's `verified_world` cross-Core connection anchor, so isolated Core worlds are not independently matched.
245
+
246
+ The first completion of a linked delegate task adds a cleanup advisory to the `TodoUpdate` result. pi-herdr verifies the Core parent and `pi.session`/`pi.task` labels before appending it; no terminal from another session, task, or Core world is targeted. The advisory asks for a decision only: record a real follow-up as a blocked task with `dependentOn="another-agent"`, or verify the result, send `/close`, read `improvements.md`, import measured timing, and call `AgentClose`. It never acts on the worker and does not repeat while cleanup is handled.
168
247
 
169
248
  ## Agent tools
170
249
 
171
- These are simple Herdr CLI wrappers in pi-tasks, with no pi-herdr-agents dependency. AgentCreate also calls the existing MonitorCreate tool; AgentClose calls MonitorStop. Those two need modern Pi nested calls and the updated pi-loop-monitor result metadata. Base Work/Todo tracking and ordinary CLI wrappers do not depend on a private monitoring runtime.
250
+ These tools are owned and registered by the separate [pi-herdr](https://github.com/abhishek944/pi-herdr) package, not pi-tasks. They are bounded, shell-free Core CLI wrappers; no legacy TUI fallback or pi-herdr-agents dependency. Creation/resume/closure require modern Pi nested tool calls and updated pi-loop-monitor.
172
251
 
173
252
  | Tool | Purpose |
174
253
  | --- | --- |
175
- | `AgentCreate` | Create a timing descriptor, an unfocused tab, start Pi and register monitoring; return paneId/tabId/monitorId/reportPath plus a prepared assignment. No prompt is sent. |
176
- | `AgentList` | `herdr agent list` (includes unrelated agents). |
177
- | `AgentStatus` | `herdr agent get <paneId>`. |
178
- | `AgentOutput` | `herdr pane read`; 50 trailing lines by default, up to 200. |
179
- | `AgentSend` | `herdr agent prompt <paneId> <message>` without waiting. |
180
- | `AgentInterrupt` | `herdr agent send-keys <paneId> esc`. |
181
- | `AgentClose` | MonitorStop for the supplied monitorId, then `herdr pane close <paneId>`. |
182
- | `AgentFocus` | `herdr agent focus <paneId>`; also used by delegate links. |
254
+ | `AgentCreate` | Verify the Core parent, start interactive Pi through hc, verify native idle status, register monitoring, and return terminalId/monitorId/reportPath plus a prepared assignment. `present: true` additionally adopts and verifies a dedicated visible task-named app tab and returns tabId. No assignment is sent. A post-launch failure returns `status: partial` with the same handles and an AgentResume next step. |
255
+ | `AgentResume` | Finish the same partial worker: validate the timing descriptor and task directory, prove Core parent plus `pi.task`/`pi.session` ownership, require idle Pi, reuse one ready subscription or replace a non-ready one, then attach timing/linkage. Never relaunches, duplicates monitoring, bypasses prompts or fabricates timing. |
256
+ | `AgentList` | `hc ls --json`, including unrelated live terminals. |
257
+ | `AgentStatus` | `hc get <terminalId> --json`. |
258
+ | `AgentOutput` | `hc read <terminalId> --lines <n>`, screen plus 50 history lines by default, up to 200. |
259
+ | `AgentSend` | `hc send <terminalId> <message>`, without --wait or --force. |
260
+ | `AgentInterrupt` | `hc keys <terminalId> esc`. |
261
+ | `AgentClose` | Stop the supplied monitor when present, kill the owned terminal if live, then remove its finished Core record. A partial worker with no monitor can be closed with only terminalId. If the worker was presented, the app removes its ended pane/tab. |
262
+ | `AgentFocus` | Shows an existing Core agent through herdr-app. A pane owner or another machine's terminal uses `agent.focus`; a pane-less sub-agent uses `terminal.peek` to open its own screen overlay over the current tab. Also used by delegate links. Reports `focused: false` with a reason when no app is available or the agent cannot be shown. |
263
+
264
+ pi-herdr 0.1.0 requires the compatible local pi-tasks source with the version-1 prepare/inspect/attach/detach event-bus bridge. Published pi-tasks 0.15.0 lacks this bridge and owns legacy Agent tools; replace that source, do not load it alongside the updated local package. Reload or restart Pi after installing the coordinated pair. pi-tasks keeps timing, records, delegate links and task UI helpers. pi-herdr rejects duplicate Agent names with migration instructions rather than overriding them.
183
265
 
184
- For an existing active Work/Todo whose `taskInfo` starts with `owner: delegate`, call:
266
+ For an existing active Work/Todo with owner: delegate:
185
267
 
186
268
  ```typescript
187
269
  AgentCreate({
188
- workId: "W1",
189
- taskId: "T2",
190
- taskDir: "var/<full-current-sessionId>/W1/T2",
270
+ workId: "W1", taskId: "T2",
271
+ // parentTaskDir: "<exact parentTaskDir from your assignment>", // delegated workers only
272
+ // present: true, // optional: adopt the worker into its own visible task-named app tab
191
273
  assignment: "Review the approved change. Do not edit files or run tests.",
192
- provider: "<chosen-provider>",
193
- model: "<chosen-model-id>",
194
- thinking: "high",
195
- onSignal: "Inspect worker output. Help with blockers; review the actual changes before completing the task.",
196
- onDone: "The monitor stopped. Inspect its status and recover monitoring if still needed."
274
+ provider: "<chosen-provider>", model: "<chosen-model-id>", thinking: "high",
275
+ onSignal: "Inspect actual worker output and blockers before completing its task.",
276
+ onDone: "The subscription ended. Inspect MonitorList and recover monitoring if needed."
197
277
  })
198
278
  ```
199
279
 
200
- Replace placeholders using the existing implement path convention and model-routing-policy. The wrapper requires taskDir to exist inside the repository's canonical var/ tree. It creates a timing descriptor there but does not create folders or verify the running model. It adds parent context, worker-local tracking and timing-export instructions without granting extra permissions.
201
-
202
- AgentCreate returns `assignmentSent: false`. Confirm MonitorList shows `Herdr signal subscription ready for <paneId>`, then call `AgentSend({ paneId, message: assignment })` using the returned assignment. Do not add a second monitor. Follow-up messages use that same paneId and existing subscription.
280
+ AgentCreate derives the canonical task directory from the host session and real Work/Task IDs and creates it if absent. A root session omits `parentTaskDir` and gets `var/<sessionId>/<workId>/<taskId>/`; a delegated session passes the exact `parentTaskDir` from its assignment and gets `<parentTaskDir>/<sessionId>/<workId>/<taskId>/`. Do not read the session ID or create the directory just for AgentCreate. Direct hc CLI launches still prepare the path manually.
203
281
 
204
- `onSignal` is a wake instruction for worker state changes, including blocked, idle and done. The monitor keeps watching. `onDone` is a wake instruction if the monitor process terminates, not a worker-completion callback; when omitted, pi-loop-monitor supplies its recovery instruction. Neither returns the worker's complete answer automatically. The parent uses `AgentOutput` and inspects actual files before marking tasks complete. Do not add a duplicate monitor or close a worker merely because it reports done.
282
+ The wrapper verifies the real HC_TERMINAL_ID with hc. It launches Pi with explicit model flags, an explicit parent, and --no-notify (the existing monitor supplies wakes). Core-only creation needs no app. With `present: true` it first locates the parent's app space by terminal mapping, never UI focus, and fails before launching when that space is missing; it then adds a herdr.space label without herdr.tab to request a new visible tab, checks that it contains only the worker, renames it to the parent's Task ID, and verifies that mapping. Missing Core prerequisites, or an unavailable app space when presentation was requested, fail clearly; HERDR_ENV is not required. Workers end with their parent by Core's default policy.
205
283
 
206
- Use actual paneId values, not pane names or a separate agent handle. These wrappers assume an agent pane is not repurposed. There are no process/session checks, startup receipts, registry, automatic reconnection, retry or rollback framework. Ordinary CLI errors are returned with any handles already obtained so the caller can inspect and decide what to do. Close only resources you created; a done signal does not automatically close anything or complete a task. If monitoring stops, use the existing monitor tools to inspect/reconnect explicitly.
284
+ The timing descriptor and prepared assignment retain worker-local tracking, canonical nested artifact paths and TaskTimeExport/Import. AgentCreate returns the resolved taskDir and assignmentSent:false. Confirm MonitorList shows `Core signal subscription ready for <terminalId>`, then call `AgentSend({ terminalId, message: assignment })`. Retain that subscription for follow-ups. onSignal means worker state changed; onDone means the subscriber process ended, not task completion. Read output/files and import measured effort before accepting work.
207
285
 
208
- Inside Herdr (`HERDR_ENV=1`), a linked `[delegate]` is underlined. In fullscreen mode, click that badge in compact/widget rows, dashboard rows, or task detail headings to focus its agent pane. Only fully visible badges are clickable. In `/works`, select the task and press `d`; `/works-panel delegate T<number>` provides a command path, including regular terminal mode. `[Open]` / `[O Open]` are also underlined and still open Cursor. Unlinked badges are not underlined, because they are not navigation actions.
286
+ Use actual returned terminal addresses (t7 or machine/t7), not app pane IDs or tab names. A startup failure reports partial handles without blind relaunch, retries or automatic cleanup. Close only resources you created after their results are accepted. No registry or recovery runtime is added.
209
287
 
210
- Navigation directly focuses the linked paneId through Herdr. Closed panes, missing Herdr CLI and command errors are reported. No subprocess runs during rendering. Agent tools coordinate Herdr resources; pi-loop-monitor remains the sole monitoring runtime. Outside Herdr, badges remain informational.
288
+ Linked delegate badges are underlined and clickable in the compact panel, widget, dashboard and detail headings when fully visible. In /works use d; /works delegate T<number> works in regular mode too. Navigation uses herdr-app: a pane owner gets focus, while a pane-less Core child opens its existing terminal.peek overlay over the current tab without navigating to the parent. Unavailable app/CLI, closed targets, or a terminal Herdr is not showing report errors. No subprocess runs while rendering. Without a valid Core link, badges remain informational. Open actions remain unchanged.
211
289
 
212
- The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works: `3!` blocked, `2▶` active, `5✓` completed, and `1×` cancelled, using the same icon colors as task rows. Counts update in floating, widget and minimized layouts; narrow headers shorten the toggle and truncate the summary when needed. Its underlined `[Open session]` action sits immediately after Copy in floating, widget and minimized layouts. It opens this agent's existing artifact directory under repository `var/` in Cursor, including a nested delegated session folder. If no folder exists, it creates `var/<full-sessionId>/`; multiple matching folders report an ambiguity rather than guessing. Session identity comes from Pi's context, not a pane name. Folder resolution and Cursor launch happen only on activation, never during rendering. `/works-panel open-session` is the keyboard-command alternative. The existing Open action still opens the repository. Narrow compact headers use `[-]`/`[+]` for Minimize/Maximize so all actions fit. The `/works` dashboard retains its existing title and controls.
290
+ The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works: `3!` blocked, `2▶` active, `5✓` completed, and `1×` cancelled, using the same icon colors as task rows. Counts update in floating, widget and minimized layouts; narrow headers shorten the toggle and truncate the summary when needed. Its underlined `[Open session]` action sits immediately after Copy in floating, widget and minimized layouts. It opens this agent's existing artifact directory under repository `var/` using the configured command, including a nested delegated session folder. If no folder exists, it creates `var/<full-sessionId>/`; multiple matching folders report an ambiguity rather than guessing. Session identity comes from Pi's context, not a pane name. Folder resolution and command launch happen only on activation, never during rendering. `/works open-session` is the keyboard-command alternative. The existing Open action still opens the repository. Narrow compact headers use `[-]`/`[+]` for Minimize/Maximize so all actions fit. The `/works` dashboard retains its existing title and controls.
213
291
 
214
- The panel defaults to a floating top-right layout and does not take keyboard focus. Its minimum box width is 48 columns to leave room for names beside both metrics; the widget hides below 48 columns. Separated right-hand Done and Time columns keep work/task percentages and measured durations aligned and visible even when names are long; the left side retains names, task status icons and Work task-counts. Work rows have no status icons. It hides on small terminals. The top border centers repository-wide Git status: `git main · S2 U3 ?1` means two staged files, three unstaged files, and one untracked file; a file with both staged and unstaged edits counts in both. A clean repository shows `git main · clean`. Long branches shorten before counts. Detached HEAD shows `@` plus the short commit. Git remains visible while minimized and adds no content row.
292
+ The compact TUI is off by default. When enabled, its default layout floats at the top-right without taking keyboard focus. Its minimum box width is 48 columns to leave room for names beside both metrics; the widget hides below 48 columns. Separated right-hand Done and Time columns keep work/task percentages and measured durations aligned and visible even when names are long; the left side retains names, task status icons and Work task-counts. Work rows have no status icons. It hides on small terminals. The top border centers repository-wide Git status: `git main · S2 U3 ?1` means two staged files, three unstaged files, and one untracked file; a file with both staged and unstaged edits counts in both. A clean repository shows `git main · clean`. Long branches shorten before counts. Detached HEAD shows `@` plus the short commit. Git remains visible while minimized and adds no content row.
215
293
 
216
294
  The asynchronous Git cache refreshes every second while a view is attached; file-changing tool results expire it sooner without blanking the last snapshot. Initial reads show `git loading…`; outside Git the border is plain, and initial failures show `git unavailable`. Later refresh failures retain the last snapshot until a successful read. Polling is read-only and stops when both the panel and dashboard are closed/off.
217
295
 
218
- In fullscreen TUI mode, click Copy in its title bar to copy every work and todo as Markdown, Open to run `cursor .` in the current session directory, or Minimize to collapse the panel to a small title bar. Copy and Open remain available while minimized, and Maximize restores the rows. Cursor's command-line launcher must be on PATH; launch failures produce visible error feedback. When more rows exist than fit, the floating panel starts at the newest rows; move the mouse over it and use the wheel to scroll older or newer rows without taking focus from the editor. In regular terminal mode, open `/works` to browse and copy the complete list.
296
+ In fullscreen TUI mode, click Copy in its title bar to copy every work and todo as Markdown, Open to run the configured command in the current session directory, or Minimize to collapse the panel to a small title bar. Copy and Open remain available while minimized, and Maximize restores the rows. The configured executable must be on PATH (or be an absolute path); launch failures produce visible error feedback. When more rows exist than fit, the floating panel starts at the newest rows; move the mouse over it and use the wheel to scroll older or newer rows without taking focus from the editor. In regular terminal mode, open `/works` to browse and copy the complete list.
219
297
 
220
- Use `/works-panel minimize`, `/works-panel maximize`, `/works-panel open`, or `/works-panel open-session` when mouse input is unavailable. Use `/works-panel widget` for a right-aligned layout above the editor that renders every row and retains the clickable title actions, `/works-panel floating` to return to the floating layout, or `/works-panel off` to hide it.
298
+ Use `/works minimize`, `/works maximize`, `/works open`, or `/works open-session` when mouse input is unavailable. Use `/works widget` for a right-aligned layout above the editor that renders every row and retains the clickable title actions, `/works floating` to return to the floating layout, `/works compact-off` to hide it, or `/works compact-on` to restore the last visible layout. `/works herdr-on` installs missing bundled mod files and opens the native Tasks pane; `pi-tasks.herdrPanel.enabled` opens it at each session start.
221
299
 
222
300
  Run `/works` for full details. Its top border mirrors repository-wide Git status, and its top bar includes Copy, Open, and Minimize actions. In fullscreen TUI mode, click Minimize to collapse the dashboard to a top bar showing the current work and todo totals; click Maximize to restore it. The actions also have keyboard shortcuts that work in regular terminal mode.
223
301
 
224
302
  - `c`: copy all works and todos as Markdown
225
- - `o`: open the current repository/session directory in Cursor
303
+ - `o`: open the current repository/session directory using the configured command
226
304
  - `d`: open the selected task's linked delegated agent
227
305
  - `m`: minimize or maximize the dashboard
228
306
  - Fullscreen left click: activate header actions, or click a task/work row to open its full details. Clicking a linked delegate badge still opens its agent.
@@ -232,4 +310,4 @@ Run `/works` for full details. Its top border mirrors repository-wide Git status
232
310
  - Back to works or configured cancel key: return from details to the task list without losing your place
233
311
  - Configured cancel key from the task list: close `/works`
234
312
 
235
- The full task view shows its name, parent work, status, completion, measured time and full task information. Blocked tasks show **Reason:** followed by the blocker text on the same line, wrapping as needed, before the task information. The mouse wheel scrolls long details. Escape from details returns to the task list; Escape again closes the dashboard.
313
+ The full task view shows its name, parent work, status, completion, measured time and full task information. Final thoughts carries any stored dependency beside its heading, such as `Final thoughts · Dependent on: Another agent`; blocked tasks show **Reason:** followed by the blocker text on the same line, wrapping as needed, before the task information. The mouse wheel scrolls long details. Escape from details returns to the task list; Escape again closes the dashboard.
@@ -0,0 +1,45 @@
1
+ # Native Herdr Tasks pane
2
+
3
+ A read-only native GPUI view of the same per-Pi-session JSON used by pi-tasks. No browser, second Pi process, task database, model call, HTTP server or task editing.
4
+
5
+ ## Install and open
6
+
7
+ From an updated local Pi terminal already displayed in Herdr, run `/works herdr-on`, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command validates the session file and source terminal, installs missing content assets into `<Herdr app home>/mods/pi-tasks/`, and opens beside that exact terminal, or stacks below its same-session Loops/Monitors pane if already open. Reopening focuses the existing Tasks pane. Automatic startup runs the same setup at each session start and replaces this terminal’s Tasks pane from an earlier session; it stays silent when Herdr is unavailable or setup fails, while the command reports the reason. The opener uses the normal desktop app home (`~/.config/herdr-app`, or the `XDG_CONFIG_HOME` equivalent), ignoring inherited `HERDR_APP_HOME` fixture overrides for both app commands and asset installation. Existing/customized mod files are never overwritten by the command; upgrade those assets explicitly after keeping a backup.
8
+
9
+ The always-visible × belongs to Herdr's real pane header, not the content view. On first setup the command uses Herdr's official clone operations to create:
10
+
11
+ - a personal `mods/pi-tasks-pane-header/`, copying the current header and assets; its original renderer is kept as `base.js`;
12
+ - a personal `layouts/pi-tasks-<current-layout>.json`, selected for this window, with the Tasks-aware header.
13
+
14
+ Original layout/header files remain untouched. Non-Tasks headers use the copied original renderer and behavior. A header shorter than 32px is raised to 32px in the personal layout for the close target. Switch back to the original layout to undo the layout selection. The current layout must already have an always-visible top pane-header mod; absent/bottom/hover-only or mixed headers report a bounded setup error instead of changing unrelated structures. Existing conflicting personal assets are preserved, not replaced. A compatible existing personal Tasks layout may be reused.
15
+
16
+ After changing the installed extension, run `/reload`, or restart Pi and resume the same session if an old loaded module has no snapshot binding. Pane-header copies only pick up edited mod code when their pane is created, so closing and reopening the Tasks pane applies a refreshed header. `/works compact-off` hides only the compact Pi TUI; tracking and the native view continue. Reopening focuses the existing same-session view, never another writer. `/works herdr-off` closes only matching Tasks mod panes in this terminal’s tab; tracking and the compact display continue.
17
+
18
+ Developer checks:
19
+
20
+ ```sh
21
+ herdr-app check ~/.config/herdr-app/mods/pi-tasks
22
+ herdr-app check ~/.config/herdr-app/mods/pi-tasks-pane-header
23
+ ```
24
+
25
+ `header.js` in this bundle is an installation template. Its `./base.js` is supplied by cloning the actual configured header, not bundled as an unrelated copy of Herdr's code. Never edit Herdr's shipped `pane` mod in place.
26
+
27
+ ## Behavior
28
+
29
+ - Compact real Work → Task rows, newest Work first with older Works below; task order within each Work stays unchanged. No invented subtasks. Activate a Work name to fold its tasks, or a task name to toggle an unboxed inline Final thoughts. A blocked task shows its authoritative blocked reason and any stored `Dependent on: User decision` or `Dependent on: Another agent` beside the Final thoughts label; a legacy blocked record without a dependency shows no invented label, and a task without a thought shows an honest empty label. Stored `taskInfo` metadata (owner line, links, paths, parent IDs) is never rendered. Work and task title buttons use the same underline focus affordance, so clicking one does not paint a selection-like background. The selected task is highlighted across its whole row. Double-clicking counts as one activation instead of immediately toggling the thought twice.
30
+ - Leading loader only while the task is genuinely running, `!` for blocked, `✓` for complete, quiet idle/cancelled marks. No session/connection bar, top counts, extra owner/status fact line or Read-only footer.
31
+ - Plain right-aligned progress and measured effort. Work completion averages noncancelled tasks; unknown propagates. Effort includes cancelled time and imported cumulative reports once. Unknown is `—`, known zero `0s`.
32
+ - A measured clock ticks only for a live source actually working on the selected measured task. Saved/offline/paused values freeze; time is not wall-clock age or ETA. Native spinner animation is independent of clock redraws. This Herdr API does not expose an OS reduced-motion preference.
33
+ - `Agent ↗` appears next to a task with a valid existing live delegate link. Activation rechecks that exact link: a terminal that owns a pane gets normal app focus, while a pane-less Core child opens its own `terminal.peek` overlay over the current tab; a deeper child is recognized by its nonempty Core parent record. It never navigates to the parent, launches an agent, or reports a silent success. Work rows have no Agent button. Agent and task-thought controls are independent.
34
+ - No three-dot trigger or native action menu is shown. Copy and repository actions remain available through the `/works` dashboard and commands; reopen the native pane to refresh after a watcher error.
35
+ - The native header × targets only the exact verified terminal-null pi-tasks pane. Closing leaves Pi, agents and tracking intact. It remains present for populated, empty, loading and error content.
36
+ - Snapshot version/session identity and record structure are validated, including a blocked task's optional two-value dependency; the directory is watched for atomic replacement. Invalid/missing files show an error, not stale rows. No authoritative record cache or mod-local task persistence is added.
37
+ - The persistent pane header carries one compact status dropdown before its ×: **All statuses** (default), **Active**, **Blocked**, **Completed**, **Cancelled**. It filters tasks by their stored status, never works, and the stored status decides the match — a running task is Active. Filtered views keep only matching tasks and the Works that contain them, in the existing newest-Work-first and original task order; Work progress and effort stay totals for every task of the Work, and task status, estimates, timing and records are untouched. A selection with no match shows a status-specific empty state, and a changed selection starts at the top of the list. The selection is view state for that exact pane: it lives in Herdr's shared store under `pi-tasks-status:<paneId>` (the neighbouring Loops/Monitors header uses the same per-pane pattern) and is never written to a settings file or a task record.
38
+ - The menu is open state, not just a value: the header publishes it as `pi-tasks-status-open:<paneId>` so the view can close it. A press anywhere in the task list dismisses it, a press on the header row dismisses it, the trigger toggles it, an option selects and closes it, and Escape closes it; dismissing always keeps the selected status. Herdr's Select closes on presses inside its own mod, so the view supplies the press from its own root.
39
+ - A pane content copy receives only the props it was created with, so it cannot name its own pane. The opener therefore writes the hosting pane id to `<agentDir>/tasks/<sessionId>.pane` and passes its path as the `paneFile` prop; the view reads it beside the snapshot. A pane created before that hand-off carries no `paneFile` prop, and its stored props never change, so the view falls back to the live pane inventory: it finds the source terminal's tab and adopts the one Tasks pane there, which is the pane the opener split it into. An absent, missing, malformed or ambiguous answer leaves the view at **All statuses** instead of guessing another pane's selection. The dropdown anchors its menu to the trigger and grows downward, because a header at the top of a pane has no room above it.
40
+
41
+ Manual content props are `{sessionId, snapshot, terminal?, openCommand?, paneFile?}`. Bind the full Pi session ID and absolute task JSON path explicitly, never whichever terminal is focused. The source terminal's availability alone does not prove it still hosts that session. Only local file-backed sessions are supported.
42
+
43
+ `herdr-app check` proves loading and an initial render only. Populated native visual/interaction checks must separately verify file updates, inline Final thoughts, keyboard focus, linked Agent navigation (pane owner and pane-less child overlay), the status dropdown (menu placement, each status, no-match empty state, Work totals, two panes staying independent) and guarded close behavior. Browser mockups do not prove native behavior. The installed personal mod is not overwritten by package setup; refresh it explicitly to receive source changes.
44
+
45
+ Mod code and pane props have separate lifetimes. A pane's view is built from the mod files in `mods/` when the Herdr app starts or when the pane is created, so an edited mod reaches existing panes after an app restart or a closed-and-reopened pane. The props a pane was created with are stored in the Herdr core document and only a *new* pane from an extension that knows them can change them: a Pi process keeps the extension code it started with, so a pane it reopens still carries the older props until that Pi session is restarted or a new session opens the pane.