@entelligentsia/forgecli 1.0.36 → 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 (654) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/CHANGELOG-forge-plugin.md +101 -0
  3. package/dist/CHANGELOG-pi.md +143 -0
  4. package/dist/bin/argv.d.ts +1 -1
  5. package/dist/bin/argv.js +12 -0
  6. package/dist/bin/argv.js.map +1 -1
  7. package/dist/bin/forge.js +18 -16
  8. package/dist/bin/forge.js.map +1 -1
  9. package/dist/bin/reset.d.ts +39 -0
  10. package/dist/bin/reset.js +101 -0
  11. package/dist/bin/reset.js.map +1 -0
  12. package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js +56 -265
  13. package/dist/extensions/forgecli/claude-bootstrap/bootstrap.js.map +1 -1
  14. package/dist/extensions/forgecli/claude-bootstrap/uninstall.js +52 -32
  15. package/dist/extensions/forgecli/claude-bootstrap/uninstall.js.map +1 -1
  16. package/dist/extensions/forgecli/commands/reset.d.ts +16 -0
  17. package/dist/extensions/forgecli/commands/reset.js +83 -0
  18. package/dist/extensions/forgecli/commands/reset.js.map +1 -0
  19. package/dist/extensions/forgecli/forge-commands.d.ts +7 -2
  20. package/dist/extensions/forgecli/forge-commands.js +19 -5
  21. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  22. package/dist/extensions/forgecli/forge-subagent.d.ts +4 -4
  23. package/dist/extensions/forgecli/hooks/forge-permissions.js +20 -6
  24. package/dist/extensions/forgecli/hooks/forge-permissions.js.map +1 -1
  25. package/dist/extensions/forgecli/index.js +6 -3
  26. package/dist/extensions/forgecli/index.js.map +1 -1
  27. package/dist/extensions/forgecli/lib/forge-root.d.ts +6 -0
  28. package/dist/extensions/forgecli/lib/forge-root.js +52 -0
  29. package/dist/extensions/forgecli/lib/forge-root.js.map +1 -1
  30. package/dist/extensions/forgecli/lib/payload-manifest.d.ts +62 -0
  31. package/dist/extensions/forgecli/lib/payload-manifest.js +151 -0
  32. package/dist/extensions/forgecli/lib/payload-manifest.js.map +1 -0
  33. package/dist/extensions/forgecli/orchestrators/advisory-render.d.ts +9 -0
  34. package/dist/extensions/forgecli/orchestrators/advisory-render.js +107 -0
  35. package/dist/extensions/forgecli/orchestrators/advisory-render.js.map +1 -0
  36. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.d.ts +3 -0
  37. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js +22 -0
  38. package/dist/extensions/forgecli/orchestrators/bug/bug-phases.js.map +1 -1
  39. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.d.ts +1 -1
  40. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js +34 -2
  41. package/dist/extensions/forgecli/orchestrators/bug/bug-verdict-loop.js.map +1 -1
  42. package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js +2 -2
  43. package/dist/extensions/forgecli/orchestrators/bug/run-bug-pipeline.js.map +1 -1
  44. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.d.ts +24 -0
  45. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js +58 -0
  46. package/dist/extensions/forgecli/orchestrators/common/recovery-menu.js.map +1 -0
  47. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.d.ts +53 -0
  48. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js +131 -0
  49. package/dist/extensions/forgecli/orchestrators/common/reset-pipeline.js.map +1 -0
  50. package/dist/extensions/forgecli/orchestrators/halt-advisor.js +25 -3
  51. package/dist/extensions/forgecli/orchestrators/halt-advisor.js.map +1 -1
  52. package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js +3 -3
  53. package/dist/extensions/forgecli/orchestrators/task/run-task-pipeline.js.map +1 -1
  54. package/dist/extensions/forgecli/orchestrators/task/task-phases.d.ts +3 -0
  55. package/dist/extensions/forgecli/orchestrators/task/task-phases.js +22 -0
  56. package/dist/extensions/forgecli/orchestrators/task/task-phases.js.map +1 -1
  57. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.d.ts +1 -1
  58. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js +37 -2
  59. package/dist/extensions/forgecli/orchestrators/task/task-verdict-loop.js.map +1 -1
  60. package/dist/extensions/forgecli/store/store-resolver.d.ts +15 -0
  61. package/dist/extensions/forgecli/store/store-resolver.js +118 -18
  62. package/dist/extensions/forgecli/store/store-resolver.js.map +1 -1
  63. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  64. package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
  65. package/dist/forge-payload/.schemas/migrations.json +85 -0
  66. package/dist/forge-payload/.schemas/payload-manifest.schema.json +100 -0
  67. package/dist/forge-payload/commands/check-agent.md +7 -23
  68. package/dist/forge-payload/commands/enhance.md +31 -5
  69. package/dist/forge-payload/commands/init.md +161 -97
  70. package/dist/forge-payload/commands/reset.md +117 -0
  71. package/dist/forge-payload/hooks/forge-permissions.cjs +29 -6
  72. package/dist/forge-payload/init/phases/phase-3-materialize.md +5 -1
  73. package/dist/forge-payload/integrity.json +22 -7
  74. package/dist/forge-payload/payload-manifest.json +314 -0
  75. package/dist/forge-payload/schemas/enum-catalog.json +2 -2
  76. package/dist/forge-payload/schemas/payload-manifest.schema.json +100 -0
  77. package/dist/forge-payload/schemas/structure-manifest.json +4 -2
  78. package/dist/forge-payload/tools/reset-plan.cjs +210 -0
  79. package/dist/forge-payload/tools/store.cjs +4 -1
  80. package/dist/forge-payload/tools/substitute-placeholders.cjs +10 -2
  81. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  82. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +8 -0
  83. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  84. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +1 -1
  85. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  86. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +1 -1
  87. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  88. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +4 -0
  89. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +1 -0
  90. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +3 -0
  91. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +1 -0
  92. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +20 -0
  93. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +1 -0
  94. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +92 -0
  95. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +1 -0
  96. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +18 -0
  97. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +1 -0
  98. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +42 -0
  99. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +1 -0
  100. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +10 -0
  101. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +1 -0
  102. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +31 -0
  103. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +1 -0
  104. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +30 -0
  105. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +1 -0
  106. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +170 -0
  107. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +1 -0
  108. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +26 -0
  109. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +1 -0
  110. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +90 -0
  111. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +1 -0
  112. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -1
  113. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  114. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  115. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  116. package/node_modules/@earendil-works/pi-ai/README.md +12 -4
  117. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  118. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +3 -0
  119. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  120. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +45 -0
  121. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  122. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +45 -0
  123. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  124. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +1804 -815
  125. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  126. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2031 -1384
  127. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  128. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  129. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +71 -27
  130. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  131. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +1 -1
  132. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  133. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +24 -16
  134. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  135. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  136. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
  137. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  138. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  139. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +3 -1
  140. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  141. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  142. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +35 -13
  143. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  144. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
  145. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
  146. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
  147. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  148. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -0
  149. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
  150. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +12 -4
  151. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  152. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  153. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  154. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +13 -1
  155. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  156. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  157. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
  158. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  159. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +1 -1
  160. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  161. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +3 -2
  162. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  163. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  164. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +143 -0
  165. package/node_modules/@earendil-works/pi-coding-agent/README.md +26 -4
  166. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +1 -0
  167. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  168. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +11 -0
  169. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  170. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts +10 -0
  171. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.d.ts.map +1 -0
  172. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js +48 -0
  173. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/project-trust.js.map +1 -0
  174. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts +17 -0
  175. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.d.ts.map +1 -0
  176. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js +128 -0
  177. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/startup-ui.js.map +1 -0
  178. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  179. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +9 -1
  180. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  181. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts +3 -1
  182. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -1
  183. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +4 -1
  184. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js.map +1 -1
  185. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts +2 -1
  186. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts.map +1 -1
  187. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +2 -2
  188. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js.map +1 -1
  189. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +4 -1
  190. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  191. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +16 -3
  192. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  193. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.d.ts.map +1 -1
  194. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +4 -3
  195. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js.map +1 -1
  196. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts +3 -1
  197. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  198. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +9 -3
  199. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js.map +1 -1
  200. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts +1 -1
  201. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.d.ts.map +1 -1
  202. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +1 -1
  203. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js.map +1 -1
  204. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts +2 -0
  205. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.d.ts.map +1 -0
  206. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js +4 -0
  207. package/node_modules/@earendil-works/pi-coding-agent/dist/core/experimental.js.map +1 -0
  208. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +19 -6
  209. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  210. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts.map +1 -1
  211. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.js.map +1 -1
  212. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts +1 -1
  213. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
  214. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +4 -4
  215. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
  216. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +10 -3
  217. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  218. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +47 -1
  219. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  220. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +28 -2
  221. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  222. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  223. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts +2 -0
  224. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.d.ts.map +1 -1
  225. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js +29 -1
  226. package/node_modules/@earendil-works/pi-coding-agent/dist/core/footer-data-provider.js.map +1 -1
  227. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts +1 -0
  228. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.d.ts.map +1 -1
  229. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js +1 -0
  230. package/node_modules/@earendil-works/pi-coding-agent/dist/core/index.js.map +1 -1
  231. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  232. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +1 -0
  233. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  234. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts +1 -0
  235. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  236. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +44 -5
  237. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +3 -0
  239. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  240. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +47 -13
  241. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  242. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts +15 -0
  243. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.d.ts.map +1 -0
  244. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +58 -0
  245. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js.map +1 -0
  246. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts +2 -1
  247. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.d.ts.map +1 -1
  248. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +24 -26
  249. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js.map +1 -1
  250. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts +4 -0
  251. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.d.ts.map +1 -0
  252. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +72 -0
  253. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js.map +1 -0
  254. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.d.ts.map +1 -1
  255. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js +3 -0
  256. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-display-names.js.map +1 -1
  257. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts +13 -2
  258. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.d.ts.map +1 -1
  259. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +112 -37
  260. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js.map +1 -1
  261. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  262. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +7 -33
  263. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  264. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  265. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +103 -70
  266. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  267. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +20 -2
  268. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  269. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +97 -30
  270. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  271. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  272. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js +1 -0
  273. package/node_modules/@earendil-works/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  274. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  275. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +1 -1
  276. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  277. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  278. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +1 -1
  279. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  280. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  281. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +1 -1
  282. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  283. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  284. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +1 -1
  285. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  286. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  287. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +1 -1
  288. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  289. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  290. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +1 -1
  291. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  292. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts +36 -0
  293. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.d.ts.map +1 -0
  294. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js +202 -0
  295. package/node_modules/@earendil-works/pi-coding-agent/dist/core/trust-manager.js.map +1 -0
  296. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +5 -4
  297. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  298. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -1
  299. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  300. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  301. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +72 -32
  302. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  303. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  304. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js +39 -34
  305. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
  306. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts +1 -1
  307. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.d.ts.map +1 -1
  308. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/index.js.map +1 -1
  309. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  310. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +2 -2
  311. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -1
  312. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
  313. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
  314. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js +103 -0
  315. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/first-time-setup.js.map +1 -0
  316. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -1
  317. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +7 -0
  318. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js.map +1 -1
  319. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts +2 -0
  320. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -1
  321. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js +2 -0
  322. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/index.js.map +1 -1
  323. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +1 -1
  324. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  325. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +10 -13
  326. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  327. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  328. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  329. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +20 -0
  330. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  331. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  332. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +22 -0
  333. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  334. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts +23 -0
  335. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  336. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js +91 -0
  337. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/trust-selector.js.map +1 -0
  338. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +7 -0
  339. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  340. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +101 -5
  341. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  342. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.d.ts.map +1 -1
  343. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +1 -0
  344. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js.map +1 -1
  345. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  346. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +1 -0
  347. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  348. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts +6 -2
  349. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.d.ts.map +1 -1
  350. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +111 -10
  351. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js.map +1 -1
  352. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts +1 -0
  353. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts.map +1 -1
  354. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +78 -0
  355. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js.map +1 -1
  356. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.d.ts.map +1 -1
  357. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js +54 -22
  358. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/git.js.map +1 -1
  359. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts +9 -0
  360. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.d.ts.map +1 -0
  361. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js +22 -0
  362. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/open-browser.js.map +1 -0
  363. package/node_modules/@earendil-works/pi-coding-agent/docs/containerization.md +111 -0
  364. package/node_modules/@earendil-works/pi-coding-agent/docs/docs.json +8 -0
  365. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +67 -13
  366. package/node_modules/@earendil-works/pi-coding-agent/docs/index.md +2 -0
  367. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +4 -3
  368. package/node_modules/@earendil-works/pi-coding-agent/docs/packages.md +1 -1
  369. package/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +9 -2
  370. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +5 -0
  371. package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +1 -1
  372. package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +5 -0
  373. package/node_modules/@earendil-works/pi-coding-agent/docs/security.md +59 -0
  374. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +15 -0
  375. package/node_modules/@earendil-works/pi-coding-agent/docs/skills.md +1 -1
  376. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +36 -2
  377. package/node_modules/@earendil-works/pi-coding-agent/docs/themes.md +1 -1
  378. package/node_modules/@earendil-works/pi-coding-agent/docs/tmux.md +4 -2
  379. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +10 -1
  380. package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +19 -2
  381. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +2 -0
  382. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-header.ts +1 -1
  383. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  384. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  385. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/doom-overlay/index.ts +1 -1
  386. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/index.ts +531 -0
  387. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +185 -0
  388. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +19 -0
  389. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/handoff.ts +1 -1
  390. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/interactive-shell.ts +1 -1
  391. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/overlay-qa-tests.ts +152 -81
  392. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/project-trust.ts +64 -0
  393. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/qna.ts +1 -1
  394. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/question.ts +1 -1
  395. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/questionnaire.ts +1 -1
  396. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  397. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/snake.ts +1 -1
  398. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/space-invaders.ts +1 -1
  399. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/summarize.ts +1 -1
  400. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tic-tac-toe.ts +1 -1
  401. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/todo.ts +1 -1
  402. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/tools.ts +5 -0
  403. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  404. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -419
  405. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -8
  406. package/node_modules/@earendil-works/pi-tui/README.md +13 -1
  407. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +2 -0
  408. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  409. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  410. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
  411. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  412. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +102 -43
  413. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  414. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -1
  415. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  416. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +11 -1
  417. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  418. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +1 -1
  419. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
  420. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +2 -2
  421. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
  422. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
  423. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  424. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  425. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +4 -7
  426. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  427. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -77
  428. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  429. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +20 -4
  430. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  431. package/node_modules/@earendil-works/pi-tui/dist/tui.js +244 -42
  432. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  433. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +1 -0
  434. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  435. package/node_modules/@earendil-works/pi-tui/dist/utils.js +46 -15
  436. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  437. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  438. package/node_modules/@mariozechner/clipboard/package.json +2 -1
  439. package/node_modules/@mariozechner/clipboard-linux-x64-musl/README.md +3 -0
  440. package/node_modules/@mariozechner/clipboard-linux-x64-musl/package.json +25 -0
  441. package/package.json +7 -6
  442. package/dist/extensions/forgecli/add-pipeline.d.ts +0 -19
  443. package/dist/extensions/forgecli/add-pipeline.js +0 -143
  444. package/dist/extensions/forgecli/add-pipeline.js.map +0 -1
  445. package/dist/extensions/forgecli/add-task.d.ts +0 -20
  446. package/dist/extensions/forgecli/add-task.js +0 -154
  447. package/dist/extensions/forgecli/add-task.js.map +0 -1
  448. package/dist/extensions/forgecli/approve.d.ts +0 -22
  449. package/dist/extensions/forgecli/approve.js +0 -152
  450. package/dist/extensions/forgecli/approve.js.map +0 -1
  451. package/dist/extensions/forgecli/banner.d.ts +0 -10
  452. package/dist/extensions/forgecli/banner.js +0 -36
  453. package/dist/extensions/forgecli/banner.js.map +0 -1
  454. package/dist/extensions/forgecli/calibrate.d.ts +0 -64
  455. package/dist/extensions/forgecli/calibrate.js +0 -481
  456. package/dist/extensions/forgecli/calibrate.js.map +0 -1
  457. package/dist/extensions/forgecli/collate.d.ts +0 -22
  458. package/dist/extensions/forgecli/collate.js +0 -134
  459. package/dist/extensions/forgecli/collate.js.map +0 -1
  460. package/dist/extensions/forgecli/commit.d.ts +0 -22
  461. package/dist/extensions/forgecli/commit.js +0 -152
  462. package/dist/extensions/forgecli/commit.js.map +0 -1
  463. package/dist/extensions/forgecli/config-command.d.ts +0 -8
  464. package/dist/extensions/forgecli/config-command.js +0 -67
  465. package/dist/extensions/forgecli/config-command.js.map +0 -1
  466. package/dist/extensions/forgecli/config-layer.d.ts +0 -53
  467. package/dist/extensions/forgecli/config-layer.js +0 -72
  468. package/dist/extensions/forgecli/config-layer.js.map +0 -1
  469. package/dist/extensions/forgecli/config-writer.d.ts +0 -16
  470. package/dist/extensions/forgecli/config-writer.js +0 -69
  471. package/dist/extensions/forgecli/config-writer.js.map +0 -1
  472. package/dist/extensions/forgecli/enhance.d.ts +0 -27
  473. package/dist/extensions/forgecli/enhance.js +0 -199
  474. package/dist/extensions/forgecli/enhance.js.map +0 -1
  475. package/dist/extensions/forgecli/fix-bug.d.ts +0 -85
  476. package/dist/extensions/forgecli/fix-bug.js +0 -1580
  477. package/dist/extensions/forgecli/fix-bug.js.map +0 -1
  478. package/dist/extensions/forgecli/forge-header.d.ts +0 -12
  479. package/dist/extensions/forgecli/forge-header.js +0 -114
  480. package/dist/extensions/forgecli/forge-header.js.map +0 -1
  481. package/dist/extensions/forgecli/forge-init.d.ts +0 -26
  482. package/dist/extensions/forgecli/forge-init.js +0 -514
  483. package/dist/extensions/forgecli/forge-init.js.map +0 -1
  484. package/dist/extensions/forgecli/forge-root.d.ts +0 -10
  485. package/dist/extensions/forgecli/forge-root.js +0 -62
  486. package/dist/extensions/forgecli/forge-root.js.map +0 -1
  487. package/dist/extensions/forgecli/forge-update-command.d.ts +0 -100
  488. package/dist/extensions/forgecli/forge-update-command.js +0 -435
  489. package/dist/extensions/forgecli/forge-update-command.js.map +0 -1
  490. package/dist/extensions/forgecli/friction-emit.d.ts +0 -99
  491. package/dist/extensions/forgecli/friction-emit.js +0 -245
  492. package/dist/extensions/forgecli/friction-emit.js.map +0 -1
  493. package/dist/extensions/forgecli/implement.d.ts +0 -22
  494. package/dist/extensions/forgecli/implement.js +0 -170
  495. package/dist/extensions/forgecli/implement.js.map +0 -1
  496. package/dist/extensions/forgecli/init-context.d.ts +0 -99
  497. package/dist/extensions/forgecli/init-context.js +0 -178
  498. package/dist/extensions/forgecli/init-context.js.map +0 -1
  499. package/dist/extensions/forgecli/init-progress.d.ts +0 -39
  500. package/dist/extensions/forgecli/init-progress.js +0 -117
  501. package/dist/extensions/forgecli/init-progress.js.map +0 -1
  502. package/dist/extensions/forgecli/input-router.d.ts +0 -33
  503. package/dist/extensions/forgecli/input-router.js +0 -136
  504. package/dist/extensions/forgecli/input-router.js.map +0 -1
  505. package/dist/extensions/forgecli/lib/halt-advisor.d.ts +0 -59
  506. package/dist/extensions/forgecli/lib/halt-advisor.js +0 -113
  507. package/dist/extensions/forgecli/lib/halt-advisor.js.map +0 -1
  508. package/dist/extensions/forgecli/lib/orchestrator-preflight.d.ts +0 -46
  509. package/dist/extensions/forgecli/lib/orchestrator-preflight.js +0 -64
  510. package/dist/extensions/forgecli/lib/orchestrator-preflight.js.map +0 -1
  511. package/dist/extensions/forgecli/materialize.d.ts +0 -16
  512. package/dist/extensions/forgecli/materialize.js +0 -195
  513. package/dist/extensions/forgecli/materialize.js.map +0 -1
  514. package/dist/extensions/forgecli/migrate.d.ts +0 -22
  515. package/dist/extensions/forgecli/migrate.js +0 -260
  516. package/dist/extensions/forgecli/migrate.js.map +0 -1
  517. package/dist/extensions/forgecli/migration-engine.d.ts +0 -117
  518. package/dist/extensions/forgecli/migration-engine.js +0 -563
  519. package/dist/extensions/forgecli/migration-engine.js.map +0 -1
  520. package/dist/extensions/forgecli/model-registry.d.ts +0 -61
  521. package/dist/extensions/forgecli/model-registry.js +0 -127
  522. package/dist/extensions/forgecli/model-registry.js.map +0 -1
  523. package/dist/extensions/forgecli/model-resolver.d.ts +0 -32
  524. package/dist/extensions/forgecli/model-resolver.js +0 -65
  525. package/dist/extensions/forgecli/model-resolver.js.map +0 -1
  526. package/dist/extensions/forgecli/model-validator.d.ts +0 -29
  527. package/dist/extensions/forgecli/model-validator.js +0 -107
  528. package/dist/extensions/forgecli/model-validator.js.map +0 -1
  529. package/dist/extensions/forgecli/orchestrator-status-bar.d.ts +0 -26
  530. package/dist/extensions/forgecli/orchestrator-status-bar.js +0 -213
  531. package/dist/extensions/forgecli/orchestrator-status-bar.js.map +0 -1
  532. package/dist/extensions/forgecli/plan.d.ts +0 -22
  533. package/dist/extensions/forgecli/plan.js +0 -167
  534. package/dist/extensions/forgecli/plan.js.map +0 -1
  535. package/dist/extensions/forgecli/quiz-agent.d.ts +0 -17
  536. package/dist/extensions/forgecli/quiz-agent.js +0 -98
  537. package/dist/extensions/forgecli/quiz-agent.js.map +0 -1
  538. package/dist/extensions/forgecli/read-command.d.ts +0 -2
  539. package/dist/extensions/forgecli/read-command.js +0 -100
  540. package/dist/extensions/forgecli/read-command.js.map +0 -1
  541. package/dist/extensions/forgecli/regenerate.d.ts +0 -40
  542. package/dist/extensions/forgecli/regenerate.js +0 -438
  543. package/dist/extensions/forgecli/regenerate.js.map +0 -1
  544. package/dist/extensions/forgecli/remove-command.d.ts +0 -17
  545. package/dist/extensions/forgecli/remove-command.js +0 -124
  546. package/dist/extensions/forgecli/remove-command.js.map +0 -1
  547. package/dist/extensions/forgecli/report-bug.d.ts +0 -25
  548. package/dist/extensions/forgecli/report-bug.js +0 -159
  549. package/dist/extensions/forgecli/report-bug.js.map +0 -1
  550. package/dist/extensions/forgecli/retrospective.d.ts +0 -20
  551. package/dist/extensions/forgecli/retrospective.js +0 -126
  552. package/dist/extensions/forgecli/retrospective.js.map +0 -1
  553. package/dist/extensions/forgecli/review-code.d.ts +0 -35
  554. package/dist/extensions/forgecli/review-code.js +0 -196
  555. package/dist/extensions/forgecli/review-code.js.map +0 -1
  556. package/dist/extensions/forgecli/review-plan.d.ts +0 -35
  557. package/dist/extensions/forgecli/review-plan.js +0 -200
  558. package/dist/extensions/forgecli/review-plan.js.map +0 -1
  559. package/dist/extensions/forgecli/run-sprint.d.ts +0 -27
  560. package/dist/extensions/forgecli/run-sprint.js +0 -716
  561. package/dist/extensions/forgecli/run-sprint.js.map +0 -1
  562. package/dist/extensions/forgecli/run-task.d.ts +0 -204
  563. package/dist/extensions/forgecli/run-task.js +0 -1403
  564. package/dist/extensions/forgecli/run-task.js.map +0 -1
  565. package/dist/extensions/forgecli/skill-curation-flag.d.ts +0 -21
  566. package/dist/extensions/forgecli/skill-curation-flag.js +0 -71
  567. package/dist/extensions/forgecli/skill-curation-flag.js.map +0 -1
  568. package/dist/extensions/forgecli/skill-curator-subagent.d.ts +0 -102
  569. package/dist/extensions/forgecli/skill-curator-subagent.js +0 -339
  570. package/dist/extensions/forgecli/skill-curator-subagent.js.map +0 -1
  571. package/dist/extensions/forgecli/skill-retriever.d.ts +0 -84
  572. package/dist/extensions/forgecli/skill-retriever.js +0 -246
  573. package/dist/extensions/forgecli/skill-retriever.js.map +0 -1
  574. package/dist/extensions/forgecli/skill-usage-tracker.d.ts +0 -91
  575. package/dist/extensions/forgecli/skill-usage-tracker.js +0 -224
  576. package/dist/extensions/forgecli/skill-usage-tracker.js.map +0 -1
  577. package/dist/extensions/forgecli/sprint-intake.d.ts +0 -10
  578. package/dist/extensions/forgecli/sprint-intake.js +0 -91
  579. package/dist/extensions/forgecli/sprint-intake.js.map +0 -1
  580. package/dist/extensions/forgecli/sprint-plan.d.ts +0 -14
  581. package/dist/extensions/forgecli/sprint-plan.js +0 -122
  582. package/dist/extensions/forgecli/sprint-plan.js.map +0 -1
  583. package/dist/extensions/forgecli/status-command.d.ts +0 -19
  584. package/dist/extensions/forgecli/status-command.js +0 -140
  585. package/dist/extensions/forgecli/status-command.js.map +0 -1
  586. package/dist/extensions/forgecli/store-error-remediation.d.ts +0 -65
  587. package/dist/extensions/forgecli/store-error-remediation.js +0 -307
  588. package/dist/extensions/forgecli/store-error-remediation.js.map +0 -1
  589. package/dist/extensions/forgecli/store-query.d.ts +0 -22
  590. package/dist/extensions/forgecli/store-query.js +0 -107
  591. package/dist/extensions/forgecli/store-query.js.map +0 -1
  592. package/dist/extensions/forgecli/store-repair.d.ts +0 -17
  593. package/dist/extensions/forgecli/store-repair.js +0 -123
  594. package/dist/extensions/forgecli/store-repair.js.map +0 -1
  595. package/dist/extensions/forgecli/store-resolver.d.ts +0 -56
  596. package/dist/extensions/forgecli/store-resolver.js +0 -263
  597. package/dist/extensions/forgecli/store-resolver.js.map +0 -1
  598. package/dist/extensions/forgecli/store-validator.d.ts +0 -16
  599. package/dist/extensions/forgecli/store-validator.js +0 -32
  600. package/dist/extensions/forgecli/store-validator.js.map +0 -1
  601. package/dist/extensions/forgecli/test-orchestrate.d.ts +0 -2
  602. package/dist/extensions/forgecli/test-orchestrate.js +0 -182
  603. package/dist/extensions/forgecli/test-orchestrate.js.map +0 -1
  604. package/dist/extensions/forgecli/thread-switcher.d.ts +0 -5
  605. package/dist/extensions/forgecli/thread-switcher.js +0 -189
  606. package/dist/extensions/forgecli/thread-switcher.js.map +0 -1
  607. package/dist/extensions/forgecli/transition-guard.d.ts +0 -20
  608. package/dist/extensions/forgecli/transition-guard.js +0 -89
  609. package/dist/extensions/forgecli/transition-guard.js.map +0 -1
  610. package/dist/extensions/forgecli/update-check.d.ts +0 -37
  611. package/dist/extensions/forgecli/update-check.js +0 -185
  612. package/dist/extensions/forgecli/update-check.js.map +0 -1
  613. package/dist/extensions/forgecli/update-tools.d.ts +0 -23
  614. package/dist/extensions/forgecli/update-tools.js +0 -135
  615. package/dist/extensions/forgecli/update-tools.js.map +0 -1
  616. package/dist/extensions/forgecli/validate.d.ts +0 -22
  617. package/dist/extensions/forgecli/validate.js +0 -152
  618. package/dist/extensions/forgecli/validate.js.map +0 -1
  619. package/dist/extensions/forgecli/viewport-events.d.ts +0 -78
  620. package/dist/extensions/forgecli/viewport-events.js +0 -243
  621. package/dist/extensions/forgecli/viewport-events.js.map +0 -1
  622. package/dist/extensions/forgecli/viewport-renderer.d.ts +0 -83
  623. package/dist/extensions/forgecli/viewport-renderer.js +0 -233
  624. package/dist/extensions/forgecli/viewport-renderer.js.map +0 -1
  625. package/dist/extensions/forgecli/viewport-theme.d.ts +0 -11
  626. package/dist/extensions/forgecli/viewport-theme.js +0 -128
  627. package/dist/extensions/forgecli/viewport-theme.js.map +0 -1
  628. package/dist/extensions/forgecli/whats-new-widget.d.ts +0 -26
  629. package/dist/extensions/forgecli/whats-new-widget.js +0 -376
  630. package/dist/extensions/forgecli/whats-new-widget.js.map +0 -1
  631. package/dist/extensions/forgecli/whats-new.d.ts +0 -120
  632. package/dist/extensions/forgecli/whats-new.js +0 -470
  633. package/dist/extensions/forgecli/whats-new.js.map +0 -1
  634. package/dist/forge-payload/.base-pack/commands/check-agent.md +0 -22
  635. package/dist/forge-payload/.base-pack/commands/enhance.md +0 -37
  636. package/dist/forge-payload/.base-pack/commands/init.md +0 -278
  637. package/dist/forge-payload/init/generation/generate-knowledge-base.md +0 -56
  638. package/dist/forge-payload/init/generation/generate-personas.md +0 -54
  639. package/dist/forge-payload/init/generation/generate-skills.md +0 -36
  640. package/dist/forge-payload/init/generation/generate-templates.md +0 -39
  641. /package/dist/forge-payload/{.base-pack/commands → commands}/approve.md +0 -0
  642. /package/dist/forge-payload/{.base-pack/commands → commands}/collate.md +0 -0
  643. /package/dist/forge-payload/{.base-pack/commands → commands}/commit.md +0 -0
  644. /package/dist/forge-payload/{.base-pack/commands → commands}/fix-bug.md +0 -0
  645. /package/dist/forge-payload/{.base-pack/commands → commands}/implement.md +0 -0
  646. /package/dist/forge-payload/{.base-pack/commands → commands}/new-sprint.md +0 -0
  647. /package/dist/forge-payload/{.base-pack/commands → commands}/plan-sprint.md +0 -0
  648. /package/dist/forge-payload/{.base-pack/commands → commands}/plan.md +0 -0
  649. /package/dist/forge-payload/{.base-pack/commands → commands}/retro.md +0 -0
  650. /package/dist/forge-payload/{.base-pack/commands → commands}/review-code.md +0 -0
  651. /package/dist/forge-payload/{.base-pack/commands → commands}/review-plan.md +0 -0
  652. /package/dist/forge-payload/{.base-pack/commands → commands}/run-sprint.md +0 -0
  653. /package/dist/forge-payload/{.base-pack/commands → commands}/run-task.md +0 -0
  654. /package/dist/forge-payload/{.base-pack/commands → commands}/validate.md +0 -0
