@selesai/code 0.6.3 → 0.8.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 (1056) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +5 -3
  3. package/dist/bun/cli.d.ts +0 -1
  4. package/dist/bun/cli.js +0 -1
  5. package/dist/bun/register-bedrock.d.ts +0 -1
  6. package/dist/bun/register-bedrock.js +0 -1
  7. package/dist/bun/restore-sandbox-env.d.ts +0 -1
  8. package/dist/bun/restore-sandbox-env.js +0 -1
  9. package/dist/cli/args.d.ts +0 -1
  10. package/dist/cli/args.js +0 -1
  11. package/dist/cli/config-selector.d.ts +0 -1
  12. package/dist/cli/config-selector.js +0 -1
  13. package/dist/cli/credential-print.d.ts +0 -1
  14. package/dist/cli/credential-print.js +0 -1
  15. package/dist/cli/file-processor.d.ts +0 -1
  16. package/dist/cli/file-processor.js +0 -1
  17. package/dist/cli/initial-message.d.ts +0 -1
  18. package/dist/cli/initial-message.js +0 -1
  19. package/dist/cli/list-models.d.ts +0 -1
  20. package/dist/cli/list-models.js +0 -1
  21. package/dist/cli/project-trust.d.ts +0 -1
  22. package/dist/cli/project-trust.js +0 -1
  23. package/dist/cli/session-picker.d.ts +0 -1
  24. package/dist/cli/session-picker.js +0 -1
  25. package/dist/cli/startup-ui.d.ts +0 -1
  26. package/dist/cli/startup-ui.js +0 -1
  27. package/dist/cli.d.ts +0 -1
  28. package/dist/cli.js +0 -1
  29. package/dist/config.d.ts +0 -1
  30. package/dist/config.js +0 -1
  31. package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
  32. package/dist/core/agent-session-auto-handoff.test.js +0 -1
  33. package/dist/core/agent-session-runtime.d.ts +0 -1
  34. package/dist/core/agent-session-runtime.js +0 -1
  35. package/dist/core/agent-session-services.d.ts +0 -1
  36. package/dist/core/agent-session-services.js +0 -1
  37. package/dist/core/agent-session-skill-block.test.d.ts +0 -1
  38. package/dist/core/agent-session-skill-block.test.js +0 -1
  39. package/dist/core/agent-session.d.ts +0 -1
  40. package/dist/core/agent-session.js +0 -1
  41. package/dist/core/agents.d.ts +0 -1
  42. package/dist/core/agents.js +0 -1
  43. package/dist/core/auth-guidance.d.ts +0 -1
  44. package/dist/core/auth-guidance.js +0 -1
  45. package/dist/core/auth-storage.d.ts +0 -1
  46. package/dist/core/auth-storage.js +0 -1
  47. package/dist/core/bash-executor.d.ts +0 -1
  48. package/dist/core/bash-executor.js +0 -1
  49. package/dist/core/built-in-extensions.d.ts +0 -1
  50. package/dist/core/built-in-extensions.js +0 -1
  51. package/dist/core/cache-stats.d.ts +0 -1
  52. package/dist/core/cache-stats.js +0 -1
  53. package/dist/core/compaction/branch-summarization.d.ts +0 -1
  54. package/dist/core/compaction/branch-summarization.js +0 -1
  55. package/dist/core/compaction/compaction.d.ts +0 -1
  56. package/dist/core/compaction/compaction.js +0 -1
  57. package/dist/core/compaction/index.d.ts +0 -1
  58. package/dist/core/compaction/index.js +0 -1
  59. package/dist/core/compaction/utils.d.ts +0 -1
  60. package/dist/core/compaction/utils.js +0 -1
  61. package/dist/core/defaults.d.ts +0 -1
  62. package/dist/core/defaults.js +0 -1
  63. package/dist/core/diagnostics.d.ts +0 -1
  64. package/dist/core/diagnostics.js +0 -1
  65. package/dist/core/event-bus.d.ts +0 -1
  66. package/dist/core/event-bus.js +0 -1
  67. package/dist/core/exec.d.ts +0 -1
  68. package/dist/core/exec.js +0 -1
  69. package/dist/core/experimental.d.ts +0 -1
  70. package/dist/core/experimental.js +0 -1
  71. package/dist/core/export-html/ansi-to-html.d.ts +0 -1
  72. package/dist/core/export-html/ansi-to-html.js +0 -1
  73. package/dist/core/export-html/index.d.ts +0 -1
  74. package/dist/core/export-html/index.js +0 -1
  75. package/dist/core/export-html/tool-renderer.d.ts +0 -1
  76. package/dist/core/export-html/tool-renderer.js +0 -1
  77. package/dist/core/extensions/index.d.ts +0 -1
  78. package/dist/core/extensions/index.js +0 -1
  79. package/dist/core/extensions/loader.d.ts +0 -1
  80. package/dist/core/extensions/loader.js +0 -1
  81. package/dist/core/extensions/runner.d.ts +0 -1
  82. package/dist/core/extensions/runner.js +0 -1
  83. package/dist/core/extensions/types.d.ts +0 -1
  84. package/dist/core/extensions/types.js +0 -1
  85. package/dist/core/extensions/wrapper.d.ts +0 -1
  86. package/dist/core/extensions/wrapper.js +0 -1
  87. package/dist/core/footer-data-provider.d.ts +0 -1
  88. package/dist/core/footer-data-provider.js +0 -1
  89. package/dist/core/git-command.d.ts +0 -1
  90. package/dist/core/git-command.js +0 -1
  91. package/dist/core/http-dispatcher.d.ts +0 -1
  92. package/dist/core/http-dispatcher.js +0 -1
  93. package/dist/core/index.d.ts +0 -1
  94. package/dist/core/index.js +0 -1
  95. package/dist/core/keybindings.d.ts +0 -1
  96. package/dist/core/keybindings.js +0 -1
  97. package/dist/core/llama/client.d.ts +0 -1
  98. package/dist/core/llama/client.js +0 -1
  99. package/dist/core/llama/huggingface.d.ts +0 -1
  100. package/dist/core/llama/huggingface.js +0 -1
  101. package/dist/core/llama/index.d.ts +0 -1
  102. package/dist/core/llama/index.js +0 -1
  103. package/dist/core/llama/provider.d.ts +0 -1
  104. package/dist/core/llama/provider.js +0 -1
  105. package/dist/core/llama/ui.d.ts +0 -1
  106. package/dist/core/llama/ui.js +0 -1
  107. package/dist/core/messages.d.ts +0 -1
  108. package/dist/core/messages.js +0 -1
  109. package/dist/core/model-config.d.ts +0 -1
  110. package/dist/core/model-config.js +0 -1
  111. package/dist/core/model-registry.d.ts +0 -1
  112. package/dist/core/model-registry.js +0 -1
  113. package/dist/core/model-resolver.d.ts +0 -1
  114. package/dist/core/model-resolver.js +0 -1
  115. package/dist/core/model-runtime.d.ts +0 -1
  116. package/dist/core/model-runtime.js +0 -1
  117. package/dist/core/models-store.d.ts +0 -1
  118. package/dist/core/models-store.js +0 -1
  119. package/dist/core/output-guard.d.ts +0 -1
  120. package/dist/core/output-guard.js +0 -1
  121. package/dist/core/package-manager.d.ts +0 -1
  122. package/dist/core/package-manager.js +0 -1
  123. package/dist/core/package-manager.test.d.ts +0 -1
  124. package/dist/core/package-manager.test.js +0 -1
  125. package/dist/core/project-trust.d.ts +0 -1
  126. package/dist/core/project-trust.js +0 -1
  127. package/dist/core/prompt-templates.d.ts +0 -1
  128. package/dist/core/prompt-templates.js +0 -1
  129. package/dist/core/provider-attribution.d.ts +0 -1
  130. package/dist/core/provider-attribution.js +0 -1
  131. package/dist/core/provider-composer.d.ts +0 -1
  132. package/dist/core/provider-composer.js +0 -1
  133. package/dist/core/radius.d.ts +0 -1
  134. package/dist/core/radius.js +0 -1
  135. package/dist/core/remote-catalog-provider.d.ts +0 -1
  136. package/dist/core/remote-catalog-provider.js +0 -1
  137. package/dist/core/resolve-config-value.d.ts +0 -1
  138. package/dist/core/resolve-config-value.js +0 -1
  139. package/dist/core/resource-loader.d.ts +0 -1
  140. package/dist/core/resource-loader.js +0 -1
  141. package/dist/core/runtime-credentials.d.ts +0 -1
  142. package/dist/core/runtime-credentials.js +0 -1
  143. package/dist/core/sdk.d.ts +0 -1
  144. package/dist/core/sdk.js +0 -1
  145. package/dist/core/session-cwd.d.ts +0 -1
  146. package/dist/core/session-cwd.js +0 -1
  147. package/dist/core/session-manager.d.ts +0 -1
  148. package/dist/core/session-manager.js +0 -1
  149. package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
  150. package/dist/core/settings-manager-auto-handoff.test.js +0 -1
  151. package/dist/core/settings-manager.d.ts +0 -4
  152. package/dist/core/settings-manager.js +0 -12
  153. package/dist/core/skills.d.ts +0 -1
  154. package/dist/core/skills.js +0 -1
  155. package/dist/core/slash-commands.d.ts +0 -1
  156. package/dist/core/slash-commands.js +0 -1
  157. package/dist/core/source-info.d.ts +0 -1
  158. package/dist/core/source-info.js +0 -1
  159. package/dist/core/system-prompt.d.ts +0 -1
  160. package/dist/core/system-prompt.js +0 -1
  161. package/dist/core/system-prompt.test.d.ts +0 -1
  162. package/dist/core/system-prompt.test.js +0 -1
  163. package/dist/core/telemetry.d.ts +0 -1
  164. package/dist/core/telemetry.js +0 -1
  165. package/dist/core/timings.d.ts +0 -1
  166. package/dist/core/timings.js +0 -1
  167. package/dist/core/tools/bash.d.ts +0 -1
  168. package/dist/core/tools/bash.js +0 -1
  169. package/dist/core/tools/edit-diff.d.ts +0 -1
  170. package/dist/core/tools/edit-diff.js +0 -1
  171. package/dist/core/tools/edit.d.ts +0 -1
  172. package/dist/core/tools/edit.js +0 -1
  173. package/dist/core/tools/file-mutation-queue.d.ts +0 -1
  174. package/dist/core/tools/file-mutation-queue.js +0 -1
  175. package/dist/core/tools/find.d.ts +0 -1
  176. package/dist/core/tools/find.js +0 -1
  177. package/dist/core/tools/grep.d.ts +0 -1
  178. package/dist/core/tools/grep.js +0 -1
  179. package/dist/core/tools/index.d.ts +0 -1
  180. package/dist/core/tools/index.js +0 -1
  181. package/dist/core/tools/ls.d.ts +0 -1
  182. package/dist/core/tools/ls.js +0 -1
  183. package/dist/core/tools/output-accumulator.d.ts +0 -1
  184. package/dist/core/tools/output-accumulator.js +0 -1
  185. package/dist/core/tools/path-utils.d.ts +0 -1
  186. package/dist/core/tools/path-utils.js +0 -1
  187. package/dist/core/tools/read.d.ts +0 -1
  188. package/dist/core/tools/read.js +0 -1
  189. package/dist/core/tools/render-utils.d.ts +0 -1
  190. package/dist/core/tools/render-utils.js +0 -1
  191. package/dist/core/tools/tool-definition-wrapper.d.ts +0 -1
  192. package/dist/core/tools/tool-definition-wrapper.js +0 -1
  193. package/dist/core/tools/truncate.d.ts +0 -1
  194. package/dist/core/tools/truncate.js +0 -1
  195. package/dist/core/tools/write.d.ts +0 -1
  196. package/dist/core/tools/write.js +0 -1
  197. package/dist/core/trust-manager.d.ts +0 -1
  198. package/dist/core/trust-manager.js +0 -1
  199. package/dist/core/usage-totals.d.ts +0 -1
  200. package/dist/core/usage-totals.js +0 -1
  201. package/dist/defaults/models.json +8 -0
  202. package/dist/defaults/settings.json +6 -7
  203. package/dist/extensions/agent-browser.test.ts +195 -0
  204. package/dist/extensions/agent-browser.ts +158 -0
  205. package/dist/extensions/inline-skills.test.ts +27 -13
  206. package/dist/extensions/inline-skills.ts +18 -11
  207. package/dist/extensions/package.json +2 -1
  208. package/dist/extensions/pi-powerline-footer/.github/workflows/test.yml +27 -0
  209. package/dist/extensions/pi-powerline-footer/CHANGELOG.md +153 -0
  210. package/dist/extensions/pi-powerline-footer/CONTRIBUTING.md +16 -0
  211. package/dist/extensions/pi-powerline-footer/README.md +192 -44
  212. package/dist/extensions/pi-powerline-footer/bash-mode/completion.ts +19 -4
  213. package/dist/extensions/pi-powerline-footer/bash-mode/editor.ts +80 -25
  214. package/dist/extensions/pi-powerline-footer/bash-mode/history.ts +81 -29
  215. package/dist/extensions/pi-powerline-footer/bash-mode/types.ts +1 -1
  216. package/dist/extensions/pi-powerline-footer/cd-command.ts +190 -0
  217. package/dist/extensions/pi-powerline-footer/colors.ts +2 -1
  218. package/dist/extensions/pi-powerline-footer/context-usage.ts +121 -6
  219. package/dist/extensions/pi-powerline-footer/currency-rates.ts +142 -0
  220. package/dist/extensions/pi-powerline-footer/editor-composition.ts +32 -0
  221. package/dist/extensions/pi-powerline-footer/git-status.ts +108 -6
  222. package/dist/extensions/pi-powerline-footer/icons.ts +11 -2
  223. package/dist/extensions/pi-powerline-footer/index.ts +1056 -324
  224. package/dist/extensions/pi-powerline-footer/lifecycle.ts +10 -0
  225. package/dist/extensions/pi-powerline-footer/package.json +10 -6
  226. package/dist/extensions/pi-powerline-footer/paths.ts +22 -0
  227. package/dist/extensions/pi-powerline-footer/powerline-config.ts +297 -15
  228. package/dist/extensions/pi-powerline-footer/presets.ts +6 -25
  229. package/dist/extensions/pi-powerline-footer/queue/store.ts +361 -0
  230. package/dist/extensions/pi-powerline-footer/queue/types.ts +54 -0
  231. package/dist/extensions/pi-powerline-footer/render-scheduler.ts +12 -7
  232. package/dist/extensions/pi-powerline-footer/segments.ts +114 -107
  233. package/dist/extensions/pi-powerline-footer/session-usage.ts +1 -1
  234. package/dist/extensions/pi-powerline-footer/shortcuts.ts +17 -3
  235. package/dist/extensions/pi-powerline-footer/tests/bash-mode.test.ts +189 -17
  236. package/dist/extensions/pi-powerline-footer/tests/cd-command.test.ts +144 -0
  237. package/dist/extensions/pi-powerline-footer/tests/context-usage.test.ts +120 -2
  238. package/dist/extensions/pi-powerline-footer/tests/custom-items.test.ts +245 -22
  239. package/dist/extensions/pi-powerline-footer/tests/editor-composition.test.ts +48 -0
  240. package/dist/extensions/pi-powerline-footer/tests/editor-responsiveness.test.ts +34 -0
  241. package/dist/extensions/pi-powerline-footer/tests/fixed-editor-border.test.ts +39 -0
  242. package/dist/extensions/pi-powerline-footer/tests/git-status.test.ts +92 -0
  243. package/dist/extensions/pi-powerline-footer/tests/guide.test.ts +4 -1
  244. package/dist/extensions/pi-powerline-footer/tests/jump-shortcuts.test.ts +33 -197
  245. package/dist/extensions/pi-powerline-footer/tests/mode-aware-trigger.test.ts +79 -0
  246. package/dist/extensions/pi-powerline-footer/tests/paths.test.ts +63 -0
  247. package/dist/extensions/pi-powerline-footer/tests/queue-store.test.ts +195 -0
  248. package/dist/extensions/pi-powerline-footer/tests/quit-cursor.test.ts +14 -0
  249. package/dist/extensions/pi-powerline-footer/tests/remaining-regressions.test.ts +167 -0
  250. package/dist/extensions/pi-powerline-footer/tests/stash-shortcut.test.ts +23 -18
  251. package/dist/extensions/pi-powerline-footer/tests/thinking-segment.test.ts +16 -1
  252. package/dist/extensions/pi-powerline-footer/tests/token-stats.test.ts +249 -0
  253. package/dist/extensions/pi-powerline-footer/tests/usage-display.test.ts +237 -0
  254. package/dist/extensions/pi-powerline-footer/tests/welcome.test.ts +199 -0
  255. package/dist/extensions/pi-powerline-footer/tests/working-vibes.test.ts +191 -100
  256. package/dist/extensions/pi-powerline-footer/theme.ts +32 -18
  257. package/dist/extensions/pi-powerline-footer/token-stats.ts +304 -0
  258. package/dist/extensions/pi-powerline-footer/tsconfig.json +13 -0
  259. package/dist/extensions/pi-powerline-footer/types.ts +74 -29
  260. package/dist/extensions/pi-powerline-footer/welcome-dismiss.ts +34 -0
  261. package/dist/extensions/pi-powerline-footer/welcome.ts +65 -10
  262. package/dist/extensions/pi-powerline-footer/working-vibes.ts +44 -11
  263. package/dist/extensions/pi-subagents/CHANGELOG.md +89 -12
  264. package/dist/extensions/pi-subagents/README.md +339 -604
  265. package/dist/extensions/pi-subagents/package-lock.json +190 -2079
  266. package/dist/extensions/pi-subagents/package.json +13 -5
  267. package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +1 -1
  268. package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +1 -1
  269. package/dist/extensions/pi-subagents/prompts/review-loop.md +1 -1
  270. package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +10 -10
  271. package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +32 -43
  272. package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +106 -105
  273. package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +3 -3
  274. package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +28 -35
  275. package/dist/extensions/pi-subagents/src/agents/agent-management.ts +167 -124
  276. package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +19 -0
  277. package/dist/extensions/pi-subagents/src/agents/agents.ts +163 -75
  278. package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +10 -7
  279. package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +5 -3
  280. package/dist/extensions/pi-subagents/src/agents/identity.ts +1 -1
  281. package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +14 -11
  282. package/dist/extensions/pi-subagents/src/agents/skills.ts +23 -6
  283. package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +8 -1
  284. package/dist/extensions/pi-subagents/src/api/control-channel.ts +4 -0
  285. package/dist/extensions/pi-subagents/src/api/delegation.ts +26 -194
  286. package/dist/extensions/pi-subagents/src/api/external-runs.ts +129 -0
  287. package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +3 -0
  288. package/dist/extensions/pi-subagents/src/api/pi-args.ts +5 -0
  289. package/dist/extensions/pi-subagents/src/api/preflight.ts +4 -4
  290. package/dist/extensions/pi-subagents/src/api/shared-types.ts +19 -0
  291. package/dist/extensions/pi-subagents/src/extension/config.ts +10 -0
  292. package/dist/extensions/pi-subagents/src/extension/control-notices.ts +5 -39
  293. package/dist/extensions/pi-subagents/src/extension/doctor.ts +10 -9
  294. package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +7 -4
  295. package/dist/extensions/pi-subagents/src/extension/index.ts +243 -77
  296. package/dist/extensions/pi-subagents/src/extension/rpc.ts +18 -6
  297. package/dist/extensions/pi-subagents/src/extension/schemas.ts +50 -39
  298. package/dist/extensions/pi-subagents/src/extension/tool-description.ts +36 -103
  299. package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +229 -0
  300. package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +130 -0
  301. package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +141 -0
  302. package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +154 -0
  303. package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +330 -0
  304. package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +3 -2
  305. package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +5 -1
  306. package/dist/extensions/pi-subagents/src/missions/actions.ts +372 -0
  307. package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +314 -0
  308. package/dist/extensions/pi-subagents/src/missions/store.ts +442 -0
  309. package/dist/extensions/pi-subagents/src/missions/types.ts +135 -0
  310. package/dist/extensions/pi-subagents/src/policy/authority.ts +46 -0
  311. package/dist/extensions/pi-subagents/src/profiles/profiles.ts +32 -6
  312. package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +103 -72
  313. package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +10 -2
  314. package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +6 -6
  315. package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +29 -1
  316. package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +3 -3
  317. package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -2
  318. package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +9 -7
  319. package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +3 -4
  320. package/dist/extensions/pi-subagents/src/runs/background/notify.ts +3 -28
  321. package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +5 -5
  322. package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +18 -68
  323. package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +3 -3
  324. package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +35 -8
  325. package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +602 -375
  326. package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +3 -3
  327. package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +612 -464
  328. package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +50 -9
  329. package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +253 -0
  330. package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +12 -4
  331. package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +3 -3
  332. package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +8 -4
  333. package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +74 -102
  334. package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +21 -22
  335. package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1050 -396
  336. package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +44 -18
  337. package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -1
  338. package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +302 -22
  339. package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
  340. package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +130 -0
  341. package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +42 -1
  342. package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +1 -1
  343. package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +59 -5
  344. package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +9 -4
  345. package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +86 -2
  346. package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +11 -2
  347. package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +95 -0
  348. package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +11 -1
  349. package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +15 -6
  350. package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +1 -1
  351. package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +9 -63
  352. package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +37 -6
  353. package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +5 -2
  354. package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +2 -23
  355. package/dist/extensions/pi-subagents/src/runs/shared/turn-budget.ts +6 -6
  356. package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +124 -13
  357. package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +29 -7
  358. package/dist/extensions/pi-subagents/src/shared/artifacts.ts +18 -1
  359. package/dist/extensions/pi-subagents/src/shared/fork-context.ts +3 -2
  360. package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +1 -0
  361. package/dist/extensions/pi-subagents/src/shared/settings.ts +10 -0
  362. package/dist/extensions/pi-subagents/src/shared/types.ts +158 -55
  363. package/dist/extensions/pi-subagents/src/shared/utils.ts +16 -66
  364. package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +33 -199
  365. package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +43 -126
  366. package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +136 -0
  367. package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +158 -205
  368. package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +22 -58
  369. package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +14 -0
  370. package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +44 -642
  371. package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +18 -14
  372. package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +156 -21
  373. package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +110 -5
  374. package/dist/extensions/pi-subagents/src/tui/fleet.ts +60 -24
  375. package/dist/extensions/pi-subagents/src/tui/render.ts +296 -140
  376. package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +14 -0
  377. package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
  378. package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +13 -7
  379. package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +2 -2
  380. package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +145 -0
  381. package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +1 -1
  382. package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +1 -1
  383. package/dist/extensions/pi-subagents/src/watchdog/review.ts +4 -1
  384. package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +3 -2
  385. package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +140 -0
  386. package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +415 -0
  387. package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +41 -144
  388. package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +16 -16
  389. package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +415 -298
  390. package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +149 -82
  391. package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +40 -40
  392. package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +15 -15
  393. package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +193 -133
  394. package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +1 -49
  395. package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +62 -0
  396. package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +56 -58
  397. package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +81 -68
  398. package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +20 -25
  399. package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +425 -317
  400. package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +73 -73
  401. package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +123 -98
  402. package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +653 -240
  403. package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +20 -1661
  404. package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +9 -9
  405. package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +3 -3
  406. package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +2 -2
  407. package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +8 -5
  408. package/dist/extensions/pi-subagents/test/support/mock-pi.ts +6 -6
  409. package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -20
  410. package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +25 -4
  411. package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
  412. package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +280 -295
  413. package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +47 -207
  414. package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +26 -26
  415. package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +89 -89
  416. package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +9 -9
  417. package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +10 -0
  418. package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +33 -9
  419. package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +24 -2
  420. package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +11 -9
  421. package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +2 -2
  422. package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +40 -40
  423. package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +22 -0
  424. package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +1 -1
  425. package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +5 -39
  426. package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +19 -19
  427. package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +9 -9
  428. package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +20 -20
  429. package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +99 -0
  430. package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +9 -9
  431. package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +41 -0
  432. package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +2 -2
  433. package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +35 -5
  434. package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +7 -0
  435. package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +16 -82
  436. package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +162 -620
  437. package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +1 -1
  438. package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +25 -25
  439. package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +125 -0
  440. package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +94 -0
  441. package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +66 -0
  442. package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +3 -3
  443. package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +242 -52
  444. package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +127 -0
  445. package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +197 -36
  446. package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +4 -4
  447. package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +245 -0
  448. package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +494 -0
  449. package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +261 -31
  450. package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +127 -0
  451. package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +6 -6
  452. package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +217 -0
  453. package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +182 -0
  454. package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +22 -0
  455. package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +1 -1
  456. package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +10 -10
  457. package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +20 -12
  458. package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +47 -5
  459. package/dist/extensions/pi-subagents/test/unit/notify.test.ts +49 -55
  460. package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +20 -3
  461. package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +37 -7
  462. package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +10 -10
  463. package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +3 -3
  464. package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +46 -0
  465. package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +31 -10
  466. package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +40 -16
  467. package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +42 -44
  468. package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +13 -13
  469. package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +4 -4
  470. package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +75 -9
  471. package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +20 -84
  472. package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +15 -16
  473. package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +28 -28
  474. package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +19 -12
  475. package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +37 -21
  476. package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +1 -1
  477. package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +50 -50
  478. package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +396 -433
  479. package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +76 -153
  480. package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +411 -0
  481. package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +1 -91
  482. package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +139 -0
  483. package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +29 -0
  484. package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +13 -13
  485. package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -2
  486. package/dist/extensions/pi-subagents/test/unit/steering.test.ts +2 -2
  487. package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +35 -35
  488. package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +53 -18
  489. package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +13 -1
  490. package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +44 -11
  491. package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +2 -26
  492. package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +24 -148
  493. package/dist/extensions/pi-subagents/test/unit/turn-budget.test.ts +11 -9
  494. package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +351 -0
  495. package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +13 -13
  496. package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +1 -1
  497. package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +79 -0
  498. package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +1 -1
  499. package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +8 -8
  500. package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +45 -9
  501. package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +197 -0
  502. package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +8 -8
  503. package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +142 -12
  504. package/dist/extensions/pi-subagents/tsconfig.json +15 -0
  505. package/dist/extensions/ponytail/index.js +1 -31
  506. package/dist/extensions/ponytail/test/extension.test.js +5 -22
  507. package/dist/extensions/rtk.test.ts +141 -0
  508. package/dist/extensions/rtk.ts +78 -36
  509. package/dist/index.d.ts +1 -1
  510. package/dist/index.js +1 -1
  511. package/dist/main.d.ts +0 -1
  512. package/dist/main.js +0 -1
  513. package/dist/migrations.d.ts +0 -1
  514. package/dist/migrations.js +0 -1
  515. package/dist/modes/index.d.ts +0 -1
  516. package/dist/modes/index.js +0 -1
  517. package/dist/modes/interactive/components/armin.d.ts +0 -1
  518. package/dist/modes/interactive/components/armin.js +0 -1
  519. package/dist/modes/interactive/components/assistant-message.d.ts +0 -1
  520. package/dist/modes/interactive/components/assistant-message.js +0 -1
  521. package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
  522. package/dist/modes/interactive/components/bash-execution.js +0 -1
  523. package/dist/modes/interactive/components/bordered-loader.d.ts +0 -1
  524. package/dist/modes/interactive/components/bordered-loader.js +0 -1
  525. package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -1
  526. package/dist/modes/interactive/components/branch-summary-message.js +0 -1
  527. package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -1
  528. package/dist/modes/interactive/components/compaction-summary-message.js +0 -1
  529. package/dist/modes/interactive/components/config-selector.d.ts +0 -1
  530. package/dist/modes/interactive/components/config-selector.js +0 -1
  531. package/dist/modes/interactive/components/countdown-timer.d.ts +0 -1
  532. package/dist/modes/interactive/components/countdown-timer.js +0 -1
  533. package/dist/modes/interactive/components/custom-editor.d.ts +0 -1
  534. package/dist/modes/interactive/components/custom-editor.js +0 -1
  535. package/dist/modes/interactive/components/custom-entry.d.ts +0 -1
  536. package/dist/modes/interactive/components/custom-entry.js +0 -1
  537. package/dist/modes/interactive/components/custom-message.d.ts +0 -1
  538. package/dist/modes/interactive/components/custom-message.js +0 -1
  539. package/dist/modes/interactive/components/daxnuts.d.ts +0 -1
  540. package/dist/modes/interactive/components/daxnuts.js +0 -1
  541. package/dist/modes/interactive/components/diff.d.ts +0 -1
  542. package/dist/modes/interactive/components/diff.js +0 -1
  543. package/dist/modes/interactive/components/dynamic-border.d.ts +0 -1
  544. package/dist/modes/interactive/components/dynamic-border.js +0 -1
  545. package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -1
  546. package/dist/modes/interactive/components/earendil-announcement.js +0 -1
  547. package/dist/modes/interactive/components/extension-editor.d.ts +0 -1
  548. package/dist/modes/interactive/components/extension-editor.js +0 -1
  549. package/dist/modes/interactive/components/extension-input.d.ts +0 -1
  550. package/dist/modes/interactive/components/extension-input.js +0 -1
  551. package/dist/modes/interactive/components/extension-selector.d.ts +0 -1
  552. package/dist/modes/interactive/components/extension-selector.js +0 -1
  553. package/dist/modes/interactive/components/first-time-setup.d.ts +0 -1
  554. package/dist/modes/interactive/components/first-time-setup.js +0 -1
  555. package/dist/modes/interactive/components/footer.d.ts +0 -1
  556. package/dist/modes/interactive/components/footer.js +0 -1
  557. package/dist/modes/interactive/components/index.d.ts +0 -1
  558. package/dist/modes/interactive/components/index.js +0 -1
  559. package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -1
  560. package/dist/modes/interactive/components/keybinding-hints.js +0 -1
  561. package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
  562. package/dist/modes/interactive/components/login-dialog.js +0 -1
  563. package/dist/modes/interactive/components/model-selector.d.ts +0 -1
  564. package/dist/modes/interactive/components/model-selector.js +0 -1
  565. package/dist/modes/interactive/components/oauth-selector.d.ts +0 -1
  566. package/dist/modes/interactive/components/oauth-selector.js +0 -1
  567. package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -1
  568. package/dist/modes/interactive/components/scoped-models-selector.js +0 -1
  569. package/dist/modes/interactive/components/session-selector-search.d.ts +0 -1
  570. package/dist/modes/interactive/components/session-selector-search.js +0 -1
  571. package/dist/modes/interactive/components/session-selector.d.ts +0 -1
  572. package/dist/modes/interactive/components/session-selector.js +0 -1
  573. package/dist/modes/interactive/components/settings-selector.d.ts +0 -3
  574. package/dist/modes/interactive/components/settings-selector.js +1 -14
  575. package/dist/modes/interactive/components/show-images-selector.d.ts +0 -1
  576. package/dist/modes/interactive/components/show-images-selector.js +0 -1
  577. package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -1
  578. package/dist/modes/interactive/components/skill-invocation-message.js +0 -1
  579. package/dist/modes/interactive/components/status-indicator.d.ts +0 -1
  580. package/dist/modes/interactive/components/status-indicator.js +0 -1
  581. package/dist/modes/interactive/components/theme-selector.d.ts +0 -1
  582. package/dist/modes/interactive/components/theme-selector.js +0 -1
  583. package/dist/modes/interactive/components/thinking-selector.d.ts +0 -1
  584. package/dist/modes/interactive/components/thinking-selector.js +0 -1
  585. package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
  586. package/dist/modes/interactive/components/tool-execution.js +0 -1
  587. package/dist/modes/interactive/components/tree-selector.d.ts +0 -1
  588. package/dist/modes/interactive/components/tree-selector.js +0 -1
  589. package/dist/modes/interactive/components/trust-selector.d.ts +0 -1
  590. package/dist/modes/interactive/components/trust-selector.js +0 -1
  591. package/dist/modes/interactive/components/user-message-selector.d.ts +0 -1
  592. package/dist/modes/interactive/components/user-message-selector.js +0 -1
  593. package/dist/modes/interactive/components/user-message.d.ts +0 -1
  594. package/dist/modes/interactive/components/user-message.js +0 -1
  595. package/dist/modes/interactive/components/visual-truncate.d.ts +0 -1
  596. package/dist/modes/interactive/components/visual-truncate.js +0 -1
  597. package/dist/modes/interactive/external-editor.d.ts +0 -1
  598. package/dist/modes/interactive/external-editor.js +0 -1
  599. package/dist/modes/interactive/interactive-mode.d.ts +0 -2
  600. package/dist/modes/interactive/interactive-mode.js +1 -22
  601. package/dist/modes/interactive/model-search.d.ts +0 -1
  602. package/dist/modes/interactive/model-search.js +0 -1
  603. package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
  604. package/dist/modes/interactive/theme/theme-controller.js +0 -1
  605. package/dist/modes/interactive/theme/theme.d.ts +0 -1
  606. package/dist/modes/interactive/theme/theme.js +0 -1
  607. package/dist/modes/print-mode.d.ts +0 -1
  608. package/dist/modes/print-mode.js +0 -1
  609. package/dist/modes/rpc/jsonl.d.ts +0 -1
  610. package/dist/modes/rpc/jsonl.js +0 -1
  611. package/dist/modes/rpc/rpc-client.d.ts +1 -2
  612. package/dist/modes/rpc/rpc-client.js +1 -2
  613. package/dist/modes/rpc/rpc-mode.d.ts +0 -1
  614. package/dist/modes/rpc/rpc-mode.js +0 -9
  615. package/dist/modes/rpc/rpc-types.d.ts +0 -1
  616. package/dist/modes/rpc/rpc-types.js +0 -1
  617. package/dist/package-manager-cli.d.ts +0 -1
  618. package/dist/package-manager-cli.js +0 -1
  619. package/dist/rpc-entry.d.ts +0 -1
  620. package/dist/rpc-entry.js +0 -1
  621. package/dist/utils/ansi.d.ts +0 -1
  622. package/dist/utils/ansi.js +0 -1
  623. package/dist/utils/changelog.d.ts +0 -1
  624. package/dist/utils/changelog.js +0 -1
  625. package/dist/utils/child-process.d.ts +0 -1
  626. package/dist/utils/child-process.js +0 -1
  627. package/dist/utils/clipboard-image.d.ts +0 -1
  628. package/dist/utils/clipboard-image.js +0 -1
  629. package/dist/utils/clipboard-native.d.ts +0 -1
  630. package/dist/utils/clipboard-native.js +0 -1
  631. package/dist/utils/clipboard.d.ts +0 -1
  632. package/dist/utils/clipboard.js +0 -1
  633. package/dist/utils/deprecation.d.ts +0 -1
  634. package/dist/utils/deprecation.js +0 -1
  635. package/dist/utils/exif-orientation.d.ts +0 -1
  636. package/dist/utils/exif-orientation.js +0 -1
  637. package/dist/utils/frontmatter.d.ts +0 -1
  638. package/dist/utils/frontmatter.js +0 -1
  639. package/dist/utils/fs-watch.d.ts +0 -1
  640. package/dist/utils/fs-watch.js +0 -1
  641. package/dist/utils/git.d.ts +0 -1
  642. package/dist/utils/git.js +0 -1
  643. package/dist/utils/html.d.ts +0 -1
  644. package/dist/utils/html.js +0 -1
  645. package/dist/utils/image-convert.d.ts +0 -1
  646. package/dist/utils/image-convert.js +0 -1
  647. package/dist/utils/image-process.d.ts +0 -1
  648. package/dist/utils/image-process.js +0 -1
  649. package/dist/utils/image-resize-core.d.ts +0 -1
  650. package/dist/utils/image-resize-core.js +0 -1
  651. package/dist/utils/image-resize-worker.d.ts +0 -1
  652. package/dist/utils/image-resize-worker.js +0 -1
  653. package/dist/utils/image-resize.d.ts +0 -1
  654. package/dist/utils/image-resize.js +0 -1
  655. package/dist/utils/json.d.ts +0 -1
  656. package/dist/utils/json.js +0 -1
  657. package/dist/utils/mime.d.ts +0 -1
  658. package/dist/utils/mime.js +0 -1
  659. package/dist/utils/open-browser.d.ts +0 -1
  660. package/dist/utils/open-browser.js +0 -1
  661. package/dist/utils/paths.d.ts +0 -1
  662. package/dist/utils/paths.js +0 -1
  663. package/dist/utils/photon.d.ts +0 -1
  664. package/dist/utils/photon.js +0 -1
  665. package/dist/utils/pi-user-agent.d.ts +0 -1
  666. package/dist/utils/pi-user-agent.js +0 -1
  667. package/dist/utils/shell.d.ts +0 -1
  668. package/dist/utils/shell.js +0 -1
  669. package/dist/utils/sleep.d.ts +0 -1
  670. package/dist/utils/sleep.js +0 -1
  671. package/dist/utils/syntax-highlight.d.ts +0 -1
  672. package/dist/utils/syntax-highlight.js +0 -1
  673. package/dist/utils/thinking-tags.d.ts +0 -1
  674. package/dist/utils/thinking-tags.js +0 -1
  675. package/dist/utils/tools-manager.d.ts +3 -3
  676. package/dist/utils/tools-manager.js +125 -42
  677. package/dist/utils/version-check.d.ts +0 -1
  678. package/dist/utils/version-check.js +0 -1
  679. package/dist/utils/windows-self-update.d.ts +0 -1
  680. package/dist/utils/windows-self-update.js +0 -1
  681. package/docs/rpc.md +1 -2
  682. package/docs/settings.md +0 -1
  683. package/docs/skills.md +10 -18
  684. package/package.json +3 -2
  685. package/dist/bun/cli.d.ts.map +0 -1
  686. package/dist/bun/cli.js.map +0 -1
  687. package/dist/bun/register-bedrock.d.ts.map +0 -1
  688. package/dist/bun/register-bedrock.js.map +0 -1
  689. package/dist/bun/restore-sandbox-env.d.ts.map +0 -1
  690. package/dist/bun/restore-sandbox-env.js.map +0 -1
  691. package/dist/cli/args.d.ts.map +0 -1
  692. package/dist/cli/args.js.map +0 -1
  693. package/dist/cli/config-selector.d.ts.map +0 -1
  694. package/dist/cli/config-selector.js.map +0 -1
  695. package/dist/cli/credential-print.d.ts.map +0 -1
  696. package/dist/cli/credential-print.js.map +0 -1
  697. package/dist/cli/file-processor.d.ts.map +0 -1
  698. package/dist/cli/file-processor.js.map +0 -1
  699. package/dist/cli/initial-message.d.ts.map +0 -1
  700. package/dist/cli/initial-message.js.map +0 -1
  701. package/dist/cli/list-models.d.ts.map +0 -1
  702. package/dist/cli/list-models.js.map +0 -1
  703. package/dist/cli/project-trust.d.ts.map +0 -1
  704. package/dist/cli/project-trust.js.map +0 -1
  705. package/dist/cli/session-picker.d.ts.map +0 -1
  706. package/dist/cli/session-picker.js.map +0 -1
  707. package/dist/cli/startup-ui.d.ts.map +0 -1
  708. package/dist/cli/startup-ui.js.map +0 -1
  709. package/dist/cli.d.ts.map +0 -1
  710. package/dist/cli.js.map +0 -1
  711. package/dist/config.d.ts.map +0 -1
  712. package/dist/config.js.map +0 -1
  713. package/dist/core/agent-session-auto-handoff.test.d.ts.map +0 -1
  714. package/dist/core/agent-session-auto-handoff.test.js.map +0 -1
  715. package/dist/core/agent-session-runtime.d.ts.map +0 -1
  716. package/dist/core/agent-session-runtime.js.map +0 -1
  717. package/dist/core/agent-session-services.d.ts.map +0 -1
  718. package/dist/core/agent-session-services.js.map +0 -1
  719. package/dist/core/agent-session-skill-block.test.d.ts.map +0 -1
  720. package/dist/core/agent-session-skill-block.test.js.map +0 -1
  721. package/dist/core/agent-session.d.ts.map +0 -1
  722. package/dist/core/agent-session.js.map +0 -1
  723. package/dist/core/agents.d.ts.map +0 -1
  724. package/dist/core/agents.js.map +0 -1
  725. package/dist/core/auth-guidance.d.ts.map +0 -1
  726. package/dist/core/auth-guidance.js.map +0 -1
  727. package/dist/core/auth-storage.d.ts.map +0 -1
  728. package/dist/core/auth-storage.js.map +0 -1
  729. package/dist/core/bash-executor.d.ts.map +0 -1
  730. package/dist/core/bash-executor.js.map +0 -1
  731. package/dist/core/built-in-extensions.d.ts.map +0 -1
  732. package/dist/core/built-in-extensions.js.map +0 -1
  733. package/dist/core/cache-stats.d.ts.map +0 -1
  734. package/dist/core/cache-stats.js.map +0 -1
  735. package/dist/core/compaction/branch-summarization.d.ts.map +0 -1
  736. package/dist/core/compaction/branch-summarization.js.map +0 -1
  737. package/dist/core/compaction/compaction.d.ts.map +0 -1
  738. package/dist/core/compaction/compaction.js.map +0 -1
  739. package/dist/core/compaction/index.d.ts.map +0 -1
  740. package/dist/core/compaction/index.js.map +0 -1
  741. package/dist/core/compaction/utils.d.ts.map +0 -1
  742. package/dist/core/compaction/utils.js.map +0 -1
  743. package/dist/core/defaults.d.ts.map +0 -1
  744. package/dist/core/defaults.js.map +0 -1
  745. package/dist/core/diagnostics.d.ts.map +0 -1
  746. package/dist/core/diagnostics.js.map +0 -1
  747. package/dist/core/event-bus.d.ts.map +0 -1
  748. package/dist/core/event-bus.js.map +0 -1
  749. package/dist/core/exec.d.ts.map +0 -1
  750. package/dist/core/exec.js.map +0 -1
  751. package/dist/core/experimental.d.ts.map +0 -1
  752. package/dist/core/experimental.js.map +0 -1
  753. package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
  754. package/dist/core/export-html/ansi-to-html.js.map +0 -1
  755. package/dist/core/export-html/index.d.ts.map +0 -1
  756. package/dist/core/export-html/index.js.map +0 -1
  757. package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
  758. package/dist/core/export-html/tool-renderer.js.map +0 -1
  759. package/dist/core/extensions/index.d.ts.map +0 -1
  760. package/dist/core/extensions/index.js.map +0 -1
  761. package/dist/core/extensions/loader.d.ts.map +0 -1
  762. package/dist/core/extensions/loader.js.map +0 -1
  763. package/dist/core/extensions/runner.d.ts.map +0 -1
  764. package/dist/core/extensions/runner.js.map +0 -1
  765. package/dist/core/extensions/types.d.ts.map +0 -1
  766. package/dist/core/extensions/types.js.map +0 -1
  767. package/dist/core/extensions/wrapper.d.ts.map +0 -1
  768. package/dist/core/extensions/wrapper.js.map +0 -1
  769. package/dist/core/footer-data-provider.d.ts.map +0 -1
  770. package/dist/core/footer-data-provider.js.map +0 -1
  771. package/dist/core/git-command.d.ts.map +0 -1
  772. package/dist/core/git-command.js.map +0 -1
  773. package/dist/core/http-dispatcher.d.ts.map +0 -1
  774. package/dist/core/http-dispatcher.js.map +0 -1
  775. package/dist/core/index.d.ts.map +0 -1
  776. package/dist/core/index.js.map +0 -1
  777. package/dist/core/keybindings.d.ts.map +0 -1
  778. package/dist/core/keybindings.js.map +0 -1
  779. package/dist/core/llama/client.d.ts.map +0 -1
  780. package/dist/core/llama/client.js.map +0 -1
  781. package/dist/core/llama/huggingface.d.ts.map +0 -1
  782. package/dist/core/llama/huggingface.js.map +0 -1
  783. package/dist/core/llama/index.d.ts.map +0 -1
  784. package/dist/core/llama/index.js.map +0 -1
  785. package/dist/core/llama/provider.d.ts.map +0 -1
  786. package/dist/core/llama/provider.js.map +0 -1
  787. package/dist/core/llama/ui.d.ts.map +0 -1
  788. package/dist/core/llama/ui.js.map +0 -1
  789. package/dist/core/messages.d.ts.map +0 -1
  790. package/dist/core/messages.js.map +0 -1
  791. package/dist/core/model-config.d.ts.map +0 -1
  792. package/dist/core/model-config.js.map +0 -1
  793. package/dist/core/model-registry.d.ts.map +0 -1
  794. package/dist/core/model-registry.js.map +0 -1
  795. package/dist/core/model-resolver.d.ts.map +0 -1
  796. package/dist/core/model-resolver.js.map +0 -1
  797. package/dist/core/model-runtime.d.ts.map +0 -1
  798. package/dist/core/model-runtime.js.map +0 -1
  799. package/dist/core/models-store.d.ts.map +0 -1
  800. package/dist/core/models-store.js.map +0 -1
  801. package/dist/core/output-guard.d.ts.map +0 -1
  802. package/dist/core/output-guard.js.map +0 -1
  803. package/dist/core/package-manager.d.ts.map +0 -1
  804. package/dist/core/package-manager.js.map +0 -1
  805. package/dist/core/package-manager.test.d.ts.map +0 -1
  806. package/dist/core/package-manager.test.js.map +0 -1
  807. package/dist/core/project-trust.d.ts.map +0 -1
  808. package/dist/core/project-trust.js.map +0 -1
  809. package/dist/core/prompt-templates.d.ts.map +0 -1
  810. package/dist/core/prompt-templates.js.map +0 -1
  811. package/dist/core/provider-attribution.d.ts.map +0 -1
  812. package/dist/core/provider-attribution.js.map +0 -1
  813. package/dist/core/provider-composer.d.ts.map +0 -1
  814. package/dist/core/provider-composer.js.map +0 -1
  815. package/dist/core/radius.d.ts.map +0 -1
  816. package/dist/core/radius.js.map +0 -1
  817. package/dist/core/remote-catalog-provider.d.ts.map +0 -1
  818. package/dist/core/remote-catalog-provider.js.map +0 -1
  819. package/dist/core/resolve-config-value.d.ts.map +0 -1
  820. package/dist/core/resolve-config-value.js.map +0 -1
  821. package/dist/core/resource-loader.d.ts.map +0 -1
  822. package/dist/core/resource-loader.js.map +0 -1
  823. package/dist/core/runtime-credentials.d.ts.map +0 -1
  824. package/dist/core/runtime-credentials.js.map +0 -1
  825. package/dist/core/sdk.d.ts.map +0 -1
  826. package/dist/core/sdk.js.map +0 -1
  827. package/dist/core/session-cwd.d.ts.map +0 -1
  828. package/dist/core/session-cwd.js.map +0 -1
  829. package/dist/core/session-manager.d.ts.map +0 -1
  830. package/dist/core/session-manager.js.map +0 -1
  831. package/dist/core/settings-manager-auto-handoff.test.d.ts.map +0 -1
  832. package/dist/core/settings-manager-auto-handoff.test.js.map +0 -1
  833. package/dist/core/settings-manager.d.ts.map +0 -1
  834. package/dist/core/settings-manager.js.map +0 -1
  835. package/dist/core/skills.d.ts.map +0 -1
  836. package/dist/core/skills.js.map +0 -1
  837. package/dist/core/slash-commands.d.ts.map +0 -1
  838. package/dist/core/slash-commands.js.map +0 -1
  839. package/dist/core/source-info.d.ts.map +0 -1
  840. package/dist/core/source-info.js.map +0 -1
  841. package/dist/core/system-prompt.d.ts.map +0 -1
  842. package/dist/core/system-prompt.js.map +0 -1
  843. package/dist/core/system-prompt.test.d.ts.map +0 -1
  844. package/dist/core/system-prompt.test.js.map +0 -1
  845. package/dist/core/telemetry.d.ts.map +0 -1
  846. package/dist/core/telemetry.js.map +0 -1
  847. package/dist/core/timings.d.ts.map +0 -1
  848. package/dist/core/timings.js.map +0 -1
  849. package/dist/core/tools/bash.d.ts.map +0 -1
  850. package/dist/core/tools/bash.js.map +0 -1
  851. package/dist/core/tools/edit-diff.d.ts.map +0 -1
  852. package/dist/core/tools/edit-diff.js.map +0 -1
  853. package/dist/core/tools/edit.d.ts.map +0 -1
  854. package/dist/core/tools/edit.js.map +0 -1
  855. package/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
  856. package/dist/core/tools/file-mutation-queue.js.map +0 -1
  857. package/dist/core/tools/find.d.ts.map +0 -1
  858. package/dist/core/tools/find.js.map +0 -1
  859. package/dist/core/tools/grep.d.ts.map +0 -1
  860. package/dist/core/tools/grep.js.map +0 -1
  861. package/dist/core/tools/index.d.ts.map +0 -1
  862. package/dist/core/tools/index.js.map +0 -1
  863. package/dist/core/tools/ls.d.ts.map +0 -1
  864. package/dist/core/tools/ls.js.map +0 -1
  865. package/dist/core/tools/output-accumulator.d.ts.map +0 -1
  866. package/dist/core/tools/output-accumulator.js.map +0 -1
  867. package/dist/core/tools/path-utils.d.ts.map +0 -1
  868. package/dist/core/tools/path-utils.js.map +0 -1
  869. package/dist/core/tools/read.d.ts.map +0 -1
  870. package/dist/core/tools/read.js.map +0 -1
  871. package/dist/core/tools/render-utils.d.ts.map +0 -1
  872. package/dist/core/tools/render-utils.js.map +0 -1
  873. package/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
  874. package/dist/core/tools/tool-definition-wrapper.js.map +0 -1
  875. package/dist/core/tools/truncate.d.ts.map +0 -1
  876. package/dist/core/tools/truncate.js.map +0 -1
  877. package/dist/core/tools/write.d.ts.map +0 -1
  878. package/dist/core/tools/write.js.map +0 -1
  879. package/dist/core/trust-manager.d.ts.map +0 -1
  880. package/dist/core/trust-manager.js.map +0 -1
  881. package/dist/core/usage-totals.d.ts.map +0 -1
  882. package/dist/core/usage-totals.js.map +0 -1
  883. package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  884. package/dist/extensions/pi-subagents/test/unit/slash-chain-groups.test.ts +0 -464
  885. package/dist/index.d.ts.map +0 -1
  886. package/dist/index.js.map +0 -1
  887. package/dist/main.d.ts.map +0 -1
  888. package/dist/main.js.map +0 -1
  889. package/dist/migrations.d.ts.map +0 -1
  890. package/dist/migrations.js.map +0 -1
  891. package/dist/modes/index.d.ts.map +0 -1
  892. package/dist/modes/index.js.map +0 -1
  893. package/dist/modes/interactive/components/armin.d.ts.map +0 -1
  894. package/dist/modes/interactive/components/armin.js.map +0 -1
  895. package/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
  896. package/dist/modes/interactive/components/assistant-message.js.map +0 -1
  897. package/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
  898. package/dist/modes/interactive/components/bash-execution.js.map +0 -1
  899. package/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
  900. package/dist/modes/interactive/components/bordered-loader.js.map +0 -1
  901. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
  902. package/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
  903. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
  904. package/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
  905. package/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
  906. package/dist/modes/interactive/components/config-selector.js.map +0 -1
  907. package/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
  908. package/dist/modes/interactive/components/countdown-timer.js.map +0 -1
  909. package/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
  910. package/dist/modes/interactive/components/custom-editor.js.map +0 -1
  911. package/dist/modes/interactive/components/custom-entry.d.ts.map +0 -1
  912. package/dist/modes/interactive/components/custom-entry.js.map +0 -1
  913. package/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
  914. package/dist/modes/interactive/components/custom-message.js.map +0 -1
  915. package/dist/modes/interactive/components/daxnuts.d.ts.map +0 -1
  916. package/dist/modes/interactive/components/daxnuts.js.map +0 -1
  917. package/dist/modes/interactive/components/diff.d.ts.map +0 -1
  918. package/dist/modes/interactive/components/diff.js.map +0 -1
  919. package/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
  920. package/dist/modes/interactive/components/dynamic-border.js.map +0 -1
  921. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +0 -1
  922. package/dist/modes/interactive/components/earendil-announcement.js.map +0 -1
  923. package/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
  924. package/dist/modes/interactive/components/extension-editor.js.map +0 -1
  925. package/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
  926. package/dist/modes/interactive/components/extension-input.js.map +0 -1
  927. package/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
  928. package/dist/modes/interactive/components/extension-selector.js.map +0 -1
  929. package/dist/modes/interactive/components/first-time-setup.d.ts.map +0 -1
  930. package/dist/modes/interactive/components/first-time-setup.js.map +0 -1
  931. package/dist/modes/interactive/components/footer.d.ts.map +0 -1
  932. package/dist/modes/interactive/components/footer.js.map +0 -1
  933. package/dist/modes/interactive/components/index.d.ts.map +0 -1
  934. package/dist/modes/interactive/components/index.js.map +0 -1
  935. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
  936. package/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
  937. package/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
  938. package/dist/modes/interactive/components/login-dialog.js.map +0 -1
  939. package/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
  940. package/dist/modes/interactive/components/model-selector.js.map +0 -1
  941. package/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
  942. package/dist/modes/interactive/components/oauth-selector.js.map +0 -1
  943. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
  944. package/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
  945. package/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
  946. package/dist/modes/interactive/components/session-selector-search.js.map +0 -1
  947. package/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
  948. package/dist/modes/interactive/components/session-selector.js.map +0 -1
  949. package/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
  950. package/dist/modes/interactive/components/settings-selector.js.map +0 -1
  951. package/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
  952. package/dist/modes/interactive/components/show-images-selector.js.map +0 -1
  953. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
  954. package/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
  955. package/dist/modes/interactive/components/status-indicator.d.ts.map +0 -1
  956. package/dist/modes/interactive/components/status-indicator.js.map +0 -1
  957. package/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
  958. package/dist/modes/interactive/components/theme-selector.js.map +0 -1
  959. package/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
  960. package/dist/modes/interactive/components/thinking-selector.js.map +0 -1
  961. package/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
  962. package/dist/modes/interactive/components/tool-execution.js.map +0 -1
  963. package/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
  964. package/dist/modes/interactive/components/tree-selector.js.map +0 -1
  965. package/dist/modes/interactive/components/trust-selector.d.ts.map +0 -1
  966. package/dist/modes/interactive/components/trust-selector.js.map +0 -1
  967. package/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
  968. package/dist/modes/interactive/components/user-message-selector.js.map +0 -1
  969. package/dist/modes/interactive/components/user-message.d.ts.map +0 -1
  970. package/dist/modes/interactive/components/user-message.js.map +0 -1
  971. package/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
  972. package/dist/modes/interactive/components/visual-truncate.js.map +0 -1
  973. package/dist/modes/interactive/external-editor.d.ts.map +0 -1
  974. package/dist/modes/interactive/external-editor.js.map +0 -1
  975. package/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
  976. package/dist/modes/interactive/interactive-mode.js.map +0 -1
  977. package/dist/modes/interactive/model-search.d.ts.map +0 -1
  978. package/dist/modes/interactive/model-search.js.map +0 -1
  979. package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
  980. package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
  981. package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
  982. package/dist/modes/interactive/theme/theme.js.map +0 -1
  983. package/dist/modes/print-mode.d.ts.map +0 -1
  984. package/dist/modes/print-mode.js.map +0 -1
  985. package/dist/modes/rpc/jsonl.d.ts.map +0 -1
  986. package/dist/modes/rpc/jsonl.js.map +0 -1
  987. package/dist/modes/rpc/rpc-client.d.ts.map +0 -1
  988. package/dist/modes/rpc/rpc-client.js.map +0 -1
  989. package/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
  990. package/dist/modes/rpc/rpc-mode.js.map +0 -1
  991. package/dist/modes/rpc/rpc-types.d.ts.map +0 -1
  992. package/dist/modes/rpc/rpc-types.js.map +0 -1
  993. package/dist/package-manager-cli.d.ts.map +0 -1
  994. package/dist/package-manager-cli.js.map +0 -1
  995. package/dist/rpc-entry.d.ts.map +0 -1
  996. package/dist/rpc-entry.js.map +0 -1
  997. package/dist/utils/ansi.d.ts.map +0 -1
  998. package/dist/utils/ansi.js.map +0 -1
  999. package/dist/utils/changelog.d.ts.map +0 -1
  1000. package/dist/utils/changelog.js.map +0 -1
  1001. package/dist/utils/child-process.d.ts.map +0 -1
  1002. package/dist/utils/child-process.js.map +0 -1
  1003. package/dist/utils/clipboard-image.d.ts.map +0 -1
  1004. package/dist/utils/clipboard-image.js.map +0 -1
  1005. package/dist/utils/clipboard-native.d.ts.map +0 -1
  1006. package/dist/utils/clipboard-native.js.map +0 -1
  1007. package/dist/utils/clipboard.d.ts.map +0 -1
  1008. package/dist/utils/clipboard.js.map +0 -1
  1009. package/dist/utils/deprecation.d.ts.map +0 -1
  1010. package/dist/utils/deprecation.js.map +0 -1
  1011. package/dist/utils/exif-orientation.d.ts.map +0 -1
  1012. package/dist/utils/exif-orientation.js.map +0 -1
  1013. package/dist/utils/frontmatter.d.ts.map +0 -1
  1014. package/dist/utils/frontmatter.js.map +0 -1
  1015. package/dist/utils/fs-watch.d.ts.map +0 -1
  1016. package/dist/utils/fs-watch.js.map +0 -1
  1017. package/dist/utils/git.d.ts.map +0 -1
  1018. package/dist/utils/git.js.map +0 -1
  1019. package/dist/utils/html.d.ts.map +0 -1
  1020. package/dist/utils/html.js.map +0 -1
  1021. package/dist/utils/image-convert.d.ts.map +0 -1
  1022. package/dist/utils/image-convert.js.map +0 -1
  1023. package/dist/utils/image-process.d.ts.map +0 -1
  1024. package/dist/utils/image-process.js.map +0 -1
  1025. package/dist/utils/image-resize-core.d.ts.map +0 -1
  1026. package/dist/utils/image-resize-core.js.map +0 -1
  1027. package/dist/utils/image-resize-worker.d.ts.map +0 -1
  1028. package/dist/utils/image-resize-worker.js.map +0 -1
  1029. package/dist/utils/image-resize.d.ts.map +0 -1
  1030. package/dist/utils/image-resize.js.map +0 -1
  1031. package/dist/utils/json.d.ts.map +0 -1
  1032. package/dist/utils/json.js.map +0 -1
  1033. package/dist/utils/mime.d.ts.map +0 -1
  1034. package/dist/utils/mime.js.map +0 -1
  1035. package/dist/utils/open-browser.d.ts.map +0 -1
  1036. package/dist/utils/open-browser.js.map +0 -1
  1037. package/dist/utils/paths.d.ts.map +0 -1
  1038. package/dist/utils/paths.js.map +0 -1
  1039. package/dist/utils/photon.d.ts.map +0 -1
  1040. package/dist/utils/photon.js.map +0 -1
  1041. package/dist/utils/pi-user-agent.d.ts.map +0 -1
  1042. package/dist/utils/pi-user-agent.js.map +0 -1
  1043. package/dist/utils/shell.d.ts.map +0 -1
  1044. package/dist/utils/shell.js.map +0 -1
  1045. package/dist/utils/sleep.d.ts.map +0 -1
  1046. package/dist/utils/sleep.js.map +0 -1
  1047. package/dist/utils/syntax-highlight.d.ts.map +0 -1
  1048. package/dist/utils/syntax-highlight.js.map +0 -1
  1049. package/dist/utils/thinking-tags.d.ts.map +0 -1
  1050. package/dist/utils/thinking-tags.js.map +0 -1
  1051. package/dist/utils/tools-manager.d.ts.map +0 -1
  1052. package/dist/utils/tools-manager.js.map +0 -1
  1053. package/dist/utils/version-check.d.ts.map +0 -1
  1054. package/dist/utils/version-check.js.map +0 -1
  1055. package/dist/utils/windows-self-update.d.ts.map +0 -1
  1056. package/dist/utils/windows-self-update.js.map +0 -1
