pi-agent-flow 1.8.40 → 2.0.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 (331) hide show
  1. package/README.md +33 -37
  2. package/agents/audit.md +21 -22
  3. package/agents/build.md +23 -22
  4. package/agents/craft.md +23 -27
  5. package/agents/debug.md +24 -28
  6. package/agents/ideas.md +21 -101
  7. package/agents/scout.md +20 -19
  8. package/dist/batch/batch-bash.d.ts +2 -2
  9. package/dist/batch/batch-bash.d.ts.map +1 -1
  10. package/dist/batch/batch-bash.js +30 -7
  11. package/dist/batch/batch-bash.js.map +1 -1
  12. package/dist/batch/constants.d.ts +31 -5
  13. package/dist/batch/constants.d.ts.map +1 -1
  14. package/dist/batch/constants.js +50 -3
  15. package/dist/batch/constants.js.map +1 -1
  16. package/dist/batch/execute.d.ts +0 -1
  17. package/dist/batch/execute.d.ts.map +1 -1
  18. package/dist/batch/execute.js +210 -6
  19. package/dist/batch/execute.js.map +1 -1
  20. package/dist/batch/fuzzy-edit.d.ts +0 -6
  21. package/dist/batch/fuzzy-edit.d.ts.map +1 -1
  22. package/dist/batch/fuzzy-edit.js +1 -1
  23. package/dist/batch/fuzzy-edit.js.map +1 -1
  24. package/dist/batch/index.d.ts.map +1 -1
  25. package/dist/batch/index.js +87 -16
  26. package/dist/batch/index.js.map +1 -1
  27. package/dist/batch/render.d.ts +0 -1
  28. package/dist/batch/render.d.ts.map +1 -1
  29. package/dist/batch/render.js +7 -101
  30. package/dist/batch/render.js.map +1 -1
  31. package/dist/batch/shell-compress.d.ts +25 -0
  32. package/dist/batch/shell-compress.d.ts.map +1 -0
  33. package/dist/batch/shell-compress.js +602 -0
  34. package/dist/batch/shell-compress.js.map +1 -0
  35. package/dist/batch/summary.d.ts +5 -0
  36. package/dist/batch/summary.d.ts.map +1 -0
  37. package/dist/batch/summary.js +101 -0
  38. package/dist/batch/summary.js.map +1 -0
  39. package/dist/batch/symbols.d.ts.map +1 -1
  40. package/dist/batch/symbols.js +12 -7
  41. package/dist/batch/symbols.js.map +1 -1
  42. package/dist/{config.d.ts → config/config.d.ts} +39 -2
  43. package/dist/config/config.d.ts.map +1 -0
  44. package/dist/{config.js → config/config.js} +220 -9
  45. package/dist/config/config.js.map +1 -0
  46. package/dist/config/log.d.ts +27 -0
  47. package/dist/config/log.d.ts.map +1 -0
  48. package/dist/config/log.js +104 -0
  49. package/dist/config/log.js.map +1 -0
  50. package/dist/config/models.d.ts +2 -0
  51. package/dist/config/models.d.ts.map +1 -0
  52. package/dist/config/models.js +49 -0
  53. package/dist/config/models.js.map +1 -0
  54. package/dist/{settings-resolver.d.ts → config/settings-resolver.d.ts} +9 -2
  55. package/dist/config/settings-resolver.d.ts.map +1 -0
  56. package/dist/config/settings-resolver.js +275 -0
  57. package/dist/config/settings-resolver.js.map +1 -0
  58. package/dist/core/agents.d.ts.map +1 -0
  59. package/dist/{agents.js → core/agents.js} +13 -12
  60. package/dist/core/agents.js.map +1 -0
  61. package/dist/core/delegation.d.ts +24 -0
  62. package/dist/core/delegation.d.ts.map +1 -0
  63. package/dist/core/delegation.js +48 -0
  64. package/dist/core/delegation.js.map +1 -0
  65. package/dist/core/depth.d.ts.map +1 -0
  66. package/dist/{depth.js → core/depth.js} +9 -8
  67. package/dist/core/depth.js.map +1 -0
  68. package/dist/{executor.d.ts → core/executor.d.ts} +18 -3
  69. package/dist/core/executor.d.ts.map +1 -0
  70. package/dist/{executor.js → core/executor.js} +53 -14
  71. package/dist/core/executor.js.map +1 -0
  72. package/dist/{flow.d.ts → core/flow.d.ts} +13 -1
  73. package/dist/core/flow.d.ts.map +1 -0
  74. package/dist/{flow.js → core/flow.js} +125 -64
  75. package/dist/core/flow.js.map +1 -0
  76. package/dist/{session-mode.d.ts → core/session-mode.d.ts} +2 -1
  77. package/dist/core/session-mode.d.ts.map +1 -0
  78. package/dist/{session-mode.js → core/session-mode.js} +2 -1
  79. package/dist/core/session-mode.js.map +1 -0
  80. package/dist/core/session-registry.d.ts +16 -0
  81. package/dist/core/session-registry.d.ts.map +1 -0
  82. package/dist/core/session-registry.js +30 -0
  83. package/dist/core/session-registry.js.map +1 -0
  84. package/dist/core/transitions.d.ts.map +1 -0
  85. package/dist/{transitions.js → core/transitions.js} +1 -1
  86. package/dist/core/transitions.js.map +1 -0
  87. package/dist/flow/auto-warp.d.ts +12 -0
  88. package/dist/flow/auto-warp.d.ts.map +1 -0
  89. package/dist/flow/auto-warp.js +29 -0
  90. package/dist/flow/auto-warp.js.map +1 -0
  91. package/dist/flow/command.d.ts +8 -0
  92. package/dist/flow/command.d.ts.map +1 -0
  93. package/dist/flow/command.js +194 -0
  94. package/dist/flow/command.js.map +1 -0
  95. package/dist/flow/continuation.d.ts +16 -0
  96. package/dist/flow/continuation.d.ts.map +1 -0
  97. package/dist/flow/continuation.js +188 -0
  98. package/dist/flow/continuation.js.map +1 -0
  99. package/dist/flow/index.d.ts +18 -0
  100. package/dist/flow/index.d.ts.map +1 -0
  101. package/dist/flow/index.js +25 -0
  102. package/dist/flow/index.js.map +1 -0
  103. package/dist/flow/loop-command.d.ts +8 -0
  104. package/dist/flow/loop-command.d.ts.map +1 -0
  105. package/dist/flow/loop-command.js +99 -0
  106. package/dist/flow/loop-command.js.map +1 -0
  107. package/dist/flow/loop-templates.d.ts +7 -0
  108. package/dist/flow/loop-templates.d.ts.map +1 -0
  109. package/dist/flow/loop-templates.js +38 -0
  110. package/dist/flow/loop-templates.js.map +1 -0
  111. package/dist/flow/loop.d.ts +19 -0
  112. package/dist/flow/loop.d.ts.map +1 -0
  113. package/dist/flow/loop.js +95 -0
  114. package/dist/flow/loop.js.map +1 -0
  115. package/dist/flow/perform-warp.d.ts +28 -0
  116. package/dist/flow/perform-warp.d.ts.map +1 -0
  117. package/dist/flow/perform-warp.js +127 -0
  118. package/dist/flow/perform-warp.js.map +1 -0
  119. package/dist/flow/settings-command.d.ts +51 -0
  120. package/dist/flow/settings-command.d.ts.map +1 -0
  121. package/dist/flow/settings-command.js +937 -0
  122. package/dist/flow/settings-command.js.map +1 -0
  123. package/dist/flow/store.d.ts +26 -0
  124. package/dist/flow/store.d.ts.map +1 -0
  125. package/dist/flow/store.js +166 -0
  126. package/dist/flow/store.js.map +1 -0
  127. package/dist/flow/template-shared.d.ts +9 -0
  128. package/dist/flow/template-shared.d.ts.map +1 -0
  129. package/dist/flow/template-shared.js +13 -0
  130. package/dist/flow/template-shared.js.map +1 -0
  131. package/dist/flow/template-strings.d.ts +8 -0
  132. package/dist/flow/template-strings.d.ts.map +1 -0
  133. package/dist/flow/template-strings.js +36 -0
  134. package/dist/flow/template-strings.js.map +1 -0
  135. package/dist/flow/types.d.ts +61 -0
  136. package/dist/flow/types.d.ts.map +1 -0
  137. package/dist/flow/types.js +5 -0
  138. package/dist/flow/types.js.map +1 -0
  139. package/dist/flow/warp-command.d.ts +8 -0
  140. package/dist/flow/warp-command.d.ts.map +1 -0
  141. package/dist/flow/warp-command.js +144 -0
  142. package/dist/flow/warp-command.js.map +1 -0
  143. package/dist/flow/warp-utils.d.ts +11 -0
  144. package/dist/flow/warp-utils.d.ts.map +1 -0
  145. package/dist/flow/warp-utils.js +187 -0
  146. package/dist/flow/warp-utils.js.map +1 -0
  147. package/dist/index.d.ts +4 -1
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/index.js +115 -31
  150. package/dist/index.js.map +1 -1
  151. package/dist/{notify-state.d.ts → notify/notify-state.d.ts} +2 -1
  152. package/dist/notify/notify-state.d.ts.map +1 -0
  153. package/dist/notify/notify-state.js.map +1 -0
  154. package/dist/notify/notify.d.ts.map +1 -0
  155. package/dist/{notify.js → notify/notify.js} +3 -2
  156. package/dist/notify/notify.js.map +1 -0
  157. package/dist/{cli-args.d.ts → snapshot/cli-args.d.ts} +4 -2
  158. package/dist/snapshot/cli-args.d.ts.map +1 -0
  159. package/dist/{cli-args.js → snapshot/cli-args.js} +13 -1
  160. package/dist/snapshot/cli-args.js.map +1 -0
  161. package/dist/snapshot/index.d.ts +2 -0
  162. package/dist/snapshot/index.d.ts.map +1 -0
  163. package/dist/snapshot/index.js +2 -0
  164. package/dist/snapshot/index.js.map +1 -0
  165. package/dist/{reasoning-strip.d.ts → snapshot/reasoning-strip.d.ts} +0 -4
  166. package/dist/snapshot/reasoning-strip.d.ts.map +1 -0
  167. package/dist/{reasoning-strip.js → snapshot/reasoning-strip.js} +2 -2
  168. package/dist/snapshot/reasoning-strip.js.map +1 -0
  169. package/dist/snapshot/runner-events.d.ts.map +1 -0
  170. package/dist/{runner-events.js → snapshot/runner-events.js} +1 -1
  171. package/dist/snapshot/runner-events.js.map +1 -0
  172. package/dist/{snapshot.d.ts → snapshot/snapshot.d.ts} +24 -18
  173. package/dist/snapshot/snapshot.d.ts.map +1 -0
  174. package/dist/snapshot/snapshot.js +1791 -0
  175. package/dist/snapshot/snapshot.js.map +1 -0
  176. package/dist/{structured-output.d.ts → snapshot/structured-output.d.ts} +1 -1
  177. package/dist/snapshot/structured-output.d.ts.map +1 -0
  178. package/dist/snapshot/structured-output.js.map +1 -0
  179. package/dist/{flow-prompt.d.ts → steering/flow-prompt.d.ts} +2 -2
  180. package/dist/steering/flow-prompt.d.ts.map +1 -0
  181. package/dist/{flow-prompt.js → steering/flow-prompt.js} +1 -1
  182. package/dist/steering/flow-prompt.js.map +1 -0
  183. package/dist/{sliding-prompt.d.ts → steering/sliding-prompt.d.ts} +8 -7
  184. package/dist/steering/sliding-prompt.d.ts.map +1 -0
  185. package/dist/{sliding-prompt.js → steering/sliding-prompt.js} +18 -64
  186. package/dist/steering/sliding-prompt.js.map +1 -0
  187. package/dist/{tool-utils.d.ts → steering/tool-utils.d.ts} +1 -0
  188. package/dist/steering/tool-utils.d.ts.map +1 -0
  189. package/dist/{tool-utils.js → steering/tool-utils.js} +10 -3
  190. package/dist/steering/tool-utils.js.map +1 -0
  191. package/dist/{ask-user.d.ts → tools/ask-user.d.ts} +3 -15
  192. package/dist/tools/ask-user.d.ts.map +1 -0
  193. package/dist/tools/ask-user.js +778 -0
  194. package/dist/tools/ask-user.js.map +1 -0
  195. package/dist/{timed-bash.d.ts → tools/timed-bash.d.ts} +2 -7
  196. package/dist/tools/timed-bash.d.ts.map +1 -0
  197. package/dist/{timed-bash.js → tools/timed-bash.js} +11 -2
  198. package/dist/tools/timed-bash.js.map +1 -0
  199. package/dist/{web-tool.d.ts → tools/web-tool.d.ts} +1 -1
  200. package/dist/tools/web-tool.d.ts.map +1 -0
  201. package/dist/{web-tool.js → tools/web-tool.js} +8 -7
  202. package/dist/tools/web-tool.js.map +1 -0
  203. package/dist/tui/flow-colors.d.ts +55 -0
  204. package/dist/tui/flow-colors.d.ts.map +1 -0
  205. package/dist/tui/flow-colors.js +22 -0
  206. package/dist/tui/flow-colors.js.map +1 -0
  207. package/dist/{render-utils.d.ts → tui/render-utils.d.ts} +6 -2
  208. package/dist/tui/render-utils.d.ts.map +1 -0
  209. package/dist/{render-utils.js → tui/render-utils.js} +40 -12
  210. package/dist/tui/render-utils.js.map +1 -0
  211. package/dist/tui/render.d.ts +21 -0
  212. package/dist/tui/render.d.ts.map +1 -0
  213. package/dist/tui/render.js +786 -0
  214. package/dist/tui/render.js.map +1 -0
  215. package/dist/tui/scramble/algorithm.d.ts +7 -0
  216. package/dist/tui/scramble/algorithm.d.ts.map +1 -0
  217. package/dist/tui/scramble/algorithm.js +227 -0
  218. package/dist/tui/scramble/algorithm.js.map +1 -0
  219. package/dist/tui/scramble/constants.d.ts +99 -0
  220. package/dist/tui/scramble/constants.d.ts.map +1 -0
  221. package/dist/tui/scramble/constants.js +101 -0
  222. package/dist/tui/scramble/constants.js.map +1 -0
  223. package/dist/tui/scramble/index.d.ts +6 -0
  224. package/dist/tui/scramble/index.d.ts.map +1 -0
  225. package/dist/tui/scramble/index.js +6 -0
  226. package/dist/tui/scramble/index.js.map +1 -0
  227. package/dist/tui/scramble/manager.d.ts +44 -0
  228. package/dist/tui/scramble/manager.d.ts.map +1 -0
  229. package/dist/tui/scramble/manager.js +899 -0
  230. package/dist/tui/scramble/manager.js.map +1 -0
  231. package/dist/tui/scramble/utils.d.ts +18 -0
  232. package/dist/tui/scramble/utils.d.ts.map +1 -0
  233. package/dist/tui/scramble/utils.js +145 -0
  234. package/dist/tui/scramble/utils.js.map +1 -0
  235. package/dist/tui/single-select-layout.d.ts +17 -0
  236. package/dist/tui/single-select-layout.d.ts.map +1 -0
  237. package/dist/{single-select-layout.js → tui/single-select-layout.js} +8 -25
  238. package/dist/tui/single-select-layout.js.map +1 -0
  239. package/dist/types/flow.d.ts +112 -0
  240. package/dist/types/flow.d.ts.map +1 -0
  241. package/dist/{types.js → types/flow.js} +3 -54
  242. package/dist/types/flow.js.map +1 -0
  243. package/dist/types/index.d.ts +8 -0
  244. package/dist/types/index.d.ts.map +1 -0
  245. package/dist/types/index.js +7 -0
  246. package/dist/types/index.js.map +1 -0
  247. package/dist/types/output.d.ts +110 -0
  248. package/dist/types/output.d.ts.map +1 -0
  249. package/dist/types/output.js +5 -0
  250. package/dist/types/output.js.map +1 -0
  251. package/dist/types/ui.d.ts +24 -0
  252. package/dist/types/ui.d.ts.map +1 -0
  253. package/dist/types/ui.js +55 -0
  254. package/dist/types/ui.js.map +1 -0
  255. package/package.json +1 -1
  256. package/dist/agents.d.ts.map +0 -1
  257. package/dist/agents.js.map +0 -1
  258. package/dist/ask-user.d.ts.map +0 -1
  259. package/dist/ask-user.js +0 -1405
  260. package/dist/ask-user.js.map +0 -1
  261. package/dist/batch.d.ts +0 -12
  262. package/dist/batch.d.ts.map +0 -1
  263. package/dist/batch.js +0 -11
  264. package/dist/batch.js.map +0 -1
  265. package/dist/cli-args.d.ts.map +0 -1
  266. package/dist/cli-args.js.map +0 -1
  267. package/dist/config.d.ts.map +0 -1
  268. package/dist/config.js.map +0 -1
  269. package/dist/depth.d.ts.map +0 -1
  270. package/dist/depth.js.map +0 -1
  271. package/dist/executor.d.ts.map +0 -1
  272. package/dist/executor.js.map +0 -1
  273. package/dist/flow-prompt.d.ts.map +0 -1
  274. package/dist/flow-prompt.js.map +0 -1
  275. package/dist/flow.d.ts.map +0 -1
  276. package/dist/flow.js.map +0 -1
  277. package/dist/notify-state.d.ts.map +0 -1
  278. package/dist/notify-state.js.map +0 -1
  279. package/dist/notify.d.ts.map +0 -1
  280. package/dist/notify.js.map +0 -1
  281. package/dist/reasoning-strip.d.ts.map +0 -1
  282. package/dist/reasoning-strip.js.map +0 -1
  283. package/dist/render-utils.d.ts.map +0 -1
  284. package/dist/render-utils.js.map +0 -1
  285. package/dist/render.d.ts +0 -24
  286. package/dist/render.d.ts.map +0 -1
  287. package/dist/render.js +0 -592
  288. package/dist/render.js.map +0 -1
  289. package/dist/runner-events.d.ts.map +0 -1
  290. package/dist/runner-events.js.map +0 -1
  291. package/dist/scramble.d.ts +0 -183
  292. package/dist/scramble.d.ts.map +0 -1
  293. package/dist/scramble.js +0 -2478
  294. package/dist/scramble.js.map +0 -1
  295. package/dist/session-mode.d.ts.map +0 -1
  296. package/dist/session-mode.js.map +0 -1
  297. package/dist/settings-resolver.d.ts.map +0 -1
  298. package/dist/settings-resolver.js +0 -148
  299. package/dist/settings-resolver.js.map +0 -1
  300. package/dist/single-select-layout.d.ts +0 -20
  301. package/dist/single-select-layout.d.ts.map +0 -1
  302. package/dist/single-select-layout.js.map +0 -1
  303. package/dist/sliding-prompt.d.ts.map +0 -1
  304. package/dist/sliding-prompt.js.map +0 -1
  305. package/dist/snapshot.d.ts.map +0 -1
  306. package/dist/snapshot.js +0 -797
  307. package/dist/snapshot.js.map +0 -1
  308. package/dist/spec-mode.d.ts +0 -13
  309. package/dist/spec-mode.d.ts.map +0 -1
  310. package/dist/spec-mode.js +0 -90
  311. package/dist/spec-mode.js.map +0 -1
  312. package/dist/structured-output.d.ts.map +0 -1
  313. package/dist/structured-output.js.map +0 -1
  314. package/dist/timed-bash.d.ts.map +0 -1
  315. package/dist/timed-bash.js.map +0 -1
  316. package/dist/tool-utils.d.ts.map +0 -1
  317. package/dist/tool-utils.js.map +0 -1
  318. package/dist/transitions.d.ts.map +0 -1
  319. package/dist/transitions.js.map +0 -1
  320. package/dist/types.d.ts +0 -224
  321. package/dist/types.d.ts.map +0 -1
  322. package/dist/types.js.map +0 -1
  323. package/dist/web-tool.d.ts.map +0 -1
  324. package/dist/web-tool.js.map +0 -1
  325. /package/dist/{agents.d.ts → core/agents.d.ts} +0 -0
  326. /package/dist/{depth.d.ts → core/depth.d.ts} +0 -0
  327. /package/dist/{transitions.d.ts → core/transitions.d.ts} +0 -0
  328. /package/dist/{notify-state.js → notify/notify-state.js} +0 -0
  329. /package/dist/{notify.d.ts → notify/notify.d.ts} +0 -0
  330. /package/dist/{runner-events.d.ts → snapshot/runner-events.d.ts} +0 -0
  331. /package/dist/{structured-output.js → snapshot/structured-output.js} +0 -0
