@unbrained/pm-cli 2026.6.6 → 2026.6.8

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 (600) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +79 -0
  4. package/CONTRIBUTING.md +1 -1
  5. package/README.md +6 -2
  6. package/dist/cli/bootstrap-args.js +30 -13
  7. package/dist/cli/bootstrap-args.js.map +1 -1
  8. package/dist/cli/commander-usage.js +74 -4
  9. package/dist/cli/commander-usage.js.map +1 -1
  10. package/dist/cli/commands/aggregate.d.ts +8 -0
  11. package/dist/cli/commands/aggregate.js +84 -7
  12. package/dist/cli/commands/aggregate.js.map +1 -1
  13. package/dist/cli/commands/calendar.js +10 -3
  14. package/dist/cli/commands/calendar.js.map +1 -1
  15. package/dist/cli/commands/close-many.js +20 -11
  16. package/dist/cli/commands/close-many.js.map +1 -1
  17. package/dist/cli/commands/close.d.ts +1 -1
  18. package/dist/cli/commands/close.js +32 -10
  19. package/dist/cli/commands/close.js.map +1 -1
  20. package/dist/cli/commands/comments-audit.js +4 -3
  21. package/dist/cli/commands/comments-audit.js.map +1 -1
  22. package/dist/cli/commands/completion.js +105 -43
  23. package/dist/cli/commands/completion.js.map +1 -1
  24. package/dist/cli/commands/config.d.ts +5 -4
  25. package/dist/cli/commands/config.js +50 -2
  26. package/dist/cli/commands/config.js.map +1 -1
  27. package/dist/cli/commands/contracts.js +4 -3
  28. package/dist/cli/commands/contracts.js.map +1 -1
  29. package/dist/cli/commands/copy.d.ts +14 -0
  30. package/dist/cli/commands/copy.js +153 -0
  31. package/dist/cli/commands/copy.js.map +1 -0
  32. package/dist/cli/commands/extension/doctor.js +62 -2
  33. package/dist/cli/commands/extension/doctor.js.map +1 -1
  34. package/dist/cli/commands/extension/install-sources.d.ts +8 -0
  35. package/dist/cli/commands/extension/install-sources.js +82 -2
  36. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.js +6 -14
  38. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  39. package/dist/cli/commands/extension.d.ts +29 -0
  40. package/dist/cli/commands/extension.js +61 -2
  41. package/dist/cli/commands/extension.js.map +1 -1
  42. package/dist/cli/commands/gc.js +10 -2
  43. package/dist/cli/commands/gc.js.map +1 -1
  44. package/dist/cli/commands/get.d.ts +9 -0
  45. package/dist/cli/commands/get.js +23 -2
  46. package/dist/cli/commands/get.js.map +1 -1
  47. package/dist/cli/commands/health.js +10 -2
  48. package/dist/cli/commands/health.js.map +1 -1
  49. package/dist/cli/commands/history-compact.d.ts +39 -0
  50. package/dist/cli/commands/history-compact.js +262 -0
  51. package/dist/cli/commands/history-compact.js.map +1 -0
  52. package/dist/cli/commands/index.d.ts +3 -1
  53. package/dist/cli/commands/index.js +5 -3
  54. package/dist/cli/commands/index.js.map +1 -1
  55. package/dist/cli/commands/init.d.ts +1 -0
  56. package/dist/cli/commands/init.js +48 -2
  57. package/dist/cli/commands/init.js.map +1 -1
  58. package/dist/cli/commands/list.d.ts +13 -2
  59. package/dist/cli/commands/list.js +189 -9
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/normalize.js +6 -4
  62. package/dist/cli/commands/normalize.js.map +1 -1
  63. package/dist/cli/commands/reindex.js +8 -4
  64. package/dist/cli/commands/reindex.js.map +1 -1
  65. package/dist/cli/commands/schema.d.ts +13 -2
  66. package/dist/cli/commands/schema.js +66 -12
  67. package/dist/cli/commands/schema.js.map +1 -1
  68. package/dist/cli/commands/search.d.ts +11 -2
  69. package/dist/cli/commands/search.js +321 -35
  70. package/dist/cli/commands/search.js.map +1 -1
  71. package/dist/cli/commands/upgrade.js +4 -12
  72. package/dist/cli/commands/upgrade.js.map +1 -1
  73. package/dist/cli/error-guidance.js +26 -2
  74. package/dist/cli/error-guidance.js.map +1 -1
  75. package/dist/cli/extension-command-help.d.ts +1 -0
  76. package/dist/cli/extension-command-help.js +3 -2
  77. package/dist/cli/extension-command-help.js.map +1 -1
  78. package/dist/cli/help-content.js +10 -2
  79. package/dist/cli/help-content.js.map +1 -1
  80. package/dist/cli/main.d.ts +3 -0
  81. package/dist/cli/main.js +18 -37
  82. package/dist/cli/main.js.map +1 -1
  83. package/dist/cli/register-list-query.js +22 -5
  84. package/dist/cli/register-list-query.js.map +1 -1
  85. package/dist/cli/register-mutation.js +83 -39
  86. package/dist/cli/register-mutation.js.map +1 -1
  87. package/dist/cli/register-operations.js +31 -7
  88. package/dist/cli/register-operations.js.map +1 -1
  89. package/dist/cli/register-setup.js +7 -5
  90. package/dist/cli/register-setup.js.map +1 -1
  91. package/dist/cli/registration-helpers.js +26 -4
  92. package/dist/cli/registration-helpers.js.map +1 -1
  93. package/dist/cli-bundle/chunks/activity-A3QKFSSF.js +16 -0
  94. package/dist/cli-bundle/chunks/{activity-JM6DTDND.js → activity-Q7XMIZIH.js} +11 -11
  95. package/dist/cli-bundle/chunks/{aggregate-VNAHUNNF.js → aggregate-GBSHSXOB.js} +87 -17
  96. package/dist/cli-bundle/chunks/aggregate-GBSHSXOB.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{aggregate-GI7WSZPH.js → aggregate-HKQJZUBG.js} +88 -18
  98. package/dist/cli-bundle/chunks/aggregate-HKQJZUBG.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{append-WMKRXKCE.js → append-3RFOU7P5.js} +8 -8
  100. package/dist/cli-bundle/chunks/{append-7H5N64R2.js → append-OM74OJVT.js} +8 -8
  101. package/dist/cli-bundle/chunks/{chunk-KJE2FOS4.js → chunk-2BYKYPWY.js} +26 -4
  102. package/dist/cli-bundle/chunks/chunk-2BYKYPWY.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js → chunk-2HMD3JM2.js} +6 -6
  104. package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js → chunk-2YPVCD7T.js} +8 -8
  105. package/dist/cli-bundle/chunks/{chunk-3FI4SEFT.js → chunk-3E3MDBTB.js} +62 -38
  106. package/dist/cli-bundle/chunks/chunk-3E3MDBTB.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-U5SXYXSY.js → chunk-3TXWDGPU.js} +287 -45
  108. package/dist/cli-bundle/chunks/chunk-3TXWDGPU.js.map +7 -0
  109. package/dist/cli-bundle/chunks/{chunk-HZGUAH22.js → chunk-4TI3532H.js} +6 -7
  110. package/dist/cli-bundle/chunks/chunk-4TI3532H.js.map +1 -0
  111. package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js → chunk-4WYBLB6J.js} +3 -3
  112. package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js → chunk-5NVJA7IW.js} +7 -7
  113. package/dist/cli-bundle/chunks/{chunk-Q7SPNHLW.js → chunk-5WO2VKFA.js} +190 -16
  114. package/dist/cli-bundle/chunks/chunk-5WO2VKFA.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-IOR7LGF4.js → chunk-7NQIY7Z6.js} +89 -7
  116. package/dist/cli-bundle/chunks/chunk-7NQIY7Z6.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-ECCMVXGM.js → chunk-7WXGR44E.js} +305 -216
  118. package/dist/cli-bundle/chunks/chunk-7WXGR44E.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js → chunk-AEMKH5WQ.js} +3 -3
  120. package/dist/cli-bundle/chunks/{chunk-WOPXVEZP.js → chunk-ALSRBNYB.js} +28 -9
  121. package/dist/cli-bundle/chunks/chunk-ALSRBNYB.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js → chunk-AXBUHLW7.js} +9 -9
  123. package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js → chunk-BFJPMUF5.js} +5 -5
  124. package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js → chunk-BKQMJXWY.js} +3 -3
  125. package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js → chunk-CBJXWXI5.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-FRAUKRU2.js → chunk-D7WK2PKB.js} +36 -15
  127. package/dist/cli-bundle/chunks/chunk-D7WK2PKB.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{chunk-PROOHX4K.js → chunk-DV27WDA7.js} +104 -21
  129. package/dist/cli-bundle/chunks/chunk-DV27WDA7.js.map +7 -0
  130. package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js → chunk-EPWT7BEA.js} +8 -8
  131. package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js +112 -0
  132. package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js.map +1 -0
  133. package/dist/cli-bundle/chunks/{chunk-TPH5XEVD.js → chunk-F33AQIB4.js} +303 -207
  134. package/dist/cli-bundle/chunks/chunk-F33AQIB4.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js → chunk-F33VC5EX.js} +2 -2
  136. package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js → chunk-FGRJZVXD.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js → chunk-FO2TYSQZ.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js → chunk-HOA3GMB6.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js → chunk-HP35AVFS.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js → chunk-J4DKAGTM.js} +3 -3
  141. package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js → chunk-JS47EKLP.js} +7 -7
  142. package/dist/cli-bundle/chunks/{chunk-T3LC5LKB.js → chunk-K62SNVVE.js} +5 -6
  143. package/dist/cli-bundle/chunks/chunk-K62SNVVE.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-GU2ZJ2VV.js → chunk-KBKJVXUS.js} +35 -14
  145. package/dist/cli-bundle/chunks/chunk-KBKJVXUS.js.map +7 -0
  146. package/dist/cli-bundle/chunks/{chunk-KWU6HG75.js → chunk-KCGMABHM.js} +101 -18
  147. package/dist/cli-bundle/chunks/chunk-KCGMABHM.js.map +1 -0
  148. package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js → chunk-KN4WSESY.js} +5 -5
  149. package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js → chunk-KP4KIUQT.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-5FDATVEZ.js → chunk-KS2U7BZ3.js} +71 -17
  151. package/dist/cli-bundle/chunks/chunk-KS2U7BZ3.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-MITFDD35.js → chunk-KVXIQDJG.js} +12 -12
  153. package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js → chunk-L3LYL3ID.js} +12 -12
  154. package/dist/cli-bundle/chunks/{chunk-AO442XLN.js → chunk-M7UBTVFT.js} +10 -6
  155. package/dist/cli-bundle/chunks/{chunk-AO442XLN.js.map → chunk-M7UBTVFT.js.map} +2 -2
  156. package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js → chunk-MSH23UWO.js} +4 -4
  157. package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js → chunk-N4SQZ7L3.js} +2 -2
  158. package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js → chunk-NDSMKB2I.js} +3 -3
  159. package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js → chunk-NGEEXR2R.js} +2 -2
  160. package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js → chunk-NLVCMVC7.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js → chunk-NUKHZZNM.js} +3 -3
  162. package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js → chunk-ODN53S6H.js} +6 -6
  163. package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js → chunk-OTY2YEH5.js} +14 -14
  164. package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js → chunk-OVSSE2JP.js} +8 -8
  165. package/dist/cli-bundle/chunks/{chunk-4LL6TK5B.js → chunk-PQDH3S54.js} +59 -35
  166. package/dist/cli-bundle/chunks/chunk-PQDH3S54.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js → chunk-QF4OPBAG.js} +9 -9
  168. package/dist/cli-bundle/chunks/{chunk-QO7EBBOM.js → chunk-QFVASU44.js} +38 -7
  169. package/dist/cli-bundle/chunks/chunk-QFVASU44.js.map +7 -0
  170. package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js → chunk-QQPZYP73.js} +14 -14
  171. package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js → chunk-QWNUDGFQ.js} +8 -8
  172. package/dist/cli-bundle/chunks/{chunk-AY43SBIN.js → chunk-R4XIE7NQ.js} +54 -8
  173. package/dist/cli-bundle/chunks/chunk-R4XIE7NQ.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-52MAOQ6J.js → chunk-RISLL7XH.js} +71 -17
  175. package/dist/cli-bundle/chunks/chunk-RISLL7XH.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-GCOQW437.js → chunk-SDLEYY6A.js} +3 -3
  177. package/dist/cli-bundle/chunks/{chunk-W7XABV4H.js → chunk-SM3RMWGO.js} +191 -17
  178. package/dist/cli-bundle/chunks/chunk-SM3RMWGO.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js → chunk-TBLBEOEX.js} +9 -9
  180. package/dist/cli-bundle/chunks/{chunk-SKJWX3QB.js → chunk-TXKENAQP.js} +88 -6
  181. package/dist/cli-bundle/chunks/chunk-TXKENAQP.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js → chunk-UEXNNF3K.js} +7 -7
  183. package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js → chunk-UMMJAJB2.js} +9 -9
  184. package/dist/cli-bundle/chunks/chunk-URJEZOLB.js +115 -0
  185. package/dist/cli-bundle/chunks/chunk-URJEZOLB.js.map +7 -0
  186. package/dist/cli-bundle/chunks/{chunk-PDDFYW4X.js → chunk-VXBUXLVD.js} +27 -8
  187. package/dist/cli-bundle/chunks/chunk-VXBUXLVD.js.map +7 -0
  188. package/dist/cli-bundle/chunks/{chunk-LB3RUL2N.js → chunk-XEKZCBCS.js} +10 -6
  189. package/dist/cli-bundle/chunks/chunk-XEKZCBCS.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js → chunk-XLSQ3QLT.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js → chunk-XNGMIVQY.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-TCD3R2PF.js → chunk-XZS4MV37.js} +39 -8
  193. package/dist/cli-bundle/chunks/chunk-XZS4MV37.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js → chunk-YEFOCDIK.js} +7 -7
  195. package/dist/cli-bundle/chunks/{chunk-5SFCOO6B.js → chunk-YJAKN2N2.js} +277 -35
  196. package/dist/cli-bundle/chunks/chunk-YJAKN2N2.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-2VBQ6ZXS.js → chunk-Z2HXAFFH.js} +27 -5
  198. package/dist/cli-bundle/chunks/chunk-Z2HXAFFH.js.map +1 -0
  199. package/dist/cli-bundle/chunks/{chunk-3LB74A67.js → chunk-Z55JACL2.js} +53 -7
  200. package/dist/cli-bundle/chunks/chunk-Z55JACL2.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js → claim-NHBIIBOW.js} +10 -10
  202. package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js → claim-RNEBQCOO.js} +10 -10
  203. package/dist/cli-bundle/chunks/close-UNTFXVM3.js +13 -0
  204. package/dist/cli-bundle/chunks/{close-PTYFA45H.js → close-ZMXL2WDS.js} +8 -8
  205. package/dist/cli-bundle/chunks/{close-many-ERFO6LHR.js → close-many-CDPQGQUB.js} +37 -28
  206. package/dist/cli-bundle/chunks/close-many-CDPQGQUB.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{close-many-7CGIDPTJ.js → close-many-IQV5C2SI.js} +36 -27
  208. package/dist/cli-bundle/chunks/close-many-IQV5C2SI.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js → comments-EFVBHWPT.js} +10 -10
  210. package/dist/cli-bundle/chunks/{comments-OONGABK5.js → comments-J5Q4IJPH.js} +10 -10
  211. package/dist/cli-bundle/chunks/{config-6FXCQKIF.js → config-72253M2O.js} +127 -12
  212. package/dist/cli-bundle/chunks/config-72253M2O.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{config-U4RZ4CQB.js → config-VFYA6BMI.js} +128 -13
  214. package/dist/cli-bundle/chunks/config-VFYA6BMI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{context-FYYJGFWS.js → context-AVLO4IFH.js} +14 -14
  216. package/dist/cli-bundle/chunks/{context-FYYJGFWS.js.map → context-AVLO4IFH.js.map} +2 -2
  217. package/dist/cli-bundle/chunks/{context-YMJ3Z2HQ.js → context-WMSI2D65.js} +15 -15
  218. package/dist/cli-bundle/chunks/context-WMSI2D65.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{contracts-RFSPGVVJ.js → contracts-D4BN3VSQ.js} +7 -5
  220. package/dist/cli-bundle/chunks/contracts-D4BN3VSQ.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{contracts-QDB6OMLQ.js → contracts-RGPOBLPL.js} +8 -6
  222. package/dist/cli-bundle/chunks/contracts-RGPOBLPL.js.map +1 -0
  223. package/dist/cli-bundle/chunks/copy-H6TXHK7S.js +185 -0
  224. package/dist/cli-bundle/chunks/copy-H6TXHK7S.js.map +7 -0
  225. package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js +182 -0
  226. package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js.map +1 -0
  227. package/dist/cli-bundle/chunks/create-EZWAMUKR.js +27 -0
  228. package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js → create-PUAIJEZ7.js} +13 -13
  229. package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js → delete-PKR2JHLH.js} +7 -7
  230. package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js → delete-WBME6WG5.js} +7 -7
  231. package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js → deps-4BQEDV4L.js} +7 -7
  232. package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js → deps-KWHQRO75.js} +7 -7
  233. package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js → docs-364GT3ZR.js} +9 -9
  234. package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js → docs-SCNBUGSV.js} +9 -9
  235. package/dist/cli-bundle/chunks/{extension-VDY2U33M.js → extension-CRE7JM47.js} +8 -6
  236. package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js → extension-KK2UPXJD.js} +8 -6
  237. package/dist/cli-bundle/chunks/{files-ISZJGILQ.js → files-3GESQAWL.js} +9 -9
  238. package/dist/cli-bundle/chunks/{files-WKOD326U.js → files-66EHM5ZR.js} +9 -9
  239. package/dist/cli-bundle/chunks/{gc-JDVJ6OQ2.js → gc-D5IWOKQH.js} +13 -5
  240. package/dist/cli-bundle/chunks/gc-D5IWOKQH.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{gc-ULPVWMTN.js → gc-MOQDND5J.js} +12 -4
  242. package/dist/cli-bundle/chunks/gc-MOQDND5J.js.map +7 -0
  243. package/dist/cli-bundle/chunks/{get-RV37HT3G.js → get-7J2ZCBV5.js} +34 -12
  244. package/dist/cli-bundle/chunks/get-7J2ZCBV5.js.map +1 -0
  245. package/dist/cli-bundle/chunks/{get-WXU6WI5P.js → get-WXSLXV3K.js} +33 -11
  246. package/dist/cli-bundle/chunks/get-WXSLXV3K.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{health-LOI2HHKB.js → health-B6AEM7BV.js} +21 -13
  248. package/dist/cli-bundle/chunks/health-B6AEM7BV.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{health-6L6EH4WR.js → health-YMZGOMVX.js} +20 -12
  250. package/dist/cli-bundle/chunks/health-YMZGOMVX.js.map +7 -0
  251. package/dist/cli-bundle/chunks/{history-PKN67D5O.js → history-TJTO5GCR.js} +10 -10
  252. package/dist/cli-bundle/chunks/history-ZERISU2L.js +20 -0
  253. package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js +290 -0
  254. package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js.map +7 -0
  255. package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js +287 -0
  256. package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js.map +1 -0
  257. package/dist/cli-bundle/chunks/history-redact-GODBYT5A.js +19 -0
  258. package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js → history-redact-JUXUOH54.js} +11 -11
  259. package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js → history-repair-CCCPBNTF.js} +11 -11
  260. package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js → history-repair-TDBBSRVK.js} +11 -11
  261. package/dist/cli-bundle/chunks/{init-P56QYWJF.js → init-6ZPKD3YN.js} +9 -8
  262. package/dist/cli-bundle/chunks/init-CBZHXBR3.js +17 -0
  263. package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js → learnings-U7U2FNIO.js} +10 -10
  264. package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js → learnings-WYNTYQ5T.js} +10 -10
  265. package/dist/cli-bundle/chunks/list-7MTPPZHC.js +20 -0
  266. package/dist/cli-bundle/chunks/{list-FGOWQMSM.js → list-JGP7ODML.js} +10 -10
  267. package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js → notes-P25YVTEG.js} +10 -10
  268. package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js → notes-QIF6A7XS.js} +10 -10
  269. package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js → plan-RACB5PI6.js} +13 -13
  270. package/dist/cli-bundle/chunks/{plan-SLMODHWX.js → plan-SSBJFWXA.js} +13 -13
  271. package/dist/cli-bundle/chunks/{register-list-query-POCFZ5JW.js → register-list-query-5IXDPUZ6.js} +31 -25
  272. package/dist/cli-bundle/chunks/register-list-query-5IXDPUZ6.js.map +1 -0
  273. package/dist/cli-bundle/chunks/{register-list-query-WST76HSQ.js → register-list-query-GQAEIG4K.js} +30 -24
  274. package/dist/cli-bundle/chunks/register-list-query-GQAEIG4K.js.map +7 -0
  275. package/dist/cli-bundle/chunks/{register-mutation-N5GSUZJV.js → register-mutation-FAS4YG63.js} +72 -50
  276. package/dist/cli-bundle/chunks/register-mutation-FAS4YG63.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{register-mutation-OA675SOU.js → register-mutation-YZCUILGO.js} +71 -49
  278. package/dist/cli-bundle/chunks/register-mutation-YZCUILGO.js.map +7 -0
  279. package/dist/cli-bundle/chunks/{register-operations-N3PMHXH5.js → register-operations-IBYWNJN5.js} +57 -34
  280. package/dist/cli-bundle/chunks/register-operations-IBYWNJN5.js.map +7 -0
  281. package/dist/cli-bundle/chunks/{register-operations-GNHBE5I3.js → register-operations-S2BOLUPF.js} +58 -35
  282. package/dist/cli-bundle/chunks/register-operations-S2BOLUPF.js.map +1 -0
  283. package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js → register-setup-ABA2JPWO.js} +20 -19
  284. package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js.map → register-setup-ABA2JPWO.js.map} +2 -2
  285. package/dist/cli-bundle/chunks/{register-setup-JIMPKJKV.js → register-setup-JRZ4UMWZ.js} +21 -20
  286. package/dist/cli-bundle/chunks/register-setup-JRZ4UMWZ.js.map +1 -0
  287. package/dist/cli-bundle/chunks/restore-3JRX27QW.js +17 -0
  288. package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js → restore-K72ZNPEP.js} +11 -11
  289. package/dist/cli-bundle/chunks/{schema-2NOO6NGB.js → schema-3VKRDBLC.js} +76 -20
  290. package/dist/cli-bundle/chunks/schema-3VKRDBLC.js.map +7 -0
  291. package/dist/cli-bundle/chunks/{schema-EBI4NLUO.js → schema-UL4B2JX5.js} +77 -21
  292. package/dist/cli-bundle/chunks/schema-UL4B2JX5.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{search-OA6JX27A.js → search-632WJ7GO.js} +516 -41
  294. package/dist/cli-bundle/chunks/search-632WJ7GO.js.map +7 -0
  295. package/dist/cli-bundle/chunks/{search-JPUQTVCY.js → search-EQDHSE4G.js} +510 -42
  296. package/dist/cli-bundle/chunks/search-EQDHSE4G.js.map +1 -0
  297. package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js → stats-O4UTMJMC.js} +7 -7
  298. package/dist/cli-bundle/chunks/{stats-CV54BAWY.js → stats-WLJ3XBF5.js} +7 -7
  299. package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js → telemetry-EUVHFSQU.js} +4 -4
  300. package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js → telemetry-NRVWX25E.js} +4 -4
  301. package/dist/cli-bundle/chunks/{test-WBROAJIE.js → test-GXUBQNUC.js} +14 -13
  302. package/dist/cli-bundle/chunks/test-XN7RJL5Z.js +32 -0
  303. package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js → test-all-UTFXC7S2.js} +16 -15
  304. package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js.map → test-all-UTFXC7S2.js.map} +1 -1
  305. package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js → test-all-XM6OKI3L.js} +14 -13
  306. package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js.map → test-all-XM6OKI3L.js.map} +1 -1
  307. package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js → test-runs-7FHCPEA3.js} +5 -5
  308. package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js → test-runs-IK6E2HNX.js} +5 -5
  309. package/dist/cli-bundle/chunks/update-LFBSEW3N.js +21 -0
  310. package/dist/cli-bundle/chunks/update-U4B4OMHZ.js +25 -0
  311. package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js → update-many-5KD33MKY.js} +22 -22
  312. package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js → update-many-N3YTM7K4.js} +22 -22
  313. package/dist/cli-bundle/chunks/{upgrade-BLI7XBAJ.js → upgrade-5SRFLUNW.js} +8 -14
  314. package/dist/cli-bundle/chunks/upgrade-5SRFLUNW.js.map +7 -0
  315. package/dist/cli-bundle/chunks/{upgrade-LXPOQKFV.js → upgrade-FFXGO43H.js} +9 -15
  316. package/dist/cli-bundle/chunks/upgrade-FFXGO43H.js.map +1 -0
  317. package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js → validate-CRWXZILW.js} +20 -19
  318. package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js.map → validate-CRWXZILW.js.map} +1 -1
  319. package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js → validate-T3LPWSZG.js} +18 -17
  320. package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js.map → validate-T3LPWSZG.js.map} +1 -1
  321. package/dist/cli-bundle/main.js +160 -87
  322. package/dist/cli-bundle/main.js.map +3 -3
  323. package/dist/core/config/nested-settings.d.ts +8 -8
  324. package/dist/core/config/nested-settings.js +71 -7
  325. package/dist/core/config/nested-settings.js.map +1 -1
  326. package/dist/core/config/positional-value.js +4 -2
  327. package/dist/core/config/positional-value.js.map +1 -1
  328. package/dist/core/diagnostics/remediation.js +7 -2
  329. package/dist/core/diagnostics/remediation.js.map +1 -1
  330. package/dist/core/extensions/extension-types.d.ts +36 -0
  331. package/dist/core/extensions/extension-types.js +2 -2
  332. package/dist/core/extensions/extension-types.js.map +1 -1
  333. package/dist/core/extensions/loader.js +46 -5
  334. package/dist/core/extensions/loader.js.map +1 -1
  335. package/dist/core/fs/fs-utils.js +29 -4
  336. package/dist/core/fs/fs-utils.js.map +1 -1
  337. package/dist/core/history/drift-scan.d.ts +3 -4
  338. package/dist/core/history/drift-scan.js +71 -18
  339. package/dist/core/history/drift-scan.js.map +1 -1
  340. package/dist/core/item/id.js +4 -5
  341. package/dist/core/item/id.js.map +1 -1
  342. package/dist/core/item/item-format.js +7 -3
  343. package/dist/core/item/item-format.js.map +1 -1
  344. package/dist/core/item/toon-decode.d.ts +7 -0
  345. package/dist/core/item/toon-decode.js +11 -2
  346. package/dist/core/item/toon-decode.js.map +1 -1
  347. package/dist/core/item/type-registry.js +25 -7
  348. package/dist/core/item/type-registry.js.map +1 -1
  349. package/dist/core/packages/root.d.ts +10 -0
  350. package/dist/core/packages/root.js +24 -2
  351. package/dist/core/packages/root.js.map +1 -1
  352. package/dist/core/schema/runtime-schema.js +3 -6
  353. package/dist/core/schema/runtime-schema.js.map +1 -1
  354. package/dist/core/search/background-refresh.d.ts +0 -8
  355. package/dist/core/search/background-refresh.js +2 -9
  356. package/dist/core/search/background-refresh.js.map +1 -1
  357. package/dist/core/search/cache.js +5 -3
  358. package/dist/core/search/cache.js.map +1 -1
  359. package/dist/core/search/corpus.d.ts +6 -0
  360. package/dist/core/search/corpus.js +22 -9
  361. package/dist/core/search/corpus.js.map +1 -1
  362. package/dist/core/search/embedding-batches.js +10 -7
  363. package/dist/core/search/embedding-batches.js.map +1 -1
  364. package/dist/core/search/relevance.d.ts +29 -0
  365. package/dist/core/search/relevance.js +226 -0
  366. package/dist/core/search/relevance.js.map +1 -0
  367. package/dist/core/search/vector-stores.d.ts +3 -0
  368. package/dist/core/search/vector-stores.js +27 -16
  369. package/dist/core/search/vector-stores.js.map +1 -1
  370. package/dist/core/sentry/instrument.js +4 -17
  371. package/dist/core/sentry/instrument.js.map +1 -1
  372. package/dist/core/shared/constants.js +15 -2
  373. package/dist/core/shared/constants.js.map +1 -1
  374. package/dist/core/shared/errors.d.ts +6 -0
  375. package/dist/core/shared/errors.js +2 -2
  376. package/dist/core/shared/errors.js.map +1 -1
  377. package/dist/core/shared/primitives.d.ts +8 -0
  378. package/dist/core/shared/primitives.js +29 -2
  379. package/dist/core/shared/primitives.js.map +1 -1
  380. package/dist/core/shared/time.js +42 -6
  381. package/dist/core/shared/time.js.map +1 -1
  382. package/dist/core/store/paths.js +40 -8
  383. package/dist/core/store/paths.js.map +1 -1
  384. package/dist/core/store/settings-validator.d.ts +11 -0
  385. package/dist/core/store/settings-validator.js +14 -2
  386. package/dist/core/store/settings-validator.js.map +1 -1
  387. package/dist/core/store/settings.js +109 -12
  388. package/dist/core/store/settings.js.map +1 -1
  389. package/dist/core/telemetry/runtime.d.ts +1 -0
  390. package/dist/core/telemetry/runtime.js +86 -5
  391. package/dist/core/telemetry/runtime.js.map +1 -1
  392. package/dist/mcp/server.js +109 -19
  393. package/dist/mcp/server.js.map +1 -1
  394. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  395. package/dist/sdk/cli-contracts/commander-types.js +15 -4
  396. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  397. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  398. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  399. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  400. package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
  401. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  402. package/dist/sdk/cli-contracts/tool-parameter-tables.js +32 -3
  403. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  404. package/dist/sdk/cli-contracts.d.ts +3 -1
  405. package/dist/sdk/cli-contracts.js +44 -12
  406. package/dist/sdk/cli-contracts.js.map +1 -1
  407. package/dist/sdk/index.d.ts +2 -2
  408. package/dist/sdk/index.js +3 -3
  409. package/dist/sdk/index.js.map +1 -1
  410. package/dist/sdk/testing.d.ts +51 -1
  411. package/dist/sdk/testing.js +93 -2
  412. package/dist/sdk/testing.js.map +1 -1
  413. package/dist/types.d.ts +14 -0
  414. package/dist/types.js +2 -2
  415. package/dist/types.js.map +1 -1
  416. package/docs/AGENT_GUIDE.md +3 -1
  417. package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
  418. package/docs/CODEX_PLUGIN.md +1 -1
  419. package/docs/COMMANDS.md +14 -5
  420. package/docs/CONFIGURATION.md +28 -1
  421. package/docs/EXTENSIONS.md +17 -9
  422. package/docs/QUICKSTART.md +1 -1
  423. package/docs/RELEASING.md +17 -0
  424. package/docs/SDK.md +66 -0
  425. package/docs/TESTING.md +14 -0
  426. package/marketplace.json +1 -1
  427. package/package.json +2 -1
  428. package/packages/pm-governance-audit/README.md +14 -0
  429. package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
  430. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
  431. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
  432. package/packages/pm-governance-audit/package.json +4 -2
  433. package/packages/pm-lifecycle-hooks/README.md +21 -0
  434. package/packages/pm-search-advanced/README.md +38 -0
  435. package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
  436. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
  437. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
  438. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
  439. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  440. package/plugins/pm-claude/README.md +7 -7
  441. package/plugins/pm-claude/commands/pm-init.md +1 -1
  442. package/plugins/pm-codex/README.md +1 -1
  443. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +0 -16
  444. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +0 -1
  445. package/dist/cli-bundle/chunks/aggregate-VNAHUNNF.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-GU2ZJ2VV.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-QO7EBBOM.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-T3LC5LKB.js.map +0 -7
  468. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +0 -1
  473. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +0 -13
  474. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +0 -7
  475. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +0 -1
  476. package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +0 -1
  477. package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +0 -7
  478. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +0 -1
  479. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +0 -1
  480. package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +0 -7
  481. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +0 -27
  482. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +0 -1
  483. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +0 -7
  484. package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +0 -1
  485. package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +0 -7
  486. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +0 -7
  487. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +0 -1
  488. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +0 -20
  489. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +0 -19
  490. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +0 -16
  491. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +0 -20
  492. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +0 -1
  493. package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +0 -7
  494. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +0 -1
  495. package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +0 -7
  496. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +0 -1
  497. package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +0 -7
  498. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +0 -1
  499. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +0 -17
  500. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +0 -7
  501. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +0 -1
  502. package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +0 -1
  503. package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +0 -7
  504. package/dist/cli-bundle/chunks/test-MXX3E5JL.js +0 -31
  505. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +0 -25
  506. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +0 -21
  507. package/dist/cli-bundle/chunks/upgrade-BLI7XBAJ.js.map +0 -7
  508. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +0 -1
  509. /package/dist/cli-bundle/chunks/{activity-CVXTCHYY.js.map → activity-A3QKFSSF.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{activity-JM6DTDND.js.map → activity-Q7XMIZIH.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{append-WMKRXKCE.js.map → append-3RFOU7P5.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{append-7H5N64R2.js.map → append-OM74OJVT.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js.map → chunk-2HMD3JM2.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js.map → chunk-2YPVCD7T.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js.map → chunk-4WYBLB6J.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js.map → chunk-5NVJA7IW.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js.map → chunk-AEMKH5WQ.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js.map → chunk-AXBUHLW7.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js.map → chunk-BFJPMUF5.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js.map → chunk-BKQMJXWY.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js.map → chunk-CBJXWXI5.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js.map → chunk-EPWT7BEA.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js.map → chunk-F33VC5EX.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js.map → chunk-FGRJZVXD.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js.map → chunk-FO2TYSQZ.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js.map → chunk-HOA3GMB6.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js.map → chunk-HP35AVFS.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js.map → chunk-J4DKAGTM.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js.map → chunk-JS47EKLP.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js.map → chunk-KN4WSESY.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js.map → chunk-KP4KIUQT.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-MITFDD35.js.map → chunk-KVXIQDJG.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js.map → chunk-L3LYL3ID.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js.map → chunk-MSH23UWO.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js.map → chunk-N4SQZ7L3.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js.map → chunk-NDSMKB2I.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js.map → chunk-NGEEXR2R.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js.map → chunk-NLVCMVC7.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js.map → chunk-NUKHZZNM.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js.map → chunk-ODN53S6H.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js.map → chunk-OTY2YEH5.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js.map → chunk-OVSSE2JP.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js.map → chunk-QF4OPBAG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js.map → chunk-QQPZYP73.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js.map → chunk-QWNUDGFQ.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-GCOQW437.js.map → chunk-SDLEYY6A.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js.map → chunk-TBLBEOEX.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js.map → chunk-UEXNNF3K.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js.map → chunk-UMMJAJB2.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js.map → chunk-XLSQ3QLT.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js.map → chunk-XNGMIVQY.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js.map → chunk-YEFOCDIK.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js.map → claim-NHBIIBOW.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js.map → claim-RNEBQCOO.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{close-3HDWDA3L.js.map → close-UNTFXVM3.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{close-PTYFA45H.js.map → close-ZMXL2WDS.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js.map → comments-EFVBHWPT.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{comments-OONGABK5.js.map → comments-J5Q4IJPH.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{create-JTZNCTQC.js.map → create-EZWAMUKR.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js.map → create-PUAIJEZ7.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js.map → delete-PKR2JHLH.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js.map → delete-WBME6WG5.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js.map → deps-4BQEDV4L.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js.map → deps-KWHQRO75.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js.map → docs-364GT3ZR.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js.map → docs-SCNBUGSV.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{extension-VDY2U33M.js.map → extension-CRE7JM47.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js.map → extension-KK2UPXJD.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{files-ISZJGILQ.js.map → files-3GESQAWL.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{files-WKOD326U.js.map → files-66EHM5ZR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{history-PKN67D5O.js.map → history-TJTO5GCR.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{history-2BA3T5AE.js.map → history-ZERISU2L.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{history-redact-JBZNXHGR.js.map → history-redact-GODBYT5A.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js.map → history-redact-JUXUOH54.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js.map → history-repair-CCCPBNTF.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js.map → history-repair-TDBBSRVK.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{init-P56QYWJF.js.map → init-6ZPKD3YN.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{init-HIVSNX3O.js.map → init-CBZHXBR3.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js.map → learnings-U7U2FNIO.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js.map → learnings-WYNTYQ5T.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{list-MUSQNMTD.js.map → list-7MTPPZHC.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{list-FGOWQMSM.js.map → list-JGP7ODML.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js.map → notes-P25YVTEG.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js.map → notes-QIF6A7XS.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js.map → plan-RACB5PI6.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{plan-SLMODHWX.js.map → plan-SSBJFWXA.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{restore-D4RGNX33.js.map → restore-3JRX27QW.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js.map → restore-K72ZNPEP.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js.map → stats-O4UTMJMC.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{stats-CV54BAWY.js.map → stats-WLJ3XBF5.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js.map → telemetry-EUVHFSQU.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js.map → telemetry-NRVWX25E.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{test-WBROAJIE.js.map → test-GXUBQNUC.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{test-MXX3E5JL.js.map → test-XN7RJL5Z.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js.map → test-runs-7FHCPEA3.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js.map → test-runs-IK6E2HNX.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-YRXSUGYQ.js.map → update-LFBSEW3N.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{update-OSV3NAQB.js.map → update-U4B4OMHZ.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js.map → update-many-5KD33MKY.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js.map → update-many-N3YTM7K4.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"extension-command-help.js","sources":["cli/extension-command-help.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\nimport type {\n RegisteredExtensionCommandDefinition,\n RegisteredExtensionFlagDefinitions,\n} from \"../core/extensions/index.js\";\n\nexport interface ExtensionCommandArgumentHelpDescriptor {\n name: string;\n required: boolean;\n variadic: boolean;\n description?: string;\n}\n\nexport interface ExtensionCommandHelpDescriptor {\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentHelpDescriptor[];\n flags: Array<Record<string, unknown>>;\n source?: {\n layer: \"global\" | \"project\";\n name: string;\n };\n}\n\nexport interface HelpOptionSummary {\n flags: string;\n long: string | null;\n short: string | null;\n description: string;\n takes_value: boolean;\n value_required: boolean;\n value_name: string | null;\n variadic: boolean;\n required: boolean;\n aliases: string[];\n alias_for: string | null;\n default_value?: unknown;\n}\n\nexport function normalizeExtensionCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction toNonEmptyFlagString(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : null;\n}\n\nfunction toOptionalBoolean(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction formatDynamicExtensionFlagHelpLine(definition: Record<string, unknown>): string | null {\n const visible = toOptionalBoolean(definition.visible);\n if (visible === false) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n if (!longName || !longName.startsWith(\"--\") || longName.length < 3) {\n return null;\n }\n\n const shortName = toNonEmptyFlagString(definition.short);\n const shortPrefix = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? `${shortName}, ` : \"\";\n const valueName = toNonEmptyFlagString(definition.value_name);\n const valueSuffix = valueName ? ` <${valueName}>` : \"\";\n const description = toNonEmptyFlagString(definition.description) ?? \"Extension-provided option.\";\n const markers: string[] = [];\n if (toOptionalBoolean(definition.required) === true) {\n markers.push(\"required\");\n }\n if (toOptionalBoolean(definition.enabled) === false) {\n markers.push(\"disabled\");\n }\n const markerSuffix = markers.length > 0 ? ` [${markers.join(\", \")}]` : \"\";\n return `${shortPrefix}${longName}${valueSuffix} ${description}${markerSuffix}`;\n}\n\nfunction buildDynamicExtensionFlagHelp(definitions: Array<Record<string, unknown>>): string | null {\n const lines = [\n ...new Set(\n definitions\n .map(formatDynamicExtensionFlagHelpLine)\n .filter((line): line is string => line !== null),\n ),\n ].sort((left, right) => left.localeCompare(right));\n if (lines.length === 0) {\n return null;\n }\n return `\\nExtension-provided flags:\\n ${lines.join(\"\\n \")}`;\n}\n\nexport function collectDynamicExtensionFlagHelpByCommand(\n registrations: RegisteredExtensionFlagDefinitions[],\n): Map<string, string> {\n const grouped = new Map<string, Array<Record<string, unknown>>>();\n for (const registration of registrations) {\n const commandPath = normalizeExtensionCommandPath(registration.target_command);\n if (commandPath.length === 0) {\n continue;\n }\n const existing = grouped.get(commandPath) ?? [];\n existing.push(...registration.flags);\n grouped.set(commandPath, existing);\n }\n\n const entries = [...grouped.entries()].sort(([left], [right]) => left.localeCompare(right));\n const helpByCommand = new Map<string, string>();\n for (const [commandPath, definitions] of entries) {\n const helpText = buildDynamicExtensionFlagHelp(definitions);\n if (!helpText) {\n continue;\n }\n helpByCommand.set(commandPath, helpText);\n }\n return helpByCommand;\n}\n\nfunction normalizeExtensionCommandAction(commandPath: string, action: string | undefined): string {\n if (typeof action !== \"string\" || action.trim().length === 0) {\n return commandPath.replace(/\\s+/g, \"-\");\n }\n return action.trim().toLowerCase();\n}\n\nfunction normalizeExtensionCommandStringList(values: string[] | undefined): string[] {\n if (!Array.isArray(values)) {\n return [];\n }\n const normalized: string[] = [];\n const seen = new Set<string>();\n for (const value of values) {\n if (typeof value !== \"string\") {\n continue;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0 || seen.has(trimmed)) {\n continue;\n }\n seen.add(trimmed);\n normalized.push(trimmed);\n }\n return normalized;\n}\n\nfunction normalizeExtensionCommandArguments(\n values: Array<{ name?: unknown; required?: unknown; variadic?: unknown; description?: unknown }> | undefined,\n): ExtensionCommandArgumentHelpDescriptor[] {\n if (!Array.isArray(values)) {\n return [];\n }\n return values\n .map((value) => {\n const name = typeof value.name === \"string\" ? value.name.trim() : \"\";\n if (name.length === 0) {\n return null;\n }\n const normalized: ExtensionCommandArgumentHelpDescriptor = {\n name,\n required: value.required === true,\n variadic: value.variadic === true,\n };\n if (typeof value.description === \"string\" && value.description.trim().length > 0) {\n normalized.description = value.description.trim();\n }\n return normalized;\n })\n .filter((entry): entry is ExtensionCommandArgumentHelpDescriptor => entry !== null);\n}\n\nexport function collectExtensionCommandHelpDescriptors(\n commandHandlers: string[],\n commandDefinitions: RegisteredExtensionCommandDefinition[],\n flagRegistrations: RegisteredExtensionFlagDefinitions[],\n): Map<string, ExtensionCommandHelpDescriptor> {\n const definitionsByCommand = new Map<string, ExtensionCommandHelpDescriptor>();\n for (const definition of commandDefinitions) {\n const commandPath = normalizeExtensionCommandPath(definition.command);\n if (commandPath.length === 0) {\n continue;\n }\n const description =\n typeof definition.description === \"string\" && definition.description.trim().length > 0\n ? definition.description.trim()\n : undefined;\n const intent =\n typeof definition.intent === \"string\" && definition.intent.trim().length > 0\n ? definition.intent.trim()\n : undefined;\n definitionsByCommand.set(commandPath, {\n command: commandPath,\n action: normalizeExtensionCommandAction(commandPath, definition.action),\n description,\n intent,\n examples: normalizeExtensionCommandStringList(definition.examples),\n failure_hints: normalizeExtensionCommandStringList(definition.failure_hints),\n arguments: normalizeExtensionCommandArguments(definition.arguments),\n flags: [],\n source: {\n layer: definition.layer,\n name: definition.name,\n },\n });\n }\n\n const flagsByCommand = new Map<string, Array<Record<string, unknown>>>();\n for (const registration of flagRegistrations) {\n const commandPath = normalizeExtensionCommandPath(registration.target_command);\n if (commandPath.length === 0) {\n continue;\n }\n const existing = flagsByCommand.get(commandPath) ?? [];\n existing.push(...registration.flags);\n flagsByCommand.set(commandPath, existing);\n }\n\n const commandSet = new Set<string>();\n for (const commandPath of commandHandlers) {\n const normalized = normalizeExtensionCommandPath(commandPath);\n if (normalized.length > 0) {\n commandSet.add(normalized);\n }\n }\n for (const commandPath of definitionsByCommand.keys()) {\n commandSet.add(commandPath);\n }\n for (const commandPath of flagsByCommand.keys()) {\n commandSet.add(commandPath);\n }\n\n const descriptors = new Map<string, ExtensionCommandHelpDescriptor>();\n const sortedCommands = [...commandSet].sort((left, right) => left.localeCompare(right));\n for (const commandPath of sortedCommands) {\n const definition = definitionsByCommand.get(commandPath);\n const flags = flagsByCommand.get(commandPath) ?? [];\n if (definition) {\n descriptors.set(commandPath, {\n ...definition,\n flags,\n });\n continue;\n }\n descriptors.set(commandPath, {\n command: commandPath,\n action: normalizeExtensionCommandAction(commandPath, undefined),\n examples: [],\n failure_hints: [],\n arguments: [],\n flags,\n });\n }\n\n return descriptors;\n}\n\nfunction buildExtensionArgumentToken(argument: ExtensionCommandArgumentHelpDescriptor): string {\n const variadicSuffix = argument.variadic ? \"...\" : \"\";\n if (argument.required) {\n return `<${argument.name}${variadicSuffix}>`;\n }\n return `[${argument.name}${variadicSuffix}]`;\n}\n\nexport function applyDynamicExtensionArguments(command: Command, descriptor: ExtensionCommandHelpDescriptor): void {\n for (const argument of descriptor.arguments) {\n command.argument(buildExtensionArgumentToken(argument), argument.description ?? \"Extension argument.\");\n }\n}\n\nfunction formatDynamicExtensionOptionFlags(definition: Record<string, unknown>): string | null {\n const visible = toOptionalBoolean(definition.visible);\n if (visible === false) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n const shortName = toNonEmptyFlagString(definition.short);\n const normalizedShort = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? shortName : null;\n const normalizedLong = longName && longName.startsWith(\"--\") && longName.length > 2 ? longName : null;\n if (!normalizedLong && !normalizedShort) {\n return null;\n }\n const optionValueName = toNonEmptyFlagString(definition.value_name);\n const optionValueSuffix = optionValueName ? ` <${optionValueName}>` : \"\";\n const optionNames = [normalizedShort, normalizedLong].filter((entry): entry is string => entry !== null);\n return `${optionNames.join(\", \")}${optionValueSuffix}`;\n}\n\nfunction formatDynamicExtensionOptionDescription(definition: Record<string, unknown>): string {\n const description = toNonEmptyFlagString(definition.description) ?? \"Extension-provided option.\";\n const markers: string[] = [];\n if (toOptionalBoolean(definition.required) === true) {\n markers.push(\"required\");\n }\n if (toOptionalBoolean(definition.enabled) === false) {\n markers.push(\"disabled\");\n }\n const markerSuffix = markers.length > 0 ? ` [${markers.join(\", \")}]` : \"\";\n return `${description}${markerSuffix}`;\n}\n\nfunction buildDynamicExtensionHelpOptionSummary(definition: Record<string, unknown>): HelpOptionSummary | null {\n const flags = formatDynamicExtensionOptionFlags(definition);\n if (!flags) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n const shortName = toNonEmptyFlagString(definition.short);\n const normalizedLong = longName && longName.startsWith(\"--\") && longName.length > 2 ? longName : null;\n const normalizedShort = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? shortName : null;\n const valueName = toNonEmptyFlagString(definition.value_name);\n const required = toOptionalBoolean(definition.required) === true;\n return {\n flags,\n long: normalizedLong,\n short: normalizedShort,\n description: formatDynamicExtensionOptionDescription(definition),\n takes_value: valueName !== null,\n value_required: valueName !== null,\n value_name: valueName,\n variadic: false,\n required,\n aliases: [],\n alias_for: null,\n };\n}\n\nexport function buildDynamicExtensionHelpOptionSummaries(descriptor: ExtensionCommandHelpDescriptor | undefined): HelpOptionSummary[] {\n if (!descriptor) {\n return [];\n }\n const summaries: HelpOptionSummary[] = [];\n const seen = new Set<string>();\n for (const definition of descriptor.flags) {\n const summary = buildDynamicExtensionHelpOptionSummary(definition);\n if (!summary || seen.has(summary.flags)) {\n continue;\n }\n seen.add(summary.flags);\n summaries.push(summary);\n }\n return summaries;\n}\n\nexport function mergeHelpOptionSummaries(base: HelpOptionSummary[], extension: HelpOptionSummary[]): HelpOptionSummary[] {\n if (extension.length === 0) {\n return base;\n }\n const merged = [...base];\n const seen = new Set(base.map((entry) => entry.flags));\n for (const entry of extension) {\n if (seen.has(entry.flags)) {\n continue;\n }\n seen.add(entry.flags);\n merged.push(entry);\n }\n return merged;\n}\n\nexport function buildDynamicExtensionCommandMetadataHelp(descriptor: ExtensionCommandHelpDescriptor): string | null {\n const lines: string[] = [];\n if (descriptor.intent) {\n lines.push(`Intent: ${descriptor.intent}`);\n }\n if (descriptor.action) {\n lines.push(`Action contract: ${descriptor.action}`);\n }\n if (descriptor.examples.length > 0) {\n lines.push(\"Examples:\");\n for (const example of descriptor.examples) {\n lines.push(` - ${example}`);\n }\n }\n if (descriptor.failure_hints.length > 0) {\n lines.push(\"Common failure hints:\");\n for (const hint of descriptor.failure_hints) {\n lines.push(` - ${hint}`);\n }\n }\n if (lines.length === 0) {\n return null;\n }\n return `\\nExtension command metadata:\\n ${lines.join(\"\\n \")}`;\n}\n\nexport function commandAliases(command: Command): string[] {\n const commandRecord = command as unknown as {\n aliases?: () => string[];\n alias?: () => string | undefined;\n _aliases?: string[];\n };\n if (typeof commandRecord.aliases === \"function\") {\n return commandRecord.aliases().map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);\n }\n if (typeof commandRecord.alias === \"function\") {\n const alias = commandRecord.alias();\n if (typeof alias === \"string\" && alias.trim().length > 0) {\n return [alias.trim().toLowerCase()];\n }\n }\n if (Array.isArray(commandRecord._aliases)) {\n return commandRecord._aliases.map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);\n }\n return [];\n}\n\nexport function findDirectChildCommand(parent: Command, name: string): Command | null {\n const normalizedTarget = name.trim().toLowerCase();\n return (\n parent.commands.find((entry) => {\n if (entry.name().trim().toLowerCase() === normalizedTarget) {\n return true;\n }\n return commandAliases(entry).includes(normalizedTarget);\n }) ?? null\n );\n}\n\nexport function findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nexport function ensureCommandPath(root: Command, pathParts: string[]): Command | null {\n if (pathParts.length === 0) {\n return null;\n }\n\n let current: Command = root;\n for (let index = 0; index < pathParts.length; index += 1) {\n const part = pathParts[index];\n const existing = findDirectChildCommand(current, part);\n if (existing) {\n current = existing;\n continue;\n }\n\n const created = current.command(part);\n if (index < pathParts.length - 1) {\n created.description(\"Extension-provided command group.\");\n } else {\n created.description(\"Extension-provided command path.\");\n }\n current = created;\n }\n\n return current;\n}\n"],"names":[],"mappings":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OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAa,EAAE,SAAmB;IAClE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,GAAY,IAAI,CAAC;IAC5B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,GAAG,QAAQ,CAAC;YACnB,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,GAAG,OAAO,CAAC;IACpB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","debugId":"f118ae9c-7572-5edd-9647-3be1fe888f91"}
1
+ {"version":3,"file":"extension-command-help.js","sources":["cli/extension-command-help.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\nimport type {\n RegisteredExtensionCommandDefinition,\n RegisteredExtensionFlagDefinitions,\n} from \"../core/extensions/index.js\";\n\nexport interface ExtensionCommandArgumentHelpDescriptor {\n name: string;\n required: boolean;\n variadic: boolean;\n description?: string;\n}\n\nexport interface ExtensionCommandHelpDescriptor {\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentHelpDescriptor[];\n flags: Array<Record<string, unknown>>;\n source?: {\n layer: \"global\" | \"project\";\n name: string;\n package?: string;\n };\n}\n\nexport interface HelpOptionSummary {\n flags: string;\n long: string | null;\n short: string | null;\n description: string;\n takes_value: boolean;\n value_required: boolean;\n value_name: string | null;\n variadic: boolean;\n required: boolean;\n aliases: string[];\n alias_for: string | null;\n default_value?: unknown;\n}\n\nexport function normalizeExtensionCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction toNonEmptyFlagString(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : null;\n}\n\nfunction toOptionalBoolean(value: unknown): boolean | undefined {\n return typeof value === \"boolean\" ? value : undefined;\n}\n\nfunction formatDynamicExtensionFlagHelpLine(definition: Record<string, unknown>): string | null {\n const visible = toOptionalBoolean(definition.visible);\n if (visible === false) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n if (!longName || !longName.startsWith(\"--\") || longName.length < 3) {\n return null;\n }\n\n const shortName = toNonEmptyFlagString(definition.short);\n const shortPrefix = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? `${shortName}, ` : \"\";\n const valueName = toNonEmptyFlagString(definition.value_name);\n const valueSuffix = valueName ? ` <${valueName}>` : \"\";\n const description = toNonEmptyFlagString(definition.description) ?? \"Extension-provided option.\";\n const markers: string[] = [];\n if (toOptionalBoolean(definition.required) === true) {\n markers.push(\"required\");\n }\n if (toOptionalBoolean(definition.enabled) === false) {\n markers.push(\"disabled\");\n }\n const markerSuffix = markers.length > 0 ? ` [${markers.join(\", \")}]` : \"\";\n return `${shortPrefix}${longName}${valueSuffix} ${description}${markerSuffix}`;\n}\n\nfunction buildDynamicExtensionFlagHelp(definitions: Array<Record<string, unknown>>): string | null {\n const lines = [\n ...new Set(\n definitions\n .map(formatDynamicExtensionFlagHelpLine)\n .filter((line): line is string => line !== null),\n ),\n ].sort((left, right) => left.localeCompare(right));\n if (lines.length === 0) {\n return null;\n }\n return `\\nExtension-provided flags:\\n ${lines.join(\"\\n \")}`;\n}\n\nexport function collectDynamicExtensionFlagHelpByCommand(\n registrations: RegisteredExtensionFlagDefinitions[],\n): Map<string, string> {\n const grouped = new Map<string, Array<Record<string, unknown>>>();\n for (const registration of registrations) {\n const commandPath = normalizeExtensionCommandPath(registration.target_command);\n if (commandPath.length === 0) {\n continue;\n }\n const existing = grouped.get(commandPath) ?? [];\n existing.push(...registration.flags);\n grouped.set(commandPath, existing);\n }\n\n const entries = [...grouped.entries()].sort(([left], [right]) => left.localeCompare(right));\n const helpByCommand = new Map<string, string>();\n for (const [commandPath, definitions] of entries) {\n const helpText = buildDynamicExtensionFlagHelp(definitions);\n if (!helpText) {\n continue;\n }\n helpByCommand.set(commandPath, helpText);\n }\n return helpByCommand;\n}\n\nfunction normalizeExtensionCommandAction(commandPath: string, action: string | undefined): string {\n if (typeof action !== \"string\" || action.trim().length === 0) {\n return commandPath.replace(/\\s+/g, \"-\");\n }\n return action.trim().toLowerCase();\n}\n\nfunction normalizeExtensionCommandStringList(values: string[] | undefined): string[] {\n if (!Array.isArray(values)) {\n return [];\n }\n const normalized: string[] = [];\n const seen = new Set<string>();\n for (const value of values) {\n if (typeof value !== \"string\") {\n continue;\n }\n const trimmed = value.trim();\n if (trimmed.length === 0 || seen.has(trimmed)) {\n continue;\n }\n seen.add(trimmed);\n normalized.push(trimmed);\n }\n return normalized;\n}\n\nfunction normalizeExtensionCommandArguments(\n values: Array<{ name?: unknown; required?: unknown; variadic?: unknown; description?: unknown }> | undefined,\n): ExtensionCommandArgumentHelpDescriptor[] {\n if (!Array.isArray(values)) {\n return [];\n }\n return values\n .map((value) => {\n const name = typeof value.name === \"string\" ? value.name.trim() : \"\";\n if (name.length === 0) {\n return null;\n }\n const normalized: ExtensionCommandArgumentHelpDescriptor = {\n name,\n required: value.required === true,\n variadic: value.variadic === true,\n };\n if (typeof value.description === \"string\" && value.description.trim().length > 0) {\n normalized.description = value.description.trim();\n }\n return normalized;\n })\n .filter((entry): entry is ExtensionCommandArgumentHelpDescriptor => entry !== null);\n}\n\nexport function collectExtensionCommandHelpDescriptors(\n commandHandlers: string[],\n commandDefinitions: RegisteredExtensionCommandDefinition[],\n flagRegistrations: RegisteredExtensionFlagDefinitions[],\n): Map<string, ExtensionCommandHelpDescriptor> {\n const definitionsByCommand = new Map<string, ExtensionCommandHelpDescriptor>();\n for (const definition of commandDefinitions) {\n const commandPath = normalizeExtensionCommandPath(definition.command);\n if (commandPath.length === 0) {\n continue;\n }\n const description =\n typeof definition.description === \"string\" && definition.description.trim().length > 0\n ? definition.description.trim()\n : undefined;\n const intent =\n typeof definition.intent === \"string\" && definition.intent.trim().length > 0\n ? definition.intent.trim()\n : undefined;\n definitionsByCommand.set(commandPath, {\n command: commandPath,\n action: normalizeExtensionCommandAction(commandPath, definition.action),\n description,\n intent,\n examples: normalizeExtensionCommandStringList(definition.examples),\n failure_hints: normalizeExtensionCommandStringList(definition.failure_hints),\n arguments: normalizeExtensionCommandArguments(definition.arguments),\n flags: [],\n source: {\n layer: definition.layer,\n name: definition.name,\n package: definition.source_package,\n },\n });\n }\n\n const flagsByCommand = new Map<string, Array<Record<string, unknown>>>();\n for (const registration of flagRegistrations) {\n const commandPath = normalizeExtensionCommandPath(registration.target_command);\n if (commandPath.length === 0) {\n continue;\n }\n const existing = flagsByCommand.get(commandPath) ?? [];\n existing.push(...registration.flags);\n flagsByCommand.set(commandPath, existing);\n }\n\n const commandSet = new Set<string>();\n for (const commandPath of commandHandlers) {\n const normalized = normalizeExtensionCommandPath(commandPath);\n if (normalized.length > 0) {\n commandSet.add(normalized);\n }\n }\n for (const commandPath of definitionsByCommand.keys()) {\n commandSet.add(commandPath);\n }\n for (const commandPath of flagsByCommand.keys()) {\n commandSet.add(commandPath);\n }\n\n const descriptors = new Map<string, ExtensionCommandHelpDescriptor>();\n const sortedCommands = [...commandSet].sort((left, right) => left.localeCompare(right));\n for (const commandPath of sortedCommands) {\n const definition = definitionsByCommand.get(commandPath);\n const flags = flagsByCommand.get(commandPath) ?? [];\n if (definition) {\n descriptors.set(commandPath, {\n ...definition,\n flags,\n });\n continue;\n }\n descriptors.set(commandPath, {\n command: commandPath,\n action: normalizeExtensionCommandAction(commandPath, undefined),\n examples: [],\n failure_hints: [],\n arguments: [],\n flags,\n });\n }\n\n return descriptors;\n}\n\nfunction buildExtensionArgumentToken(argument: ExtensionCommandArgumentHelpDescriptor): string {\n const variadicSuffix = argument.variadic ? \"...\" : \"\";\n if (argument.required) {\n return `<${argument.name}${variadicSuffix}>`;\n }\n return `[${argument.name}${variadicSuffix}]`;\n}\n\nexport function applyDynamicExtensionArguments(command: Command, descriptor: ExtensionCommandHelpDescriptor): void {\n for (const argument of descriptor.arguments) {\n command.argument(buildExtensionArgumentToken(argument), argument.description ?? \"Extension argument.\");\n }\n}\n\nfunction formatDynamicExtensionOptionFlags(definition: Record<string, unknown>): string | null {\n const visible = toOptionalBoolean(definition.visible);\n if (visible === false) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n const shortName = toNonEmptyFlagString(definition.short);\n const normalizedShort = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? shortName : null;\n const normalizedLong = longName && longName.startsWith(\"--\") && longName.length > 2 ? longName : null;\n if (!normalizedLong && !normalizedShort) {\n return null;\n }\n const optionValueName = toNonEmptyFlagString(definition.value_name);\n const optionValueSuffix = optionValueName ? ` <${optionValueName}>` : \"\";\n const optionNames = [normalizedShort, normalizedLong].filter((entry): entry is string => entry !== null);\n return `${optionNames.join(\", \")}${optionValueSuffix}`;\n}\n\nfunction formatDynamicExtensionOptionDescription(definition: Record<string, unknown>): string {\n const description = toNonEmptyFlagString(definition.description) ?? \"Extension-provided option.\";\n const markers: string[] = [];\n if (toOptionalBoolean(definition.required) === true) {\n markers.push(\"required\");\n }\n if (toOptionalBoolean(definition.enabled) === false) {\n markers.push(\"disabled\");\n }\n const markerSuffix = markers.length > 0 ? ` [${markers.join(\", \")}]` : \"\";\n return `${description}${markerSuffix}`;\n}\n\nfunction buildDynamicExtensionHelpOptionSummary(definition: Record<string, unknown>): HelpOptionSummary | null {\n const flags = formatDynamicExtensionOptionFlags(definition);\n if (!flags) {\n return null;\n }\n const longName = toNonEmptyFlagString(definition.long);\n const shortName = toNonEmptyFlagString(definition.short);\n const normalizedLong = longName && longName.startsWith(\"--\") && longName.length > 2 ? longName : null;\n const normalizedShort = shortName && shortName.startsWith(\"-\") && !shortName.startsWith(\"--\") ? shortName : null;\n const valueName = toNonEmptyFlagString(definition.value_name);\n const required = toOptionalBoolean(definition.required) === true;\n return {\n flags,\n long: normalizedLong,\n short: normalizedShort,\n description: formatDynamicExtensionOptionDescription(definition),\n takes_value: valueName !== null,\n value_required: valueName !== null,\n value_name: valueName,\n variadic: false,\n required,\n aliases: [],\n alias_for: null,\n };\n}\n\nexport function buildDynamicExtensionHelpOptionSummaries(descriptor: ExtensionCommandHelpDescriptor | undefined): HelpOptionSummary[] {\n if (!descriptor) {\n return [];\n }\n const summaries: HelpOptionSummary[] = [];\n const seen = new Set<string>();\n for (const definition of descriptor.flags) {\n const summary = buildDynamicExtensionHelpOptionSummary(definition);\n if (!summary || seen.has(summary.flags)) {\n continue;\n }\n seen.add(summary.flags);\n summaries.push(summary);\n }\n return summaries;\n}\n\nexport function mergeHelpOptionSummaries(base: HelpOptionSummary[], extension: HelpOptionSummary[]): HelpOptionSummary[] {\n if (extension.length === 0) {\n return base;\n }\n const merged = [...base];\n const seen = new Set(base.map((entry) => entry.flags));\n for (const entry of extension) {\n if (seen.has(entry.flags)) {\n continue;\n }\n seen.add(entry.flags);\n merged.push(entry);\n }\n return merged;\n}\n\nexport function buildDynamicExtensionCommandMetadataHelp(descriptor: ExtensionCommandHelpDescriptor): string | null {\n const lines: string[] = [];\n if (descriptor.intent) {\n lines.push(`Intent: ${descriptor.intent}`);\n }\n if (descriptor.action) {\n lines.push(`Action contract: ${descriptor.action}`);\n }\n if (descriptor.examples.length > 0) {\n lines.push(\"Examples:\");\n for (const example of descriptor.examples) {\n lines.push(` - ${example}`);\n }\n }\n if (descriptor.failure_hints.length > 0) {\n lines.push(\"Common failure hints:\");\n for (const hint of descriptor.failure_hints) {\n lines.push(` - ${hint}`);\n }\n }\n if (lines.length === 0) {\n return null;\n }\n return `\\nExtension command metadata:\\n ${lines.join(\"\\n \")}`;\n}\n\nexport function commandAliases(command: Command): string[] {\n const commandRecord = command as unknown as {\n aliases?: () => string[];\n alias?: () => string | undefined;\n _aliases?: string[];\n };\n if (typeof commandRecord.aliases === \"function\") {\n return commandRecord.aliases().map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);\n }\n if (typeof commandRecord.alias === \"function\") {\n const alias = commandRecord.alias();\n if (typeof alias === \"string\" && alias.trim().length > 0) {\n return [alias.trim().toLowerCase()];\n }\n }\n if (Array.isArray(commandRecord._aliases)) {\n return commandRecord._aliases.map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);\n }\n return [];\n}\n\nexport function findDirectChildCommand(parent: Command, name: string): Command | null {\n const normalizedTarget = name.trim().toLowerCase();\n return (\n parent.commands.find((entry) => {\n if (entry.name().trim().toLowerCase() === normalizedTarget) {\n return true;\n }\n return commandAliases(entry).includes(normalizedTarget);\n }) ?? null\n );\n}\n\nexport function findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nexport function ensureCommandPath(root: Command, pathParts: string[]): Command | null {\n if (pathParts.length === 0) {\n return null;\n }\n\n let current: Command = root;\n for (let index = 0; index < pathParts.length; index += 1) {\n const part = pathParts[index];\n const existing = findDirectChildCommand(current, part);\n if (existing) {\n current = existing;\n continue;\n }\n\n const created = current.command(part);\n if (index < pathParts.length - 1) {\n created.description(\"Extension-provided command group.\");\n } else {\n created.description(\"Extension-provided command path.\");\n }\n current = created;\n }\n\n return current;\n}\n"],"names":[],"mappings":";;AA4CA,MAAM,UAAU,6BAA6B,CAAC,WAAmB;IAC/D,OAAO,WAAW;SACf,IAAI,EAAE;SACN,WAAW,EAAE;SACb,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC;AAED,SAAS,kCAAkC,CAAC,UAAmC;IAC7E,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnE,OAAO,IAAI,CAA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ined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="74a0432a-8374-53db-8e95-5ebd38cf8557")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ad4ec245-86cd-551a-814a-482b7a2442b8")}catch(e){}}();
3
3
  function renderCompactHelpBundle(bundle) {
4
4
  const lines = [
5
5
  "",
@@ -460,6 +460,14 @@ const HELP_BY_COMMAND_PATH = {
460
460
  why: "Inspects item mutation timeline and audit trail.",
461
461
  examples: ["pm history pm-a1b2 --limit 20", "pm history pm-a1b2 --full --verify"],
462
462
  },
463
+ "history-compact": {
464
+ why: "Compacts long history streams into a synthetic checkpoint while preserving replay integrity.",
465
+ examples: [
466
+ "pm history-compact pm-a1b2 --dry-run",
467
+ "pm history-compact pm-a1b2 --before 25 --author codex-agent --message \"Compact early history\"",
468
+ "pm history-compact pm-a1b2 --before 2026-06-01T00:00:00.000Z",
469
+ ],
470
+ },
463
471
  activity: {
464
472
  why: "Reviews recent tracker-wide activity across items.",
465
473
  examples: [
@@ -721,4 +729,4 @@ export function attachRichHelpText(program, argv = process.argv.slice(2)) {
721
729
  }
722
730
  }
723
731
  //# sourceMappingURL=help-content.js.map
724
- //# debugId=74a0432a-8374-53db-8e95-5ebd38cf8557
732
+ //# debugId=ad4ec245-86cd-551a-814a-482b7a2442b8
@@ -1 +1 @@
1
- {"version":3,"file":"help-content.js","sources":["cli/help-content.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: [\n \"pm init\",\n \"pm init acme\",\n \"pm init --preset minimal\",\n \"pm init --agent-guidance add\",\n \"pm init --defaults --with-packages\",\n ],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n \"Use --agent-guidance add to inject compact AGENTS/CLAUDE workflow guidance, or --agent-guidance status to inspect missing guidance without modifying files.\",\n \"Use --with-packages when agents need bundled commands such as calendar and templates available immediately.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.\",\n examples: [\n \"pm install ./my-package --project\",\n \"pm install '*' --project\",\n \"pm package doctor --project --detail summary\",\n \"pm package manage --global\",\n \"pm package activate sample-ext --project\",\n \"pm package deactivate sample-ext --project\",\n \"pm package uninstall sample-ext --global\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n ],\n tips: [\n \"Prefer pm install and pm package in new user-facing automation.\",\n \"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n package: {\n why:\n \"Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.\",\n examples: [\n \"pm install npm:@scope/pm-package --project\",\n \"pm package install ./my-package --project\",\n \"pm package doctor --project --detail deep\",\n \"pm package manage --project --runtime-probe\",\n \"pm package activate sample-ext --project\",\n \"pm upgrade --packages-only --dry-run\",\n ],\n tips: [\n \"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.\",\n \"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.\",\n \"Use --dry-run before upgrade when automation needs a deterministic plan.\",\n ],\n },\n \"package init\": {\n why: \"Generates an installable starter pm package with package metadata and a root extension entrypoint.\",\n examples: [\n \"pm package init ./my-package\",\n \"pm install ./my-package --project\",\n \"pm package doctor --project --detail summary\",\n ],\n tips: [\n \"The generated package is local-install safe; add SDK runtime imports only after declaring dependencies and validating with package doctor.\",\n \"Use package doctor after changes to verify activation, policy, and collision diagnostics.\",\n ],\n },\n \"package install\": {\n why: \"Installs pm packages from local paths, npm sources, GitHub sources, bundled aliases, or wildcard/all aliases.\",\n examples: [\n \"pm package install ./my-package --project\",\n \"pm install npm:pm-changelog --project\",\n \"pm package install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\n \"Prefer the top-level pm install alias in scripts when only installation is needed.\",\n \"Run pm package manage or pm package doctor after installing external packages.\",\n ],\n },\n \"package catalog\": {\n why: \"Lists bundled first-party package catalog metadata and compact field projections.\",\n examples: [\n \"pm package catalog --project\",\n \"pm package catalog --project --fields alias,installed,install_command\",\n \"pm package list --project --fields alias,package_name,category\",\n ],\n tips: [\n \"Use --fields for low-token package discovery in agent loops.\",\n \"External npm package discovery still belongs to npm search.\",\n ],\n },\n \"extension init\": {\n why: \"Generates an installable starter runtime extension with manifest and entrypoint files.\",\n examples: [\n \"pm extension init ./my-extension\",\n \"pm extension --install --project ./my-extension\",\n \"pm extension --doctor --project --detail summary\",\n ],\n tips: [\n \"Use package init for new distributable package workflows; extension init is the compatibility-level runtime scaffold.\",\n ],\n },\n \"extension install\": {\n why: \"Installs a compatibility runtime extension from local, npm, GitHub, bundled alias, or wildcard sources.\",\n examples: [\n \"pm extension install ./my-extension --project\",\n \"pm extension --install --project ./my-extension\",\n \"pm extension doctor --project --detail summary\",\n ],\n tips: [\"Prefer pm install or pm package install for new package-first automation.\"],\n },\n \"extension catalog\": {\n why: \"Compatibility view of bundled package catalog metadata.\",\n examples: [\n \"pm extension catalog --project\",\n \"pm extension catalog --project --fields alias,installed,install_command\",\n ],\n tips: [\"Prefer pm package catalog in new user-facing workflows.\"],\n },\n install: {\n why: \"Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.\",\n examples: [\n \"pm install '*' --project\",\n \"pm install ./packages/pm-todos --project\",\n \"pm install npm:@scope/pm-package --global\",\n \"pm install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\"Installed packages are recorded in managed state and can be inspected with pm package manage.\"],\n },\n upgrade: {\n why: \"Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.\",\n examples: [\n \"pm upgrade --dry-run\",\n \"pm upgrade --packages-only --project\",\n \"pm upgrade todos --dry-run\",\n \"pm upgrade --cli-only --repair\",\n \"pm upgrade --tag next --dry-run\",\n ],\n tips: [\n \"Omit target to include the CLI/SDK plus all managed packages in the selected scope.\",\n \"Pass a target to refresh one managed package by name, directory, package name, or source.\",\n \"Use --packages-only in repository automation when the global CLI should not be changed.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,timeout_seconds=240\" --doc \"path=README.md,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n \"close-many\": {\n why: \"Bulk-closes matched items with a shared reason routed through full pm close semantics (close validation, active-child orphan checks, blocked-edge cleanup) plus dry-run previews and rollback checkpoints — unlike update-many --status closed, which bypasses close validation.\",\n examples: [\n 'pm close-many --filter-sprint S-12 --reason \"Sprint S-12 acceptance criteria met\" --dry-run',\n 'pm close-many --filter-tag wave:7 --reason \"Superseded by redesign\" --validate-close warn',\n 'pm close-many --ids pm-a,pm-b,pm-c --reason \"Closed in batch\" --resolution \"Verified by integration suite\"',\n \"pm close-many --rollback close-many-20260604-abc123\",\n ],\n tips: [\n \"At least one filter (--filter-* or --ids) is required so close-many never matches every item.\",\n \"Already-terminal matches are skipped by default; pass --force to re-close them.\",\n \"Use --dry-run to preview matches plus per-item skip reasons and active-child orphan warnings before applying.\",\n \"Checkpoints are enabled by default for apply mode; restore with --rollback <checkpoint-id>.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm install guide-shell --project\",\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Decisions/Event/Reminder/Milestone/Meeting/Plan.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid --progress --json\"],\n tips: [\n \"Use --progress for non-interactive visibility during local embedding runs.\",\n \"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.\",\n ],\n },\n get: {\n why: \"Shows details for one item by ID, with optional lower-token projections for agent loops.\",\n examples: [\n \"pm get pm-a1b2\",\n \"pm get pm-a1b2 --depth brief --json\",\n \"pm get pm-a1b2 --fields id,title,status,parent,type --json\",\n ],\n tips: [\n \"Default depth is standard for body plus linked artifacts without append-only logs; use brief for metadata-only checks or --full for complete history-heavy metadata.\",\n \"Use --fields for the smallest deterministic item metadata payload when an agent only needs specific fields.\",\n \"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\",\n ],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\", \"pm history pm-a1b2 --full --verify\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --full --id pm-a1b2 --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n telemetry: {\n why: \"Inspects and manages local telemetry queue/runtime state for observability diagnostics.\",\n examples: [\n \"pm telemetry status\",\n \"pm telemetry stats --limit 10\",\n \"pm telemetry flush\",\n \"pm telemetry clear\",\n ],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\n \"pm health\",\n \"pm health --check-only --summary --json\",\n \"pm health --brief --json\",\n \"pm health --no-refresh\",\n \"pm health --refresh-vectors\",\n ],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Deletes optional cache artifacts by default to keep local tracker state tidy; use --dry-run to preview targets without deleting files.\",\n examples: [\"pm gc --dry-run\", \"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm install guide-shell --project\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Install guide-shell before using pm guide for local docs and skills routing.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"],"names":[],"mappings":";;AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAkB;IAClD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,uBAAuB;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE;QACjB,EAAE;QACF,WAAW;QACX,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OA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js","sources":["cli/help-content.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: [\n \"pm init\",\n \"pm init acme\",\n \"pm init --preset minimal\",\n \"pm init --agent-guidance add\",\n \"pm init --defaults --with-packages\",\n ],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n \"Use --agent-guidance add to inject compact AGENTS/CLAUDE workflow guidance, or --agent-guidance status to inspect missing guidance without modifying files.\",\n \"Use --with-packages when agents need bundled commands such as calendar and templates available immediately.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.\",\n examples: [\n \"pm install ./my-package --project\",\n \"pm install '*' --project\",\n \"pm package doctor --project --detail summary\",\n \"pm package manage --global\",\n \"pm package activate sample-ext --project\",\n \"pm package deactivate sample-ext --project\",\n \"pm package uninstall sample-ext --global\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n ],\n tips: [\n \"Prefer pm install and pm package in new user-facing automation.\",\n \"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n package: {\n why:\n \"Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.\",\n examples: [\n \"pm install npm:@scope/pm-package --project\",\n \"pm package install ./my-package --project\",\n \"pm package doctor --project --detail deep\",\n \"pm package manage --project --runtime-probe\",\n \"pm package activate sample-ext --project\",\n \"pm upgrade --packages-only --dry-run\",\n ],\n tips: [\n \"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.\",\n \"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.\",\n \"Use --dry-run before upgrade when automation needs a deterministic plan.\",\n ],\n },\n \"package init\": {\n why: \"Generates an installable starter pm package with package metadata and a root extension entrypoint.\",\n examples: [\n \"pm package init ./my-package\",\n \"pm install ./my-package --project\",\n \"pm package doctor --project --detail summary\",\n ],\n tips: [\n \"The generated package is local-install safe; add SDK runtime imports only after declaring dependencies and validating with package doctor.\",\n \"Use package doctor after changes to verify activation, policy, and collision diagnostics.\",\n ],\n },\n \"package install\": {\n why: \"Installs pm packages from local paths, npm sources, GitHub sources, bundled aliases, or wildcard/all aliases.\",\n examples: [\n \"pm package install ./my-package --project\",\n \"pm install npm:pm-changelog --project\",\n \"pm package install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\n \"Prefer the top-level pm install alias in scripts when only installation is needed.\",\n \"Run pm package manage or pm package doctor after installing external packages.\",\n ],\n },\n \"package catalog\": {\n why: \"Lists bundled first-party package catalog metadata and compact field projections.\",\n examples: [\n \"pm package catalog --project\",\n \"pm package catalog --project --fields alias,installed,install_command\",\n \"pm package list --project --fields alias,package_name,category\",\n ],\n tips: [\n \"Use --fields for low-token package discovery in agent loops.\",\n \"External npm package discovery still belongs to npm search.\",\n ],\n },\n \"extension init\": {\n why: \"Generates an installable starter runtime extension with manifest and entrypoint files.\",\n examples: [\n \"pm extension init ./my-extension\",\n \"pm extension --install --project ./my-extension\",\n \"pm extension --doctor --project --detail summary\",\n ],\n tips: [\n \"Use package init for new distributable package workflows; extension init is the compatibility-level runtime scaffold.\",\n ],\n },\n \"extension install\": {\n why: \"Installs a compatibility runtime extension from local, npm, GitHub, bundled alias, or wildcard sources.\",\n examples: [\n \"pm extension install ./my-extension --project\",\n \"pm extension --install --project ./my-extension\",\n \"pm extension doctor --project --detail summary\",\n ],\n tips: [\"Prefer pm install or pm package install for new package-first automation.\"],\n },\n \"extension catalog\": {\n why: \"Compatibility view of bundled package catalog metadata.\",\n examples: [\n \"pm extension catalog --project\",\n \"pm extension catalog --project --fields alias,installed,install_command\",\n ],\n tips: [\"Prefer pm package catalog in new user-facing workflows.\"],\n },\n install: {\n why: \"Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.\",\n examples: [\n \"pm install '*' --project\",\n \"pm install ./packages/pm-todos --project\",\n \"pm install npm:@scope/pm-package --global\",\n \"pm install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\"Installed packages are recorded in managed state and can be inspected with pm package manage.\"],\n },\n upgrade: {\n why: \"Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.\",\n examples: [\n \"pm upgrade --dry-run\",\n \"pm upgrade --packages-only --project\",\n \"pm upgrade todos --dry-run\",\n \"pm upgrade --cli-only --repair\",\n \"pm upgrade --tag next --dry-run\",\n ],\n tips: [\n \"Omit target to include the CLI/SDK plus all managed packages in the selected scope.\",\n \"Pass a target to refresh one managed package by name, directory, package name, or source.\",\n \"Use --packages-only in repository automation when the global CLI should not be changed.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,timeout_seconds=240\" --doc \"path=README.md,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n \"close-many\": {\n why: \"Bulk-closes matched items with a shared reason routed through full pm close semantics (close validation, active-child orphan checks, blocked-edge cleanup) plus dry-run previews and rollback checkpoints — unlike update-many --status closed, which bypasses close validation.\",\n examples: [\n 'pm close-many --filter-sprint S-12 --reason \"Sprint S-12 acceptance criteria met\" --dry-run',\n 'pm close-many --filter-tag wave:7 --reason \"Superseded by redesign\" --validate-close warn',\n 'pm close-many --ids pm-a,pm-b,pm-c --reason \"Closed in batch\" --resolution \"Verified by integration suite\"',\n \"pm close-many --rollback close-many-20260604-abc123\",\n ],\n tips: [\n \"At least one filter (--filter-* or --ids) is required so close-many never matches every item.\",\n \"Already-terminal matches are skipped by default; pass --force to re-close them.\",\n \"Use --dry-run to preview matches plus per-item skip reasons and active-child orphan warnings before applying.\",\n \"Checkpoints are enabled by default for apply mode; restore with --rollback <checkpoint-id>.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm install guide-shell --project\",\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Decisions/Event/Reminder/Milestone/Meeting/Plan.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid --progress --json\"],\n tips: [\n \"Use --progress for non-interactive visibility during local embedding runs.\",\n \"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.\",\n ],\n },\n get: {\n why: \"Shows details for one item by ID, with optional lower-token projections for agent loops.\",\n examples: [\n \"pm get pm-a1b2\",\n \"pm get pm-a1b2 --depth brief --json\",\n \"pm get pm-a1b2 --fields id,title,status,parent,type --json\",\n ],\n tips: [\n \"Default depth is standard for body plus linked artifacts without append-only logs; use brief for metadata-only checks or --full for complete history-heavy metadata.\",\n \"Use --fields for the smallest deterministic item metadata payload when an agent only needs specific fields.\",\n \"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\",\n ],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\", \"pm history pm-a1b2 --full --verify\"],\n },\n \"history-compact\": {\n why: \"Compacts long history streams into a synthetic checkpoint while preserving replay integrity.\",\n examples: [\n \"pm history-compact pm-a1b2 --dry-run\",\n \"pm history-compact pm-a1b2 --before 25 --author codex-agent --message \\\"Compact early history\\\"\",\n \"pm history-compact pm-a1b2 --before 2026-06-01T00:00:00.000Z\",\n ],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --full --id pm-a1b2 --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n telemetry: {\n why: \"Inspects and manages local telemetry queue/runtime state for observability diagnostics.\",\n examples: [\n \"pm telemetry status\",\n \"pm telemetry stats --limit 10\",\n \"pm telemetry flush\",\n \"pm telemetry clear\",\n ],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\n \"pm health\",\n \"pm health --check-only --summary --json\",\n \"pm health --brief --json\",\n \"pm health --no-refresh\",\n \"pm health --refresh-vectors\",\n ],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Deletes optional cache artifacts by default to keep local tracker state tidy; use --dry-run to preview targets without deleting files.\",\n examples: [\"pm gc --dry-run\", \"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm install guide-shell --project\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Install guide-shell before using pm guide for local docs and skills routing.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"],"names":[],"mappings":";;AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAA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,OAAgB,EAAE,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","debugId":"ad4ec245-86cd-551a-814a-482b7a2442b8"}
@@ -1,11 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import { type PmCliErrorContext } from "../core/shared/errors.js";
2
3
  declare function readThrownExitCode(error: unknown): number | undefined;
3
4
  declare function normalizeThrownExitCode(exitCode: number): number;
4
5
  declare function isCommanderError(error: unknown): boolean;
5
6
  declare function wrapThrownErrorForSentry(error: unknown, message: string): Error;
7
+ declare function buildPmCliRecoveryContext(context: PmCliErrorContext | undefined, invocationArgv: string[], rawMessage: string): PmCliErrorContext;
6
8
  declare function shouldLogHandledErrorToSentry(exitCode: number): boolean;
7
9
  export declare function runPmCli(rawArgv?: string[]): Promise<void>;
8
10
  export declare const _testOnly: {
11
+ buildPmCliRecoveryContext: typeof buildPmCliRecoveryContext;
9
12
  isCommanderError: typeof isCommanderError;
10
13
  normalizeThrownExitCode: typeof normalizeThrownExitCode;
11
14
  readThrownExitCode: typeof readThrownExitCode;
package/dist/cli/main.js CHANGED
@@ -1,12 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85d31f87-d392-5da2-9d53-1525fb938ff2")}catch(e){}}();
4
- import fs from "node:fs";
5
- import path from "node:path";
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aead80b1-f418-5252-a0b9-6ab1ea18d330")}catch(e){}}();
6
4
  import { Command } from "commander";
7
5
  import { activateExtensions, clearActiveExtensionHooks, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
8
6
  import { pathExists } from "../core/fs/fs-utils.js";
9
- import { resolvePmPackageRootFromModule } from "../core/packages/root.js";
7
+ import { resolvePmCliVersion, resolvePmPackageRootFromModule } from "../core/packages/root.js";
10
8
  import { resolveItemTypeRegistry, } from "../core/item/type-registry.js";
11
9
  import { resolveRuntimeFieldRegistry, } from "../core/schema/runtime-schema.js";
12
10
  import { EXIT_CODE, resolveTelemetryErrorCategory } from "../core/shared/constants.js";
@@ -147,6 +145,8 @@ function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
147
145
  provided_fields: existingRecovery?.provided_fields ?? (providedFields.length > 0 ? providedFields : undefined),
148
146
  missing: existingRecovery?.missing ?? inferredMissing,
149
147
  ...(suggestedRetry ? { suggested_retry: suggestedRetry } : {}),
148
+ ...(existingRecovery?.fallback_candidates ? { fallback_candidates: existingRecovery.fallback_candidates } : {}),
149
+ ...(existingRecovery?.next_best_command ? { next_best_command: existingRecovery.next_best_command } : {}),
150
150
  };
151
151
  return {
152
152
  ...(context ?? {}),
@@ -376,6 +376,7 @@ function extractCommandScopedOptions(command, commandArgs, extensionFlagDefiniti
376
376
  delete scoped.json;
377
377
  delete scoped.quiet;
378
378
  delete scoped.path;
379
+ delete scoped.pmPath;
379
380
  delete scoped.noExtensions;
380
381
  delete scoped.extensions;
381
382
  delete scoped.profile;
@@ -782,14 +783,6 @@ async function loadRuntimeExtensionDiscoverySnapshot(pmRoot) {
782
783
  if (runtimeExtensionDiscoverySnapshotCache?.key === cacheKey) {
783
784
  return runtimeExtensionDiscoverySnapshotCache.snapshot;
784
785
  }
785
- const settingsPath = getSettingsPath(pmRoot);
786
- if (!(await pathExists(settingsPath))) {
787
- runtimeExtensionDiscoverySnapshotCache = {
788
- key: cacheKey,
789
- snapshot: null,
790
- };
791
- return null;
792
- }
793
786
  try {
794
787
  const startedAt = Date.now();
795
788
  const { settings, warnings: settingsReadWarnings } = await readSettingsWithMetadata(pmRoot);
@@ -825,14 +818,6 @@ async function loadRuntimeExtensionSnapshot(pmRoot) {
825
818
  if (runtimeExtensionSnapshotCache?.key === cacheKey) {
826
819
  return runtimeExtensionSnapshotCache.snapshot;
827
820
  }
828
- const settingsPath = getSettingsPath(pmRoot);
829
- if (!(await pathExists(settingsPath))) {
830
- runtimeExtensionSnapshotCache = {
831
- key: cacheKey,
832
- snapshot: null,
833
- };
834
- return null;
835
- }
836
821
  try {
837
822
  const settings = await readSettings(pmRoot);
838
823
  const loadResult = await loadExtensions({
@@ -930,6 +915,10 @@ async function maybeLoadRuntimeExtensions(command) {
930
915
  pmRoot,
931
916
  };
932
917
  }
918
+ async function loadRuntimeExtensionCommandDescriptorsForRecovery(pmRoot) {
919
+ const snapshot = await loadRuntimeExtensionSnapshot(pmRoot);
920
+ return snapshot ? new Map(snapshot.commandDescriptors) : activeRuntimeExtensionCommandDescriptors;
921
+ }
933
922
  async function executeRegisteredRuntimeMigrations(migrations, pmRoot) {
934
923
  const warnings = [];
935
924
  for (let index = 0; index < migrations.length; index += 1) {
@@ -1201,18 +1190,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
1201
1190
  });
1202
1191
  }
1203
1192
  }
1204
- function resolveCliVersion() {
1205
- try {
1206
- const packageJsonPath = path.join(resolvePmPackageRoot(), "package.json");
1207
- const raw = fs.readFileSync(packageJsonPath, "utf8");
1208
- const parsed = JSON.parse(raw);
1209
- return typeof parsed.version === "string" ? parsed.version : "0.0.0";
1210
- }
1211
- catch {
1212
- return "0.0.0";
1213
- }
1214
- }
1215
- const CLI_VERSION = resolveCliVersion();
1193
+ const CLI_VERSION = resolvePmCliVersion(import.meta.url, ["../.."]) ?? "0.0.0";
1216
1194
  const program = new Command();
1217
1195
  program
1218
1196
  .name("pm")
@@ -1231,7 +1209,8 @@ program
1231
1209
  .option("--json", "Output JSON instead of TOON")
1232
1210
  .option("--quiet", "Suppress stdout output")
1233
1211
  .option("--no-changed-fields", "Omit the changed_fields array from mutation output (keeps changed_field_count)")
1234
- .option("--path <dir>", "Override PM path for this command")
1212
+ .option("--pm-path <dir>", "Explicit tracker storage path for this command (preferred over --path)")
1213
+ .option("--path <dir>", "Backward-compatible alias for --pm-path; this is the tracker storage path, not a workspace cwd")
1235
1214
  .option("--no-extensions", "Disable extension loading")
1236
1215
  .option("--no-pager", "Disable pager integration for help and long output")
1237
1216
  .option("--explain", "Render extended rationale and examples in help output")
@@ -1756,7 +1735,8 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
1756
1735
  if (helpRequest.requested && !isKnownHelpCommandPath(program, helpRequest.commandPathTokens)) {
1757
1736
  const unknownToken = helpRequest.commandPathTokens[0] ?? parseBootstrapCommandName(invocationArgv) ?? "<command>";
1758
1737
  const unknownMessage = `unknown command '${unknownToken}'`;
1759
- const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, activeRuntimeExtensionCommandDescriptors);
1738
+ const recoveryCommandDescriptors = await loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(), bootstrapGlobal.path));
1739
+ const usageContext = await resolveCommanderUsageContext({ message: unknownMessage }, program, recoveryCommandDescriptors);
1760
1740
  const classification = classifyCommanderError(usageContext.message, usageContext.commandName, usageContext.allowedTypes, {
1761
1741
  unknownCommandExamples: usageContext.unknownCommandExamples,
1762
1742
  unknownCommandNextSteps: usageContext.unknownCommandNextSteps,
@@ -1788,8 +1768,8 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
1788
1768
  source_context: activeTelemetryCommandContext?.source_context,
1789
1769
  });
1790
1770
  const renderedUsage = jsonErrors
1791
- ? await formatCommanderUsageJson({ message: unknownMessage }, program, activeRuntimeExtensionCommandDescriptors)
1792
- : await formatCommanderUsageMessage({ message: unknownMessage }, program, activeRuntimeExtensionCommandDescriptors);
1771
+ ? await formatCommanderUsageJson({ message: unknownMessage }, program, recoveryCommandDescriptors)
1772
+ : await formatCommanderUsageMessage({ message: unknownMessage }, program, recoveryCommandDescriptors);
1793
1773
  sentryFinishCommandSpan(false, unknownMessage, {
1794
1774
  error_code: classification.code,
1795
1775
  error_category: errorCategory,
@@ -1952,6 +1932,7 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
1952
1932
  }
1953
1933
  }
1954
1934
  export const _testOnly = {
1935
+ buildPmCliRecoveryContext,
1955
1936
  isCommanderError,
1956
1937
  normalizeThrownExitCode,
1957
1938
  readThrownExitCode,
@@ -1959,4 +1940,4 @@ export const _testOnly = {
1959
1940
  wrapThrownErrorForSentry,
1960
1941
  };
1961
1942
  //# sourceMappingURL=main.js.map
1962
- //# debugId=85d31f87-d392-5da2-9d53-1525fb938ff2
1943
+ //# debugId=aead80b1-f418-5252-a0b9-6ab1ea18d330