@abhishek944/pi-tasks 0.15.0 → 0.17.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 (54) hide show
  1. package/README.md +63 -14
  2. package/dist/agents/delegation.d.ts +4 -0
  3. package/dist/agents/delegation.js +130 -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 +409 -33
  9. package/dist/blocked.d.ts +29 -0
  10. package/dist/blocked.js +100 -0
  11. package/dist/command.d.ts +2 -2
  12. package/dist/command.js +7 -3
  13. package/dist/delegated-time.d.ts +12 -1
  14. package/dist/delegated-time.js +96 -15
  15. package/dist/dependency.d.ts +7 -0
  16. package/dist/dependency.js +13 -0
  17. package/dist/durable.d.ts +42 -0
  18. package/dist/durable.js +577 -0
  19. package/dist/herdr-header.d.ts +3 -0
  20. package/dist/herdr-header.js +100 -0
  21. package/dist/herdr-panel.d.ts +15 -0
  22. package/dist/herdr-panel.js +219 -0
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +125 -56
  25. package/dist/markdown.js +3 -1
  26. package/dist/panel-settings.d.ts +11 -0
  27. package/dist/panel-settings.js +30 -0
  28. package/dist/progress.js +1 -1
  29. package/dist/snapshot.d.ts +23 -0
  30. package/dist/snapshot.js +166 -0
  31. package/dist/state.d.ts +43 -18
  32. package/dist/state.js +581 -289
  33. package/dist/thoughts.d.ts +11 -0
  34. package/dist/thoughts.js +14 -0
  35. package/dist/timing.js +9 -2
  36. package/dist/tools.js +295 -34
  37. package/dist/tracking.js +25 -13
  38. package/dist/transition.d.ts +9 -0
  39. package/dist/transition.js +26 -0
  40. package/dist/types.d.ts +76 -3
  41. package/dist/ui/panel.js +38 -19
  42. package/dist/ui/task-view.d.ts +7 -0
  43. package/dist/ui/task-view.js +10 -0
  44. package/dist/ui/works-dashboard.js +37 -19
  45. package/docs/REFERENCE.md +85 -31
  46. package/docs/USAGE_GUIDE.md +129 -55
  47. package/herdr/pi-tasks/README.md +46 -0
  48. package/herdr/pi-tasks/header.js +212 -0
  49. package/herdr/pi-tasks/main.js +488 -0
  50. package/herdr/pi-tasks/mod.json +3 -0
  51. package/herdr/pi-tasks/spinner.svg +1 -0
  52. package/package.json +26 -1
  53. package/dist/agents/tools.d.ts +0 -3
  54. package/dist/agents/tools.js +0 -143
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,47 +23,72 @@ 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 `blockedAt`, optional `decisionQuestionId`, optional `completionPercent`, optional `elapsedMs`, optional `delegatedTimes`, optional snapshot `workingSince`, `createdAt`, and `updatedAt`. Every task also stores a visible goal and criteria, and the status set includes `closed`. A task starts active; no goal confirmation is required. Legacy records may store a goal confirmation or closeout attempts, and those fields remain readable exactly as stored. Records written before the lifecycle have no goal or revision; they remain readable exactly as stored and can be updated, completed, or closed without a fabricated goal or approval. `dependentOn` is `"user-decision" | "another-agent"`, stored only on blocked tasks; the Durable document uses `null` for absence. `blockedAt` is the epoch millisecond when the current blocked state began and is optional so legacy records omit the age instead of showing an invented one. `decisionQuestionId` links a `user-decision` blocker to its pi-decisions question and is cleared when the task leaves blocked or changes dependency class.
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. Goals, criteria and `finalThoughts` are visible; empty/whitespace final thoughts are stored as absent. Existing records without them 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` creates an active task; `TodoUpdate` requires both fields 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 are classified by who can clear them, not by what failed. An obstacle only the user can clear — signing in or reconnecting a browser profile, granting access, supplying an identifier only they hold, or choosing between options — is a `user-decision` blocker. An obstacle nobody can act on yet — a provider outage, an unreachable service, an internal tool defect — is 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. Each blocked state records `blockedAt`; an unrelated blocked edit preserves it, while a different dependency class starts a new age. When the blocker is a browser decision, store its question ID in `decisionQuestionId`. Several tasks may reference the same question: one answer must reconcile every linked task, and a superseded page is retired with `WithdrawQuestion` while its linked task records are updated in the same turn. If the agent concludes in conversation that a blocked dependency no longer exists, it must update the task record in that same turn; saying no input is needed without clearing or re-recording the blocker is a lifecycle defect. A task whose premise no longer holds is retired through the human cancellation decision with a recorded reason, never by inventing completion. A cancellation requested from an active task is recorded as blocked on `user-decision` with its `decisionQuestionId` while the page is pending; rejection restores it to active, so no active task is left awaiting the user with no record. `TaskLifecycleDecision` accepts an optional cancellation `reason`, shown on the page and stored with the decision. 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.
35
+
36
+ ### Task lifecycle
37
+
38
+ Each task stores its goal and criteria separately from hidden coordination notes. `TaskGoalUpdate` replaces them and increments the goal revision; no approval is required. Starting, timing, delegation, completion, and closure do not need goal confirmation.
39
+
40
+ Verified work is `completed` at 100% and remains visible. A completed task can be closed without a separate approval step: `TodoUpdate` accepts `closed`, or for a delegated task use `TaskWorkerClose` to request and verify a `/close`, or `TaskCloseoutFinalize` to verify the worker is absent and record that the retrospective was not run. An unverified presence check never proves absence. Closed and cancelled tasks remain stored but are hidden in the Tasks panel. Deletion only permits a task with no recorded work; a Work containing retained tasks cannot be deleted. `TaskLifecycleDecision` requires an explicit human decision to cancel a task or reopen a closed or cancelled one. A legacy task with no stored `revision` is bound as revision 0 for this decision path, so it remains readable and retireable without an unrelated edit; the first actual mutation assigns a real revision, and no stored data is rewritten merely to present the decision. Reopening retains prior attempts and effort.
28
41
 
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.
42
+ A local pi-decisions answer is validated against its session and immutable question, but it does not cryptographically prove a human submitted it: a same-user local process with access to the page capability can submit an answer. Real human action is a workflow requirement, not a tamper-proof authentication boundary. Similarly, generic shell/Core access is outside the tool-level guards.
43
+
44
+ Existing session task files are read as stored: no record is rewritten, no goal is synthesized, and no human approval is fabricated. Because there is no second lifecycle, their records follow these same rules; a goal-less record can be worked, completed, or closed without a fabricated goal. The independent Durable 1.1 conversation backend has no nested tool bridge for pi-decisions or Core; it closes a completed task normally and does not implement the explicit human cancel/reopen path.
45
+
46
+ ### Final thoughts
47
+
48
+ Task details show `finalThoughts` (or the blocked reason) as the result update. Task details also show the stored goal and criteria when present. `taskInfo` remains hidden.
49
+
50
+ - **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 and blocked age beside the Final thoughts heading; the native mod shows `Dependent on` and `Blocked for` beside its inline label and a compact age in the collapsed row. A legacy blocked record with no reason or dependency may fall back to its `finalThoughts`, shows no invented label, and shows no age at all rather than zero.
51
+ - **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`.
52
+ - **Active:** `finalThoughts` is an occasional short update only when something significant changed; no filler is required per turn, estimate, or tool call.
53
+ - **Contents:** never include the goal again, ownership or delegation rationale, `owner:` declarations, terminal/monitor links, artifact paths, parent IDs, sections, lists, or history.
54
+ - **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.
55
+ - **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
56
 