package/README.md CHANGED
@@ -42,31 +42,45 @@ pi install .
42
42
 
43
43
  ## Features
44
44
 
45
+ ### Flow System
45
46
  - **Flow-state delegation** — six bundled specialist flows (`scout`, `debug`, `build`, `craft`, `audit`, `ideas`) plus custom flows via Markdown front-matter
46
47
  - **Isolated forked context** — each flow runs as an isolated `pi` child process with a session snapshot (or clean slate when configured)
47
48
  - **Parallel execution** — batch independent flows into one call with bounded concurrency
48
- - **Structured reports** every flow returns structured output with `summary`, `files`, `actions`, `commands`, `notDone`, `nextSteps`, `reasoning`, and `notes`; optional JSON schema for machine-readable results
49
- - **Mechanically enriched commands** — bash commands in structured output are replaced with exact verbatim tool-call strings and annotated with `executionTime`
50
- - **Depth guards** — configurable max delegation depth (default: `3`)
49
+ - **Depth guards & cycle prevention** configurable max delegation depth (default: `3`) and automatic blocking of re-entering ancestor flows
50
+ - **Post-flow advisories** — built-in transition matrix suggesting optimal next flows (e.g. `scout` `build`, `debug` `build`)
51
51
  - **Session timeout modes** — child flows use controlled budgets: `fast` (300s), `default` (600s), `long` (900s), or `extreme_long` (1200s)
