@entelligentsia/forgecli 1.0.25 → 1.0.40

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 (590) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/README.md +2 -0
  3. package/dist/CHANGELOG-forge-plugin.md +264 -0
  4. package/dist/CHANGELOG-pi.md +143 -0
  5. package/dist/bin/argv.d.ts +2 -2
  6. package/dist/bin/argv.js +37 -0
  7. package/dist/bin/argv.js.map +1 -1
  8. package/dist/bin/forge.js +30 -16
  9. package/dist/bin/forge.js.map +1 -1
  10. package/dist/bin/init.d.ts +23 -0
  11. package/dist/bin/init.js +123 -0
  12. package/dist/bin/init.js.map +1 -0
  13. package/dist/bin/reset.d.ts +39 -0
  14. package/dist/bin/reset.js +101 -0
  15. package/dist/bin/reset.js.map +1 -0
  16. package/dist/bin/uninstall.d.ts +20 -0
  17. package/dist/bin/uninstall.js +141 -0
  18. package/dist/bin/uninstall.js.map +1 -0
  19. package/dist/extensions/forgecli/claude-bootstrap/bootstrap.d.ts +40 -0
  20. package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js +384 -0
  21. package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js.map +1 -0
  22. package/dist/extensions/forgecli/claude-bootstrap/settings-merge.d.ts +46 -0
  23. package/dist/extensions/forgecli/claude-bootstrap/settings-merge.js +245 -0
  24. package/dist/extensions/forgecli/claude-bootstrap/settings-merge.js.map +1 -0
  25. package/dist/extensions/forgecli/claude-bootstrap/uninstall.d.ts +23 -0
  26. package/dist/extensions/forgecli/claude-bootstrap/uninstall.js +235 -0
  27. package/dist/extensions/forgecli/claude-bootstrap/uninstall.js.map +1 -0
  28. package/dist/extensions/forgecli/commands/reset.d.ts +16 -0
  29. package/dist/extensions/forgecli/commands/reset.js +83 -0
  30. package/dist/extensions/forgecli/commands/reset.js.map +1 -0
  31. package/dist/extensions/forgecli/dashboard/component.js +10 -7
  32. package/dist/extensions/forgecli/dashboard/component.js.map +1 -1
  33. package/dist/extensions/forgecli/forge-commands.d.ts +7 -2
  34. package/dist/extensions/forgecli/forge-commands.js +19 -5
  35. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  36. package/dist/extensions/forgecli/forge-subagent.d.ts +4 -4
  37. package/dist/extensions/forgecli/hooks/forge-permissions.js +20 -6
  38. package/dist/extensions/forgecli/hooks/forge-permissions.js.map +1 -1
  39. package/dist/extensions/forgecli/index.js +6 -3
  40. package/dist/extensions/forgecli/index.js.map +1 -1
  41. package/dist/extensions/forgecli/lib/forge-root.d.ts +6 -0
  42. package/dist/extensions/forgecli/lib/forge-root.js +52 -0
  43. package/dist/extensions/forgecli/lib/forge-root.js.map +1 -1
  44. package/dist/extensions/forgecli/lib/payload-manifest.d.ts +62 -0
  45. package/dist/extensions/forgecli/lib/payload-manifest.js +151 -0
  46. package/dist/extensions/forgecli/lib/payload-manifest.js.map +1 -0
  47. package/dist/extensions/forgecli/orchestrators/advisory-render.d.ts +9 -0
  48. package/dist/extensions/forgecli/orchestrators/advisory-render.js +107 -0
  49. package/dist/extensions/forgecli/orchestrators/advisory-render.js.map +1 -0
  50. package/dist/extensions/forgecli/orchestrators/bug/bug-body.d.ts +1 -0
  51. package/dist/extensions/forgecli/orchestrators/bug/bug-body.js +65 -0
  52. package/dist/extensions/forgecli/orchestrators/bug/bug-body.js.map +1 -0
  53. package/dist/extensions/forgecli/orchestrators/bug/bug-id.d.ts +23 -0
  54. package/dist/extensions/forgecli/orchestrators/bug/bug-id.js +140 -0
  55. package/dist/extensions/forgecli/orchestrators/bug/bug-id.js.map +1 -0
  56. package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.d.ts +54 -0
  57. package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.js +349 -0
  58. package/dist/extensions/forgecli/orchestrators/bug/bug-phase-dispatch.js.map +1 -0
  59. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.d.ts +11 -0
  60. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js +82 -0
  61. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js.map +1 -0
  62. package/dist/extensions/forgecli/orchestrators/bug/bug-state.d.ts +14 -0
  63. package/dist/extensions/forgecli/orchestrators/bug/bug-state.js +100 -0
  64. package/dist/extensions/forgecli/orchestrators/bug/bug-state.js.map +1 -0
  65. package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.d.ts +72 -0
  66. package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.js +204 -0
  67. package/dist/extensions/forgecli/orchestrators/bug/bug-triage-routing.js.map +1 -0
  68. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.d.ts +38 -0
  69. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js +198 -0
  70. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js.map +1 -0
  71. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.d.ts +3 -0
  72. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.js +55 -0
  73. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict.js.map +1 -0
  74. package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.d.ts +7 -0
  75. package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.js +293 -0
  76. package/dist/extensions/forgecli/orchestrators/bug/run-bug-command.js.map +1 -0
  77. package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.d.ts +2 -0
  78. package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js +501 -0
  79. package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js.map +1 -0
  80. package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.d.ts +41 -0
  81. package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.js +5 -0
  82. package/dist/extensions/forgecli/orchestrators/bug/run-bug-types.js.map +1 -0
  83. package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.d.ts +43 -0
  84. package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.js +85 -0
  85. package/dist/extensions/forgecli/orchestrators/common/orchestrator-entry.js.map +1 -0
  86. package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.d.ts +8 -0
  87. package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.js +37 -0
  88. package/dist/extensions/forgecli/orchestrators/common/orchestrator-misc.js.map +1 -0
  89. package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.d.ts +28 -0
  90. package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.js +45 -0
  91. package/dist/extensions/forgecli/orchestrators/common/orchestrator-notify.js.map +1 -0
  92. package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.d.ts +26 -0
  93. package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.js +75 -0
  94. package/dist/extensions/forgecli/orchestrators/common/orchestrator-transcript-session.js.map +1 -0
  95. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.d.ts +24 -0
  96. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js +58 -0
  97. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js.map +1 -0
  98. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.d.ts +53 -0
  99. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js +131 -0
  100. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js.map +1 -0
  101. package/dist/extensions/forgecli/orchestrators/common/summary-recovery.d.ts +24 -0
  102. package/dist/extensions/forgecli/orchestrators/common/summary-recovery.js +37 -0
  103. package/dist/extensions/forgecli/orchestrators/common/summary-recovery.js.map +1 -0
  104. package/dist/extensions/forgecli/orchestrators/fix-bug.d.ts +9 -93
  105. package/dist/extensions/forgecli/orchestrators/fix-bug.js +23 -1721
  106. package/dist/extensions/forgecli/orchestrators/fix-bug.js.map +1 -1
  107. package/dist/extensions/forgecli/orchestrators/halt-advisor.js +25 -3
  108. package/dist/extensions/forgecli/orchestrators/halt-advisor.js.map +1 -1
  109. package/dist/extensions/forgecli/orchestrators/run-sprint.d.ts +3 -12
  110. package/dist/extensions/forgecli/orchestrators/run-sprint.js +48 -270
  111. package/dist/extensions/forgecli/orchestrators/run-sprint.js.map +1 -1
  112. package/dist/extensions/forgecli/orchestrators/run-task.d.ts +10 -214
  113. package/dist/extensions/forgecli/orchestrators/run-task.js +31 -1481
  114. package/dist/extensions/forgecli/orchestrators/run-task.js.map +1 -1
  115. package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.d.ts +33 -0
  116. package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.js +135 -0
  117. package/dist/extensions/forgecli/orchestrators/sprint/sprint-ceremony.js.map +1 -0
  118. package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.d.ts +18 -0
  119. package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.js +55 -0
  120. package/dist/extensions/forgecli/orchestrators/sprint/sprint-state.js.map +1 -0
  121. package/dist/extensions/forgecli/orchestrators/task/run-task-command.d.ts +9 -0
  122. package/dist/extensions/forgecli/orchestrators/task/run-task-command.js +174 -0
  123. package/dist/extensions/forgecli/orchestrators/task/run-task-command.js.map +1 -0
  124. package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.d.ts +2 -0
  125. package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js +494 -0
  126. package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js.map +1 -0
  127. package/dist/extensions/forgecli/orchestrators/task/run-task-types.d.ts +62 -0
  128. package/dist/extensions/forgecli/orchestrators/task/run-task-types.js +5 -0
  129. package/dist/extensions/forgecli/orchestrators/task/run-task-types.js.map +1 -0
  130. package/dist/extensions/forgecli/orchestrators/task/task-body.d.ts +4 -0
  131. package/dist/extensions/forgecli/orchestrators/task/task-body.js +48 -0
  132. package/dist/extensions/forgecli/orchestrators/task/task-body.js.map +1 -0
  133. package/dist/extensions/forgecli/orchestrators/task/task-events.d.ts +63 -0
  134. package/dist/extensions/forgecli/orchestrators/task/task-events.js +185 -0
  135. package/dist/extensions/forgecli/orchestrators/task/task-events.js.map +1 -0
  136. package/dist/extensions/forgecli/orchestrators/task/task-gates.d.ts +34 -0
  137. package/dist/extensions/forgecli/orchestrators/task/task-gates.js +78 -0
  138. package/dist/extensions/forgecli/orchestrators/task/task-gates.js.map +1 -0
  139. package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.d.ts +42 -0
  140. package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.js +370 -0
  141. package/dist/extensions/forgecli/orchestrators/task/task-phase-dispatch.js.map +1 -0
  142. package/dist/extensions/forgecli/orchestrators/task/task-phases.d.ts +17 -0
  143. package/dist/extensions/forgecli/orchestrators/task/task-phases.js +48 -0
  144. package/dist/extensions/forgecli/orchestrators/task/task-phases.js.map +1 -0
  145. package/dist/extensions/forgecli/orchestrators/task/task-record.d.ts +9 -0
  146. package/dist/extensions/forgecli/orchestrators/task/task-record.js +58 -0
  147. package/dist/extensions/forgecli/orchestrators/task/task-record.js.map +1 -0
  148. package/dist/extensions/forgecli/orchestrators/task/task-state.d.ts +14 -0
  149. package/dist/extensions/forgecli/orchestrators/task/task-state.js +35 -0
  150. package/dist/extensions/forgecli/orchestrators/task/task-state.js.map +1 -0
  151. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.d.ts +36 -0
  152. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js +187 -0
  153. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js.map +1 -0
  154. package/dist/extensions/forgecli/store/store-resolver.d.ts +15 -0
  155. package/dist/extensions/forgecli/store/store-resolver.js +118 -18
  156. package/dist/extensions/forgecli/store/store-resolver.js.map +1 -1
  157. package/dist/extensions/forgecli/update/forge-update-command.js +10 -7
  158. package/dist/extensions/forgecli/update/forge-update-command.js.map +1 -1
  159. package/dist/forge-payload/.base-pack/workflows/collator_agent.md +5 -6
  160. package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +1 -1
  161. package/dist/forge-payload/.base-pack/workflows-js/wfl-init.js +449 -0
  162. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  163. package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
  164. package/dist/forge-payload/.schemas/migrations.json +170 -0
  165. package/dist/forge-payload/.schemas/payload-manifest.schema.json +100 -0
  166. package/dist/forge-payload/commands/add-pipeline.md +1 -1
  167. package/dist/forge-payload/commands/add-task.md +3 -3
  168. package/dist/forge-payload/{.base-pack/commands → commands}/approve.md +2 -2
  169. package/dist/forge-payload/commands/ask.md +1 -1
  170. package/dist/forge-payload/commands/check-agent.md +8 -24
  171. package/dist/forge-payload/{.base-pack/commands → commands}/collate.md +2 -2
  172. package/dist/forge-payload/{.base-pack/commands → commands}/commit.md +2 -2
  173. package/dist/forge-payload/commands/config.md +1 -1
  174. package/dist/forge-payload/commands/enhance.md +31 -5
  175. package/dist/forge-payload/{.base-pack/commands → commands}/fix-bug.md +2 -2
  176. package/dist/forge-payload/commands/health.md +1 -1
  177. package/dist/forge-payload/{.base-pack/commands → commands}/implement.md +2 -2
  178. package/dist/forge-payload/commands/init.md +186 -67
  179. package/dist/forge-payload/{.base-pack/commands → commands}/new-sprint.md +2 -2
  180. package/dist/forge-payload/{.base-pack/commands → commands}/plan-sprint.md +2 -2
  181. package/dist/forge-payload/{.base-pack/commands → commands}/plan.md +2 -2
  182. package/dist/forge-payload/commands/rebuild.md +3 -3
  183. package/dist/forge-payload/commands/remove.md +1 -1
  184. package/dist/forge-payload/commands/repair.md +1 -1
  185. package/dist/forge-payload/commands/report-bug.md +1 -1
  186. package/dist/forge-payload/commands/reset.md +117 -0
  187. package/dist/forge-payload/{.base-pack/commands → commands}/retro.md +2 -2
  188. package/dist/forge-payload/{.base-pack/commands → commands}/review-code.md +2 -2
  189. package/dist/forge-payload/{.base-pack/commands → commands}/review-plan.md +2 -2
  190. package/dist/forge-payload/{.base-pack/commands → commands}/run-sprint.md +2 -2
  191. package/dist/forge-payload/{.base-pack/commands → commands}/run-task.md +2 -2
  192. package/dist/forge-payload/commands/status.md +1 -1
  193. package/dist/forge-payload/commands/update.md +3 -3
  194. package/dist/forge-payload/{.base-pack/commands → commands}/validate.md +2 -2
  195. package/dist/forge-payload/hooks/forge-permissions.cjs +29 -6
  196. package/dist/forge-payload/hooks/lib/common.cjs +228 -0
  197. package/dist/forge-payload/hooks/lib/plugin-detection.cjs +106 -0
  198. package/dist/forge-payload/hooks/lib/update-msg.cjs +23 -0
  199. package/dist/forge-payload/hooks/lib/update-url.cjs +46 -0
  200. package/dist/forge-payload/hooks/lib/write-registry.js +53 -0
  201. package/dist/forge-payload/init/discovery/discover-database.md +32 -0
  202. package/dist/forge-payload/init/discovery/discover-processes.md +31 -0
  203. package/dist/forge-payload/init/discovery/discover-routing.md +31 -0
  204. package/dist/forge-payload/init/discovery/discover-stack.md +33 -0
  205. package/dist/forge-payload/init/discovery/discover-testing.md +34 -0
  206. package/dist/forge-payload/init/generation/generate-commands.md +171 -0
  207. package/dist/forge-payload/init/generation/generate-kb-doc.md +60 -0
  208. package/dist/forge-payload/init/generation/generate-persona.md +73 -0
  209. package/dist/forge-payload/init/generation/generate-skill.md +66 -0
  210. package/dist/forge-payload/init/generation/generate-template.md +60 -0
  211. package/dist/forge-payload/init/generation/generate-tools.md +133 -0
  212. package/dist/forge-payload/init/generation/generate-workflows.md +78 -0
  213. package/dist/forge-payload/init/phases/phase-1-collect.md +10 -2
  214. package/dist/forge-payload/init/phases/phase-3-materialize.md +5 -1
  215. package/dist/forge-payload/init/phases/phase-4-register.md +8 -0
  216. package/dist/forge-payload/init/workflow-gen-plan.json +17 -0
  217. package/dist/forge-payload/integrity.json +33 -18
  218. package/dist/forge-payload/meta/workflows/meta-collate.md +5 -6
  219. package/dist/forge-payload/meta/workflows/meta-migrate.md +1 -1
  220. package/dist/forge-payload/payload-manifest.json +314 -0
  221. package/dist/forge-payload/schemas/enum-catalog.json +2 -2
  222. package/dist/forge-payload/schemas/payload-manifest.schema.json +100 -0
  223. package/dist/forge-payload/schemas/structure-manifest.json +5 -12
  224. package/dist/forge-payload/tools/forge-preflight.cjs +268 -0
  225. package/dist/forge-payload/tools/lib/paths.cjs +12 -11
  226. package/dist/forge-payload/tools/lib/pricing.cjs +31 -11
  227. package/dist/forge-payload/tools/query-logger.cjs +34 -0
  228. package/dist/forge-payload/tools/reset-plan.cjs +210 -0
  229. package/dist/forge-payload/tools/store.cjs +4 -1
  230. package/dist/forge-payload/tools/substitute-placeholders.cjs +14 -7
  231. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  232. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +8 -0
  233. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  234. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +1 -1
  235. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  236. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +1 -1
  237. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +4 -0
  239. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +1 -0
  240. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +3 -0
  241. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +1 -0
  242. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +20 -0
  243. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +1 -0
  244. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +92 -0
  245. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +1 -0
  246. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +18 -0
  247. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +1 -0
  248. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +42 -0
  249. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +1 -0
  250. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +10 -0
  251. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +1 -0
  252. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +31 -0
  253. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +1 -0
  254. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +30 -0
  255. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +1 -0
  256. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +170 -0
  257. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +1 -0
  258. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +26 -0
  259. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +1 -0
  260. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +90 -0
  261. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +1 -0
  262. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -1
  263. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  265. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  266. package/node_modules/@earendil-works/pi-ai/README.md +12 -4
  267. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  268. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +3 -0
  269. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  270. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +45 -0
  271. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  272. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +45 -0
  273. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  274. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +1804 -815
  275. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  276. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2031 -1384
  277. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  278. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  279. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +71 -27
  280. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  281. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +1 -1
  282. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  283. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +24 -16
  284. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  285. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  286. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
  287. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  288. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  289. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +3 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  291. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +35 -13
  293. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  294. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
  295. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
  297. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  298. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -0
  299. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
  300. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +12 -4
  301. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  302. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  303. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  304. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +13 -1
  305. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  306. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  307. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
  308. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  309. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -1
  310. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  311. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -2
  312. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  313. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  314. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +143 -0
  315. package/node_modules/@earendil-works/pi-coding-agent/README.md +26 -4
  316. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +1 -0
  317. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  318. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +11 -0
  319. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  320. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts +10 -0
  321. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts.map +1 -0
  322. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js +48 -0
  323. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js.map +1 -0
  324. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts +17 -0
  325. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts.map +1 -0
  326. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js +128 -0
  327. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js.map +1 -0
  328. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  329. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +9 -1
  330. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  331. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts +3 -1
  332. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -1
  333. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +4 -1
  334. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js.map +1 -1
  335. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts +2 -1
  336. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts.map +1 -1
  337. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +2 -2
  338. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js.map +1 -1
  339. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +4 -1
  340. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  341. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +16 -3
  342. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  343. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  344. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +4 -3
  345. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  346. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +3 -1
  347. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  348. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +9 -3
  349. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  350. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +1 -1
  351. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  352. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +1 -1
  353. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  354. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts +2 -0
  355. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts.map +1 -0
  356. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js +4 -0
  357. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js.map +1 -0
  358. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +19 -6
  359. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  360. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  361. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  362. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts +1 -1
  363. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  364. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +4 -4
  365. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  366. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +10 -3
  367. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  368. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +47 -1
  369. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  370. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +28 -2
  371. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  372. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  373. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts +2 -0
  374. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -1
  375. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js +29 -1
  376. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -1
  377. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts +1 -0
  378. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts.map +1 -1
  379. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js +1 -0
  380. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js.map +1 -1
  381. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  382. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +1 -0
  383. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  384. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +1 -0
  385. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  386. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +44 -5
  387. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  388. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +3 -0
  389. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  390. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +47 -13
  391. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  392. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts +15 -0
  393. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -0
  394. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +58 -0
  395. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -0
  396. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts +2 -1
  397. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
  398. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +24 -26
  399. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
  400. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts +4 -0
  401. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts.map +1 -0
  402. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +72 -0
  403. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js.map +1 -0
  404. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.d.ts.map +1 -1
  405. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js +3 -0
  406. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js.map +1 -1
  407. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +13 -2
  408. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  409. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +112 -37
  410. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  411. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  412. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +7 -33
  413. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  414. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  415. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +103 -70
  416. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  417. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +20 -2
  418. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  419. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +97 -30
  420. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  421. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  422. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +1 -0
  423. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  424. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  425. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +1 -1
  426. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  427. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  428. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +1 -1
  429. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  430. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  431. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +1 -1
  432. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  433. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  434. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +1 -1
  435. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  436. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  437. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +1 -1
  438. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  439. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  440. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +1 -1
  441. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  442. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts +36 -0
  443. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts.map +1 -0
  444. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +202 -0
  445. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js.map +1 -0
  446. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +5 -4
  447. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  448. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
  449. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  450. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  451. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +72 -32
  452. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  453. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  454. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js +39 -34
  455. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
  456. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts +1 -1
  457. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts.map +1 -1
  458. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.js.map +1 -1
  459. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  460. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -2
  461. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  462. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  463. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  464. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js +103 -0
  465. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  466. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  467. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +7 -0
  468. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  469. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts +2 -0
  470. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -1
  471. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js +2 -0
  472. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -1
  473. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +1 -1
  474. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  475. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +10 -13
  476. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  477. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  478. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  479. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +20 -0
  480. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  481. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  482. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +22 -0
  483. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  484. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  485. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  486. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js +91 -0
  487. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js.map +1 -0
  488. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +7 -0
  489. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  490. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +101 -5
  491. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  492. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  493. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +1 -0
  494. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  495. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  496. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -0
  497. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  498. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts +6 -2
  499. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  500. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +111 -10
  501. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  502. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts +1 -0
  503. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
  504. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +78 -0
  505. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
  506. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.d.ts.map +1 -1
  507. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js +54 -22
  508. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js.map +1 -1
  509. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts +9 -0
  510. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts.map +1 -0
  511. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js +22 -0
  512. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js.map +1 -0
  513. package/node_modules/@earendil-works/pi-coding-agent/docs/containerization.md +111 -0
  514. package/node_modules/@earendil-works/pi-coding-agent/docs/docs.json +8 -0
  515. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +67 -13
  516. package/node_modules/@earendil-works/pi-coding-agent/docs/index.md +2 -0
  517. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +4 -3
  518. package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +1 -1
  519. package/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +9 -2
  520. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +5 -0
  521. package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +1 -1
  522. package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +5 -0
  523. package/node_modules/@earendil-works/pi-coding-agent/docs/security.md +59 -0
  524. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +15 -0
  525. package/node_modules/@earendil-works/pi-coding-agent/docs/skills.md +1 -1
  526. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +36 -2
  527. package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +1 -1
  528. package/node_modules/@earendil-works/pi-coding-agent/docs/tmux.md +4 -2
  529. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +10 -1
  530. package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +19 -2
  531. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +2 -0
  532. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-header.ts +1 -1
  533. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  534. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  535. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/doom-overlay/index.ts +1 -1
  536. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/index.ts +531 -0
  537. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +185 -0
  538. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +19 -0
  539. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/handoff.ts +1 -1
  540. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/interactive-shell.ts +1 -1
  541. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-qa-tests.ts +152 -81
  542. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/project-trust.ts +64 -0
  543. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/qna.ts +1 -1
  544. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/question.ts +1 -1
  545. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/questionnaire.ts +1 -1
  546. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  547. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/snake.ts +1 -1
  548. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/space-invaders.ts +1 -1
  549. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/summarize.ts +1 -1
  550. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tic-tac-toe.ts +1 -1
  551. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/todo.ts +1 -1
  552. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tools.ts +5 -0
  553. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  554. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -419
  555. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -8
  556. package/node_modules/@earendil-works/pi-tui/README.md +13 -1
  557. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +2 -0
  558. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  559. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  560. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
  561. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  562. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +102 -43
  563. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  564. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -1
  565. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  566. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +11 -1
  567. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  568. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +1 -1
  569. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
  570. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +2 -2
  571. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
  572. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
  573. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  574. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  575. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +4 -7
  576. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  577. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -77
  578. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  579. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +20 -4
  580. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  581. package/node_modules/@earendil-works/pi-tui/dist/tui.js +244 -42
  582. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  583. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +1 -0
  584. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  585. package/node_modules/@earendil-works/pi-tui/dist/utils.js +46 -15
  586. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  587. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  588. package/package.json +8 -7
  589. package/dist/forge-payload/.base-pack/commands/check-agent.md +0 -22
  590. package/dist/forge-payload/.base-pack/commands/enhance.md +0 -37
