@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,501 @@
1
+ // run-bug-pipeline.ts — the per-bug orchestrator pipeline (runBugPipeline thin
2
+ // wrapper + runBugPipelineInner phase loop). Extracted VERBATIM from fix-bug.ts
3
+ // (FORGE-S31 file-size refactor); the only logic-neutral changes are that the
4
+ // per-phase dispatch, the post-triage bugId capture, the review-phase verdict
5
+ // handling, and the post-triage Path A/B routing are delegated to helpers in
6
+ // bug-phase-dispatch.ts / bug-triage-routing.ts / bug-verdict-loop.ts and the
7
+ // loop switches on their discriminated results.
8
+ //
9
+ // Iron Laws enforced here:
10
+ // IL6 — no shell-string interpolation; all external calls via spawnSync argv arrays
11
+ // IL7 — every failure path emits ctx.ui.notify and returns; no silent continuation
12
+ // IL10 — ALL LLM dispatch goes through runForgeSubagent (NO sendKickoff calls here)
13
+ //
14
+ // sendKickoff is NEVER called from this file.
15
+ import { spawnSync } from "node:child_process";
16
+ import * as fs from "node:fs";
17
+ import * as path from "node:path";
18
+ import { assertAudience, CallerContextStore } from "../../audience-gate.js";
19
+ import { checkMaterialization } from "../../lib/manifest-checker.js";
20
+ import { loadWorkflow } from "../../parsers/workflow-loader.js";
21
+ import { BUG_SUMMARY_KEY_BY_ROLE } from "../../subagent/phase-summary-map.js";
22
+ import { fmtPhaseSummary } from "../../viewport/renderer.js";
23
+ import { resolveAdvisorModel, runHaltAdvisor } from "../halt-advisor.js";
24
+ import { createOrchestratorNotifier } from "../common/orchestrator-notify.js";
25
+ import { runPipelinePreflight } from "../common/orchestrator-entry.js";
26
+ import { withOrchestratorTranscript, } from "../common/orchestrator-transcript-session.js";
27
+ import { buildPhaseEvent, drainFrictionFile, emitEvent, judgementFromSummary, runPreflightGateWithData, } from "../run-task.js";
28
+ import { dispatchBugPhase } from "./bug-phase-dispatch.js";
29
+ import { BUG_PHASES, BUG_TYPE_TOKENS } from "./bug-phases.js";
30
+ import { readBugRecord } from "./bug-id.js";
31
+ import { deleteBugState, writeBugState } from "./bug-state.js";
32
+ import { captureTriageBugId, maybeSkipPhase, routeAfterTriage } from "./bug-triage-routing.js";
33
+ import { handleBugReviewVerdict } from "./bug-verdict-loop.js";
34
+ const STATUS_KEY = "forge:fix-bug";
35
+ const MESSAGE_KEY = "forge:fix-bug:message";
36
+ export async function runBugPipeline(opts) {
37
+ // Entry preflight (layered-config schema + model-config validation) runs
38
+ // BEFORE the transcript writer is created, so a failed preflight never
39
+ // leaves a transcript file behind.
40
+ const notify = createOrchestratorNotifier(opts.ctx, {
41
+ label: "forge:fix-bug",
42
+ statusKey: STATUS_KEY,
43
+ messageKey: MESSAGE_KEY,
44
+ });
45
+ const pre = runPipelinePreflight({ cwd: opts.cwd, ctx: opts.ctx, notify });
46
+ if (!pre.proceed) {
47
+ return {
48
+ status: "failed",
49
+ lastPhaseIndex: opts.resumeFromState?.phaseIndex ?? 0,
50
+ iterationCounts: opts.resumeFromState?.iterationCounts ?? {},
51
+ lastError: pre.lastError,
52
+ };
53
+ }
54
+ // The transcript session owns ctx.ui.notify interception and the guaranteed
55
+ // pipeline-end close on every outcome (see orchestrator-transcript-session).
56
+ return withOrchestratorTranscript({ cwd: opts.cwd, entityKind: "bug", entityId: opts.bugId, ctx: opts.ctx }, (session) => runBugPipelineInner(opts, pre.modelRoutingConfig, session));
57
+ }
58
+ async function runBugPipelineInner(opts, modelRoutingConfig, session) {
59
+ const { bugId: initialBugId, originalArg, isNewBug, cwd, ctx, forgeRoot, storeCli, preflightGate, registry, resumeFromState, } = opts;
60
+ // Mutable bugId — for new bugs, pre-assign a real FORGE-BUG-NNN ID
61
+ // before triage so the subagent never needs to create or discover one.
62
+ // This replaces the fragile PENDING→capture pattern where the subagent was
63
+ // expected to create the bug record and we'd fish the ID from events.
64
+ let bugId = initialBugId;
65
+ let currentPhaseIndex = resumeFromState?.phaseIndex ?? 0;
66
+ const iterationCounts = resumeFromState?.iterationCounts ?? {};
67
+ // Per-phase completion-recovery guard (forge-engineering#41): each role gets
68
+ // at most one deterministic set-bug-summary recovery attempt before a
69
+ // missing-summary hard-fail. Prevents recovery loops.
70
+ const recoveredPhases = new Set();
71
+ // Per-role dispatch counter for OrchestratorTree node identity. Distinct
72
+ // from iterationCounts (which only tracks review-verdict revisions): every
73
+ // dispatch of a role — including a plan-fix re-run after a review
74
+ // loopback — gets its own `<bugId>:<role>:<attempt>` node, so the
75
+ // dashboard renders one leaf per run in dispatch order instead of merging
76
+ // attempts into one node (CART-BUG-003 dashboard regression). Seeded from
77
+ // resume state so resumed runs continue numbering past prior attempts.
78
+ const dispatchCounts = { ...(resumeFromState?.iterationCounts ?? {}) };
79
+ let lastModel;
80
+ let lastProvider;
81
+ // modelRoutingConfig is loaded and validated by runPipelinePreflight (in
82
+ // runBugPipeline) before the transcript writer exists, then passed in.
83
+ // Pipeline name "fix-bug" lets users configure per-phase overrides under
84
+ // pipelines["fix-bug"] in their routing config.
85
+ // Orchestrator transcript writer — created and notify-intercepted by
86
+ // withOrchestratorTranscript; the loop records structured phase-boundary
87
+ // events through it (one JSONL file per run).
88
+ const orchTranscript = session.writer;
89
+ const pipelineStartMs = Date.now();
90
+ while (currentPhaseIndex < BUG_PHASES.length) {
91
+ // ── Between-phase cancellation gate ────────────────────────────
92
+ if (opts.signal?.aborted) {
93
+ ctx.ui.notify(`⊘ forge:fix-bug — ${bugId} cancelled by user.`, "info");
94
+ registry.completePhase(bugId, BUG_PHASES[currentPhaseIndex]?.role ?? "unknown", "cancelled");
95
+ registry.confirmCancelled(bugId);
96
+ // ADR-S21-01: preserve state file so cancelled runs are resumable
97
+ writeBugState(cwd, {
98
+ bugId,
99
+ phaseIndex: currentPhaseIndex,
100
+ iterationCounts,
101
+ halted: false,
102
+ status: "cancelled",
103
+ lastError: undefined,
104
+ savedAt: new Date().toISOString(),
105
+ });
106
+ return { status: "cancelled", lastPhaseIndex: currentPhaseIndex, iterationCounts };
107
+ }
108
+ const phase = BUG_PHASES[currentPhaseIndex];
109
+ if (!phase) {
110
+ ctx.ui.notify(`× forge:fix-bug — invalid phase index ${currentPhaseIndex}`, "error");
111
+ return {
112
+ status: "failed",
113
+ lastPhaseIndex: currentPhaseIndex,
114
+ iterationCounts,
115
+ lastError: `invalid phase index ${currentPhaseIndex}`,
116
+ };
117
+ }
118
+ ctx.ui.setStatus?.(STATUS_KEY, `fix-bug ${bugId}: phase ${currentPhaseIndex + 1}/${BUG_PHASES.length} (${phase.role})`);
119
+ ctx.ui.notify(`→ ${bugId}: ${phase.role} (phase ${currentPhaseIndex + 1}/${BUG_PHASES.length})`, "info");
120
+ orchTranscript.record({
121
+ kind: "phase-start",
122
+ ts: new Date().toISOString(),
123
+ phase: phase.role,
124
+ phaseIndex: currentPhaseIndex,
125
+ phaseCount: BUG_PHASES.length,
126
+ attempt: (iterationCounts[phase.role] ?? 0) + 1,
127
+ workflowFile: phase.workflowFile,
128
+ persona: phase.personaNoun,
129
+ });
130
+ const subWorkflowPath = path.join(cwd, ".forge", "workflows", `${phase.workflowFile}.md`);
131
+ // ── Read sub-workflow ─────────────────────────────────────────
132
+ let subWorkflowMd;
133
+ let subWorkflowAudience = "any";
134
+ try {
135
+ const loaded = loadWorkflow(subWorkflowPath);
136
+ subWorkflowMd = loaded.rawMarkdown;
137
+ subWorkflowAudience = loaded.audience;
138
+ }
139
+ catch (err) {
140
+ const e = err;
141
+ ctx.ui.notify(`× forge:fix-bug — failed to read sub-workflow for ${phase.role}: ${e.message ?? "unknown"}`, "error");
142
+ writeBugState(cwd, {
143
+ bugId,
144
+ phaseIndex: currentPhaseIndex,
145
+ iterationCounts,
146
+ halted: true,
147
+ lastError: `sub-workflow read failed: ${e.message ?? "unknown"}`,
148
+ savedAt: new Date().toISOString(),
149
+ });
150
+ return {
151
+ status: "failed",
152
+ lastPhaseIndex: currentPhaseIndex,
153
+ iterationCounts,
154
+ lastError: `sub-workflow read failed: ${e.message ?? "unknown"}`,
155
+ };
156
+ }
157
+ // ── 6a. Phase skip (state-aware, defense-in-depth) ─────────────
158
+ const bugNow = readBugRecord(bugId, storeCli, cwd);
159
+ if (maybeSkipPhase({ phase, bugId, cwd, ctx, storeCli, bugNow, summaryKeyByRole: BUG_SUMMARY_KEY_BY_ROLE })) {
160
+ currentPhaseIndex++;
161
+ continue;
162
+ }
163
+ // ── 6b. Preflight gate ────────────────────────────────────────
164
+ // Skip preflight gate for triage phase of new bugs (PENDING- placeholder)
165
+ // because the bug record doesn't exist yet — gates referencing bug fields
166
+ // would always fail.
167
+ //
168
+ // Also skip for review phases when the bug is already in a terminal
169
+ // state ("fixed"). Path A bugs get fixed during triage, then the
170
+ // preflight gate's `forbid bug.status == fixed` and `after implement
171
+ // = n/a` checks block review-code/review-plan even though we
172
+ // deliberately want to run those reviews. The review subagent handles
173
+ // the already-fixed scenario internally.
174
+ const pendingBugId = bugId.startsWith("PENDING-");
175
+ const bugAlreadyFixed = bugNow?.status === "fixed" && phase.isReview;
176
+ if (!pendingBugId && !bugAlreadyFixed && fs.existsSync(preflightGate)) {
177
+ const preflightOutcome = runPreflightGateWithData(preflightGate, phase.role, bugId, cwd, "bug");
178
+ if (preflightOutcome.result === "halt") {
179
+ // Render structured failure reason if available.
180
+ if (preflightOutcome.gateFailure) {
181
+ ctx.ui.notify(`× forge:fix-bug — preflight gate failed for phase ${phase.role} ` +
182
+ `[${preflightOutcome.gateFailure.reasonCode}]: ${preflightOutcome.gateFailure.detail}`, "error");
183
+ }
184
+ else {
185
+ ctx.ui.notify(`× forge:fix-bug — preflight gate failed for phase ${phase.role} (exit 1); halting.`, "error");
186
+ }
187
+ writeBugState(cwd, {
188
+ bugId,
189
+ phaseIndex: currentPhaseIndex,
190
+ iterationCounts,
191
+ halted: true,
192
+ lastError: `preflight gate exit 1 for ${phase.role}`,
193
+ savedAt: new Date().toISOString(),
194
+ });
195
+ // Spawn halt-recovery advisor (Tier 1, best-effort — non-fatal).
196
+ if (preflightOutcome.gateFailure) {
197
+ const advisorModel = resolveAdvisorModel(modelRoutingConfig, ctx.model);
198
+ await runHaltAdvisor({
199
+ gateFailure: preflightOutcome.gateFailure,
200
+ advisorModel,
201
+ taskId: bugId,
202
+ cwd,
203
+ ctx: { ui: ctx.ui },
204
+ forgeRoot,
205
+ });
206
+ }
207
+ return {
208
+ status: "halted",
209
+ lastPhaseIndex: currentPhaseIndex,
210
+ iterationCounts,
211
+ lastError: `preflight gate exit 1 for ${phase.role}`,
212
+ };
213
+ }
214
+ if (preflightOutcome.result === "escalate") {
215
+ ctx.ui.notify(`× forge:fix-bug — preflight gate escalated for phase ${phase.role} (exit 2); manual intervention required.`, "error");
216
+ writeBugState(cwd, {
217
+ bugId,
218
+ phaseIndex: currentPhaseIndex,
219
+ iterationCounts,
220
+ halted: true,
221
+ lastError: `preflight gate exit 2 (escalate) for ${phase.role}`,
222
+ savedAt: new Date().toISOString(),
223
+ });
224
+ return {
225
+ status: "escalated",
226
+ lastPhaseIndex: currentPhaseIndex,
227
+ iterationCounts,
228
+ lastError: `preflight gate exit 2 (escalate) for ${phase.role}`,
229
+ };
230
+ }
231
+ }
232
+ // ── 6. Materialization-marker check ───────────────────────────
233
+ // FORGE-BUG-040: every BUG phase is now a true `audience: subagent`
234
+ // sub-workflow — triage / plan-fix / implement no longer alias to
235
+ // fix_bug.md. The marker check is therefore unconditional; a missing
236
+ // marker is a hard failure on the first dispatch.
237
+ {
238
+ const markerCheck = checkMaterialization(subWorkflowPath, subWorkflowMd);
239
+ if (!markerCheck.ok) {
240
+ for (const marker of markerCheck.missing) {
241
+ ctx.ui.notify(`× workflow regression: ${marker} not found in ${subWorkflowPath}`, "error");
242
+ }
243
+ return {
244
+ status: "failed",
245
+ lastPhaseIndex: currentPhaseIndex,
246
+ iterationCounts,
247
+ lastError: `materialization markers missing: ${markerCheck.missing.join(", ")}`,
248
+ };
249
+ }
250
+ }
251
+ // ── 5. Audience check ─────────────────────────────────────────
252
+ // FORGE-BUG-040: every BUG phase is a true `audience: subagent`
253
+ // workflow now; the previous `fix_bug.md` audience-bypass is gone.
254
+ const audienceOk = CallerContextStore.asSubagent(phase.role, () => assertAudience({ workflowName: phase.workflowFile, audience: subWorkflowAudience }, ctx));
255
+ if (!audienceOk) {
256
+ writeBugState(cwd, {
257
+ bugId,
258
+ phaseIndex: currentPhaseIndex,
259
+ iterationCounts,
260
+ halted: true,
261
+ lastError: `audience check failed for ${phase.workflowFile}`,
262
+ savedAt: new Date().toISOString(),
263
+ });
264
+ return {
265
+ status: "failed",
266
+ lastPhaseIndex: currentPhaseIndex,
267
+ iterationCounts,
268
+ lastError: `audience check failed for ${phase.workflowFile}`,
269
+ };
270
+ }
271
+ // ── Read bug record for current status ────────────────────────
272
+ // Skip for PENDING bugIds (bug doesn't exist yet).
273
+ const bugRecordBefore = pendingBugId ? null : readBugRecord(bugId, storeCli, cwd);
274
+ const bugStatusBeforePhase = bugRecordBefore?.status;
275
+ // ── Dispatch (persona load + runForgeSubagent + observer + abort/halt) ──
276
+ // Extracted to bug-phase-dispatch.ts (FORGE-S31). Returns either a
277
+ // terminal result or the live locals the rest of the loop needs.
278
+ const dispatch = await dispatchBugPhase({
279
+ opts,
280
+ phase,
281
+ bugId,
282
+ cwd,
283
+ ctx,
284
+ storeCli,
285
+ currentPhaseIndex,
286
+ iterationCounts,
287
+ dispatchCounts,
288
+ modelRoutingConfig,
289
+ registry,
290
+ isNewBug,
291
+ originalArg,
292
+ subWorkflowMd,
293
+ bugRecordBefore,
294
+ bugStatusBeforePhase,
295
+ pendingBugId,
296
+ });
297
+ if (dispatch.kind === "return")
298
+ return dispatch.result;
299
+ const { result, finishPhaseNode, observer, phaseStart, toolExecutionEvents, debugLogDisabled } = dispatch;
300
+ let { writeDebug, debugLogPath } = dispatch;
301
+ // Capture model/provider from subagent result.
302
+ if (result.model)
303
+ lastModel = result.model;
304
+ if (result.provider)
305
+ lastProvider = result.provider;
306
+ // ── BugId capture after triage phase (Finding #1, #2) ──────────
307
+ // For new bugs, the triage subagent creates the bug record via store-cli.
308
+ // We capture the bugId by scanning tool_execution_end events.
309
+ if (phase.role === "triage" && isNewBug && bugId.startsWith("PENDING-")) {
310
+ const capture = captureTriageBugId({
311
+ bugId,
312
+ cwd,
313
+ ctx,
314
+ storeCli,
315
+ currentPhaseIndex,
316
+ iterationCounts,
317
+ debugLogDisabled,
318
+ toolExecutionEvents,
319
+ }, writeDebug, debugLogPath);
320
+ if (capture.kind === "return")
321
+ return capture.result;
322
+ bugId = capture.bugId;
323
+ debugLogPath = capture.debugLogPath;
324
+ writeDebug = capture.writeDebug;
325
+ }
326
+ {
327
+ const elapsed = Math.floor((Date.now() - phaseStart) / 1000);
328
+ const { turn, toolCount, errCount, cumUsage, cumCompression } = observer.state;
329
+ ctx.ui.notify(`✓ ${phase.role}: ${turn} turn${turn === 1 ? "" : "s"} · ${toolCount} tool call${toolCount === 1 ? "" : "s"}${errCount ? ` · ${errCount} err` : ""} · ${elapsed}s`, "info");
330
+ orchTranscript.record({
331
+ kind: "phase-end",
332
+ ts: new Date().toISOString(),
333
+ phase: phase.role,
334
+ phaseIndex: currentPhaseIndex,
335
+ attempt: (iterationCounts[phase.role] ?? 0) + 1,
336
+ verdict: "n/a",
337
+ elapsedMs: Date.now() - phaseStart,
338
+ turns: turn,
339
+ toolCount,
340
+ errCount,
341
+ subagentTranscriptPath: result.subagentTranscriptPath,
342
+ });
343
+ registry.appendTail(bugId, phase.role, fmtPhaseSummary({
344
+ role: phase.role,
345
+ turns: turn,
346
+ tools: toolCount,
347
+ errors: errCount,
348
+ wallSeconds: elapsed,
349
+ usage: cumUsage,
350
+ model: result.model,
351
+ provider: result.provider,
352
+ compression: cumCompression.tokensSaved > 0 ? cumCompression : undefined,
353
+ }));
354
+ }
355
+ // ── Slice-2: orchestrator emits phase event ──────────────────
356
+ // sprintId for bug event emission is the literal "bugs" (routing key),
357
+ // matching the convention in .forge/workflows/fix_bug.md.
358
+ const phaseEndMs = Date.now();
359
+ const bugRecord = readBugRecord(bugId, storeCli, cwd);
360
+ const sprintId = "bugs"; // routing key for bug events — not a sprint reference
361
+ const phaseIteration = (iterationCounts[phase.role] ?? 0) + 1;
362
+ // Read summary judgement for review phases (using bug summary key map)
363
+ const judgement = phase.isReview
364
+ ? judgementFromSummary(bugRecord ?? null, phase.role, BUG_SUMMARY_KEY_BY_ROLE)
365
+ : undefined;
366
+ const emitCtx = {
367
+ entityType: "bug",
368
+ bugId,
369
+ sprintId, // routing key "bugs" — not a sprint reference
370
+ phase,
371
+ iteration: phaseIteration,
372
+ startMs: phaseStart,
373
+ endMs: phaseEndMs,
374
+ model: result.model ?? "unknown",
375
+ provider: result.provider ?? "unknown",
376
+ usage: {
377
+ input: result.usage.input,
378
+ output: result.usage.output,
379
+ cacheRead: result.usage.cacheRead,
380
+ cacheWrite: result.usage.cacheWrite,
381
+ },
382
+ judgement,
383
+ storeCli,
384
+ cwd,
385
+ };
386
+ const phaseEvent = buildPhaseEvent(emitCtx);
387
+ // Set bug event type based on BUG_TYPE_TOKENS mapping.
388
+ const typeTokenEntry = BUG_TYPE_TOKENS[phase.role];
389
+ if (typeTokenEntry) {
390
+ if (phase.isReview && judgement?.verdict === "revision") {
391
+ phaseEvent.type = typeTokenEntry.fail;
392
+ }
393
+ else {
394
+ phaseEvent.type = typeTokenEntry.pass;
395
+ }
396
+ }
397
+ const emitResult = emitEvent(storeCli, cwd, sprintId, phaseEvent);
398
+ if (!emitResult.ok) {
399
+ ctx.ui.notify(`⚠ forge:fix-bug — phase event emit failed for ${phase.role}: ${emitResult.stderr.trim()}`, "warning");
400
+ writeDebug({ kind: "emit_failed", stderr: emitResult.stderr });
401
+ }
402
+ else {
403
+ writeDebug({ kind: "emit_ok", eventId: phaseEvent.eventId });
404
+ }
405
+ // Drain friction file for this phase.
406
+ const frictionPath = path.join(cwd, ".forge", "cache", `FRICTION-${phase.role}.jsonl`);
407
+ const drain = drainFrictionFile(frictionPath, emitCtx);
408
+ if (drain.emitted + drain.failed > 0) {
409
+ writeDebug({ kind: "friction_drain", ...drain });
410
+ if (drain.failed > 0) {
411
+ ctx.ui.notify(`⚠ forge:fix-bug — friction drain for ${phase.role}: ${drain.emitted} ok, ${drain.failed} failed`, "warning");
412
+ }
413
+ }
414
+ // ── AC §C.16: Bug FSM canonical-enum assertion ────────────────
415
+ // After each phase that could transition bug status, validate the new
416
+ // status via store-cli (single source of truth). Surface a warning (not halt) if invalid.
417
+ const currentBugRecordForAssert = readBugRecord(bugId, storeCli, cwd);
418
+ if (currentBugRecordForAssert && currentBugRecordForAssert.status) {
419
+ // Defer to store-cli's isLegalTransition as authoritative guard.
420
+ // Only warn on statuses store-cli itself would reject.
421
+ const validateResult = spawnSync("node", [storeCli, "validate", "bug", JSON.stringify(currentBugRecordForAssert)], { cwd, encoding: "utf8" });
422
+ if (validateResult.status !== 0) {
423
+ const detail = typeof validateResult.stderr === "string" ? validateResult.stderr.trim() : "unknown";
424
+ ctx.ui.notify(`⚠ forge:fix-bug — bug ${bugId} validation warning: ${detail}`, "warning");
425
+ writeDebug({ kind: "fsm_assertion_warning", bugId, status: currentBugRecordForAssert.status, detail });
426
+ }
427
+ }
428
+ // ── 6b. Verdict check (review phases only) ────────────────────
429
+ if (phase.isReview) {
430
+ const outcome = await handleBugReviewVerdict({
431
+ phase,
432
+ bugId,
433
+ storeCli,
434
+ cwd,
435
+ forgeRoot,
436
+ iterationCounts,
437
+ currentPhaseIndex,
438
+ modelRoutingConfig,
439
+ ctx,
440
+ orchTranscript,
441
+ summaryKeyByRole: BUG_SUMMARY_KEY_BY_ROLE,
442
+ recoveredPhases,
443
+ finishPhaseNode,
444
+ });
445
+ if (outcome.kind === "return")
446
+ return outcome.result;
447
+ if (outcome.kind === "loopback") {
448
+ currentPhaseIndex = outcome.toIndex;
449
+ continue;
450
+ }
451
+ // outcome.kind === "advance": fall through to advance
452
+ }
453
+ // ── Advance to next phase ─────────────────────────────────────
454
+ registry.completePhase(bugId, phase.role, "completed");
455
+ finishPhaseNode("completed");
456
+ writeBugState(cwd, {
457
+ bugId,
458
+ phaseIndex: currentPhaseIndex,
459
+ iterationCounts,
460
+ halted: false,
461
+ savedAt: new Date().toISOString(),
462
+ });
463
+ // ── 6c. Path A / Path B branch (post-triage) ──────────────────
464
+ // Per meta-fix-bug.md § Triage Judgement (forge v0.44.0+), the
465
+ // triage subagent records the route decision in
466
+ // bug.summaries.triage.route. The orchestrator reads it after
467
+ // triage returns and selects the downstream phase list:
468
+ // Path A (short-circuit): skip plan-fix + review-plan
469
+ // Path B (default, full loop): run all phases
470
+ //
471
+ // If route is missing or malformed, default to Path B (the safe
472
+ // choice — running extra phases never produces an unsafe outcome).
473
+ // The PHASE_SKIP_STATES heuristic at section 6a remains as
474
+ // defense-in-depth for cases where the field is missing but the
475
+ // bug status proves the work happened.
476
+ if (phase.role === "triage") {
477
+ const routing = routeAfterTriage({ bugId, cwd, ctx, storeCli, currentPhaseIndex });
478
+ if (routing.kind === "jump") {
479
+ currentPhaseIndex = routing.toIndex;
480
+ continue;
481
+ }
482
+ }
483
+ currentPhaseIndex++;
484
+ }
485
+ // ── All phases complete ───────────────────────────────────────────
486
+ deleteBugState(cwd, bugId);
487
+ orchTranscript.record({
488
+ kind: "pipeline-end",
489
+ ts: new Date().toISOString(),
490
+ outcome: "complete",
491
+ elapsedMs: Date.now() - pipelineStartMs,
492
+ });
493
+ return {
494
+ status: "completed",
495
+ lastPhaseIndex: BUG_PHASES.length - 1,
496
+ iterationCounts,
497
+ model: lastModel,
498
+ provider: lastProvider,
499
+ };
500
+ }
501
+ //# sourceMappingURL=run-bug-pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-bug-pipeline.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/bug/run-bug-pipeline.ts"],"names":[],"mappings":"AAAA,+EAA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9D,wDAAwD;QACxD,wDAAwD;QACxD,gDAAgD;QAChD,EAAE;QACF,gEAAgE;QAChE,mEAAmE;QACnE,2DAA2D;QAC3D,gEAAgE;QAChE,uCAAuC;QACvC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC;YACnF,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC7B,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;gBACpC,SAAS;YACV,CAAC;QACF,CAAC;QAED,iBAAiB,EAAE,CAAC;IACrB,CAAC;IAED,qEAAqE;IACrE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3B,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,UAAU,CAAC,MAAM,GAAG,CAAC;QACrC,eAAe;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,YAAY;KACtB,CAAC;AACH,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import { type ForgeToolDefs } from "../../forge-tools.js";
3
+ import { getSessionRegistry } from "../../session-registry.js";
4
+ import type { RunBugState } from "./bug-state.js";
5
+ export type RunBugPipelineStatus = "completed" | "halted" | "escalated" | "failed" | "cancelled";
6
+ export interface RunBugPipelineResult {
7
+ status: RunBugPipelineStatus;
8
+ lastPhaseIndex: number;
9
+ iterationCounts: Record<string, number>;
10
+ lastError?: string;
11
+ model?: string;
12
+ provider?: string;
13
+ /**
14
+ * Project-local orchestrator JSONL path for this run. Callers hand it to
15
+ * archiveRun() to mirror the run into the central transcript archive.
16
+ * Unset only when the pipeline returned before the writer was created.
17
+ */
18
+ orchestratorTranscriptPath?: string;
19
+ }
20
+ export interface RunBugPipelineOptions {
21
+ bugId: string;
22
+ /** Original free-form text argument when creating a new bug (not a FORGE-BUG-NNN ID).
23
+ * Passed to triage-phase subagent so it can create the bug with a meaningful description. */
24
+ originalArg?: string;
25
+ /** Whether this is a new bug (free-form text) vs. an existing FORGE-BUG-NNN ID. */
26
+ isNewBug?: boolean;
27
+ cwd: string;
28
+ ctx: ExtensionCommandContext;
29
+ forgeRoot: string;
30
+ storeCli: string;
31
+ preflightGate: string;
32
+ registry: ReturnType<typeof getSessionRegistry>;
33
+ resumeFromState?: RunBugState;
34
+ /**
35
+ * Optional AbortSignal from SessionRegistry. When provided, the pipeline
36
+ * checks signal.aborted between phases and passes the signal to
37
+ * runForgeSubagent so in-flight subagents can be aborted.
38
+ */
39
+ signal?: AbortSignal;
40
+ forgeToolDefs?: ForgeToolDefs;
41
+ }
@@ -0,0 +1,5 @@
1
+ // run-bug-types.ts — pipeline option/result/status types for the bug pipeline.
2
+ // Extracted VERBATIM from fix-bug.ts (FORGE-S31 file-size refactor); no logic
3
+ // changes.
4
+ export {};
5
+ //# sourceMappingURL=run-bug-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-bug-types.js","sourceRoot":"","sources":["../../../../../src/extensions/forgecli/orchestrators/bug/run-bug-types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,WAAW"}
@@ -0,0 +1,43 @@
1
+ import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import { type MergedConfig } from "../../config/config-layer.js";
3
+ import type { OrchestratorNotifier } from "./orchestrator-notify.js";
4
+ export interface ModelValidationInputs {
5
+ personaCatalogue: string[];
6
+ pipelineCatalogue: string[] | null;
7
+ availableModels: Array<{
8
+ provider: string;
9
+ id: string;
10
+ }>;
11
+ }
12
+ /** Gather the model-validation inputs shared by every orchestrator entry: the
13
+ * bundled persona catalogue, the project pipeline names, and the session model
14
+ * registry. The persona dir is resolved relative to this module's dist
15
+ * location (orchestrators/common → four levels up to dist/forge-payload). */
16
+ export declare function gatherModelValidationInputs(cwd: string, ctx: Pick<ExtensionCommandContext, "modelRegistry">): ModelValidationInputs;
17
+ export interface OrchestratorEntry {
18
+ forgeRoot: string;
19
+ storeCli: string;
20
+ preflightGate: string;
21
+ }
22
+ /** Discover the Forge config at cwd. On success, sweep orphaned project
23
+ * transcripts and return the resolved tool paths. On failure, notify and clear
24
+ * the status line, then return null (caller returns immediately). */
25
+ export declare function resolveOrchestratorEntry(opts: {
26
+ cwd: string;
27
+ notify: OrchestratorNotifier;
28
+ }): OrchestratorEntry | null;
29
+ export type PipelinePreflightOutcome = {
30
+ proceed: true;
31
+ modelRoutingConfig: MergedConfig;
32
+ } | {
33
+ proceed: false;
34
+ lastError: string;
35
+ };
36
+ /** Layered-config schema check followed by full model-config validation.
37
+ * Surfaces schema/validation errors via the notifier (matching the legacy
38
+ * inline strings) and returns the merged routing config on success. */
39
+ export declare function runPipelinePreflight(opts: {
40
+ cwd: string;
41
+ ctx: ExtensionCommandContext;
42
+ notify: OrchestratorNotifier;
43
+ }): PipelinePreflightOutcome;