52
52
  - **Two-stage timeout awareness** — flows receive deadline hints in their prompt; the parent UI shows live countdowns and injects warning reminders before hard kill
53
53
  - **Graceful shutdown** — parent `SIGINT`/`SIGTERM` propagates to all child process groups; orphaned sub-agents are force-killed after a grace period
54
- - **Cycle prevention** — blocks re-entering flows already in the ancestor stack
55
54
  - **Model tiering & failover** — flows map to `lite` / `flash` / `full` tiers with primary + failover model chains
56
55
  - **Persistent flow mode** — switch global model strategies with `--flow-mode`; written to `settings.json` and remembered across sessions
57
- - **Flow-mode notification** — concise (`mode: name | lite: model - flash: model - full: model`) or verbose (with per-tier flow-name labels) startup message
56
+
57
+ ### Tools
58
58
  - **Unified batch tools** — `batch` (read/write/edit/delete) and `batch_read` replace separate file tools for cross-cutting work
59
59
  - **Web tool** — built-in `web` search (Brave + DuckDuckGo) and page fetch with HTML→Markdown conversion
60
- - **Steering hint** — lightweight routing reminder dynamically injected before each user message (never part of the static system prompt); switches between spec-driven planning and implement modes based on the `/spec` toggle, stripped from child snapshots to avoid duplication
61
- - **Session snapshot sanitization** — removes steering hints, reasoning/thinking artifacts, and non-inheritable content before forking; compresses prior flow results into compact context maps
62
- - **Shared context inheritance** — child flows receive the parent's sanitized session automatically; write forward-looking intents and let the child pick up context from its inherited snapshot
63
- - **Project flow confirmation** — prompts before running project-local flows from `.pi/agents/` for security
64
- - **Rich TUI rendering** — collapsed activity-panel view with per-flow stats, live countdowns, scramble-animated act/msg/tps lines, and expanded view with full reports and tool traces
60
+ - **Ask-user prompts** — interactive `ask_user` with overlay/inline display, preferred-choice guidance, comments, and optional timeouts
61
+ - **Structured reports** — every flow returns structured output with `summary`, `files`, `actions`, `commands`, `notDone`, `nextSteps`, `reasoning`, and `notes`; optional JSON schema for machine-readable results
62
+ - **Mechanically enriched commands** — bash commands in structured output are replaced with exact verbatim tool-call strings and annotated with `executionTime`
63
+
64
+ ### TUI & Rendering
65
+ - **Rich activity panel** — collapsed view with per-flow stats, live countdowns, and expanded view with full reports and tool traces
66
+ - **Glitch scramble animations** — `glitch` text animation on act, msg, TPS lines, and tool results
65
67
  - **Smooth streaming metrics** — token counters and smoothed TPS increment tick-by-tick during active streaming
