@osolmaz/pi-workflows 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/README.md +56 -31
  2. package/dist/builtins/autodoc.workflow.d.ts +4 -4
  3. package/dist/builtins/autoimplement.workflow.d.ts +797 -142
  4. package/dist/builtins/autoimplement.workflow.js +17 -105
  5. package/dist/builtins/autoimplement.workflow.js.map +1 -1
  6. package/dist/builtins/autoplan.workflow.d.ts +126 -13
  7. package/dist/builtins/autoplan.workflow.js +200 -29
  8. package/dist/builtins/autoplan.workflow.js.map +1 -1
  9. package/dist/builtins/catalog.js +7 -5
  10. package/dist/builtins/catalog.js.map +1 -1
  11. package/dist/builtins/index.d.ts +4 -2
  12. package/dist/builtins/index.js +3 -1
  13. package/dist/builtins/index.js.map +1 -1
  14. package/dist/builtins/monitor.workflow.d.ts +56 -23
  15. package/dist/builtins/monitor.workflow.js +508 -329
  16. package/dist/builtins/monitor.workflow.js.map +1 -1
  17. package/dist/builtins/pi-agent-group.d.ts +72 -0
  18. package/dist/builtins/pi-agent-group.js +1087 -0
  19. package/dist/builtins/pi-agent-group.js.map +1 -0
  20. package/dist/builtins/plain-summary.workflow.d.ts +32 -0
  21. package/dist/builtins/plain-summary.workflow.js +134 -0
  22. package/dist/builtins/plain-summary.workflow.js.map +1 -0
  23. package/dist/builtins/plan-approval.workflow.d.ts +39 -5
  24. package/dist/builtins/plan-approval.workflow.js +92 -14
  25. package/dist/builtins/plan-approval.workflow.js.map +1 -1
  26. package/dist/builtins/plan-change.workflow.d.ts +449 -0
  27. package/dist/builtins/plan-change.workflow.js +256 -0
  28. package/dist/builtins/plan-change.workflow.js.map +1 -0
  29. package/dist/builtins/plan-presentation.js +2 -2
  30. package/dist/builtins/plan-presentation.js.map +1 -1
  31. package/dist/builtins/sanity-check.workflow.d.ts +50 -6
  32. package/dist/builtins/sanity-check.workflow.js +150 -28
  33. package/dist/builtins/sanity-check.workflow.js.map +1 -1
  34. package/dist/controllers/effects.d.ts +3 -2
  35. package/dist/controllers/effects.js +8 -1
  36. package/dist/controllers/effects.js.map +1 -1
  37. package/dist/controllers/index.d.ts +1 -1
  38. package/dist/controllers/index.js +1 -1
  39. package/dist/controllers/index.js.map +1 -1
  40. package/dist/controllers/manager.d.ts +1 -0
  41. package/dist/controllers/manager.js +41 -17
  42. package/dist/controllers/manager.js.map +1 -1
  43. package/dist/controllers/sqlite.d.ts +107 -85
  44. package/dist/controllers/sqlite.js +1611 -1486
  45. package/dist/controllers/sqlite.js.map +1 -1
  46. package/dist/controllers/store.d.ts +9 -8
  47. package/dist/controllers/store.js +1 -31
  48. package/dist/controllers/store.js.map +1 -1
  49. package/dist/controllers/types.d.ts +3 -0
  50. package/dist/controllers/workflow-engine-scheduler.d.ts +1 -1
  51. package/dist/controllers/workflow-engine-scheduler.js +3 -5
  52. package/dist/controllers/workflow-engine-scheduler.js.map +1 -1
  53. package/dist/controllers/workflows.d.ts +2 -2
  54. package/dist/controllers/workflows.js +11 -10
  55. package/dist/controllers/workflows.js.map +1 -1
  56. package/dist/extension/controller-host.js +2 -2
  57. package/dist/extension/controller-host.js.map +1 -1
  58. package/dist/extension/decision-channels.d.ts +4 -2
  59. package/dist/extension/decision-channels.js +333 -146
  60. package/dist/extension/decision-channels.js.map +1 -1
  61. package/dist/extension/executor.d.ts +9 -2
  62. package/dist/extension/executor.js +89 -2
  63. package/dist/extension/executor.js.map +1 -1
  64. package/dist/extension/herdr-viewer.d.ts +0 -1
  65. package/dist/extension/herdr-viewer.js +0 -4
  66. package/dist/extension/herdr-viewer.js.map +1 -1
  67. package/dist/extension/index.js +209 -127
  68. package/dist/extension/index.js.map +1 -1
  69. package/dist/extension/recorder.d.ts +3 -10
  70. package/dist/extension/recorder.js +13 -22
  71. package/dist/extension/recorder.js.map +1 -1
  72. package/dist/extension/session-events.d.ts +2 -2
  73. package/dist/extension/step-message.d.ts +7 -2
  74. package/dist/extension/step-message.js +94 -2
  75. package/dist/extension/step-message.js.map +1 -1
  76. package/dist/extension/widget.js +29 -3
  77. package/dist/extension/widget.js.map +1 -1
  78. package/dist/host/rpc-executor.d.ts +3 -0
  79. package/dist/host/rpc-executor.js +2 -0
  80. package/dist/host/rpc-executor.js.map +1 -1
  81. package/dist/host/runner.d.ts +3 -6
  82. package/dist/host/runner.js +83 -32
  83. package/dist/host/runner.js.map +1 -1
  84. package/dist/render/graph-render.js +15 -10
  85. package/dist/render/graph-render.js.map +1 -1
  86. package/dist/state/database.d.ts +35 -0
  87. package/dist/state/database.js +287 -0
  88. package/dist/state/database.js.map +1 -0
  89. package/dist/state/index.d.ts +4 -0
  90. package/dist/state/index.js +5 -0
  91. package/dist/state/index.js.map +1 -0
  92. package/dist/state/json.d.ts +6 -0
  93. package/dist/state/json.js +38 -0
  94. package/dist/state/json.js.map +1 -0
  95. package/dist/state/mutation.d.ts +57 -0
  96. package/dist/state/mutation.js +255 -0
  97. package/dist/state/mutation.js.map +1 -0
  98. package/dist/state/schema.d.ts +6 -0
  99. package/dist/state/schema.js +473 -0
  100. package/dist/state/schema.js.map +1 -0
  101. package/dist/viewer/cli.d.ts +2 -2
  102. package/dist/viewer/cli.js +142 -122
  103. package/dist/viewer/cli.js.map +1 -1
  104. package/dist/viewer/render.d.ts +4 -4
  105. package/dist/viewer/render.js +9 -23
  106. package/dist/viewer/render.js.map +1 -1
  107. package/dist/viewer/session-reducer.d.ts +1 -1
  108. package/dist/viewer/session-reducer.js +1 -1
  109. package/dist/viewer/tui.d.ts +3 -3
  110. package/dist/viewer/tui.js +15 -13
  111. package/dist/viewer/tui.js.map +1 -1
  112. package/dist/viewer/watch.d.ts +2 -5
  113. package/dist/viewer/watch.js +13 -13
  114. package/dist/viewer/watch.js.map +1 -1
  115. package/dist/workflows/catalog.js +7 -2
  116. package/dist/workflows/catalog.js.map +1 -1
  117. package/dist/workflows/composition.js +20 -2
  118. package/dist/workflows/composition.js.map +1 -1
  119. package/dist/workflows/decision-presentation.d.ts +1 -1
  120. package/dist/workflows/decision-presentation.js +51 -38
  121. package/dist/workflows/decision-presentation.js.map +1 -1
  122. package/dist/workflows/definition.d.ts +6 -2
  123. package/dist/workflows/definition.js +17 -0
  124. package/dist/workflows/definition.js.map +1 -1
  125. package/dist/workflows/engine.d.ts +7 -7
  126. package/dist/workflows/engine.js +196 -115
  127. package/dist/workflows/engine.js.map +1 -1
  128. package/dist/workflows/errors.d.ts +16 -3
  129. package/dist/workflows/errors.js +18 -3
  130. package/dist/workflows/errors.js.map +1 -1
  131. package/dist/workflows/human-decision.d.ts +45 -8
  132. package/dist/workflows/human-decision.js +641 -274
  133. package/dist/workflows/human-decision.js.map +1 -1
  134. package/dist/workflows/index.d.ts +5 -6
  135. package/dist/workflows/index.js +4 -5
  136. package/dist/workflows/index.js.map +1 -1
  137. package/dist/workflows/progress.d.ts +1 -0
  138. package/dist/workflows/progress.js +15 -3
  139. package/dist/workflows/progress.js.map +1 -1
  140. package/dist/workflows/schema.js +27 -1
  141. package/dist/workflows/schema.js.map +1 -1
  142. package/dist/workflows/store.d.ts +83 -103
  143. package/dist/workflows/store.js +907 -951
  144. package/dist/workflows/store.js.map +1 -1
  145. package/dist/workflows/types.d.ts +88 -126
  146. package/docs/CONTROLLERS.md +10 -8
  147. package/docs/DEFERRED_TURNS.md +2 -2
  148. package/docs/DESIGN_PHILOSOPHY.md +4 -2
  149. package/docs/HUMAN_DECISIONS.md +36 -47
  150. package/docs/HUMAN_DECISION_PRESENTATIONS.md +14 -24
  151. package/docs/MONITOR.md +179 -237
  152. package/docs/SQLITE_STATE.md +219 -0
  153. package/docs/WORKFLOW_COMPOSITION.md +27 -26
  154. package/docs/WORKFLOW_STEP_MESSAGES.md +20 -18
  155. package/docs/WORKFLOW_UPDATES.md +10 -9
  156. package/docs/development.md +9 -9
  157. package/docs/live-replay-protocol.md +28 -37
  158. package/docs/plans/2026-08-16-workflow-updates-plan.md +1 -1
  159. package/docs/plans/2026-08-19-human-decision-gates-plan.md +1 -1
  160. package/docs/plans/2026-08-21-autoimplement-timeout-fallback-plan.md +1 -1
  161. package/docs/plans/2026-08-21-plan-change-approval-policy-plan.md +322 -0
  162. package/docs/plans/2026-08-21-sanity-check-plan.md +217 -95
  163. package/docs/plans/2026-08-22-goal-finishing-monitor-plan.md +200 -0
  164. package/docs/plans/2026-08-23-assistant-agent-completion-plan.md +701 -0
  165. package/docs/plans/2026-08-23-sqlite-state-plan.md +970 -0
  166. package/docs/plans/replayable-run-bundles-implementation-plan.md +2 -2
  167. package/docs/plans/session-event-replay-implementation-plan.md +1 -1
  168. package/docs/plans/tui-viewer-implementation-plan.md +1 -1
  169. package/docs/session-event-journal.md +63 -434
  170. package/docs/tui-viewer.md +13 -15
  171. package/docs/workflows.md +127 -53
  172. package/examples/workflows/approved-plan.workflow.ts +19 -46
  173. package/examples/workflows/plain-summary.workflow.ts +1 -0
  174. package/herdr-plugin.toml +1 -1
  175. package/package.json +7 -7
  176. package/plugins/herdr/viewer.mjs +1 -11
  177. package/schemas/human-decision-accepted-v1.schema.json +15 -3
  178. package/schemas/human-decision-continuation-v1.schema.json +10 -1
  179. package/schemas/human-decision-delivery-v1.schema.json +8 -0
  180. package/schemas/human-decision-receipt-v1.schema.json +8 -0
  181. package/schemas/human-decision-request-v1.schema.json +24 -4
  182. package/skills/autoimplement/SKILL.md +27 -0
  183. package/skills/autoplan/SKILL.md +5 -4
  184. package/skills/monitor/SKILL.md +91 -135
  185. package/skills/pi-workflows/SKILL.md +9 -8
  186. package/skills/sanity-check/SKILL.md +44 -0
  187. package/src/builtins/autoimplement.workflow.ts +19 -118
  188. package/src/builtins/autoplan.workflow.ts +290 -40
  189. package/src/builtins/catalog.ts +7 -5
  190. package/src/builtins/index.ts +18 -1
  191. package/src/builtins/monitor.workflow.ts +673 -382
  192. package/src/builtins/pi-agent-group.ts +1407 -0
  193. package/src/builtins/plain-summary.workflow.ts +185 -0
  194. package/src/builtins/plan-approval.workflow.ts +157 -24
  195. package/src/builtins/plan-change.workflow.ts +321 -0
  196. package/src/builtins/plan-presentation.ts +2 -2
  197. package/src/builtins/sanity-check.workflow.ts +248 -48
  198. package/src/controllers/effects.ts +7 -0
  199. package/src/controllers/index.ts +0 -6
  200. package/src/controllers/manager.ts +72 -32
  201. package/src/controllers/sqlite.ts +2420 -1948
  202. package/src/controllers/store.ts +17 -38
  203. package/src/controllers/types.ts +3 -0
  204. package/src/controllers/workflow-engine-scheduler.ts +4 -8
  205. package/src/controllers/workflows.ts +45 -21
  206. package/src/extension/controller-host.ts +1 -2
  207. package/src/extension/decision-channels.ts +456 -203
  208. package/src/extension/executor.ts +105 -2
  209. package/src/extension/herdr-viewer.ts +0 -5
  210. package/src/extension/index.ts +251 -151
  211. package/src/extension/recorder.ts +13 -22
  212. package/src/extension/session-events.ts +2 -2
  213. package/src/extension/step-message.ts +106 -4
  214. package/src/extension/widget.ts +32 -5
  215. package/src/host/rpc-executor.ts +4 -0
  216. package/src/host/runner.ts +93 -41
  217. package/src/render/graph-render.ts +12 -6
  218. package/src/state/database.ts +375 -0
  219. package/src/state/index.ts +29 -0
  220. package/src/state/json.ts +42 -0
  221. package/src/state/mutation.ts +435 -0
  222. package/src/state/schema.ts +475 -0
  223. package/src/viewer/cli.ts +151 -144
  224. package/src/viewer/render.ts +19 -30
  225. package/src/viewer/session-reducer.ts +1 -1
  226. package/src/viewer/tui.ts +18 -17
  227. package/src/viewer/watch.ts +13 -17
  228. package/src/workflows/catalog.ts +7 -2
  229. package/src/workflows/composition.ts +21 -3
  230. package/src/workflows/decision-presentation.ts +56 -43
  231. package/src/workflows/definition.ts +36 -3
  232. package/src/workflows/engine.ts +228 -130
  233. package/src/workflows/errors.ts +27 -3
  234. package/src/workflows/human-decision.ts +921 -349
  235. package/src/workflows/index.ts +20 -30
  236. package/src/workflows/progress.ts +18 -3
  237. package/src/workflows/schema.ts +36 -1
  238. package/src/workflows/store.ts +1300 -1163
  239. package/src/workflows/types.ts +100 -137
  240. package/dist/builtins/sanity-check-session.d.ts +0 -17
  241. package/dist/builtins/sanity-check-session.js +0 -168
  242. package/dist/builtins/sanity-check-session.js.map +0 -1
  243. package/dist/workflows/artifacts.d.ts +0 -40
  244. package/dist/workflows/artifacts.js +0 -155
  245. package/dist/workflows/artifacts.js.map +0 -1
  246. package/dist/workflows/migrate-sources.d.ts +0 -42
  247. package/dist/workflows/migrate-sources.js +0 -133
  248. package/dist/workflows/migrate-sources.js.map +0 -1
  249. package/docs/run-bundles.md +0 -481
  250. package/schemas/human-decision-accepted-v2.schema.json +0 -50
  251. package/schemas/human-decision-delivery-v2.schema.json +0 -36
  252. package/schemas/human-decision-receipt-v2.schema.json +0 -39
  253. package/schemas/human-decision-request-v2.schema.json +0 -69
  254. package/schemas/human-decision-resolution-v2.schema.json +0 -27
  255. package/src/builtins/sanity-check-session.ts +0 -205
  256. package/src/workflows/artifacts.ts +0 -188
  257. package/src/workflows/migrate-sources.ts +0 -178
