@entelligentsia/forgecli 1.0.20 → 1.0.21

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 (324) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +7 -1
  3. package/dist/bin/config.js +4 -4
  4. package/dist/bin/config.js.map +1 -1
  5. package/dist/bin/update-cli.d.ts +1 -1
  6. package/dist/bin/update-cli.js +1 -1
  7. package/dist/bin/update-cli.js.map +1 -1
  8. package/dist/extensions/forgecli/ask-user-tool.js +1 -1
  9. package/dist/extensions/forgecli/ask-user-tool.js.map +1 -1
  10. package/dist/extensions/forgecli/commands/add-pipeline.d.ts +19 -0
  11. package/dist/extensions/forgecli/commands/add-pipeline.js +143 -0
  12. package/dist/extensions/forgecli/commands/add-pipeline.js.map +1 -0
  13. package/dist/extensions/forgecli/commands/add-task.d.ts +20 -0
  14. package/dist/extensions/forgecli/commands/add-task.js +154 -0
  15. package/dist/extensions/forgecli/commands/add-task.js.map +1 -0
  16. package/dist/extensions/forgecli/commands/approve.d.ts +22 -0
  17. package/dist/extensions/forgecli/commands/approve.js +152 -0
  18. package/dist/extensions/forgecli/commands/approve.js.map +1 -0
  19. package/dist/extensions/forgecli/commands/collate.d.ts +22 -0
  20. package/dist/extensions/forgecli/commands/collate.js +134 -0
  21. package/dist/extensions/forgecli/commands/collate.js.map +1 -0
  22. package/dist/extensions/forgecli/commands/commit.d.ts +22 -0
  23. package/dist/extensions/forgecli/commands/commit.js +152 -0
  24. package/dist/extensions/forgecli/commands/commit.js.map +1 -0
  25. package/dist/extensions/forgecli/commands/config-command.d.ts +8 -0
  26. package/dist/extensions/forgecli/commands/config-command.js +67 -0
  27. package/dist/extensions/forgecli/commands/config-command.js.map +1 -0
  28. package/dist/extensions/forgecli/commands/enhance.d.ts +45 -0
  29. package/dist/extensions/forgecli/commands/enhance.js +219 -0
  30. package/dist/extensions/forgecli/commands/enhance.js.map +1 -0
  31. package/dist/extensions/forgecli/commands/implement.d.ts +22 -0
  32. package/dist/extensions/forgecli/commands/implement.js +170 -0
  33. package/dist/extensions/forgecli/commands/implement.js.map +1 -0
  34. package/dist/extensions/forgecli/commands/plan.d.ts +22 -0
  35. package/dist/extensions/forgecli/commands/plan.js +167 -0
  36. package/dist/extensions/forgecli/commands/plan.js.map +1 -0
  37. package/dist/extensions/forgecli/commands/quiz-agent.d.ts +17 -0
  38. package/dist/extensions/forgecli/commands/quiz-agent.js +98 -0
  39. package/dist/extensions/forgecli/commands/quiz-agent.js.map +1 -0
  40. package/dist/extensions/forgecli/commands/read-command.d.ts +2 -0
  41. package/dist/extensions/forgecli/commands/read-command.js +100 -0
  42. package/dist/extensions/forgecli/commands/read-command.js.map +1 -0
  43. package/dist/extensions/forgecli/commands/regenerate.d.ts +40 -0
  44. package/dist/extensions/forgecli/commands/regenerate.js +426 -0
  45. package/dist/extensions/forgecli/commands/regenerate.js.map +1 -0
  46. package/dist/extensions/forgecli/commands/remove-command.d.ts +17 -0
  47. package/dist/extensions/forgecli/commands/remove-command.js +124 -0
  48. package/dist/extensions/forgecli/commands/remove-command.js.map +1 -0
  49. package/dist/extensions/forgecli/commands/report-bug.d.ts +25 -0
  50. package/dist/extensions/forgecli/commands/report-bug.js +159 -0
  51. package/dist/extensions/forgecli/commands/report-bug.js.map +1 -0
  52. package/dist/extensions/forgecli/commands/retrospective.d.ts +20 -0
  53. package/dist/extensions/forgecli/commands/retrospective.js +126 -0
  54. package/dist/extensions/forgecli/commands/retrospective.js.map +1 -0
  55. package/dist/extensions/forgecli/commands/review-code.d.ts +35 -0
  56. package/dist/extensions/forgecli/commands/review-code.js +196 -0
  57. package/dist/extensions/forgecli/commands/review-code.js.map +1 -0
  58. package/dist/extensions/forgecli/commands/review-plan.d.ts +35 -0
  59. package/dist/extensions/forgecli/commands/review-plan.js +200 -0
  60. package/dist/extensions/forgecli/commands/review-plan.js.map +1 -0
  61. package/dist/extensions/forgecli/commands/sprint-intake.d.ts +10 -0
  62. package/dist/extensions/forgecli/commands/sprint-intake.js +91 -0
  63. package/dist/extensions/forgecli/commands/sprint-intake.js.map +1 -0
  64. package/dist/extensions/forgecli/commands/sprint-plan.d.ts +14 -0
  65. package/dist/extensions/forgecli/commands/sprint-plan.js +122 -0
  66. package/dist/extensions/forgecli/commands/sprint-plan.js.map +1 -0
  67. package/dist/extensions/forgecli/commands/status-command.d.ts +19 -0
  68. package/dist/extensions/forgecli/commands/status-command.js +140 -0
  69. package/dist/extensions/forgecli/commands/status-command.js.map +1 -0
  70. package/dist/extensions/forgecli/commands/store-query.d.ts +22 -0
  71. package/dist/extensions/forgecli/commands/store-query.js +107 -0
  72. package/dist/extensions/forgecli/commands/store-query.js.map +1 -0
  73. package/dist/extensions/forgecli/commands/store-repair.d.ts +17 -0
  74. package/dist/extensions/forgecli/commands/store-repair.js +123 -0
  75. package/dist/extensions/forgecli/commands/store-repair.js.map +1 -0
  76. package/dist/extensions/forgecli/commands/test-orchestrate.d.ts +2 -0
  77. package/dist/extensions/forgecli/commands/test-orchestrate.js +182 -0
  78. package/dist/extensions/forgecli/commands/test-orchestrate.js.map +1 -0
  79. package/dist/extensions/forgecli/commands/transcripts-command.d.ts +87 -0
  80. package/dist/extensions/forgecli/commands/transcripts-command.js +418 -0
  81. package/dist/extensions/forgecli/commands/transcripts-command.js.map +1 -0
  82. package/dist/extensions/forgecli/commands/validate.d.ts +22 -0
  83. package/dist/extensions/forgecli/commands/validate.js +152 -0
  84. package/dist/extensions/forgecli/commands/validate.js.map +1 -0
  85. package/dist/extensions/forgecli/config/config-layer.d.ts +53 -0
  86. package/dist/extensions/forgecli/config/config-layer.js +72 -0
  87. package/dist/extensions/forgecli/config/config-layer.js.map +1 -0
  88. package/dist/extensions/forgecli/config/config-writer.d.ts +16 -0
  89. package/dist/extensions/forgecli/config/config-writer.js +69 -0
  90. package/dist/extensions/forgecli/config/config-writer.js.map +1 -0
  91. package/dist/extensions/forgecli/config/model-registry.d.ts +61 -0
  92. package/dist/extensions/forgecli/config/model-registry.js +127 -0
  93. package/dist/extensions/forgecli/config/model-registry.js.map +1 -0
  94. package/dist/extensions/forgecli/config/model-resolver.d.ts +32 -0
  95. package/dist/extensions/forgecli/config/model-resolver.js +65 -0
  96. package/dist/extensions/forgecli/config/model-resolver.js.map +1 -0
  97. package/dist/extensions/forgecli/config/model-validator.d.ts +29 -0
  98. package/dist/extensions/forgecli/config/model-validator.js +107 -0
  99. package/dist/extensions/forgecli/config/model-validator.js.map +1 -0
  100. package/dist/extensions/forgecli/config-tui/component.js +1 -1
  101. package/dist/extensions/forgecli/config-tui/component.js.map +1 -1
  102. package/dist/extensions/forgecli/config-tui/handler.js +1 -1
  103. package/dist/extensions/forgecli/config-tui/handler.js.map +1 -1
  104. package/dist/extensions/forgecli/config-tui/screens/override-editor.js +1 -1
  105. package/dist/extensions/forgecli/config-tui/screens/override-editor.js.map +1 -1
  106. package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js +1 -1
  107. package/dist/extensions/forgecli/config-tui/screens/overrides-list-phases.js.map +1 -1
  108. package/dist/extensions/forgecli/config-tui/screens/show-resolved.js +1 -1
  109. package/dist/extensions/forgecli/config-tui/screens/show-resolved.js.map +1 -1
  110. package/dist/extensions/forgecli/config-tui/state/buffer.d.ts +2 -2
  111. package/dist/extensions/forgecli/config-tui/state/model.d.ts +1 -1
  112. package/dist/extensions/forgecli/config-tui/state/reducer.js.map +1 -1
  113. package/dist/extensions/forgecli/config-tui/state/selectors.d.ts +2 -2
  114. package/dist/extensions/forgecli/config-tui/state/selectors.js +1 -1
  115. package/dist/extensions/forgecli/config-tui/state/selectors.js.map +1 -1
  116. package/dist/extensions/forgecli/context-governor-compaction.d.ts +13 -2
  117. package/dist/extensions/forgecli/context-governor-compaction.js +66 -41
  118. package/dist/extensions/forgecli/context-governor-compaction.js.map +1 -1
  119. package/dist/extensions/forgecli/context-governor.d.ts +3 -7
  120. package/dist/extensions/forgecli/context-governor.js +43 -69
  121. package/dist/extensions/forgecli/context-governor.js.map +1 -1
  122. package/dist/extensions/forgecli/dashboard/component.d.ts +10 -1
  123. package/dist/extensions/forgecli/dashboard/component.js +84 -18
  124. package/dist/extensions/forgecli/dashboard/component.js.map +1 -1
  125. package/dist/extensions/forgecli/dashboard/register.js +1 -1
  126. package/dist/extensions/forgecli/dashboard/register.js.map +1 -1
  127. package/dist/extensions/forgecli/forge-artifact-tool.js +1 -1
  128. package/dist/extensions/forgecli/forge-commands.js +1 -1
  129. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  130. package/dist/extensions/forgecli/forge-init/forge-init.d.ts +26 -0
  131. package/dist/extensions/forgecli/forge-init/forge-init.js +514 -0
  132. package/dist/extensions/forgecli/forge-init/forge-init.js.map +1 -0
  133. package/dist/extensions/forgecli/forge-init/init-context.d.ts +99 -0
  134. package/dist/extensions/forgecli/forge-init/init-context.js +178 -0
  135. package/dist/extensions/forgecli/forge-init/init-context.js.map +1 -0
  136. package/dist/extensions/forgecli/forge-init/init-progress.d.ts +39 -0
  137. package/dist/extensions/forgecli/forge-init/init-progress.js +117 -0
  138. package/dist/extensions/forgecli/forge-init/init-progress.js.map +1 -0
  139. package/dist/extensions/forgecli/forge-init/phase4-register.js +1 -1
  140. package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
  141. package/dist/extensions/forgecli/forge-init/run-phases.js +2 -2
  142. package/dist/extensions/forgecli/forge-init/run-phases.js.map +1 -1
  143. package/dist/extensions/forgecli/forge-subagent.d.ts +22 -0
  144. package/dist/extensions/forgecli/forge-subagent.js +42 -15
  145. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  146. package/dist/extensions/forgecli/forge-tools.d.ts +0 -25
  147. package/dist/extensions/forgecli/forge-tools.js +6 -37
  148. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  149. package/dist/extensions/forgecli/governor-config.d.ts +19 -0
  150. package/dist/extensions/forgecli/governor-config.js +58 -0
  151. package/dist/extensions/forgecli/governor-config.js.map +1 -0
  152. package/dist/extensions/forgecli/health-check.js +1 -1
  153. package/dist/extensions/forgecli/health-check.js.map +1 -1
  154. package/dist/extensions/forgecli/hook-dispatcher.js +2 -2
  155. package/dist/extensions/forgecli/hook-dispatcher.js.map +1 -1
  156. package/dist/extensions/forgecli/hooks/post-init-hook.js +11 -6
  157. package/dist/extensions/forgecli/hooks/post-init-hook.js.map +1 -1
  158. package/dist/extensions/forgecli/hooks/post-sprint-hook.js +11 -6
  159. package/dist/extensions/forgecli/hooks/post-sprint-hook.js.map +1 -1
  160. package/dist/extensions/forgecli/hooks/write-guard.js +1 -1
  161. package/dist/extensions/forgecli/hooks/write-guard.js.map +1 -1
  162. package/dist/extensions/forgecli/index.js +37 -35
  163. package/dist/extensions/forgecli/index.js.map +1 -1
  164. package/dist/extensions/forgecli/kickoff.d.ts +9 -0
  165. package/dist/extensions/forgecli/kickoff.js +15 -0
  166. package/dist/extensions/forgecli/kickoff.js.map +1 -1
  167. package/dist/extensions/forgecli/lib/forge-config.d.ts +1 -1
  168. package/dist/extensions/forgecli/lib/forge-config.js +1 -1
  169. package/dist/extensions/forgecli/lib/forge-config.js.map +1 -1
  170. package/dist/extensions/forgecli/lib/forge-root.d.ts +10 -0
  171. package/dist/extensions/forgecli/lib/forge-root.js +62 -0
  172. package/dist/extensions/forgecli/lib/forge-root.js.map +1 -0
  173. package/dist/extensions/forgecli/lib/run-cjs.d.ts +26 -0
  174. package/dist/extensions/forgecli/lib/run-cjs.js +42 -0
  175. package/dist/extensions/forgecli/lib/run-cjs.js.map +1 -0
  176. package/dist/extensions/forgecli/orchestrator-tree.d.ts +4 -0
  177. package/dist/extensions/forgecli/orchestrator-tree.js +21 -3
  178. package/dist/extensions/forgecli/orchestrator-tree.js.map +1 -1
  179. package/dist/extensions/forgecli/orchestrators/calibrate.d.ts +64 -0
  180. package/dist/extensions/forgecli/orchestrators/calibrate.js +481 -0
  181. package/dist/extensions/forgecli/orchestrators/calibrate.js.map +1 -0
  182. package/dist/extensions/forgecli/orchestrators/fix-bug.d.ts +93 -0
  183. package/dist/extensions/forgecli/orchestrators/fix-bug.js +1705 -0
  184. package/dist/extensions/forgecli/orchestrators/fix-bug.js.map +1 -0
  185. package/dist/extensions/forgecli/orchestrators/halt-advisor.d.ts +59 -0
  186. package/dist/extensions/forgecli/orchestrators/halt-advisor.js +113 -0
  187. package/dist/extensions/forgecli/orchestrators/halt-advisor.js.map +1 -0
  188. package/dist/extensions/forgecli/orchestrators/materialize.d.ts +16 -0
  189. package/dist/extensions/forgecli/orchestrators/materialize.js +195 -0
  190. package/dist/extensions/forgecli/orchestrators/materialize.js.map +1 -0
  191. package/dist/extensions/forgecli/orchestrators/migrate.d.ts +22 -0
  192. package/dist/extensions/forgecli/orchestrators/migrate.js +260 -0
  193. package/dist/extensions/forgecli/orchestrators/migrate.js.map +1 -0
  194. package/dist/extensions/forgecli/orchestrators/orchestrator-preflight.d.ts +46 -0
  195. package/dist/extensions/forgecli/orchestrators/orchestrator-preflight.js +64 -0
  196. package/dist/extensions/forgecli/orchestrators/orchestrator-preflight.js.map +1 -0
  197. package/dist/extensions/forgecli/orchestrators/run-sprint.d.ts +27 -0
  198. package/dist/extensions/forgecli/orchestrators/run-sprint.js +734 -0
  199. package/dist/extensions/forgecli/orchestrators/run-sprint.js.map +1 -0
  200. package/dist/extensions/forgecli/orchestrators/run-task.d.ts +215 -0
  201. package/dist/extensions/forgecli/orchestrators/run-task.js +1491 -0
  202. package/dist/extensions/forgecli/orchestrators/run-task.js.map +1 -0
  203. package/dist/extensions/forgecli/paths/paths.d.ts +8 -0
  204. package/dist/extensions/forgecli/paths/paths.js +17 -0
  205. package/dist/extensions/forgecli/paths/paths.js.map +1 -1
  206. package/dist/extensions/forgecli/phase-vocab.d.ts +31 -0
  207. package/dist/extensions/forgecli/phase-vocab.js +82 -0
  208. package/dist/extensions/forgecli/phase-vocab.js.map +1 -0
  209. package/dist/extensions/forgecli/session-registry.d.ts +2 -2
  210. package/dist/extensions/forgecli/session-registry.js +6 -2
  211. package/dist/extensions/forgecli/session-registry.js.map +1 -1
  212. package/dist/extensions/forgecli/skill-curation/friction-emit.d.ts +99 -0
  213. package/dist/extensions/forgecli/skill-curation/friction-emit.js +245 -0
  214. package/dist/extensions/forgecli/skill-curation/friction-emit.js.map +1 -0
  215. package/dist/extensions/forgecli/skill-curation/skill-curation-flag.d.ts +21 -0
  216. package/dist/extensions/forgecli/skill-curation/skill-curation-flag.js +71 -0
  217. package/dist/extensions/forgecli/skill-curation/skill-curation-flag.js.map +1 -0
  218. package/dist/extensions/forgecli/skill-curation/skill-curator-subagent.d.ts +102 -0
  219. package/dist/extensions/forgecli/skill-curation/skill-curator-subagent.js +339 -0
  220. package/dist/extensions/forgecli/skill-curation/skill-curator-subagent.js.map +1 -0
  221. package/dist/extensions/forgecli/skill-curation/skill-retriever.d.ts +84 -0
  222. package/dist/extensions/forgecli/skill-curation/skill-retriever.js +246 -0
  223. package/dist/extensions/forgecli/skill-curation/skill-retriever.js.map +1 -0
  224. package/dist/extensions/forgecli/skill-curation/skill-usage-tracker.d.ts +91 -0
  225. package/dist/extensions/forgecli/skill-curation/skill-usage-tracker.js +224 -0
  226. package/dist/extensions/forgecli/skill-curation/skill-usage-tracker.js.map +1 -0
  227. package/dist/extensions/forgecli/store/store-error-remediation.d.ts +65 -0
  228. package/dist/extensions/forgecli/store/store-error-remediation.js +307 -0
  229. package/dist/extensions/forgecli/store/store-error-remediation.js.map +1 -0
  230. package/dist/extensions/forgecli/store/store-resolver.d.ts +56 -0
  231. package/dist/extensions/forgecli/store/store-resolver.js +263 -0
  232. package/dist/extensions/forgecli/store/store-resolver.js.map +1 -0
  233. package/dist/extensions/forgecli/store/store-validator.d.ts +16 -0
  234. package/dist/extensions/forgecli/store/store-validator.js +32 -0
  235. package/dist/extensions/forgecli/store/store-validator.js.map +1 -0
  236. package/dist/extensions/forgecli/store/transition-guard.d.ts +20 -0
  237. package/dist/extensions/forgecli/store/transition-guard.js +89 -0
  238. package/dist/extensions/forgecli/store/transition-guard.js.map +1 -0
  239. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js +5 -0
  240. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js.map +1 -1
  241. package/dist/extensions/forgecli/transcript-archive-types.d.ts +171 -0
  242. package/dist/extensions/forgecli/transcript-archive-types.js +130 -0
  243. package/dist/extensions/forgecli/transcript-archive-types.js.map +1 -0
  244. package/dist/extensions/forgecli/transcript-archive.d.ts +127 -0
  245. package/dist/extensions/forgecli/transcript-archive.js +656 -0
  246. package/dist/extensions/forgecli/transcript-archive.js.map +1 -0
  247. package/dist/extensions/forgecli/transcript-replay.d.ts +28 -0
  248. package/dist/extensions/forgecli/transcript-replay.js +153 -0
  249. package/dist/extensions/forgecli/transcript-replay.js.map +1 -0
  250. package/dist/extensions/forgecli/transcripts-tui/component.d.ts +36 -0
  251. package/dist/extensions/forgecli/transcripts-tui/component.js +112 -0
  252. package/dist/extensions/forgecli/transcripts-tui/component.js.map +1 -0
  253. package/dist/extensions/forgecli/transcripts-tui/index.d.ts +4 -0
  254. package/dist/extensions/forgecli/transcripts-tui/index.js +5 -0
  255. package/dist/extensions/forgecli/transcripts-tui/index.js.map +1 -0
  256. package/dist/extensions/forgecli/transcripts-tui/screens/browse.d.ts +21 -0
  257. package/dist/extensions/forgecli/transcripts-tui/screens/browse.js +172 -0
  258. package/dist/extensions/forgecli/transcripts-tui/screens/browse.js.map +1 -0
  259. package/dist/extensions/forgecli/transcripts-tui/screens/types.d.ts +22 -0
  260. package/dist/extensions/forgecli/transcripts-tui/screens/types.js +4 -0
  261. package/dist/extensions/forgecli/transcripts-tui/screens/types.js.map +1 -0
  262. package/dist/extensions/forgecli/transcripts-tui/state/index.d.ts +4 -0
  263. package/dist/extensions/forgecli/transcripts-tui/state/index.js +5 -0
  264. package/dist/extensions/forgecli/transcripts-tui/state/index.js.map +1 -0
  265. package/dist/extensions/forgecli/transcripts-tui/state/init.d.ts +8 -0
  266. package/dist/extensions/forgecli/transcripts-tui/state/init.js +18 -0
  267. package/dist/extensions/forgecli/transcripts-tui/state/init.js.map +1 -0
  268. package/dist/extensions/forgecli/transcripts-tui/state/model.d.ts +56 -0
  269. package/dist/extensions/forgecli/transcripts-tui/state/model.js +6 -0
  270. package/dist/extensions/forgecli/transcripts-tui/state/model.js.map +1 -0
  271. package/dist/extensions/forgecli/transcripts-tui/state/reducer.d.ts +2 -0
  272. package/dist/extensions/forgecli/transcripts-tui/state/reducer.js +51 -0
  273. package/dist/extensions/forgecli/transcripts-tui/state/reducer.js.map +1 -0
  274. package/dist/extensions/forgecli/transcripts-tui/state/selectors.d.ts +10 -0
  275. package/dist/extensions/forgecli/transcripts-tui/state/selectors.js +62 -0
  276. package/dist/extensions/forgecli/transcripts-tui/state/selectors.js.map +1 -0
  277. package/dist/extensions/forgecli/transcripts-tui/theme.d.ts +20 -0
  278. package/dist/extensions/forgecli/transcripts-tui/theme.js +47 -0
  279. package/dist/extensions/forgecli/transcripts-tui/theme.js.map +1 -0
  280. package/dist/extensions/forgecli/tui/banner.d.ts +10 -0
  281. package/dist/extensions/forgecli/tui/banner.js +36 -0
  282. package/dist/extensions/forgecli/tui/banner.js.map +1 -0
  283. package/dist/extensions/forgecli/tui/forge-header.d.ts +12 -0
  284. package/dist/extensions/forgecli/tui/forge-header.js +114 -0
  285. package/dist/extensions/forgecli/tui/forge-header.js.map +1 -0
  286. package/dist/extensions/forgecli/tui/input-router.d.ts +33 -0
  287. package/dist/extensions/forgecli/tui/input-router.js +136 -0
  288. package/dist/extensions/forgecli/tui/input-router.js.map +1 -0
  289. package/dist/extensions/forgecli/tui/orchestrator-status-bar.d.ts +26 -0
  290. package/dist/extensions/forgecli/tui/orchestrator-status-bar.js +213 -0
  291. package/dist/extensions/forgecli/tui/orchestrator-status-bar.js.map +1 -0
  292. package/dist/extensions/forgecli/tui/thread-switcher.d.ts +18 -0
  293. package/dist/extensions/forgecli/tui/thread-switcher.js +194 -0
  294. package/dist/extensions/forgecli/tui/thread-switcher.js.map +1 -0
  295. package/dist/extensions/forgecli/update/forge-update-command.d.ts +100 -0
  296. package/dist/extensions/forgecli/update/forge-update-command.js +435 -0
  297. package/dist/extensions/forgecli/update/forge-update-command.js.map +1 -0
  298. package/dist/extensions/forgecli/update/migration-engine.d.ts +117 -0
  299. package/dist/extensions/forgecli/update/migration-engine.js +563 -0
  300. package/dist/extensions/forgecli/update/migration-engine.js.map +1 -0
  301. package/dist/extensions/forgecli/update/update-check.d.ts +37 -0
  302. package/dist/extensions/forgecli/update/update-check.js +185 -0
  303. package/dist/extensions/forgecli/update/update-check.js.map +1 -0
  304. package/dist/extensions/forgecli/update/update-tools.d.ts +23 -0
  305. package/dist/extensions/forgecli/update/update-tools.js +135 -0
  306. package/dist/extensions/forgecli/update/update-tools.js.map +1 -0
  307. package/dist/extensions/forgecli/update/whats-new-widget.d.ts +26 -0
  308. package/dist/extensions/forgecli/update/whats-new-widget.js +376 -0
  309. package/dist/extensions/forgecli/update/whats-new-widget.js.map +1 -0
  310. package/dist/extensions/forgecli/update/whats-new.d.ts +120 -0
  311. package/dist/extensions/forgecli/update/whats-new.js +470 -0
  312. package/dist/extensions/forgecli/update/whats-new.js.map +1 -0
  313. package/dist/extensions/forgecli/viewport/events.d.ts +113 -0
  314. package/dist/extensions/forgecli/viewport/events.js +290 -0
  315. package/dist/extensions/forgecli/viewport/events.js.map +1 -0
  316. package/dist/extensions/forgecli/viewport/renderer.d.ts +102 -0
  317. package/dist/extensions/forgecli/viewport/renderer.js +277 -0
  318. package/dist/extensions/forgecli/viewport/renderer.js.map +1 -0
  319. package/dist/extensions/forgecli/viewport/theme.d.ts +11 -0
  320. package/dist/extensions/forgecli/viewport/theme.js +131 -0
  321. package/dist/extensions/forgecli/viewport/theme.js.map +1 -0
  322. package/dist/extensions/forgecli/wf-engine/engine.js +1 -1
  323. package/dist/extensions/forgecli/wf-engine/engine.js.map +1 -1
  324. package/package.json +4 -2