66
- - **Quad-mode TUI scramble** — `stream`, `cascade`, `ripple`, and `illuminate` text animations on act, msg, TPS lines, and tool results (batch, web, ask_user) in the collapsed activity panel (default: `illuminate`)
67
- - **`/spec` command** — toggle spec-driven planning mode that guides the orchestrator through investigate → discuss → plan → delegate
68
68
  - **Dynamic notifications** — terminal and desktop alerts adapt their title/body based on flow completion state or pending `ask_user` decisions
69
- - **Preferred-choice guidance** — `ask_user` prompts can mark a recommended option with `[preferred]` and place it first
69
+
70
+ ### Developer Experience
71
+ - **Local development loop** — `npm link` local checkout for instant iteration; `scripts/switch.sh` toggles between local and published builds
72
+ - **Payload dump workflow** — capture exact child-flow prompts via `PI_FLOW_DUMP_SNAPSHOT` or `--dump`; sync to repo with `scripts/sync-dumps.sh`
73
+ - **Steering hint** — lightweight routing reminder dynamically injected before each user message; stripped from child snapshots to avoid duplication
74
+ - **Session snapshot sanitization** — removes steering hints, reasoning artifacts, and non-inheritable content before forking; compresses prior flow results into compact context maps
75
+ - **Shared context inheritance** — child flows receive the parent's sanitized session automatically; write forward-looking intents and let the child pick up context from its inherited snapshot
76
+ - **Project flow confirmation** — prompts before running project-local flows from `.pi/agents/` for security
77
+ - **TUI-safe logging** — `logWarn`/`logError` routes to a log file instead of stderr during TUI rendering to prevent on-screen text flash
78
+
79
+ ### Configuration
80
+ - **Flow model strategies** — define tiered model chains (`lite` / `flash` / `full`) with `flowModelConfigs`; switch modes via `--flow-mode` (performance / balance / quality)
81
+ - **Flow settings** — persistent runtime defaults under `flowSettings` (session mode, concurrency, tool optimization, structured output)
82
+ - **CLI flags** — `--flow-max-depth`, `--flow-session-mode`, `--flow-max-concurrency`, `--no-steering`, `--no-animation`, and more
83
+ - **Environment variables** — `PI_FLOW_DUMP_SNAPSHOT`, `PI_FLOW_MAX_DEPTH`, `PI_FLOW_TOOL_OPTIMIZE`, `PI_TUI_MODE`, and others
70
84
 
71
85
  ---
72
86
 
@@ -173,27 +187,6 @@ Flows are aware of their deadline from the moment they start:
173
187
 
174
188
  ---
175
189
 