@@ -0,0 +1,494 @@
1
+ // run-task-pipeline.ts — the per-task orchestrator pipeline (runTaskPipeline
2
+ // thin wrapper + runTaskPipelineInner phase loop). Extracted VERBATIM from
3
+ // run-task.ts (FORGE-S31 file-size refactor); the only logic-neutral change is
4
+ // that the review-phase verdict block is delegated to handleReviewVerdict in
5
+ // task-verdict-loop.ts and the loop switches on its discriminated result.
6
+ //
7
+ // Iron Laws enforced here:
8
+ // IL6 — no shell-string interpolation; all external calls via spawnSync argv arrays
9
+ // IL7 — every failure path emits ctx.ui.notify and returns; no silent continuation
10
+ // IL10 — ALL LLM dispatch goes through runForgeSubagent (NO sendKickoff calls here)
11
+ //
12
+ // sendKickoff is NEVER called from this file.
13
+ import * as fs from "node:fs";
14
+ import * as path from "node:path";
15
+ import { assertAudience, CallerContextStore } from "../../audience-gate.js";
16
+ import { resolveAdvisorModel, runHaltAdvisor } from "../halt-advisor.js";
17
+ import { checkMaterialization } from "../../lib/manifest-checker.js";
18
+ import { runRefreshKbLinks } from "../../refresh-kb-links.js";
19
+ import { createOrchestratorNotifier } from "../common/orchestrator-notify.js";
20
+ import { runPipelinePreflight } from "../common/orchestrator-entry.js";
21
+ import { recoverPhaseSummary } from "../common/summary-recovery.js";
22
+ import { withOrchestratorTranscript, } from "../common/orchestrator-transcript-session.js";
23
+ import { loadWorkflow } from "../../parsers/workflow-loader.js";
24
+ import { fmtPhaseSummary } from "../../viewport/renderer.js";
25
+ import { buildPhaseEvent, drainFrictionFile, emitEvent, judgementFromSummary, } from "./task-events.js";
26
+ import { runPostflightGate, runPreflightGateWithData } from "./task-gates.js";
27
+ import { PHASES, SUMMARY_KEY_BY_ROLE } from "./task-phases.js";
28
+ import { readTaskRecord } from "./task-record.js";
29
+ import { writeState, deleteState } from "./task-state.js";
30
+ import { dispatchPhase } from "./task-phase-dispatch.js";
31
+ import { handleReviewVerdict } from "./task-verdict-loop.js";
32
+ const STATUS_KEY = "forge:run-task";
33
+ const MESSAGE_KEY = "forge:run-task:message";
34
+ // ── runTaskPipeline ──────────────────────────────────────────────────────
35
+ export async function runTaskPipeline(opts) {
36
+ // Entry preflight (layered-config schema + model-config validation) runs
37
+ // BEFORE the transcript writer is created, so a failed preflight never
38
+ // leaves a transcript file behind.
39
+ const notify = createOrchestratorNotifier(opts.ctx, {
40
+ label: "forge:run-task",
41
+ statusKey: STATUS_KEY,
42
+ messageKey: MESSAGE_KEY,
43
+ });
44
+ const pre = runPipelinePreflight({ cwd: opts.cwd, ctx: opts.ctx, notify });
45
+ if (!pre.proceed) {
46
+ return { status: "failed", lastPhaseIndex: 0, iterationCounts: {}, lastError: pre.lastError };
47
+ }
48
+ // The transcript session owns ctx.ui.notify interception and the guaranteed
49
+ // pipeline-end close on every outcome (see orchestrator-transcript-session).
50
+ return withOrchestratorTranscript({ cwd: opts.cwd, entityKind: "task", entityId: opts.taskId, ctx: opts.ctx }, (session) => runTaskPipelineInner(opts, pre.modelRoutingConfig, session));
51
+ }
52
+ async function runTaskPipelineInner(opts, modelRoutingConfig, session) {
53
+ const { taskId, cwd, ctx, forgeRoot, storeCli, preflightGate, registry, resumeFromState, onPhaseEvent } = opts;
54
+ // modelRoutingConfig is loaded and validated by runPipelinePreflight (in
55
+ // runTaskPipeline) before the transcript writer exists, then passed in.
56
+ // Determine starting phase from resumeFromState (if provided) or phase 0.
57
+ let currentPhaseIndex = resumeFromState?.phaseIndex ?? 0;
58
+ const iterationCounts = resumeFromState?.iterationCounts ?? {};
59
+ // Per-phase completion-recovery guard (forge-engineering#41): each role gets
60
+ // at most one deterministic set-summary recovery attempt before a
61
+ // missing-summary hard-fail. Prevents recovery loops.
62
+ const recoveredPhases = new Set();
63
+ // Per-role dispatch counter for OrchestratorTree node identity. Distinct
64
+ // from iterationCounts (which only tracks review-verdict revisions): every
65
+ // dispatch of a role — including a plan re-run after a review loopback —
66
+ // gets its own `<taskId>:<role>:<attempt>` node, so the dashboard renders
67
+ // one leaf per run in dispatch order instead of merging attempts into one
68
+ // node (CART-BUG-003 dashboard regression). Seeded from resume state so
69
+ // resumed runs continue numbering past prior attempts.
70
+ const dispatchCounts = { ...(resumeFromState?.iterationCounts ?? {}) };
71
+ // Track model/provider from last successful subagent result (REVIEW FIX #1).
72
+ let lastModel;
73
+ let lastProvider;
74
+ // Resolve the task's sprintId once for prompt-cache session affinity. All
75
+ // phases in this task share the cache key `forge:${sprintId}` so the
76
+ // system-prompt + project orientation prefix (which is identical across
77
+ // personas) stays warm on Anthropic and shares a stable prompt_cache_key
78
+ // on OpenAI. Falls back to a task-scoped key if the task is unattached.
79
+ const taskRecordAtStart = readTaskRecord(taskId, storeCli, cwd);
80
+ const cacheSessionId = taskRecordAtStart?.sprintId ? `forge:${taskRecordAtStart.sprintId}` : `forge:task:${taskId}`;
81
+ // Orchestrator transcript writer — created and notify-intercepted by
82
+ // withOrchestratorTranscript; the loop records structured phase-boundary
83
+ // events through it (FORGE-BUG-040 follow-up: one JSONL file per run).
84
+ const orchTranscript = session.writer;
85
+ const pipelineStartMs = Date.now();
86
+ while (currentPhaseIndex < PHASES.length) {
87
+ // ── Between-phase cancellation gate ────────────────────────────
88
+ if (opts.signal?.aborted) {
89
+ ctx.ui.notify(`⊘ forge:run-task — ${taskId} cancelled by user.`, "info");
90
+ registry.completePhase(taskId, PHASES[currentPhaseIndex]?.role ?? "unknown", "cancelled");
91
+ registry.confirmCancelled(taskId);
92
+ // ADR-S21-01: preserve state file so cancelled runs are resumable
93
+ // from the beginning of the cancelled phase (not deleted).
94
+ writeState(cwd, {
95
+ taskId,
96
+ phaseIndex: currentPhaseIndex,
97
+ iterationCounts,
98
+ halted: false,
99
+ status: "cancelled",
100
+ lastError: undefined,
101
+ savedAt: new Date().toISOString(),
102
+ });
103
+ return { status: "cancelled", lastPhaseIndex: currentPhaseIndex, iterationCounts };
104
+ }
105
+ const phase = PHASES[currentPhaseIndex];
106
+ if (!phase) {
107
+ ctx.ui.notify(`× forge:run-task — invalid phase index ${currentPhaseIndex}`, "error");
108
+ return {
109
+ status: "failed",
110
+ lastPhaseIndex: currentPhaseIndex,
111
+ iterationCounts,
112
+ lastError: `invalid phase index ${currentPhaseIndex}`,
113
+ };
114
+ }
115
+ ctx.ui.setStatus?.(STATUS_KEY, `run-task ${taskId}: phase ${currentPhaseIndex + 1}/${PHASES.length} (${phase.role})`);
116
+ ctx.ui.notify(`→ ${taskId}: ${phase.role} (phase ${currentPhaseIndex + 1}/${PHASES.length})`, "info");
117
+ orchTranscript.record({
118
+ kind: "phase-start",
119
+ ts: new Date().toISOString(),
120
+ phase: phase.role,
121
+ phaseIndex: currentPhaseIndex,
122
+ phaseCount: PHASES.length,
123
+ attempt: (iterationCounts[phase.role] ?? 0) + 1,
124
+ workflowFile: phase.workflowFile,
125
+ persona: phase.personaNoun,
126
+ });
127
+ const subWorkflowPath = path.join(cwd, ".forge", "workflows", `${phase.workflowFile}.md`);
128
+ // ── Read sub-workflow ─────────────────────────────────────────
129
+ let subWorkflowMd;
130
+ let subWorkflowAudience = "any";
131
+ try {
132
+ const loaded = loadWorkflow(subWorkflowPath);
133
+ subWorkflowMd = loaded.rawMarkdown;
134
+ subWorkflowAudience = loaded.audience;
135
+ }
136
+ catch (err) {
137
+ const e = err;
138
+ ctx.ui.notify(`× forge:run-task — failed to read sub-workflow for ${phase.role}: ${e.message ?? "unknown"}`, "error");
139
+ writeState(cwd, {
140
+ taskId,
141
+ phaseIndex: currentPhaseIndex,
142
+ iterationCounts,
143
+ halted: true,
144
+ lastError: `sub-workflow read failed: ${e.message ?? "unknown"}`,
145
+ savedAt: new Date().toISOString(),
146
+ });
147
+ return {
148
+ status: "failed",
149
+ lastPhaseIndex: currentPhaseIndex,
150
+ iterationCounts,
151
+ lastError: `sub-workflow read failed: ${e.message ?? "unknown"}`,
152
+ };
153
+ }
154
+ // ── 6a. Preflight gate ────────────────────────────────────────
155
+ if (fs.existsSync(preflightGate)) {
156
+ const preflightOutcome = runPreflightGateWithData(preflightGate, phase.role, taskId, cwd);
157
+ if (preflightOutcome.result === "halt") {
158
+ // Render structured failure reason if available.
159
+ if (preflightOutcome.gateFailure) {
160
+ ctx.ui.notify(`× forge:run-task — preflight gate failed for phase ${phase.role} ` +
161
+ `[${preflightOutcome.gateFailure.reasonCode}]: ${preflightOutcome.gateFailure.detail}`, "error");
162
+ }
163
+ else {
164
+ ctx.ui.notify(`× forge:run-task — preflight gate failed for phase ${phase.role} (exit 1); halting.`, "error");
165
+ }
166
+ writeState(cwd, {
167
+ taskId,
168
+ phaseIndex: currentPhaseIndex,
169
+ iterationCounts,
170
+ halted: true,
171
+ lastError: `preflight gate exit 1 for ${phase.role}`,
172
+ savedAt: new Date().toISOString(),
173
+ });
174
+ // Spawn halt-recovery advisor (Tier 1, best-effort — non-fatal).
175
+ if (preflightOutcome.gateFailure) {
176
+ const advisorModel = resolveAdvisorModel(modelRoutingConfig, ctx.model);
177
+ await runHaltAdvisor({
178
+ gateFailure: preflightOutcome.gateFailure,
179
+ advisorModel,
180
+ taskId,
181
+ cwd,
182
+ ctx: { ui: ctx.ui },
183
+ forgeRoot,
184
+ });
185
+ }
186
+ return {
187
+ status: "halted",
188
+ lastPhaseIndex: currentPhaseIndex,
189
+ iterationCounts,
190
+ lastError: `preflight gate exit 1 for ${phase.role}`,
191
+ };
192
+ }
193
+ if (preflightOutcome.result === "escalate") {
194
+ ctx.ui.notify(`× forge:run-task — preflight gate escalated for phase ${phase.role} (exit 2); manual intervention required.`, "error");
195
+ writeState(cwd, {
196
+ taskId,
197
+ phaseIndex: currentPhaseIndex,
198
+ iterationCounts,
199
+ halted: true,
200
+ lastError: `preflight gate exit 2 (escalate) for ${phase.role}`,
201
+ savedAt: new Date().toISOString(),
202
+ });
203
+ return {
204
+ status: "escalated",
205
+ lastPhaseIndex: currentPhaseIndex,
206
+ iterationCounts,
207
+ lastError: `preflight gate exit 2 (escalate) for ${phase.role}`,
208
+ };
209
+ }
210
+ // Preflight passed — notify (mirrored to the root node's dashboard log).
211
+ ctx.ui.notify(`〇 preflight: ${phase.role} — ok`, "info");
212
+ }
213
+ // ── 6. Materialization-marker check ───────────────────────────
214
+ const markerCheck = checkMaterialization(subWorkflowPath, subWorkflowMd);
215
+ if (!markerCheck.ok) {
216
+ for (const marker of markerCheck.missing) {
217
+ ctx.ui.notify(`× workflow regression: ${marker} not found in ${subWorkflowPath}`, "error");
218
+ }
219
+ return {
220
+ status: "failed",
221
+ lastPhaseIndex: currentPhaseIndex,
222
+ iterationCounts,
223
+ lastError: `materialization markers missing: ${markerCheck.missing.join(", ")}`,
224
+ };
225
+ }
226
+ // ── 5. Audience check ─────────────────────────────────────────
227
+ // Wrap with CallerContextStore.asSubagent so assertAudience treats
228
+ // this as a subagent context (IL10: we ARE dispatching from subagent chain).
229
+ const audienceOk = CallerContextStore.asSubagent(phase.role, () => assertAudience({ workflowName: phase.workflowFile, audience: subWorkflowAudience }, ctx));
230
+ if (!audienceOk) {
231
+ writeState(cwd, {
232
+ taskId,
233
+ phaseIndex: currentPhaseIndex,
234
+ iterationCounts,
235
+ halted: true,
236
+ lastError: `audience check failed for ${phase.workflowFile}`,
237
+ savedAt: new Date().toISOString(),
238
+ });
239
+ return {
240
+ status: "failed",
241
+ lastPhaseIndex: currentPhaseIndex,
242
+ iterationCounts,
243
+ lastError: `audience check failed for ${phase.workflowFile}`,
244
+ };
245
+ }
246
+ // ── Dispatch (persona load + runForgeSubagent + observer + abort/halt) ──
247
+ // Extracted to task-phase-dispatch.ts (FORGE-S31). Returns either a
248
+ // terminal result (persona-load failure / throw / cancel / non-zero exit)
249
+ // or the live locals the rest of the loop needs.
250
+ const dispatch = await dispatchPhase({
251
+ opts,
252
+ phase,
253
+ taskId,
254
+ cwd,
255
+ ctx,
256
+ storeCli,
257
+ currentPhaseIndex,
258
+ iterationCounts,
259
+ dispatchCounts,
260
+ modelRoutingConfig,
261
+ registry,
262
+ cacheSessionId,
263
+ taskRecordAtStart,
264
+ subWorkflowMd,
265
+ });
266
+ if (dispatch.kind === "return")
267
+ return dispatch.result;
268
+ const { result, finishPhaseNode, observer, phaseStart, writeDebug } = dispatch;
269
+ // Capture model/provider from subagent result (REVIEW FIX #1).
270
+ if (result.model)
271
+ lastModel = result.model;
272
+ if (result.provider)
273
+ lastProvider = result.provider;
274
+ // Phase-complete liveliness ping (counts + duration).
275
+ {
276
+ const elapsed = Math.floor((Date.now() - phaseStart) / 1000);
277
+ const { turn, toolCount, errCount, cumUsage } = observer.state;
278
+ ctx.ui.notify(`✓ ${phase.role}: ${turn} turn${turn === 1 ? "" : "s"} · ${toolCount} tool call${toolCount === 1 ? "" : "s"}${errCount ? ` · ${errCount} err` : ""} · ${elapsed}s`, "info");
279
+ orchTranscript.record({
280
+ kind: "phase-end",
281
+ ts: new Date().toISOString(),
282
+ phase: phase.role,
283
+ phaseIndex: currentPhaseIndex,
284
+ attempt: (iterationCounts[phase.role] ?? 0) + 1,
285
+ verdict: "n/a",
286
+ elapsedMs: Date.now() - phaseStart,
287
+ turns: turn,
288
+ toolCount,
289
+ errCount,
290
+ subagentTranscriptPath: result.subagentTranscriptPath,
291
+ });
292
+ const { cumCompression } = observer.state;
293
+ registry.appendTail(taskId, phase.role, fmtPhaseSummary({
294
+ role: phase.role,
295
+ turns: turn,
296
+ tools: toolCount,
297
+ errors: errCount,
298
+ wallSeconds: elapsed,
299
+ usage: cumUsage,
300
+ model: result.model,
301
+ provider: result.provider,
302
+ compression: cumCompression.tokensSaved > 0 ? cumCompression : undefined,
303
+ }));
304
+ }
305
+ // ── Plan 11 / Slice 2: orchestrator emits phase event ─────────
306
+ const phaseEndMs = Date.now();
307
+ const taskRecord = readTaskRecord(taskId, storeCli, cwd);
308
+ const sprintId = taskRecord?.sprintId;
309
+ if (!sprintId) {
310
+ ctx.ui.notify(`⚠ forge:run-task — could not resolve sprintId for ${taskId}; ` +
311
+ `skipping orchestrator emit for phase ${phase.role}`, "warning");
312
+ writeDebug({ kind: "emit_skipped", reason: "no-sprintId" });
313
+ }
314
+ else {
315
+ const phaseIteration = (iterationCounts[phase.role] ?? 0) + 1;
316
+ const emitCtx = {
317
+ entityType: "task",
318
+ taskId,
319
+ sprintId,
320
+ phase,
321
+ iteration: phaseIteration,
322
+ startMs: phaseStart,
323
+ endMs: phaseEndMs,
324
+ model: result.model ?? "unknown",
325
+ provider: result.provider ?? "unknown",
326
+ usage: {
327
+ input: result.usage.input,
328
+ output: result.usage.output,
329
+ cacheRead: result.usage.cacheRead,
330
+ cacheWrite: result.usage.cacheWrite,
331
+ },
332
+ judgement: judgementFromSummary(taskRecord, phase.role),
333
+ storeCli,
334
+ cwd,
335
+ };
336
+ const phaseEvent = buildPhaseEvent(emitCtx);
337
+ const emitResult = emitEvent(storeCli, cwd, sprintId, phaseEvent);
338
+ if (!emitResult.ok) {
339
+ ctx.ui.notify(`⚠ forge:run-task — phase event emit failed for ${phase.role}: ${emitResult.stderr.trim()}`, "warning");
340
+ writeDebug({ kind: "emit_failed", stderr: emitResult.stderr });
341
+ }
342
+ else {
343
+ writeDebug({ kind: "emit_ok", eventId: phaseEvent.eventId });
344
+ }
345
+ // Notify sprint-level observer (FORGE-S21-T03).
346
+ if (onPhaseEvent)
347
+ onPhaseEvent(phaseEvent);
348
+ // Drain friction file for this phase, if any.
349
+ const frictionPath = path.join(cwd, ".forge", "cache", `FRICTION-${phase.role}.jsonl`);
350
+ const drain = drainFrictionFile(frictionPath, emitCtx);
351
+ if (drain.emitted + drain.failed > 0) {
352
+ writeDebug({ kind: "friction_drain", ...drain });
353
+ if (drain.failed > 0) {
354
+ ctx.ui.notify(`⚠ forge:run-task — friction drain for ${phase.role}: ${drain.emitted} ok, ${drain.failed} failed`, "warning");
355
+ }
356
+ }
357
+ }
358
+ // ── 6b. Verdict check (review phases only) ────────────────────
359
+ if (phase.isReview) {
360
+ const outcome = await handleReviewVerdict({
361
+ phase,
362
+ taskId,
363
+ storeCli,
364
+ cwd,
365
+ forgeRoot,
366
+ iterationCounts,
367
+ currentPhaseIndex,
368
+ modelRoutingConfig,
369
+ ctx,
370
+ orchTranscript,
371
+ finishPhaseNode,
372
+ recoveredPhases,
373
+ });
374
+ if (outcome.kind === "return")
375
+ return outcome.result;
376
+ if (outcome.kind === "loopback") {
377
+ currentPhaseIndex = outcome.toIndex;
378
+ continue;
379
+ }
380
+ // outcome.kind === "advance": fall through to postflight + advance
381
+ }
382
+ // Postflight gate: evaluate `outputs` block after subagent returns,
383
+ // before FSM status advance (FORGE-S26-T19). Hard enforcement in forge-cli;
384
+ // plugin LLM route treats postflight as advisory. On UNSATISFIED: do not
385
+ // advance currentPhaseIndex, halt, hand off to existing runHaltAdvisor.
386
+ {
387
+ const postflightGatePath = preflightGate.replace("preflight-gate.cjs", "postflight-gate.cjs");
388
+ let postflightOutcome = runPostflightGate(postflightGatePath, phase.role, taskId, cwd);
389
+ // Completion recovery (forge-engineering#41): a clean stop with an
390
+ // unsatisfied postflight is most often the subagent writing the
391
+ // {PHASE}-SUMMARY.json sidecar but eliding the set-summary that
392
+ // registers it. Register the sidecar ourselves (once per phase), then
393
+ // re-run the gate. Only the existing hard-fail remains if it's still
394
+ // unsatisfied (sidecar genuinely absent → set-summary exits non-zero).
395
+ if (postflightOutcome.result === "unsatisfied") {
396
+ const summaryKey = SUMMARY_KEY_BY_ROLE[phase.role];
397
+ if (summaryKey && !recoveredPhases.has(phase.role)) {
398
+ recoveredPhases.add(phase.role);
399
+ const rec = recoverPhaseSummary({ storeCli, entityId: taskId, summaryKey, cwd });
400
+ writeDebug({ kind: "summary_recovery", phase: phase.role, gate: "postflight", ok: rec.ok });
401
+ if (rec.ok) {
402
+ const recheck = runPostflightGate(postflightGatePath, phase.role, taskId, cwd);
403
+ if (recheck.result !== "unsatisfied") {
404
+ ctx.ui.notify(`⟳ forge:run-task — ${phase.role}: subagent skipped set-summary; orchestrator registered ` +
405
+ `the '${summaryKey}' sidecar and postflight now passes.`, "info");
406
+ }
407
+ postflightOutcome = recheck;
408
+ }
409
+ }
410
+ }
411
+ if (postflightOutcome.result === "unsatisfied") {
412
+ finishPhaseNode("failed");
413
+ if (postflightOutcome.gateFailure) {
414
+ ctx.ui.notify(`× forge:run-task — postflight gate failed for phase ${phase.role} ` +
415
+ `[${postflightOutcome.gateFailure.reasonCode}]: ${postflightOutcome.gateFailure.detail}`, "error");
416
+ }
417
+ else {
418
+ ctx.ui.notify(`× forge:run-task — postflight gate failed for phase ${phase.role}; halting.`, "error");
419
+ }
420
+ // Do NOT advance FSM — write state at current phaseIndex (halted)
421
+ writeState(cwd, {
422
+ taskId,
423
+ phaseIndex: currentPhaseIndex,
424
+ iterationCounts,
425
+ halted: true,
426
+ lastError: `postflight gate exit 1 for ${phase.role}`,
427
+ savedAt: new Date().toISOString(),
428
+ });
429
+ // Spawn halt-recovery advisor (Tier 1, best-effort — non-fatal).
430
+ if (postflightOutcome.gateFailure) {
431
+ const advisorModel = resolveAdvisorModel(modelRoutingConfig, ctx.model);
432
+ await runHaltAdvisor({
433
+ gateFailure: postflightOutcome.gateFailure,
434
+ advisorModel,
435
+ taskId,
436
+ cwd,
437
+ ctx: { ui: ctx.ui },
438
+ forgeRoot,
439
+ });
440
+ }
441
+ return {
442
+ status: "halted",
443
+ lastPhaseIndex: currentPhaseIndex,
444
+ iterationCounts,
445
+ lastError: `postflight gate exit 1 for ${phase.role}`,
446
+ };
447
+ }
448
+ // "ok" or "error" — proceed to advance
449
+ if (postflightOutcome.result === "ok") {
450
+ ctx.ui.notify(`〇 postflight: ${phase.role} — ok`, "info");
451
+ }
452
+ }
453
+ // ── Advance to next phase ─────────────────────────────────────
454
+ registry.completePhase(taskId, phase.role, "completed");
455
+ finishPhaseNode("completed");
456
+ // KB link refresh is orchestrator-owned in forge-cli (subagents run via Pi
457
+ // runtime and have no Skill tool). Mirrors the init phase-4 pattern.
458
+ if (phase.role === "writeback") {
459
+ try {
460
+ const kbResult = await runRefreshKbLinks(cwd);
461
+ ctx.ui.notify(kbResult.filesUpdated > 0
462
+ ? `〇 KB links refreshed (${kbResult.filesUpdated} file${kbResult.filesUpdated === 1 ? "" : "s"} updated)`
463
+ : ` KB links — already up to date`, "info");
464
+ }
465
+ catch (e) {
466
+ ctx.ui.notify(`△ KB links refresh failed (best-effort): ${e.message ?? "unknown"}`, "warning");
467
+ }
468
+ }
469
+ writeState(cwd, {
470
+ taskId,
471
+ phaseIndex: currentPhaseIndex,
472
+ iterationCounts,
473
+ halted: false,
474
+ savedAt: new Date().toISOString(),
475
+ });
476
+ currentPhaseIndex++;
477
+ }
478
+ // ── All phases complete ───────────────────────────────────────────
479
+ deleteState(cwd, taskId);
480
+ orchTranscript.record({
481
+ kind: "pipeline-end",
482
+ ts: new Date().toISOString(),
483
+ outcome: "complete",
484
+ elapsedMs: Date.now() - pipelineStartMs,
485
+ });
486
+ return {
487
+ status: "completed",
488
+ lastPhaseIndex: PHASES.length - 1,
489
+ iterationCounts,
490
+ model: lastModel,
491
+ provider: lastProvider,
492
+ };
493
+ }
494
+ //# sourceMappingURL=run-task-pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-task-pipeline.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/task/run-task-pipeline.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,2BAA2B;AAC3B,uFAAuF;AACvF,sFAAsF;AACtF,sFAAsF;AACtF,EAAE;AACF,8CAA8C;AAE9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB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CAAC,CAAC;gBAC9C,GAAG,CAAC,EAAE,CAAC,MAAM,CACZ,QAAQ,CAAC,YAAY,GAAG,CAAC;oBACxB,CAAC,CAAC,yBAAyB,QAAQ,CAAC,YAAY,QAAQ,QAAQ,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW;oBACzG,CAAC,CAAC,iCAAiC,EACpC,MAAM,CACN,CAAC;YACH,CAAC;YAAC,OAAO,CAAU,EAAE,CAAC;gBACrB,GAAG,CAAC,EAAE,CAAC,MAAM,CACZ,4CAA6C,CAA0B,CAAC,OAAO,IAAI,SAAS,EAAE,EAC9F,SAAS,CACT,CAAC;YACH,CAAC;QACF,CAAC;QACD,UAAU,CAAC,GAAG,EAAE;YACf,MAAM;YACN,UAAU,EAAE,iBAAiB;YAC7B,eAAe;YACf,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACjC,CAAC,CAAC;QACH,iBAAiB,EAAE,CAAC;IACrB,CAAC;IAED,qEAAqE;IACrE,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzB,cAAc,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC5B,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe;KACvC,CAAC,CAAC;IACH,OAAO;QACN,MAAM,EAAE,WAAW;QACnB,cAAc,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC;QACjC,eAAe;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,YAAY;KACtB,CAAC;AACH,CAAC"}
@@ -0,0 +1,62 @@
1
+ import type { ExtensionCommandContext, ExtensionFactory } from "@earendil-works/pi-coding-agent";
2
+ import type { ForgeToolDefs } from "../../forge-tools.js";
3
+ import type { getSessionRegistry } from "../../session-registry.js";
4
+ import type { RunTaskState } from "./task-state.js";
5
+ export interface RunTaskPipelineOptions {
6
+ taskId: string;
7
+ cwd: string;
8
+ ctx: ExtensionCommandContext;
9
+ forgeRoot: string;
10
+ storeCli: string;
11
+ preflightGate: string;
12
+ registry: ReturnType<typeof getSessionRegistry>;
13
+ /** When provided, pipeline starts from this state instead of phase 0.
14
+ * Used by run-sprint.ts for mid-task resume (REVIEW FIX #2, option b). */
15
+ resumeFromState?: RunTaskState;
16
+ /** Optional observer for phase events; called after emitEvent. */
17
+ onPhaseEvent?: (event: Record<string, unknown>) => void;
18
+ /**
19
+ * Test-only seam (forge-cli#17). When set, each phase's `runForgeSubagent`
20
+ * call receives `streamFn = streamFnFactory({...})`. Production callers
21
+ * leave this undefined. See helpers/scripted-subagent.ts and
22
+ * fixtures/sprint-fixture.ts.
23
+ */
24
+ streamFnFactory?: (ctx: {
25
+ kind: "task-phase";
26
+ persona: string;
27
+ phase: string;
28
+ taskId: string;
29
+ }) => import("@earendil-works/pi-agent-core").StreamFn | undefined;
30
+ /**
31
+ * Optional AbortSignal from SessionRegistry. When provided, the pipeline
32
+ * checks signal.aborted between phases and passes the signal to
33
+ * runForgeSubagent so in-flight subagents can be aborted.
34
+ */
35
+ signal?: AbortSignal;
36
+ forgeToolDefs?: ForgeToolDefs;
37
+ /**
38
+ * Extension factories forwarded to each subagent session via runForgeSubagent.
39
+ * Used by Mechanism E (FORGE-S30-T07) to inject the Forge-aware compaction
40
+ * handler when FORGE_CTX_GOVERNOR=1. No-op when undefined (default path unchanged).
41
+ */
42
+ extensionFactories?: ExtensionFactory[];
43
+ }
44
+ export type RunTaskPipelineStatus = "completed" | "halted" | "escalated" | "failed" | "cancelled";
45
+ export interface RunTaskPipelineResult {
46
+ status: RunTaskPipelineStatus;
47
+ lastPhaseIndex: number;
48
+ iterationCounts: Record<string, number>;
49
+ lastError?: string;
50
+ /** Model captured from last successful phase's subagent result (REVIEW FIX #1). */
51
+ model?: string;
52
+ /** Provider captured from last successful phase's subagent result (REVIEW FIX #1). */
53
+ provider?: string;
54
+ /**
55
+ * Project-local orchestrator JSONL path for this run
56
+ * (.forge/transcripts/<taskId>/<ISO>__<taskId>__orchestrator.jsonl).
57
+ * Callers (registerRunTask, run-sprint) hand it to archiveRun() to mirror
58
+ * the run into the central transcript archive. Unset only when the
59
+ * pipeline returned before the transcript writer was created (preflight).
60
+ */
61
+ orchestratorTranscriptPath?: string;
62
+ }
@@ -0,0 +1,5 @@
1
+ // run-task-types.ts — pipeline option/result interfaces shared between the
2
+ // pipeline file and the command handler. Extracted from run-task.ts (no logic
3
+ // changes). run-task.ts re-exports these.
4
+ export {};
5
+ //# sourceMappingURL=run-task-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-task-types.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/task/run-task-types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,8EAA8E;AAC9E,0CAA0C"}
@@ -0,0 +1,4 @@
1
+ import type { PhaseDescriptor } from "./task-phases.js";
2
+ export declare function findPredecessorIndex(phases: PhaseDescriptor[], reviewIndex: number): number;
3
+ export declare function buildSummariesBlock(summaries: Record<string, unknown> | undefined): string;
4
+ export declare function composeTaskBody(subWorkflowMd: string, taskId: string, summariesBlock?: string): string;
@@ -0,0 +1,48 @@
1
+ // task-body.ts — task body composition + summary carry-forward helpers and the
2
+ // revision-loop predecessor finder. Extracted from run-task.ts (no logic
3
+ // changes). run-task.ts re-exports these.
4
+ // ── Find predecessor non-review phase for revision loop ───────────────────
5
+ export function findPredecessorIndex(phases, reviewIndex) {
6
+ for (let i = reviewIndex - 1; i >= 0; i--) {
7
+ if (!phases[i].isReview)
8
+ return i;
9
+ }
10
+ return 0;
11
+ }
12
+ // Phase ordering for summary injection — earlier phases first.
13
+ const PHASE_ORDER = ["plan", "review_plan", "implementation", "code_review", "validation"];
14
+ export function buildSummariesBlock(summaries) {
15
+ if (!summaries)
16
+ return "";
17
+ const lines = [];
18
+ for (const key of PHASE_ORDER) {
19
+ const raw = summaries[key];
20
+ if (!raw || typeof raw !== "object")
21
+ continue;
22
+ const s = raw;
23
+ const parts = [`### ${key}`];
24
+ if (s.objective)
25
+ parts.push(`Objective: ${s.objective}`);
26
+ if (s.verdict)
27
+ parts.push(`Verdict: ${s.verdict}`);
28
+ if (s.key_changes?.length)
29
+ parts.push(`Key changes: ${s.key_changes.join("; ")}`);
30
+ if (s.findings?.length)
31
+ parts.push(`Findings: ${s.findings.join("; ")}`);
32
+ if (s.artifact_ref)
33
+ parts.push(`Full artifact: ${s.artifact_ref}`);
34
+ lines.push(parts.join("\n"));
35
+ }
36
+ if (lines.length === 0)
37
+ return "";
38
+ return ["## Prior phase summaries (carry-forward)", "", ...lines].join("\n");
39
+ }
40
+ export function composeTaskBody(subWorkflowMd, taskId, summariesBlock) {
41
+ const parts = [`Read the workflow below and follow it. Task ID: ${taskId}.`, "", "---", ""];
42
+ if (summariesBlock) {
43
+ parts.push(summariesBlock, "", "---", "");
44
+ }
45
+ parts.push(subWorkflowMd.trim());
46
+ return parts.join("\n");
47
+ }
48
+ //# sourceMappingURL=task-body.js.map