@@ -22,19 +22,19 @@ describe("child watchdog status helpers", () => {
22
22
  model: "openai/gpt-test-child",
23
23
  thinking: "low",
24
24
  overrides: {
25
- worker: {
26
- model: "anthropic/claude-test-worker",
25
+ builder: {
26
+ model: "anthropic/claude-test-builder",
27
27
  thinking: false,
28
28
  },
29
29
  },
30
30
  },
31
31
  },
32
- agent: "worker",
32
+ agent: "builder",
33
33
  runId: "run-1",
34
34
  childIndex: 0,
35
35
  });
36
36
 
37
- assert.equal(config?.model, "anthropic/claude-test-worker");
37
+ assert.equal(config?.model, "anthropic/claude-test-builder");
38
38
  assert.equal(config?.thinking, false);
39
39
  assert.deepEqual(config?.lsp, DEFAULT_WATCHDOG_CONFIG.lsp);
40
40
  });
@@ -43,7 +43,7 @@ describe("child watchdog status helpers", () => {
43
43
  const payload = {
44
44
  enabled: true,
45
45
  runId: "run-1",
46
- agent: "worker",
46
+ agent: "builder",
47
47
  childIndex: 1,
48
48
  watchdogTailTimeoutMs: 100,
49
49
  agentEndTimeoutMs: 200,
@@ -79,7 +79,7 @@ describe("child watchdog status helpers", () => {
79
79
  const firstEvent = {
80
80
  type: CHILD_WATCHDOG_STATUS_EVENT,
81
81
  runId: "run-1",
82
- agent: "worker",
82
+ agent: "builder",
83
83
  childIndex: 0,
84
84
  seq: 1,
85
85
  phase: "reviewing",
@@ -88,20 +88,20 @@ describe("child watchdog status helpers", () => {
88
88
  } as const;
89
89
 
90
90
  assert.equal(isChildWatchdogStatusEvent(firstEvent), true);
91
- const first = acceptChildWatchdogEvent({ event: firstEvent, runId: "run-1", agent: "worker", childIndex: 0, current: undefined });
91
+ const first = acceptChildWatchdogEvent({ event: firstEvent, runId: "run-1", agent: "builder", childIndex: 0, current: undefined });
92
92
  assert.deepEqual(first, { phase: "reviewing", seq: 1, lastUpdate: 10, followUpPending: false });
93
93
  assert.equal(childWatchdogIsActive(first), true);
94
- assert.equal(acceptChildWatchdogEvent({ event: firstEvent, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
95
- assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, runId: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
96
- assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
97
- assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, childIndex: undefined }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
98
- assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: "other" }, current: first, runId: "run-1", agent: "worker", childIndex: 0 }), undefined);
94
+ assert.equal(acceptChildWatchdogEvent({ event: firstEvent, current: first, runId: "run-1", agent: "builder", childIndex: 0 }), undefined);
95
+ assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, runId: undefined }, current: first, runId: "run-1", agent: "builder", childIndex: 0 }), undefined);
96
+ assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: undefined }, current: first, runId: "run-1", agent: "builder", childIndex: 0 }), undefined);
97
+ assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, childIndex: undefined }, current: first, runId: "run-1", agent: "builder", childIndex: 0 }), undefined);
98
+ assert.equal(acceptChildWatchdogEvent({ event: { ...firstEvent, seq: 2, agent: "other" }, current: first, runId: "run-1", agent: "builder", childIndex: 0 }), undefined);
99
99
 