176
- ## `/spec` Command
177
-
178
- Toggle spec-driven planning mode with the `/spec` command. When active, the steering hint instructs the orchestrator to follow a four-phase workflow:
179
-
180
- 1. **Investigate** — read package files, tests, and config directly; delegate broad discovery to `[scout]`
181
- 2. **Discuss** — ask 2–3 targeted, evidence-based questions via `ask_user`, marking the recommended choice with `[preferred]`
182
- 3. **Recommend Exit** — prompt the user to type `/spec` when ready to proceed; do not initiate builds yourself
183
- 4. **Synthesize** — on `/spec` deactivation, a plan is auto-generated from the conversation and placed in the editor for review
184
-
185
- Run `/spec` with a prompt to activate immediately and start investigating:
186
-
187
- ```bash
188
- /spec Add a REST API endpoint for user preferences
189
- ```
190
-
191
- Run `/spec` without arguments to toggle the mode on or off. When off, the orchestrator uses the standard implement-mode behavior: investigate first, then delegate directly to flows.
192
-
193
- When you deactivate spec mode, a new session is created and the orchestrator synthesizes a full implementation plan from the conversation history, placing it in the editor for review.
194
-
195
- ---
196
-
197
190
  ## Flow Definitions
198
191
 
199
192
  Create `.md` files in `~/.pi/agent/agents/` (user-level) or `.pi/agents/` (project-level):
@@ -502,10 +495,13 @@ per-flow sessionMode > --flow-session-mode > PI_FLOW_SESSION_MODE > flowSettings
502
495
  | `PI_FLOW_REMINDER_FILE` | Path to a file the parent writes warning messages into; the timed-bash wrapper reads it before each tool call |
503
496
  | `PI_FLOW_DEBUG_CONTEXT` | Set to `1` to emit context-compression telemetry to stderr |
504
497
  | `PI_OFFLINE` | Always set to `1` for child flow processes |
498
+ | `PI_FLOW_NO_STEERING` | Set to `1` to disable orchestrator steering hint injection |
505
499
  | `PI_FLOW_NO_STRATEGIC_HINT` | Set to `1` to suppress the strategic planning hints appended after tool calls |
506
- | `PI_ASK_USER_DISPLAY_MODE` | Default display mode for `ask_user`: `overlay` or `inline` |
507
- | `PI_ASK_USER_OVERLAY_TOGGLE_KEY` | Default shortcut for hiding/showing the overlay popup (e.g. `alt+o`) |
508
- | `PI_ASK_USER_COMMENT_TOGGLE_KEY` | Default shortcut for toggling the comment row (e.g. `ctrl+g`) |
500
+ | `PI_FLOW_NO_ANIMATION` | Set to `1` to disable all flow animation (instant render) |
501
+ | `PI_FLOW_NO_GLITCH` | Set to `1` to disable glitch/scramble effect |
502
+ | `PI_FLOW_LOG_FILE` | TUI-safe log file path (default: `$TMPDIR/pi-agent-flow.log`; set to `/dev/null` to suppress) |
503
+ | `PI_FLOW_DUMP_MAX_AGE_HOURS` | Max age of dump files before auto-cleanup deletes them (default: `168` = 7 days) |
504
+ | `PI_FLOW_SKIP_STRUCTURED_DIRECTIVE` | Set to `1` to skip structured output directive if a provider rejects that prompt shape |
509
505
 
510
506
  ### Notifications
511
507
 
package/agents/audit.md CHANGED
@@ -1,30 +1,29 @@
1
1
  ---
2
2
  name: audit
3
- description: Audit security, quality, correctness, and apply fixes
4
- tools: batch, bash, find, grep, ls, web
3
+ description: Audit security quality correctness and apply fixes
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: flash
7
7
  ---
8
8
 
9
- ## Mission
9
+ mission: During this audit flow your mission is to verify and remediate quality security and correctness issues. Be adversarial look for what others miss fix safe issues directly and treat the conversation history above as background reference only.
10
10
 
11
- During this audit flow — your mission is to verify and remediate quality, security, and correctness issues. Be adversarial, look for what others miss, fix safe issues directly, and treat the conversation history above as background reference only.
12
-
13
- ## Workflow
14
-
15
- 1. Scope identify the files, behavior, or change set to audit.
16
- 2. Inspect — review security, correctness, maintainability, and performance risks. Use `batch` with `o: "read"`, `s: <offset>`, and `l: <limit>` for targeted file reading instead of bash `sed`/`head`/`tail`.
17
- 3. Classify assign severity and explain the impact of each issue found.
18
- 4. Fix — apply safe, localized fixes directly with available tools.
19
- 5. Verify — run relevant tests or checks after fixes when practical.
20
- 6. Report — distinguish fixed issues from remaining risks.
21
-
22
- ## Rules
23
-
24
- - Be specific: cite exact file paths and line numbers.
25
- - If code is clean, say so; do not invent issues.
26
- - Fix issues autonomously when the fix is safe and localized.
27
- - Do not apply risky rewrites or broad redesigns from audit; flag them with severity instead.
28
- - If a fix requires broader redesign, recommend [craft] in [Next Steps].
29
- - If root cause is unclear, recommend [debug] rather than guessing.
11
+ workflow:
12
+ 1 Scope: identify the files behavior or change set to audit
13
+ 2 Inspect: review security correctness maintainability and performance risks use batch with o read s offset l limit for targeted file reading instead of bash sed head tail
14
+ 3 Classify: assign severity and explain the impact of each issue found
15
+ 4 Fix: apply safe localized fixes directly with available tools
16
+ 5 Verify: run relevant tests or checks after fixes when practical
17
+ 6 Report: distinguish fixed issues from remaining risks
30
18
 
19
+ rules:
20
+ Be specific cite exact file paths and line numbers
21
+ If code is clean say so do not invent issues
22
+ Fix issues autonomously when the fix is safe and localized
23
+ Do not apply risky rewrites or broad redesigns from audit flag them with severity instead
24
+ If a fix requires broader redesign recommend craft in next steps
25
+ If root cause is unclear recommend debug rather than guessing
26
+ Markers: Prefix substantive claims with [V] verified, [I] inferred, [A] assumed, or [U] unknown.
27
+ Bite-first: Output raw evidence (code, paths, logs) before any prose explanation.
28
+ No preamble: Start immediately with evidence or action. Skip all conversational filler.
29
+ See _conventions for tmp scripts and batch reads
package/agents/build.md CHANGED
@@ -1,30 +1,31 @@
1
1
  ---
2
2
  name: build
3
- description: Implement features, fix bugs, write tests, deploy, and ship
4
- tools: batch, bash, find, grep, ls, web
3
+ description: Implement features fix bugs write tests deploy and ship
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: flash
7
7
  ---
8
8
 
9
- ## Mission
9
+ mission: Implement and verify changes. Verify first then ship. Prior conversation is background reference only.
10
10
 
11
- Implement and verify changes. Verify first, then ship. Prior conversation is background reference only.
11
+ workflow:
12
+ 1 Analyze: read existing code for context
13
+ 2 Plan: outline approach before modifying
14
+ 3 Test: write or identify a failing test when practical
15
+ 4 Execute: implement changes following core principles
16
+ 5 Verify: run tests and checks refactor only if working
17
+ 6 Ship: commit push monitor CI fix failures until green
18
+ 7 Cleanup: delete old branch local and remote if requested otherwise leave the branch for the user to merge
12
19
 
