@entelligentsia/forgecli 0.7.9 → 0.7.10

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 (506) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/CHANGELOG-forge-plugin.md +26 -0
  3. package/dist/bin/argv.d.ts +2 -2
  4. package/dist/bin/argv.js +12 -3
  5. package/dist/bin/argv.js.map +1 -1
  6. package/dist/bin/doctor.d.ts +59 -0
  7. package/dist/bin/doctor.js +149 -0
  8. package/dist/bin/doctor.js.map +1 -0
  9. package/dist/bin/forge.js +13 -0
  10. package/dist/bin/forge.js.map +1 -1
  11. package/dist/extensions/forgecli/fix-bug.js +35 -110
  12. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  13. package/dist/extensions/forgecli/index.js +28 -0
  14. package/dist/extensions/forgecli/index.js.map +1 -1
  15. package/dist/extensions/forgecli/review-command.d.ts +2 -0
  16. package/dist/extensions/forgecli/review-command.js +184 -0
  17. package/dist/extensions/forgecli/review-command.js.map +1 -0
  18. package/dist/extensions/forgecli/run-sprint.js +10 -0
  19. package/dist/extensions/forgecli/run-sprint.js.map +1 -1
  20. package/dist/extensions/forgecli/run-task.d.ts +1 -7
  21. package/dist/extensions/forgecli/run-task.js +30 -142
  22. package/dist/extensions/forgecli/run-task.js.map +1 -1
  23. package/dist/extensions/forgecli/session-registry.d.ts +68 -0
  24. package/dist/extensions/forgecli/session-registry.js +61 -0
  25. package/dist/extensions/forgecli/session-registry.js.map +1 -1
  26. package/dist/extensions/forgecli/thread-switcher.js +128 -9
  27. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  28. package/dist/extensions/forgecli/viewport-events.d.ts +74 -0
  29. package/dist/extensions/forgecli/viewport-events.js +184 -0
  30. package/dist/extensions/forgecli/viewport-events.js.map +1 -0
  31. package/dist/extensions/forgecli/viewport-renderer.d.ts +55 -0
  32. package/dist/extensions/forgecli/viewport-renderer.js +204 -0
  33. package/dist/extensions/forgecli/viewport-renderer.js.map +1 -0
  34. package/dist/extensions/forgecli/viewport-theme.d.ts +11 -0
  35. package/dist/extensions/forgecli/viewport-theme.js +124 -0
  36. package/dist/extensions/forgecli/viewport-theme.js.map +1 -0
  37. package/dist/forge-payload/.base-pack/workflows/_fragments/store-cli-verbs.md +18 -2
  38. package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +21 -14
  39. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  40. package/dist/forge-payload/.tools/banners.cjs +435 -0
  41. package/dist/forge-payload/.tools/build-context-pack.cjs +290 -0
  42. package/dist/forge-payload/.tools/build-init-context.cjs +322 -0
  43. package/dist/forge-payload/.tools/build-overlay.cjs +326 -0
  44. package/dist/forge-payload/.tools/build-persona-pack.cjs +226 -0
  45. package/dist/forge-payload/.tools/collate.cjs +1041 -0
  46. package/dist/forge-payload/.tools/generation-manifest.cjs +311 -0
  47. package/dist/forge-payload/.tools/lib/forge-root.cjs +59 -0
  48. package/dist/forge-payload/.tools/lib/paths.cjs +29 -0
  49. package/dist/forge-payload/.tools/lib/pricing.cjs +165 -0
  50. package/dist/forge-payload/.tools/lib/project-root.cjs +32 -0
  51. package/dist/forge-payload/.tools/lib/result.js +40 -0
  52. package/dist/forge-payload/.tools/lib/store-facade.cjs +162 -0
  53. package/dist/forge-payload/.tools/lib/store-nlp.cjs +250 -0
  54. package/dist/forge-payload/.tools/lib/store-query-exec.cjs +272 -0
  55. package/dist/forge-payload/.tools/lib/validate.js +141 -0
  56. package/dist/forge-payload/.tools/manage-config.cjs +340 -0
  57. package/dist/forge-payload/.tools/manage-versions.cjs +365 -0
  58. package/dist/forge-payload/.tools/package.json +3 -0
  59. package/dist/forge-payload/.tools/parse-gates.cjs +151 -0
  60. package/dist/forge-payload/.tools/parse-verdict.cjs +67 -0
  61. package/dist/forge-payload/.tools/preflight-gate.cjs +350 -0
  62. package/dist/forge-payload/.tools/prompts/sprint-plan-prompt.md +70 -0
  63. package/dist/forge-payload/.tools/schemas/task-list.schema.json +53 -0
  64. package/dist/forge-payload/.tools/seed-store.cjs +237 -0
  65. package/dist/forge-payload/.tools/store-cli.cjs +1226 -0
  66. package/dist/forge-payload/.tools/store-query.cjs +319 -0
  67. package/dist/forge-payload/.tools/store.cjs +315 -0
  68. package/dist/forge-payload/.tools/substitute-placeholders.cjs +625 -0
  69. package/dist/forge-payload/.tools/validate-store.cjs +593 -0
  70. package/dist/forge-payload/skills/refresh-kb-links/SKILL.md +217 -0
  71. package/dist/forge-payload/skills/store-custodian/SKILL.md +163 -0
  72. package/dist/forge-payload/skills/store-query-grammar/SKILL.md +145 -0
  73. package/dist/forge-payload/skills/store-query-nlp/SKILL.md +110 -0
  74. package/dist/forge-payload/tools/lib/suggest.cjs +211 -0
  75. package/dist/forge-payload/tools/lib/validate.js +12 -2
  76. package/dist/forge-payload/tools/store-cli.cjs +192 -18
  77. package/dist/forge-payload/tools/validate-store.cjs +22 -1
  78. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/endpoint/endpointResolver.js +2 -2
  79. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +9 -13
  80. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.browser.js +5 -5
  81. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/runtimeConfig.js +2 -3
  82. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js +1 -4
  83. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js +1 -1
  84. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.browser.js +1 -1
  85. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js +1 -2
  86. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js +1 -1
  87. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/BedrockRuntimeClient.d.ts +1 -2
  88. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.browser.d.ts +1 -1
  89. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.d.ts +1 -1
  90. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/runtimeConfig.native.d.ts +1 -1
  91. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/BedrockRuntimeClient.d.ts +5 -7
  92. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
  93. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
  94. package/node_modules/@aws-sdk/client-bedrock-runtime/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
  95. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +11 -19
  96. package/node_modules/@aws-sdk/core/dist-cjs/index.js +4 -6
  97. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +595 -0
  98. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +715 -0
  99. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +588 -0
  100. package/node_modules/@aws-sdk/core/dist-es/index.js +3 -3
  101. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.browser.js +36 -0
  102. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +26 -4
  103. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.native.js +37 -0
  104. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.js +3 -0
  105. package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/check-features.js +1 -1
  106. package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/user-agent-middleware.js +1 -1
  107. package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/partition.js +1 -1
  108. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +1 -0
  109. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.browser.js +1 -0
  110. package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.js +1 -1
  111. package/node_modules/@aws-sdk/core/dist-types/api-extractor-type-index.d.ts +3 -2
  112. package/node_modules/@aws-sdk/core/dist-types/index.d.ts +12 -14
  113. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.browser.d.ts +47 -0
  114. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +38 -4
  115. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.native.d.ts +48 -0
  116. package/node_modules/@aws-sdk/core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -0
  117. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -0
  118. package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
  119. package/node_modules/@aws-sdk/core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
  120. package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +0 -2
  121. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +65 -3
  122. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +116 -0
  123. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +123 -4
  124. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +116 -0
  125. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +4 -0
  126. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +647 -0
  127. package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.d.ts +1 -1
  128. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +1 -0
  129. package/node_modules/@aws-sdk/core/package.json +27 -8
  130. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  131. package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
  132. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  133. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  134. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  135. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  136. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  137. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  138. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
  139. package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
  140. package/node_modules/@aws-sdk/middleware-websocket/package.json +5 -5
  141. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +13 -20
  142. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +13 -20
  143. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +13 -20
  144. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -20
  145. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -21
  146. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +1 -4
  147. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +1 -1
  148. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -1
  149. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +1 -2
  150. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeExtensions.js +1 -1
  151. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +1 -4
  152. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
  153. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -1
  154. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +1 -2
  155. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +1 -1
  156. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js +1 -4
  157. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js +1 -1
  158. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -1
  159. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +1 -2
  160. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js +1 -1
  161. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +1 -4
  162. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +1 -1
  163. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -1
  164. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +1 -2
  165. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js +1 -1
  166. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +1 -4
  167. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -2
  168. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +1 -1
  169. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -1
  170. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +1 -2
  171. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js +1 -1
  172. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -2
  173. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
  174. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
  175. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
  176. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +1 -2
  177. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +1 -1
  178. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +1 -1
  179. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +1 -1
  180. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +1 -2
  181. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +1 -1
  182. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +1 -1
  183. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +1 -1
  184. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -2
  185. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
  186. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
  187. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
  188. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +1 -2
  189. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +1 -1
  190. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +1 -1
  191. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +1 -1
  192. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +1 -3
  193. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +1 -1
  194. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +1 -1
  195. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +1 -1
  196. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +1 -3
  197. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +1 -1
  198. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +1 -1
  199. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +1 -1
  200. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +1 -3
  201. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +1 -1
  202. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +1 -1
  203. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +1 -1
  204. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDCClient.d.ts +1 -3
  205. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +1 -1
  206. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +1 -1
  207. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +1 -1
  208. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STSClient.d.ts +1 -3
  209. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +1 -1
  210. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +1 -1
  211. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +1 -1
  212. package/node_modules/@aws-sdk/nested-clients/package.json +6 -14
  213. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  214. package/node_modules/@aws-sdk/token-providers/package.json +4 -4
  215. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  216. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  217. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  218. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +3 -1
  219. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  220. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +5 -1
  221. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  222. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  223. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  224. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  225. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package-lock.json +2 -2
  226. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  227. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  228. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  229. package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
  230. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  231. package/node_modules/@smithy/core/package.json +2 -2
  232. package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
  233. package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
  234. package/node_modules/@smithy/node-http-handler/package.json +4 -4
  235. package/node_modules/@smithy/signature-v4/package.json +3 -3
  236. package/node_modules/@smithy/types/README.md +3 -3
  237. package/node_modules/@smithy/types/dist-types/abort.d.ts +4 -6
  238. package/node_modules/@smithy/types/dist-types/auth/auth.d.ts +6 -4
  239. package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +7 -10
  240. package/node_modules/@smithy/types/dist-types/checksum.d.ts +4 -6
  241. package/node_modules/@smithy/types/dist-types/client.d.ts +8 -8
  242. package/node_modules/@smithy/types/dist-types/command.d.ts +2 -2
  243. package/node_modules/@smithy/types/dist-types/crypto.d.ts +6 -8
  244. package/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +6 -7
  245. package/node_modules/@smithy/types/dist-types/eventStream.d.ts +10 -10
  246. package/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +9 -10
  247. package/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +2 -2
  248. package/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +10 -10
  249. package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +2 -2
  250. package/node_modules/@smithy/types/dist-types/http.d.ts +18 -21
  251. package/node_modules/@smithy/types/dist-types/logger.d.ts +2 -2
  252. package/node_modules/@smithy/types/dist-types/middleware.d.ts +28 -27
  253. package/node_modules/@smithy/types/dist-types/pagination.d.ts +4 -4
  254. package/node_modules/@smithy/types/dist-types/serde.d.ts +10 -10
  255. package/node_modules/@smithy/types/dist-types/shapes.d.ts +9 -12
  256. package/node_modules/@smithy/types/dist-types/signature.d.ts +4 -4
  257. package/node_modules/@smithy/types/dist-types/stream.d.ts +2 -2
  258. package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +7 -11
  259. package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +23 -29
  260. package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +9 -19
  261. package/node_modules/@smithy/types/dist-types/transfer.d.ts +2 -1
  262. package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +4 -4
  263. package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +14 -18
  264. package/node_modules/@smithy/types/dist-types/transform/exact.d.ts +2 -2
  265. package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +12 -12
  266. package/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +14 -9
  267. package/node_modules/@smithy/types/dist-types/uri.d.ts +2 -2
  268. package/node_modules/@smithy/types/dist-types/util.d.ts +28 -28
  269. package/node_modules/@smithy/types/package.json +1 -1
  270. package/node_modules/fast-xml-parser/CHANGELOG.md +7 -0
  271. package/node_modules/fast-xml-parser/README.md +0 -3
  272. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +1 -1
  273. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -1
  274. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  275. package/node_modules/fast-xml-parser/lib/fxp.d.cts +1 -0
  276. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  277. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  278. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  279. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  280. package/node_modules/fast-xml-parser/package.json +2 -4
  281. package/node_modules/fast-xml-parser/src/fxp.d.ts +1 -0
  282. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +1 -1
  283. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +4 -0
  284. package/package.json +7 -7
  285. package/skills/refresh-kb-links/SKILL.md +217 -0
  286. package/skills/store-custodian/SKILL.md +163 -0
  287. package/skills/store-query-grammar/SKILL.md +145 -0
  288. package/skills/store-query-nlp/SKILL.md +110 -0
  289. package/node_modules/@aws-sdk/middleware-host-header/LICENSE +0 -201
  290. package/node_modules/@aws-sdk/middleware-host-header/README.md +0 -4
  291. package/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +0 -41
  292. package/node_modules/@aws-sdk/middleware-host-header/package.json +0 -59
  293. package/node_modules/@aws-sdk/middleware-logger/LICENSE +0 -201
  294. package/node_modules/@aws-sdk/middleware-logger/README.md +0 -4
  295. package/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +0 -48
  296. package/node_modules/@aws-sdk/middleware-logger/dist-es/index.js +0 -1
  297. package/node_modules/@aws-sdk/middleware-logger/dist-types/index.d.ts +0 -1
  298. package/node_modules/@aws-sdk/middleware-logger/dist-types/ts3.4/index.d.ts +0 -1
  299. package/node_modules/@aws-sdk/middleware-logger/package.json +0 -59
  300. package/node_modules/@aws-sdk/middleware-recursion-detection/LICENSE +0 -201
  301. package/node_modules/@aws-sdk/middleware-recursion-detection/README.md +0 -17
  302. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +0 -29
  303. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.browser.js +0 -5
  304. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +0 -33
  305. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.native.js +0 -5
  306. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js +0 -2
  307. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/index.d.ts +0 -2
  308. package/node_modules/@aws-sdk/middleware-recursion-detection/dist-types/ts3.4/index.d.ts +0 -2
  309. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +0 -66
  310. package/node_modules/@aws-sdk/middleware-user-agent/LICENSE +0 -201
  311. package/node_modules/@aws-sdk/middleware-user-agent/README.md +0 -4
  312. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +0 -194
  313. package/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js +0 -2
  314. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/index.d.ts +0 -2
  315. package/node_modules/@aws-sdk/middleware-user-agent/dist-types/ts3.4/index.d.ts +0 -2
  316. package/node_modules/@aws-sdk/middleware-user-agent/package.json +0 -61
  317. package/node_modules/@aws-sdk/region-config-resolver/LICENSE +0 -201
  318. package/node_modules/@aws-sdk/region-config-resolver/README.md +0 -19
  319. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +0 -38
  320. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.browser.js +0 -6
  321. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +0 -19
  322. package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.native.js +0 -6
  323. package/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js +0 -3
  324. package/node_modules/@aws-sdk/region-config-resolver/dist-types/index.d.ts +0 -3
  325. package/node_modules/@aws-sdk/region-config-resolver/dist-types/ts3.4/index.d.ts +0 -3
  326. package/node_modules/@aws-sdk/region-config-resolver/package.json +0 -64
  327. package/node_modules/@aws-sdk/util-endpoints/LICENSE +0 -201
  328. package/node_modules/@aws-sdk/util-endpoints/README.md +0 -6
  329. package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +0 -406
  330. package/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +0 -267
  331. package/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +0 -6
  332. package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +0 -3
  333. package/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +0 -267
  334. package/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +0 -6
  335. package/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +0 -6
  336. package/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts +0 -3
  337. package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +0 -6
  338. package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts +0 -3
  339. package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts +0 -6
  340. package/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts +0 -6
  341. package/node_modules/@aws-sdk/util-endpoints/package.json +0 -59
  342. package/node_modules/@aws-sdk/util-user-agent-browser/LICENSE +0 -201
  343. package/node_modules/@aws-sdk/util-user-agent-browser/README.md +0 -29
  344. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +0 -24
  345. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.browser.js +0 -4
  346. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +0 -61
  347. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.native.js +0 -22
  348. package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.browser.js +0 -1
  349. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.browser.d.ts +0 -1
  350. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.browser.d.ts +0 -1
  351. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +0 -60
  352. package/node_modules/@aws-sdk/util-user-agent-node/LICENSE +0 -201
  353. package/node_modules/@aws-sdk/util-user-agent-node/README.md +0 -17
  354. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +0 -185
  355. package/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js +0 -2
  356. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/index.d.ts +0 -2
  357. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/ts3.4/index.d.ts +0 -2
  358. package/node_modules/@aws-sdk/util-user-agent-node/package.json +0 -68
  359. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +0 -4
  360. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +0 -1
  361. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +0 -3
  362. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +0 -1
  363. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +0 -20
  364. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +0 -1
  365. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +0 -92
  366. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +0 -1
  367. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +0 -18
  368. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +0 -1
  369. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +0 -42
  370. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +0 -1
  371. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +0 -10
  372. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +0 -1
  373. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +0 -31
  374. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +0 -1
  375. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +0 -30
  376. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +0 -1
  377. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +0 -170
  378. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +0 -1
  379. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +0 -26
  380. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +0 -1
  381. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +0 -90
  382. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +0 -1
  383. package/skills/.gitkeep +0 -0
  384. /package/node_modules/@aws-sdk/{middleware-host-header/dist-es/index.js → core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js} +0 -0
  385. /package/node_modules/@aws-sdk/{middleware-logger/dist-es → core/dist-es/submodules/client/middleware-logger}/loggerMiddleware.js +0 -0
  386. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/configuration.js +0 -0
  387. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/getRecursionDetectionPlugin.js +0 -0
  388. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.js +0 -0
  389. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.js +0 -0
  390. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-es → core/dist-es/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.js +0 -0
  391. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/configurations.js +0 -0
  392. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/constants.js +0 -0
  393. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-es → core/dist-es/submodules/client/middleware-user-agent}/encode-features.js +0 -0
  394. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/awsRegionConfig.js +0 -0
  395. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/extensions/index.js → core/dist-es/submodules/client/region-config-resolver/extensions.js} +0 -0
  396. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.js +0 -0
  397. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.js +0 -0
  398. /package/node_modules/@aws-sdk/{region-config-resolver/dist-es/regionConfig → core/dist-es/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.js +0 -0
  399. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/aws.js +0 -0
  400. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.js +0 -0
  401. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/aws/parseArn.js +0 -0
  402. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/lib/isIpAddress.js +0 -0
  403. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.js +0 -0
  404. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/resolveEndpoint.js +0 -0
  405. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointError.js +0 -0
  406. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/EndpointRuleObject.js +0 -0
  407. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/ErrorRuleObject.js +0 -0
  408. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/RuleSetObject.js +0 -0
  409. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/TreeRuleObject.js +0 -0
  410. /package/node_modules/@aws-sdk/{util-endpoints/dist-es → core/dist-es/submodules/client/util-endpoints}/types/shared.js +0 -0
  411. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/configurations.js +0 -0
  412. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es → core/dist-es/submodules/client/util-user-agent-browser}/createUserAgentStringParsingProvider.js +0 -0
  413. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js} +0 -0
  414. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-es/index.native.js → core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.native.js} +0 -0
  415. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/crt-availability.js +0 -0
  416. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/defaultUserAgent.js +0 -0
  417. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.js +0 -0
  418. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.js +0 -0
  419. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.js +0 -0
  420. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.js +0 -0
  421. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.js +0 -0
  422. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-es → core/dist-es/submodules/client/util-user-agent-node}/is-crt-available.js +0 -0
  423. /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/index.d.ts → core/dist-types/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
  424. /package/node_modules/@aws-sdk/{middleware-logger/dist-types → core/dist-types/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
  425. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
  426. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/getRecursionDetectionPlugin.d.ts → core/dist-types/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
  427. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
  428. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
  429. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types → core/dist-types/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
  430. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
  431. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
  432. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
  433. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
  434. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types → core/dist-types/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
  435. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
  436. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/extensions/index.d.ts → core/dist-types/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
  437. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
  438. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
  439. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/regionConfig → core/dist-types/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
  440. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/aws.d.ts +0 -0
  441. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
  442. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
  443. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
  444. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
  445. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
  446. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
  447. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
  448. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
  449. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
  450. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
  451. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
  452. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
  453. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types → core/dist-types/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
  454. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
  455. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/index.native.d.ts → core/dist-types/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
  456. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
  457. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
  458. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
  459. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
  460. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
  461. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
  462. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
  463. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
  464. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types → core/dist-types/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
  465. /package/node_modules/@aws-sdk/{middleware-host-header/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts} +0 -0
  466. /package/node_modules/@aws-sdk/{middleware-logger/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-logger}/loggerMiddleware.d.ts +0 -0
  467. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/configuration.d.ts +0 -0
  468. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4/getRecursionDetectionPlugin.d.ts → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts} +0 -0
  469. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.browser.d.ts +0 -0
  470. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.d.ts +0 -0
  471. /package/node_modules/@aws-sdk/{middleware-recursion-detection/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-recursion-detection}/recursionDetectionMiddleware.native.d.ts +0 -0
  472. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/check-features.d.ts +0 -0
  473. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/configurations.d.ts +0 -0
  474. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/constants.d.ts +0 -0
  475. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/encode-features.d.ts +0 -0
  476. /package/node_modules/@aws-sdk/{middleware-user-agent/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/middleware-user-agent}/user-agent-middleware.d.ts +0 -0
  477. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/awsRegionConfig.d.ts +0 -0
  478. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/extensions/index.d.ts → core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts} +0 -0
  479. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.browser.d.ts +0 -0
  480. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.d.ts +0 -0
  481. /package/node_modules/@aws-sdk/{region-config-resolver/dist-types/ts3.4/regionConfig → core/dist-types/ts3.4/submodules/client/region-config-resolver}/stsRegionDefaultResolver.native.d.ts +0 -0
  482. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/aws.d.ts +0 -0
  483. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/isVirtualHostableS3Bucket.d.ts +0 -0
  484. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/parseArn.d.ts +0 -0
  485. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/aws/partition.d.ts +0 -0
  486. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/lib/isIpAddress.d.ts +0 -0
  487. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveDefaultAwsRegionalEndpointsConfig.d.ts +0 -0
  488. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/resolveEndpoint.d.ts +0 -0
  489. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointError.d.ts +0 -0
  490. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/EndpointRuleObject.d.ts +0 -0
  491. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/ErrorRuleObject.d.ts +0 -0
  492. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/RuleSetObject.d.ts +0 -0
  493. /package/node_modules/@aws-sdk/{util-endpoints/dist-types → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/TreeRuleObject.d.ts +0 -0
  494. /package/node_modules/@aws-sdk/{util-endpoints/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-endpoints}/types/shared.d.ts +0 -0
  495. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-browser}/configurations.d.ts +0 -0
  496. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts} +0 -0
  497. /package/node_modules/@aws-sdk/{util-user-agent-browser/dist-types/ts3.4/index.native.d.ts → core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts} +0 -0
  498. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/crt-availability.d.ts +0 -0
  499. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/defaultUserAgent.d.ts +0 -0
  500. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getNodeModulesParentDirs.d.ts +0 -0
  501. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getRuntimeUserAgentPair.d.ts +0 -0
  502. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedDevTypeScriptVersion.d.ts +0 -0
  503. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getSanitizedTypeScriptVersion.d.ts +0 -0
  504. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/getTypeScriptUserAgentPair.d.ts +0 -0
  505. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/is-crt-available.d.ts +0 -0
  506. /package/node_modules/@aws-sdk/{util-user-agent-node/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/client/util-user-agent-node}/nodeAppIdConfigOptions.d.ts +0 -0