31
57
  ### Completion progress
32
58
 
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.
59
+ `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
60
 
35
- - 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.
61
+ - Completed and closed tasks are 100%; explicit partial progress with those statuses is rejected. Completion is an agent assertion after verification; closure needs no separate approval.
36
62
  - Moving a partial task to blocked retains its progress. Reopening a completed task without a new estimate becomes unknown rather than retaining 100%.
37
63
  - 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
64
  - 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
65
  - 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.
66
+ - 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
67
  - 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
68
 
43
69
  ### Measured time
44
70
 
45
- `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.
71
+ `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 for the rest of that run; 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.
72
+
73
+ Automatic start removes the routine initial `working=true` call. When the agent is actually running (the same execution gate that drives `agentRunning`), exactly one task that is active, declares `owner: self`, and carries no delegated timing is selected without a tool call: at the start of each run, when a run resumes after a blocking prompt, and when a task becomes eligible during a run (return to active or reopen). With no candidate or several, no automatic choice is made and the caller selects explicitly. Delegated ownership, blocked, completed, closed and cancelled tasks are never auto-selected. A current focus or an explicit `working=false` pause always wins; the pause lasts until the next run boundary. One local task remains timed at a time, and idle, prompt and terminal pauses are unchanged.
46
74
 
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().
75
+ 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`. Automatic selection writes the same focus field and therefore the same validation rules apply; it can only run while `agentRunning` is true, so no timer starts in a session that is restored, idle, or blocked on a prompt. 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
76
 