13
- ## Workflow
14
-
15
- 1. Analyze read existing code for context.
16
- 2. Plan outline approach before modifying.
17
- 3. Test write or identify a failing test when practical.
18
- 4. Execute implement changes following core principles.
19
- 5. Verify run tests and checks; refactor only if working.
20
- 6. Ship commit, push, monitor CI/CD; fix failures until green.
21
- 7. Cleanup delete old branch (local + remote) if requested. Otherwise leave the branch for the user to merge.
22
-
23
- ## Rules
24
-
25
- - Follow SOLID, DRY, KISS.
26
- - Run `git branch --show-current` before making changes.
27
- - Commit with conventional messages: `feat:`, `fix:`, `refactor:`.
28
- - Do not merge to `main` unless the user explicitly requests it. If merging, use squash-merge (`git merge --squash`).
29
- - Update relevant docs; if none changed, state why.
30
- - Unexpected errors → recommend [debug], don't guess.
20
+ rules:
21
+ Follow SOLID (Single Responsibility Open Closed Liskov Substitution Interface Segregation Dependency Inversion) DRY (Do Not Repeat Yourself) KISS (Keep It Simple Stupid) TDD (Test Driven Development)
22
+ Run git branch show current before making changes
23
+ Commit with conventional messages feat fix refactor
24
+ Do not merge to main unless the user explicitly requests it
25
+ If merging use squash merge
26
+ Update relevant docs if none changed, state why
27
+ Unexpected errors recommend debug do not guess
28
+ Markers: Prefix substantive claims with [V] verified, [I] inferred, [A] assumed, or [U] unknown.
29
+ Bite-first: Output raw evidence (code, paths, logs) before any prose explanation.
30
+ No preamble: Start immediately with evidence or action. Skip all conversational filler.
31
+ See _conventions for tmp scripts and batch reads
package/agents/craft.md CHANGED
@@ -1,33 +1,29 @@
1
1
  ---
2
2
  name: craft
3
- description: Plan structure, break down requirements, design solutions
4
- tools: batch, bash, find, grep, ls, web
3
+ description: Plan structure break down requirements design solutions
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: full
7
7
  ---
8
8
 
9
- ## Mission
10
-
11
- During this craft flow — your mission is to design a clear, well-structured plan for implementation. Think architecturally: evaluate the full landscape, design for clean migration, and treat the conversation history above as background reference only.
12
-
13
- ## Workflow
14
-
15
- 1. Understand define the problem, constraints, existing behavior, and success criteria.
16
- 2. Explore map relevant patterns, dependencies, and existing architecture. Use `batch` with `o: "read"`, `s: <offset>`, and `l: <limit>` for targeted file reading instead of bash `sed`/`head`/`tail`.
17
- 3. Evaluate — assess whether the change fits existing patterns or requires a clean migration. Prefer incremental improvement when safe; endorse full-cut redesign when the architecture demands it.
18
- 4. Design — produce a concrete plan with ordered tasks, data flow, module boundaries, and interface contracts.
19
- 5. Review check risks, edge cases, test strategy, migration path, and handoff to build.
20
-
21
- ## Rules
22
-
23
- - Follow SOLID, DRY, and KISS.
24
- - Design for 10x, build for 1x.
25
- - Prefer explicit assumptions and constraints over hidden decisions — state what you assume and why.
26
- - When redesigning, preserve data integrity and migration paths; never orphan existing consumers.
27
- - Favor clean migration: if a redesign is warranted, cut fully rather than leaving half-measures.
28
- - Document trade-offs explicitly when the optimal path is unclear.
29
- - Do not implement changes from this flow unless explicitly requested.
30
-
31
- ## Note
32
-
33
- This flow operates in design mode — produce plans and specifications, not implementations. When a clean-slate redesign is warranted by the requirements, embrace it fully: define the target architecture, migration steps, and rollback strategy. When incremental change suffices, prefer it. The key principle is intentional design over accidental complexity.
9
+ mission: During this craft flow your mission is to design a clear well structured plan for implementation. Think architecturally evaluate the full landscape design for clean migration and treat the conversation history above as background reference only.
10
+
11
+ workflow:
12
+ 1 Understand: define the problem constraints existing behavior and success criteria
13
+ 2 Explore: map relevant patterns dependencies and existing architecture use batch with o read s offset l limit for targeted file reading instead of bash sed head tail
14
+ 3 Evaluate: assess whether the change fits existing patterns or requires a clean migration prefer incremental improvement when safe endorse full cut redesign when the architecture demands it
15
+ 4 Design: produce a concrete plan with ordered tasks data flow module boundaries and interface contracts
16
+ 5 Review: check risks edge cases test strategy migration path and handoff to build
17
+
18
+ rules:
19
+ Follow SOLID (Single Responsibility Open Closed Liskov Substitution Interface Segregation Dependency Inversion) DRY (Do Not Repeat Yourself) KISS (Keep It Simple Stupid)
20
+ Design for ten x build for one x
21
+ Prefer explicit assumptions and constraints over hidden decisions state what you assume and why
22
+ When redesigning preserve data integrity and migration paths never orphan existing consumers
23
+ Favor clean migration if a redesign is warranted cut fully rather than leaving half measures
24
+ Document trade offs explicitly when the optimal path is unclear
25
+ Do not implement changes from this flow unless explicitly requested
26
+ Markers: Prefix substantive claims with [V] verified, [I] inferred, [A] assumed, or [U] unknown.
27
+ Bite-first: Output raw evidence (code, paths, logs) before any prose explanation.
28
+ No preamble: Start immediately with evidence or action. Skip all conversational filler.
29
+ See _conventions for tmp scripts and batch reads
package/agents/debug.md CHANGED
@@ -1,34 +1,30 @@
1
1
  ---
2
2
  name: debug
3
- description: Investigate logs, errors, stack traces, root causes, and fix bugs
4
- tools: batch, bash, find, grep, ls, web
3
+ description: Hypothesis driven root cause analysis minimal instrumentation targeted fix verify
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: lite
7
7
  ---
8
8
 
