@marcoscale98/pi-extensible-workflows 5.14.1-fork.1

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 (204) hide show
  1. package/CHANGELOG.md +536 -0
  2. package/README.md +64 -0
  3. package/dist/src/agent-execution.d.ts +338 -0
  4. package/dist/src/agent-execution.js +1633 -0
  5. package/dist/src/background-widget.d.ts +74 -0
  6. package/dist/src/background-widget.js +1340 -0
  7. package/dist/src/budget.d.ts +38 -0
  8. package/dist/src/budget.js +188 -0
  9. package/dist/src/changelog.d.ts +6 -0
  10. package/dist/src/changelog.js +112 -0
  11. package/dist/src/decoders.d.ts +96 -0
  12. package/dist/src/decoders.js +629 -0
  13. package/dist/src/execution.d.ts +19 -0
  14. package/dist/src/execution.js +749 -0
  15. package/dist/src/herdr.d.ts +53 -0
  16. package/dist/src/herdr.js +270 -0
  17. package/dist/src/host-delivery.d.ts +95 -0
  18. package/dist/src/host-delivery.js +376 -0
  19. package/dist/src/host-navigator.d.ts +83 -0
  20. package/dist/src/host-navigator.js +1087 -0
  21. package/dist/src/host-phases.d.ts +89 -0
  22. package/dist/src/host-phases.js +320 -0
  23. package/dist/src/host-recovery.d.ts +141 -0
  24. package/dist/src/host-recovery.js +356 -0
  25. package/dist/src/host-runtime.d.ts +78 -0
  26. package/dist/src/host-runtime.js +378 -0
  27. package/dist/src/host-view.d.ts +116 -0
  28. package/dist/src/host-view.js +868 -0
  29. package/dist/src/host.d.ts +40 -0
  30. package/dist/src/host.js +1641 -0
  31. package/dist/src/index.d.ts +29 -0
  32. package/dist/src/index.js +13725 -0
  33. package/dist/src/index.js.map +6 -0
  34. package/dist/src/io.d.ts +14 -0
  35. package/dist/src/io.js +82 -0
  36. package/dist/src/package-identity.d.ts +4 -0
  37. package/dist/src/package-identity.js +6 -0
  38. package/dist/src/paths.d.ts +14 -0
  39. package/dist/src/paths.js +51 -0
  40. package/dist/src/persistence.d.ts +5 -0
  41. package/dist/src/persistence.js +5 -0
  42. package/dist/src/pi-runtime-adapter.d.ts +27 -0
  43. package/dist/src/pi-runtime-adapter.js +243 -0
  44. package/dist/src/pi-runtime-runner.d.ts +42 -0
  45. package/dist/src/pi-runtime-runner.js +505 -0
  46. package/dist/src/registry.d.ts +48 -0
  47. package/dist/src/registry.js +379 -0
  48. package/dist/src/retention.d.ts +17 -0
  49. package/dist/src/retention.js +195 -0
  50. package/dist/src/runtime/agent-runner.d.ts +143 -0
  51. package/dist/src/runtime/agent-runner.js +12 -0
  52. package/dist/src/runtime/index.d.ts +2 -0
  53. package/dist/src/runtime/index.js +2 -0
  54. package/dist/src/runtime/namespace.d.ts +14 -0
  55. package/dist/src/runtime/namespace.js +1 -0
  56. package/dist/src/runtime/workflow-result.d.ts +2 -0
  57. package/dist/src/runtime/workflow-result.js +6 -0
  58. package/dist/src/session-handoff.d.ts +2 -0
  59. package/dist/src/session-handoff.js +82 -0
  60. package/dist/src/session-lease.d.ts +12 -0
  61. package/dist/src/session-lease.js +180 -0
  62. package/dist/src/store.d.ts +95 -0
  63. package/dist/src/store.js +951 -0
  64. package/dist/src/subagent-manager-handle.d.ts +4 -0
  65. package/dist/src/subagent-manager-handle.js +6 -0
  66. package/dist/src/tool-timing.d.ts +12 -0
  67. package/dist/src/tool-timing.js +33 -0
  68. package/dist/src/trajectory-contracts.d.ts +8 -0
  69. package/dist/src/trajectory-contracts.js +9 -0
  70. package/dist/src/trajectory-host-handle.d.ts +12 -0
  71. package/dist/src/trajectory-host-handle.js +6 -0
  72. package/dist/src/trajectory.d.ts +128 -0
  73. package/dist/src/trajectory.js +594 -0
  74. package/dist/src/types.d.ts +960 -0
  75. package/dist/src/types.js +60 -0
  76. package/dist/src/utils.d.ts +57 -0
  77. package/dist/src/utils.js +225 -0
  78. package/dist/src/validation.d.ts +29 -0
  79. package/dist/src/validation.js +1100 -0
  80. package/dist/src/workflow-artifacts.d.ts +14 -0
  81. package/dist/src/workflow-artifacts.js +40 -0
  82. package/dist/starter/index.d.ts +1 -0
  83. package/dist/starter/index.js +103 -0
  84. package/dist/starter/index.js.map +6 -0
  85. package/dist/starter/review-loop.d.ts +72 -0
  86. package/dist/starter/review-loop.js +43 -0
  87. package/dist/starter/roles/developer.md +6 -0
  88. package/dist/starter/roles/oracle.md +18 -0
  89. package/dist/starter/roles/researcher.md +20 -0
  90. package/dist/starter/roles/reviewer.md +19 -0
  91. package/dist/starter/roles/scout.md +18 -0
  92. package/dist/subagents/index.d.ts +8 -0
  93. package/dist/subagents/index.js +8021 -0
  94. package/dist/subagents/index.js.map +6 -0
  95. package/dist/subagents/src/contracts.d.ts +173 -0
  96. package/dist/subagents/src/contracts.js +68 -0
  97. package/dist/subagents/src/decode.d.ts +15 -0
  98. package/dist/subagents/src/decode.js +182 -0
  99. package/dist/subagents/src/index.d.ts +12 -0
  100. package/dist/subagents/src/index.js +180 -0
  101. package/dist/subagents/src/manager.d.ts +3 -0
  102. package/dist/subagents/src/manager.js +1636 -0
  103. package/dist/subagents/src/navigator.d.ts +5 -0
  104. package/dist/subagents/src/navigator.js +627 -0
  105. package/dist/subagents/src/view.d.ts +70 -0
  106. package/dist/subagents/src/view.js +387 -0
  107. package/dist/subagents/src/worktree.d.ts +34 -0
  108. package/dist/subagents/src/worktree.js +68 -0
  109. package/dist/trajectory/assets/favicon.png +0 -0
  110. package/dist/trajectory/assets/index.html +772 -0
  111. package/dist/trajectory/assets/marked.min.js +6 -0
  112. package/dist/trajectory/assets/morphdom.min.js +1 -0
  113. package/dist/trajectory/index.d.ts +5 -0
  114. package/dist/trajectory/index.js +3459 -0
  115. package/dist/trajectory/index.js.map +6 -0
  116. package/dist/trajectory/src/assets/favicon.png +0 -0
  117. package/dist/trajectory/src/assets/index.html +772 -0
  118. package/dist/trajectory/src/assets/marked.min.js +6 -0
  119. package/dist/trajectory/src/assets/morphdom.min.js +1 -0
  120. package/dist/trajectory/src/export.d.ts +25 -0
  121. package/dist/trajectory/src/export.js +80 -0
  122. package/dist/trajectory/src/index.d.ts +26 -0
  123. package/dist/trajectory/src/index.js +732 -0
  124. package/dist/trajectory/src/server.d.ts +7 -0
  125. package/dist/trajectory/src/server.js +2534 -0
  126. package/dist/trajectory/src/server.js.map +6 -0
  127. package/examples/advanced-patterns/auto-model-router.mjs +78 -0
  128. package/examples/workflow-extension-template/README.md +37 -0
  129. package/examples/workflow-extension-template/extension.test.mjs +59 -0
  130. package/examples/workflow-extension-template/index.js +51 -0
  131. package/examples/workflow-extension-template/roles/reviewer.md +4 -0
  132. package/package.json +105 -0
  133. package/skills/pi-extensible-workflows/SKILL.md +160 -0
  134. package/src/agent-execution.ts +1533 -0
  135. package/src/background-widget.ts +1496 -0
  136. package/src/budget.ts +109 -0
  137. package/src/changelog.ts +114 -0
  138. package/src/decoders.ts +567 -0
  139. package/src/execution.ts +652 -0
  140. package/src/herdr.ts +240 -0
  141. package/src/host-delivery.ts +346 -0
  142. package/src/host-navigator.ts +871 -0
  143. package/src/host-phases.ts +264 -0
  144. package/src/host-recovery.ts +333 -0
  145. package/src/host-runtime.ts +373 -0
  146. package/src/host-view.ts +828 -0
  147. package/src/host.ts +1502 -0
  148. package/src/index.ts +29 -0
  149. package/src/io.ts +73 -0
  150. package/src/package-identity.ts +7 -0
  151. package/src/paths.ts +49 -0
  152. package/src/persistence.ts +11 -0
  153. package/src/pi-runtime-adapter.ts +247 -0
  154. package/src/pi-runtime-runner.ts +436 -0
  155. package/src/registry.ts +321 -0
  156. package/src/retention.ts +178 -0
  157. package/src/runtime/agent-runner.ts +158 -0
  158. package/src/runtime/index.ts +2 -0
  159. package/src/runtime/namespace.ts +16 -0
  160. package/src/runtime/workflow-result.ts +8 -0
  161. package/src/session-handoff.ts +78 -0
  162. package/src/session-lease.ts +125 -0
  163. package/src/store.ts +832 -0
  164. package/src/subagent-manager-handle.ts +8 -0
  165. package/src/tool-timing.ts +47 -0
  166. package/src/trajectory-contracts.ts +13 -0
  167. package/src/trajectory-host-handle.ts +16 -0
  168. package/src/trajectory.ts +543 -0
  169. package/src/types.ts +374 -0
  170. package/src/utils.ts +192 -0
  171. package/src/validation.ts +910 -0
  172. package/src/workflow-artifacts.ts +35 -0
  173. package/starter/index.ts +35 -0
  174. package/starter/prompts/council.md +16 -0
  175. package/starter/prompts/deep-research.md +16 -0
  176. package/starter/prompts/oracle.md +14 -0
  177. package/starter/prompts/parallel-review.md +22 -0
  178. package/starter/prompts/parallel-scout.md +16 -0
  179. package/starter/prompts/review-loop.md +14 -0
  180. package/starter/prompts/review.md +14 -0
  181. package/starter/prompts/scout.md +14 -0
  182. package/starter/review-loop.ts +73 -0
  183. package/starter/roles/developer.md +6 -0
  184. package/starter/roles/oracle.md +18 -0
  185. package/starter/roles/researcher.md +20 -0
  186. package/starter/roles/reviewer.md +19 -0
  187. package/starter/roles/scout.md +18 -0
  188. package/subagents/README.md +145 -0
  189. package/subagents/index.ts +8 -0
  190. package/subagents/src/contracts.ts +176 -0
  191. package/subagents/src/decode.ts +158 -0
  192. package/subagents/src/index.ts +194 -0
  193. package/subagents/src/manager.ts +1560 -0
  194. package/subagents/src/navigator.ts +488 -0
  195. package/subagents/src/view.ts +376 -0
  196. package/subagents/src/worktree.ts +99 -0
  197. package/trajectory/index.ts +5 -0
  198. package/trajectory/src/assets/favicon.png +0 -0
  199. package/trajectory/src/assets/index.html +772 -0
  200. package/trajectory/src/assets/marked.min.js +6 -0
  201. package/trajectory/src/assets/morphdom.min.js +1 -0
  202. package/trajectory/src/export.ts +85 -0
  203. package/trajectory/src/index.ts +604 -0
  204. package/trajectory/src/server.ts +447 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,536 @@