@@ -0,0 +1,245 @@
1
+ // Auto-emit friction events with 5 skill subkinds — FORGE-S24-T11.
2
+ //
3
+ // At task close, the orchestrator hands a snapshot of {retrieved skills,
4
+ // usage verdicts (T09), task outcome, observed tool errors, per-skill
5
+ // historical "unused" counts, pairwise retrieval overlaps} to this module.
6
+ // `computeFrictionSignals` is a pure classifier; `emitFrictionEvents` writes
7
+ // one `friction` event per signal via `node <storeCli> emit <sprintId> …`.
8
+ //
9
+ // Gating logic (acceptance criteria FORGE-S24-T11):
10
+ // - skill_unused : retrieved && !used && task.success
11
+ // - skill_failed : retrieved && used && !task.success
12
+ // - skill_missing : !retrieved && task.success && tool_errors ≥ 2
13
+ // - skill_stale : retrieved && !used across 3 consecutive sprints
14
+ // - skill_redundant : two skills' retrieval overlap > 0.8 in this task
15
+ //
16
+ // Each event carries `{type: "friction", workflow, persona, issue, subkind,
17
+ // skillId, evidence, …runtime attribution}`. The required-trio
18
+ // `{workflow, persona, issue}` is what the event schema (plugin v0.45.x)
19
+ // enforces for `type === "friction"`.
20
+ //
21
+ // Telemetry-actor split (IL10):
22
+ // - Orchestrator owns emission. Subagents never call this module directly.
23
+ // - Runtime attribution (model/provider/timestamps/durationMinutes) is
24
+ // SUPPLIED by the orchestrator — never fabricated here.
25
+ //
26
+ // Iron Laws (forge-cli-engineer):
27
+ // IL1 — code only under forge-cli/src/extensions/forgecli/
28
+ // IL2 — TypeScript + TypeBox. Runtime inputs validated via Value.Parse.
29
+ // IL6 — argv-array spawn. No shell-string interpolation.
30
+ // IL7 — failures surface in the returned counter and stderrs[]; nothing
31
+ // is silently swallowed.
32
+ // IL10 — orchestrator-side emission only; subagent never invokes.
33
+ //
34
+ // Scope boundary: this module classifies and emits. It does NOT crawl
35
+ // the trajectory, decide what counts as a "tool error", or compute
36
+ // retrieval overlaps. The caller (orchestrator handler in run-task.ts /
37
+ // fix-bug.ts, gated by FORGE-S24-T12 flag) does that and passes the
38
+ // shaped inputs in.
39
+ import { Type } from "typebox";
40
+ import { Value } from "typebox/value";
41
+ import { spawnStoreCliEmit } from "../lib/spawn-store-cli.js";
42
+ import { isSkillCurationEnabled } from "./skill-curation-flag.js";
43
+ // ── Public schemas ──────────────────────────────────────────────────────────
44
+ /**
45
+ * One retrieved-and-classified skill for the closed task. `retrieved`
46
+ * comes from T08 (skill-retriever); `used` from T09 (skill-usage-tracker).
47
+ * `retrievalScore` is the T08 score (informational — surfaces in evidence).
48
+ */
49
+ export const RetrievedSkillSignalSchema = Type.Object({
50
+ skillId: Type.String({ minLength: 1 }),
51
+ retrieved: Type.Boolean(),
52
+ used: Type.Boolean(),
53
+ retrievalScore: Type.Number({ minimum: 0, maximum: 1 }),
54
+ });
55
+ /** Per-skill historical signal — supplied by caller from sprint history. */
56
+ export const SkillHistorySchema = Type.Object({
57
+ consecutiveUnusedSprints: Type.Integer({ minimum: 0 }),
58
+ });
59
+ /** One pairwise retrieval-overlap measurement for the closed task. */
60
+ export const PairwiseOverlapSchema = Type.Object({
61
+ skillA: Type.String({ minLength: 1 }),
62
+ skillB: Type.String({ minLength: 1 }),
63
+ overlap: Type.Number({ minimum: 0, maximum: 1 }),
64
+ });
65
+ export const FrictionInputsSchema = Type.Object({
66
+ retrievedSkills: Type.Array(RetrievedSkillSignalSchema),
67
+ taskSuccess: Type.Boolean(),
68
+ toolErrorCount: Type.Integer({ minimum: 0 }),
69
+ history: Type.Record(Type.String(), SkillHistorySchema),
70
+ pairwiseRetrievalOverlap: Type.Optional(Type.Array(PairwiseOverlapSchema)),
71
+ });
72
+ // FORGE-S25-T27: FRICTION_SUBKINDS and FrictionSubkind are now canonical in
73
+ // lib/catalog-types.ts (single source of truth). Re-exported here for backward
74
+ // compatibility — all existing imports of FRICTION_SUBKINDS from this module continue to work.
75
+ // Source of truth: event.schema.json subkind pattern (skill_unused|skill_failed|…).
76
+ import { FRICTION_SUBKINDS } from "../lib/catalog-types.js";
77
+ export { FRICTION_SUBKINDS };
78
+ /** Runtime attribution supplied by the orchestrator (IL10). */
79
+ export const FrictionEmitRuntimeSchema = Type.Object({
80
+ storeCli: Type.String({ minLength: 1 }),
81
+ cwd: Type.String({ minLength: 1 }),
82
+ sprintId: Type.String({ minLength: 1 }),
83
+ taskId: Type.String({ minLength: 1 }),
84
+ /** Orchestrator phase role. @see RoleKind from lib/catalog-types.ts */
85
+ role: Type.String({ minLength: 1 }),
86
+ /** Orchestrator phase action. @see ActionKind from lib/catalog-types.ts */
87
+ action: Type.String({ minLength: 1 }),
88
+ workflow: Type.String({ minLength: 1 }),
89
+ persona: Type.String({ minLength: 1 }),
90
+ phase: Type.Optional(Type.String()),
91
+ iteration: Type.Optional(Type.Integer({ minimum: 1 })),
92
+ startTimestamp: Type.String({ format: "date-time" }),
93
+ endTimestamp: Type.String({ format: "date-time" }),
94
+ durationMinutes: Type.Number({ minimum: 0 }),
95
+ model: Type.String({ minLength: 1 }),
96
+ provider: Type.String({ minLength: 1 }),
97
+ });
98
+ // ── Classification ──────────────────────────────────────────────────────────
99
+ const STALE_THRESHOLD_SPRINTS = 3;
100
+ const REDUNDANCY_OVERLAP_FLOOR = 0.8;
101
+ const MISSING_TOOL_ERROR_FLOOR = 2;
102
+ /**
103
+ * Apply the five gating rules and return one signal per matching emit.
104
+ * Pure: no IO, no subprocess. Caller decides whether/when to emit.
105
+ *
106
+ * The `skill_unused` and `skill_failed` gates are mutually exclusive by
107
+ * design — on a failed task we emit `skill_failed` (when used) rather
108
+ * than `skill_unused`, so the two signals never double-count the same
109
+ * outcome.
110
+ */
111
+ export function computeFrictionSignals(inputs) {
112
+ Value.Parse(FrictionInputsSchema, inputs);
113
+ const signals = [];
114
+ for (const s of inputs.retrievedSkills) {
115
+ // skill_unused — retrieved, not used, task succeeded.
116
+ if (s.retrieved && !s.used && inputs.taskSuccess) {
117
+ signals.push({
118
+ subkind: "skill_unused",
119
+ skillId: s.skillId,
120
+ evidence: {
121
+ retrievalScore: s.retrievalScore,
122
+ taskSuccess: true,
123
+ },
124
+ });
125
+ }
126
+ // skill_failed — retrieved, used, task failed.
127
+ if (s.retrieved && s.used && !inputs.taskSuccess) {
128
+ signals.push({
129
+ subkind: "skill_failed",
130
+ skillId: s.skillId,
131
+ evidence: {
132
+ retrievalScore: s.retrievalScore,
133
+ toolErrorCount: inputs.toolErrorCount,
134
+ },
135
+ });
136
+ }
137
+ // skill_stale — retrieved, not used, and the same {retrieved && !used}
138
+ // pattern has held across STALE_THRESHOLD_SPRINTS consecutive sprints.
139
+ if (s.retrieved && !s.used) {
140
+ const hist = inputs.history[s.skillId];
141
+ if (hist && hist.consecutiveUnusedSprints >= STALE_THRESHOLD_SPRINTS) {
142
+ signals.push({
143
+ subkind: "skill_stale",
144
+ skillId: s.skillId,
145
+ evidence: {
146
+ consecutiveUnusedSprints: hist.consecutiveUnusedSprints,
147
+ },
148
+ });
149
+ }
150
+ }
151
+ }
152
+ // skill_missing — no skill retrieved AND task succeeded AND ≥2 tool errors.
153
+ // Emitted once per task (no skillId — there's nothing to attribute).
154
+ if (inputs.retrievedSkills.length === 0 && inputs.taskSuccess && inputs.toolErrorCount >= MISSING_TOOL_ERROR_FLOOR) {
155
+ signals.push({
156
+ subkind: "skill_missing",
157
+ skillId: undefined,
158
+ evidence: {
159
+ toolErrorCount: inputs.toolErrorCount,
160
+ },
161
+ });
162
+ }
163
+ // skill_redundant — pairwise retrieval overlap strictly > 0.8. Emit one
164
+ // signal per pair, attributed to the FIRST skill in the pair (skillA).
165
+ for (const p of inputs.pairwiseRetrievalOverlap ?? []) {
166
+ if (p.overlap > REDUNDANCY_OVERLAP_FLOOR) {
167
+ signals.push({
168
+ subkind: "skill_redundant",
169
+ skillId: p.skillA,
170
+ evidence: {
171
+ pairedWith: p.skillB,
172
+ overlap: p.overlap,
173
+ },
174
+ });
175
+ }
176
+ }
177
+ return signals;
178
+ }
179
+ // ── Emission ────────────────────────────────────────────────────────────────
180
+ /** ISO-compact timestamp segment for eventId composition. */
181
+ function isoCompact(iso) {
182
+ return iso.replace(/[-:.]/g, "").replace(/Z$/, "Z");
183
+ }
184
+ /**
185
+ * Emit one `friction` event per signal via
186
+ * `node <storeCli> emit <sprintId> <json>`. Runtime attribution
187
+ * (model/provider/timestamps/eventId) is supplied by the caller — never
188
+ * fabricated. Failures surface in the result counter; nothing is thrown
189
+ * for subprocess failure.
190
+ */
191
+ export function emitFrictionEvents(signals, runtime) {
192
+ // FORGE-S24-T12 — gated rollout. Default off ⇒ no friction events
193
+ // for the five SKILL-CURATION subkinds (skill_unused, skill_failed,
194
+ // skill_missing, skill_stale, skill_redundant). Note: this gate
195
+ // applies to the auto-emit module landed in FORGE-S24-T11. The
196
+ // existing orchestrator friction channel (non-skill subkinds) goes
197
+ // through `forge/tools/friction-emit.cjs` and is not gated here.
198
+ if (!isSkillCurationEnabled(runtime.cwd)) {
199
+ return { emitted: 0, failed: 0, stderrs: [] };
200
+ }
201
+ Value.Parse(FrictionEmitRuntimeSchema, runtime);
202
+ let emitted = 0;
203
+ let failed = 0;
204
+ const stderrs = [];
205
+ for (let i = 0; i < signals.length; i++) {
206
+ const sig = signals[i];
207
+ const idTail = sig.skillId ?? "none";
208
+ const eventId = `${isoCompact(runtime.startTimestamp)}_${runtime.taskId}_friction_${sig.subkind}_${i}_${idTail}`;
209
+ const event = {
210
+ eventId,
211
+ sprintId: runtime.sprintId,
212
+ taskId: runtime.taskId,
213
+ role: runtime.role,
214
+ action: runtime.action,
215
+ startTimestamp: runtime.startTimestamp,
216
+ endTimestamp: runtime.endTimestamp,
217
+ durationMinutes: runtime.durationMinutes,
218
+ model: runtime.model,
219
+ provider: runtime.provider,
220
+ type: "friction",
221
+ workflow: runtime.workflow,
222
+ persona: runtime.persona,
223
+ issue: sig.subkind,
224
+ subkind: sig.subkind,
225
+ evidence: sig.evidence,
226
+ };
227
+ if (sig.skillId !== undefined)
228
+ event.skillId = sig.skillId;
229
+ if (runtime.phase !== undefined)
230
+ event.phase = runtime.phase;
231
+ if (runtime.iteration !== undefined)
232
+ event.iteration = runtime.iteration;
233
+ // FORGE-S25-T17: adopt spawnStoreCliEmit; adds missing 10 s timeout (N-C-A).
234
+ const emitResult = spawnStoreCliEmit(runtime.storeCli, runtime.sprintId, event, runtime.cwd);
235
+ if (emitResult.ok) {
236
+ emitted++;
237
+ }
238
+ else {
239
+ failed++;
240
+ stderrs.push(emitResult.stderr);
241
+ }
242
+ }
243
+ return { emitted, failed, stderrs };
244
+ }
245
+ //# sourceMappingURL=friction-emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friction-emit.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/skill-curation/friction-emit.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,oDAAoD;AACpD,4DAA4D;AAC5D,6DAA6D;AAC7D,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,EAAE;AACF,4EAA4E;AAC5E,+DAA+D;AAC/D,yEAAyE;AACzE,sCAAsC;AACtC,EAAE;AACF,gCAAgC;AAChC,6EAA6E;AAC7E,yEAAyE;AACzE,4DAA4D;AAC5D,EAAE;AACF,kCAAkC;AAClC,8DAA8D;AAC9D,2EAA2E;AAC3E,4DAA4D;AAC5D,2EAA2E;AAC3E,kCAAkC;AAClC,oEAAoE;AACpE,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,wEAAwE;AACxE,oEAAoE;AACpE,oBAAoB;AAEpB,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACrD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE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E,OAAO,CAAC,cAAc;YACtC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACtB,CAAC;QACF,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;YAAE,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC3D,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7D,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEzE,6EAA6E;QAC7E,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7F,IAAI,UAAU,CAAC,EAAE,EAAE,CAAC;YACnB,OAAO,EAAE,CAAC;QACX,CAAC;aAAM,CAAC;YACP,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Parse an env flag value to a tri-state: true / false / null (absent or
3
+ * unrecognised). Unrecognised values fall through to the disk layers — we
4
+ * do NOT throw or coerce to false silently.
5
+ */
6
+ declare function parseEnvFlag(raw: string | undefined): boolean | null;
7
+ /**
8
+ * Resolve the SKILL-CURATION feature flag for the given working directory.
9
+ *
10
+ * Default OFF — the helper returns true only when an explicit `true` value
11
+ * is found in the env override or one of the config layers.
12
+ *
13
+ * `cwd` defaults to `process.cwd()` for production call sites; tests pass
14
+ * a temp dir to isolate filesystem state.
15
+ */
16
+ export declare function isSkillCurationEnabled(cwd?: string): boolean;
17
+ export declare const _internal: {
18
+ parseEnvFlag: typeof parseEnvFlag;
19
+ ENV_FLAG: string;
20
+ };
21
+ export {};
@@ -0,0 +1,71 @@
1
+ // Skill-curation feature flag — FORGE-S24-T12.
2
+ //
3
+ // Single source of truth for resolving `forgeCli.skillCuration.enabled`
4
+ // from the layered config. The four SKILL-CURATION emission modules
5
+ // (T08 skill-retriever, T09 skill-usage-tracker, T10 skill-curator-subagent,
6
+ // T11 friction-emit) call `isSkillCurationEnabled()` at the top of their
7
+ // public emission / dispatch entry points and no-op when it returns false.
8
+ //
9
+ // Resolution order (first match wins):
10
+ // 1. Env override `FORGE_CLI_SKILL_CURATION_ENABLED` — accepts "1"/"true"
11
+ // (case-insensitive) for on, "0"/"false" for off. Provided primarily
12
+ // for unit tests and one-shot operator overrides; takes precedence
13
+ // over disk config so a poisoned config never blocks an operator
14
+ // from turning the flag on or off for a single session.
15
+ // 2. Project config (`<cwd>/.pi/forge-cli/config.json`): `forgeCli.skillCuration.enabled`.
16
+ // 3. Global config (`~/.pi/forge-cli/config.json`): `forgeCli.skillCuration.enabled`.
17
+ // 4. Default: false (Iron Law — gated rollout per FORGE-S24-T12 AC2).
18
+ //
19
+ // Iron Laws (forge-cli-engineer):
20
+ // IL1 — code only under forge-cli/src/extensions/forgecli/
21
+ // IL2 — TypeScript; no runtime cast. The layered loader has already
22
+ // Ajv-validated the JSON against forge-cli-schema.json before
23
+ // we read it.
24
+ // IL7 — no silent continuation past failures: schema errors at the
25
+ // layered-config level are surfaced by orchestrator and TUI callers
26
+ // upstream of this helper (see doc/decisions/layered-config-error-policy.md).
27
+ // This function only reads `.project`/`.global` layers; its resilience
28
+ // to absent layers is intentional — missing means "no opinion".
29
+ import { loadLayeredConfig } from "../config/config-layer.js";
30
+ const ENV_FLAG = "FORGE_CLI_SKILL_CURATION_ENABLED";
31
+ /**
32
+ * Parse an env flag value to a tri-state: true / false / null (absent or
33
+ * unrecognised). Unrecognised values fall through to the disk layers — we
34
+ * do NOT throw or coerce to false silently.
35
+ */
36
+ function parseEnvFlag(raw) {
37
+ if (raw === undefined)
38
+ return null;
39
+ const normalised = raw.trim().toLowerCase();
40
+ if (normalised === "1" || normalised === "true")
41
+ return true;
42
+ if (normalised === "0" || normalised === "false")
43
+ return false;
44
+ return null;
45
+ }
46
+ /**
47
+ * Resolve the SKILL-CURATION feature flag for the given working directory.
48
+ *
49
+ * Default OFF — the helper returns true only when an explicit `true` value
50
+ * is found in the env override or one of the config layers.
51
+ *
52
+ * `cwd` defaults to `process.cwd()` for production call sites; tests pass
53
+ * a temp dir to isolate filesystem state.
54
+ */
55
+ export function isSkillCurationEnabled(cwd = process.cwd()) {
56
+ const envValue = parseEnvFlag(process.env[ENV_FLAG]);
57
+ if (envValue !== null)
58
+ return envValue;
59
+ const layered = loadLayeredConfig(cwd);
60
+ const projectFlag = layered.project?.forgeCli?.skillCuration?.enabled;
61
+ if (typeof projectFlag === "boolean")
62
+ return projectFlag;
63
+ const globalFlag = layered.global?.forgeCli?.skillCuration?.enabled;
64
+ if (typeof globalFlag === "boolean")
65
+ return globalFlag;
66
+ return false;
67
+ }
68
+ // Exposed for unit tests that want to assert env-parsing behaviour
69
+ // without touching the disk layers.
70
+ export const _internal = { parseEnvFlag, ENV_FLAG };
71
+ //# sourceMappingURL=skill-curation-flag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-curation-flag.js","sourceRoot":"","sources":["../../../../src/extensions/forgecli/skill-curation/skill-curation-flag.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,wEAA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AS;QAAE,OAAO,WAAW,CAAC;IAEzD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IACpE,IAAI,OAAO,UAAU,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAEvD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,mEAAmE;AACnE,oCAAoC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { type Static, Type } from "typebox";
2
+ import { type ForgePersona } from "../forge-subagent.js";
3
+ import type { ForgeToolDefs } from "../forge-tools.js";
4
+ /**
5
+ * One retrieved skill (T08 output) supplied to the curator as context.
6
+ * `body` is the actual SKILL.md text the agent was shown during the task —
7
+ * the curator reads it to decide whether the skill needs updating.
8
+ */
9
+ export declare const RetrievedSkillBodySchema: Type.TObject<{
10
+ skillId: Type.TString;
11
+ name: Type.TString;
12
+ body: Type.TString;
13
+ }>;
14
+ export type RetrievedSkillBody = Static<typeof RetrievedSkillBodySchema>;
15
+ export declare const TaskOutcomeSchema: Type.TObject<{
16
+ verdict: Type.TUnion<[Type.TLiteral<"approved">, Type.TLiteral<"revision">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">]>;
17
+ notes: Type.TOptional<Type.TString>;
18
+ }>;
19
+ export type TaskOutcome = Static<typeof TaskOutcomeSchema>;
20
+ export declare const CuratorInputSchema: Type.TObject<{
21
+ sprintId: Type.TString;
22
+ taskId: Type.TString;
23
+ cwd: Type.TString;
24
+ ts: Type.TString;
25
+ trajectorySummary: Type.TString;
26
+ retrievedSkills: Type.TArray<Type.TObject<{
27
+ skillId: Type.TString;
28
+ name: Type.TString;
29
+ body: Type.TString;
30
+ }>>;
31
+ outcome: Type.TObject<{
32
+ verdict: Type.TUnion<[Type.TLiteral<"approved">, Type.TLiteral<"revision">, Type.TLiteral<"failed">, Type.TLiteral<"aborted">]>;
33
+ notes: Type.TOptional<Type.TString>;
34
+ }>;
35
+ }>;
36
+ export type CuratorInput = Static<typeof CuratorInputSchema>;
37
+ /**
38
+ * The enhancement proposal schema accepted by this module — mirrors
39
+ * `forge/forge/schemas/proposal.schema.json` (the queue-drain contract).
40
+ * `op` is restricted to the canonical three-op enum; other fields are
41
+ * passed through verbatim if present.
42
+ *
43
+ * Strict on required keys (so malformed items are dropped), permissive on
44
+ * optional keys (so the curator can supply rationale, sourceFrictionIds,
45
+ * generated_at, etc., without us re-enumerating the entire schema here).
46
+ */
47
+ declare const ProposalSchema: Type.TObject<{
48
+ op: Type.TUnion<[Type.TLiteral<"insert_skill">, Type.TLiteral<"update_skill">, Type.TLiteral<"delete_skill">]>;
49
+ target_path: Type.TString;
50
+ diff_body: Type.TString;
51
+ rationale: Type.TOptional<Type.TString>;
52
+ sourceFrictionIds: Type.TOptional<Type.TArray<Type.TString>>;
53
+ generated_at: Type.TOptional<Type.TString>;
54
+ sprintId: Type.TOptional<Type.TString>;
55
+ proposalId: Type.TOptional<Type.TString>;
56
+ }>;
57
+ export type Proposal = Static<typeof ProposalSchema>;
58
+ export interface CuratorResult {
59
+ exitCode: 0 | 1;
60
+ written: number;
61
+ queueFile?: string;
62
+ errorMessage?: string;
63
+ }
64
+ /**
65
+ * Compose the first user message for the curator subagent. The body embeds
66
+ * the trajectory summary, retrieved-skill bodies, and task outcome, and
67
+ * instructs the curator to return zero or more proposals in a fenced JSON
68
+ * block. The schema is described inline so the curator does not need to
69
+ * read an external file.
70
+ */
71
+ export declare function composeCuratorTask(input: CuratorInput): string;
72
+ /**
73
+ * Pull zero or more proposals from the curator's final assistant text.
74
+ * Strategy: try fenced ```json blocks first (the requested format), then
75
+ * fall back to a bare JSON array scan. Items that fail TypeBox validation
76
+ * are dropped — the failure mode for ill-formed proposals is silent
77
+ * exclusion, not exception, because the curator's output is best-effort.
78
+ */
79
+ export declare function parseProposalsFromOutput(text: string): Proposal[];
80
+ /**
81
+ * Inline curator persona. We do NOT add a file under
82
+ * `forge/forge/meta/personas/` (Iron Law 1 — forge-cli only). The persona
83
+ * system prompt is small and self-contained; it tells the LLM to act as a
84
+ * skill curator and reiterates the output format and the no-write rule.
85
+ *
86
+ * The persona is exported so tests can introspect it; in production the
87
+ * defaultCuratorPersona() factory is consumed by runSkillCurator.
88
+ */
89
+ export declare function defaultCuratorPersona(): ForgePersona;
90
+ /**
91
+ * Run the per-task curator subagent and write its proposals to the
92
+ * enhancement-proposals queue. Always returns a typed result; never throws
93
+ * on subagent failure (IL7).
94
+ *
95
+ * Caller (orchestrator) is responsible for:
96
+ * - assembling `retrievedSkills` from the T08 retriever's output;
97
+ * - assembling `trajectorySummary` from the task transcript;
98
+ * - emitting the canonical phase event AFTER this call returns,
99
+ * using its own captured runtime telemetry (Slice 2 contract).
100
+ */
101
+ export declare function runSkillCurator(input: CuratorInput, forgeToolDefs?: ForgeToolDefs): Promise<CuratorResult>;
102
+ export {};