9
- ## Mission
10
-
11
- During this debug flow — your mission is to investigate root cause. Be forensic: every claim must be backed by evidence, and treat the conversation history above as background reference only.
12
-
13
- ## Workflow
14
-
15
- 1. Collect evidence logs, error messages, stack traces, failing tests, and reproduction steps.
16
- 2. Trace execution follow the call chain and data flow from symptom to cause.
17
- 3. Check changes inspect recent diffs, configuration, dependencies, and environment differences.
18
- 4. Identify root cause state exactly what is broken and why.
19
- 5. Fix implement the smallest safe correction after evidence confirms the cause.
20
- 6. Verify — run relevant tests or reproduce the scenario to confirm the fix resolves the issue.
21
- 7. Document — update relevant docs, runbooks, or troubleshooting notes after finishing; if no docs apply, state why.
22
- 8. Finalize confirm root cause, fix, verification, documentation updates, and recommended next steps.
23
-
24
- ## Rules
25
-
26
- - Never guess; every conclusion must cite evidence.
27
- - Read logs and symptoms before reading broad code areas.
28
- - Use `batch` with `o: "read"`, `s: <offset>`, and `l: <limit>` for targeted file reading instead of bash `sed`/`head`/`tail`.
29
- - Do not suggest fixes until root cause is confirmed.
30
- - Implement fixes only after root cause is confirmed.
31
- - Run tests or reproduction steps after fixing.
32
- - Documentation-only updates are required after finishing the work when relevant and safe; if no docs changed, explain why in the final report.
33
-
34
-
9
+ mission: Find why the bug happens not the first plausible story prove it with runtime or test evidence apply the smallest safe fix verify then clean up. Treat conversation history as background only.
10
+
11
+ workflow:
12
+ 1 Reproduce: nail exact steps inputs env and expected vs actual if you cannot reproduce say what is missing
13
+ 2 Hypothesize: list three to five concrete causes subsystem branch timing data shape each must be falsifiable
14
+ 3 Instrument: add minimal temporary logs or probes so one run can support or reject several hypotheses in parallel tag each log with hypothesisId prefer existing test hooks or stderr over noisy prints
15
+ 4 Run once: clear prior logs if applicable reproduce read the evidence before editing logic
16
+ 5 Conclude: for each hypothesis state CONFIRMED REJECTED or INCONCLUSIVE with cited lines log stack trace assertion
17
+ 6 Fix: only after a hypothesis is confirmed by evidence no speculative guards revert any change tied to a rejected hypothesis
18
+ 7 Verify: same repro plus tests compare before and after evidence no sleep or polling hacks as fixes unless the product contract truly requires delay
19
+ 8 Finalize: remove temporary instrumentation after verification or when orchestrator confirms if applicable update relevant docs, runbooks, or troubleshooting notes after finishing Documentation-only updates are required after finishing the work
20
+
21
+ rules:
22
+ Evidence before edits read errors failing tests and traces before wide code reads
23
+ Targeted reads use batch with o read s and l avoid bash sed head tail for source
24
+ No fix without proof do not ship guesses if blocked report what evidence is still missing
25
+ Keep instrumentation through verification do not strip logs until the post fix run proves the fix or the user confirms
26
+ State missing evidence or environment gaps do not invent a fix
27
+ Markers: Prefix substantive claims with [V] verified, [I] inferred, [A] assumed, or [U] unknown.
28
+ Bite-first: Output raw evidence (code, paths, logs) before any prose explanation.
29
+ No preamble: Start immediately with evidence or action. Skip all conversational filler.
30
+ See _conventions for tmp scripts and batch reads
package/agents/ideas.md CHANGED
@@ -1,107 +1,27 @@
1
1
  ---
2
2
  name: ideas
3
- description: Generate ideas, explore possibilities, and think creatively using inherited context as background
4
- tools: batch, bash, web
3
+ description: Generate ideas explore possibilities think creatively using inherited context as background
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: full
7
7
  ---
8
8
 
9
- ## Mission
10
-
11
- During this ideas flow — your mission is to generate and compare possible directions. Use inherited context as background and constraints, but avoid anchoring too tightly on prior solutions.
12
-
13
- ## Workflow
14
-
15
- 1. Diverge explore many possibilities without judging too early.
16
- 2. Evaluate — compare trade-offs, risks, effort, and reversibility.
17
- 3. Recommend — identify the strongest options and explain why.
18
- 4. Package present choices clearly enough for planning or implementation handoff.
19
-
20
- ## Rules
21
-
22
- - Stay focused on the requested intent; creativity should still serve the objective.
23
- - Prefer several distinct options over variations of the same idea.
24
- - Make assumptions explicit when evidence is limited.
25
- - If file context is needed, use `batch` with `o: "read"`, `s: <offset>`, and `l: <limit>` for targeted reading instead of bash `sed`/`head`/`tail`.
26
- - Do not implement changes from this flow.
27
-
28
- ## Decision Gates
29
-
30
- When you encounter a choice that materially affects the recommendation, **do not decide unilaterally**. Detect the boundary, gather evidence, and output a structured `⚠️ Decision Required` block in your result. The **main agent** (not this sub-flow) will present it to the user via `ask_user`.
31
-
32
- Only emit a decision block for choices where the user's preference would **materially change** the direction.
33
-
34
- ### Triggers
35
-
36
- 1. **Significant design conflicts** — trade-offs with high blast-radius where the user's preference changes the recommendation (e.g., complexity vs. simplicity, coupling vs. isolation, build-vs-buy, monolith vs. services).
37
- 2. **Short-term vs. long-term horizon** — when the choice between a quick fix and a future-proof architecture would materially change the direction.
38
-
39
- ### Decision block format
40
-
41
- When you hit a trigger, gather evidence with available tools (`batch`, `bash`, `web`), then synthesize a neutral summary and emit this exact block inside your result:
42
-
43
- ```
44
- ⚠️ Decision Required: <one-line, focused question>
45
- Context:
46
- <3–7 bullet or short-paragraph summary of current state, constraints, trade-offs, and a recommendation if you have one>
47
- Options:
48
- 1. <title> — <short description>
49
- 2. <title> — <short description>
50
- [3–4. ...]
51
- ```
52
-
53
- Rules for the decision block:
54
- - One focused question only. Do not bundle multiple unrelated decisions.
55
- - Provide 2–4 distinct, labeled options with short descriptions when trade-offs are non-obvious.
56
- - Do not emit more than **one** decision block for the same boundary. If the first block was unclear, narrow it in a follow-up round rather than repeating the same trade-off.
57
- - After emitting the block, **stop** the current ideas round. Do not continue speculating past a confirmed ambiguity.
58
-
59
- ### Example decision blocks
60
-
61
- **Significant design conflict:**
62
-
63
- ```
64
- ⚠️ Decision Required: Which persistence strategy should we adopt for the shared state module?
65
- Context:
66
- • Current design has two viable paths.
67
- • In-memory: simplest implementation, fastest reads, no external dependency, but state is lost on restart and cannot be shared across instances.
68
- • Redis: survives restarts, supports horizontal scaling, adds infra complexity and network latency.
69
- • Recommendation: start in-memory and migrate to Redis only if multi-instance deployment becomes a real requirement.
70
- Options:
71
- 1. In-memory cache — Zero-dependency, fastest, not shared across instances
72
- 2. Redis-backed store — Scalable and durable, adds ops overhead
73
- ```
74
-
75
- **Short-term vs. long-term horizon:**
76
-
77
- ```
78
- ⚠️ Decision Required: Should we ship a minimal regex-based parser now or build a proper AST parser first?
79
- Context:
80
- • The user wants config-file validation.
81
- • Regex parser: can be done in ~1 day, covers 90% of cases, brittle on nested structures.
82
- • AST parser: takes ~3 days, handles all edge cases, enables future linting and auto-fix.
83
- • The config format is still evolving; a brittle parser may need a full rewrite in two weeks.
84
- Options:
85
- 1. Ship regex parser now — Fastest path, accept rewrite risk if format changes
86
- 2. Build AST parser first — Future-proof, higher upfront cost
87
- ```
88
-
89
- ## Anti-overasking guardrails
90
-
91
- Apply a strict decision-block budget per boundary:
92
-
93
- - **Max 1** decision block per decision boundary in normal cases.
94
- - **Max 2** decision blocks for the same boundary when the first was unclear.
95
- - Never repeat the same trade-off without new evidence.
96
-
97
- Escalation ladder:
98
-
99
- 1. **Attempt 1:** structured options + concise context (examples above).
100
- 2. **Attempt 2 (only if needed):** narrower question with your explicit recommendation:
101
- - `Proceed with recommended option`
102
- - `Choose another option` (triggers freeform)
103
- - `Stop for now`
104
-
105
- After attempt 2:
106
- - If the boundary is a **significant design conflict** or **horizon choice**: **stop and mark blocked**. Do not continue emitting decision blocks.
107
- - If the boundary is **ambiguity-only** and the user says "your call" or equivalent: proceed with the most reversible default, state assumptions explicitly, and continue.
9
+ mission: During this ideas flow your mission is to generate and compare possible directions. Use inherited context as background and constraints but avoid anchoring too tightly on prior solutions.
10
+
11
+ workflow:
12
+ 1 Diverge: explore many possibilities without judging too early
13
+ 2 Evaluate: compare trade offs risks effort and reversibility
14
+ 3 Recommend: identify the strongest options and explain why
15
+ 4 Package: present choices clearly enough for planning or implementation handoff
16
+
17
+ rules:
18
+ Stay focused on the requested intent creativity should still serve the objective
19
+ Prefer several distinct options over variations of the same idea
20
+ Make assumptions explicit when evidence is limited
21
+ If file context is needed use batch with o read s offset l limit for targeted reading instead of bash sed head tail
22
+ Do not implement changes from this flow
23
+ Markers: Prefix substantive claims with [V] verified, [I] inferred, [A] assumed, or [U] unknown.
24
+ Bite-first: Output raw evidence (code, paths, logs) before any prose explanation.
25
+ No preamble: Start immediately with evidence or action. Skip all conversational filler.
26
+ See _conventions for batch reads and tmp scripts
27
+ See decision gates for material choices that require user preference
package/agents/scout.md CHANGED
@@ -1,27 +1,28 @@
1
1
  ---
