@unbrained/pm-cli 2026.6.7 → 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 (460) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +42 -0
  4. package/CONTRIBUTING.md +1 -1
  5. package/README.md +1 -1
  6. package/dist/cli/bootstrap-args.js +30 -13
  7. package/dist/cli/bootstrap-args.js.map +1 -1
  8. package/dist/cli/commands/close-many.js +9 -3
  9. package/dist/cli/commands/close-many.js.map +1 -1
  10. package/dist/cli/commands/close.js +15 -3
  11. package/dist/cli/commands/close.js.map +1 -1
  12. package/dist/cli/commands/comments-audit.js +4 -3
  13. package/dist/cli/commands/comments-audit.js.map +1 -1
  14. package/dist/cli/commands/completion.js +40 -33
  15. package/dist/cli/commands/completion.js.map +1 -1
  16. package/dist/cli/commands/extension/scaffold.js +6 -14
  17. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  18. package/dist/cli/commands/gc.js +10 -2
  19. package/dist/cli/commands/gc.js.map +1 -1
  20. package/dist/cli/commands/health.js +10 -2
  21. package/dist/cli/commands/health.js.map +1 -1
  22. package/dist/cli/commands/index.d.ts +1 -1
  23. package/dist/cli/commands/index.js +3 -3
  24. package/dist/cli/commands/index.js.map +1 -1
  25. package/dist/cli/commands/init.d.ts +1 -0
  26. package/dist/cli/commands/init.js +48 -2
  27. package/dist/cli/commands/init.js.map +1 -1
  28. package/dist/cli/commands/list.d.ts +11 -2
  29. package/dist/cli/commands/list.js +104 -2
  30. package/dist/cli/commands/list.js.map +1 -1
  31. package/dist/cli/commands/normalize.js +6 -4
  32. package/dist/cli/commands/normalize.js.map +1 -1
  33. package/dist/cli/commands/schema.d.ts +13 -2
  34. package/dist/cli/commands/schema.js +66 -12
  35. package/dist/cli/commands/schema.js.map +1 -1
  36. package/dist/cli/commands/search.d.ts +10 -2
  37. package/dist/cli/commands/search.js +94 -5
  38. package/dist/cli/commands/search.js.map +1 -1
  39. package/dist/cli/commands/upgrade.js +4 -12
  40. package/dist/cli/commands/upgrade.js.map +1 -1
  41. package/dist/cli/main.js +7 -18
  42. package/dist/cli/main.js.map +1 -1
  43. package/dist/cli/register-list-query.js +5 -3
  44. package/dist/cli/register-list-query.js.map +1 -1
  45. package/dist/cli/register-mutation.js +33 -24
  46. package/dist/cli/register-mutation.js.map +1 -1
  47. package/dist/cli/register-setup.js +4 -2
  48. package/dist/cli/register-setup.js.map +1 -1
  49. package/dist/cli/registration-helpers.js +7 -3
  50. package/dist/cli/registration-helpers.js.map +1 -1
  51. package/dist/cli-bundle/chunks/activity-A3QKFSSF.js +16 -0
  52. package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js → activity-Q7XMIZIH.js} +11 -11
  53. package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js → aggregate-GBSHSXOB.js} +10 -10
  54. package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js → aggregate-HKQJZUBG.js} +10 -10
  55. package/dist/cli-bundle/chunks/{append-2PPYFAG5.js → append-3RFOU7P5.js} +8 -8
  56. package/dist/cli-bundle/chunks/{append-AUGT5W6J.js → append-OM74OJVT.js} +8 -8
  57. package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js → chunk-2BYKYPWY.js} +2 -2
  58. package/dist/cli-bundle/chunks/{chunk-TP4DDY27.js → chunk-2HMD3JM2.js} +6 -6
  59. package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js → chunk-2YPVCD7T.js} +8 -8
  60. package/dist/cli-bundle/chunks/{chunk-WAA7UI6M.js → chunk-3E3MDBTB.js} +10 -14
  61. package/dist/cli-bundle/chunks/chunk-3E3MDBTB.js.map +7 -0
  62. package/dist/cli-bundle/chunks/{chunk-UJUT6AHZ.js → chunk-3TXWDGPU.js} +48 -12
  63. package/dist/cli-bundle/chunks/chunk-3TXWDGPU.js.map +7 -0
  64. package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js → chunk-4TI3532H.js} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js → chunk-4WYBLB6J.js} +3 -3
  66. package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js → chunk-5NVJA7IW.js} +7 -7
  67. package/dist/cli-bundle/chunks/{chunk-42LOFGJS.js → chunk-5WO2VKFA.js} +108 -9
  68. package/dist/cli-bundle/chunks/chunk-5WO2VKFA.js.map +7 -0
  69. package/dist/cli-bundle/chunks/{chunk-QQL5QSTZ.js → chunk-7NQIY7Z6.js} +6 -5
  70. package/dist/cli-bundle/chunks/chunk-7NQIY7Z6.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-KR6R465K.js → chunk-7WXGR44E.js} +5 -5
  72. package/dist/cli-bundle/chunks/{chunk-KR6R465K.js.map → chunk-7WXGR44E.js.map} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js → chunk-AEMKH5WQ.js} +3 -3
  74. package/dist/cli-bundle/chunks/{chunk-XS3O2TFJ.js → chunk-ALSRBNYB.js} +8 -8
  75. package/dist/cli-bundle/chunks/chunk-ALSRBNYB.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js → chunk-AXBUHLW7.js} +9 -9
  77. package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js → chunk-BFJPMUF5.js} +5 -5
  78. package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js → chunk-BKQMJXWY.js} +3 -3
  79. package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js → chunk-CBJXWXI5.js} +2 -2
  80. package/dist/cli-bundle/chunks/{chunk-NHR2QXXZ.js → chunk-D7WK2PKB.js} +20 -8
  81. package/dist/cli-bundle/chunks/chunk-D7WK2PKB.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-MWRS7Z4P.js → chunk-DV27WDA7.js} +15 -13
  83. package/dist/cli-bundle/chunks/chunk-DV27WDA7.js.map +7 -0
  84. package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js → chunk-EPWT7BEA.js} +8 -8
  85. package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js → chunk-ETZZU5QF.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-XYNT7UFP.js → chunk-F33AQIB4.js} +6 -6
  87. package/dist/cli-bundle/chunks/{chunk-XYNT7UFP.js.map → chunk-F33AQIB4.js.map} +1 -1
  88. package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js → chunk-F33VC5EX.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js → chunk-FGRJZVXD.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js → chunk-FO2TYSQZ.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js → chunk-HOA3GMB6.js} +4 -4
  92. package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js → chunk-HP35AVFS.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js → chunk-J4DKAGTM.js} +3 -3
  94. package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js → chunk-JS47EKLP.js} +7 -7
  95. package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js → chunk-K62SNVVE.js} +2 -2
  96. package/dist/cli-bundle/chunks/{chunk-IMCJBN2Q.js → chunk-KBKJVXUS.js} +19 -7
  97. package/dist/cli-bundle/chunks/chunk-KBKJVXUS.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-CLD3XNCH.js → chunk-KCGMABHM.js} +14 -12
  99. package/dist/cli-bundle/chunks/chunk-KCGMABHM.js.map +1 -0
  100. package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js → chunk-KN4WSESY.js} +5 -5
  101. package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js → chunk-KP4KIUQT.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-YPH4ESA2.js → chunk-KS2U7BZ3.js} +11 -6
  103. package/dist/cli-bundle/chunks/chunk-KS2U7BZ3.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js → chunk-KVXIQDJG.js} +12 -12
  105. package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js → chunk-L3LYL3ID.js} +12 -12
  106. package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js → chunk-M7UBTVFT.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js → chunk-MSH23UWO.js} +4 -4
  108. package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js → chunk-N4SQZ7L3.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js → chunk-NDSMKB2I.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js → chunk-NGEEXR2R.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js → chunk-NLVCMVC7.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js → chunk-NUKHZZNM.js} +3 -3
  113. package/dist/cli-bundle/chunks/{chunk-YBZW2QQ7.js → chunk-ODN53S6H.js} +6 -6
  114. package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js → chunk-OTY2YEH5.js} +12 -12
  115. package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js → chunk-OVSSE2JP.js} +8 -8
  116. package/dist/cli-bundle/chunks/{chunk-4GHZR3BA.js → chunk-PQDH3S54.js} +10 -14
  117. package/dist/cli-bundle/chunks/chunk-PQDH3S54.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js → chunk-QF4OPBAG.js} +9 -9
  119. package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js → chunk-QFVASU44.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js → chunk-QQPZYP73.js} +12 -12
  121. package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js → chunk-QWNUDGFQ.js} +8 -8
  122. package/dist/cli-bundle/chunks/{chunk-TYJJOTUA.js → chunk-R4XIE7NQ.js} +54 -8
  123. package/dist/cli-bundle/chunks/chunk-R4XIE7NQ.js.map +1 -0
  124. package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js → chunk-RISLL7XH.js} +10 -5
  125. package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js.map → chunk-RISLL7XH.js.map} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js → chunk-SDLEYY6A.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-TINUJMWN.js → chunk-SM3RMWGO.js} +109 -10
  128. package/dist/cli-bundle/chunks/chunk-SM3RMWGO.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js → chunk-TBLBEOEX.js} +9 -9
  130. package/dist/cli-bundle/chunks/{chunk-WR5567FH.js → chunk-TXKENAQP.js} +5 -4
  131. package/dist/cli-bundle/chunks/chunk-TXKENAQP.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js → chunk-UEXNNF3K.js} +7 -7
  133. package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js → chunk-UMMJAJB2.js} +9 -9
  134. package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js → chunk-URJEZOLB.js} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-M2PW7EZU.js → chunk-VXBUXLVD.js} +7 -7
  136. package/dist/cli-bundle/chunks/chunk-VXBUXLVD.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js → chunk-XEKZCBCS.js} +3 -3
  138. package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js → chunk-XLSQ3QLT.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js → chunk-XNGMIVQY.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js → chunk-XZS4MV37.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js → chunk-YEFOCDIK.js} +7 -7
  142. package/dist/cli-bundle/chunks/{chunk-X4IZKYHP.js → chunk-YJAKN2N2.js} +46 -10
  143. package/dist/cli-bundle/chunks/chunk-YJAKN2N2.js.map +1 -0
  144. package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js → chunk-Z2HXAFFH.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-CKLBZHS7.js → chunk-Z55JACL2.js} +53 -7
  146. package/dist/cli-bundle/chunks/chunk-Z55JACL2.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{claim-KW743OSW.js → claim-NHBIIBOW.js} +10 -10
  148. package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js → claim-RNEBQCOO.js} +10 -10
  149. package/dist/cli-bundle/chunks/close-UNTFXVM3.js +13 -0
  150. package/dist/cli-bundle/chunks/{close-SYHSRZDC.js → close-ZMXL2WDS.js} +8 -8
  151. package/dist/cli-bundle/chunks/{close-many-LAC5VR4G.js → close-many-CDPQGQUB.js} +24 -18
  152. package/dist/cli-bundle/chunks/close-many-CDPQGQUB.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{close-many-DBLEYFOY.js → close-many-IQV5C2SI.js} +23 -17
  154. package/dist/cli-bundle/chunks/close-many-IQV5C2SI.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js → comments-EFVBHWPT.js} +10 -10
  156. package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js → comments-J5Q4IJPH.js} +10 -10
  157. package/dist/cli-bundle/chunks/{config-RZRVS3ZV.js → config-72253M2O.js} +10 -11
  158. package/dist/cli-bundle/chunks/config-72253M2O.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{config-YJSAAADD.js → config-VFYA6BMI.js} +9 -10
  160. package/dist/cli-bundle/chunks/config-VFYA6BMI.js.map +7 -0
  161. package/dist/cli-bundle/chunks/{context-LGYEEKAW.js → context-AVLO4IFH.js} +13 -13
  162. package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js → context-WMSI2D65.js} +13 -13
  163. package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js → contracts-D4BN3VSQ.js} +4 -4
  164. package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js → contracts-RGPOBLPL.js} +4 -4
  165. package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js → copy-H6TXHK7S.js} +7 -7
  166. package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js → copy-WXE3OOLZ.js} +7 -7
  167. package/dist/cli-bundle/chunks/create-EZWAMUKR.js +27 -0
  168. package/dist/cli-bundle/chunks/{create-CF7EVRX7.js → create-PUAIJEZ7.js} +13 -13
  169. package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js → delete-PKR2JHLH.js} +7 -7
  170. package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js → delete-WBME6WG5.js} +7 -7
  171. package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js → deps-4BQEDV4L.js} +7 -7
  172. package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js → deps-KWHQRO75.js} +7 -7
  173. package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js → docs-364GT3ZR.js} +9 -9
  174. package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js → docs-SCNBUGSV.js} +9 -9
  175. package/dist/cli-bundle/chunks/{extension-XYCUXICD.js → extension-CRE7JM47.js} +5 -5
  176. package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js → extension-KK2UPXJD.js} +5 -5
  177. package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js → files-3GESQAWL.js} +9 -9
  178. package/dist/cli-bundle/chunks/{files-J4I5IU4O.js → files-66EHM5ZR.js} +9 -9
  179. package/dist/cli-bundle/chunks/{gc-34NXSNSN.js → gc-D5IWOKQH.js} +13 -5
  180. package/dist/cli-bundle/chunks/gc-D5IWOKQH.js.map +1 -0
  181. package/dist/cli-bundle/chunks/{gc-SPIIZX3A.js → gc-MOQDND5J.js} +12 -4
  182. package/dist/cli-bundle/chunks/gc-MOQDND5J.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{get-SZKNRHMA.js → get-7J2ZCBV5.js} +11 -11
  184. package/dist/cli-bundle/chunks/{get-VITKYP6S.js → get-WXSLXV3K.js} +11 -11
  185. package/dist/cli-bundle/chunks/{health-7G3EPM57.js → health-B6AEM7BV.js} +21 -14
  186. package/dist/cli-bundle/chunks/health-B6AEM7BV.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{health-4SNTA2TF.js → health-YMZGOMVX.js} +20 -13
  188. package/dist/cli-bundle/chunks/health-YMZGOMVX.js.map +7 -0
  189. package/dist/cli-bundle/chunks/{history-SDAWYZR3.js → history-TJTO5GCR.js} +10 -10
  190. package/dist/cli-bundle/chunks/history-ZERISU2L.js +20 -0
  191. package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js → history-compact-CKNN6UKW.js} +11 -11
  192. package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js → history-compact-N2Q7IR3T.js} +11 -11
  193. package/dist/cli-bundle/chunks/history-redact-GODBYT5A.js +19 -0
  194. package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js → history-redact-JUXUOH54.js} +11 -11
  195. package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js → history-repair-CCCPBNTF.js} +11 -11
  196. package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js → history-repair-TDBBSRVK.js} +11 -11
  197. package/dist/cli-bundle/chunks/{init-YHVBTEET.js → init-6ZPKD3YN.js} +9 -9
  198. package/dist/cli-bundle/chunks/init-CBZHXBR3.js +17 -0
  199. package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js → learnings-U7U2FNIO.js} +10 -10
  200. package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js → learnings-WYNTYQ5T.js} +10 -10
  201. package/dist/cli-bundle/chunks/list-7MTPPZHC.js +20 -0
  202. package/dist/cli-bundle/chunks/{list-3KEVBOYW.js → list-JGP7ODML.js} +10 -10
  203. package/dist/cli-bundle/chunks/{notes-GJKALVZM.js → notes-P25YVTEG.js} +10 -10
  204. package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js → notes-QIF6A7XS.js} +10 -10
  205. package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js → plan-RACB5PI6.js} +13 -13
  206. package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js → plan-SSBJFWXA.js} +13 -13
  207. package/dist/cli-bundle/chunks/{register-list-query-I65EZ3HB.js → register-list-query-5IXDPUZ6.js} +23 -21
  208. package/dist/cli-bundle/chunks/register-list-query-5IXDPUZ6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{register-list-query-OECMHO4G.js → register-list-query-GQAEIG4K.js} +22 -20
  210. package/dist/cli-bundle/chunks/register-list-query-GQAEIG4K.js.map +7 -0
  211. package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js → register-mutation-FAS4YG63.js} +41 -37
  212. package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js.map → register-mutation-FAS4YG63.js.map} +1 -1
  213. package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js → register-mutation-YZCUILGO.js} +40 -36
  214. package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js.map → register-mutation-YZCUILGO.js.map} +2 -2
  215. package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js → register-operations-IBYWNJN5.js} +30 -30
  216. package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js → register-operations-S2BOLUPF.js} +30 -30
  217. package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js → register-setup-ABA2JPWO.js} +19 -18
  218. package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js.map → register-setup-ABA2JPWO.js.map} +2 -2
  219. package/dist/cli-bundle/chunks/{register-setup-DNDCGZ4O.js → register-setup-JRZ4UMWZ.js} +20 -19
  220. package/dist/cli-bundle/chunks/register-setup-JRZ4UMWZ.js.map +1 -0
  221. package/dist/cli-bundle/chunks/restore-3JRX27QW.js +17 -0
  222. package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js → restore-K72ZNPEP.js} +11 -11
  223. package/dist/cli-bundle/chunks/{schema-B7NQ6XVP.js → schema-3VKRDBLC.js} +76 -20
  224. package/dist/cli-bundle/chunks/schema-3VKRDBLC.js.map +7 -0
  225. package/dist/cli-bundle/chunks/{schema-HEGYH6CE.js → schema-UL4B2JX5.js} +77 -21
  226. package/dist/cli-bundle/chunks/schema-UL4B2JX5.js.map +1 -0
  227. package/dist/cli-bundle/chunks/{search-JNEZJV7H.js → search-632WJ7GO.js} +103 -14
  228. package/dist/cli-bundle/chunks/search-632WJ7GO.js.map +7 -0
  229. package/dist/cli-bundle/chunks/{search-DVVQ4UO2.js → search-EQDHSE4G.js} +104 -15
  230. package/dist/cli-bundle/chunks/search-EQDHSE4G.js.map +1 -0
  231. package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js → stats-O4UTMJMC.js} +7 -7
  232. package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js → stats-WLJ3XBF5.js} +7 -7
  233. package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js → telemetry-EUVHFSQU.js} +4 -4
  234. package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js → telemetry-NRVWX25E.js} +4 -4
  235. package/dist/cli-bundle/chunks/{test-IIELLSZX.js → test-GXUBQNUC.js} +14 -14
  236. package/dist/cli-bundle/chunks/test-XN7RJL5Z.js +32 -0
  237. package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js → test-all-UTFXC7S2.js} +14 -14
  238. package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js → test-all-XM6OKI3L.js} +14 -14
  239. package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js → test-runs-7FHCPEA3.js} +5 -5
  240. package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js → test-runs-IK6E2HNX.js} +5 -5
  241. package/dist/cli-bundle/chunks/update-LFBSEW3N.js +21 -0
  242. package/dist/cli-bundle/chunks/update-U4B4OMHZ.js +25 -0
  243. package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js → update-many-5KD33MKY.js} +22 -22
  244. package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js → update-many-N3YTM7K4.js} +22 -22
  245. package/dist/cli-bundle/chunks/{upgrade-YWI5DJFA.js → upgrade-5SRFLUNW.js} +8 -15
  246. package/dist/cli-bundle/chunks/upgrade-5SRFLUNW.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{upgrade-RSE5PC44.js → upgrade-FFXGO43H.js} +9 -16
  248. package/dist/cli-bundle/chunks/upgrade-FFXGO43H.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js → validate-CRWXZILW.js} +16 -16
  250. package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js → validate-T3LPWSZG.js} +16 -16
  251. package/dist/cli-bundle/main.js +51 -62
  252. package/dist/cli-bundle/main.js.map +3 -3
  253. package/dist/core/config/nested-settings.d.ts +0 -2
  254. package/dist/core/config/nested-settings.js +2 -4
  255. package/dist/core/config/nested-settings.js.map +1 -1
  256. package/dist/core/diagnostics/remediation.js +7 -2
  257. package/dist/core/diagnostics/remediation.js.map +1 -1
  258. package/dist/core/fs/fs-utils.js +29 -4
  259. package/dist/core/fs/fs-utils.js.map +1 -1
  260. package/dist/core/packages/root.d.ts +10 -0
  261. package/dist/core/packages/root.js +24 -2
  262. package/dist/core/packages/root.js.map +1 -1
  263. package/dist/core/schema/runtime-schema.js +3 -6
  264. package/dist/core/schema/runtime-schema.js.map +1 -1
  265. package/dist/core/search/background-refresh.d.ts +0 -8
  266. package/dist/core/search/background-refresh.js +2 -9
  267. package/dist/core/search/background-refresh.js.map +1 -1
  268. package/dist/core/search/vector-stores.js +6 -8
  269. package/dist/core/search/vector-stores.js.map +1 -1
  270. package/dist/core/sentry/instrument.js +4 -17
  271. package/dist/core/sentry/instrument.js.map +1 -1
  272. package/dist/core/store/paths.js +17 -3
  273. package/dist/core/store/paths.js.map +1 -1
  274. package/dist/core/telemetry/runtime.d.ts +1 -0
  275. package/dist/core/telemetry/runtime.js +3 -3
  276. package/dist/core/telemetry/runtime.js.map +1 -1
  277. package/dist/mcp/server.js +76 -13
  278. package/dist/mcp/server.js.map +1 -1
  279. package/dist/sdk/cli-contracts/commander-types.js +4 -4
  280. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  281. package/dist/sdk/cli-contracts/tool-parameter-tables.js +3 -3
  282. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  283. package/dist/sdk/cli-contracts.js +10 -8
  284. package/dist/sdk/cli-contracts.js.map +1 -1
  285. package/docs/AGENT_GUIDE.md +3 -1
  286. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  287. package/docs/COMMANDS.md +6 -4
  288. package/docs/CONFIGURATION.md +6 -0
  289. package/docs/EXTENSIONS.md +0 -5
  290. package/docs/RELEASING.md +17 -0
  291. package/marketplace.json +1 -1
  292. package/package.json +1 -1
  293. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  294. package/plugins/pm-claude/README.md +3 -3
  295. package/plugins/pm-claude/commands/pm-init.md +1 -1
  296. package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +0 -16
  297. package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +0 -7
  298. package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +0 -1
  299. package/dist/cli-bundle/chunks/chunk-CKLBZHS7.js.map +0 -7
  300. package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +0 -1
  301. package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +0 -7
  302. package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +0 -7
  303. package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +0 -7
  304. package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +0 -1
  305. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +0 -1
  306. package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +0 -1
  307. package/dist/cli-bundle/chunks/chunk-TYJJOTUA.js.map +0 -1
  308. package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +0 -7
  309. package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +0 -7
  310. package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +0 -7
  311. package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +0 -1
  312. package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +0 -1
  313. package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +0 -1
  314. package/dist/cli-bundle/chunks/close-P4ZBKODL.js +0 -13
  315. package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +0 -7
  316. package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +0 -1
  317. package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +0 -1
  318. package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +0 -7
  319. package/dist/cli-bundle/chunks/create-4DS2QWQC.js +0 -27
  320. package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +0 -1
  321. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +0 -7
  322. package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +0 -7
  323. package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +0 -1
  324. package/dist/cli-bundle/chunks/history-YDUEILKP.js +0 -20
  325. package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +0 -19
  326. package/dist/cli-bundle/chunks/init-IGSS4GNH.js +0 -17
  327. package/dist/cli-bundle/chunks/list-E44O2K64.js +0 -20
  328. package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +0 -1
  329. package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +0 -7
  330. package/dist/cli-bundle/chunks/register-setup-DNDCGZ4O.js.map +0 -1
  331. package/dist/cli-bundle/chunks/restore-SJSASGZP.js +0 -17
  332. package/dist/cli-bundle/chunks/schema-B7NQ6XVP.js.map +0 -7
  333. package/dist/cli-bundle/chunks/schema-HEGYH6CE.js.map +0 -1
  334. package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +0 -1
  335. package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +0 -7
  336. package/dist/cli-bundle/chunks/test-ML5RLWXE.js +0 -32
  337. package/dist/cli-bundle/chunks/update-6C67X4KS.js +0 -21
  338. package/dist/cli-bundle/chunks/update-VF26YPT3.js +0 -25
  339. package/dist/cli-bundle/chunks/upgrade-RSE5PC44.js.map +0 -1
  340. package/dist/cli-bundle/chunks/upgrade-YWI5DJFA.js.map +0 -7
  341. /package/dist/cli-bundle/chunks/{activity-5UROHJ3D.js.map → activity-A3QKFSSF.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js.map → activity-Q7XMIZIH.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js.map → aggregate-GBSHSXOB.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js.map → aggregate-HKQJZUBG.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{append-2PPYFAG5.js.map → append-3RFOU7P5.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{append-AUGT5W6J.js.map → append-OM74OJVT.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js.map → chunk-2BYKYPWY.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-TP4DDY27.js.map → chunk-2HMD3JM2.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js.map → chunk-2YPVCD7T.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js.map → chunk-4TI3532H.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js.map → chunk-4WYBLB6J.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js.map → chunk-5NVJA7IW.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js.map → chunk-AEMKH5WQ.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js.map → chunk-AXBUHLW7.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js.map → chunk-BFJPMUF5.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js.map → chunk-BKQMJXWY.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js.map → chunk-CBJXWXI5.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js.map → chunk-EPWT7BEA.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js.map → chunk-ETZZU5QF.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js.map → chunk-F33VC5EX.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js.map → chunk-FGRJZVXD.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js.map → chunk-FO2TYSQZ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js.map → chunk-HOA3GMB6.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js.map → chunk-HP35AVFS.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js.map → chunk-J4DKAGTM.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js.map → chunk-JS47EKLP.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js.map → chunk-K62SNVVE.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js.map → chunk-KN4WSESY.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js.map → chunk-KP4KIUQT.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js.map → chunk-KVXIQDJG.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js.map → chunk-L3LYL3ID.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js.map → chunk-M7UBTVFT.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js.map → chunk-MSH23UWO.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js.map → chunk-N4SQZ7L3.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js.map → chunk-NDSMKB2I.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js.map → chunk-NGEEXR2R.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js.map → chunk-NLVCMVC7.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js.map → chunk-NUKHZZNM.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-YBZW2QQ7.js.map → chunk-ODN53S6H.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js.map → chunk-OTY2YEH5.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js.map → chunk-OVSSE2JP.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js.map → chunk-QF4OPBAG.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js.map → chunk-QFVASU44.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js.map → chunk-QQPZYP73.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js.map → chunk-QWNUDGFQ.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js.map → chunk-SDLEYY6A.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js.map → chunk-TBLBEOEX.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js.map → chunk-UEXNNF3K.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js.map → chunk-UMMJAJB2.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js.map → chunk-URJEZOLB.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js.map → chunk-XEKZCBCS.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js.map → chunk-XLSQ3QLT.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js.map → chunk-XNGMIVQY.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js.map → chunk-XZS4MV37.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js.map → chunk-YEFOCDIK.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js.map → chunk-Z2HXAFFH.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{claim-KW743OSW.js.map → claim-NHBIIBOW.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js.map → claim-RNEBQCOO.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{close-P4ZBKODL.js.map → close-UNTFXVM3.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{close-SYHSRZDC.js.map → close-ZMXL2WDS.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js.map → comments-EFVBHWPT.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js.map → comments-J5Q4IJPH.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{context-LGYEEKAW.js.map → context-AVLO4IFH.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js.map → context-WMSI2D65.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js.map → contracts-D4BN3VSQ.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js.map → contracts-RGPOBLPL.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js.map → copy-H6TXHK7S.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js.map → copy-WXE3OOLZ.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{create-4DS2QWQC.js.map → create-EZWAMUKR.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{create-CF7EVRX7.js.map → create-PUAIJEZ7.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js.map → delete-PKR2JHLH.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js.map → delete-WBME6WG5.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js.map → deps-4BQEDV4L.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js.map → deps-KWHQRO75.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js.map → docs-364GT3ZR.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js.map → docs-SCNBUGSV.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{extension-XYCUXICD.js.map → extension-CRE7JM47.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js.map → extension-KK2UPXJD.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js.map → files-3GESQAWL.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{files-J4I5IU4O.js.map → files-66EHM5ZR.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{get-SZKNRHMA.js.map → get-7J2ZCBV5.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{get-VITKYP6S.js.map → get-WXSLXV3K.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{history-SDAWYZR3.js.map → history-TJTO5GCR.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{history-YDUEILKP.js.map → history-ZERISU2L.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js.map → history-compact-CKNN6UKW.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js.map → history-compact-N2Q7IR3T.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{history-redact-KASLLPE7.js.map → history-redact-GODBYT5A.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js.map → history-redact-JUXUOH54.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js.map → history-repair-CCCPBNTF.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js.map → history-repair-TDBBSRVK.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{init-YHVBTEET.js.map → init-6ZPKD3YN.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{init-IGSS4GNH.js.map → init-CBZHXBR3.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js.map → learnings-U7U2FNIO.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js.map → learnings-WYNTYQ5T.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{list-E44O2K64.js.map → list-7MTPPZHC.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{list-3KEVBOYW.js.map → list-JGP7ODML.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{notes-GJKALVZM.js.map → notes-P25YVTEG.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js.map → notes-QIF6A7XS.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js.map → plan-RACB5PI6.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js.map → plan-SSBJFWXA.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js.map → register-operations-IBYWNJN5.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js.map → register-operations-S2BOLUPF.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{restore-SJSASGZP.js.map → restore-3JRX27QW.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js.map → restore-K72ZNPEP.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js.map → stats-O4UTMJMC.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js.map → stats-WLJ3XBF5.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js.map → telemetry-EUVHFSQU.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js.map → telemetry-NRVWX25E.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{test-IIELLSZX.js.map → test-GXUBQNUC.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{test-ML5RLWXE.js.map → test-XN7RJL5Z.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js.map → test-all-UTFXC7S2.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js.map → test-all-XM6OKI3L.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js.map → test-runs-7FHCPEA3.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js.map → test-runs-IK6E2HNX.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{update-6C67X4KS.js.map → update-LFBSEW3N.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{update-VF26YPT3.js.map → update-U4B4OMHZ.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js.map → update-many-5KD33MKY.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js.map → update-many-N3YTM7K4.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js.map → validate-CRWXZILW.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js.map → validate-T3LPWSZG.js.map} +0 -0
@@ -49,8 +49,6 @@ export interface NestedSettingDescriptor {
49
49
  * `pm config list` and in error hints.
50
50
  */
51
51
  export declare const NESTED_SETTING_DESCRIPTORS: readonly NestedSettingDescriptor[];
52
- /** Canonical CLI keys (in declaration order). */
53
- export declare const NESTED_SETTING_KEYS: readonly string[];
54
52
  /**
55
53
  * Map a raw user-supplied key (kebab or snake case, any casing) onto a known
56
54
  * nested-leaf descriptor. Returns `undefined` when the key is not a nested
@@ -27,7 +27,7 @@
27
27
  * `pm config list` and in error hints.
28
28
  */
29
29
 
30
- !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]="121fa495-f276-5e11-af32-62738b88da77")}catch(e){}}();
30
+ !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]="1bb81b8a-b034-5aec-aa16-d395bac81342")}catch(e){}}();
31
31
  export const NESTED_SETTING_DESCRIPTORS = [
32
32
  {
33
33
  key: "search_provider",
@@ -182,8 +182,6 @@ export const NESTED_SETTING_DESCRIPTORS = [
182
182
  },
183
183
  ];
184
184
  const DESCRIPTOR_BY_KEY = new Map(NESTED_SETTING_DESCRIPTORS.map((descriptor) => [descriptor.key, descriptor]));
185
- /** Canonical CLI keys (in declaration order). */
186
- export const NESTED_SETTING_KEYS = NESTED_SETTING_DESCRIPTORS.map((descriptor) => descriptor.key);
187
185
  /**
188
186
  * Map a raw user-supplied key (kebab or snake case, any casing) onto a known
189
187
  * nested-leaf descriptor. Returns `undefined` when the key is not a nested
@@ -336,4 +334,4 @@ export function writeNestedSettingValue(settings, descriptor, value) {
336
334
  return true;
337
335
  }
338
336
  //# sourceMappingURL=nested-settings.js.map
339
- //# debugId=121fa495-f276-5e11-af32-62738b88da77
337
+ //# debugId=1bb81b8a-b034-5aec-aa16-d395bac81342
@@ -1 +1 @@
1
- {"version":3,"file":"nested-settings.js","sources":["core/config/nested-settings.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Nested leaf settings exposed via `pm config <scope> set/get <key> <value>`.\n *\n * These are simple string/number leaves of {@link PmSettings} (provider URLs,\n * vector-store adapter, search tuning) that previously required hand-editing\n * `.agents/pm/settings.json`. They live here so the same dotted path is\n * documented in one place and surfaced both to the config dispatcher and to\n * `pm config list` (so `pm config list --json` is discoverable).\n *\n * Shape conventions:\n * - `path` is the dotted JSON path in {@link PmSettings} (e.g. `search.provider`).\n * - `kind` is the value shape: \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\"\n * - \"ratio\" must be a finite number in [0, 1].\n * - \"integer\" must be a finite non-negative integer. Set `min: 1` for keys\n * where the runtime silently falls back when 0 is supplied (e.g. batch\n * size, timeout, max-results limits).\n * - \"number\" must be a finite number — negatives ARE allowed (e.g. score\n * thresholds may legitimately be negative when a provider normalizes\n * scores into a signed range).\n *\n * Adding a key here makes it acceptable to `pm config <scope> set <key> <value>`\n * with no other code changes — the dispatcher walks the dotted path on the\n * already-validated PmSettings shape.\n */\n\nexport type NestedSettingKind = \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\";\n\nexport interface NestedSettingDescriptor {\n /** CLI key (snake_case). Kebab-case form is accepted by normalizing `-` → `_`. */\n key: string;\n /** Dotted JSON path in PmSettings. */\n path: string;\n /** Value shape. */\n kind: NestedSettingKind;\n /** Short human-facing summary for `pm config list`. */\n summary: string;\n /** Optional accepted values for string settings. */\n choices?: readonly string[];\n /** Require a non-empty trimmed string value for string settings. */\n non_empty?: boolean;\n /**\n * Optional minimum value for `integer` / `number` kinds. When set,\n * `parseNestedSettingValue` rejects values strictly below `min`. Useful for\n * settings where 0 would be silently ignored by the runtime (batch sizes,\n * timeouts, max-results limits).\n */\n min?: number;\n}\n\n/**\n * Search/provider/vector-store leaves. Order is the display order in\n * `pm config list` and in error hints.\n */\nexport const NESTED_SETTING_DESCRIPTORS: readonly NestedSettingDescriptor[] = [\n {\n key: \"search_provider\",\n path: \"search.provider\",\n kind: \"string\",\n summary: \"Search embedding provider name (e.g. openai, ollama, or an extension provider).\",\n },\n {\n key: \"search_mutation_refresh_policy\",\n path: \"search.mutation_refresh_policy\",\n kind: \"string\",\n choices: [\"cache_only\", \"semantic_configured\", \"semantic_auto\"],\n summary: \"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto.\",\n },\n {\n key: \"search_query_expansion_enabled\",\n path: \"search.query_expansion.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable query expansion for semantic/hybrid search.\",\n },\n {\n key: \"search_query_expansion_provider\",\n path: \"search.query_expansion.provider\",\n kind: \"string\",\n summary: \"Query expansion provider name (built-in openai/ollama or extension provider).\",\n },\n {\n key: \"search_rerank_enabled\",\n path: \"search.rerank.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable post-retrieval reranking for hybrid search.\",\n },\n {\n key: \"search_rerank_model\",\n path: \"search.rerank.model\",\n kind: \"string\",\n summary: \"Rerank model name override used by built-in providers.\",\n },\n {\n key: \"search_rerank_top_k\",\n path: \"search.rerank.top_k\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of top hybrid candidates to rerank when rerank is enabled.\",\n },\n {\n key: \"search_embedding_model\",\n path: \"search.embedding_model\",\n kind: \"string\",\n summary: \"Default embedding model name (overrides provider-specific model when set).\",\n },\n {\n key: \"search_embedding_corpus_max_characters\",\n path: \"search.embedding_corpus_max_characters\",\n kind: \"integer\",\n min: 1,\n summary: \"Maximum semantic corpus characters per item before truncation.\",\n },\n {\n key: \"search_embedding_batch_size\",\n path: \"search.embedding_batch_size\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of items embedded per request batch.\",\n },\n {\n key: \"search_embedding_timeout_ms\",\n path: \"search.embedding_timeout_ms\",\n kind: \"integer\",\n min: 1,\n summary: \"Per-request embedding timeout in milliseconds.\",\n },\n {\n key: \"search_score_threshold\",\n path: \"search.score_threshold\",\n kind: \"number\",\n summary: \"Minimum score for a hit to be returned (0 keeps all matches).\",\n },\n {\n key: \"search_hybrid_semantic_weight\",\n path: \"search.hybrid_semantic_weight\",\n kind: \"ratio\",\n summary: \"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword).\",\n },\n {\n key: \"search_max_results\",\n path: \"search.max_results\",\n kind: \"integer\",\n min: 1,\n summary: \"Default upper bound on search hits when --limit is not supplied.\",\n },\n {\n key: \"openai_base_url\",\n path: \"providers.openai.base_url\",\n kind: \"string\",\n summary: \"OpenAI-compatible API base URL (LM Studio/vLLM also use this).\",\n },\n {\n key: \"openai_api_key\",\n path: \"providers.openai.api_key\",\n kind: \"string\",\n summary: \"OpenAI-compatible API key.\",\n },\n {\n key: \"openai_model\",\n path: \"providers.openai.model\",\n kind: \"string\",\n summary: \"OpenAI-compatible embedding model name.\",\n },\n {\n key: \"ollama_base_url\",\n path: \"providers.ollama.base_url\",\n kind: \"string\",\n summary: \"Ollama API base URL (typically http://localhost:11434).\",\n },\n {\n key: \"ollama_model\",\n path: \"providers.ollama.model\",\n kind: \"string\",\n summary: \"Ollama embedding model name (e.g. nomic-embed-text).\",\n },\n {\n key: \"vector_store_adapter\",\n path: \"vector_store.adapter\",\n kind: \"string\",\n summary: \"Vector store adapter name (lancedb, qdrant, or an extension adapter).\",\n },\n {\n key: \"vector_store_collection_name\",\n path: \"vector_store.collection_name\",\n kind: \"string\",\n non_empty: true,\n summary: \"Vector collection/table name shared by Qdrant and LanceDB adapters.\",\n },\n {\n key: \"qdrant_url\",\n path: \"vector_store.qdrant.url\",\n kind: \"string\",\n summary: \"Qdrant HTTP API URL.\",\n },\n {\n key: \"qdrant_api_key\",\n path: \"vector_store.qdrant.api_key\",\n kind: \"string\",\n summary: \"Qdrant API key (empty if running unauthenticated).\",\n },\n {\n key: \"lancedb_path\",\n path: \"vector_store.lancedb.path\",\n kind: \"string\",\n summary: \"LanceDB storage path (relative to pm root or absolute).\",\n },\n];\n\nconst DESCRIPTOR_BY_KEY: ReadonlyMap<string, NestedSettingDescriptor> = new Map(\n NESTED_SETTING_DESCRIPTORS.map((descriptor) => [descriptor.key, descriptor]),\n);\n\n/** Canonical CLI keys (in declaration order). */\nexport const NESTED_SETTING_KEYS: readonly string[] = NESTED_SETTING_DESCRIPTORS.map(\n (descriptor) => descriptor.key,\n);\n\n/**\n * Map a raw user-supplied key (kebab or snake case, any casing) onto a known\n * nested-leaf descriptor. Returns `undefined` when the key is not a nested\n * leaf (callers can then fall back to the regular ConfigKey path).\n */\nexport function resolveNestedSettingDescriptor(raw: string | undefined): NestedSettingDescriptor | undefined {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n return undefined;\n }\n return DESCRIPTOR_BY_KEY.get(normalized);\n}\n\n/** Recoverable parsed value with the descriptor it satisfied. */\nexport interface NestedSettingParsedValue {\n descriptor: NestedSettingDescriptor;\n value: string | number | boolean;\n}\n\n/** Throwable validation error returned as a structured result. */\nexport interface NestedSettingParseError {\n message: string;\n}\n\nexport type NestedSettingParseResult =\n | { ok: true; parsed: NestedSettingParsedValue }\n | { ok: false; error: NestedSettingParseError };\n\n/**\n * Validate and coerce a raw string value for a nested-leaf setting. The\n * returned value is the typed leaf that should be written into PmSettings.\n *\n * Empty strings are allowed for \"string\" leaves unless `non_empty` is set.\n */\nexport function parseNestedSettingValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n): NestedSettingParseResult {\n if (typeof rawValue !== \"string\") {\n return { ok: false, error: { message: `Config set ${descriptor.key} requires a string value` } };\n }\n const trimmed = rawValue.trim();\n if (descriptor.kind === \"boolean\") {\n const normalized = trimmed.toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\" || normalized === \"on\") {\n return { ok: true, parsed: { descriptor, value: true } };\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\" || normalized === \"off\") {\n return { ok: true, parsed: { descriptor, value: false } };\n }\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires a boolean value (true|false), got \"${rawValue}\"`,\n },\n };\n }\n if (descriptor.kind === \"string\") {\n if (descriptor.non_empty === true && trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n if (descriptor.choices && !descriptor.choices.includes(trimmed)) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} must be one of ${descriptor.choices.join(\"|\")}, got \"${rawValue}\"`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value: trimmed } };\n }\n\n // Number(\"\") === 0, which would silently accept empty / whitespace-only input\n // as a valid zero. Reject explicitly so misconfigurations don't slip through.\n if (trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a finite number, got \"${rawValue}\"` },\n };\n }\n if (descriptor.kind === \"integer\") {\n if (!Number.isInteger(parsed) || parsed < 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-negative integer, got \"${rawValue}\"` },\n };\n }\n if (descriptor.min !== undefined && parsed < descriptor.min) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires an integer >= ${descriptor.min}, got \"${rawValue}\" (the runtime silently ignores 0 here and falls back to the default)`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n }\n if (descriptor.kind === \"ratio\") {\n if (parsed < 0 || parsed > 1) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number in [0, 1], got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n }\n // kind === \"number\" — negatives are allowed; only apply an explicit `min`.\n if (descriptor.min !== undefined && parsed < descriptor.min) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number >= ${descriptor.min}, got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n}\n\n/** Walk a dotted path on an arbitrary record (best-effort, returns null on miss). */\nexport function readNestedSettingValue(\n settings: unknown,\n descriptor: NestedSettingDescriptor,\n): string | number | boolean | null {\n const segments = descriptor.path.split(\".\");\n let cursor: unknown = settings;\n for (const segment of segments) {\n if (typeof cursor !== \"object\" || cursor === null) {\n return null;\n }\n cursor = (cursor as Record<string, unknown>)[segment];\n }\n if (typeof cursor === \"string\" || typeof cursor === \"number\" || typeof cursor === \"boolean\") {\n return cursor;\n }\n return null;\n}\n\n/**\n * Set a leaf value on a settings object by walking the descriptor's dotted\n * path. Missing intermediate objects are created. Returns `true` when the\n * value actually changed.\n */\nexport function writeNestedSettingValue(\n settings: Record<string, unknown>,\n descriptor: NestedSettingDescriptor,\n value: string | number | boolean,\n): boolean {\n const segments = descriptor.path.split(\".\");\n let cursor: Record<string, unknown> = settings;\n for (let index = 0; index < segments.length - 1; index += 1) {\n const segment = segments[index];\n const existing = cursor[segment];\n if (typeof existing !== \"object\" || existing === null || Array.isArray(existing)) {\n const next: Record<string, unknown> = {};\n cursor[segment] = next;\n cursor = next;\n } else {\n cursor = existing as Record<string, unknown>;\n }\n }\n const leafKey = segments[segments.length - 1];\n const previous = cursor[leafKey];\n if (previous === value) {\n return false;\n }\n cursor[leafKey] = value;\n return true;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA0BH;;;GAGG;;;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAuC;IAC5E;QACE,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,iFAAiF;KAC3F;IACD;QACE,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,eAAe,CAAC;QAC/D,OAAO,EAAE,yFAAyF;KACnG;IACD;QACE,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,+DAA+D;KACzE;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,+EAA+E;KACzF;IACD;QACE,GAAG,EAAE,uBAAuB;QAC5B,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,+DAA+D;KACzE;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,wDAAwD;KAClE;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,mEAAmE;KAC7E;IACD;QACE,GAAG,EAAE,wBAAwB;QAC7B,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,QAAQ;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AAC,CAAC;QACjC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjF,MAAM,IAAI,GAA4B,EAAE,CAAC;YACzC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACvB,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,QAAmC,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC","debugId":"121fa495-f276-5e11-af32-62738b88da77"}
1
+ {"version":3,"file":"nested-settings.js","sources":["core/config/nested-settings.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Nested leaf settings exposed via `pm config <scope> set/get <key> <value>`.\n *\n * These are simple string/number leaves of {@link PmSettings} (provider URLs,\n * vector-store adapter, search tuning) that previously required hand-editing\n * `.agents/pm/settings.json`. They live here so the same dotted path is\n * documented in one place and surfaced both to the config dispatcher and to\n * `pm config list` (so `pm config list --json` is discoverable).\n *\n * Shape conventions:\n * - `path` is the dotted JSON path in {@link PmSettings} (e.g. `search.provider`).\n * - `kind` is the value shape: \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\"\n * - \"ratio\" must be a finite number in [0, 1].\n * - \"integer\" must be a finite non-negative integer. Set `min: 1` for keys\n * where the runtime silently falls back when 0 is supplied (e.g. batch\n * size, timeout, max-results limits).\n * - \"number\" must be a finite number — negatives ARE allowed (e.g. score\n * thresholds may legitimately be negative when a provider normalizes\n * scores into a signed range).\n *\n * Adding a key here makes it acceptable to `pm config <scope> set <key> <value>`\n * with no other code changes — the dispatcher walks the dotted path on the\n * already-validated PmSettings shape.\n */\n\nexport type NestedSettingKind = \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\";\n\nexport interface NestedSettingDescriptor {\n /** CLI key (snake_case). Kebab-case form is accepted by normalizing `-` → `_`. */\n key: string;\n /** Dotted JSON path in PmSettings. */\n path: string;\n /** Value shape. */\n kind: NestedSettingKind;\n /** Short human-facing summary for `pm config list`. */\n summary: string;\n /** Optional accepted values for string settings. */\n choices?: readonly string[];\n /** Require a non-empty trimmed string value for string settings. */\n non_empty?: boolean;\n /**\n * Optional minimum value for `integer` / `number` kinds. When set,\n * `parseNestedSettingValue` rejects values strictly below `min`. Useful for\n * settings where 0 would be silently ignored by the runtime (batch sizes,\n * timeouts, max-results limits).\n */\n min?: number;\n}\n\n/**\n * Search/provider/vector-store leaves. Order is the display order in\n * `pm config list` and in error hints.\n */\nexport const NESTED_SETTING_DESCRIPTORS: readonly NestedSettingDescriptor[] = [\n {\n key: \"search_provider\",\n path: \"search.provider\",\n kind: \"string\",\n summary: \"Search embedding provider name (e.g. openai, ollama, or an extension provider).\",\n },\n {\n key: \"search_mutation_refresh_policy\",\n path: \"search.mutation_refresh_policy\",\n kind: \"string\",\n choices: [\"cache_only\", \"semantic_configured\", \"semantic_auto\"],\n summary: \"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto.\",\n },\n {\n key: \"search_query_expansion_enabled\",\n path: \"search.query_expansion.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable query expansion for semantic/hybrid search.\",\n },\n {\n key: \"search_query_expansion_provider\",\n path: \"search.query_expansion.provider\",\n kind: \"string\",\n summary: \"Query expansion provider name (built-in openai/ollama or extension provider).\",\n },\n {\n key: \"search_rerank_enabled\",\n path: \"search.rerank.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable post-retrieval reranking for hybrid search.\",\n },\n {\n key: \"search_rerank_model\",\n path: \"search.rerank.model\",\n kind: \"string\",\n summary: \"Rerank model name override used by built-in providers.\",\n },\n {\n key: \"search_rerank_top_k\",\n path: \"search.rerank.top_k\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of top hybrid candidates to rerank when rerank is enabled.\",\n },\n {\n key: \"search_embedding_model\",\n path: \"search.embedding_model\",\n kind: \"string\",\n summary: \"Default embedding model name (overrides provider-specific model when set).\",\n },\n {\n key: \"search_embedding_corpus_max_characters\",\n path: \"search.embedding_corpus_max_characters\",\n kind: \"integer\",\n min: 1,\n summary: \"Maximum semantic corpus characters per item before truncation.\",\n },\n {\n key: \"search_embedding_batch_size\",\n path: \"search.embedding_batch_size\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of items embedded per request batch.\",\n },\n {\n key: \"search_embedding_timeout_ms\",\n path: \"search.embedding_timeout_ms\",\n kind: \"integer\",\n min: 1,\n summary: \"Per-request embedding timeout in milliseconds.\",\n },\n {\n key: \"search_score_threshold\",\n path: \"search.score_threshold\",\n kind: \"number\",\n summary: \"Minimum score for a hit to be returned (0 keeps all matches).\",\n },\n {\n key: \"search_hybrid_semantic_weight\",\n path: \"search.hybrid_semantic_weight\",\n kind: \"ratio\",\n summary: \"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword).\",\n },\n {\n key: \"search_max_results\",\n path: \"search.max_results\",\n kind: \"integer\",\n min: 1,\n summary: \"Default upper bound on search hits when --limit is not supplied.\",\n },\n {\n key: \"openai_base_url\",\n path: \"providers.openai.base_url\",\n kind: \"string\",\n summary: \"OpenAI-compatible API base URL (LM Studio/vLLM also use this).\",\n },\n {\n key: \"openai_api_key\",\n path: \"providers.openai.api_key\",\n kind: \"string\",\n summary: \"OpenAI-compatible API key.\",\n },\n {\n key: \"openai_model\",\n path: \"providers.openai.model\",\n kind: \"string\",\n summary: \"OpenAI-compatible embedding model name.\",\n },\n {\n key: \"ollama_base_url\",\n path: \"providers.ollama.base_url\",\n kind: \"string\",\n summary: \"Ollama API base URL (typically http://localhost:11434).\",\n },\n {\n key: \"ollama_model\",\n path: \"providers.ollama.model\",\n kind: \"string\",\n summary: \"Ollama embedding model name (e.g. nomic-embed-text).\",\n },\n {\n key: \"vector_store_adapter\",\n path: \"vector_store.adapter\",\n kind: \"string\",\n summary: \"Vector store adapter name (lancedb, qdrant, or an extension adapter).\",\n },\n {\n key: \"vector_store_collection_name\",\n path: \"vector_store.collection_name\",\n kind: \"string\",\n non_empty: true,\n summary: \"Vector collection/table name shared by Qdrant and LanceDB adapters.\",\n },\n {\n key: \"qdrant_url\",\n path: \"vector_store.qdrant.url\",\n kind: \"string\",\n summary: \"Qdrant HTTP API URL.\",\n },\n {\n key: \"qdrant_api_key\",\n path: \"vector_store.qdrant.api_key\",\n kind: \"string\",\n summary: \"Qdrant API key (empty if running unauthenticated).\",\n },\n {\n key: \"lancedb_path\",\n path: \"vector_store.lancedb.path\",\n kind: \"string\",\n summary: \"LanceDB storage path (relative to pm root or absolute).\",\n },\n];\n\nconst DESCRIPTOR_BY_KEY: ReadonlyMap<string, NestedSettingDescriptor> = new Map(\n NESTED_SETTING_DESCRIPTORS.map((descriptor) => [descriptor.key, descriptor]),\n);\n\n/**\n * Map a raw user-supplied key (kebab or snake case, any casing) onto a known\n * nested-leaf descriptor. Returns `undefined` when the key is not a nested\n * leaf (callers can then fall back to the regular ConfigKey path).\n */\nexport function resolveNestedSettingDescriptor(raw: string | undefined): NestedSettingDescriptor | undefined {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n return undefined;\n }\n return DESCRIPTOR_BY_KEY.get(normalized);\n}\n\n/** Recoverable parsed value with the descriptor it satisfied. */\nexport interface NestedSettingParsedValue {\n descriptor: NestedSettingDescriptor;\n value: string | number | boolean;\n}\n\n/** Throwable validation error returned as a structured result. */\nexport interface NestedSettingParseError {\n message: string;\n}\n\nexport type NestedSettingParseResult =\n | { ok: true; parsed: NestedSettingParsedValue }\n | { ok: false; error: NestedSettingParseError };\n\n/**\n * Validate and coerce a raw string value for a nested-leaf setting. The\n * returned value is the typed leaf that should be written into PmSettings.\n *\n * Empty strings are allowed for \"string\" leaves unless `non_empty` is set.\n */\nexport function parseNestedSettingValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n): NestedSettingParseResult {\n if (typeof rawValue !== \"string\") {\n return { ok: false, error: { message: `Config set ${descriptor.key} requires a string value` } };\n }\n const trimmed = rawValue.trim();\n if (descriptor.kind === \"boolean\") {\n const normalized = trimmed.toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\" || normalized === \"on\") {\n return { ok: true, parsed: { descriptor, value: true } };\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\" || normalized === \"off\") {\n return { ok: true, parsed: { descriptor, value: false } };\n }\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires a boolean value (true|false), got \"${rawValue}\"`,\n },\n };\n }\n if (descriptor.kind === \"string\") {\n if (descriptor.non_empty === true && trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n if (descriptor.choices && !descriptor.choices.includes(trimmed)) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} must be one of ${descriptor.choices.join(\"|\")}, got \"${rawValue}\"`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value: trimmed } };\n }\n\n // Number(\"\") === 0, which would silently accept empty / whitespace-only input\n // as a valid zero. Reject explicitly so misconfigurations don't slip through.\n if (trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a finite number, got \"${rawValue}\"` },\n };\n }\n if (descriptor.kind === \"integer\") {\n if (!Number.isInteger(parsed) || parsed < 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-negative integer, got \"${rawValue}\"` },\n };\n }\n if (descriptor.min !== undefined && parsed < descriptor.min) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires an integer >= ${descriptor.min}, got \"${rawValue}\" (the runtime silently ignores 0 here and falls back to the default)`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n }\n if (descriptor.kind === \"ratio\") {\n if (parsed < 0 || parsed > 1) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number in [0, 1], got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n }\n // kind === \"number\" — negatives are allowed; only apply an explicit `min`.\n if (descriptor.min !== undefined && parsed < descriptor.min) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number >= ${descriptor.min}, got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value: parsed } };\n}\n\n/** Walk a dotted path on an arbitrary record (best-effort, returns null on miss). */\nexport function readNestedSettingValue(\n settings: unknown,\n descriptor: NestedSettingDescriptor,\n): string | number | boolean | null {\n const segments = descriptor.path.split(\".\");\n let cursor: unknown = settings;\n for (const segment of segments) {\n if (typeof cursor !== \"object\" || cursor === null) {\n return null;\n }\n cursor = (cursor as Record<string, unknown>)[segment];\n }\n if (typeof cursor === \"string\" || typeof cursor === \"number\" || typeof cursor === \"boolean\") {\n return cursor;\n }\n return null;\n}\n\n/**\n * Set a leaf value on a settings object by walking the descriptor's dotted\n * path. Missing intermediate objects are created. Returns `true` when the\n * value actually changed.\n */\nexport function writeNestedSettingValue(\n settings: Record<string, unknown>,\n descriptor: NestedSettingDescriptor,\n value: string | number | boolean,\n): boolean {\n const segments = descriptor.path.split(\".\");\n let cursor: Record<string, unknown> = settings;\n for (let index = 0; index < segments.length - 1; index += 1) {\n const segment = segments[index];\n const existing = cursor[segment];\n if (typeof existing !== \"object\" || existing === null || Array.isArray(existing)) {\n const next: Record<string, unknown> = {};\n cursor[segment] = next;\n cursor = next;\n } else {\n cursor = existing as Record<string, unknown>;\n }\n }\n const leafKey = segments[segments.length - 1];\n const previous = cursor[leafKey];\n if (previous === value) {\n return false;\n }\n cursor[leafKey] = value;\n return true;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA0BH;;;GAGG;;;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAuC;IAC5E;QACE,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,iFAAiF;KAC3F;IACD;QACE,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,eAAe,CAAC;QAC/D,OAAO,EAAE,yFAAyF;KACnG;IACD;QACE,GAAG,EAAE,gCAAgC;QACrC,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,+DAA+D;KACzE;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,+EAA+E;KACzF;IACD;QACE,GAAG,EAAE,uBAAuB;QAC5B,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,+DAA+D;KACzE;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,wDAAwD;KAClE;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,mEAAmE;KAC7E;IACD;QACE,GAAG,EAAE,wBAAwB;QAC7B,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,QAAQ;QACd,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,GAA4B,EAAE,CAAC;YACzC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACvB,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,QAAmC,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACxB,OAAO,IAAI,CAAC;AACd,CAAC","debugId":"1bb81b8a-b034-5aec-aa16-d395bac81342"}
@@ -24,7 +24,7 @@
24
24
  * intentionally excluded here (see pm-0hnu: "all non-extension checks").
25
25
  */
26
26
 
27
- !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]="e7af63b5-6c1c-55f2-bafc-027531d5725f")}catch(e){}}();
27
+ !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]="88ac4364-7d22-5199-8b9b-c6f40eb50d8b")}catch(e){}}();
28
28
  export const REMEDIATION_REGISTRY = Object.freeze([
29
29
  // --- pm health: directories ---
30
30
  {
@@ -85,6 +85,11 @@ export const REMEDIATION_REGISTRY = Object.freeze([
85
85
  command: "pm health --check-telemetry",
86
86
  summary: "The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.",
87
87
  },
88
+ {
89
+ code: "telemetry_schema_version_behind",
90
+ command: "pm health --check-telemetry",
91
+ summary: "Client schema is behind server; upgrade pm-cli to emit the latest event shape.",
92
+ },
88
93
  // --- pm health: integrity ---
89
94
  {
90
95
  code: "integrity_item_unreadable",
@@ -325,4 +330,4 @@ export function buildRemediationCommands(warnings) {
325
330
  return Object.values(buildRemediationMap(warnings));
326
331
  }
327
332
  //# sourceMappingURL=remediation.js.map
328
- //# debugId=e7af63b5-6c1c-55f2-bafc-027531d5725f
333
+ //# debugId=88ac4364-7d22-5199-8b9b-c6f40eb50d8b
@@ -1 +1 @@
1
- {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it.\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain.\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain.\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain.\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,6GAA6G;KACvH;IACD,qCAAqC;IACrC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,yGAAyG;KACnH;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,0FAA0F;KACpG;IACD,0CAA0C;IAC1C;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,0FAA0F;KACpG;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,8FAA8F;KACxG;IACD;QACE,IAAI,EAAE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;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,oBAAoB,EAAE,CAAC;QACzC,IAAI,UAAU,KAAK,KAAK,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA0B;IAC5D,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"e7af63b5-6c1c-55f2-bafc-027531d5725f"}
1
+ {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it.\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain.\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain.\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain.\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QA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IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"88ac4364-7d22-5199-8b9b-c6f40eb50d8b"}
@@ -1,6 +1,6 @@
1
1
 
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]="24293159-379b-5416-a184-9ed7ef02ca92")}catch(e){}}();
3
- import fs from "node:fs/promises";
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]="8b4dd1a6-7645-5c6e-afd3-f4c23fe19182")}catch(e){}}();
3
+ import * as fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import crypto from "node:crypto";
6
6
  export async function ensureDir(dirPath) {
@@ -31,7 +31,32 @@ export async function writeFileAtomic(targetPath, contents) {
31
31
  await ensureDir(dirPath);
32
32
  const tempPath = path.join(dirPath, `.${path.basename(targetPath)}.${process.pid}.${Date.now()}.${crypto.randomBytes(4).toString("hex")}.tmp`);
33
33
  await fs.writeFile(tempPath, contents, "utf8");
34
- await fs.rename(tempPath, targetPath);
34
+ try {
35
+ await fs.rename(tempPath, targetPath);
36
+ }
37
+ catch (error) {
38
+ if (isErrno(error, "EXDEV")) {
39
+ try {
40
+ await fs.copyFile(tempPath, targetPath);
41
+ }
42
+ finally {
43
+ try {
44
+ await fs.unlink(tempPath);
45
+ }
46
+ catch {
47
+ // Best-effort cleanup only.
48
+ }
49
+ }
50
+ return;
51
+ }
52
+ try {
53
+ await fs.unlink(tempPath);
54
+ }
55
+ catch {
56
+ // Best-effort cleanup only.
57
+ }
58
+ throw error;
59
+ }
35
60
  }
36
61
  export async function appendLineAtomic(targetPath, line) {
37
62
  const dirPath = path.dirname(targetPath);
@@ -58,4 +83,4 @@ function isErrno(error, code) {
58
83
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
59
84
  }
60
85
  //# sourceMappingURL=fs-utils.js.map
61
- //# debugId=24293159-379b-5416-a184-9ed7ef02ca92
86
+ //# debugId=8b4dd1a6-7645-5c6e-afd3-f4c23fe19182
@@ -1 +1 @@
1
- {"version":3,"file":"fs-utils.js","sources":["core/fs/fs-utils.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport crypto from \"node:crypto\";\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function pathExists(targetPath: string): Promise<boolean> {\n try {\n await fs.access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readFileIfExists(targetPath: string): Promise<string | null> {\n try {\n return await fs.readFile(targetPath, \"utf8\");\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return null;\n }\n throw error;\n }\n}\n\nexport async function writeFileAtomic(targetPath: string, contents: string): Promise<void> {\n const dirPath = path.dirname(targetPath);\n await ensureDir(dirPath);\n const tempPath = path.join(\n dirPath,\n `.${path.basename(targetPath)}.${process.pid}.${Date.now()}.${crypto.randomBytes(4).toString(\"hex\")}.tmp`,\n );\n await fs.writeFile(tempPath, contents, \"utf8\");\n await fs.rename(tempPath, targetPath);\n}\n\nexport async function appendLineAtomic(targetPath: string, line: string): Promise<void> {\n const dirPath = path.dirname(targetPath);\n await ensureDir(dirPath);\n const handle = await fs.open(targetPath, \"a\");\n try {\n await handle.writeFile(`${line}\\n`, \"utf8\");\n } finally {\n await handle.close();\n }\n}\n\nexport async function removeFileIfExists(targetPath: string): Promise<void> {\n try {\n await fs.unlink(targetPath);\n } catch (error: unknown) {\n if (!isErrno(error, \"ENOENT\")) {\n throw error;\n }\n }\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAkB;IACjD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAkB;IACvD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CA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EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,IAAY;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAK,KAA2B,CAAC,IAAI,KAAK,IAAI,CAAC;AACtH,CAAC","debugId":"24293159-379b-5416-a184-9ed7ef02ca92"}
1
+ {"version":3,"file":"fs-utils.js","sources":["core/fs/fs-utils.ts"],"sourceRoot":"/","sourcesContent":["import * as fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport crypto from \"node:crypto\";\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function pathExists(targetPath: string): Promise<boolean> {\n try {\n await fs.access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readFileIfExists(targetPath: string): Promise<string | null> {\n try {\n return await fs.readFile(targetPath, \"utf8\");\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return null;\n }\n throw error;\n }\n}\n\nexport async function writeFileAtomic(targetPath: string, contents: string): Promise<void> {\n const dirPath = path.dirname(targetPath);\n await ensureDir(dirPath);\n const tempPath = path.join(\n dirPath,\n `.${path.basename(targetPath)}.${process.pid}.${Date.now()}.${crypto.randomBytes(4).toString(\"hex\")}.tmp`,\n );\n await fs.writeFile(tempPath, contents, \"utf8\");\n try {\n await fs.rename(tempPath, targetPath);\n } catch (error: unknown) {\n if (isErrno(error, \"EXDEV\")) {\n try {\n await fs.copyFile(tempPath, targetPath);\n } finally {\n try {\n await fs.unlink(tempPath);\n } catch {\n // Best-effort cleanup only.\n }\n }\n return;\n }\n try {\n await fs.unlink(tempPath);\n } catch {\n // Best-effort cleanup only.\n }\n throw error;\n }\n}\n\nexport async function appendLineAtomic(targetPath: string, line: string): Promise<void> {\n const dirPath = path.dirname(targetPath);\n await ensureDir(dirPath);\n const handle = await fs.open(targetPath, \"a\");\n try {\n await handle.writeFile(`${line}\\n`, \"utf8\");\n } finally {\n await handle.close();\n }\n}\n\nexport async function removeFileIfExists(targetPath: string): Promise<void> {\n try {\n await fs.unlink(targetPath);\n } catch (error: unknown) {\n if (!isErrno(error, \"ENOENT\")) {\n throw error;\n }\n }\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAkB;IACjD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAkB;IACvD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,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AAC;IACzC,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,UAAkB;IACzD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAE,IAAY;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAK,KAA2B,CAAC,IAAI,KAAK,IAAI,CAAC;AACtH,CAAC","debugId":"8b4dd1a6-7645-5c6e-afd3-f4c23fe19182"}
@@ -1,3 +1,13 @@
1
1
  export declare function findPmPackageRootFromPath(startPath: string): string | undefined;
2
2
  export declare function resolvePmPackageRootFromModule(metaUrl: string, fallbackRelativeSegments?: string[]): string;
3
+ /**
4
+ * Read the pm-cli package version from the resolved package root's `package.json`.
5
+ *
6
+ * Centralizes the read+parse+guard logic shared by the CLI banner, the Sentry
7
+ * release tag, the MCP `serverInfo`, and the upgrade check so they never drift.
8
+ * Returns `undefined` when the version cannot be resolved; callers supply their
9
+ * own fallback (the CLI/MCP use `"0.0.0"`). Resolution must never throw, so the
10
+ * hot startup path is safe.
11
+ */
12
+ export declare function resolvePmCliVersion(metaUrl: string, fallbackRelativeSegments?: string[]): string | undefined;
3
13
  export declare function resolveConfiguredPmPackageRoot(env?: NodeJS.ProcessEnv, envName?: string, metaUrl?: string, fallbackRelativeSegments?: string[]): string;
@@ -1,5 +1,5 @@
1
1
 
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]="20b7827b-6f96-518c-8df3-b699d41dec88")}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]="71eb0333-ba65-5a8a-aafe-a5ec10f24a8a")}catch(e){}}();
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -37,6 +37,28 @@ export function resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments
37
37
  }
38
38
  return path.resolve(path.dirname(modulePath), ...fallbackRelativeSegments);
39
39
  }
40
+ /**
41
+ * Read the pm-cli package version from the resolved package root's `package.json`.
42
+ *
43
+ * Centralizes the read+parse+guard logic shared by the CLI banner, the Sentry
44
+ * release tag, the MCP `serverInfo`, and the upgrade check so they never drift.
45
+ * Returns `undefined` when the version cannot be resolved; callers supply their
46
+ * own fallback (the CLI/MCP use `"0.0.0"`). Resolution must never throw, so the
47
+ * hot startup path is safe.
48
+ */
49
+ export function resolvePmCliVersion(metaUrl, fallbackRelativeSegments = []) {
50
+ try {
51
+ const packageJsonPath = path.join(resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments), "package.json");
52
+ if (!fs.existsSync(packageJsonPath)) {
53
+ return undefined;
54
+ }
55
+ const parsed = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
56
+ return typeof parsed.version === "string" && parsed.version.trim().length > 0 ? parsed.version : undefined;
57
+ }
58
+ catch {
59
+ return undefined;
60
+ }
61
+ }
40
62
  export function resolveConfiguredPmPackageRoot(env = process.env, envName = "PM_CLI_PACKAGE_ROOT", metaUrl, fallbackRelativeSegments = []) {
41
63
  const envRoot = env[envName];
42
64
  if (typeof envRoot === "string" && envRoot.trim().length > 0) {
@@ -48,4 +70,4 @@ export function resolveConfiguredPmPackageRoot(env = process.env, envName = "PM_
48
70
  return process.cwd();
49
71
  }
50
72
  //# sourceMappingURL=root.js.map
51
- //# debugId=20b7827b-6f96-518c-8df3-b699d41dec88
73
+ //# debugId=71eb0333-ba65-5a8a-aafe-a5ec10f24a8a
@@ -1 +1 @@
1
- {"version":3,"file":"root.js","sources":["core/packages/root.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst PM_CLI_PACKAGE_NAME = \"@unbrained/pm-cli\";\n\nfunction packageJsonNamesPmCli(packageJsonPath: string): boolean {\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as { name?: unknown };\n return parsed.name === PM_CLI_PACKAGE_NAME;\n } catch {\n return false;\n }\n}\n\nexport function findPmPackageRootFromPath(startPath: string): string | undefined {\n let current = fs.existsSync(startPath) && fs.statSync(startPath).isDirectory()\n ? path.resolve(startPath)\n : path.dirname(path.resolve(startPath));\n\n while (true) {\n const packageJsonPath = path.join(current, \"package.json\");\n if (fs.existsSync(packageJsonPath) && packageJsonNamesPmCli(packageJsonPath)) {\n return current;\n }\n\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nexport function resolvePmPackageRootFromModule(metaUrl: string, fallbackRelativeSegments: string[] = []): string {\n const modulePath = fileURLToPath(metaUrl);\n const discovered = findPmPackageRootFromPath(modulePath);\n if (discovered) {\n return discovered;\n }\n return path.resolve(path.dirname(modulePath), ...fallbackRelativeSegments);\n}\n\nexport function resolveConfiguredPmPackageRoot(\n env: NodeJS.ProcessEnv = process.env,\n envName = \"PM_CLI_PACKAGE_ROOT\",\n metaUrl?: string,\n fallbackRelativeSegments: string[] = [],\n): string {\n const envRoot = env[envName];\n if (typeof envRoot === \"string\" && envRoot.trim().length > 0) {\n return path.resolve(envRoot.trim());\n }\n if (metaUrl) {\n return resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments);\n }\n return process.cwd();\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEhD,SAAS,qBAAqB,CAAC,eAAuB;IACpD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAuB,CAAC;QAC1F,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAmB,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,SAAiB;IACzD,IAAI,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAC5E,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,qBAAqB,C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import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst PM_CLI_PACKAGE_NAME = \"@unbrained/pm-cli\";\n\nfunction packageJsonNamesPmCli(packageJsonPath: string): boolean {\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as { name?: unknown };\n return parsed.name === PM_CLI_PACKAGE_NAME;\n } catch {\n return false;\n }\n}\n\nexport function findPmPackageRootFromPath(startPath: string): string | undefined {\n let current = fs.existsSync(startPath) && fs.statSync(startPath).isDirectory()\n ? path.resolve(startPath)\n : path.dirname(path.resolve(startPath));\n\n while (true) {\n const packageJsonPath = path.join(current, \"package.json\");\n if (fs.existsSync(packageJsonPath) && packageJsonNamesPmCli(packageJsonPath)) {\n return current;\n }\n\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nexport function resolvePmPackageRootFromModule(metaUrl: string, fallbackRelativeSegments: string[] = []): string {\n const modulePath = fileURLToPath(metaUrl);\n const discovered = findPmPackageRootFromPath(modulePath);\n if (discovered) {\n return discovered;\n }\n return path.resolve(path.dirname(modulePath), ...fallbackRelativeSegments);\n}\n\n/**\n * Read the pm-cli package version from the resolved package root's `package.json`.\n *\n * Centralizes the read+parse+guard logic shared by the CLI banner, the Sentry\n * release tag, the MCP `serverInfo`, and the upgrade check so they never drift.\n * Returns `undefined` when the version cannot be resolved; callers supply their\n * own fallback (the CLI/MCP use `\"0.0.0\"`). Resolution must never throw, so the\n * hot startup path is safe.\n */\nexport function resolvePmCliVersion(metaUrl: string, fallbackRelativeSegments: string[] = []): string | undefined {\n try {\n const packageJsonPath = path.join(resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments), \"package.json\");\n if (!fs.existsSync(packageJsonPath)) {\n return undefined;\n }\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as { version?: unknown };\n return typeof parsed.version === \"string\" && parsed.version.trim().length > 0 ? parsed.version : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function resolveConfiguredPmPackageRoot(\n env: NodeJS.ProcessEnv = process.env,\n envName = \"PM_CLI_PACKAGE_ROOT\",\n metaUrl?: string,\n fallbackRelativeSegments: string[] = [],\n): string {\n const envRoot = env[envName];\n if (typeof envRoot === \"string\" && envRoot.trim().length > 0) {\n return path.resolve(envRoot.trim());\n }\n if (metaUrl) {\n return resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments);\n }\n return process.cwd();\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEhD,SAAS,qBAAqB,CAAC,eAAuB;IACpD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAuB,CAAC;QAC1F,OAAO,MAAM,CAAC,IAAI,KAAK,mBAAmB,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,SAAiB;IACzD,IAAI,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAC5E,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC3D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAA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IAC7G,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,MAAyB,OAAO,CAAC,GAAG,EACpC,OAAO,GAAG,qBAAqB,EAC/B,OAAgB,EAChB,2BAAqC,EAAE;IAEvC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,8BAA8B,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC","debugId":"71eb0333-ba65-5a8a-aafe-a5ec10f24a8a"}
@@ -1,5 +1,5 @@
1
1
 
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]="11167959-e632-5d72-a6d1-103f6a7d50ef")}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]="221fcd13-8553-5c32-a2d8-2845d0f71047")}catch(e){}}();
3
3
  import path from "node:path";
4
4
  import { pathExists, readFileIfExists, writeFileAtomic } from "../fs/fs-utils.js";
5
5
  import { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from "../shared/constants.js";
@@ -400,10 +400,7 @@ export async function loadRuntimeSchemaFromOptionalFiles(pmRoot, schema) {
400
400
  const statusFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);
401
401
  const fieldsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);
402
402
  const workflowsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows);
403
- const typeDefinitionsFromFile = (() => {
404
- return undefined;
405
- })();
406
- let loadedTypeDefinitions = typeDefinitionsFromFile;
403
+ let loadedTypeDefinitions;
407
404
  let loadedStatuses;
408
405
  let loadedFields;
409
406
  let loadedWorkflow;
@@ -599,4 +596,4 @@ export function statusIsTerminal(status, registry) {
599
596
  return registry.terminal_statuses.has(normalized);
600
597
  }
601
598
  //# sourceMappingURL=runtime-schema.js.map
602
- //# debugId=11167959-e632-5d72-a6d1-103f6a7d50ef
599
+ //# debugId=221fcd13-8553-5c32-a2d8-2845d0f71047