100
100
  const settled = acceptChildWatchdogEvent({
101
101
  event: { ...firstEvent, seq: 2, phase: "idle", ts: 20 },
102
102
  current: first,
103
103
  runId: "run-1",
104
- agent: "worker",
104
+ agent: "builder",
105
105
  childIndex: 0,
106
106
  });
107
107
  assert.equal(settled?.phase, "idle");
@@ -110,7 +110,7 @@ describe("watchdog LSP diagnostics", () => {
110
110
  cwd: temp,
111
111
  root: temp,
112
112
  changedPaths: ["src/file.ts"],
113
- config: { enabled: true, timeoutMs: 500, maxFiles: 10, maxDiagnostics: 10 },
113
+ config: { enabled: true, timeoutMs: 5000, maxFiles: 10, maxDiagnostics: 10 },
114
114
  });
115
115
 
116
116
  assert.equal(diagnostics.status, "failed");
@@ -0,0 +1,79 @@
1
+ import assert from "node:assert/strict";
2
+ import * as fs from "node:fs";
3
+ import * as os from "node:os";
4
+ import * as path from "node:path";
5
+ import { describe, it } from "node:test";
6
+ import type { StreamFn } from "@earendil-works/pi-agent-core";
7
+ import { createAssistantMessageEventStream, fauxAssistantMessage, fauxToolCall, type AssistantMessage, type Model } from "@earendil-works/pi-ai";
8
+ import { createWatchdogPermissionArbiter } from "../../src/watchdog/permission-arbiter.ts";
9
+
10
+ function model(): Model<any> {
11
+ return { id: "watchdog", name: "watchdog", api: "faux", provider: "test", baseUrl: "https://example.invalid", reasoning: true, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 100_000, maxTokens: 4_096 };
12
+ }
13
+
14
+ function ctx(current = model()) {
15
+ return {
16
+ cwd: "/tmp/watchdog-permission",
17
+ model: current,
18
+ signal: undefined,
19
+ modelRegistry: {
20
+ getAvailable: () => [current],
21
+ find: (provider: string, id: string) => provider === current.provider && id === current.id ? current : undefined,
22
+ hasConfiguredAuth: () => true,
23
+ getApiKeyAndHeaders: async () => ({ ok: true as const, apiKey: "test-key" }),
24
+ getRegisteredProviderConfig: () => undefined,
25
+ },
26
+ } as never;
27
+ }
28
+
29
+ function responseStream(message: AssistantMessage) {
30
+ const stream = createAssistantMessageEventStream();
31
+ queueMicrotask(() => stream.push({ type: "done", reason: message.stopReason, message }));
32
+ return stream;
33
+ }
34
+
35
+ function stream(decision: "approve" | "deny", reason: string): StreamFn {
36
+ const responses = [
37
+ fauxAssistantMessage(fauxToolCall("watchdog_permission_decision", { decision, reason }), { stopReason: "toolUse" }),
38
+ fauxAssistantMessage("done", { stopReason: "stop" }),
39
+ ];
40
+ return () => responseStream(responses.shift()!);
41
+ }
42
+
43
+ const childConfig = JSON.stringify({
44
+ enabled: true,
45
+ watchdogTailTimeoutMs: 1_000,
46
+ agentEndTimeoutMs: 1_000,
47
+ maxWarnings: null,
48
+ lsp: { enabled: false, timeoutMs: 100, maxFiles: 1, maxDiagnostics: 1 },
49
+ autoFollowBlockers: false,
50
+ autoFollowMaxAttempts: null,
51
+ stalemateRepeats: 2,
52
+ });
53
+
54
+ describe("watchdog permission arbiter", () => {
55
+ it("approves and denies exact calls through the watchdog model decision tool", async () => {
56
+ const approved = await createWatchdogPermissionArbiter({ streamFn: stream("approve", "safe output path") })({ ctx: ctx(), toolName: "write", args: { path: "out.txt" }, rawWatchdogConfig: childConfig });
57
+ assert.deepEqual(approved, { approved: true, reason: "safe output path", source: "watchdog" });
58
+
59
+ const denied = await createWatchdogPermissionArbiter({ streamFn: stream("deny", "path is outside scope") })({ ctx: ctx(), toolName: "write", args: { path: "/etc/hosts" }, rawWatchdogConfig: childConfig });
60
+ assert.deepEqual(denied, { approved: false, reason: "path is outside scope", source: "watchdog" });
61
+ });
62
+
63
+ it("fails closed when the child watchdog is unavailable and audits redacted decisions", async () => {
64
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "watchdog-permission-"));
65
+ try {
66
+ const auditPath = path.join(dir, "audit.jsonl");
67
+ const result = await createWatchdogPermissionArbiter()({ ctx: ctx(), toolName: "write", args: { token: "secret-value", path: "out.txt" }, auditPath });
68
+ assert.equal(result.approved, false);
69
+ assert.match(result.reason, /disabled/);
70
+ const records = fs.readFileSync(auditPath, "utf-8").trim().split("\n").map((line) => JSON.parse(line) as Record<string, unknown>);
71
+ assert.equal(records.length, 2);
72
+ assert.equal(records[0]?.decisionSource, "watchdog");
73
+ assert.equal(records[1]?.decision, "unavailable");
74
+ assert.doesNotMatch(String(records[0]?.preview), /secret-value/);
75
+ } finally {
76
+ fs.rmSync(dir, { recursive: true, force: true });
77
+ }
78
+ });
79
+ });
@@ -337,7 +337,7 @@ describe("main watchdog runtime", () => {
337
337
  assert.equal(runtime.getSnapshot().lastWarning, undefined);
338
338
  });