@@ -1,563 +0,0 @@
1
- // migration-engine.ts — Deterministic migration apply engine (FORGE-S23-T01)
2
- //
3
- // Reads migrations.json from the bundled payload, walks version entries between
4
- // the given bounds using semver comparison [from, to) semantics, applies
5
- // regeneration actions against the project's .forge/ directory, and maintains
6
- // an idempotency ledger at .forge/applied-migrations.json.
7
- //
8
- // Design: pure engine — no pi runtime context, no UI calls, no event emission.
9
- // The calling command handler (forge-update-command.ts) is responsible for
10
- // event emission after this engine returns a MigrationResult.
11
- //
12
- // Layer: Layer 1 of the two-layer split (pure engine / command handler).
13
- import * as fs from "node:fs";
14
- import { createRequire } from "node:module";
15
- import * as path from "node:path";
16
- import { isFile } from "./lib/shared-fs-utils.js";
17
- // ── semverCompare ─────────────────────────────────────────────────────────────
18
- /**
19
- * Compare two version strings using semver integer-component comparison.
20
- * Returns: negative if a < b, 0 if a === b, positive if a > b.
21
- *
22
- * Unlike string comparison, this correctly handles 0.9.x vs 0.10.x boundaries.
23
- * Strips leading "v" prefix (matches parseTriple() behavior in forge-update-command.ts:118).
24
- * Falls back to localeCompare for invalid/non-semver inputs.
25
- */
26
- export function semverCompare(a, b) {
27
- const parse = (v) => {
28
- const cleaned = v.startsWith("v") ? v.slice(1) : v; // Strip "v" prefix (parity with parseTriple())
29
- const parts = cleaned.split(".");
30
- if (parts.length !== 3)
31
- return null;
32
- const [major, minor, patch] = parts.map(Number);
33
- if ([major, minor, patch].some((n) => Number.isNaN(n)))
34
- return null;
35
- return [major, minor, patch];
36
- };
37
- const pa = parse(a);
38
- const pb = parse(b);
39
- if (!pa || !pb)
40
- return a.localeCompare(b); // Fallback for invalid format
41
- for (let i = 0; i < 3; i++) {
42
- if (pa[i] !== pb[i])
43
- return pa[i] - pb[i];
44
- }
45
- return 0;
46
- }
47
- // ── filterMigrationEntries ────────────────────────────────────────────────────
48
- /**
49
- * Filter migrations.json entries using [fromVersion, toVersion) semantics on keys.
50
- *
51
- * - fromVersion entry IS included: it represents the transition AWAY from that version.
52
- * - toVersion entry is EXCLUDED: it would be a further transition past the target.
53
- * - Results are sorted ascending by semver (oldest first).
54
- *
55
- * No first-run special case — this same filter applies for both first-run
56
- * (empty ledger) and subsequent runs. The idempotency ledger handles re-run protection.
57
- */
58
- export function filterMigrationEntries(migrations, fromVersion, toVersion) {
59
- return Object.entries(migrations)
60
- .filter(([key]) => {
61
- return semverCompare(key, fromVersion) >= 0 && semverCompare(key, toVersion) < 0;
62
- })
63
- .map(([key, entry]) => ({ key, entry }))
64
- .sort((a, b) => semverCompare(a.key, b.key));
65
- }
66
- // ── resolveCategory ────────────────────────────────────────────────────────────
67
- /**
68
- * Resolve a migration category string to one or more WriteDescriptors.
69
- * Pure function — does not write files; appends to the provided writes array.
70
- *
71
- * ENOENT trap rule: if source doesn't exist, skip silently (never throw on ENOENT).
72
- * Non-ENOENT IO errors propagate.
73
- *
74
- * Path-traversal defense: all output paths are validated against
75
- * path.join(projectRoot, '.forge') before being added to writes.
76
- */
77
- export function resolveCategory(category, bundleRoot, projectRoot, writes) {
78
- const forgeDir = path.join(projectRoot, ".forge");
79
- const basePack = path.join(bundleRoot, ".base-pack");
80
- const schemas = path.join(bundleRoot, ".schemas");
81
- function safeDest(rel) {
82
- const resolved = path.join(forgeDir, rel);
83
- const safePrefix = forgeDir + path.sep;
84
- if (!resolved.startsWith(safePrefix)) {
85
- throw new Error(`Path traversal attempt: resolved output path '${resolved}' is outside .forge/`);
86
- }
87
- return resolved;
88
- }
89
- function tryAdd(src, dest) {
90
- // isFile() returns false on ENOENT and any other stat error — intentional,
91
- // since the migration engine must not crash on missing optional sources.
92
- if (isFile(src)) {
93
- writes.push({ src, dest });
94
- }
95
- }
96
- // ── Schema categories ───────────────────────────────────────────────────
97
- if (category === "schemas") {
98
- // Bare schemas — copy all *.schema.json from bundle/.schemas/ recursively,
99
- // preserving subdirectory structure under the destination .forge/schemas/.
100
- // (FORGE-S25-T12: enables _defs/ subtree shipping for $ref'd shared schemas.)
101
- function walk(dir) {
102
- let entries;
103
- try {
104
- entries = fs.readdirSync(dir, { withFileTypes: true });
105
- }
106
- catch (err) {
107
- if (err.code === "ENOENT")
108
- return;
109
- throw err;
110
- }
111
- for (const entry of entries) {
112
- const fullSrc = path.join(dir, entry.name);
113
- if (entry.isDirectory()) {
114
- walk(fullSrc);
115
- }
116
- else if (entry.isFile() && entry.name.endsWith(".schema.json")) {
117
- const rel = path.relative(schemas, fullSrc);
118
- writes.push({
119
- src: fullSrc,
120
- dest: safeDest(path.join("schemas", rel)),
121
- });
122
- }
123
- }
124
- }
125
- walk(schemas);
126
- return;
127
- }
128
- if (category.startsWith("schemas:")) {
129
- const name = category.slice("schemas:".length);
130
- // Path-traversal defense on the name itself
131
- if (name.includes("..") || name.includes("/") || name.includes("\\")) {
132
- // Validate safe destination will catch it — but throw explicitly for clarity
133
- const dest = path.join(forgeDir, "schemas", `${name}.schema.json`);
134
- const safePrefix = forgeDir + path.sep;
135
- if (!dest.startsWith(safePrefix)) {
136
- throw new Error(`Path traversal attempt: schemas category '${category}'`);
137
- }
138
- }
139
- // Special case: structure-manifest (non-.schema.json file)
140
- if (name === "structure-manifest") {
141
- // Probe .schema.json first, fall back to .json
142
- const srcSchema = path.join(schemas, `${name}.schema.json`);
143
- const srcJson = path.join(schemas, `${name}.json`);
144
- const dest = safeDest(path.join("schemas", `${name}.json`));
145
- if (fs.existsSync(srcSchema)) {
146
- writes.push({ src: srcSchema, dest });
147
- }
148
- else {
149
- tryAdd(srcJson, dest);
150
- }
151
- return;
152
- }
153
- // Standard schema: <name>.schema.json
154
- tryAdd(path.join(schemas, `${name}.schema.json`), safeDest(path.join("schemas", `${name}.schema.json`)));
155
- return;
156
- }
157
- // ── hooks:* short-circuit ───────────────────────────────────────────────
158
- if (category === "hooks" || category.startsWith("hooks:")) {
159
- // No source directory in bundle; short-circuit before any fs call
160
- return;
161
- }
162
- // ── tools:* short-circuit (excluding tools:lib:*) ──────────────────────
163
- if (category === "tools" || (category.startsWith("tools:") && !category.startsWith("tools:lib"))) {
164
- // FORGE-S29-T05: copy all .cjs and .js files from bundle tools/ to .forge/tools/.
165
- // The tools/ directory is at bundleRoot/tools/ (same level as .schemas/, .base-pack/).
166
- const toolsSrc = path.join(bundleRoot, "tools");
167
- let entries;
168
- try {
169
- entries = fs.readdirSync(toolsSrc, { withFileTypes: true });
170
- }
171
- catch (err) {
172
- if (err.code === "ENOENT")
173
- return;
174
- throw err;
175
- }
176
- for (const entry of entries) {
177
- if (!entry.isFile())
178
- continue;
179
- if (!entry.name.endsWith(".cjs") && !entry.name.endsWith(".js"))
180
- continue;
181
- writes.push({
182
- src: path.join(toolsSrc, entry.name),
183
- dest: safeDest(path.join("tools", entry.name)),
184
- });
185
- }
186
- return;
187
- }
188
- // ── tools:lib/<name> and tools:lib:<name> ──────────────────────────────
189
- if (category.startsWith("tools:lib")) {
190
- const rest = category.slice("tools:lib".length);
191
- // Normalize separator: tools:lib/forge-root or tools:lib:validate → name
192
- const name = rest.startsWith("/") ? rest.slice(1) : rest.startsWith(":") ? rest.slice(1) : rest;
193
- const libSrc = path.join(bundleRoot, "tools", "lib");
194
- // FORGE-S29-T05: copy lib files to .forge/tools/lib/ (previously wrote a
195
- // marker stub to .forge/schemas/; now writes the real file to .forge/tools/lib/).
196
- // Probe .cjs first, then .js (matching LIB_ALLOWLIST entry patterns).
197
- // ENOENT on both: graceful skip (no throw).
198
- const srcCjs = path.join(libSrc, `${name}.cjs`);
199
- const srcJs = path.join(libSrc, `${name}.js`);
200
- const resolvedSrc = fs.existsSync(srcCjs) ? srcCjs : fs.existsSync(srcJs) ? srcJs : null;
201
- if (resolvedSrc) {
202
- writes.push({
203
- src: resolvedSrc,
204
- dest: safeDest(path.join("tools", "lib", `${name}${resolvedSrc.endsWith(".cjs") ? ".cjs" : ".js"}`)),
205
- });
206
- }
207
- // ENOENT on both: graceful skip
208
- return;
209
- }
210
- // ── fragments:* and events:* (convention aliases) ──────────────────────
211
- if (category.startsWith("fragments:") || category.startsWith("events:")) {
212
- const prefix = category.startsWith("fragments:") ? "fragments:" : "events:";
213
- const name = category.slice(prefix.length);
214
- tryAdd(path.join(basePack, "workflows", "_fragments", `${name}.md`), safeDest(path.join("workflows", "_fragments", `${name}.md`)));
215
- return;
216
- }
217
- // ── workflows:_fragments (bare-directory token) ─────────────────────────
218
- if (category === "workflows:_fragments") {
219
- const fragDir = path.join(basePack, "workflows", "_fragments");
220
- try {
221
- const entries = fs.readdirSync(fragDir);
222
- for (const entry of entries) {
223
- // Nesting guard: do NOT recurse into a subdirectory named _fragments/
224
- if (entry === "_fragments")
225
- continue;
226
- const fullSrc = path.join(fragDir, entry);
227
- // isFile() returns false for dirs and any stat error — skip silently.
228
- if (isFile(fullSrc)) {
229
- writes.push({
230
- src: fullSrc,
231
- dest: safeDest(path.join("workflows", "_fragments", entry)),
232
- });
233
- }
234
- }
235
- }
236
- catch (err) {
237
- if (err.code !== "ENOENT")
238
- throw err;
239
- }
240
- return;
241
- }
242
- // ── workflows:_fragments_<name> (underscore compound) ──────────────────
243
- if (category.startsWith("workflows:_fragments_")) {
244
- const name = category.slice("workflows:_fragments_".length);
245
- tryAdd(path.join(basePack, "workflows", "_fragments", `${name}.md`), safeDest(path.join("workflows", "_fragments", `${name}.md`)));
246
- return;
247
- }
248
- // ── Base-pack categories ────────────────────────────────────────────────
249
- const VALID_BASE_PACK_TYPES = ["personas", "workflows", "skills", "templates", "commands"];
250
- const colonIdx = category.indexOf(":");
251
- const typeStr = colonIdx >= 0 ? category.slice(0, colonIdx) : category;
252
- const subTarget = colonIdx >= 0 ? category.slice(colonIdx + 1) : null;
253
- if (!VALID_BASE_PACK_TYPES.includes(typeStr)) {
254
- // Unknown category — log at debug level and skip
255
- return;
256
- }
257
- const type = typeStr;
258
- if (subTarget === null) {
259
- // Bare category — walk the entire subdirectory
260
- const srcDir = path.join(basePack, type);
261
- try {
262
- const files = fs.readdirSync(srcDir).filter((f) => f.endsWith(".md"));
263
- for (const f of files) {
264
- const dest = type === "skills"
265
- ? safeDest(path.join(type, f)) // skills files already have -skills.md suffix
266
- : type === "commands"
267
- ? safeDest(path.join("commands", "forge", f))
268
- : safeDest(path.join(type, f));
269
- tryAdd(path.join(srcDir, f), dest);
270
- }
271
- }
272
- catch (err) {
273
- if (err.code !== "ENOENT")
274
- throw err;
275
- }
276
- return;
277
- }
278
- // Special case: workflows:base-pack-store-cli-form — explicit no-op
279
- if (type === "workflows" && subTarget === "base-pack-store-cli-form") {
280
- // Sub-target doesn't exist in base-pack; debug-logged no-op
281
- return;
282
- }
283
- // Sub-target category: <type>:<name>
284
- const filename = type === "skills"
285
- ? `${subTarget}-skills.md` // skills:<name> → <name>-skills.md
286
- : `${subTarget}.md`;
287
- const dest = type === "commands" ? safeDest(path.join("commands", "forge", filename)) : safeDest(path.join(type, filename));
288
- tryAdd(path.join(basePack, type, filename), dest);
289
- }
290
- function executeFileOps(fileOps, projectRoot, dryRun) {
291
- const forgeDir = path.join(projectRoot, ".forge");
292
- const safePrefix = forgeDir + path.sep;
293
- const categories = [];
294
- // C-19: accumulate ENOENT failures for copy/substitute-placeholder ops
295
- const failed = [];
296
- for (const op of fileOps) {
297
- const dest = path.resolve(projectRoot, op.path);
298
- if (!dest.startsWith(safePrefix) && !dest.startsWith(forgeDir)) {
299
- throw new Error(`Path traversal attempt in fileOps: '${op.path}'`);
300
- }
301
- const categoryLabel = `fileOps:${op.op}`;
302
- categories.push(categoryLabel);
303
- if (dryRun)
304
- continue;
305
- switch (op.op) {
306
- case "mkdir":
307
- fs.mkdirSync(dest, { recursive: true });
308
- break;
309
- case "copy":
310
- if (op.src) {
311
- fs.mkdirSync(path.dirname(dest), { recursive: true });
312
- try {
313
- fs.copyFileSync(op.src, dest);
314
- }
315
- catch (err) {
316
- if (err.code !== "ENOENT")
317
- throw err;
318
- // C-19: src absent — record failure so caller can surface it
319
- failed.push({ category: categoryLabel, reason: `ENOENT: ${op.src}` });
320
- }
321
- }
322
- break;
323
- case "delete":
324
- try {
325
- fs.rmSync(dest, { force: true });
326
- }
327
- catch (err) {
328
- if (err.code !== "ENOENT")
329
- throw err;
330
- }
331
- break;
332
- case "substitute-placeholder":
333
- // Forward-compat: just copy for now (no ctx available in engine)
334
- if (op.src) {
335
- fs.mkdirSync(path.dirname(dest), { recursive: true });
336
- try {
337
- fs.copyFileSync(op.src, dest);
338
- }
339
- catch (err) {
340
- if (err.code !== "ENOENT")
341
- throw err;
342
- // C-19: src absent — record failure so caller can surface it
343
- failed.push({ category: categoryLabel, reason: `ENOENT: ${op.src}` });
344
- }
345
- }
346
- break;
347
- }
348
- }
349
- return { categories, failed };
350
- }
351
- // ── Ledger helpers ────────────────────────────────────────────────────────────
352
- function readLedger(projectRoot) {
353
- const ledgerPath = path.join(projectRoot, ".forge", "applied-migrations.json");
354
- try {
355
- const raw = fs.readFileSync(ledgerPath, "utf8");
356
- return JSON.parse(raw);
357
- }
358
- catch {
359
- return { schemaVersion: 1, appliedVersions: [] };
360
- }
361
- }
362
- function writeLedger(projectRoot, ledger) {
363
- const ledgerPath = path.join(projectRoot, ".forge", "applied-migrations.json");
364
- fs.writeFileSync(ledgerPath, JSON.stringify(ledger, null, 2), "utf8");
365
- }
366
- // ── runMigrations ─────────────────────────────────────────────────────────────
367
- /**
368
- * Execute all migration entries between [fromVersion, toVersion) from the
369
- * bundled migrations.json against the project's .forge/ directory.
370
- *
371
- * Design constraints:
372
- * - No UI context (no ctx.ui calls).
373
- * - No event emission (caller is responsible).
374
- * - Pure deterministic engine: reads from bundleRoot, writes to projectRoot/.forge/.
375
- * - Idempotent: already-applied versions (from .forge/applied-migrations.json) are skipped.
376
- *
377
- * Forward-compat: entries with non-empty fileOps[] use fileOps; otherwise regenerate.
378
- * NOTE: 0 of 158 current entries use fileOps — the executor is dead code on day 1.
379
- * Once a real fileOps entry lands, an integration test against that entry MUST be added.
380
- */
381
- export async function runMigrations(opts) {
382
- const { bundleRoot, projectRoot, fromVersion, toVersion, dryRun = false } = opts;
383
- const result = {
384
- applied: [],
385
- skippedBreaking: [],
386
- manualSteps: [],
387
- dryRun,
388
- schemasRefreshed: [],
389
- forgeRootUpdated: false,
390
- failedCategories: [], // C-19: populated when ops fail with ENOENT
391
- };
392
- // Read migrations.json from bundle
393
- const migrationsPath = path.join(bundleRoot, ".schemas", "migrations.json");
394
- let migrations;
395
- try {
396
- const raw = fs.readFileSync(migrationsPath, "utf8");
397
- migrations = JSON.parse(raw);
398
- }
399
- catch (err) {
400
- if (err.code === "ENOENT") {
401
- // migrations.json not in bundle — no migrations to apply
402
- return result;
403
- }
404
- throw err;
405
- }
406
- // Filter entries using [from, to) semantics
407
- const entries = filterMigrationEntries(migrations, fromVersion, toVersion);
408
- if (entries.length === 0) {
409
- // No-op: empty range (from == to) or no entries in range
410
- return result;
411
- }
412
- // Read idempotency ledger
413
- const ledger = readLedger(projectRoot);
414
- // Build substitution map ONCE using config from .forge/config.json
415
- let buildSubstitutionMap = null;
416
- let substituteFile = null;
417
- try {
418
- const substPath = path.join(bundleRoot, "tools", "substitute-placeholders.cjs");
419
- const _require = createRequire(import.meta.url);
420
- const substModule = _require(substPath);
421
- buildSubstitutionMap = substModule.buildSubstitutionMap;
422
- substituteFile = substModule.substituteFile;
423
- }
424
- catch {
425
- // substitute-placeholders not available (testing or minimal bundle)
426
- // Fall back to identity substitution
427
- }
428
- let substitutionMap = null;
429
- if (buildSubstitutionMap) {
430
- try {
431
- const configPath = path.join(projectRoot, ".forge", "config.json");
432
- const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
433
- substitutionMap = buildSubstitutionMap(config);
434
- }
435
- catch {
436
- // Config unreadable — proceed without substitution
437
- }
438
- }
439
- // Process each entry in ascending semver order
440
- for (const { key, entry } of entries) {
441
- // Skip if already applied (idempotency)
442
- if (ledger.appliedVersions.includes(key)) {
443
- continue;
444
- }
445
- // Skip breaking entries
446
- if (entry.breaking) {
447
- result.skippedBreaking.push({
448
- fromVersion: key,
449
- toVersion: entry.version,
450
- reason: `breaking: true — manual intervention required. Notes: ${entry.notes}`,
451
- });
452
- continue;
453
- }
454
- // Collect manual steps
455
- if (entry.manual && entry.manual.length > 0) {
456
- result.manualSteps.push({
457
- fromVersion: key,
458
- toVersion: entry.version,
459
- steps: entry.manual,
460
- });
461
- }
462
- let appliedCategories = [];
463
- // fileOps takes priority over regenerate when non-empty
464
- // NOTE: 0 of 158 current entries use fileOps (dead code on day 1).
465
- // When a real fileOps entry lands, add an integration test against it.
466
- if (entry.fileOps && entry.fileOps.length > 0) {
467
- // C-19: consume FileOpsResult to capture ENOENT failures
468
- const fileOpsResult = executeFileOps(entry.fileOps, projectRoot, dryRun);
469
- appliedCategories = fileOpsResult.categories;
470
- for (const f of fileOpsResult.failed) {
471
- result.failedCategories.push({ version: key, category: f.category, reason: f.reason });
472
- }
473
- }
474
- else if (entry.regenerate && entry.regenerate.length > 0) {
475
- // Resolve categories to write descriptors
476
- const writes = [];
477
- for (const category of entry.regenerate) {
478
- resolveCategory(category, bundleRoot, projectRoot, writes);
479
- }
480
- // Execute writes (unless dry-run)
481
- if (!dryRun) {
482
- for (const { src, dest } of writes) {
483
- try {
484
- fs.mkdirSync(path.dirname(dest), { recursive: true });
485
- // Apply placeholder substitution for base-pack files
486
- if (substituteFile &&
487
- substitutionMap &&
488
- src.includes(path.join(".base-pack")) &&
489
- dest.endsWith(".md")) {
490
- const content = fs.readFileSync(src, "utf8");
491
- const substituted = substituteFile(content, substitutionMap);
492
- fs.writeFileSync(dest, substituted, "utf8");
493
- }
494
- else {
495
- fs.copyFileSync(src, dest);
496
- }
497
- }
498
- catch (err) {
499
- if (err.code !== "ENOENT")
500
- throw err;
501
- // C-19: ENOENT on src — skip silently but record the failure so
502
- // the caller (forge-update-command.ts) can surface a warning.
503
- result.failedCategories.push({
504
- version: key,
505
- category: src,
506
- reason: `ENOENT: ${src}`,
507
- });
508
- }
509
- }
510
- }
511
- appliedCategories = entry.regenerate;
512
- }
513
- result.applied.push({
514
- fromVersion: key,
515
- toVersion: entry.version,
516
- categories: appliedCategories,
517
- });
518
- // Update ledger after successful application
519
- if (!dryRun) {
520
- ledger.appliedVersions.push(key);
521
- }
522
- }
523
- // Write updated ledger
524
- if (!dryRun && result.applied.length > 0) {
525
- writeLedger(projectRoot, ledger);
526
- }
527
- // Always-on schema refresh post-pass: copy all *.schema.json to .forge/schemas/
528
- // Runs regardless of whether any entry had a schemas category.
529
- // This is an always-overwrite safety net (schemas are not user-edited).
530
- const schemasDir = path.join(bundleRoot, ".schemas");
531
- const forgeSchemasDir = path.join(projectRoot, ".forge", "schemas");
532
- try {
533
- const schemaFiles = fs.readdirSync(schemasDir).filter((f) => f.endsWith(".schema.json"));
534
- if (!dryRun) {
535
- fs.mkdirSync(forgeSchemasDir, { recursive: true });
536
- for (const f of schemaFiles) {
537
- try {
538
- fs.copyFileSync(path.join(schemasDir, f), path.join(forgeSchemasDir, f));
539
- result.schemasRefreshed.push(f);
540
- }
541
- catch (err) {
542
- if (err.code !== "ENOENT")
543
- throw err;
544
- }
545
- }
546
- }
547
- else {
548
- result.schemasRefreshed = schemaFiles;
549
- }
550
- }
551
- catch (err) {
552
- if (err.code !== "ENOENT")
553
- throw err;
554
- }
555
- return result;
556
- }
557
- // ── Test helpers (exported for test access) ───────────────────────────────────
558
- export const __test__ = {
559
- semverCompare,
560
- filterMigrationEntries,
561
- resolveCategory,
562
- };
563
- //# sourceMappingURL=migration-engine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-engine.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/migration-engine.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,8DAA8D;AAC9D,EAAE;AACF,yEAAyE;AAEzE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AA2ElD,iFAAiF;AAEjF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS,EAAE,CAAS;IACjD,MAAM,KAAK,GAAG,CAAC,CAAS,EAAmC,EAAE;QAC5D,MAAM,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,+CAA+C;QACnG,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KA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type.TBoolean;
6
- deferredTo: Type.TOptional<Type.TString>;
7
- modelGlobs: Type.TArray<Type.TString>;
8
- credentialEnvAny: Type.TArray<Type.TString>;
9
- }>;
10
- declare const RegistrySchema: Type.TObject<{
11
- version: Type.TLiteral<1>;
12
- providers: Type.TArray<Type.TObject<{
13
- id: Type.TString;
14
- label: Type.TString;
15
- enabled: Type.TBoolean;
16
- deferredTo: Type.TOptional<Type.TString>;
17
- modelGlobs: Type.TArray<Type.TString>;
18
- credentialEnvAny: Type.TArray<Type.TString>;
19
- }>>;
20
- }>;
21
- export type CuratedRegistry = Static<typeof RegistrySchema>;
22
- export type CuratedProvider = Static<typeof ProviderSchema>;
23
- export interface LoadOptions {
24
- registryPath?: string;
25
- env?: NodeJS.ProcessEnv;
26
- }
27
- export interface SeedOutcome {
28
- seeded: boolean;
29
- path: string;
30
- }
31
- export interface SeedOptions {
32
- projectRoot: string;
33
- registry: CuratedRegistry;
34
- now?: () => number;
35
- }
36
- declare function resolveRegistryPath(opts: LoadOptions): string;
37
- export declare function loadRegistry(opts?: LoadOptions): CuratedRegistry;
38
- declare function seededModelGlobs(registry: CuratedRegistry): string[];
39
- declare function defaultGlob(registry: CuratedRegistry): string;
40
- declare function seedFilePath(projectRoot: string): string;
41
- export declare function seedEnabledModels(opts: SeedOptions): Promise<SeedOutcome>;
42
- export declare function detectMissingCredentials(registry: CuratedRegistry, env?: NodeJS.ProcessEnv): string | null;
43
- export declare const __test__: {
44
- BUNDLED_PATH: string;
45
- resolveRegistryPath: typeof resolveRegistryPath;
46
- seedFilePath: typeof seedFilePath;
47
- seededModelGlobs: typeof seededModelGlobs;
48
- defaultGlob: typeof defaultGlob;
49
- RegistrySchema: Type.TObject<{
50
- version: Type.TLiteral<1>;
51
- providers: Type.TArray<Type.TObject<{
52
- id: Type.TString;
53
- label: Type.TString;
54
- enabled: Type.TBoolean;
55
- deferredTo: Type.TOptional<Type.TString>;
56
- modelGlobs: Type.TArray<Type.TString>;
57
- credentialEnvAny: Type.TArray<Type.TString>;
58
- }>>;
59
- }>;
60
- };
61
- export {};