@abhishek944/pi-tasks 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -12
- package/dist/agents/delegation.d.ts +4 -0
- package/dist/agents/delegation.js +59 -0
- package/dist/agents/herdr.d.ts +10 -3
- package/dist/agents/herdr.js +39 -12
- package/dist/agents/links.d.ts +3 -3
- package/dist/agents/links.js +42 -19
- package/dist/auto-continue.js +160 -27
- package/dist/command.d.ts +2 -2
- package/dist/command.js +7 -3
- package/dist/delegated-time.d.ts +11 -0
- package/dist/delegated-time.js +51 -2
- package/dist/dependency.d.ts +7 -0
- package/dist/dependency.js +13 -0
- package/dist/durable.d.ts +38 -0
- package/dist/durable.js +515 -0
- package/dist/herdr-header.d.ts +3 -0
- package/dist/herdr-header.js +100 -0
- package/dist/herdr-panel.d.ts +7 -0
- package/dist/herdr-panel.js +182 -0
- package/dist/index.js +96 -56
- package/dist/markdown.js +3 -1
- package/dist/panel-settings.d.ts +11 -0
- package/dist/panel-settings.js +30 -0
- package/dist/snapshot.d.ts +23 -0
- package/dist/snapshot.js +123 -0
- package/dist/state.d.ts +21 -18
- package/dist/state.js +357 -286
- package/dist/thoughts.d.ts +11 -0
- package/dist/thoughts.js +14 -0
- package/dist/timing.js +2 -1
- package/dist/tools.js +48 -29
- package/dist/tracking.js +18 -11
- package/dist/types.d.ts +9 -2
- package/dist/ui/panel.js +17 -10
- package/dist/ui/task-view.d.ts +7 -0
- package/dist/ui/task-view.js +10 -0
- package/dist/ui/works-dashboard.js +22 -15
- package/docs/REFERENCE.md +56 -28
- package/docs/USAGE_GUIDE.md +112 -50
- package/herdr/pi-tasks/README.md +45 -0
- package/herdr/pi-tasks/header.js +192 -0
- package/herdr/pi-tasks/main.js +413 -0
- package/herdr/pi-tasks/mod.json +3 -0
- package/herdr/pi-tasks/spinner.svg +1 -0
- package/package.json +26 -1
- package/dist/agents/tools.d.ts +0 -3
- 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
|
|
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
|
|
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
|
|
12
|
-
- 500 todos per session
|
|
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
|
|
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`,
|
|
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`
|
|
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
|
-
|
|
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
|
|
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
|
-
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
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,
|
|
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,23 +86,25 @@ 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
109
|
## Repository status and opening directories
|
|
92
110
|
|
|
@@ -94,26 +112,36 @@ Both terminal views share a cwd-scoped asynchronous Git status cache, separate f
|
|
|
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 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
|
|
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]`).
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
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.
|