@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
@@ -11,6 +11,7 @@ export declare class WorksDashboard implements Component, Focusable {
11
11
  private readonly cwd;
12
12
  private readonly git;
13
13
  private readonly notify;
14
+ private readonly getOpenCommand;
14
15
  focused: boolean;
15
16
  private selectedKey;
16
17
  private scrollOffset;
@@ -32,7 +33,7 @@ export declare class WorksDashboard implements Component, Focusable {
32
33
  private toggleHitRegion;
33
34
  private disposed;
34
35
  private readonly refreshTimer;
35
- constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void, cwd: string, git: GitStatusCache, notify: (message: string, type: "error") => void);
36
+ constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void, cwd: string, git: GitStatusCache, notify: (message: string, type: "error") => void, getOpenCommand: () => string[]);
36
37
  render(width: number): string[];
37
38
  handleInput(data: string): void;
38
39
  handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
@@ -50,7 +51,7 @@ export declare class WorksDashboard implements Component, Focusable {
50
51
  private toggleMinimized;
51
52
  private isHit;
52
53
  private openLinkedDelegate;
53
- private openInCursor;
54
+ private openDirectory;
54
55
  private copyAllAsMarkdown;
55
56
  private renderFooter;
56
57
  }
@@ -1,12 +1,15 @@
1
1
  import { copyToClipboard } from "@earendil-works/pi-coding-agent";