2
2
  name: scout
3
- description: Discover files, trace code paths, map architecture
4
- tools: batch, bash, find, grep, ls, web
3
+ description: Discover files trace code paths map architecture
4
+ tools: batch bash find grep ls web
5
5
  maxDepth: 0
6
6
  tier: lite
7
7
  ---
8
8
 
9
- ## Mission
9
+ mission: During this scout flow your mission is to discover relevant context. Move fast stay surgical and treat the conversation history above as background reference only. This is a read oriented flow do not modify files.
10
10
 
11
- During this scout flow — your mission is to discover relevant context. Move fast, stay surgical, and treat the conversation history above as background reference only.
11
+ workflow:
12
+ 1 Survey: use ls find and grep to locate relevant files and symbols before reading whole files
13
+ 2 Inspect: use batch with o read s offset l limit for targeted file reading instead of bash sed head tail
14
+ 3 Trace: if batch returns a context map for a large file use the reported line ranges for targeted follow up reads then follow code paths dependencies configuration and tests that explain the requested area
15
+ 4 Report: cite concrete evidence with precise file paths and line ranges stop when the requested context is mapped
16
+ 5 Validate: cross-check evidence, verify inferences against source, mark gaps with [U], and confirm sufficiency.
12
17
 
13
- ## Workflow
14
-
15
- 1. Survey use `ls`, `find`, and `grep` to locate relevant files and symbols before reading whole files.
16
- 2. Inspect use `batch` with `o: "read"`, `s: <offset>`, and `l: <limit>` for targeted file reading instead of bash `sed`/`head`/`tail`.
17
- 3. If `batch` returns a context map for a large code/infra file, do not retry the full-file read; use the reported line ranges for targeted follow-up reads.
18
- 4. Trace follow code paths, dependencies, configuration, and tests that explain the requested area.
19
- 5. Report cite concrete evidence and stop when the requested context is mapped.
20
-
21
- ## Rules
22
-
23
- - This is a read-oriented flow: do not modify files.
24
- - Cite every finding with a precise file path and line number or range.
25
- - Include relevant snippets or evidence inline so citations are verifiable.
26
- - Show actual code/data, not excessive summaries.
27
- - If something is not found, say so directly — do not guess.
18
+ rules:
19
+ This is a read oriented flow do not modify files
20
+ Cite every finding with a precise file path and line number or range
21
+ Include relevant snippets or evidence inline so citations are verifiable
22
+ Show actual code or data not excessive summaries
23
+ If something is not found say so directly do not guess
24
+ Workflow: Scouts must complete 5 steps (Survey Inspect Trace Report Validate). Reject and resend if Validate is missing.
25
+ Snap mode: when session mode is snap, prioritize Survey and Inspect. Skip deep Trace. Emit partial findings fast — incomplete maps are acceptable.
26
+ Markers: Preserve exactly ([V] Verified, [I] Inferred, [A] Assumed, [U] Unknown). Never present [A] or [U] as facts to the user. Dispatch a validation scout if critical claims are [A]/[U].
27
+ Output: Zero preamble or filler. Start immediately with the answer or tool call.
28
+ See _conventions for batch reads and tmp scripts
@@ -1,5 +1,5 @@
1
1
  import { type BashOpResult, type PendingBashResult } from "./constants.js";
2
- export interface TrackedBashResult {
2
+ interface TrackedBashResult {
3
3
  id: string;
4
4
  command: string;
5
5
  status: "ok" | "error" | "aborted";
@@ -64,7 +64,6 @@ export declare function executeBatchBash(ops: Array<{
64
64
  }>, defaultCwd: string, tracker: BashProcessTracker, signal?: AbortSignal, softTimeoutMs?: number): Promise<BashOpResult[]>;
65
65
  /** Poll for completed bash results. */
66
66
  export declare function pollBatchBashResults(ids: string[], tracker: BashProcessTracker): PendingBashResult[];
67
- export declare const BatchBashPollParams: any;
68
67
  export declare function createBatchBashPollTool(tracker: BashProcessTracker): {
69
68
  name: string;
70
69
  label: string;
@@ -89,4 +88,5 @@ export declare function createBatchBashPollTool(tracker: BashProcessTracker): {
89
88
  isError: boolean;
90
89
  }>;
91
90
  };
91
+ export {};
92
92
  //# sourceMappingURL=batch-bash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch-bash.d.ts","sourceRoot":"","sources":["../../src/batch/batch-bash.ts"],"names":[],"mappings":"AAiBA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAKtB,MAAM,gBAAgB,CAAC;AAgBxB,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,SAAS,CAAwC;IAEzD,sFAAsF;IACtF,MAAM,CACL,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,WAAW,GAClB,IAAI;IAoFP,2CAA2C;IAC3C,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI9B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAOlC,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIjD,iFAAiF;IACj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