49
- `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.
77
+ `registerTaskTiming` gates focus with agent start/end and nested blocking user-prompt events. Every new `before_agent_start` clears prior selection and an explicit pause; the same activity gate then starts the sole eligible task automatically at `agent_start` or when a task becomes eligible, so no tool call is needed for routine work. 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
78
 
51
79
  `taskTime`, `workTime`, and `formatTime` supply shared display calculations. Work time sums all tasks, including cancelled tasks, because already-spent effort is real; an empty Work or any unknown task yields unknown. This differs deliberately from completion, which excludes cancelled tasks and averages rather than sums. Delegated workers measure their own session-local tasks. Parent delegate records remain unknown until their registered assignment snapshots have been exported and imported. Known task effort is the stored local interval total plus imported assignment totals; prompt-to-completion duration is never used as a substitute. Imported sources remain attached across ownership changes so already-consumed effort is not lost. Unknown local history or any unknown source keeps the aggregate unknown. Unsafe aggregate totals also display unknown. No cross-session task registry or live monitor timing bridge is added.
52
80
 
53
81
  `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
82
 
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.
83
+ `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
84
 
57
85
  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
86
 
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.
87
+ 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
88
 
61
89
  ## Tracking behavior
62
90
 
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.
91
+ 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
92
 
65
93
  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
94
 
@@ -70,23 +98,39 @@ The guidance is not added when the tracking tools have been removed from the act
70
98
 
71
99
  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
100
 
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.
101
+ 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
102
 
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.
103
+ 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
104
 
77
105
  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
106
 
79
107
  ## Auto-continuation
80
108
 
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.
109
+ 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 10; if supplied, it must be a positive safe integer, subject to the existing maximum of 50. 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
110
 
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.
111
+ 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
112
 
85
113
  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
114
 
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.
115
+ Eligible active tasks across all Works and pending TodoUpdate completion or blocker transitions share one task-review continuation. Legacy planned/pending task statuses replay as active. Empty Works and unchanged blocked, completed, or cancelled tasks do not trigger continuation. Work metadata has no scheduling role. The prompt includes task IDs, names and statuses and directs the agent to list tools for full details. The extension never mutates statuses, verifies work independently, or treats a blocker label as proof of an actual dependency.
116
+
117
+ Continuation is not a retry. Before continuing, the extension fingerprints the records it would send: task and work IDs, status, completion estimate and visible Final thoughts. Comparing only happens when nothing outside task bookkeeping ran since the previous committed continuation, so real work is preserved without demanding a reporting update every round: reads, searches, builds, browser calls, edits, monitors and decisions all count as work even when the record fields stay untouched, and tracking never requires a filler `TodoUpdate`. An orchestration wrapper such as `codemode` is credited only with the nested calls it ran, identified by Pi's `<callerId>/<n>` nested call IDs, so a batch that only read or rewrote bookkeeping is not progress. Work evidence accumulates across native retries and queued low-level runs inside one settlement interval and is cleared only when a continuation is committed or a fresh accepted main run starts. A comparison interval with no such work and an identical fingerprint would repeat the previous round exactly, so it stops the epoch with one visible notice. A fresh accepted main user run clears the fingerprint with the count, and a delivered or dismissed command-monitor wake clears it too, because the new evidence is not comparable with the interval that was waiting. Measured time, the running interval and hidden `taskInfo` are excluded, so ordinary time accumulation cannot mask a stall. When the stop does happen, the unresolved obstacle, wait or failure is reported once with its exact dependency and resume trigger instead of being repeated.
88
118
 
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`.
119
+ 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.
120
+
121
+ At most the effective limit of extra continuations are requested per fresh accepted main user run: 10 by default, a higher configured `maxContinuations` up to the hard maximum of 50, and 50 when a configured value exceeds it. The final permitted request is labeled final. If active tasks remain after that request, the next boundary surfaces one explicit unresolved warning that names them, states that progress continuation stopped at the limit, and tells the user to send a new prompt to start a fresh budget; it changes no record and does not silently imply completion. When `autoContinue.enabled` is false and active tasks remain, the same explicit unresolved warning appears once instead of a silent settlement, and names the settings change followed by a fresh main prompt as the actionable continuation; reloading the setting alone does not arm continuation, so a new accepted main prompt is required. Tasks with a live command-monitor wake are identified as having their own wake, not relabeled blocked or cancelled. 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`. Reloading does not arm a continuation epoch; only a fresh accepted main user prompt does.
122
+
123
+ ## Transition review
124
+
125
+ The desktop extension registers a `tool_result` observer for both TodoUpdate implementations. The tools add an additive structured marker (`details.data.transition` and `details.data.taskId` in the standard tool; the Durable tool also exposes the marker on its flat details) when the status changes to `completed`, `blocked` with `user-decision`, or `blocked` with `another-agent`, or when a blocked task's dependency class changes between the two blocked values. Persisted task records and their schema are unchanged; ordinary same-state updates emit no marker.
126
+
127
+ At `agent_before_settle`, pending markers and eligible active tasks are combined into one `pi-tasks-review` draft. Pending changes remain queued while native retries or other messages take priority and are consumed only when a review is delivered. Actual later transitions can be reviewed again; same-status edits do not create markers.
128
+
129
+ Record correctness is not budgeted progress. When `autoContinue.enabled` is false or the progress-continuation limit is reached, a pending transition still produces one `pi-tasks-review` that only challenges the records; it names why progress continuation is disabled or stopped, explicitly says not to start or continue unrelated active work in that review, lists any active tasks as unresolved, and does not increment the progress budget. The limit notice clarifies that the next transition still gets a record review. A transition is consumed once delivered, so a review that changes no status does not repeat by itself. Neither the warning nor the record review mutates a task, overrides the user's `autoContinue` setting, or treats an outage or live monitor as a completion.
130
+
131
+ A review that is already being delivered also carries a read-only blocked-task audit: every blocked task with its dependency class, blocked age when stored, linked decision question, shared-question tasks, and reason. It asks the agent to confirm the dependency still exists, return the task to active when it does not, retire an obsolete task through the human cancellation decision, or keep the block with its exact unblock condition and a live question or monitor. The same audit is delivered once at `session_start` for a restored start (`startup`, `/reload`, or `resume`), because restarts and reloads stop decision watchers and agent monitors; a fresh `fork` keeps its isolation and a brand-new session has no inherited store; that audit triggers one reconciliation turn, changes no record itself, and is not a new user request. Both audits are generated from task bookkeeping and never treat task text as instructions.
132
+
133
+ Transition guidance validates task IDs and never copies blocked reasons as instructions. It also requires a chat statement that a blocker is superseded to be accompanied by a task update in the same turn, and a shared decision to reconcile all linked tasks when it is answered or withdrawn. Monitor and decision-watcher wakes remain independent of the review budget. Hosts without the newer boundary APIs retain ordinary tracking without automatic review.
90
134
 
91
135
  ## Repository status and opening directories
92
136
 
@@ -94,26 +138,36 @@ Both terminal views share a cwd-scoped asynchronous Git status cache, separate f
94
138
 
95
139
  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
140
 
97
- 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-panel open` supplies a command path, and `/works` uses `o`. Open is also available outside Git repositories.
141
+ 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
142
 