339
339
 
340
- it("bounds review input before calling the reviewer", async () => {
340
+ it("bounds review input before calling the commentator", async () => {
341
341
  let reviewedDelta = "";
342
342
  const runtime = new MainWatchdogRuntime({
343
343
  resolveConfig: () => configResult(enabledConfig()),
@@ -87,7 +87,7 @@ describe("watchdog settings", () => {
87
87
  children: {
88
88
  autoFollow: { maxAttempts: 4 },
89
89
  overrides: {
90
- worker: { enabled: true, model: "anthropic/claude-test" },
90
+ builder: { enabled: true, model: "anthropic/claude-test" },
91
91
  },
92
92
  },
93
93
  guidance: { systemPromptPath: "/tmp/user-watchdog.md" },
@@ -105,8 +105,8 @@ describe("watchdog settings", () => {
105
105
  children: {
106
106
  autoFollow: { blockers: false },
107
107
  overrides: {
108
- worker: { thinking: "medium" },
109
- reviewer: { enabled: false },
108
+ builder: { thinking: "medium" },
109
+ commentator: { enabled: false },
110
110
  },
111
111
  },
112
112
  },
@@ -118,7 +118,7 @@ describe("watchdog settings", () => {
118
118
  autoFollow: { maxAttempts: null },
119
119
  children: {
120
120
  overrides: {
121
- worker: { enabled: false },
121
+ builder: { enabled: false },
122
122
  },
123
123
  },
124
124
  },
@@ -133,12 +133,12 @@ describe("watchdog settings", () => {
133
133
  assert.deepEqual(result.config.cadence, { everyNTools: 10 });
134
134
  assert.deepEqual(result.config.lsp, { enabled: false, timeoutMs: 1500, maxFiles: 4, maxDiagnostics: 7 });
135
135
  assert.deepEqual(result.config.children.autoFollow, { blockers: false, maxAttempts: 4, stalemateRepeats: 3 });
136
- assert.deepEqual(result.config.children.overrides.worker, {
136
+ assert.deepEqual(result.config.children.overrides.builder, {
137
137
  enabled: false,
138
138
  model: "anthropic/claude-test",
139
139
  thinking: "medium",
140
140
  });
141
- assert.deepEqual(result.config.children.overrides.reviewer, { enabled: false });
141
+ assert.deepEqual(result.config.children.overrides.commentator, { enabled: false });
142
142
  });
143
143
 
144
144
  it("returns exact validation errors at the watchdog boundary", () => {
@@ -166,7 +166,7 @@ describe("watchdog settings", () => {
166
166
  writeJson(userSettingsPath(), {
167
167
  subagents: {
168
168
  watchdog: {
169
- children: { overrides: { worker: { mode: "fast" } } },
169
+ children: { overrides: { builder: { mode: "fast" } } },
170
170
  },
171
171
  },
172
172
  });
@@ -174,7 +174,7 @@ describe("watchdog settings", () => {
174
174
  assert.throws(
175
175
  () => resolveWatchdogConfigStrict(tempProject),
176
176
  (error: unknown) => error instanceof Error
177
- && error.message === `Watchdog settings in '${userSettingsPath()}' have unknown field 'subagents.watchdog.children.overrides.worker.mode'.`,
177
+ && error.message === `Watchdog settings in '${userSettingsPath()}' have unknown field 'subagents.watchdog.children.overrides.builder.mode'.`,
178
178
  );
179
179
  });
180
180
 
@@ -38,17 +38,53 @@ function job(child: NestedRunSummary): AsyncJobState {
38
38
  }
39
39
 
40
40
  describe("nested widget rendering", () => {
41
- it("uses aggregate lines when collapsed and full child rows when expanded", () => {
42
- const child = nested("nested-reviewer", "root-run", "running", { currentTool: "read" });
41
+ it("renders a bounded collapsed tree and full child rows when expanded", () => {
42
+ const child = nested("nested-commentator", "root-run", "running", { currentTool: "read", model: "gpt-5.6-luna:medium", thinking: "medium" });
43
43
  const collapsed = buildWidgetLines([job(child)], theme as any, 120, false).join("\n");
44
- assert.match(collapsed, /↳ \[\d{2}:\d{2}:\d{2}\] \+1 nested run \(1 running\)/);
45
- assert.doesNotMatch(collapsed, /nested-reviewer · running/);
44
+ assert.match(collapsed, /↳ └─ \[\d{2}:\d{2}:\d{2}\] . nested-commentator · running · gpt-5.6-luna · thinking medium · read/);
45
+ assert.equal((collapsed.match(/thinking medium/g) ?? []).length, 1);
46
46
 
47
47
  const expanded = buildWidgetLines([job(child)], theme as any, 120, true).join("\n");
48
- assert.match(expanded, /↳ \[\d{2}:\d{2}:\d{2}\] . nested-reviewer · running · read/);
48
+ assert.match(expanded, /↳ \[\d{2}:\d{2}:\d{2}\] . nested-commentator · running · gpt-5.6-luna · thinking medium · read/);
49
49
 
50
50
  const epoch = buildWidgetLines([job(nested("epoch", "root-run", "running", { lastUpdate: 0, startedAt: 0 }))], theme as any, 120, false).join("\n");
51
- assert.match(epoch, /↳ \[\d{2}:\d{2}:\d{2}\] \+1 nested run/);
51
+ assert.match(epoch, /↳ └─ \[\d{2}:\d{2}:\d{2}\] . epoch · running/);
52
+ });
53
+
54
+ it("shows four direct leaves and one overflow row while retaining completed siblings", () => {
55
+ const root = nested("parallel-owner", "root-run", "running", {
56
+ mode: "parallel",
57
+ steps: ["one", "two", "three", "four", "five"].map((agent, index) => ({
58
+ agent,
59
+ status: index === 0 ? "complete" as const : "running" as const,
60
+ model: index === 0 ? "gpt-5.6-luna:medium" : "gpt-5.6-luna",
61
+ thinking: "medium",
62
+ })),
63
+ });
64
+ const collapsed = buildWidgetLines([job(root)], theme as any, 160, false).join("\n");
65
+ assert.match(collapsed, /parallel-owner · running/);
66
+ for (const [agent, state] of [["one", "complete"], ["two", "running"], ["three", "running"], ["four", "running"]] as const) {
67
+ const line = collapsed.split("\n").find((candidate) => candidate.includes(` ${agent} ·`));
68
+ assert.ok(line);
69
+ assert.match(line!, /\[\d{2}:\d{2}:\d{2}\] /);
70
+ assert.match(line!, /gpt-5.6-luna/);
71
+ assert.match(line!, /thinking medium/);
72
+ assert.match(line!, new RegExp(state));
73
+ }
74
+ assert.doesNotMatch(collapsed, /five · running/);
75
+
76
+ const chain = nested("chain-owner", "root-run", "running", {
77
+ mode: "chain",
78
+ steps: ["first", "second"].map((agent) => ({ agent, status: "running" as const })),
79
+ });
80
+ const chainCollapsed = buildWidgetLines([job(chain)], theme as any, 160, false).join("\n");
81
+ for (const agent of ["first", "second"]) {
82
+ const line = chainCollapsed.split("\n").find((candidate) => candidate.includes(` ${agent} ·`));
83
+ assert.ok(line);
84
+ assert.match(line!, /\[\d{2}:\d{2}:\d{2}\] /);
85
+ }
86
+ assert.match(collapsed, /\+1 more nested leaves/);
87
+ assert.equal((collapsed.match(/thinking medium/g) ?? []).length, 4);
52
88
  });
53
89
 
54
90
  it("collapses descendants beyond the nested depth budget", () => {
@@ -101,7 +137,7 @@ describe("nested widget rendering", () => {
101
137
  });
102
138
 
103
139
  it("keeps event-time timestamps stable instead of advancing with wall time", async () => {
104
- const state = job(nested("nested-reviewer", "root-run", "running", { currentTool: "read", currentToolStartedAt: 0 }));
140
+ const state = job(nested("nested-commentator", "root-run", "running", { currentTool: "read", currentToolStartedAt: 0 }));
105
141
  const first = buildWidgetLines([state], theme as any, 120, true);
106
142
  await new Promise((resolve) => setTimeout(resolve, 20));
107
143
  const second = buildWidgetLines([state], theme as any, 120, true);
@@ -109,8 +145,8 @@ describe("nested widget rendering", () => {
109
145
  });
110
146
 
111
147
  it("rerenders when only nested state changes", () => {
112
- const first = job(nested("nested-reviewer", "root-run", "running"));
113
- const second = job(nested("nested-reviewer", "root-run", "complete"));
148
+ const first = job(nested("nested-commentator", "root-run", "running"));
149
+ const second = job(nested("nested-commentator", "root-run", "complete"));
114
150
  assert.notEqual(widgetRenderKey(first), widgetRenderKey(second));
115
151
  });
116
152
  });
@@ -0,0 +1,197 @@
1
+ import assert from "node:assert/strict";
2
+ import { spawnSync } from "node:child_process";
3
+ import * as fs from "node:fs";
4
+ import * as os from "node:os";
5
+ import * as path from "node:path";
6
+ import { describe, it } from "node:test";
7
+ import { isSameGitRepository, resolveWorkflowChatProgress } from "../../src/workflows/chat-progress.ts";
8
+ import { renderSubagentResult } from "../../src/tui/render.ts";
9
+ import { createSubagentExecutor, foregroundResultIntercomStatus, shouldSuppressRoutineResultIntercom } from "../../src/runs/foreground/subagent-executor.ts";
10
+ import type { Details, SingleResult, SubagentState } from "../../src/shared/types.ts";
11
+
12
+ const theme = {
13
+ fg(_name: string, text: string): string { return text; },
14
+ bold(text: string): string { return text; },
15
+ };
16
+
17
+ function git(cwd: string, args: string[]): string {
18
+ const result = spawnSync("git", ["-C", cwd, ...args], { encoding: "utf-8" });
19
+ if (result.status !== 0) throw new Error(result.stderr.trim() || result.stdout.trim() || `git ${args.join(" ")} failed`);
20
+ return result.stdout.trim();
21
+ }
22
+
23
+ function createRepo(prefix: string): string {
24
+ const repo = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
25
+ git(repo, ["init"]);
26
+ git(repo, ["config", "user.email", "tests@example.com"]);
27
+ git(repo, ["config", "user.name", "Workflow Progress Tests"]);
28
+ fs.writeFileSync(path.join(repo, "tracked.txt"), "initial\n", "utf-8");
29
+ git(repo, ["add", "-A"]);
30
+ git(repo, ["commit", "-m", "initial"]);
31
+ return repo;
32
+ }
33
+
34
+ function componentText(component: unknown): string {
35
+ if (typeof component !== "object" || component === null) return "";
36
+ if ("text" in component && typeof component.text === "string") return component.text;
37
+ if ("children" in component && Array.isArray(component.children)) return component.children.map(componentText).filter(Boolean).join("\n");
38
+ return "";
39
+ }
40
+
41
+ function createState(): SubagentState {
42
+ return {
43
+ baseCwd: "",
44
+ currentSessionId: null,
45
+ asyncJobs: new Map(),
46
+ foregroundRuns: new Map(),
47
+ foregroundControls: new Map(),
48
+ lastForegroundControlId: null,
49
+ pendingForegroundControlNotices: new Map(),
50
+ cleanupTimers: new Map(),
51
+ lastUiContext: null,
52
+ poller: null,
53
+ completionSeen: new Map(),
54
+ watcher: null,
55
+ watcherRestartTimer: null,
56
+ resultFileCoalescer: { schedule: () => false, clear: () => {} },
57
+ };
58
+ }
59
+
60
+ function createExecutor() {
61
+ return createSubagentExecutor({
62
+ pi: { events: { emit() {}, on() { return () => {}; } }, getSessionName() { return "parent"; } } as any,
63
+ state: createState(),
64
+ config: { maxSubagentDepth: 2, control: {}, intercomBridge: {} } as any,
65
+ asyncByDefault: false,
66
+ tempArtifactsDir: os.tmpdir(),
67
+ getSubagentSessionRoot: () => os.tmpdir(),
68
+ expandTilde: (value) => value,
69
+ discoverAgents: () => ({ agents: [] as any[] }),
70
+ });
71
+ }
72
+
73
+ function ctx(root: string) {
74
+ return {
75
+ cwd: root,
76
+ hasUI: false,
77
+ sessionManager: { getSessionId() { return "session"; }, getSessionFile() { return null; } },
78
+ modelRegistry: { getAvailable() { return []; } },
79
+ model: { provider: "test", id: "test-model" },
80
+ } as any;
81
+ }
82
+
83
+ describe("workflow chat progress policy", () => {
84
+ it("treats managed worktrees as same repo and sibling repos as other repo", () => {
85
+ const repo = createRepo("pi-workflow-progress-repo-");
86
+ const other = createRepo("pi-workflow-progress-other-");
87
+ const worktree = path.join(os.tmpdir(), `pi-workflow-progress-wt-${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2)}`);
88
+ try {
89
+ fs.mkdirSync(path.join(repo, "packages"));
90
+ git(repo, ["worktree", "add", "-b", "chat-progress-test", worktree, "HEAD"]);
91
+ assert.equal(isSameGitRepository(repo, path.join(repo, "packages")), true);
92
+ assert.equal(isSameGitRepository(repo, worktree), true);
93
+ assert.equal(isSameGitRepository(repo, other), false);
94
+
95
+ assert.equal(resolveWorkflowChatProgress({ requested: "auto", parentCwd: repo, workflowCwd: worktree, background: false }).projection?.mode, "live-card");
96
+ assert.equal(resolveWorkflowChatProgress({ requested: "auto", parentCwd: repo, workflowCwd: worktree, background: true }).projection?.mode, "milestones");
97
+ assert.equal(resolveWorkflowChatProgress({ requested: "auto", parentCwd: repo, workflowCwd: other, background: false }).projection?.mode, "terminal");
98
+ assert.match(resolveWorkflowChatProgress({ requested: "live-card", parentCwd: repo, workflowCwd: other, background: false }).error ?? "", /same Git repository/i);
99
+ } finally {
100
+ try { git(repo, ["worktree", "remove", "--force", worktree]); } catch {}
101
+ fs.rmSync(repo, { recursive: true, force: true });
102
+ fs.rmSync(other, { recursive: true, force: true });
103
+ fs.rmSync(worktree, { recursive: true, force: true });
104
+ }
105
+ });
106
+ });
107
+
108
+ describe("workflow chat progress rendering", () => {
109
+ it("emits live-card updates for same-repo watched workflowScript runs", async () => {
110
+ const repo = createRepo("pi-workflow-progress-executor-");
111
+ try {
112
+ const updates: Array<{ details?: Details }> = [];
113
+ const result = await createExecutor().execute(
114
+ "wf-live",
115
+ { workflowScript: `return await runs.run("explorer", { agent: "missing-agent", task: "scan", phase: "Validation", label: "Find renderer seam" });`, async: false },
116
+ new AbortController().signal,
117
+ (update) => updates.push(update),
118
+ ctx(repo),
119
+ );
120
+ assert.equal(result.isError, true);
121
+ const liveUpdate = updates.find((update) => update.details?.chatProgress?.mode === "live-card");
122
+ assert.ok(liveUpdate, "expected a live-card update");
123
+ assert.equal(liveUpdate.details?.workflow?.trace[0]?.key, "explorer");
124
+ assert.equal(liveUpdate.details?.workflow?.trace[0]?.phase, "Validation");
125
+ assert.equal(liveUpdate.details?.workflow?.trace[0]?.label, "Find renderer seam");
126
+ } finally {
127
+ fs.rmSync(repo, { recursive: true, force: true });
128
+ }
129
+ });
130
+
131
+ it("renders stable rows keyed by workflow trace entries", () => {
132
+ const text = componentText(renderSubagentResult({
133
+ content: [{ type: "text", text: "Workflow running." }],
134
+ details: {
135
+ mode: "workflow",
136
+ runId: "wf_8f3a123456",
137
+ results: [],
138
+ chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
139
+ workflow: {
140
+ trace: [
141
+ { operation: "run", key: "explorer", state: "completed", runId: "run-explorer", phase: "Validation", label: "Found renderer seam", durationMs: 12 },
142
+ { operation: "run", key: "tests", state: "started", phase: "Validation", label: "focused integration suite" },
143
+ { operation: "run", key: "review", state: "failed", phase: "Validation", label: "fresh-context UX review", error: "needs fixes" },
144
+ ],
145
+ emits: [],
146
+ console: [],
147
+ },
148
+ },
149
+ }, { expanded: false }, theme as any));
150
+
151
+ assert.match(text, /workflow wf_8f3a12345 .* same repo .* failed/);
152
+ assert.match(text, /Repo pi-subagents/);
153
+ assert.match(text, /Phase Validation/);
154
+ assert.match(text, /complete\s+explorer Found renderer seam/);
155
+ assert.match(text, /running\s+tests focused integration suite/);
156
+ assert.match(text, /failed\s+review fresh-context UX review .* needs fixes/);
157
+ });
158
+
159
+ it("suppresses only successful routine child result intercom for live-card workflows", () => {
160
+ const completed = { agent: "explorer", exitCode: 0, outputState: "present" } as SingleResult;
161
+ const failed = { agent: "explorer", exitCode: 1, outputState: "present" } as SingleResult;
162
+ const rejected = { agent: "explorer", exitCode: 0, acceptance: { status: "rejected" }, outputState: "present" } as SingleResult;
163
+
164
+ assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: true, results: [completed] }), true);
165
+ assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: true, results: [failed] }), false);
166
+ assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: true, results: [rejected] }), false);
167
+ assert.equal(shouldSuppressRoutineResultIntercom({ suppressRoutineResultIntercom: false, results: [completed] }), false);
168
+ });
169
+
170
+ it("marks acceptance-rejected foreground intercom results as failed", () => {
171
+ const rejected = { agent: "explorer", exitCode: 0, acceptance: { status: "rejected" }, outputState: "present" } as SingleResult;
172
+
173
+ assert.equal(foregroundResultIntercomStatus(rejected), "failed");
174
+ });
175
+
176
+ it("shows final workflow output after live-card progress completes", () => {
177
+ const text = componentText(renderSubagentResult({
178
+ content: [{ type: "text", text: "Workflow completed.\n\nReturn:\nfinal answer" }],
179
+ details: {
180
+ mode: "workflow",
181
+ runId: "wf_done",
182
+ results: [],
183
+ chatProgress: { mode: "live-card", repoRelation: "same", repoLabel: "pi-subagents" },
184
+ workflow: {
185
+ value: "final answer",
186
+ trace: [{ operation: "run", key: "explorer", state: "completed", runId: "run-explorer" }],
187
+ emits: [],
188
+ console: [],
189
+ },
190
+ },
191
+ }, { expanded: true }, theme as any));
192
+
193
+ assert.match(text, /Workflow completed/);
194
+ assert.match(text, /final answer/);
195
+ assert.doesNotMatch(text, /workflow wf_done/);
196
+ });
197
+ });
@@ -7,7 +7,7 @@ describe("workflow graph snapshots", () => {
7
7
  const graph = buildWorkflowGraphSnapshot({
8
8
  runId: "run-1",
9
9
  steps: [
10
- { agent: "scout", task: "Scan", phase: "Research", label: "Find context", as: "context" },
10
+ { agent: "explorer", task: "Scan", phase: "Research", label: "Find context", as: "context" },
11
11
  { agent: "writer", task: "Use {outputs.context}", phase: "Synthesis", outputSchema: { type: "object" } },
12
12
  ],
13
13
  results: [{ exitCode: 0 }, { exitCode: 1, error: "bad output" }],
@@ -25,9 +25,9 @@ describe("workflow graph snapshots", () => {
25
25
  ]);
26
26
  });
27
27
 
28
- it("maps a long alternating worker and reviewer chain without losing indexes", () => {
28
+ it("maps a long alternating builder and commentator chain without losing indexes", () => {
29
29
  const steps = Array.from({ length: 40 }, (_, index) => ({
30
- agent: index % 2 === 0 ? "worker" : "reviewer",
30
+ agent: index % 2 === 0 ? "builder" : "commentator",
31
31
  task: index === 0 ? "Start" : "{previous}",
32
32
  }));
33
33
  const results = steps.map(() => ({ exitCode: 0 }));
@@ -43,10 +43,10 @@ describe("workflow graph snapshots", () => {
43
43
  assert.equal(graph.nodes[0]?.id, "step-0");
44
44
  assert.equal(graph.nodes[0]?.flatIndex, 0);
45
45
  assert.equal(graph.nodes[37]?.id, "step-37");
46
- assert.equal(graph.nodes[37]?.agent, "reviewer");
46
+ assert.equal(graph.nodes[37]?.agent, "commentator");
47
47
  assert.equal(graph.nodes[37]?.flatIndex, 37);
48
48
  assert.equal(graph.nodes[39]?.id, "step-39");
49
- assert.equal(graph.nodes[39]?.agent, "reviewer");
49
+ assert.equal(graph.nodes[39]?.agent, "commentator");
50
50
  assert.equal(graph.nodes[39]?.flatIndex, 39);
51
51
  assert.equal(graph.currentNodeId, "step-37");
52
52
  });
@@ -58,7 +58,7 @@ describe("workflow graph snapshots", () => {
58
58
  { agent: "setup", task: "Setup" },
59
59
  {
60
60
  parallel: [
61
- { agent: "reviewer", label: "Correctness", phase: "Review", as: "correctness" },
61
+ { agent: "commentator", label: "Correctness", phase: "Review", as: "correctness" },
62
62
  { agent: "security", label: "Security", phase: "Review", as: "security" },
63
63
  ],
64
64
  },
@@ -107,7 +107,7 @@ describe("workflow graph snapshots", () => {
107
107
  it("uses dynamic group status overrides for empty or aggregate-failure fanout states", () => {
108
108
  const steps = [{
109
109
  expand: { from: { output: "targets", path: "/items" }, maxItems: 4 },
110
- parallel: { agent: "reviewer", task: "Review {item}" },
110
+ parallel: { agent: "commentator", task: "Review {item}" },
111
111
  collect: { as: "reviews" },
112
112
  }];
113
113
 
@@ -123,7 +123,7 @@ describe("workflow graph snapshots", () => {
123
123
  const collectFailure = buildWorkflowGraphSnapshot({
124
124
  runId: "run-dynamic-collect-fail",
125
125
  steps,
126
- dynamicChildren: { 0: [{ agent: "reviewer", flatIndex: 0, itemKey: "a" }] },
126
+ dynamicChildren: { 0: [{ agent: "commentator", flatIndex: 0, itemKey: "a" }] },
127
127
  results: [{ exitCode: 0 }],
128
128
  dynamicGroupStatuses: { 0: { status: "failed", error: "Collected output validation failed" } },
129
129
  });