@@ -0,0 +1,365 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // Forge tool: manage-versions
5
+ // Manage .forge/structure-versions.json — snapshot lifecycle for structural elements.
6
+ //
7
+ // Subcommands:
8
+ // init Write snapshot 0 at first init (idempotent: no-op if file exists)
9
+ // current Print current snapshot index and metadata
10
+ // list Print tabular summary of all snapshots
11
+ // add-snapshot Archive current structural elements and record a new snapshot entry
12
+ //
13
+ // Composition model: Working Artifact = base@pluginVersion + snapshot@currentSnapshot + user_enhancements
14
+ // Snapshot-array invariant: snapshots is ordered ascending by index; currentSnapshot always equals
15
+ // snapshots[snapshots.length - 1].index.
16
+ //
17
+ // Usage:
18
+ // node manage-versions.cjs init [--dry-run]
19
+ // node manage-versions.cjs current
20
+ // node manage-versions.cjs list
21
+ // node manage-versions.cjs add-snapshot --source <source> [--enhanced-elements <csv>] [--dry-run]
22
+ // --source <string> Required. One of: post-init | post-sprint:<ID> | on-demand
23
+ // --enhanced-elements <csv> Optional. Comma-separated list of .forge/-relative paths that were enhanced.
24
+ // --dry-run Log intent without performing I/O.
25
+ //
26
+ // Environment:
27
+ // FORGE_ROOT — path to forge plugin root (used by init to locate plugin.json and schemas)
28
+ // Falls back to auto-detection via ../../ from __dirname when FORGE_ROOT is unset.
29
+
30
+ const fs = require('fs');
31
+ const path = require('path');
32
+ const { resolveForgeRoot } = require('./lib/forge-root.cjs');
33
+
34
+ // ---------------------------------------------------------------------------
35
+ // Constants
36
+ // ---------------------------------------------------------------------------
37
+
38
+ // Relative path suffix for structure-versions.json (from project root)
39
+ const VERSIONS_SUFFIX = path.join('.forge', 'structure-versions.json');
40
+
41
+ // Default project root is cwd when used as CLI; exports allow test injection.
42
+ const VERSIONS_PATH = path.join(process.cwd(), VERSIONS_SUFFIX);
43
+
44
+ // ---------------------------------------------------------------------------
45
+ // Exported helpers (used by unit tests and callers)
46
+ // ---------------------------------------------------------------------------
47
+
48
+ /**
49
+ * Resolve the path to structure-versions.json for the given project root.
50
+ * @param {string} projectRoot
51
+ * @returns {string}
52
+ */
53
+ function versionsPath(projectRoot) {
54
+ return path.join(projectRoot, VERSIONS_SUFFIX);
55
+ }
56
+
57
+ /**
58
+ * Read and parse .forge/structure-versions.json.
59
+ * @param {string} projectRoot
60
+ * @returns {object} parsed document
61
+ * @throws {Error} when file does not exist or cannot be parsed
62
+ */
63
+ function readStructureVersions(projectRoot) {
64
+ const filePath = versionsPath(projectRoot);
65
+ if (!fs.existsSync(filePath)) {
66
+ throw new Error(`structure-versions.json not found at ${filePath}. Run \`manage-versions init\` first.`);
67
+ }
68
+ try {
69
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
70
+ } catch (e) {
71
+ throw new Error(`Failed to parse structure-versions.json at ${filePath}: ${e.message}`);
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Write data to .forge/structure-versions.json atomically via .tmp.PID rename.
77
+ * @param {string} projectRoot
78
+ * @param {object} data
79
+ */
80
+ function writeStructureVersions(projectRoot, data) {
81
+ const filePath = versionsPath(projectRoot);
82
+ const json = JSON.stringify(data, null, 2) + '\n';
83
+ const tmp = filePath + '.tmp.' + process.pid;
84
+ try {
85
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
86
+ fs.writeFileSync(tmp, json, 'utf8');
87
+ fs.renameSync(tmp, filePath);
88
+ } catch (e) {
89
+ try { fs.unlinkSync(tmp); } catch {}
90
+ throw new Error(`Failed to write structure-versions.json: ${e.message}`);
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Resolve forge root from env or __dirname fallback.
96
+ * Delegates to the shared forge-root.cjs helper (FR-001).
97
+ * @param {string} [envForgeRoot] - value of FORGE_ROOT env var
98
+ * @returns {string}
99
+ */
100
+
101
+ /**
102
+ * Read the plugin version from FORGE_ROOT/.claude-plugin/plugin.json.
103
+ * @param {string} forgeRoot
104
+ * @returns {string}
105
+ */
106
+ function readPluginVersion(forgeRoot) {
107
+ const pluginPath = path.join(forgeRoot, '.claude-plugin', 'plugin.json');
108
+ try {
109
+ const pkg = JSON.parse(fs.readFileSync(pluginPath, 'utf8'));
110
+ if (!pkg.version) throw new Error('version field missing');
111
+ return pkg.version;
112
+ } catch (e) {
113
+ throw new Error(`Failed to read plugin version from ${pluginPath}: ${e.message}`);
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Read the overlay tool version from FORGE_ROOT/schemas/project-overlay.schema.json.
119
+ * Falls back to "1.0.0" if the schema does not contain a version field.
120
+ * @param {string} forgeRoot
121
+ * @returns {string}
122
+ */
123
+ function readOverlayToolVersion(forgeRoot) {
124
+ const schemaPath = path.join(forgeRoot, 'schemas', 'project-overlay.schema.json');
125
+ try {
126
+ const schema = JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
127
+ if (typeof schema.version === 'string' && schema.version) {
128
+ return schema.version;
129
+ }
130
+ } catch {
131
+ // Schema unreadable — fall back
132
+ }
133
+ return '1.0.0';
134
+ }
135
+
136
+ // Structural element directories that are eligible to be archived.
137
+ const STRUCTURAL_ELEMENT_DIRS = ['personas', 'skills', 'workflows', 'templates'];
138
+
139
+ /**
140
+ * Copy a file, creating intermediate directories as needed.
141
+ * @param {string} src
142
+ * @param {string} dest
143
+ */
144
+ function copyFileWithDirs(src, dest) {
145
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
146
+ fs.copyFileSync(src, dest);
147
+ }
148
+
149
+ /**
150
+ * Add a new snapshot entry to structure-versions.json and archive the
151
+ * current structural elements listed in enhancedElements.
152
+ *
153
+ * @param {string} projectRoot - path to the project root (where .forge/ lives)
154
+ * @param {string} source - snapshot source label (post-init | post-sprint:<ID> | on-demand)
155
+ * @param {string[]} enhancedElements - list of .forge/-relative paths that were enhanced
156
+ * @param {boolean} [dryRun] - when true, log intent but perform no I/O
157
+ */
158
+ function addSnapshot(projectRoot, source, enhancedElements, dryRun) {
159
+ if (!source) {
160
+ throw new Error('--source is required for add-snapshot. Provide one of: post-init | post-sprint:<ID> | on-demand');
161
+ }
162
+
163
+ const doc = readStructureVersions(projectRoot);
164
+ const nextIndex = doc.currentSnapshot + 1;
165
+ const archivePath = path.join('.forge', 'archive', `snap-${nextIndex}`);
166
+ const archiveAbsPath = path.join(projectRoot, archivePath);
167
+
168
+ // Guard: fail if archive directory already exists to prevent corruption.
169
+ if (fs.existsSync(archiveAbsPath)) {
170
+ throw new Error(
171
+ `Archive directory already exists: ${archiveAbsPath} (snap-${nextIndex}). ` +
172
+ 'Cannot create snapshot — remove or rename the existing archive directory first.'
173
+ );
174
+ }
175
+
176
+ const createdAt = new Date().toISOString();
177
+ const newSnapshot = {
178
+ index: nextIndex,
179
+ createdAt,
180
+ source,
181
+ enhancedElements: enhancedElements || [],
182
+ archivePath
183
+ };
184
+
185
+ if (dryRun) {
186
+ console.log(`[dry-run] Would create archive at: ${archiveAbsPath}`);
187
+ console.log(`[dry-run] Would archive ${(enhancedElements || []).length} element(s).`);
188
+ console.log(`[dry-run] Would write snapshot entry:`);
189
+ console.log(JSON.stringify(newSnapshot, null, 2));
190
+ return;
191
+ }
192
+
193
+ // Archive each enhanced element by copying from .forge/ into the archive dir.
194
+ for (const relPath of (enhancedElements || [])) {
195
+ const srcPath = path.join(projectRoot, '.forge', relPath);
196
+ const destPath = path.join(archiveAbsPath, relPath);
197
+ if (fs.existsSync(srcPath)) {
198
+ copyFileWithDirs(srcPath, destPath);
199
+ }
200
+ // If the source file does not exist, skip silently — the element list
201
+ // may reference files that were removed or renamed; archiving what's there
202
+ // is better than failing the whole snapshot.
203
+ }
204
+
205
+ // Also create the archive directory even if no elements were listed,
206
+ // so archivePath references a real directory.
207
+ fs.mkdirSync(archiveAbsPath, { recursive: true });
208
+
209
+ // Append snapshot entry and advance currentSnapshot.
210
+ doc.snapshots.push(newSnapshot);
211
+ doc.currentSnapshot = nextIndex;
212
+ writeStructureVersions(projectRoot, doc);
213
+
214
+ console.log(`ノ add-snapshot complete — snapshot ${nextIndex} written (source: ${source}, elements: ${(enhancedElements || []).length})`);
215
+ }
216
+
217
+ /**
218
+ * Initialise structure-versions.json with snapshot 0.
219
+ * Idempotent: if the file already exists, exits cleanly without overwriting.
220
+ *
221
+ * @param {string} projectRoot - path to the project root (where .forge/ lives)
222
+ * @param {string} forgeRoot - path to the forge plugin root
223
+ * @param {boolean} [dryRun] - when true, log intent but perform no I/O
224
+ * @param {string} [source] - source label for snapshot 0 (default: 'base-pack')
225
+ */
226
+ function initStructureVersions(projectRoot, forgeRoot, dryRun, source) {
227
+ const filePath = versionsPath(projectRoot);
228
+
229
+ // Idempotency: if the file already exists, do nothing.
230
+ if (fs.existsSync(filePath)) {
231
+ console.log(`〇 structure-versions.json already exists — skipping (idempotent).`);
232
+ return;
233
+ }
234
+
235
+ const effectiveSource = source || 'base-pack';
236
+ const basePackVersion = readPluginVersion(forgeRoot);
237
+ const overlayToolVersion = readOverlayToolVersion(forgeRoot);
238
+
239
+ const doc = {
240
+ basePackVersion,
241
+ overlayToolVersion,
242
+ currentSnapshot: 0,
243
+ snapshots: [
244
+ {
245
+ index: 0,
246
+ createdAt: new Date().toISOString(),
247
+ source: effectiveSource,
248
+ enhancedElements: [],
249
+ archivePath: null
250
+ }
251
+ ]
252
+ };
253
+
254
+ if (dryRun) {
255
+ console.log('[dry-run] Would write structure-versions.json:');
256
+ console.log(JSON.stringify(doc, null, 2));
257
+ return;
258
+ }
259
+
260
+ writeStructureVersions(projectRoot, doc);
261
+ console.log(`ノ structure-versions.json written (snapshot 0, source: ${effectiveSource}, plugin: v${basePackVersion})`);
262
+ }
263
+
264
+ // ---------------------------------------------------------------------------
265
+ // Exports (for unit tests)
266
+ // ---------------------------------------------------------------------------
267
+
268
+ module.exports = {
269
+ initStructureVersions,
270
+ addSnapshot,
271
+ readStructureVersions,
272
+ writeStructureVersions,
273
+ VERSIONS_PATH,
274
+ versionsPath,
275
+ readPluginVersion,
276
+ readOverlayToolVersion,
277
+ };
278
+
279
+ // ---------------------------------------------------------------------------
280
+ // CLI
281
+ // ---------------------------------------------------------------------------
282
+
283
+ if (require.main === module) {
284
+
285
+ process.on('uncaughtException', (error) => {
286
+ console.error('Fatal manage-versions error:', error.message);
287
+ process.exit(1);
288
+ });
289
+
290
+ const args = process.argv.slice(2);
291
+ const DRY_RUN = args.includes('--dry-run');
292
+ const subcommand = args.find(a => !a.startsWith('--'));
293
+
294
+ const forgeRoot = resolveForgeRoot(process.env.FORGE_ROOT);
295
+ const projectRoot = process.cwd();
296
+
297
+ try {
298
+ switch (subcommand) {
299
+ case 'init': {
300
+ const sourceIdx = args.indexOf('--source');
301
+ const initSource = sourceIdx !== -1 ? args[sourceIdx + 1] : undefined;
302
+ initStructureVersions(projectRoot, forgeRoot, DRY_RUN, initSource);
303
+ break;
304
+ }
305
+
306
+ case 'current': {
307
+ const doc = readStructureVersions(projectRoot);
308
+ const snap = doc.snapshots.find(s => s.index === doc.currentSnapshot);
309
+ console.log(`Current snapshot: ${doc.currentSnapshot}`);
310
+ if (snap) {
311
+ console.log(` source: ${snap.source}`);
312
+ console.log(` createdAt: ${snap.createdAt}`);
313
+ console.log(` plugin: v${doc.basePackVersion}`);
314
+ }
315
+ break;
316
+ }
317
+
318
+ case 'list': {
319
+ const doc = readStructureVersions(projectRoot);
320
+ console.log(`Snapshots (current: ${doc.currentSnapshot}):`);
321
+ console.log(`${'#'.padEnd(4)} ${'source'.padEnd(20)} ${'createdAt'.padEnd(28)} elements`);
322
+ console.log('-'.repeat(70));
323
+ for (const snap of doc.snapshots) {
324
+ const current = snap.index === doc.currentSnapshot ? '*' : ' ';
325
+ const elems = snap.enhancedElements ? snap.enhancedElements.length : 0;
326
+ console.log(`${current}${String(snap.index).padEnd(3)} ${snap.source.padEnd(20)} ${snap.createdAt.padEnd(28)} ${elems}`);
327
+ }
328
+ break;
329
+ }
330
+
331
+ case 'add-snapshot': {
332
+ // Parse --source flag
333
+ const sourceIdx = args.indexOf('--source');
334
+ const source = sourceIdx !== -1 ? args[sourceIdx + 1] : null;
335
+ if (!source || source.startsWith('--')) {
336
+ console.error('× add-snapshot requires --source <value>.');
337
+ console.error(' Accepted values: post-init | post-sprint:<SPRINT_ID> | on-demand');
338
+ process.exit(1);
339
+ }
340
+
341
+ // Parse optional --enhanced-elements flag (comma-separated list)
342
+ const elementsIdx = args.indexOf('--enhanced-elements');
343
+ let enhancedElements = [];
344
+ if (elementsIdx !== -1) {
345
+ const raw = args[elementsIdx + 1];
346
+ if (raw && !raw.startsWith('--')) {
347
+ enhancedElements = raw.split(',').map(s => s.trim()).filter(Boolean);
348
+ }
349
+ }
350
+
351
+ addSnapshot(projectRoot, source, enhancedElements, DRY_RUN);
352
+ break;
353
+ }
354
+
355
+ default: {
356
+ console.error(`× Unknown subcommand: ${subcommand || '(none)'}`);
357
+ console.error(' Usage: manage-versions.cjs <init|current|list|add-snapshot> [--dry-run]');
358
+ process.exit(1);
359
+ }
360
+ }
361
+ } catch (err) {
362
+ console.error(`× manage-versions error: ${err.message}`);
363
+ process.exit(1);
364
+ }
365
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,151 @@
1
+ 'use strict';
2
+
3
+ // parse-gates.cjs — minimal DSL for per-phase gate declarations.
4
+ //
5
+ // Grammar (closed — unknown directives throw):
6
+ // artifact <path> [min=<bytes>]
7
+ // require <field> <op> <value>
8
+ // forbid <field> <op> <value>
9
+ // after <phase> = <approved|revision>
10
+ //
11
+ // Predicate ops: ==, !=, in [v1, v2, ...]
12
+ // Blank lines and lines beginning with # (optionally indented) are ignored.
13
+ // Gates live in fenced blocks self-identified by phase via a fence-label
14
+ // attribute, e.g. ```gates phase=implement . The fence is self-contained;
15
+ // gate blocks can appear anywhere in the workflow file without depending on
16
+ // surrounding heading structure.
17
+
18
+ const FENCE_OPEN = /^```gates\s+phase=([A-Za-z0-9_-]+)\s*$/;
19
+ const FENCE_CLOSE = /^```\s*$/;
20
+
21
+ const VALID_VERDICTS = new Set(['approved', 'revision']);
22
+
23
+ function parseGates(markdown) {
24
+ if (typeof markdown !== 'string' || markdown.length === 0) return {};
25
+ const lines = markdown.split('\n');
26
+ const result = {};
27
+
28
+ let currentPhase = null;
29
+ let inFence = false;
30
+ let fenceStartLine = -1;
31
+ let fenceBuffer = [];
32
+
33
+ for (let i = 0; i < lines.length; i++) {
34
+ const line = lines[i];
35
+ const lineNo = i + 1;
36
+
37
+ if (!inFence) {
38
+ const m = line.match(FENCE_OPEN);
39
+ if (m) {
40
+ currentPhase = m[1];
41
+ if (result[currentPhase]) {
42
+ throw new Error(
43
+ `parse-gates: line ${lineNo}: duplicate gates block for phase "${currentPhase}"`,
44
+ );
45
+ }
46
+ inFence = true;
47
+ fenceStartLine = lineNo;
48
+ fenceBuffer = [];
49
+ }
50
+ continue;
51
+ }
52
+
53
+ // Inside a gates fence
54
+ if (FENCE_CLOSE.test(line)) {
55
+ result[currentPhase] = parseBlock(fenceBuffer, fenceStartLine);
56
+ inFence = false;
57
+ currentPhase = null;
58
+ continue;
59
+ }
60
+ fenceBuffer.push({ text: line, lineNo });
61
+ }
62
+
63
+ if (inFence) {
64
+ throw new Error(`parse-gates: unterminated \`\`\`gates fence opened at line ${fenceStartLine}`);
65
+ }
66
+ return result;
67
+ }
68
+
69
+ function parseBlock(bufferedLines, _fenceStartLine) {
70
+ const spec = { artifacts: [], require: [], forbid: [], after: [] };
71
+ for (const { text, lineNo } of bufferedLines) {
72
+ const trimmed = text.trim();
73
+ if (trimmed === '' || trimmed.startsWith('#')) continue;
74
+
75
+ const firstSpace = trimmed.search(/\s/);
76
+ if (firstSpace < 0) {
77
+ throw new Error(`parse-gates: line ${lineNo}: malformed directive "${trimmed}"`);
78
+ }
79
+ const directive = trimmed.slice(0, firstSpace);
80
+ const rest = trimmed.slice(firstSpace + 1).trim();
81
+
82
+ switch (directive) {
83
+ case 'artifact':
84
+ spec.artifacts.push(parseArtifact(rest, lineNo));
85
+ break;
86
+ case 'require':
87
+ spec.require.push(parsePredicate(rest, lineNo));
88
+ break;
89
+ case 'forbid':
90
+ spec.forbid.push(parsePredicate(rest, lineNo));
91
+ break;
92
+ case 'after':
93
+ spec.after.push(parseAfter(rest, lineNo));
94
+ break;
95
+ default:
96
+ throw new Error(`parse-gates: line ${lineNo}: unknown directive "${directive}"`);
97
+ }
98
+ }
99
+ return spec;
100
+ }
101
+
102
+ function parseArtifact(rest, lineNo) {
103
+ const minMatch = rest.match(/\bmin=(\d+)\s*$/);
104
+ let path = rest;
105
+ let minBytes = 0;
106
+ if (minMatch) {
107
+ minBytes = parseInt(minMatch[1], 10);
108
+ path = rest.slice(0, minMatch.index).trim();
109
+ }
110
+ if (!path) {
111
+ throw new Error(`parse-gates: line ${lineNo}: artifact directive missing path`);
112
+ }
113
+ return { path, minBytes };
114
+ }
115
+
116
+ function parsePredicate(rest, lineNo) {
117
+ // in-list form: <field> in [v1, v2, ...]
118
+ const inMatch = rest.match(/^(\S+)\s+in\s+\[(.*)\]\s*$/);
119
+ if (inMatch) {
120
+ const field = inMatch[1];
121
+ const value = inMatch[2]
122
+ .split(',')
123
+ .map((v) => v.trim())
124
+ .filter((v) => v.length > 0);
125
+ return { field, op: 'in', value };
126
+ }
127
+ // binary form: <field> <op> <value>
128
+ const binMatch = rest.match(/^(\S+)\s+(==|!=)\s+(.+?)\s*$/);
129
+ if (binMatch) {
130
+ return { field: binMatch[1], op: binMatch[2], value: binMatch[3].trim() };
131
+ }
132
+ throw new Error(
133
+ `parse-gates: line ${lineNo}: unknown predicate op or malformed predicate "${rest}"`,
134
+ );
135
+ }
136
+
137
+ function parseAfter(rest, lineNo) {
138
+ const m = rest.match(/^(\S+)\s*=\s*(\S+)\s*$/);
139
+ if (!m) {
140
+ throw new Error(`parse-gates: line ${lineNo}: malformed "after" directive "${rest}"`);
141
+ }
142
+ const verdict = m[2].toLowerCase();
143
+ if (!VALID_VERDICTS.has(verdict)) {
144
+ throw new Error(
145
+ `parse-gates: line ${lineNo}: "after" verdict must be "approved" or "revision", got "${m[2]}"`,
146
+ );
147
+ }
148
+ return { phase: m[1], verdict };
149
+ }
150
+
151
+ module.exports = { parseGates };
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ // Closed verdict vocabulary. Anything outside this map yields null so the
4
+ // orchestrator halts loudly instead of guessing from reviewer prose.
5
+ const APPROVED = new Set(['approved', 'approve']);
6
+ const REVISION = new Set([
7
+ 'revision required',
8
+ 'revision',
9
+ 'needs revision',
10
+ 'changes requested',
11
+ ]);
12
+
13
+ const VERDICT_LINE = /^[ \t]*\*\*verdict:\*\*[ \t]*(.+?)[ \t]*$/gim;
14
+
15
+ function parseVerdict(markdown) {
16
+ if (typeof markdown !== 'string' || markdown.length === 0) return null;
17
+
18
+ let lastValue = null;
19
+ let match;
20
+ VERDICT_LINE.lastIndex = 0;
21
+ while ((match = VERDICT_LINE.exec(markdown)) !== null) {
22
+ lastValue = match[1];
23
+ }
24
+ if (lastValue === null) return null;
25
+
26
+ const normalised = lastValue
27
+ .trim()
28
+ .replace(/^\[(.*)\]$/, '$1')
29
+ .trim()
30
+ .toLowerCase();
31
+
32
+ if (APPROVED.has(normalised)) return 'approved';
33
+ if (REVISION.has(normalised)) return 'revision';
34
+ return null;
35
+ }
36
+
37
+ module.exports = { parseVerdict };
38
+
39
+ // CLI shim: `node parse-verdict.cjs <path-to-review.md>`
40
+ // stdout: "approved" | "revision" | "unknown"
41
+ // exit codes: 0 approved, 1 revision, 2 unknown/malformed
42
+ if (require.main === module) {
43
+ const fs = require('node:fs');
44
+ const path = process.argv[2];
45
+ if (!path) {
46
+ process.stderr.write('Usage: parse-verdict.cjs <path-to-review.md>\n');
47
+ process.exit(2);
48
+ }
49
+ let contents;
50
+ try {
51
+ contents = fs.readFileSync(path, 'utf8');
52
+ } catch (err) {
53
+ process.stderr.write(`parse-verdict: cannot read ${path}: ${err.message}\n`);
54
+ process.exit(2);
55
+ }
56
+ const verdict = parseVerdict(contents);
57
+ if (verdict === 'approved') {
58
+ process.stdout.write('approved\n');
59
+ process.exit(0);
60
+ }
61
+ if (verdict === 'revision') {
62
+ process.stdout.write('revision\n');
63
+ process.exit(1);
64
+ }
65
+ process.stdout.write('unknown\n');
66
+ process.exit(2);
67
+ }