99
143
  ### Ownership display
100
144
 
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.
145
+ `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
146
 
103
147
  ### Delegate navigation
104
148
 
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.
149
+ 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.
150
+
151
+ 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.
152
+
153
+ `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.
106
154
 
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.
155
+ 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.
108
156
 
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.
157
+ ### Task-owned delegation bridge
110
158
 
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.
159
+ 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.
112
160
 
113
- Linked `[delegate]` badges and 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.
161
+ 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
162
 
115
163
  ## Interfaces
116
164
 
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 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-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.
165
+ `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, syncs the bundled assets in the personal mods/pi-tasks directory, then explicitly opens a native read-only pane beside the originating local Core terminal. A bundled asset that already matches is left untouched; a differing copy is saved beside itself as `<name>.bak-<timestamp>` and replaced, because the pane validates the snapshot contract of the package version that writes it, and a refreshed viewer loads in a new pane. 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.
166
+
167
+ 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.
168
+
169
+ 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. A Work is rendered only while it has a task the current selection lists, so a Work with no tasks or no match leaves no Work heading. The header offers All statuses, Active, Blocked (all), Blocked on you, Waiting on agents, Completed and Cancelled; Completed lists `completed` and `closed` records together because verified work is closed after completion, All statuses stays the live view, and every count is the number of tasks its entry lists. 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).
170
+
171
+ 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
172
 
119
173
  `/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.