2
2
  import { matchesKey, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
3
- import { delegateLink, focusPane } from "../agents/links.js";
3
+ import { delegateLink, focusTerminal } from "../agents/links.js";
4
+ import { dependentOnLabel } from "../dependency.js";
4
5
  import { formatWorksMarkdown } from "../markdown.js";
5
6
  import { openRepository } from "../open-repository.js";
6
7
  import { formatCompletion, taskCompletion, workCompletion } from "../progress.js";
7
8
  import { safeMultiline, safeSingleLine } from "../text.js";
9
+ import { finalThoughtsFor } from "../thoughts.js";
8
10
  import { formatTime, taskTime, workTime } from "../time.js";
9
11
  import { border, delegateHitRegion, frame, gitBorder, metricsColumn, metricsHeader, ownerBadge, recordId, rule, todoIcon } from "./panel.js";
12
+ import { readTaskView } from "./task-view.js";
10
13
  const CHROME_LINES = 9;
11
14
  export class WorksDashboard {
12
15
  tui;
@@ -17,6 +20,7 @@ export class WorksDashboard {
17
20
  cwd;
18
21
  git;
19
22
  notify;
23
+ getOpenCommand;
20
24
  focused = false;
21
25
  selectedKey;
22
26
  scrollOffset = 0;
@@ -38,7 +42,7 @@ export class WorksDashboard {
38
42
  toggleHitRegion;
39
43
  disposed = false;
40
44
  refreshTimer;
41
- constructor(tui, theme, keybindings, state, close, cwd, git, notify) {
45
+ constructor(tui, theme, keybindings, state, close, cwd, git, notify, getOpenCommand) {
42
46
  this.tui = tui;
43
47
  this.theme = theme;
44
48
  this.keybindings = keybindings;
@@ -47,6 +51,7 @@ export class WorksDashboard {
47
51
  this.cwd = cwd;
48
52
  this.git = git;
49
53
  this.notify = notify;
54
+ this.getOpenCommand = getOpenCommand;
50
55
  this.unsubscribeGit = git.subscribe(() => tui.requestRender());
51
56
  this.refreshTimer = setInterval(() => {
52
57
  if (!this.disposed)
@@ -63,7 +68,9 @@ export class WorksDashboard {
63
68
  this.toggleHitRegion = undefined;
64
69
  const dialogWidth = Math.max(1, width);
65
70
  const innerWidth = Math.max(1, dialogWidth - 2);
66
- const works = this.state.listWorks();
71
+ const { works, error } = readTaskView(this.state);
72
+ if (error)
73
+ return [border(innerWidth, "top", this.theme), frame(this.theme.fg("error", "Tasks unavailable · Escape closes"), innerWidth, this.theme), frame(truncateToWidth(error, innerWidth, "…"), innerWidth, this.theme), border(innerWidth, "bottom", this.theme)];
67
74
  const todos = works.flatMap((work) => work.tasks);
68
75
  const items = this.items(works);
69
76
  this.syncSelection(items);
@@ -140,7 +147,7 @@ export class WorksDashboard {
140
147
  return;
141
148
  }
142
149
  if (matchesKey(data, "o")) {
143
- void this.openInCursor();
150
+ void this.openDirectory();
144
151
  return;
145
152
  }
146
153
  if (matchesKey(data, "m")) {
@@ -155,7 +162,7 @@ export class WorksDashboard {
155
162
  if (link)
156
163
  void this.openLinkedDelegate(link);
157
164
  else {
158
- this.message = "Select a delegated task with a Herdr pane link. Navigation requires Herdr.";
165
+ this.message = "Select a delegated task with a Core terminal link. Navigation requires the Herdr app.";
159
166
  this.messageColor = "warning";
160
167
  this.tui.requestRender();
161
168
  }
@@ -225,7 +232,7 @@ export class WorksDashboard {
225
232
  return { handled: true, focus: true, render: true };
226
233
  }
227
234
  if (this.isHit(event.x, this.openHitRegion)) {
228
- void this.openInCursor();
235
+ void this.openDirectory();
229
236
  return { handled: true, focus: true, render: true };
230
237
  }
231
238
  return undefined;
@@ -238,7 +245,7 @@ export class WorksDashboard {
238
245
  this.unsubscribeGit();
239
246
  clearInterval(this.refreshTimer);
240
247
  }
241
- items(works = this.state.listWorks()) {
248
+ items(works = readTaskView(this.state).works) {
242
249
  const items = [];
243
250
  for (const work of works) {
244
251
  items.push({ key: `work:${work.workId}`, kind: "work", work });
@@ -329,19 +336,21 @@ export class WorksDashboard {
329
336
  lines.push(...wrap(this.theme.fg("muted", `${recordId(item.work.workId, this.theme)} ${safeSingleLine(item.work.workName)}`)), "");
330
337
  const status = `${todoIcon(task.status, this.theme)} ${task.status}`;
331
338
  lines.push(...wrap(`${status} · ${formatCompletion(taskCompletion(task))} complete · Time: ${formatTime(taskTime(task))}`), "");
332
- if (task.status === "blocked") {
333
- const reasonWidth = Math.max(1, contentWidth - 2);
334
- for (const line of safeMultiline(`Reason: ${task.blockedReason ?? "No reason recorded."}`)) {
335
- lines.push(...wrapTextWithAnsi(line || " ", reasonWidth).map((part) => this.theme.fg("warning", `│ ${part}`)));
336
- }
337
- lines.push("");
338
- }
339
339
  }
340
340
  else {
341
341
  lines.push(...wrap(`${formatCompletion(workCompletion(item.work))} complete · Time (task effort): ${formatTime(workTime(item.work))}`), "");
342
342
  }
343
- lines.push(this.theme.fg("accent", this.theme.bold(task ? "Task details" : "Work details")));
344
- lines.push(...safeMultiline(task?.taskInfo ?? item.work.workInfo).flatMap(wrap));
343
+ if (task) {
344
+ const dependency = dependentOnLabel(task.dependentOn);
345
+ lines.push(this.theme.fg("accent", this.theme.bold(dependency === undefined ? "Final thoughts" : `Final thoughts · Dependent on: ${dependency}`)));
346
+ const thoughts = finalThoughtsFor(task) ?? "No final thoughts recorded.";
347
+ const color = task.status === "blocked" ? "warning" : "muted";
348
+ lines.push(...safeMultiline(thoughts).flatMap(wrap).map((line) => this.theme.fg(color, line)));
349
+ }
350
+ else {
351
+ lines.push(this.theme.fg("accent", this.theme.bold("Work details")));
352
+ lines.push(...safeMultiline(item.work.workInfo).flatMap(wrap));
353
+ }
345
354
  this.detailPageSize = budget;
346
355
  this.detailOffset = Math.max(0, Math.min(this.detailOffset, Math.max(0, lines.length - budget)));
347
356
  const shown = lines.slice(this.detailOffset, this.detailOffset + budget);
@@ -401,7 +410,7 @@ export class WorksDashboard {
401
410
  this.messageColor = "warning";
402
411
  this.tui.requestRender();
403
412
  try {
404
- await focusPane(link.paneId, this.cwd);
413
+ await focusTerminal(link.terminalId, this.cwd);
405
414
  this.message = "Opened delegated agent in Herdr.";
406
415
  this.messageColor = "success";
407
416
  }
@@ -418,21 +427,21 @@ export class WorksDashboard {
418
427
  this.tui.requestRender();
419
428
  }
420
429
  }
421
- async openInCursor() {
430
+ async openDirectory() {
422
431
  if (this.opening)
423
432
  return;
424
433
  this.opening = true;
425
- this.message = "Opening repository in Cursor…";
434
+ this.message = "Opening repository…";
426
435
  this.messageColor = "warning";
427
436
  this.tui.requestRender();
428
437
  try {
429
- await openRepository(this.cwd);
430
- this.message = "Opened repository in Cursor.";
438
+ await openRepository(this.cwd, this.getOpenCommand());
439
+ this.message = "Opened repository.";
431
440
  this.messageColor = "success";
432
441
  }
433
442
  catch (error) {
434
443
  const reason = error instanceof Error ? ` ${safeSingleLine(error.message)}` : "";
435
- this.message = `Could not open Cursor. Check cursor is on PATH.${reason}`;
444
+ this.message = `Could not open repository. Check pi-tasks.openCommand and that its executable is installed on PATH.${reason}`;
436
445
  this.messageColor = "error";
437
446
  if (!this.disposed)
438
447
  this.notify(this.message, "error");
@@ -450,8 +459,8 @@ export class WorksDashboard {
450
459
  this.message = "Copying all works and todos as Markdown…";
451
460
  this.messageColor = "warning";
452
461
  this.tui.requestRender();
453
- const works = this.state.listWorks();
454
462
  try {
463
+ const works = this.state.listWorks();
455
464
  await copyToClipboard(formatWorksMarkdown(works));
456
465
  const todoCount = works.reduce((total, work) => total + work.tasks.length, 0);
457
466
  this.message = `Copied ${works.length} work${works.length === 1 ? "" : "s"} and ${todoCount} todo${todoCount === 1 ? "" : "s"} as Markdown.`;
@@ -469,7 +478,7 @@ export class WorksDashboard {
469
478
  }
470
479
  }
471
480
  renderFooter(width) {
472
- const text = "↑/↓ select · Enter details · Esc close · C copy · O Cursor · D delegate · M minimize";
481
+ const text = "↑/↓ select · Enter details · Esc close · C copy · O open · D delegate · M minimize";
473
482
  return truncateToWidth(this.theme.fg("muted", text), width, "");
474
483
  }
475
484
  }
package/docs/REFERENCE.md CHANGED
@@ -2,16 +2,19 @@
2
2
 
3
3
  ## Ownership and persistence
4
4
 
5
- `TaskState` owns work and todo state. Every mutation appends a versioned `pi-tasks-state` custom entry to the current Pi session. Custom entries do not enter model context. State restoration replays entries from `sessionManager.getBranch()`, so resume, fork, and tree navigation follow the active session branch.
5
+ `TaskState` owns file-backed work and todo operations. The authoritative document is `<getAgentDir()>/tasks/<Pi-sessionId>.json`, normally `~/.pi/agent/tasks/<sessionId>.json`. Each read loads that file; each mutation reads, validates and atomically replaces it with private file permissions. No record map is kept as an authoritative in-memory cache. Conversation branch navigation never restores, rolls back or duplicates tasks. Resume/reload of the same session retains the file; a new session ID, including a fork, starts independently.
6
6
 
7
- A work deletion also deletes every associated todo. A todo cannot be created for a missing work. IDs are stable within a branch and use `W<number>` for works and `T<number>` for todos.
7
+ A missing store on first startup imports the selected legacy `pi-tasks-state` view once, except when the session_start event identifies a newly created fork. CLI forks can arrive as startup rather than fork; their copied-only legacy events are excluded by comparing parent event identities. Pre-upgrade forks with their own task edits still migrate their old view. This compatibility check requires the parent history file; an unavailable parent is reported without guessing or replacing history. This compatibility migration is the only history replay; original session history is not changed. Existing files with invalid JSON, unsupported schema, wrong identity or invalid records fail visibly without being replaced. TUI render/timer boundaries show a storage error rather than allowing disk exceptions to terminate Pi. A missing file after binding is an error, not a request to reconstruct it. One Pi process owns writes for a session; the Herdr mod is a reader. Concurrent independent Pi writers for the same session ID are not supported.
8
+
9
+ A work deletion also deletes every associated todo. A todo cannot be created for a missing work. IDs remain stable for the entire session and use `W<number>` for works and `T<number>` for todos. Deleted IDs are not reused.
8
10
 
9
11
  Limits:
10
12
 
11
- - 100 works per session branch
12
- - 500 todos per session branch
13
+ - 100 works per Pi session
14
+ - 500 todos per Pi session
15
+ - 16 MiB per JSON task snapshot
13
16
  - 240 characters per name
14
- - 10,000 characters per information field
17
+ - 10,000 characters per workInfo, taskInfo, or blockedReason; finalThoughts has no separate application cap and is bounded only by the 16 MiB snapshot
15
18
  - list tool text is truncated at 50KB or 2,000 lines
16
19
 
17
20
  `WorkList` and `TodoList` accept an optional positive integer `limit`. Without it, they return all matching records (subject to the output truncation above). With it, filters are applied first, then the newest `limit` matching works or todos are returned in oldest-to-newest order within that selection. A `WorkList` limit applies to works, not their nested todos: all todos belonging to each selected work are included. Both tools report the number returned and the total number matching the filters; those counts describe records selected before any text truncation.
@@ -20,31 +23,44 @@ Limits:
20
23
 
21
24
  A work contains `workId`, `workName`, `workInfo`, `createdAt`, and `updatedAt`. It is a collection with no stored or derived lifecycle status. Work tools do not accept status, and WorkList has no status filter. The public WorkStatus type is removed; consumers should use TodoStatus for task lifecycle.
22
25
 
23
- A todo contains `taskId`, `workId`, `taskName`, `taskInfo`, `status`, optional `blockedReason`, optional `completionPercent`, optional `elapsedMs`, optional `delegatedTimes`, runtime-only optional `workingSince`, `createdAt`, and `updatedAt`. Todo status is `active`, `blocked`, `completed`, or `cancelled`; new todos default to `active`.
26
+ A todo contains `taskId`, `workId`, `taskName`, hidden `taskInfo`, optional visible `finalThoughts`, `status`, optional `blockedReason`, optional `dependentOn`, optional `completionPercent`, optional `elapsedMs`, optional `delegatedTimes`, optional snapshot `workingSince`, `createdAt`, and `updatedAt`. Todo status is `active`, `blocked`, `completed`, or `cancelled`; new todos default to `active`. `dependentOn` is the enum `"user-decision" | "another-agent"`, stored only on blocked tasks; the Durable document uses `null` for absence.
27
+
28
+ `taskInfo` is coordination metadata for resumption: the machine-read `owner:` declaration, canonical artifact paths, parent IDs, terminal/monitor links, and necessary execution constraints. It is never rendered as task text. `finalThoughts` is the only user-visible task text; empty/whitespace is stored as absent. Existing records without it remain valid.
24
29
 
25
30
  The public list shape assembles each work with `tasks: Todo[]`; tasks are stored separately to avoid duplicate state. Work progress is derived, not independently stored or editable.
26
31
 
27
- `Blocked` includes waiting for another agent’s output, review, an external response, user input, permission, or a genuine obstacle. Mark dependent tasks blocked immediately. `TodoCreate` requires a nonempty `blockedReason` for blocked creation; `TodoUpdate` requires it when entering blocked status. Explain the dependency and resume condition. Unrelated blocked updates preserve the current reason, and leaving blocked clears it. A supplied non-null reason outside blocked status is rejected. Replay accepts legacy tasks without a reason, which display “No reason recorded.” Lists and copied Markdown include the reason. AgentCreate supplies its automatic waiting reason. 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. Resume affected tasks as active when the dependency resolves and work resumes. Works do not have status; cancelling a collection means explicitly cancelling its remaining tasks. These are agent instructions, not automatic dependency detection or a wake mechanism.
32
+ `Blocked` means waiting for a user decision (a response, approval, or permission) or another agent's output or review. Mark such dependent tasks blocked immediately. `TodoCreate` requires a nonempty `blockedReason` and an explicit `dependentOn` for blocked creation; `TodoUpdate` requires both when entering blocked status. Explain the current dependency and resume condition. The blocked reason is the task's visible Final thoughts, so it is authoritative and is not duplicated in `finalThoughts`; `finalThoughts` is only a legacy fallback when an old blocked record has no reason. Unrelated blocked updates preserve both fields, and leaving blocked clears both. A supplied dependency outside blocked status is rejected. Replay accepts legacy blocked tasks without a dependency and never infers one from prose; details omit the label for those records. External services, tool failures, and other obstacles that fit neither category are not blocked status: keep the task active, preserve safety, and report the unavailable dependency truthfully. Lists and copied Markdown include the visible thought and any stored dependency. AgentCreate supplies its automatic waiting reason with `dependentOn="another-agent"`. 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. Resume affected tasks as active when the dependency resolves and work resumes. Works do not have status; cancelling a collection means explicitly cancelling its remaining tasks. These are agent instructions, not automatic dependency detection or a wake mechanism.
33
+
34
+ Legacy migration accepts version-1 Work events with or without status, ignores retired Work statuses and status-only patches, and preserves IDs, details, timestamps and tasks without rewriting history. It normalizes legacy planned/pending statuses to active. New mutations update only the session task JSON, not custom conversation entries. Older extension versions cannot read that JSON: back up the task file and retain the new version when rolling back other code, rather than expecting old session history to contain post-migration edits.
28
35
 
29
- Replay accepts version-1 Work events with or without status, ignores retired Work statuses and status-only patches, and preserves IDs, details, timestamps and tasks without rewriting history. Work updates containing name/context changes still apply. Task replay normalizes legacy `planned` and `pending` statuses to `active` in both creation and update events; task tools accept only the four current statuses. Older clients that require Work status cannot read new status-free Work creation events correctly: upgrade readers before sharing new history, and retain session files before rollback.
36
+ ### Final thoughts
37
+
38
+ The desktop panel, `/works` task detail, and copied Markdown show only `finalThoughts` (or the blocked reason) as task text. `taskInfo` is never dumped under the new label.
39
+
40
+ - **Blocked:** the authoritative `blockedReason` is shown, including what is awaited and what unblocks it. Do not duplicate it in `finalThoughts`. `/works` shows any stored dependency beside the Final thoughts heading; the native mod shows `Dependent on` beside its inline label. A legacy blocked record with no reason or dependency may fall back to its `finalThoughts` and shows no invented label.
41
+ - **Completed:** `finalThoughts` states the short actual result, verification performed, and remaining limits. A newly completed task should provide it; historical completed records without one remain honestly empty. No outcome is synthesized from old `taskInfo`.
42
+ - **Active:** `finalThoughts` is an occasional short update only when something significant changed; no filler is required per turn, estimate, or tool call.
43
+ - **Contents:** never include the goal again, ownership or delegation rationale, `owner:` declarations, terminal/monitor links, artifact paths, parent IDs, sections, lists, or history.
44
+ - **Transitions:** changing status clears an unsupplied thought. This keeps a new blocked dependency from being hidden by an old active note and prevents resumed or completed rows from showing stale waiting text. An explicitly supplied thought on the transition is kept.
45
+ - **Compatibility:** empty input clears a thought; no destructive history migration, automatic summarization, generated outcome, history list, or new hard length cap is introduced. `taskInfo` and blocked-reason structures remain readable by older records.
30
46
 
31
47
  ### Completion progress
32
48
 
33
- `TodoCreate` and `TodoUpdate` accept optional `completionPercent`: an integer from 0 through 100, or `null` to clear an obsolete estimate. Omission preserves an existing estimate on updates. For longer tasks, the guidance asks the AI to include interim estimates in `TodoUpdate` after roughly 5–10 meaningful working steps or a milestone, not just at completion or in status-only updates. The AI reports approximate progress based on completed effort and verification, explaining the evidence and remaining scope in `taskInfo`; status alone never implies an arbitrary partial percentage. Estimates remain optional; use `null` when unknown and do not increase a percentage without new evidence. This cadence is guidance, not a runtime timer or enforced tool-call count. No new tool or extra model call is added.
49
+ `TodoCreate` and `TodoUpdate` accept optional `completionPercent`: an integer from 0 through 100, or `null` to clear an obsolete estimate. Omission preserves an existing estimate on updates. For longer tasks, the guidance asks the AI to include interim estimates in `TodoUpdate` after roughly 5–10 meaningful working steps or a milestone, not just at completion or in status-only updates. The AI reports approximate progress based on completed effort and verification; visible evidence belongs in `finalThoughts` only when the change is significant, never in hidden `taskInfo`. Status alone never implies an arbitrary partial percentage. Estimates remain optional; use `null` when unknown and do not increase a percentage without new evidence. This cadence is guidance, not a runtime timer or enforced tool-call count. No new tool or extra model call is added.
34
50
 
35
51
  - Completed tasks normalize to 100%; explicit partial progress with completed status is rejected. Explicit 100 requires completed status. Completion remains an agent assertion after verification, not an independent extension proof.
36
52
  - Moving a partial task to blocked retains its progress. Reopening a completed task without a new estimate becomes unknown rather than retaining 100%.
37
53
  - A work is the equal arithmetic mean of all non-cancelled task percentages, rounded down for display. For example, 100, 40, 0, 0 yields 35%.
38
54
  - Any unknown eligible task makes the work unknown (`—`); unknown is not silently 0. With no eligible tasks (empty Work or only cancelled tasks), work is unknown.
39
55
  - Work progress reaches 100 only when all eligible tasks are completed; there is no parent status override. Progress never changes task statuses or auto-continuation eligibility.
40
- - Optional progress fields are additive to version-1 branch events. Legacy completed tasks show 100%; other legacy tasks remain unknown until reported. Invalid optional progress is sanitized on replay without discarding the task.
56
+ - The JSON snapshot stores completion values with each task. Legacy completed tasks migrate to 100%; other legacy tasks remain unknown until reported. Invalid optional legacy progress is sanitized during migration.
41
57
  - Dashboard, compact panel, list output and copied Markdown share these calculations. The compact panel and `/works` reserve separated Done and Time columns; names truncate independently and navigation is unchanged. Percentages do not predict remaining time; no subtasks, weights or separate navigation sidebar are added.
42
58
 
43
59
  ### Measured time
44
60
 
45
61
  `TodoUpdate` accepts optional `working: boolean`, separate from status and progress. `true` selects an active `owner: self` task in this session; a missing task, non-active status, or other ownership is rejected before changing state. The selected task is exclusive per session. `false` pauses that task without changing status; it does not interrupt a different selected task. Changing status away from active, changing ownership away from self, or deleting the task/Work closes its interval. The field is an operation, not persistent task status; callers cannot provide elapsed duration or timestamps.
46
62
 
47
- TaskState owns focus, an agent-running gate, and an in-memory interval timestamp. Snapshot `workingSince` exists only during a running interval. Saved `elapsedMs` is a non-negative safe integer; version-1 `todo-time` custom entries save cumulative totals without altering status, completion, or the task's descriptive `updatedAt`. Replay accepts old entries and sanitizes invalid duration fields to unknown. Restored records never restore running focus or count offline time. New tasks start at zero; older records remain unknown until selected, which begins measurement from that point rather than reconstructing history. Negative intervals following a backward wall-clock change clamp to zero; forward clock corrections can affect measured time because the agreed clock is Date.now().
63
+ The shared JSON stores focus, the agent-running gate, and `workingSince` during an active interval. Interval boundaries atomically update cumulative `elapsedMs` and clear the running marker, without changing status, completion or descriptive `updatedAt`. Resume/reload clears stale running focus without counting offline time. Migration accepts old time entries and sanitizes invalid duration fields to unknown. New tasks start at zero; older records remain unknown until selected, which begins measurement from that point rather than reconstructing history. Negative intervals following a backward wall-clock change clamp to zero; forward clock corrections can affect measured time because the agreed clock is Date.now().
48
64
 
49
65
  `registerTaskTiming` gates focus with agent start/end and nested blocking user-prompt events. Every new `before_agent_start` clears prior selection; native loop continuations can retain selection until final settlement. Abort signals close the interval immediately. Settlement, shutdown, and pre-navigation boundaries close and clear selection. Tool execution and model thinking within an agent loop count; idle and native retry waits between loops do not. Hosts without blocking-prompt events cannot exclude an in-loop extension dialog, but retain loop-boundary pauses. There is no per-second persistence, heartbeat, or crash-recovery registry: forced termination may lose the uncommitted interval.
50
66
 
@@ -52,15 +68,15 @@ TaskState owns focus, an agent-running gate, and an in-memory interval timestamp
52
68
 
53
69
  `TaskTimeExport({ reportPath, taskIds })` reads the descriptor created by AgentCreate and writes a paused cumulative snapshot for the explicitly selected worker tasks. The schema contains version 1, parent session/Work/Task IDs, worker session identity and an array of `{ taskId, elapsedMs }` values. The worker cannot supply durations. Export rejects running tasks, missing or duplicate IDs, another worker session, and dropping previously exported tasks. Cancelled tasks belong in the assignment set; unrelated tasks do not. Nested delegate imports must happen before export. Unknown values propagate rather than becoming zero.
54
70
 
55
- `TaskTimeImport({ taskId })` reads only the paths already registered on that parent task, validates parent and worker identities, and persists the latest snapshot per source. Missing exports remain unknown; missing files and malformed reports produce errors. Validation finishes before state updates begin. A version-1 `todo-delegated-time` event stores `{ reportPath, elapsedMs, workerSessionId? }` per assignment. Re-import replaces the source instead of adding it again, so follow-up cumulative exports and repeated imports do not double-count. Additional AgentCreate assignments add separate sources. Neither export nor import changes status, completion or task descriptive timestamps. Totals remain available after report files or panes are removed, until another explicit import is attempted. Imported events follow the parent branch; files hold the latest worker snapshot and are not branch-versioned, so an explicit import after navigation intentionally reads the latest exported value. Forked parent sessions cannot import reports addressed to the original parent session.
71
+ `TaskTimeImport({ taskId })` reads only the paths already registered on that parent task, validates parent and worker identities, and persists the latest snapshot per source. Missing exports remain unknown; missing files and malformed reports produce errors. Validation finishes before state updates begin. The session JSON stores `{ reportPath, elapsedMs, workerSessionId? }` per assignment. Re-import replaces the source instead of adding it again, so follow-up cumulative exports and repeated imports do not double-count. Additional AgentCreate assignments add separate sources. Neither export nor import changes status, completion or task descriptive timestamps. Totals remain available after report files or panes are removed, until another explicit import is attempted. Imported totals belong to the parent Pi session and are unaffected by tree navigation. Report files hold the latest worker measurement, so an explicit import reads that latest exported value. Forked parent sessions cannot import reports addressed to the original parent session.
56
72
 
57
73
  Report files are bounded to 128 KB and 500 unique task IDs, contain no task prose, and must be regular files below the repository's canonical var/ tree. Exports use the host file-mutation queue and atomic replacement. Descriptor names are unique per assignment. Existing legacy/manual delegations without a registered report remain unknown. Both worker and parent need the new tools loaded; older readers ignore the new timing event. No migration of historical durations is attempted.
58
74
 
59
- Compact floating/widget views refresh running durations once per second while visible and dispose the render timer on hide. `/works` reuses its existing refresh interval. Neither timer writes session entries. Both views reserve Done and Time columns with name clipping, a running marker, and explicit unknown duration. The compact box minimum is 48 columns so the task prefix does not consume the entire name area; widget views hide below that width. Lists, dashboard details, and copied Markdown show the same measured totals.
75
+ Compact floating/widget views refresh running durations once per second while visible and dispose the render timer on hide. `/works` reuses its existing refresh interval. Neither display timer writes the task file. Both views reserve Done and Time columns with name clipping, a running marker, and explicit unknown duration. The compact box minimum is 48 columns so the task prefix does not consume the entire name area; widget views hide below that width. Lists, dashboard details, and copied Markdown show the same measured totals.
60
76
 
61
77
  ## Tracking behavior
62
78
 
63
- When all tracking tools are active, the extension adds hidden per-turn guidance for every normal request that starts or continues work. Pi finds or creates the Work collection, synchronizes todos, marks the current todo active before the attempt, and updates task statuses afterward. Work context changes only when shared scope or decisions change. Tracking is not skipped merely because the request looks small.
79
+ When all tracking tools are active, the extension adds hidden per-turn guidance for every normal request that starts or continues work. Pi finds or creates the Work collection, gives each distinct new actionable request its own todo even when it extends an existing Work, marks the current todo active before the attempt, and updates task statuses afterward. A request is never recorded only by broadening workInfo, renaming an existing todo, or blocking a previous todo; an existing todo is reused only when it genuinely owns the same outcome. Work context changes only when shared scope or decisions change. Tracking is not skipped merely because the request looks small.
64
80
 
65
81
  The guidance also requires every delegated subagent, at every depth, to create or resume its own session-local Work and Todos before assigned work, maintain a real `workId` and an active `taskId`, and return its IDs with results. Parent assignment IDs are recorded as context, not used to mutate another session's records. Worker prompts must carry this requirement, including stopping delegated execution if tracking tools or IDs are unavailable. This is instruction-only, not a tool-call gate or automatic tracking repair.
66
82
 
@@ -70,50 +86,62 @@ The guidance is not added when the tracking tools have been removed from the act
70
86
 
71
87
  The guidance directs every tracked Work, including worker-local Works, through the globally installed `implement` skill. Reuse an active skill rather than recursively invoking it. Specialized skill permissions remain authoritative; planning, research, and review do not gain implementation authority. Missing `implement`, tracking tools, valid session identity, or real IDs blocks execution. Reading instructions, obtaining identity, and establishing records are startup steps, not assigned execution. Plain conversation and side-thread exceptions remain unchanged.
72
88
 
73
- The agent obtains its full session identity from `PI_SESSION_ID` in its own shell-tool command, not from a parent prompt or Herdr pane/name. Require `[A-Za-z0-9][A-Za-z0-9_-]*` and actual Work/Task IDs. Hosts without session-environment support must report the identity blocker rather than guess. Root artifacts use repository-relative `var/<sessionId>/<workId>/<taskId>/`; delegated artifacts append `<childSessionId>/<childWorkId>/<childTaskId>/` beneath the exact canonical parent task directory, recursively. Resolved destinations, including symlinks, must remain inside repository `var/`. Paths and parent IDs go in existing `taskInfo` and handoff context; each worker returns its own IDs and canonical path. Do not migrate legacy artifacts implicitly or overwrite files after branch navigation solely because numeric IDs match. `implement` owns the detailed path/ownership contract, including incompatible specialized helper handling.
89
+ The agent obtains its full session identity from `PI_SESSION_ID` in its own shell-tool command, not from a parent prompt or Herdr pane/name. Require `[A-Za-z0-9][A-Za-z0-9_-]*` and actual Work/Task IDs. Hosts without session-environment support must report the identity blocker rather than guess. Root artifacts use repository-relative `var/<sessionId>/<workId>/<taskId>/`; delegated artifacts append `<childSessionId>/<childWorkId>/<childTaskId>/` beneath the exact canonical parent task directory, recursively. Resolved destinations, including symlinks, must remain inside repository `var/`. Paths and parent IDs go in hidden `taskInfo` and handoff context; each worker returns its own IDs and canonical path. Do not migrate legacy artifacts implicitly or overwrite files after branch navigation solely because numeric IDs match. `implement` owns the detailed path/ownership contract, including incompatible specialized helper handling.
74
90
 
75
- Each task starts its existing `taskInfo` with `owner: self` or `owner: delegate` plus a reason, preserving that declaration in later updates. Delegation requires a bounded outcome, isolated ownership, ready inputs and verified prerequisites, useful parallelism or expertise that exceeds coordination costs, owning-skill permission, and available tracking/monitoring. Small or tightly coupled changes stay with one owner by default. Reassess on scope changes and apply the rule at every permitted delegation depth; parents retain integration and verification responsibility. Herdr retains lifecycle and monitor ownership. Worker root panes use only the parent's delegated Task ID as their name (`T34`, without brackets or descriptions), updated when a different parent Todo is assigned. This label is distinct from worker-local IDs and may repeat across parent sessions; returned resource IDs remain authoritative for lifecycle commands. No file-count, agent-count, or depth threshold is imposed.
91
+ Each task starts its hidden `taskInfo` with `owner: self` or `owner: delegate` plus a reason, preserving that declaration in later updates. Visible progress belongs in `finalThoughts`, never in the owner metadata. Delegation requires a bounded outcome, isolated ownership, ready inputs and verified prerequisites, useful parallelism or expertise that exceeds coordination costs, owning-skill permission, and available tracking/monitoring. Small or tightly coupled changes stay with one owner by default. Reassess on scope changes and apply the rule at every permitted delegation depth; parents retain integration and verification responsibility. Core owns process lifecycle and pi-loop-monitor owns subscriptions. Workers are Core-only by default. When the user or active harness explicitly requires a visible worker, that worker gets a dedicated Herdr app tab using only the parent's delegated Task ID as its name (`T34`, without brackets or descriptions), updated when a different parent Todo is assigned; the presented tab and real returned IDs remain distinct from worker-local identity and may repeat across parent sessions. No file-count, agent-count, or depth threshold is imposed.
76
92
 
77
93
  This is model guidance only. No new schema fields, path-creation code, tool-call gate, cross-session mutation, session-ID API dependency, or automatic skill installer is added. Guidance still depends on all tracking tools being active as described above.
78
94
 
79
95
  ## Auto-continuation
80
96
 
81
- Auto-continuation is optional and requires Pi 1.2.0 or newer. Configure `pi-tasks.autoContinue` in Pi's `settings.json`; the extension reads `pi.getSettings()` so trusted project settings override global settings. `enabled` defaults to `false`; `maxContinuations` is optional. Omission means no continuation limit; if supplied, it must be a positive safe integer. Explicit `null` is invalid. Invalid configuration disables the flow and reports a warning. Hosts without the new settings API keep normal task tracking with no automatic continuation.
97
+ Auto-continuation is optional and requires Pi 1.2.0 or newer. Configure `pi-tasks.autoContinue` in Pi's `settings.json`; the extension reads `pi.getSettings()` so trusted project settings override global settings. `enabled` defaults to `false`. `maxContinuations` is optional and defaults to a hard maximum of 50; if supplied, it must be a positive safe integer. Values above 50 are clamped to 50 with one warning. Explicit `null` is invalid. Invalid configuration disables the flow and reports a warning. Hosts without the new settings API keep normal task tracking with no automatic continuation.
82
98
 
83
- A fresh accepted main interactive/RPC run arms a new continuation epoch. Input is provisional until the run starts, so handled/rejected prompts cannot arm it. Extension/custom starts do not arm or reset it. Steering/follow-up messages queued inside an already-running activity do not themselves reset the cap. Session start/reload, tree navigation, and shutdown disarm it until fresh user input. Explicitly aborted activity also suspends it; failed activity does not. `agent_settled.aborted` covers aborts that skip the actionable boundary. Tracking tools must be active; side conversations must not start continuation.
99
+ A fresh accepted main interactive/RPC run arms a new continuation epoch and is the only path that resets its count. Input is provisional until the run starts, so handled/rejected prompts cannot arm it. Extension/custom starts do not arm or reset it. Steering/follow-up messages queued inside an already-running activity do not themselves reset the cap. Session start/reload and shutdown disarm and reset the epoch; tree navigation disarms it while preserving the count until fresh user input. Explicitly aborted activity also suspends it without resetting the count; failed activity does not. `agent_settled.aborted` covers aborts that skip the actionable boundary. Tracking tools must be active; side conversations must not start continuation.
84
100
 
85
101
  The synchronous `agent_before_settle` handler runs after native retries, compaction, and queued work. It accepts completed or error outcomes and requires a non-aborted signal, no pending messages in either the boundary preview or runtime queue, and no continuation already requested by an earlier handler. Pi is still busy at this actionable boundary, so it does not require `ctx.isIdle()`. Instead it appends one custom-message draft and requests one native continuation; Pi owns committing it and honoring cancellation. No detached prompt, timer, background worker, or polling loop is created.
86
102
 
87
- Any active task across all Works on the current branch requires continuation. Legacy planned/pending task statuses replay as active. Empty Works and completed, blocked, or cancelled tasks do not trigger continuation. Work metadata has no scheduling role. The prompt includes a bounded preview of IDs, names and statuses, and directs the agent to list tools for full details. No records means no continuation. The extension never mutates statuses, verifies work independently, or treats a blocker label as proof of an actual dependency.
103
+ Any active task across all Works in the current Pi session requires continuation. Legacy planned/pending task statuses replay as active. Empty Works and completed, blocked, or cancelled tasks do not trigger continuation. Work metadata has no scheduling role. The prompt includes a bounded preview of IDs, names and statuses, and directs the agent to list tools for full details. No records means no continuation. The extension never mutates statuses, verifies work independently, or treats a blocker label as proof of an actual dependency.
104
+
105
+ A focused `owner: self` task that launched a command `MonitorCreate` with an `onDone` wake is excluded from that preview until the wake is actually delivered, dismissed, or stale. pi-tasks captures the exact task at `tool_call` by tool-call identity, matches it with `pi-loop-monitor:ondone-registered`, and verifies each boundary through `pi-loop-monitor:state-probe`. Core `hcTerminalId` subscriptions are excluded because their signals report worker state, not command completion; worker signals and unrelated active tasks continue normally. The probe's `queued` state still suppresses continuation while a completed monitor's notification waits for Pi to become idle, and `released` clears that wait only after actual delivery or dismissal. A task may have multiple outstanding command waits; they are tracked and released individually, with no one-monitor limit, and any live or queued wait keeps that task suppressed. pi-tasks does not parse monitor text or create a replacement loop. The task stays active and its status is never changed to blocked for these waits.
88
106
 
89
- When `maxContinuations` is supplied, at most that many extra continuations are requested per fresh accepted main user run. The next unfinished boundary warns once and suspends continuation; a fresh user prompt resets the cap. With no limit supplied, continuation can consume tokens indefinitely while unfinished records remain, until explicitly interrupted, disabled or otherwise suspended, including during repeated provider failures. This is not a cost cap or a cap on native tool/retry requests, and another extension may independently request work. Settings changes take effect when Pi reloads effective settings, normally through `/reload`.
107
+ At most the effective limit (50 by default, or a lower configured value) of extra continuations are requested per fresh accepted main user run. The 50th or lower-bound request is labeled final; the next unfinished boundary warns with the count and suspends continuation without changing records. A fresh user prompt resets the cap. The cap applies across failed runs, native retries, compaction, and queued work, and cannot be reset by extension messages, steering/follow-up input, or session-tree changes. This is not a cost cap or a cap on native tool/retry requests, and another extension may independently request work. Settings changes take effect when Pi reloads effective settings, normally through `/reload`.
90
108
 
91
- ## Repository status and Cursor
109
+ ## Repository status and opening directories
92
110
 
93
111
  Both terminal views share a cwd-scoped asynchronous Git status cache, separate from persisted work/todo state. The top border centers `git <branch> · S<staged> U<unstaged> ?<untracked>`; zero counts collapse to `clean`, detached HEAD uses `@<shortcommit>`, and narrow frames shorten the branch first. The border label remains when minimized. Initial loading displays `git loading…`, non-repositories have a plain border, and initial read failures display `git unavailable`; refreshes and later failures retain the prior snapshot.
94
112
 
95
113
  The implementation is informed by [pi-powerline-footer's cache behavior](https://github.com/nicobailon/pi-powerline-footer/blob/main/git-status.ts): a one-second cache, asynchronous stale-while-refresh reads, deduplicated requests, cwd/generation guards, read-only Git environment (`GIT_OPTIONAL_LOCKS=0`), and bounded child processes. This extension reads branch and file counts together rather than running a separate branch timer. Attached views share the poller; unsubscribing the last view or shutting down releases it. File-changing `write`, `edit`, and `bash` results expire cached data sooner.
96
114
 
97
- Open appears between Copy and Minimize/Maximize. It executes `cursor` with the separate argument `.` in the active session working directory, without a shell. The executable must be on PATH; errors are shown instead of silently failing. `/works-panel open` supplies a command path, and `/works` uses `o`. Open is also available outside Git repositories.
115
+ Open appears between Copy and Minimize/Maximize. It executes the command from `pi-tasks.openCommand` (default `["cursor"]`) with the separate argument `.` appended in the active session working directory, without a shell. The executable must be on PATH or specified by absolute path; errors are shown instead of silently failing. `/works open` supplies a command path, and `/works` uses `o`. Open is also available outside Git repositories.
98
116
 
99
117
  ### Ownership display
100
118
 
101
- `taskOwner(taskInfo)` interprets explicit line-start `owner: self` or `owner: delegate` declarations case-insensitively. A trailing sentence/reason is allowed, but incidental prose and longer enum-like tokens such as `self-managed` do not count. Missing/invalid decisions or conflicting valid declarations return `unassigned`; repeated identical declarations remain unambiguous. Compact floating/widget panel rows, dashboard rows, and todo detail headings share this interpretation and show `[taskId] [self/delegate] Task name` (or `[unassigned]`). The existing `taskInfo` is the sole source; no persistence fields, tool parameters, migrations, or task-name edits are introduced. Progress reservations, status/count logic, and full details remain unchanged.
119
+ `taskOwner(taskInfo)` interprets explicit line-start `owner: self` or `owner: delegate` declarations case-insensitively. A trailing sentence/reason is allowed, but incidental prose and longer enum-like tokens such as `self-managed` do not count. Missing/invalid decisions or conflicting valid declarations return `unassigned`; repeated identical declarations remain unambiguous. Compact floating/widget panel rows, dashboard rows, and todo detail headings share this interpretation and show `[taskId] [self/delegate] Task name` (or `[unassigned]`). Hidden `taskInfo` remains the sole ownership source; no ownership persistence fields or ownership tool parameters are introduced. `finalThoughts` is a separate visible text field and never assigns ownership. Progress, status/count logic, and rendering remain unchanged.
102
120
 
103
121
  ### Delegate navigation
104
122
 
105
- Agent tools are thin, bounded, shell-free Herdr CLI wrappers using actual paneId values. No separate agent handle, private registry, process/session validation, startup receipt, recovery/reconnection or acquisition framework is implemented. Panes are assumed not to be repurposed. Structured CLI errors are reported even with exit code zero, and partial creation failures report the handles already obtained without automatic retry/cleanup.
123
+ The separate pi-herdr package owns and registers all nine Agent tools; pi-tasks no longer registers them. Agent tools are thin Core CLI wrappers using terminalId addresses returned by hc (t7 or machine/t7), never app pane IDs. AgentCreate derives and creates the canonical delegated-task directory from the host session and real Work/Task IDs, validates a real HC_TERMINAL_ID parent, checks Pi's native idle status, then registers MonitorCreate with hcTerminalId. It is Core-only by default; with `present: true` it also checks the parent's app space before launch, adopts the worker into a dedicated visible task-named tab, verifies it and returns tabId only then. It returns taskDir/terminalId/monitorId/reportPath, assignmentSent:false and worker-local tracking/timing instructions. Confirm the Core subscription ready receipt before AgentSend; follow-ups keep that monitor.
106
124
 
107
- AgentCreate creates a timing descriptor in the existing canonical taskDir, then creates a dedicated unfocused tab, starts Pi with the supplied model flags and calls the existing MonitorCreate through ctx.executeTool. It appends a TaskTimeImport reminder to onSignal; optional onDone remains unchanged. It returns paneId/tabId/monitorId/reportPath, assignmentSent:false and the prepared assignment with TaskTimeExport instructions. The AI must confirm MonitorList shows subscription ready before explicit AgentSend. Follow-up sends do not replace the monitor. AgentClose calls MonitorStop with the supplied monitorId, then closes the supplied pane; callers must use only resources they created. AgentList returns the CLI inventory, including unrelated agents. No subprocess runs during rendering.
125
+ Core owns processes; herdr-app owns requested presentation and focus; pi-loop-monitor owns continuous state delivery. No HERDR_ENV prerequisite or TUI fallback remains. A post-launch AgentCreate failure returns structured `status: partial` handles and a prepared assignment without automatic retry/cleanup; pi-herdr's AgentResume inspects the timing descriptor above, proves Core ownership, requires idle Pi, reuses or replaces one ready subscription, then reattaches timing/linkage. Native status and terminal lifecycle are not proof of task completion. AgentClose stops the specified monitor when present, kills only the owned live terminal, removes its finished record, and clears matching links.
108
126
 
109
- AgentCreate marks the parent task blocked and stores herdr-pane and herdr-monitor lines in existing taskInfo after successful agent startup and monitor creation; task tools persist and restore these details. TodoUpdate preserves existing link lines for delegate-to-delegate detail edits unless explicit replacement metadata is supplied, so ordinary progress/status descriptions do not silently disable navigation. Changing ownership, explicit `herdr-pane: none`, or AgentClose can unlink. delegateLink interprets an unambiguous valid pane ID for owner:delegate inside Herdr. AgentClose removes matching delegate links. Pane links do not change task schema or complete tasks automatically; separate delegatedTimes fields hold timing snapshots. Execution of onSignal/onDone remains owned by pi-loop-monitor; onDone means its process ended, not that worker work is complete.
127
+ `TodoUpdate` marks the first completion of a linked delegate task in its result data with `status`, `completedTransition`, and `cleanupTerminalId`. pi-herdr consumes that data through the normal `tool_result` hook and appends a cleanup advisory only when `hc get` proves the Core parent and `pi.session`/`pi.task` labels belong to this session and task. The advisory is informational: it asks the parent to verify the result and decide between a real follow-up dependency and `/close`, retrospective review, timing import, and `AgentClose`. It sends no command, changes no state, and repeats only on another completion transition.
110
128
 
111
- Delegate navigation and AgentFocus first focus the pane, then explicitly activate the tab returned by Herdr; pane-focus success alone does not guarantee that the visible client switched tabs.
129
+ Links store hc-terminal/hc-monitor in hidden taskInfo. Delegate-to-delegate detail edits preserve metadata unless explicitly replaced. hc-terminal:none unlinks; historical herdr-pane text is preserved but never interpreted as Core. Navigation uses herdr-app: `agent.focus` for a terminal that owns a pane or belongs to another machine, and `terminal.peek` for a pane-less child or deeper child with a nonempty Core parent record. The peek overlay opens over the current tab and never navigates to the parent. The Pi helpers classify from the desktop app listing and `hc get`; they assume `hc` and the running app target the same Core (`HC_SESSION`/`HC_SOCKET`) and do not perform Pet Town's `verified_world` cross-Core connection anchor. Isolated Core worlds are not independently matched. An address Herdr is not showing fails explicitly instead of reporting a silent success. Underlined linked badges, clicks and keyboard actions remain unchanged; no subprocess runs during rendering. Missing app/CLI and stale targets are reported by the focus tool. Timing exports/imports are unchanged.
112
130
 
113
- Linked `[delegate]` badges and Cursor Open controls are underlined. Fullscreen mouse regions use ANSI-aware visible columns and only include complete visible badges after clipping and scrolling. Floating/widget rows, dashboard rows and todo detail headings support clicks; hidden/minimized/offscreen badges have no regions. In `/works`, `d` opens the selected task's delegate, and `/works-panel delegate T<number>` provides a command path in regular mode. Outside Herdr or without a pane link, ownership stays informational and is not underlined. Unavailable CLI, stale/closed targets and other navigation failures produce visible errors.
131
+ ### Task-owned delegation bridge
132
+
133
+ The extension factory subscribes to `pi-tasks:delegation-api`. A synchronous `{ version: 1, respond(api) }` request obtains `prepare(ctx, { workId, taskId, taskDir }) -> Promise<{ reportPath }>`, `inspect(ctx, { workId, taskId, taskDir, reportPath }) -> Promise<TimingInspection>`, `attach(ctx, { workId, taskId, terminalId, monitorId, reportPath }) -> void`, and `detach(ctx, { terminalId }) -> void`. AgentCreate derives and validates `taskDir` from the host session and real Work/Task IDs. Prepare validates the existing delegate task/work, creates the canonical directory if absent inside the repository's real `var/`, and writes the timing descriptor; inspect validates an existing descriptor for a resume, requiring it to be a regular file inside that task directory whose parent session/work/task match the current assignment, and reports `timing: "placeholder" | "measured"` from the presence of a worker session and task list; attach revalidates and records timing/link metadata plus the blocked waiting state with `dependentOn="another-agent"`; detach clears matching links after AgentClose. A placeholder is not a measurement: it stays unknown until the worker exports. All operations require active tracking tools and the current session generation/context. Shutdown or replacement invalidates retained APIs, and prepare/inspect check ownership again after their asynchronous work. pi-herdr discovers the bridge when needed; no runtime internal imports, registry or additional task store are introduced. UI CLI helpers remain in pi-tasks for task navigation.
134
+
135
+ pi-herdr 0.1.0 needs this compatible local source. The package version remains 0.15.0, but published 0.15.0 lacks this bridge and still registers Agent tools. Replace that legacy source rather than installing both; pi-herdr detects duplicate Agent names before registration, reports migration instructions and blocks Agent calls instead of overriding them.
114
136
 
115
137
  ## Interfaces
116
138
 
117
- The compact panel defaults to a non-capturing floating overlay anchored at the top-right. Its header hides the session ID and places an underlined Open session action immediately after Copy, including minimized/widget layouts. The action uses the Pi session-context identity to locate the matching direct/nested artifact directory under repository var and opens it via the existing shell-free Cursor launcher. If absent, the standard var/sessionId directory is created on activation; ambiguous matches or unsafe identity fail visibly. No lookup or process launch occurs during rendering. /works-panel open-session supplies a keyboard-command path. Existing repository Open remains separate. On narrow headers, Minimize/Maximize shorten to [-]/[+] to preserve every action and its hit region; overflow hints use remaining space. It prefixes work and todo names with bracketed IDs (`[W1] Name`, `[T1] [self] Name`), alongside status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows. In fullscreen TUI mode, its title-bar Copy action exports every work and nested todo as Markdown, while Minimize collapses the panel to a restorable title bar that keeps Copy, Open, and Maximize available. `/works-panel minimize` and `/works-panel maximize` provide a keyboard-command path and preserve the collapsed state when switching between floating and widget layouts. Overflow starts at the newest rows and follows newly added tail rows until the user scrolls upward. Mouse-wheel events over the expanded floating panel scroll it directly without taking keyboard focus; regular terminal mode shows the newest rows and uses `/works` for complete browsing and copying. Because Pi treats any persistent overlay as active, the floating mode can block display-mode changes. `/works-panel widget` switches to a right-aligned widget above the editor, renders all rows, and retains the title actions, while `/works-panel off` hides it.
139
+ `pi-tasks.panel.enabled` defaults to false; `pi-tasks.panel.mode` defaults to floating and also accepts widget. `pi-tasks.herdrPanel.enabled` also defaults to false; when true, a TUI session in a local Herdr Core terminal opens or focuses the native Tasks pane at session start and replaces a Tasks pane left by the same terminal’s earlier session. Automatic startup keeps setup failures silent, while `/works herdr-on` reports them. Pi 1.2+ merged settings apply on startup/reload; older hosts keep defaults. `/works compact-off` hides the compact TUI and `/works compact-on` restores the last visible mode. Commands do not rewrite settings. `/works` remains available on demand. `/works herdr-on` validates the current session snapshot, installs missing bundled assets into the personal mods/pi-tasks directory, then explicitly opens a native read-only pane beside the originating local Core terminal. Existing files/customizations are never overwritten. A missing/invalid snapshot binding fails before pane creation with restart/resume guidance; no snapshot is synthesized from stale in-memory records. It passes sessionId, snapshot path and terminal identity, never infers the session from UI focus, and does not launch a second Pi. If same-session Loops/Monitors is already open, Tasks stacks below it instead of creating another column. Reopening focuses the existing Tasks pane. Closing either panel leaves the other in place without affecting task state.
140
+
141
+ Native header close uses a personal cloned layout/header, leaving originals intact and delegating other panes to its copied base renderer. Only an exact terminal-null pi-tasks pane can be closed. Existing top/always headers are required; conflicting personal files are preserved. Content uses compact Work→Task rows, unboxed inline Final thoughts with any stored blocked dependency beside the label, leading genuine-running/blocked symbols, adjacent existing-delegate Agent buttons and plain metrics, without session/status bars or a footer. Repository command configuration is passed as explicit view props.
142
+
143
+ The native mod reads the same version-1 snapshot containing sessionId, cwd, optional terminalId, updatedAt, nextWorkId, nextTaskId, works, todos, agentRunning and optional focusedTaskId. It never edits task JSON. Its header status dropdown is view state: the header writes `pi-tasks-status:<paneId>` through Herdr's shared store and the view reads it, so filtering changes visibility only and no pane sees another pane's selection. The opener passes `paneFile`, an absolute `<agentDir>/tasks/<sessionId>.pane` holding the hosting pane id, because a pane content copy receives only its creation props. A pane created before that hand-off has no `paneFile` prop, so the view also looks itself up in the live pane inventory: the Tasks pane in the source terminal's tab, adopted only when exactly one matches. A missing, malformed or ambiguous answer leaves the view at All statuses. Copy and header menu behavior assume the installed personal mods are refreshed after a source change. See [setup](USAGE_GUIDE.md#panel-visibility-and-herdr-tasks-pane).
144
+
145
+ The compact TUI panel is off by default. When explicitly enabled, its default visible mode is a non-capturing floating overlay anchored at the top-right. Its header hides the session ID and places an underlined Open session action immediately after Copy, including minimized/widget layouts. The action uses the Pi session-context identity to locate the matching direct/nested artifact directory under repository var and opens it via the configured shell-free launcher. If absent, the standard var/sessionId directory is created on activation; ambiguous matches or unsafe identity fail visibly. No lookup or process launch occurs during rendering. /works open-session supplies a keyboard-command path. Existing repository Open remains separate. On narrow headers, Minimize/Maximize shorten to [-]/[+] to preserve every action and its hit region; overflow hints use remaining space. It prefixes work and todo names with bracketed IDs (`[W1] Name`, `[T1] [self] Name`), alongside status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows. In fullscreen TUI mode, its title-bar Copy action exports every work and nested todo as Markdown, while Minimize collapses the panel to a restorable title bar that keeps Copy, Open, and Maximize available. `/works minimize` and `/works maximize` provide a keyboard-command path and preserve the collapsed state when switching between floating and widget layouts. Overflow starts at the newest rows and follows newly added tail rows until the user scrolls upward. Mouse-wheel events over the expanded floating panel scroll it directly without taking keyboard focus; regular terminal mode shows the newest rows and uses `/works` for complete browsing and copying. Because Pi treats any persistent overlay as active, the floating mode can block display-mode changes. `/works widget` switches to a right-aligned widget above the editor, renders all rows, and retains the title actions, while `/works compact-off` hides it.
118
146
 
119
- `/works` opens a top-centered detailed overlay. List rows and detail headings use the same bracketed ID and ownership prefixes; list metadata no longer repeats the ID after the name. The dashboard title remains unchanged. Stored names remain unchanged. Its top-right Copy action uses `c` to copy every work and nested todo to the system clipboard as Markdown. Its Open action uses `o` to open the current directory in Cursor. Its Minimize action uses `m` to collapse the overlay to a framed top bar containing live total work and todo counts, Copy, Open, and a Maximize action; activating Maximize restores the full dashboard. In fullscreen TUI mode, Copy, Open, and Minimize/Maximize also respond to left clicks. Configured selection keys choose records; confirmation or a row click opens a dedicated full detail view that replaces the list within the existing overlay. The view shows Back to works, ID/owner, name, parent work, status/progress/time, a prominent `Reason: ...` line when blocked, and full details. Arrow keys, Page Up/Page Down, and the mouse wheel scroll long details. The Back action or configured cancel key returns to the same list selection and scroll position; cancel from the list closes the dashboard. Delegate badges remain independent click targets and retain their agent-navigation behavior. Work rows also open full Work details. Missing/deleted selections return to the list.
147
+ `/works` opens a top-centered detailed overlay. List rows and detail headings use the same bracketed ID and ownership prefixes; list metadata no longer repeats the ID after the name. The dashboard title remains unchanged. Stored names remain unchanged. Its top-right Copy action uses `c` to copy every work and nested todo to the system clipboard as Markdown. Its Open action uses `o` to open the current directory using the configured command. Its Minimize action uses `m` to collapse the overlay to a framed top bar containing live total work and todo counts, Copy, Open, and a Maximize action; activating Maximize restores the full dashboard. In fullscreen TUI mode, Copy, Open, and Minimize/Maximize also respond to left clicks. Configured selection keys choose records; confirmation or a row click opens a dedicated full detail view that replaces the list within the existing overlay. The view shows Back to works, ID/owner, name, parent work, status/progress/time, a prominent `Reason: ...` line when blocked, and full details. Arrow keys, Page Up/Page Down, and the mouse wheel scroll long details. The Back action or configured cancel key returns to the same list selection and scroll position; cancel from the list closes the dashboard. Delegate badges remain independent click targets and retain their agent-navigation behavior. Work rows also open full Work details. Missing/deleted selections return to the list.