package/README.md CHANGED
@@ -11,11 +11,11 @@ live in a standalone terminal viewer.
11
11
 
12
12
  The workflow model is a port of [openclaw/acpx](https://github.com/openclaw/acpx)
13
13
  flows into pi itself. Agent steps run inside your current pi conversation, so
14
- the model keeps everything it already knows from the discussion. The model
15
- completes each step by calling a JSON `workflow` tool, which gives the engine
16
- structured, validated output to route on. See the
17
- [design philosophy](docs/DESIGN_PHILOSOPHY.md) for the principles behind the
18
- engine and its public parts. Running steps can publish durable [workflow
14
+ the model keeps everything it already knows from the discussion. A submitted
15
+ agent calls the JSON `workflow` tool with structured output. An assistant agent
16
+ writes a normal visible response that becomes the node output. See the [design
17
+ philosophy](docs/DESIGN_PHILOSOPHY.md) for the principles behind the engine and
18
+ its public parts. Running steps can publish durable [workflow
19
19
  updates](docs/WORKFLOW_UPDATES.md), including progress counts and ETA data.
20
20
  Agent instructions use compact [workflow step
21
21
  messages](docs/WORKFLOW_STEP_MESSAGES.md), and the built-in
@@ -40,13 +40,14 @@ Or try the npm package without installing it:
40
40
  pi -e npm:@osolmaz/pi-workflows
41
41
  ```
42
42
 
43
- The Pi package includes the extension and five optional skills:
43
+ The Pi package includes the extension and six optional skills:
44
44
 
45
45
  - `pi-workflows` teaches the agent how to operate and author workflows.
46
46
  - `monitor` starts and operates the built-in monitor workflow.
47
47
  - `autoplan` selects the best practical solution and writes an implementation plan.
48
48
  - `autodoc` records an existing plan in canonical documentation.
49
49
  - `autoimplement` implements an existing plan and verifies the result.
50
+ - `sanity-check` reviews whether a contribution is necessary, focused, and well supported.
50
51
 
51
52
  Pi discovers these skills when it loads the package. Use `pi config` to disable
52
53
  the extension, all bundled skills, or one skill independently. The equivalent
@@ -78,6 +79,17 @@ The npm package also includes the simpler `pi-workflows` snapshot viewer. To
78
79
  link that command from a clone, run `npm install && npm run build && npm link`,
79
80
  or run it in place with `npx tsx src/viewer/cli.ts`.
80
81
 
82
+ All live workflow and controller state uses one local database:
83
+
84
+ ```text
85
+ ~/.pi/agent/workflows/state.sqlite
86
+ ```
87
+
88
+ Runs, decisions, queues, claims, controllers, session capture, notifications,
89
+ channel transport state, effects, and large text values share that database.
90
+ Reads are read-only. Every write checks its actor, expected revision, and owner
91
+ lease when required. See [SQLite state](docs/SQLITE_STATE.md).
92
+
81
93
  ## Herdr integration
82
94
 
83
95
  pi-workflows also ships as a [Herdr](https://herdr.dev) plugin. After installing
@@ -95,7 +107,7 @@ plan](docs/plans/2026-08-20-herdr-plugin-sync-plan.md) defines update and
95
107
  recovery behavior.
96
108
 
97
109
  When Pi runs inside Herdr, a workflow widget shows `Ctrl+Shift+R piw`. When the widget has hidden rows, this call to action shares the existing scroll-controls line instead of taking another line.
98
- The shortcut opens the exact run bundle and lets you choose a split, tab, or new
110
+ The shortcut opens the exact SQLite run state and lets you choose a split, tab, or new
99
111
  workspace. `/piw` opens the same menu, and `/piw right`, `/piw below`, `/piw
100
112
  left`, `/piw above`, `/piw tab`, or `/piw workspace` selects a placement
101
113
  directly. If a viewer for that run already exists, pi-workflows focuses it
@@ -158,6 +170,12 @@ structured run ends to request one normal, human-readable assistant response.
158
170
  Workflows without it remain silent after their final structured output, which
159
171
  keeps shell-only and machine-consumed workflows model-free.
160
172
 
173
+ Use `expectedOutput: assistantMessage()` when a normal assistant response must
174
+ be a node inside the graph rather than a presentation after the run. Its exact
175
+ visible text becomes the node output after the turn settles. The helper has no
176
+ default character limit; a workflow can set one explicitly with
177
+ `assistantMessage({ maxChars: 2_000 })`.
178
+
161
179
  ## Compose workflows
162
180
 
163
181
  A workflow can import another workflow and connect its named exits without copying its nodes:
@@ -192,8 +210,9 @@ Direct imports check child input and exit names in TypeScript. Names and paths r
192
210
  ## Agent-managed workflows
193
211
 
194
212
  The model can use the same `workflow` tool to list, start, inspect, pause,
195
- resume, cancel, and answer workflows. Step contracts use the tool's `submit`
196
- action. Slash commands and model actions share one lifecycle implementation.
213
+ resume, cancel, and answer workflows. Submitted-step contracts use the tool's
214
+ `submit` action. Assistant-step contracts require a normal assistant response
215
+ instead. Slash commands and model actions share one lifecycle implementation.
197
216
 
198
217
  pi-workflows includes a `monitor` workflow for plain-language requests such as:
199
218
 
@@ -216,14 +235,15 @@ discussion first and then trigger a workflow that builds on it. The
216
235
  an elegant production-ready solution, and compares it with the holy grail. It
217
236
  then selects the best practical in-scope solution without asking the user to
218
237
  resolve the gap. The ideal can win when it is feasible, but work outside the
219
- current authority cannot block a valid practical solution. The workflow ends
220
- with a detailed implementation plan. `autoplan` replaces the earlier
221
- `autodevise` name; the old command and export are not retained.
238
+ current authority cannot block a valid practical solution. The workflow keeps
239
+ the detailed implementation plan and shows one short assistant response with
240
+ the selected plan and a gist of every rejected option. `autoplan` replaces the
241
+ earlier `autodevise` name; the old command and export are not retained.
222
242
 
223
243
  ## Watching a run
224
244
 
225
- Runs persist to `~/.pi/agent/workflows/runs/` as they execute. The viewer
226
- tails that directory and re-renders on every state change:
245
+ Runs persist in `~/.pi/agent/workflows/state.sqlite` as they execute. The
246
+ viewer reads that database and re-renders on every state change:
227
247
 
228
248
  ```bash
229
249
  pi-workflows view # interactive picker, live updates
@@ -280,20 +300,22 @@ full boxed graph and its edges.
280
300
  ## Node types
281
301
 
282
302
  A workflow is a graph of named nodes with exactly one entry point. Each node
283
- finishes with a JSON output, and edges decide what runs next.
284
-
285
- An `agent` node sends a prompt into the pi conversation and waits for the
286
- model to submit its output through the `workflow` tool. A `compute` node runs
287
- a pure TypeScript function. A `notify` node writes a durable message for the
288
- Pi session that started the run. An `action` node performs a side effect,
289
- either a TypeScript function (`action({ run })`) or a runtime-owned shell
290
- command (`shell({ exec, parse })`). A `checkpoint` node ends the run in a
291
- `waiting` state so a human can pick it up. On top of `agent`, the `decision` helper asks
303
+ finishes with an output, and edges decide what runs next.
304
+
305
+ An `agent` node sends a prompt into the pi conversation. By default, it waits
306
+ for structured output through the `workflow` tool. With
307
+ `expectedOutput: assistantMessage()`, it waits for a normal visible assistant
308
+ response and uses the exact text as its output. A `compute` node runs a pure
309
+ TypeScript function. A `notify` node writes a durable message for the Pi
310
+ session that started the run. An `action` node performs a side effect, either a
311
+ TypeScript function (`action({ run })`) or a runtime-owned shell command
312
+ (`shell({ exec, parse })`). A `checkpoint` node ends the run in a `waiting`
313
+ state so a human can pick it up. On top of `agent`, the `decision` helper asks
292
314
  the model to pick from a fixed set of choices and validates the answer, and
293
315
  `decisionEdge` routes on the result with compile-time case checking.
294
316
 
295
317
  See [docs/workflows.md](docs/workflows.md) for the full authoring reference
296
- and [docs/run-bundles.md](docs/run-bundles.md) for the on-disk run format.
318
+ and [docs/SQLITE_STATE.md](docs/SQLITE_STATE.md) for the on-disk run format.
297
319
 
298
320
  ## Controllers
299
321
 
@@ -329,7 +351,7 @@ The standalone CLI provides read-only views with `pi-workflows controllers` and
329
351
 
330
352
  Runs do not depend on the Pi window. Every `/workflow` run is claimed through a durable queue, so closing Pi mid-run **parks** the run instead of cancelling it. Another interactive session cannot claim it. Reopening the exact session that started the run resumes it. A standalone host can also resume it without changing where reports go. A checkpointed run waits durably until you answer it with `/workflow answer <json>`, which continues the graph in a linked run.
331
353
 
332
- Workflow reports use a durable session-addressed outbox. A report waits while its starting session is closed and is delivered only to that session when it opens again. Runs in the same directory do not broadcast messages to each other's conversations.
354
+ Workflow reports use a durable session-addressed outbox. A report waits while its starting session is closed and is delivered only to that session when it opens again. Runs in the same database do not broadcast messages to each other's conversations.
333
355
 
334
356
  For runs that must continue while Pi is closed, keep the standalone host running:
335
357
 
@@ -337,12 +359,12 @@ For runs that must continue while Pi is closed, keep the standalone host running
337
359
  pi-workflows host --project /path/to/project
338
360
  ```
339
361
 
340
- The host claims parked runs and reconciles controllers without a Pi session. Conversation nodes execute in headless `pi --mode rpc` children that expose the same `workflow` tool contract. It is a foreground process — stop it with Ctrl-C; a crashed host's leftovers are reaped by the next one. See [docs/workflows.md](docs/workflows.md#durable-runs-parking-and-resume) for the model and [docs/run-bundles.md](docs/run-bundles.md) for the on-disk rules.
362
+ The host claims parked runs and reconciles controllers without a Pi session. Conversation nodes execute in headless `pi --mode rpc` children that expose the same `workflow` tool contract. It is a foreground process — stop it with Ctrl-C; a crashed host's leftovers are reaped by the next one. See [docs/workflows.md](docs/workflows.md#durable-runs-parking-and-resume) for the model and [docs/SQLITE_STATE.md](docs/SQLITE_STATE.md) for the on-disk rules.
341
363
 
342
364
  ## Examples
343
365
 
344
- The [examples/workflows/](examples/workflows/) directory mirrors the acpx
345
- example set. Copy any of them into `.pi/workflows/` to use them:
366
+ The [examples/workflows/](examples/workflows/) directory contains complete
367
+ workflow examples. Copy any of them into `.pi/workflows/` to use them:
346
368
 
347
369
  - `echo` is the smallest possible workflow, one agent step.
348
370
  - `branch` classifies a task with a `decision` and routes to either a
@@ -352,9 +374,12 @@ example set. Copy any of them into `.pi/workflows/` to use them:
352
374
  while they run.
353
375
  - `two-turn` chains three agent steps that build on each other's outputs in
354
376
  the same conversation.
377
+ - `plain-summary` turns structured source data into one short visible assistant
378
+ response. It is also a built-in workflow that other workflows can include.
355
379
  - `autoplan` turns the current problem into a chosen practical solution and
356
380
  a detailed implementation plan, using the ideal end state as guidance rather
357
- than an out-of-scope requirement.
381
+ than an out-of-scope requirement. It also shows a short assistant response
382
+ with the selected plan and each rejected option.
358
383
  - `autoimplement` finds a clear existing plan, documents it when needed,
359
384
  implements and verifies it, writes and runs the exact pi-reviewer command,
360
385
  tracks P0 through P2, handles PR comments and CI, and
@@ -365,8 +390,8 @@ example set. Copy any of them into `.pi/workflows/` to use them:
365
390
  - `human-decision` shows a reusable verified-human gate with a structured
366
391
  machine subject, a separate readable operator presentation, plain choices,
367
392
  and exact replan text.
368
- - `approved-plan` composes autoplan, autodoc, and the reusable plan-approval
369
- workflow without copying their internal nodes.
393
+ - `approved-plan` includes the shared plan-change workflow, which composes
394
+ autoplan, autodoc, the configurable plan decision, and bounded replanning.
370
395
  - `autoresearch` runs an iterative feature-search loop in the style of
371
396
  [karpathy/autoresearch](https://github.com/karpathy/autoresearch): setup
372
397
  creates a frozen evaluation harness, one editable feature file, and a
@@ -36,10 +36,10 @@ export declare const autodocWorkflow: import("../workflows/types.js").WorkflowDe
36
36
  }, import("../workflows/types.js").WorkflowIncludeMap> & {
37
37
  nodes: {
38
38
  readonly prepare: import("../workflows/types.js").ComputeNodeDefinition;
39
- readonly locatePlan: import("../workflows/types.js").AgentNodeDefinition;
40
- readonly inspectDocumentation: import("../workflows/types.js").AgentNodeDefinition;
41
- readonly updateDocumentation: import("../workflows/types.js").AgentNodeDefinition;
42
- readonly verifyDocumentation: import("../workflows/types.js").AgentNodeDefinition;
39
+ readonly locatePlan: import("../workflows/types.js").SubmittedAgentNodeDefinition;
40
+ readonly inspectDocumentation: import("../workflows/types.js").SubmittedAgentNodeDefinition;
41
+ readonly updateDocumentation: import("../workflows/types.js").SubmittedAgentNodeDefinition;
42
+ readonly verifyDocumentation: import("../workflows/types.js").SubmittedAgentNodeDefinition;
43
43
  readonly finalize: import("../workflows/types.js").ComputeNodeDefinition;
44
44
  readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
45
45
  };