1
+ # Changelog
2
+ ## Unreleased
3
+
4
+ ## [5.14.1] - 2026-09-17
5
+
6
+ ### Fixes
7
+
8
+ - Atomic state and artifact writes retry transient Windows rename sharing violations (`EPERM`, `EBUSY`, `EACCES`) with bounded backoff instead of failing the run; asynchronous and synchronous replacements are both covered by a `windows-latest` CI job.
9
+ - Trajectory only signals a stale server whose lock `startedAt` still matches the live process (checked against `/proc/<pid>` ctime like the session lease), so a reused PID after a reboot is never sent `SIGTERM`/`SIGKILL`.
10
+ - Herdr tool bridge places its Unix socket and shim in a private `0700` temp directory instead of `tmpdir()` with umask permissions.
11
+ - Trajectory attaches when Pi runs as a Bun-compiled binary: the detached server is spawned with `node` from `PATH` instead of `process.execPath`, which re-ran the Pi CLI (exit 1) and, under Bun, never completed the WebSocket 101 upgrade (oven-sh/bun#28157).
12
+
13
+ ## [5.14.0] - 2026-09-10
14
+
15
+ ### New capabilities
16
+
17
+ - Extensions can declare namespaced `extensionSettings` and validate their own values. Settings are passed to workflow functions and agent transports, with explicit global, trusted-project, and role override semantics.
18
+
19
+ ### Fixes
20
+
21
+ - Herdr detects agent settlement through a direct lifecycle bridge instead of waiting for pane status to become idle, preventing completed agents from becoming stale.
22
+ - Canonical filesystem path handling is shared across the CLI, workflows, and Trajectory; the detached Trajectory server is bundled correctly for installed packages.
23
+ - Explicit empty extension settings, including `extensionSettings: {}`, now replace inherited settings instead of silently falling back.
24
+ - Optionally run a trusted workflow-settings command after newly created worktrees are checked out; failures roll back the worktree and report `WORKTREE_FAILED`.
25
+
26
+ ### Compatibility
27
+
28
+ - Standalone subagent retries persist launch-time roles and extension settings for deterministic replay. Historic runs without the frozen `configuration.json` remain inspectable but cannot be retried.
29
+
30
+ ## [5.13.2] - 2026-09-07
31
+
32
+ ### Fixes
33
+
34
+ - A pending pause can be cancelled: resuming a `pausing` run (the `/workflow` picker offers "Cancel pause", Trajectory offers the same, and the resume path accepts the state) returns it to `running` before the active operation finishes. The picker now reports "Pausing workflow ..." while the pause is pending instead of "Paused workflow ...". (#283)
35
+ - Cold resume and paused-run alias refresh keep the snapshot's role definitions but fall back to the current role files for roles a registered function uses for the first time after the restart, capturing them into the snapshot as at launch; previously such runs failed with `UNKNOWN_AGENT_TYPE`. (#284)
36
+ - Concurrent `agent(...)` calls issued by one workflow are admitted to the scheduler in call order, so a run concurrency limit starts the first-called agent first instead of whichever call finished its journal lookup first.
37
+ - Replaying one journaled operation no longer clones every completed operation of the run and its retry lineage; the cost of an `agent()`/`shell()` replay lookup is now proportional to the single operation it resolves.
38
+
39
+ ### Internal
40
+
41
+ - Run-state, budget, context-file-scope, and thinking-level vocabularies are declared once in the core (`types.ts`/`utils.ts`) and reused by the decoders, host, widget, subagents extension, and `@piewf/cli`; structure tests keep local copies from coming back.
42
+
43
+ ## [5.13.1] - 2026-09-05
44
+
45
+ ### Fixes
46
+
47
+ - Portable bundles (`piewf bundle`) now bundle the extension module and its declared imports with esbuild instead of serialising `run.toString()`, so imported runtime values, module constants, and helpers work from the bundle. Extensions declare `source: import.meta.url` and `dependencies`; undeclared packages, Pi packages (`@earendil-works/*`), and non-literal dynamic imports fail at bundle time. esbuild is optional and loaded on demand only while bundling. The manifest is version 2; version 1 bundles still launch. The starter now imports `pi-extensible-workflows` by package name, so `dist/starter` relies on the package self-reference. (#271)
48
+ - A session ownership lease containing valid JSON of the wrong shape (e.g. `null`) no longer makes lease acquisition loop forever; it is rejected while fresh and reclaimed once stale. (#270)
49
+ - Keep the subagent Steer editor and selected action visible while navigating long detail panels, including across live refreshes; detail scrolling is bounded to the content. (#274)
50
+ - A rejected progress callback (e.g. run-state persistence failure) no longer crashes the Pi host; the agent run fails through its normal path and the session is aborted and disposed. (#265)
51
+ - Manual deletion from `/workflow` refuses to delete a run that a surviving run depends on and skips such runs during bulk deletion; retry-child creation is serialised with deletion. (#263)
52
+ - Concurrent `get_subagent_result` calls no longer release the parent's scheduler permit more than once, so run/session concurrency limits hold and the parent no longer deadlocks. (#264)
53
+
54
+ ## [5.13.0] - 2026-09-05
55
+
56
+ ### Breaking changes
57
+
58
+ - Worktrees (`withWorktree()` and `subagents_run({ worktree })`) now branch from the launch repository's clean `HEAD` instead of a synthetic runtime snapshot commit. A dirty launch working tree (tracked or untracked non-ignored changes) fails worktree creation with `WORKTREE_FAILED`; commit or stash first. (#235, #262)
59
+
60
+ ### Fixes
61
+
62
+ - A workflow that fails while bridge work is still in flight now aborts that work (shell, agent, checkpoint, function, worktree) instead of letting it run on after the run is marked failed. (#266)
63
+ - Host text blocks truncate by terminal display width, so CJK and other wide characters no longer overflow the line. (#267)
64
+ - Lifecycle transitions persist the run's current budget runtime; after `workflow_resume` with a replacement budget, the adjusted usage and budget events are no longer overwritten by the pre-adjustment runtime. (#269)
65
+ - The public `pi-extensible-workflows/trajectory` entry can find its UI assets: they are staged next to the bundled entry, not only next to the detached server, so `exportTrajectoryRunHtml` works from the installed package. (#272)
66
+ - Trajectory recognizes failed tool results stored in the canonical Pi shape (`message.isError`) in the timeline, the tool summary pane, and the event ticks. (#276)
67
+ - `piewf export --bundle` forwards an explicit `--approve` or `--no-approve` to bundle creation, so trust-dependent project resources (roles, extensions) are included or excluded as requested. (#268)
68
+ - Portable bundles keep extensions that import the workflow API under an alias (`import { registerWorkflowExtension as register }`): the generated shim exports the original names. (#275)
69
+ - `@piewf/cli` declares its Pi and TypeBox runtime dependencies directly instead of as peers, so a Pi-managed install without workspace hoisting loads `piewf`. The packed-package verification now runs the installed CLI as a smoke test. (#273)
70
+ - "Change model" in the provider-failure recovery dialog opens the model picker again on Pi 0.85 (`ModelSelectorComponent` constructor changed). A failing recovery dialog now appends its cause to the reported agent error instead of being swallowed. (#260)
71
+ - Aligned Pi development dependencies at `0.85.0`. `@earendil-works/pi-server` is a core devDependency because `pi-coding-agent@0.85.0` imports it without declaring it; `@piewf/cli` now declares it as well (#273). (#260)
72
+
73
+ ## [5.12.0] - 2026-09-04
74
+
75
+ ### Runtime
76
+
77
+ - Persistent agent handles: `agent.create({ name, ... })` returns a handle whose `send(prompt, { outputSchema?, timeoutMs? })` keeps one agent's transcript across turns. Each turn is journaled at `agent/handle/<name>/turn:<n>`, continues from a per-turn copy of the previous session file, and replays without contacting the model.
78
+
79
+ ### Fixes
80
+
81
+ - Foreground workflow completion is delivered on a single path, removing duplicate background completion messages.
82
+ - Bundled roles are recognized across install layouts.
83
+ - Registered function side-effect failures are owned by the registered function and fail-fast side-effect errors are preserved.
84
+ - Trajectory timeline events link to their transcript rows, and the transcript cursor stays in sync on hover.
85
+
86
+ ## [5.11.2] - 2026-08-31
87
+
88
+ ### Fixes
89
+
90
+ - Keep Trajectory live state below the WebSocket frame cap, fetch transcript bodies on demand, and reconnect detached servers after publisher disconnects. Restart existing Pi processes after upgrading so their Trajectory publisher uses the new protocol.
91
+ ## [5.11.1] - 2026-08-30
92
+
93
+ ### Fixes
94
+
95
+ - Keep streamed reasoning and response progress out of workflow and subagent status, persistence, and exports, and sanitize live activity before terminal rendering.
96
+ - Keep Herdr's working state aligned with workflow lifecycle transitions, including pauses, checkpoints, terminal runs, and concurrent runs.
97
+
98
+ ## [5.11.0] - 2026-08-29
99
+
100
+ ### Starter
101
+
102
+ - New packaged roles: `scout` (read-only recon), `oracle` (second opinion, read-only plus `bash`), and `researcher` (all session tools except `edit`/`write`/`bash`, uses web tools when present), with dynamic `scout-model`, `oracle-model`, and `researcher-model` aliases.
103
+ - The packaged `reviewer` role now filters findings on evidence, labels them P0/P1/P2, and ends with a machine-readable merge verdict.
104
+ - New package-level slash-command prompts that drive the packaged roles: `/scout`, `/parallel-scout`, `/oracle`, `/council`, `/review`, `/parallel-review`, `/review-loop`, and `/deep-research`. Prompts are declared in the package manifest and are not removed by the starter filter.
105
+
106
+ ### Runtime
107
+
108
+ - Role frontmatter tools that are not active in the launching session no longer fail the launch with `UNKNOWN_TOOL`. The agent now runs without the missing tool and a warning is surfaced in the TUI (once per role/tool per executor). Call-level `tools`, `effectiveTools`, and boundary checks still fail hard, and doctor diagnostics are unchanged. This makes packaged roles such as `reviewer` work on sessions without the optional `grep`/`find`/`ls` built-ins.
109
+
110
+ ## [5.10.0] - 2026-08-28
111
+
112
+ ### Packaging
113
+
114
+ - The published package now loads bundled extension entries (`dist/src/index.js`, `dist/starter/index.js`, `dist/subagents/index.js`, `dist/trajectory/index.js`) instead of TypeScript sources, cutting Pi startup overhead from ~1.25s to ~0.06s. Package filters that excluded the old `.ts` entries must switch to the new `dist/*.js` paths (see the extensions guide). Repository-root source installs still load the TypeScript entries.
115
+
116
+ ## [5.9.0] - 2026-08-28
117
+
118
+ ### New capabilities
119
+
120
+ - Trajectory can export one persisted workflow run as a self-contained static HTML report (`exportTrajectoryRunHtml`): the live UI with inlined assets and injected state instead of a WebSocket, viewable from `file://`, sandboxed iframes, and the `docs/run.html` gist viewer.
121
+ - The Trajectory run dossier gains a Share button (and the CLI a `piewf share <run-id>` command) that uploads the static report as a secret GitHub gist through the user's `gh` CLI and returns the viewer URL. Share is served by the Trajectory extension itself; secret gists are unlisted, not private.
122
+
123
+ ### Packaging
124
+
125
+ - Moved the eval harness from `src/` to the unpublished `evals/src/` directory and stopped publishing `evals/` cases and `test/fixtures` in the npm package. `npm run evals` and `npm run evals:ambient` are unchanged for repository checkouts.
126
+
127
+ ### Fixes
128
+
129
+ - Closing the workflow dashboard after a confirmed stop now leaves the parent Pi session ready for its next prompt, and intentional cancellation skips provider recovery ([#241](https://github.com/vekexasia/pi-extensible-workflows/issues/241)).
130
+ - Live Herdr handoffs show queued/opening status and bypass provider recovery only when a handoff was actually attempted, preserving genuine provider errors containing `abort` ([#204](https://github.com/vekexasia/pi-extensible-workflows/issues/204), [#240](https://github.com/vekexasia/pi-extensible-workflows/pull/240)).
131
+
132
+ ## [5.8.0] - 2026-08-23
133
+
134
+ ### Breaking changes
135
+
136
+ - Require every workflow agent to submit its result through `workflow_result`. Unstructured agents use `{ result: string }`, return that string to their parent, and fail with `RESULT_INVALID` after the existing two result prompts when they do not submit one. Eager transports now receive the runtime-generated workflow prompt when their session is created.
137
+
138
+ ### New capabilities
139
+ - Trajectory now publishes current-session durable subagents as first-class publisher state, including live progress, attempts, transcripts, results, failures, worktrees, and resolved tools.
140
+
141
+ - Registered-function `context.invoke(name, input, label?)` now supports presentation-only nested breadcrumbs without changing journal identity ([#223](https://github.com/vekexasia/pi-extensible-workflows/issues/223)).
142
+ - Trajectory adds a resizable, scrollable workflow Gantt with sticky time axis and independently collapsible Gantt, agent, and log sections, with layout state persisted in local storage ([#224](https://github.com/vekexasia/pi-extensible-workflows/issues/224)).
143
+ - Trajectory replaces a stale detached server when its server or UI files change, so `/workflow trajectory` and auto-attach use the current implementation ([#226](https://github.com/vekexasia/pi-extensible-workflows/issues/226)).
144
+ - Trajectory groups live sessions by full project folder in a collapsible, dense sidebar with persisted folder state ([#227](https://github.com/vekexasia/pi-extensible-workflows/issues/227)).
145
+ - Trajectory auto-attaches without opening a browser once per interactive Pi session when persisted workflow runs are restored or after the first successful workflow launch; `/workflow trajectory` remains the manual browser re-open ([#217](https://github.com/vekexasia/pi-extensible-workflows/issues/217)).
146
+ - Trajectory records per-tool wall-clock execution timing in workflow-agent session JSONL and displays completed and failed tool durations across its event, agent, inspector, and Gantt views. Loaded transcripts retain up to 400 non-timing entries plus their matching timing entries ([#212](https://github.com/vekexasia/pi-extensible-workflows/issues/212)).
147
+ - Trajectory renders canonical skill file reads as compact `[skill] name:start-end` event previews while retaining their full input in the inspector ([#215](https://github.com/vekexasia/pi-extensible-workflows/issues/215)).
148
+ - Trajectory renders tool event arguments as colored key/value pairs with bounded row values while retaining full input for search and inspection ([#222](https://github.com/vekexasia/pi-extensible-workflows/issues/222)).
149
+ - Trajectory summarizes assistant tool calls as separate event chips and inspector blocks with searchable arguments ([#220](https://github.com/vekexasia/pi-extensible-workflows/issues/220)).
150
+
151
+ ### Packaging
152
+ - Moved Trajectory's server and controller into the bundled extension; the core entry no longer exports `createTrajectoryController`, `createTrajectoryRunLoader`, `createTrajectorySubagentLoader`, `loadTrajectoryRuns`, `openTrajectoryUrl`, `trajectoryUrl`, or the Trajectory contract types.
153
+
154
+ ### Fixes
155
+ - Sanitize Trajectory markdown before rendering assistant messages and system prompts.
156
+ - Keep Trajectory layout and sidebar preference storage failures from stopping the UI, preserving defaults.
157
+ - Exclude non-message session records from Trajectory agent transcripts instead of labeling them assistant messages.
158
+ - Ensure idle Trajectory servers destroy connected client sockets before closing, remove their lock, and exit.
159
+ - Recover from live but unhealthy Trajectory server locks by replacing the stale process after the startup budget expires.
160
+ - Give Trajectory server frame-size and fingerprint configuration separate, unambiguous options.
161
+ - Restore Trajectory home, run, and agent views from `?view=&run=&agent=` on refresh and Back ([#228](https://github.com/vekexasia/pi-extensible-workflows/issues/228)).
162
+ - Fetch one agent transcript on demand when combined Trajectory state exceeds the WebSocket frame cap, so agent views keep their events.
163
+ - Label canonical Trajectory skill reads as `SKILL` in event and inspector views while retaining the tool inspector panes ([#219](https://github.com/vekexasia/pi-extensible-workflows/issues/219)).
164
+ - Drop disconnected Trajectory publishers and their runs, returning an open session to the empty home view ([#218](https://github.com/vekexasia/pi-extensible-workflows/issues/218)).
165
+ - Collapse shadowed model aliases to the static settings winner in the LLM-facing workflow catalog index and detail results while preserving full provenance for trusted catalogs ([#210](https://github.com/vekexasia/pi-extensible-workflows/issues/210)).
166
+ - Clarify Trajectory message token usage as per-call provider input/output (with optional reasoning and cache rows) or a displayed-text estimate, without duplicating it in the header ([#221](https://github.com/vekexasia/pi-extensible-workflows/issues/221)).
167
+
168
+ ### Documentation
169
+
170
+ - Document how to disable the bundled `reviewLoop` starter, Subagents, and Trajectory independently with Pi package filters.
171
+
172
+ ## [5.7.0] - 2026-08-20
173
+
174
+ ### New capabilities
175
+
176
+ - Added the bundled `reviewLoop` starter, packaged developer and reviewer roles, and durable standalone subagent tools to the core package.
177
+ - Added Trajectory, a local browser UI opened with `/workflow trajectory` for inspecting live workflow runs, agents, transcripts, tools, skills, and extensions.
178
+
179
+ ### Packaging
180
+
181
+ - Moved standalone subagents into core and stopped publishing `@piewf/subagents` as a separate package.
182
+
183
+ ## [5.6.1] - 2026-08-19
184
+
185
+ ### Fixes
186
+
187
+ - Wait for background workflow log entries and completion follow-ups instead of a 100ms spin.
188
+
189
+
190
+ ## [5.6.0] - 2026-08-18
191
+
192
+ ### Breaking changes
193
+
194
+ - Removed per-call `thinking`. Concrete models must be `provider/model:thinking`; aliases may omit the suffix and inherit it from the target. Role-file `thinking` frontmatter is rejected.
195
+ - `role` is now a name string only. Role files provide defaults; per-call `AgentOptions` `model`, `tools`, `skills`, `extensions`, and `contextFiles` override them. Role objects, `RoleOverride`, `ROLE_OVERRIDE_KEYS`, and `validateRoleOverride` are removed. `overrideSystemPrompt` remains role-file only. Persisted legacy role objects are rejected as corrupt. Legacy role snapshots fold `thinking` into `model`.
196
+ - Removed the optional `singleAgent` workflow-catalog function from `@piewf/subagents`. Use core `agent()` and `withWorktree()` in workflow scripts.
197
+
198
+ ### New capabilities
199
+
200
+ - Added terminal-run retention settings (`retention.olderThanDays`, `retention.maxTerminalRuns`) applied best-effort at session start to hard-terminal runs only.
201
+
202
+ ### Fixes
203
+
204
+ - Report failed ownership writes per run instead of crashing the host.
205
+ - Keep nested `failedAt` paths absolute and journal-consistent.
206
+ - Resolve real-session trace paths from the package root.
207
+
208
+ ### Documentation
209
+
210
+ - Documented agent session transitions and tightened the root README.
211
+
212
+ ## [5.5.0] - 2026-08-16
213
+
214
+ - Show the core package's bundled changelog once after its installed version changes, with a startup fallback for `pi update --extensions` and `pi update --all` ([#208](https://github.com/vekexasia/pi-extensible-workflows/issues/208)).
215
+ - Added `piewf doctor --json`, which emits one machine-readable `DoctorReport` object when checks complete; the existing exit contract still returns non-zero for error diagnostics. Selecting a role adds `roleTarget` and, when role inspection succeeds, `roleInspection` ([#207](https://github.com/vekexasia/pi-extensible-workflows/issues/207)).
216
+ - Replaced `disabledAgentResources` with ordered direct `skills`, `extensions`, and `tools` selectors composed across settings, roles, and agent calls; candidates remain enabled unless a matching rule disables them, and `!*` clears a selection before narrower additions. Existing plain positive lists no longer restrict the candidate set; prepend `!*` to preserve a whitelist, and use `!*` (not `[]`) to select none. The legacy `disabledAgentResources` field is rejected by runtime configuration, and `piewf doctor` reports active uses as errors and warns with `AGENT_RESOURCE_TOOL_SELECTOR_ALLOWLIST` when a positive-only tool selector restricts nothing ([#205](https://github.com/vekexasia/pi-extensible-workflows/issues/205), [#206](https://github.com/vekexasia/pi-extensible-workflows/issues/206)).
217
+ - Resolved relative extension selectors from their own source: settings selectors from the settings file's directory, role-file selectors from the role file's directory, and call and role-override selectors from the agent launch cwd. Setup hooks may now only narrow resources; widening fails with `INVALID_METADATA` ([#205](https://github.com/vekexasia/pi-extensible-workflows/issues/205)).
218
+ - Added fail-closed role-load diagnostics to `piewf doctor`: it reports the source diagnostic and `ROLE_LOAD_BLOCKED`, marks active role entries unavailable in the general report, and exits non-zero ([#205](https://github.com/vekexasia/pi-extensible-workflows/issues/205)).
219
+ - Moved Herdr configuration to `extensionSettings.herdr`; the obsolete `extensions.herdr` settings shape is rejected with `INVALID_SETTINGS` and must be migrated ([#205](https://github.com/vekexasia/pi-extensible-workflows/issues/205)).
220
+
221
+ ## [5.4.0] - 2026-08-12
222
+
223
+ ### Subagents API and migration
224
+
225
+ - Consolidated the `@piewf/subagents` model-facing API to `subagents_run`, `subagents_inspect`, `subagents_steer`, `subagents_stop`, and `subagents_retry`; replace `subagents_list({})` with `subagents_inspect({})` and replace `subagents_status({ id })` or `subagents_result({ id })` with `subagents_inspect({ id })` ([#198](https://github.com/vekexasia/pi-extensible-workflows/issues/198)).
226
+ - Added foreground standalone subagent runs with durable terminal envelopes, cancellation persistence, retry-mode preservation, and duplicate follow-up suppression; background remains the default, while optional `singleAgent` workflow composition remains inline and does not create a durable standalone run.
227
+ - Added bounded retry metadata and cumulative per-run accounting across internal attempts.
228
+
229
+ ### Subagents TUI and inspection
230
+
231
+ - Added compact call, progress, inspection, and control renderers plus a bounded background-run widget with stale-run warnings, sub-cent cost display, and width-safe rendering.
232
+ - Added the read-only `/subagents` TUI picker for durable current-session runs, with live refresh, persisted labels and roles, inline steering, lifecycle controls, and shared workflow-agent actions for Herdr, editor, IDs, branches, and worktrees.
233
+ - Consolidated inspection snapshots under `progress`, removed system prompts and redundant usage fields from public inspection output, and kept legacy persisted records readable ([#200](https://github.com/vekexasia/pi-extensible-workflows/issues/200)).
234
+
235
+ ### Workflow progress and navigation
236
+
237
+ - Separated repeated registered-function invocations into stable occurrence-aware progress groups such as `developUntilApproved #2`, including nested calls, navigator views, and replay/resume ([#199](https://github.com/vekexasia/pi-extensible-workflows/issues/199)).
238
+ - Reworked the background workflow widget to mount once, animate only active runs, rescan at a slower cadence, repaint navigation and elapsed clocks immediately, and suspend while `/workflow` owns the TUI ([#202](https://github.com/vekexasia/pi-extensible-workflows/issues/202)).
239
+ - Collapsed durable workflow receipts to one line by default, while expanded receipts retain phases, agents, accounting, errors, and run IDs.
240
+ - Added explicit live run-state labels, compact token and cost totals, shared sub-cent cost formatting, and expanded per-agent model, usage, runtime, and retry details.
241
+
242
+ ### Reliability and integrations
243
+
244
+ - Accepted a submitted `workflow_result` even when the provider emitted an empty abort immediately afterward, avoiding an unnecessary recovery prompt.
245
+ - Reported workflow confirmation dialogs as blocked activity so Herdr and other lifecycle observers can represent waits for human input.
246
+ - Kept `piewf doctor` read-only by preventing Pi model discovery from writing a model cache.
247
+
248
+ ### TypeScript and maintenance
249
+
250
+ - Exported shared workflow/subagent presentation helpers and `formatCost` from the core package.
251
+ - Split the persistence implementation into focused decoder, path, I/O, session-lease, and store modules without changing its public facade, and deduplicated shared domain and persistence helpers.
252
+ - Aligned Pi development dependencies at `0.84.1`.
253
+
254
+ ### Documentation
255
+
256
+ - Reworked the main README as the canonical product and package overview, added dedicated Subagents and Herdr HTML guides, and connected package selection, roles, settings, installation, and extension references across the documentation site.
257
+
258
+ ## [5.3.0] - 2026-08-09
259
+
260
+ ### New capabilities
261
+
262
+ - Added a built-in background workflow widget with live phase/agent status and durable transcript receipts; resumable runs remain visible, receipts are written only from stable terminal state, and both can be disabled globally with `backgroundWidget: false` ([#197](https://github.com/vekexasia/pi-extensible-workflows/issues/197)).
263
+ - Added the `@piewf/subagents` extension with background `subagents_*` controls, durable IDs/results, steering, stopping, retries, named worktrees, progress/accounting, session-shutdown cleanup, and bounded effective workflow concurrency with no launch queue.
264
+ - Added the optional `singleAgent` workflow-catalog function for one inline `context.agent` call with the same request normalization; a process-global name collision leaves the standalone tools available.
265
+
266
+ ### Reliability
267
+
268
+ - Added bounded completion descriptors for results that do not fit, preserved foreground/background completion envelopes, and kept worktree metadata failures from blocking delivery ([#195](https://github.com/vekexasia/pi-extensible-workflows/issues/195)).
269
+ - Cleared subagent worktree path, branch, and cleanup metadata from status after successful cleanup while retaining it when cleanup fails.
270
+
271
+ ### Fixes
272
+
273
+ - Stopped inline workflow and navigator refresh polling after terminal runs and froze terminal snapshots ([#196](https://github.com/vekexasia/pi-extensible-workflows/issues/196)); scroll hints now appear only for overflowing views.
274
+
275
+ ### Herdr
276
+
277
+ - Propagated provider-recovery blocked state to Herdr lifecycle reporting.
278
+
279
+ ### Packaging and migration
280
+
281
+ - Added first-class npm discovery, package release checks, publish ordering, shared-version validation, and documentation for `@piewf/subagents`.
282
+ - Added `@earendil-works/pi-tui` as a peer dependency of the core and CLI packages for the built-in widget; install it alongside these packages.
283
+
284
+ ## [5.2.0] - 2026-08-06
285
+
286
+ ### Reliability
287
+
288
+ - Completed local Pi session lifecycle ownership: extension startup/shutdown is balanced for direct and workflow consumers, and Herdr handoff sessions report resume context.
289
+
290
+ ## [5.1.1] - 2026-07-31
291
+
292
+ ### Fixes
293
+
294
+ - Clarified workflow phase state glyphs while keeping detailed agent activity in the dashboard details.
295
+
296
+ ### Verification
297
+
298
+ - `npm run check` passes.
299
+
300
+ ## [5.1.0] - 2026-07-31
301
+
302
+ ### New capabilities
303
+
304
+ - Added role-targeted `piewf doctor --role` inspection of effective agent resources and prepared prompts without provider execution ([#181](https://github.com/vekexasia/pi-extensible-workflows/issues/181)).
305
+ - Added `/workflow` as the sole workflow slash-command with contextual run, agent, lifecycle, budget, and checkpoint actions; Enter opens the applicable action picker and `a`/`A` remains available as a legacy shortcut ([#185](https://github.com/vekexasia/pi-extensible-workflows/issues/185), [#188](https://github.com/vekexasia/pi-extensible-workflows/issues/188)).
306
+ - Added an interactive startup picker to resume one or all interrupted workflows.
307
+ - Added `/workflow background` behavior to move an attached foreground workflow to background delivery without restarting it ([#182](https://github.com/vekexasia/pi-extensible-workflows/issues/182)).
308
+ - Added role `contextFiles` policies to scope context visible to workflow agents ([#179](https://github.com/vekexasia/pi-extensible-workflows/issues/179)).
309
+ - Added per-call role override objects with inheritance, unsetting, and explicit replacement semantics.
310
+ - Added long-running shell progress reporting and inline foreground log rendering while preserving background transcript delivery ([#180](https://github.com/vekexasia/pi-extensible-workflows/issues/180), [#187](https://github.com/vekexasia/pi-extensible-workflows/issues/187)).
311
+
312
+ ### Fixes
313
+
314
+ - Exported CLI launchers now prefer the configured Pi package installation before resolving a development-workspace package, preserving registered workflow functions when launched from the repository.
315
+
316
+ ### CLI and diagnostics
317
+
318
+ - Clarified `piewf doctor` output by separating Pi-active tools/resources from workflow-agent resources after `disabledAgentResources`.
319
+
320
+ ### TypeScript API
321
+
322
+ - Added typed workflow schemas and orchestration results, plus public local Pi/session inspection APIs.
323
+
324
+ ### Herdr
325
+
326
+ - Kept handed-off and completed workflow sessions inspectable, including correct continuation behavior for already-completed sessions.
327
+
328
+ ### Verification
329
+
330
+ - `npm run check` passes.
331
+
332
+ ## [5.0.0] - 2026-07-29
333
+
334
+ ### Breaking changes
335
+
336
+ - Removed the `workflow` argument from the `workflow` tool. Registered catalog functions are now composed inside `script` or `scriptPath` sources, and `args` remains available to pass input to them.
337
+ - Workflow launches now require a non-empty `name` and exactly one of `script` or `scriptPath`.
338
+ - Removed the exported `launchScriptForSnapshot` helper; persisted runs resume from their stored script source.
339
+
340
+ ### Herdr
341
+
342
+ - Migrated `@piewf/herdr` to TypeScript and publish its compiled `dist` output.
343
+ - Preserved the originating Pi executable and entrypoint during live handoff, and report handoff status in the originating Pi TUI.
344
+ - Preserved completed assistant results across handoff and restored opening completed, failed, or cancelled sessions in Herdr panes.
345
+
346
+ ### Runtime and CLI
347
+
348
+ - Ordered resolved workflow runs by completion time.
349
+ - Report missing transcript files explicitly during session inspection.
350
+ - Upgraded Pi development dependencies from `0.80.9` to `0.82.1`.
351
+
352
+ ### Verification
353
+
354
+ - Expanded core, CLI, persistence, replay, recovery, validation, Herdr, and integration coverage; `npm run check` passes.
355
+
356
+ ## [4.0.3] - 2026-07-28
357
+
358
+ ### Fixes
359
+
360
+ - Reused the workflow progress component for foreground workflow runs.
361
+
362
+ ## [4.0.2] - 2026-07-28
363
+
364
+ ### Packaging
365
+
366
+ - Added source repository metadata to `@piewf/herdr` so npm can verify its GitHub Actions provenance, and aligned all public packages at `4.0.2`.
367
+
368
+ ## [4.0.1] - 2026-07-28
369
+
370
+ ### New capabilities
371
+
372
+ - Added `workflow_status({ runId })` summaries and guarded retry/resume recovery with `expectedState` ([#164](https://github.com/vekexasia/pi-extensible-workflows/issues/164), [6aed1fe](https://github.com/vekexasia/pi-extensible-workflows/commit/6aed1fe), [4d783d3](https://github.com/vekexasia/pi-extensible-workflows/commit/4d783d3)).
373
+ - Added workflow and per-agent elapsed-time displays ([#158](https://github.com/vekexasia/pi-extensible-workflows/issues/158), [d05d0ea](https://github.com/vekexasia/pi-extensible-workflows/commit/d05d0ea)).
374
+ - Added the Herdr workflow extension with live handoff and fully inspectable agent workspaces ([372c3f6](https://github.com/vekexasia/pi-extensible-workflows/commit/372c3f6)).
375
+ - Added hostile-CLI and dynamic-model-router examples ([#167](https://github.com/vekexasia/pi-extensible-workflows/pull/167)).
376
+
377
+ ### Fixes
378
+
379
+ - Preserved completion and failure delivery across resume, cancellation, and terminal-state races ([#163](https://github.com/vekexasia/pi-extensible-workflows/issues/163), [44fc940](https://github.com/vekexasia/pi-extensible-workflows/commit/44fc940), [680e878](https://github.com/vekexasia/pi-extensible-workflows/commit/680e878), [b21ba55](https://github.com/vekexasia/pi-extensible-workflows/commit/b21ba55)).
380
+ - Preserved foreground/background mode during TUI recovery ([#166](https://github.com/vekexasia/pi-extensible-workflows/issues/166), [22a8f9f](https://github.com/vekexasia/pi-extensible-workflows/commit/22a8f9f)).
381
+ - Fixed macOS path aliases and Herdr pane lifecycle reporting ([#168](https://github.com/vekexasia/pi-extensible-workflows/pull/168), [5ad64ff](https://github.com/vekexasia/pi-extensible-workflows/commit/5ad64ff), [e9f1859](https://github.com/vekexasia/pi-extensible-workflows/commit/e9f1859)).
382
+
383
+ ### Breaking changes
384
+
385
+ - Removed extension variables. Use registered functions for reusable host-side capabilities and return values ([#155](https://github.com/vekexasia/pi-extensible-workflows/issues/155), [9601654](https://github.com/vekexasia/pi-extensible-workflows/commit/9601654)).
386
+ - Removed the Herdr pane `inspect`, `transcript`, and `fork` actions; use the CLI commands where applicable ([50d5791](https://github.com/vekexasia/pi-extensible-workflows/commit/50d5791)).
387
+ - Moved `piewf` to `@piewf/cli`; the core package no longer ships that binary ([fa5c1bf](https://github.com/vekexasia/pi-extensible-workflows/commit/fa5c1bf)).
388
+
389
+ ### Packaging
390
+
391
+ - Converted to npm workspaces and prepared `pi-extensible-workflows`, `@piewf/cli`, and `@piewf/herdr` for publication from the release workflow ([bc37e7f](https://github.com/vekexasia/pi-extensible-workflows/commit/bc37e7f)).
392
+
393
+ ## [3.4.2] - 2026-07-27
394
+
395
+ ### Recovery and navigation
396
+
397
+ - Local workflow session disposal now waits for all in-flight prompts before releasing native resources ([#147](https://github.com/vekexasia/pi-extensible-workflows/issues/147)).
398
+ - Agent system prompts are now opened through Agent actions instead of being rendered directly in the workflow TUI details ([#153](https://github.com/vekexasia/pi-extensible-workflows/issues/153)).
399
+
400
+ ### Verification
401
+
402
+ - `npm run check` passes.
403
+ ## [3.4.1] - 2026-07-26
404
+
405
+ ### Recovery and reliability
406
+
407
+ - Preserve substantive agent reports when Pi auto-compaction emits an empty `aborted` assistant message instead of treating the empty message as a successful result.
408
+
409
+ ### Verification
410
+
411
+ - Added regression coverage for aborted assistant turns; package tests, lint, and documentation checks pass.
412
+
413
+ ## [3.4.0] - 2026-07-26
414
+
415
+ ### New capabilities
416
+
417
+ - Added support for launching reviewed workflow JavaScript files with `scriptPath`; file contents are captured at launch for retry and resume ([#145](https://github.com/vekexasia/pi-extensible-workflows/issues/145)).
418
+ - Workflow progress now displays runtime and keeps runtime accounting accurate across pauses and resumes ([#150](https://github.com/vekexasia/pi-extensible-workflows/issues/150)).
419
+ - Added a `/workflow` action to open agent prompts in the configured external editor while agents are running or settled ([#151](https://github.com/vekexasia/pi-extensible-workflows/issues/151)).
420
+ - Registered function launches may use `name` as an optional run label; `workflow` remains the function identity for resume and replay.
421
+
422
+ ### Recovery, reliability, and navigation
423
+
424
+ - Inline foreground workflow progress now refreshes persisted agent state so stalled-agent warnings remain visible ([#149](https://github.com/vekexasia/pi-extensible-workflows/issues/149)).
425
+ - `/workflow` agent actions can now be closed with `h` or the left arrow ([#152](https://github.com/vekexasia/pi-extensible-workflows/issues/152)).
426
+
427
+ ### Verification
428
+
429
+ - Package check passed: 427 tests, 426 passed, 1 skipped; lint, documentation checks, and package dry-run passed.
430
+
431
+ ## [3.3.0] - 2026-07-26
432
+
433
+ ### New capabilities
434
+
435
+ - Added per-run summaries and non-TTY/headless run inspection, including best-effort summary projection and journal-derived timestamps ([#129](https://github.com/vekexasia/pi-extensible-workflows/issues/129); [1908ae5](https://github.com/vekexasia/pi-extensible-workflows/commit/1908ae5), [a911588](https://github.com/vekexasia/pi-extensible-workflows/commit/a911588), [d91d29a](https://github.com/vekexasia/pi-extensible-workflows/commit/d91d29a), [6800fdd](https://github.com/vekexasia/pi-extensible-workflows/commit/6800fdd)).
436
+ - Added per-agent token and spend accounting to workflow inspection ([#134](https://github.com/vekexasia/pi-extensible-workflows/issues/134); [4bce545](https://github.com/vekexasia/pi-extensible-workflows/commit/4bce545)).
437
+ - Added portable workflow bundles with dependency preflight, selected payload resources, skills, extension modules, and self-contained launchers ([#123](https://github.com/vekexasia/pi-extensible-workflows/issues/123); [76dbc40](https://github.com/vekexasia/pi-extensible-workflows/commit/76dbc40), [0d6c91b](https://github.com/vekexasia/pi-extensible-workflows/commit/0d6c91b), [cc81808](https://github.com/vekexasia/pi-extensible-workflows/commit/cc81808)).
438
+ - Added workflow-specific `SYSTEM.md` files and role-level system prompt replacement ([#137](https://github.com/vekexasia/pi-extensible-workflows/issues/137); [cc1082e](https://github.com/vekexasia/pi-extensible-workflows/commit/cc1082e), [0ada062](https://github.com/vekexasia/pi-extensible-workflows/commit/0ada062)).
439
+ - Added orange stalled-agent warnings after ten minutes without observable session events ([#138](https://github.com/vekexasia/pi-extensible-workflows/issues/138); [30ab4a1](https://github.com/vekexasia/pi-extensible-workflows/commit/30ab4a1), [5577f69](https://github.com/vekexasia/pi-extensible-workflows/commit/5577f69), [4f594ec](https://github.com/vekexasia/pi-extensible-workflows/commit/4f594ec)).
440
+ - Added concise human-readable background failure follow-ups and `inspect --failed` for persisted runs ([#130](https://github.com/vekexasia/pi-extensible-workflows/issues/130); [90acffe](https://github.com/vekexasia/pi-extensible-workflows/commit/90acffe), [387643f](https://github.com/vekexasia/pi-extensible-workflows/commit/387643f), [30e67b2](https://github.com/vekexasia/pi-extensible-workflows/commit/30e67b2)).
441
+ - Added active shell operations to workflow progress and cleared stale shell activity during recovery ([#141](https://github.com/vekexasia/pi-extensible-workflows/issues/141); [cf62485](https://github.com/vekexasia/pi-extensible-workflows/commit/cf62485), [a7e4386](https://github.com/vekexasia/pi-extensible-workflows/commit/a7e4386)).
442
+
443
+ ### Recovery, reliability, and navigation
444
+
445
+ - Continued TUI provider retries in the same native session, preserved results, and recovered thrown provider errors before disposal ([#135](https://github.com/vekexasia/pi-extensible-workflows/issues/135); [d75cb5b](https://github.com/vekexasia/pi-extensible-workflows/commit/d75cb5b), [0b09509](https://github.com/vekexasia/pi-extensible-workflows/commit/0b09509), [d7ca8e7](https://github.com/vekexasia/pi-extensible-workflows/commit/d7ca8e7)).
446
+ - Preserved registered workflow role definitions across retries ([#136](https://github.com/vekexasia/pi-extensible-workflows/issues/136); [3fcbf76](https://github.com/vekexasia/pi-extensible-workflows/commit/3fcbf76), [1755c30](https://github.com/vekexasia/pi-extensible-workflows/commit/1755c30)).
447
+ - Preserved foreground/background launch mode across resume and retry, including detached interactive budget recovery ([#142](https://github.com/vekexasia/pi-extensible-workflows/issues/142); [326f6bc](https://github.com/vekexasia/pi-extensible-workflows/commit/326f6bc), [fa58b94](https://github.com/vekexasia/pi-extensible-workflows/commit/fa58b94), [bfbd909](https://github.com/vekexasia/pi-extensible-workflows/commit/bfbd909)).
448
+ - Delivered detached foreground workflow completion and failure follow-ups correctly ([#143](https://github.com/vekexasia/pi-extensible-workflows/issues/143); [3d2a190](https://github.com/vekexasia/pi-extensible-workflows/commit/3d2a190)).
449
+ - Improved workflow navigator hierarchy and Back behavior, and added vim key support ([#139](https://github.com/vekexasia/pi-extensible-workflows/issues/139); [0dec3df](https://github.com/vekexasia/pi-extensible-workflows/commit/0dec3df); [#144](https://github.com/vekexasia/pi-extensible-workflows/issues/144); [3b34e78](https://github.com/vekexasia/pi-extensible-workflows/commit/3b34e78)).
450
+ - Completed external-editor artifact cleanup ([#133](https://github.com/vekexasia/pi-extensible-workflows/issues/133); [897f8fd](https://github.com/vekexasia/pi-extensible-workflows/commit/897f8fd)).
451
+
452
+ ### Validation and acceptance coverage
453
+
454
+ - Added trust-boundary adversarial regression coverage ([#128](https://github.com/vekexasia/pi-extensible-workflows/issues/128); [3e5e6a3](https://github.com/vekexasia/pi-extensible-workflows/commit/3e5e6a3)).
455
+ - Added targeted recovery-selection, evaluation-argument, and partial-shell retry acceptance coverage ([#132](https://github.com/vekexasia/pi-extensible-workflows/issues/132); [245a956](https://github.com/vekexasia/pi-extensible-workflows/commit/245a956), [458f564](https://github.com/vekexasia/pi-extensible-workflows/commit/458f564), [50581d5](https://github.com/vekexasia/pi-extensible-workflows/commit/50581d5), [63e6901](https://github.com/vekexasia/pi-extensible-workflows/commit/63e6901)).
456
+
457
+ ### Verification
458
+
459
+ - Package check passed: 405 tests, 404 passed, 1 skipped; lint, documentation checks, package dry-run, and npm publication passed.
460
+
461
+ ## [3.2.0] - 2026-07-25
462
+
463
+ ### Highlights
464
+
465
+ - Added a phase-first workflow navigator with responsive layouts and external-editor actions for workflow scripts and completed top-level agent results.
466
+ - Published a discoverable workflow extension template with a working role, tests, and setup documentation.
467
+ - Rejected unsafe concurrent same-callsite `agent()` calls and obvious `Promise.all(...map(agent))` fan-out; use `parallel()` or `pipeline()` for stable identity.
468
+ - Hardened worker temporary-path handling, workflow recovery routing, control-error rendering, and artifact navigation.
469
+ - Updated the bundled workflow skill to make named inline parallel fan-out followed by a summarizing agent the default path.
470
+
471
+ ## [3.1.0] - 2026-07-24
472
+
473
+ ### Highlights
474
+
475
+ - Added explicit dry-run-first `doctor cleanup` with age-gated, lease-aware, dependency-safe deletion of old terminal workflow runs.
476
+ - Added dynamic workflow model aliases and phase-aware workflow navigator views.
477
+
478
+ ## [3.0.0] - 2026-07-23
479
+
480
+ ### Breaking changes
481
+
482
+ - Removed persistent workflow conversations. Use independent `agent()` calls and pass completed results explicitly to later prompts.
483
+ - Added explicit `workflow_retry({ runId })` for failed runs, with linked child runs, cumulative budgets, structural journal replay, and durable named-worktree lineage.
484
+ - Registered function launches now reject a separate `name`; `workflow` is their run name.
485
+
486
+ ## [2.0.0] - 2026-07-23
487
+
488
+ ### Highlights
489
+
490
+ - Added schema-validated registered functions. Register reusable workflows under `functions`, launch them directly with `{ workflow: "name", args: {...} }`, or compose them with `context.invoke()`.
491
+ - Added the headless CLI: `run` launches registered functions, `export` creates executable POSIX launchers, and `transcript` renders saved sessions. Schema-derived flags, JSON input, trust overrides, and `--` passthrough are supported.
492
+ - Added the host-mediated `shell(command, options)` primitive with deterministic workflow identity, timeout and environment options, worktree-aware execution, and structured results.
493
+ - Added reusable worktrees. `withWorktree` callbacks receive a frozen `{ path, branch }` reference, and `parentRunId` can borrow matching named worktrees from a terminal run.
494
+ - Added bounded structured failure diagnostics, provider-failure recovery in the TUI, and Herdr pane inspection and attempt forking.
495
+
496
+ ### Breaking changes
497
+ - Inline `workflow` launches require an explicit non-empty `name`; registered function launches may omit `name` and use the registered function name as the run name.
498
+ - Registered function launches ignore any separately supplied run name so function identity remains stable.
499
+ - Removed registered workflow scripts: `WorkflowExtension.workflows`, `WorkflowScriptDefinition`, `registry.workflow()` / `workflows()`, and `registeredWorkflowDefinitions`.
500
+ - Migrate each workflow to `functions.<name>` with `description`, `input`, `output`, and `run(input, context)`.
501
+ - Launch it with `{ workflow: "name", args: {...} }`.
502
+ - Changed `workflow_catalog` to return a compact index by default and removed its `workflows` collection.
503
+ - Use the default call for discovery and `{ "name": "entry" }` for full details.
504
+ - Host integrations should use `workflowCatalogIndex()`, `workflowCatalogDetail()`, or `registeredWorkflowFunctions()`.
505
+ - Bumped launch snapshot identity to v5. Cold resume rejects older snapshots, including v4 snapshots using the previous worktree or registered-function naming contracts, with `RESUME_INCOMPATIBLE`.
506
+ - Relaunch affected workflows after updating. Completed runs remain inspectable and deletable.
507
+ - Changed budget relaxation to an asynchronous proposal. `workflow_resume` now returns `{ state: "awaiting_approval", proposalId }`.
508
+ - Answer with `workflow_respond` using the returned `proposalId`. Budget tightening still resumes directly.
509
+ - `withWorktree` now requires an explicit non-empty name and callback; unnamed scopes are rejected.
510
+ - Removed transcript browsing from the navigator.
511
+ - Use `pi-extensible-workflows transcript <session-file>` or Herdr pane actions.
512
+
513
+ ### Other improvements
514
+
515
+ - Structured `workflow_result` submissions are accepted immediately without an unnecessary repair turn.
516
+ - Workflow overlays gained borders and stable compact rendering; agent rows are denser and unused budget rows stay hidden.
517
+ - Fixed fullscreen flashing, shell process-tree cleanup, shell RPC size boundaries, running-attempt fork classification, and exported launchers without a global CLI installation.
518
+ - Borrowed worktree bindings are persisted, lineage-checked, and fail closed when invalid. Borrowed worktrees are never deleted with the borrowing run.
519
+ - Global and trusted-project roles now propagate consistently through CLI launches, nested agents, and cold resume.
520
+ - Updated the README, developer and agent documentation, and bundled workflow skill for the CLI, trust model, shell gates, worktree reuse, and v5 snapshot contract.
521
+
522
+ ### Verification
523
+
524
+ - Full test suite: 270 tests passing.
525
+ - Runtime acceptance suite: 24 tests passing.
526
+ - Build, lint, documentation checks, and package dry-run passing.
527
+
528
+ [5.4.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v5.3.0...v5.4.0
529
+ [4.0.2]: https://github.com/vekexasia/pi-extensible-workflows/compare/v4.0.1...v4.0.2
530
+ [4.0.1]: https://github.com/vekexasia/pi-extensible-workflows/compare/v3.4.2...v4.0.1
531
+ [3.4.2]: https://github.com/vekexasia/pi-extensible-workflows/compare/v3.4.1...v3.4.2
532
+ [3.4.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v3.3.0...v3.4.0
533
+ [3.2.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v3.1.0...v3.2.0
534
+ [3.1.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v3.0.0...v3.1.0
535
+ [3.0.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v2.0.0...v3.0.0
536
+ [2.0.0]: https://github.com/vekexasia/pi-extensible-workflows/compare/v1.0.1...v2.0.0
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # pi-extensible-workflows
2
+
3
+ Deterministic multi-agent workflow orchestration for Pi. Build named jobs that fan out, pause for approval, use isolated worktrees, and recover without rerunning completed work.
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/vekexasia/pi-extensible-workflows/main/assets/banner.svg" alt="Animated workflow: a task fans out to parallel agents, merges into review, and either completes or loops back" width="100%">
7
+ </p>
8
+
9
+ The repository [README](https://github.com/vekexasia/pi-extensible-workflows#readme) is the canonical product overview, package map, and documentation index.
10
+
11
+ ## Install
12
+
13
+ Requires Node.js 22.19 or newer. This is trusted Pi host code with the same filesystem and process access as Pi.
14
+ The core installation includes workflow orchestration, the `reviewLoop` starter for implementation-and-review cycles, packaged `developer`/`reviewer`/`scout`/`oracle`/`researcher` roles with ready-made slash commands (`/scout`, `/oracle`, `/review`, `/parallel-review`, `/review-loop`, `/deep-research`, and more), and durable standalone subagent tools. See the [Subagents guide](https://vekexasia.github.io/pi-extensible-workflows/subagents.html) for the bundled tools.
15
+ Trajectory live monitoring is included in the package. Restart existing Pi processes after upgrading the package so their publisher protocol matches the detached Trajectory server.
16
+
17
+ ```sh
18
+ pi install npm:@marcoscale98/pi-extensible-workflows@fork
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ A workflow is a named inline or file-backed JavaScript script. Pi normally writes the script for the current task.
24
+
25
+ ```js
26
+ const reports = await parallel("review", {
27
+ api: () => agent("Review the API."),
28
+ tests: () => agent("Review the tests."),
29
+ });
30
+
31
+ return agent(prompt("Summarize these reports:\n\n{reports}", { reports }));
32
+ ```
33
+
34
+ Launch with a non-empty `name` and exactly one of `script` or `scriptPath`. Registered functions are available as globals, and JSON-compatible launch values are available through `args`. Runs are backgrounded by default; set `foreground: true` to wait for the final value.
35
+
36
+ ## Programmatic integration
37
+
38
+ The package exports the workflow registry, runtime, persistence, validation, settings, role, lifecycle, and local Pi session APIs used by trusted hosts and extensions.
39
+
40
+ Direct consumers of `createLocalPiSession()` receive a session with extensions already bound. Always `await session.dispose()` so `session_shutdown` runs before the native session is released; disposal is idempotent.
41
+
42
+ ## References
43
+
44
+ - [Canonical overview](https://github.com/vekexasia/pi-extensible-workflows#readme)
45
+ - [Developer guide](https://vekexasia.github.io/pi-extensible-workflows/developers.html)
46
+ - [Subagents](https://vekexasia.github.io/pi-extensible-workflows/subagents.html)
47
+ - [Herdr](https://vekexasia.github.io/pi-extensible-workflows/herdr.html)
48
+ - [Roles](https://vekexasia.github.io/pi-extensible-workflows/roles.html)
49
+ - [Extension authoring](https://vekexasia.github.io/pi-extensible-workflows/extensions.html)
50
+ - [Bundled workflow skill](skills/pi-extensible-workflows/SKILL.md)
51
+
52
+ ## Development
53
+
54
+ From the repository root:
55
+
56
+ ```sh
57
+ npm run build --workspace=packages/core
58
+ npm test --workspace=packages/core
59
+ npm run lint --workspace=packages/core
60
+ ```
61
+
62
+ ## License
63
+
64
+ MIT