@unbrained/pm-cli 2026.6.19 → 2026.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (545) hide show
  1. package/CHANGELOG.md +328 -258
  2. package/README.md +1 -1
  3. package/dist/cli/bootstrap-args.d.ts +12 -1
  4. package/dist/cli/bootstrap-args.js +20 -9
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.js +31 -25
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/completion.js +3 -3
  9. package/dist/cli/commands/completion.js.map +1 -1
  10. package/dist/cli/commands/contracts.js +4 -3
  11. package/dist/cli/commands/contracts.js.map +1 -1
  12. package/dist/cli/commands/eval.d.ts +62 -0
  13. package/dist/cli/commands/eval.js +158 -0
  14. package/dist/cli/commands/eval.js.map +1 -0
  15. package/dist/cli/commands/extension/install-sources.d.ts +12 -0
  16. package/dist/cli/commands/extension/install-sources.js +77 -10
  17. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  18. package/dist/cli/commands/extension/scaffold.js +49 -3
  19. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  20. package/dist/cli/commands/extension.js +9 -2
  21. package/dist/cli/commands/extension.js.map +1 -1
  22. package/dist/cli/commands/gc.d.ts +12 -1
  23. package/dist/cli/commands/gc.js +53 -6
  24. package/dist/cli/commands/gc.js.map +1 -1
  25. package/dist/cli/commands/health.js +27 -9
  26. package/dist/cli/commands/health.js.map +1 -1
  27. package/dist/cli/commands/index.d.ts +1 -0
  28. package/dist/cli/commands/index.js +3 -2
  29. package/dist/cli/commands/index.js.map +1 -1
  30. package/dist/cli/commands/linked-artifacts.js +13 -3
  31. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  32. package/dist/cli/commands/list.js +12 -9
  33. package/dist/cli/commands/list.js.map +1 -1
  34. package/dist/cli/commands/plan.js +2 -2
  35. package/dist/cli/commands/plan.js.map +1 -1
  36. package/dist/cli/commands/restore.js +5 -11
  37. package/dist/cli/commands/restore.js.map +1 -1
  38. package/dist/cli/commands/search.d.ts +39 -1
  39. package/dist/cli/commands/search.js +89 -12
  40. package/dist/cli/commands/search.js.map +1 -1
  41. package/dist/cli/commands/update.js +96 -58
  42. package/dist/cli/commands/update.js.map +1 -1
  43. package/dist/cli/commands/validate.d.ts +1 -1
  44. package/dist/cli/commands/validate.js +44 -2
  45. package/dist/cli/commands/validate.js.map +1 -1
  46. package/dist/cli/extension-command-help.d.ts +9 -0
  47. package/dist/cli/extension-command-help.js +13 -2
  48. package/dist/cli/extension-command-help.js.map +1 -1
  49. package/dist/cli/extension-command-options.d.ts +8 -0
  50. package/dist/cli/extension-command-options.js +27 -2
  51. package/dist/cli/extension-command-options.js.map +1 -1
  52. package/dist/cli/help-content.js +15 -2
  53. package/dist/cli/help-content.js.map +1 -1
  54. package/dist/cli/main.d.ts +12 -0
  55. package/dist/cli/main.js +49 -9
  56. package/dist/cli/main.js.map +1 -1
  57. package/dist/cli/register-list-query.js +34 -4
  58. package/dist/cli/register-list-query.js.map +1 -1
  59. package/dist/cli/register-operations.js +3 -3
  60. package/dist/cli/register-operations.js.map +1 -1
  61. package/dist/cli-bundle/chunks/activity-CIHV64UC.js +18 -0
  62. package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js → activity-KW3IRP44.js} +11 -11
  63. package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js → aggregate-3ZKQG5SW.js} +10 -10
  64. package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js → aggregate-FIGQEIL3.js} +10 -10
  65. package/dist/cli-bundle/chunks/{append-BP2ARHOK.js → append-EWJYJ7CH.js} +8 -8
  66. package/dist/cli-bundle/chunks/{append-5U3XR5SD.js → append-QEOLX3XB.js} +8 -8
  67. package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js → chunk-2EIMPCE4.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-MAKOMXVM.js → chunk-2GCDRRIF.js} +106 -67
  69. package/dist/cli-bundle/chunks/chunk-2GCDRRIF.js.map +1 -0
  70. package/dist/cli-bundle/chunks/{search-AZR2JITW.js → chunk-2PKHRP6G.js} +190 -22
  71. package/dist/cli-bundle/chunks/chunk-2PKHRP6G.js.map +7 -0
  72. package/dist/cli-bundle/chunks/{chunk-YWAYOWDQ.js → chunk-32R4PIC6.js} +118 -15
  73. package/dist/cli-bundle/chunks/chunk-32R4PIC6.js.map +1 -0
  74. package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js → chunk-37QXHBIB.js} +3 -3
  75. package/dist/cli-bundle/chunks/{chunk-UCNEPMPY.js → chunk-3EWSGA7N.js} +105 -66
  76. package/dist/cli-bundle/chunks/chunk-3EWSGA7N.js.map +7 -0
  77. package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js → chunk-3MDHREEV.js} +3 -3
  78. package/dist/cli-bundle/chunks/{chunk-I2VJM36R.js → chunk-434HM6Z5.js} +21 -21
  79. package/dist/cli-bundle/chunks/chunk-434HM6Z5.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{chunk-Y4IBSEQ2.js → chunk-52OCIDPG.js} +20 -8
  81. package/dist/cli-bundle/chunks/chunk-52OCIDPG.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js → chunk-5FIEHKEX.js} +5 -5
  83. package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js → chunk-5IDI42VV.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-UA4ANRJY.js → chunk-5PCI3UBT.js} +119 -16
  85. package/dist/cli-bundle/chunks/chunk-5PCI3UBT.js.map +7 -0
  86. package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js → chunk-5QICDWMV.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js → chunk-6CJWZAN7.js} +7 -7
  88. package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js → chunk-6H4LF7AO.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js → chunk-6M4RJS4M.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-4BFNWAMQ.js → chunk-6ZXM2XNF.js} +29 -12
  91. package/dist/cli-bundle/chunks/chunk-6ZXM2XNF.js.map +7 -0
  92. package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js → chunk-76Z3YSHV.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js → chunk-7D3SAQXM.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-DVUU3AHP.js → chunk-A4Z7ZOL5.js} +17 -6
  95. package/dist/cli-bundle/chunks/chunk-A4Z7ZOL5.js.map +1 -0
  96. package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js → chunk-AIS5PGI3.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js → chunk-AZMOLBN3.js} +7 -7
  98. package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js → chunk-B473GZWW.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js → chunk-C3AZ5ZML.js} +15 -15
  100. package/dist/cli-bundle/chunks/{chunk-S673PVHD.js → chunk-C4N5I7ZW.js} +3 -3
  101. package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js → chunk-CF55WVVS.js} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js → chunk-CZPXY7UW.js} +3 -3
  103. package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js → chunk-CZUB4XWO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js → chunk-D7FYS6PG.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-5SRID7DV.js → chunk-EBH56IXK.js} +29 -12
  106. package/dist/cli-bundle/chunks/chunk-EBH56IXK.js.map +1 -0
  107. package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js → chunk-F5NZWFSW.js} +7 -7
  108. package/dist/cli-bundle/chunks/{chunk-PSWSQHM7.js → chunk-F7K5GWP3.js} +15 -19
  109. package/dist/cli-bundle/chunks/chunk-F7K5GWP3.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js → chunk-FKBDKV7Y.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js → chunk-FRUFKWNK.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js → chunk-FWPDUYEY.js} +7 -7
  113. package/dist/cli-bundle/chunks/{search-2JX776KX.js → chunk-GMHPNNYG.js} +184 -23
  114. package/dist/cli-bundle/chunks/chunk-GMHPNNYG.js.map +1 -0
  115. package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js → chunk-GOZUHWFD.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js → chunk-H7NJZWG2.js} +15 -15
  117. package/dist/cli-bundle/chunks/{chunk-FPQA4ZMA.js → chunk-HC4AWIKT.js} +18 -7
  118. package/dist/cli-bundle/chunks/chunk-HC4AWIKT.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js → chunk-HCU6WUSY.js} +9 -9
  120. package/dist/cli-bundle/chunks/{chunk-2RI3BDFK.js → chunk-HIP7WVTL.js} +10 -9
  121. package/dist/cli-bundle/chunks/chunk-HIP7WVTL.js.map +7 -0
  122. package/dist/cli-bundle/chunks/{chunk-5QLHQK7V.js → chunk-HMOADQVT.js} +26 -26
  123. package/dist/cli-bundle/chunks/chunk-HMOADQVT.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-K5TD74VU.js → chunk-J4MYYSOL.js} +19 -7
  125. package/dist/cli-bundle/chunks/chunk-J4MYYSOL.js.map +7 -0
  126. package/dist/cli-bundle/chunks/{chunk-GDOTTY2S.js → chunk-JINYH2DB.js} +40 -2
  127. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-EMFDZ7N3.js → chunk-LEU5GHRC.js} +55 -5
  129. package/dist/cli-bundle/chunks/chunk-LEU5GHRC.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js → chunk-LUWW7L4B.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js → chunk-M5XALUSL.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js → chunk-N5ZJACJ6.js} +8 -8
  133. package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js → chunk-NB3PYLQ6.js} +7 -5
  134. package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js → chunk-NIGXMNNI.js} +2 -2
  135. package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js → chunk-NIUEXCFS.js} +6 -6
  136. package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js → chunk-NJHMAJ6N.js} +8 -8
  137. package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js → chunk-NJN7LL7U.js} +5 -5
  138. package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js → chunk-NSBZ2CKF.js} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-ZZEM2PH7.js → chunk-NXS7ZKAK.js} +19 -14
  140. package/dist/cli-bundle/chunks/chunk-NXS7ZKAK.js.map +1 -0
  141. package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js → chunk-O47BPOPC.js} +2 -2
  142. package/dist/cli-bundle/chunks/{chunk-X26ODPU4.js → chunk-OFYMIDF2.js} +14 -18
  143. package/dist/cli-bundle/chunks/chunk-OFYMIDF2.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js → chunk-OTHIWLMB.js} +7 -5
  145. package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js → chunk-PFSRUHDH.js} +9 -9
  146. package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js → chunk-PP2U4NMT.js} +5 -5
  147. package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js → chunk-PUH4D67U.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js → chunk-Q2J2HJUN.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-QSH34DSQ.js → chunk-QGG32QHW.js} +61 -4
  150. package/dist/cli-bundle/chunks/chunk-QGG32QHW.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js → chunk-QQHISQBJ.js} +3 -3
  152. package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js → chunk-QZTWBFXJ.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-COHNQLB2.js → chunk-R2EMWY7Q.js} +41 -3
  154. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js → chunk-RLK7P77C.js} +5 -5
  156. package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js → chunk-RVHYI7SL.js} +8 -8
  157. package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js → chunk-SBGXDO7A.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js → chunk-SRYYRVPB.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js → chunk-SX75ADBK.js} +6 -6
  160. package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js → chunk-TKBHZPKD.js} +3 -3
  161. package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js → chunk-UEMNL33O.js} +8 -8
  162. package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js → chunk-UPE3CDD7.js} +7 -7
  163. package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js → chunk-UV6IYE5U.js} +2 -2
  164. package/dist/cli-bundle/chunks/{chunk-YOGXK3ON.js → chunk-WQ7NIVDK.js} +18 -13
  165. package/dist/cli-bundle/chunks/chunk-WQ7NIVDK.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js → chunk-YCJX76PW.js} +2 -2
  167. package/dist/cli-bundle/chunks/{chunk-FP7YLQ52.js → chunk-Z6T4PQI2.js} +11 -10
  168. package/dist/cli-bundle/chunks/chunk-Z6T4PQI2.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js → claim-RC56YUWG.js} +10 -10
  170. package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js → claim-THOJ6CMV.js} +10 -10
  171. package/dist/cli-bundle/chunks/close-DNMHGOCX.js +15 -0
  172. package/dist/cli-bundle/chunks/{close-3TSX6BYF.js → close-SG5MNCVQ.js} +8 -8
  173. package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js → close-many-3L3AQZBU.js} +15 -15
  174. package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js → close-many-DKQLBGLV.js} +15 -15
  175. package/dist/cli-bundle/chunks/{comments-M7PAINZT.js → comments-M7ZOZNBX.js} +10 -10
  176. package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js → comments-SKWMDWCW.js} +10 -10
  177. package/dist/cli-bundle/chunks/{config-YICACPHA.js → config-7CK62S7T.js} +30 -10
  178. package/dist/cli-bundle/chunks/config-7CK62S7T.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{config-UWF3KRP5.js → config-OZCUABPB.js} +29 -9
  180. package/dist/cli-bundle/chunks/config-OZCUABPB.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{context-EGUGU4K7.js → context-OEC366TO.js} +13 -13
  182. package/dist/cli-bundle/chunks/{context-V32ZAPL6.js → context-PUG2A7RC.js} +13 -13
  183. package/dist/cli-bundle/chunks/{contracts-B2YWYUV5.js → contracts-3THOLA7L.js} +10 -8
  184. package/dist/cli-bundle/chunks/contracts-3THOLA7L.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{contracts-7G553BHP.js → contracts-N65FXEOL.js} +10 -8
  186. package/dist/cli-bundle/chunks/contracts-N65FXEOL.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js → copy-6QLHILAC.js} +7 -7
  188. package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js → copy-JPX7VZCH.js} +7 -7
  189. package/dist/cli-bundle/chunks/create-NNP6TSFO.js +30 -0
  190. package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js → create-Y54ZVVZH.js} +14 -14
  191. package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js → delete-63PCMQAJ.js} +7 -7
  192. package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js → delete-GDSMGAGJ.js} +7 -7
  193. package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js → deps-T4ZF5G54.js} +7 -7
  194. package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js → deps-XYQ73XRH.js} +7 -7
  195. package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js → docs-C75YIXHC.js} +10 -9
  196. package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js.map → docs-C75YIXHC.js.map} +1 -1
  197. package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js → docs-EHNPDWUL.js} +12 -11
  198. package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js.map → docs-EHNPDWUL.js.map} +1 -1
  199. package/dist/cli-bundle/chunks/eval-3WKDTRMH.js +276 -0
  200. package/dist/cli-bundle/chunks/eval-3WKDTRMH.js.map +1 -0
  201. package/dist/cli-bundle/chunks/eval-GTENKE24.js +286 -0
  202. package/dist/cli-bundle/chunks/eval-GTENKE24.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js → extension-46NWACO3.js} +5 -5
  204. package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js → extension-D5FDZ2CO.js} +5 -5
  205. package/dist/cli-bundle/chunks/{files-TXEQOA7C.js → files-DSZBOSSN.js} +12 -11
  206. package/dist/cli-bundle/chunks/{files-TXEQOA7C.js.map → files-DSZBOSSN.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{files-UAZFB3EA.js → files-X3H7CCBQ.js} +10 -9
  208. package/dist/cli-bundle/chunks/{files-UAZFB3EA.js.map → files-X3H7CCBQ.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{focus-UGROAMAX.js → focus-5STQXDPU.js} +8 -8
  210. package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js → focus-MDVPOWB5.js} +8 -8
  211. package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js +395 -0
  212. package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js.map +7 -0
  213. package/dist/cli-bundle/chunks/gc-ZMST3WQP.js +385 -0
  214. package/dist/cli-bundle/chunks/gc-ZMST3WQP.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{get-OTXPLWYW.js → get-J2IPJRZW.js} +11 -11
  216. package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js → get-NT7L2HUZ.js} +11 -11
  217. package/dist/cli-bundle/chunks/{health-PPTJ7XKW.js → health-IVMA3XQC.js} +38 -26
  218. package/dist/cli-bundle/chunks/health-IVMA3XQC.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{health-JEBESKID.js → health-WOYBR3KU.js} +37 -25
  220. package/dist/cli-bundle/chunks/health-WOYBR3KU.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{history-HNWBUDMI.js → history-RLH2QCRO.js} +10 -10
  222. package/dist/cli-bundle/chunks/history-WX3MGFS2.js +20 -0
  223. package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js → history-compact-UXDIFC33.js} +12 -12
  224. package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js → history-compact-ZBEBGJM7.js} +12 -12
  225. package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js → history-redact-P7I7AWMB.js} +11 -11
  226. package/dist/cli-bundle/chunks/history-redact-YQGU3XRA.js +21 -0
  227. package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js → history-repair-52KINVIK.js} +12 -12
  228. package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js → history-repair-RM5ITLU5.js} +12 -12
  229. package/dist/cli-bundle/chunks/{init-QGK4JFF6.js → init-2BNZOO6F.js} +10 -10
  230. package/dist/cli-bundle/chunks/init-SC2P6CHP.js +20 -0
  231. package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js → learnings-W6F3FIPL.js} +10 -10
  232. package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js → learnings-YGYVHWJK.js} +10 -10
  233. package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js → list-K6FPV4J4.js} +10 -10
  234. package/dist/cli-bundle/chunks/{list-KOJN23UL.js → list-KPAYU5KZ.js} +10 -10
  235. package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js → notes-PU74EPKV.js} +10 -10
  236. package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js → notes-YTD6ZILW.js} +10 -10
  237. package/dist/cli-bundle/chunks/{plan-X3STKLED.js → plan-FNXHXRCI.js} +15 -15
  238. package/dist/cli-bundle/chunks/plan-FNXHXRCI.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{plan-BK3OMLGP.js → plan-GEQYUCBW.js} +16 -16
  240. package/dist/cli-bundle/chunks/plan-GEQYUCBW.js.map +1 -0
  241. package/dist/cli-bundle/chunks/{register-list-query-XDLFESU7.js → register-list-query-PHWYHENI.js} +43 -22
  242. package/dist/cli-bundle/chunks/register-list-query-PHWYHENI.js.map +1 -0
  243. package/dist/cli-bundle/chunks/{register-list-query-FUMXPWZ4.js → register-list-query-QI45RMKN.js} +42 -21
  244. package/dist/cli-bundle/chunks/register-list-query-QI45RMKN.js.map +7 -0
  245. package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js → register-mutation-X3BUOQEL.js} +33 -33
  246. package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js → register-mutation-YINRTS7L.js} +33 -33
  247. package/dist/cli-bundle/chunks/{register-operations-DGSHCS75.js → register-operations-E5JEASRK.js} +35 -35
  248. package/dist/cli-bundle/chunks/register-operations-E5JEASRK.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js → register-operations-MIDTRW7S.js} +34 -34
  250. package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js.map → register-operations-MIDTRW7S.js.map} +2 -2
  251. package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js → register-setup-DYBFLEZX.js} +15 -15
  252. package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js → register-setup-EG2U6CEU.js} +15 -15
  253. package/dist/cli-bundle/chunks/restore-5KHR2YYQ.js +19 -0
  254. package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js → restore-XQYSWBV7.js} +11 -11
  255. package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js → scheduling-shortcuts-HJMTEXKE.js} +14 -14
  256. package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js → scheduling-shortcuts-NNT5ASZR.js} +14 -14
  257. package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js → schema-263RI4WW.js} +9 -9
  258. package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js → schema-TZXW6XWD.js} +9 -9
  259. package/dist/cli-bundle/chunks/search-LECJYSXE.js +33 -0
  260. package/dist/cli-bundle/chunks/search-SFRJOVDG.js +37 -0
  261. package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js → stats-N7ER2PNK.js} +8 -8
  262. package/dist/cli-bundle/chunks/{stats-J563NJBY.js → stats-VPBGSRQH.js} +8 -8
  263. package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js → telemetry-L6K3BUIQ.js} +4 -4
  264. package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js → telemetry-PP3FUNBU.js} +4 -4
  265. package/dist/cli-bundle/chunks/{test-47UQGEXE.js → test-3EGNS3T5.js} +15 -15
  266. package/dist/cli-bundle/chunks/{test-55RJCGRU.js → test-RQCTSWUK.js} +15 -15
  267. package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js → test-all-NJ5V2QFS.js} +15 -15
  268. package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js → test-all-ZHFAWNC3.js} +15 -15
  269. package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js → test-runs-AJHR6IQF.js} +5 -5
  270. package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js → test-runs-GN3C6GOI.js} +5 -5
  271. package/dist/cli-bundle/chunks/update-6YXOGHRT.js +24 -0
  272. package/dist/cli-bundle/chunks/update-6YXOGHRT.js.map +7 -0
  273. package/dist/cli-bundle/chunks/update-V33YUBRP.js +28 -0
  274. package/dist/cli-bundle/chunks/update-V33YUBRP.js.map +1 -0
  275. package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js → update-many-N2AN6ZDH.js} +23 -23
  276. package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js → update-many-RYQ64CFW.js} +23 -23
  277. package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js → upgrade-TJXFLZIX.js} +5 -5
  278. package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js → upgrade-VPCIYAVW.js} +5 -5
  279. package/dist/cli-bundle/chunks/{validate-GVY4VE43.js → validate-JMNWEUYF.js} +62 -24
  280. package/dist/cli-bundle/chunks/validate-JMNWEUYF.js.map +1 -0
  281. package/dist/cli-bundle/chunks/{validate-ADKGN37M.js → validate-PHKIYGSY.js} +61 -23
  282. package/dist/cli-bundle/chunks/validate-PHKIYGSY.js.map +7 -0
  283. package/dist/cli-bundle/main.js +133 -55
  284. package/dist/cli-bundle/main.js.map +2 -2
  285. package/dist/core/checkpoint/checkpoint-gc.d.ts +69 -0
  286. package/dist/core/checkpoint/checkpoint-gc.js +175 -0
  287. package/dist/core/checkpoint/checkpoint-gc.js.map +1 -0
  288. package/dist/core/config/nested-settings.js +22 -2
  289. package/dist/core/config/nested-settings.js.map +1 -1
  290. package/dist/core/diagnostics/remediation.js +40 -2
  291. package/dist/core/diagnostics/remediation.js.map +1 -1
  292. package/dist/core/extensions/extension-types.d.ts +0 -9
  293. package/dist/core/extensions/extension-types.js +2 -27
  294. package/dist/core/extensions/extension-types.js.map +1 -1
  295. package/dist/core/fs/fs-utils.d.ts +17 -1
  296. package/dist/core/fs/fs-utils.js +19 -3
  297. package/dist/core/fs/fs-utils.js.map +1 -1
  298. package/dist/core/history/drift-scan.d.ts +17 -5
  299. package/dist/core/history/drift-scan.js +22 -14
  300. package/dist/core/history/drift-scan.js.map +1 -1
  301. package/dist/core/history/replay.d.ts +7 -0
  302. package/dist/core/history/replay.js +11 -6
  303. package/dist/core/history/replay.js.map +1 -1
  304. package/dist/core/item/item-format-version.d.ts +87 -0
  305. package/dist/core/item/item-format-version.js +85 -0
  306. package/dist/core/item/item-format-version.js.map +1 -0
  307. package/dist/core/item/item-format.js +8 -2
  308. package/dist/core/item/item-format.js.map +1 -1
  309. package/dist/core/item/status-filter.d.ts +7 -3
  310. package/dist/core/item/status-filter.js +26 -5
  311. package/dist/core/item/status-filter.js.map +1 -1
  312. package/dist/core/search/bm25.d.ts +113 -0
  313. package/dist/core/search/bm25.js +178 -0
  314. package/dist/core/search/bm25.js.map +1 -0
  315. package/dist/core/search/eval.d.ts +114 -0
  316. package/dist/core/search/eval.js +217 -0
  317. package/dist/core/search/eval.js.map +1 -0
  318. package/dist/core/sentry/instrument.d.ts +14 -0
  319. package/dist/core/sentry/instrument.js +43 -3
  320. package/dist/core/sentry/instrument.js.map +1 -1
  321. package/dist/core/shared/constants.js +6 -2
  322. package/dist/core/shared/constants.js.map +1 -1
  323. package/dist/core/store/paths.js +4 -3
  324. package/dist/core/store/paths.js.map +1 -1
  325. package/dist/core/store/settings-validator.d.ts +7 -0
  326. package/dist/core/store/settings-validator.js +10 -2
  327. package/dist/core/store/settings-validator.js.map +1 -1
  328. package/dist/core/store/settings.js +6 -2
  329. package/dist/core/store/settings.js.map +1 -1
  330. package/dist/mcp/tool-definitions.js +4 -3
  331. package/dist/mcp/tool-definitions.js.map +1 -1
  332. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  333. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  334. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  335. package/dist/sdk/cli-contracts/tool-parameter-tables.js +4 -4
  336. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  337. package/dist/sdk/cli-contracts.d.ts +1 -0
  338. package/dist/sdk/cli-contracts.js +11 -2
  339. package/dist/sdk/cli-contracts.js.map +1 -1
  340. package/dist/sdk/index.d.ts +2 -2
  341. package/dist/sdk/index.js +3 -3
  342. package/dist/sdk/index.js.map +1 -1
  343. package/dist/sdk/runtime.d.ts +1 -0
  344. package/dist/sdk/runtime.js +3 -2
  345. package/dist/sdk/runtime.js.map +1 -1
  346. package/dist/sdk/testing.d.ts +48 -1
  347. package/dist/sdk/testing.js +98 -2
  348. package/dist/sdk/testing.js.map +1 -1
  349. package/dist/types.d.ts +26 -0
  350. package/dist/types.js +2 -2
  351. package/dist/types.js.map +1 -1
  352. package/docs/AGENT_GUIDE.md +1 -0
  353. package/docs/ARCHITECTURE.md +126 -11
  354. package/docs/CLAUDE_CODE_PLUGIN.md +5 -13
  355. package/docs/COMMANDS.md +57 -5
  356. package/docs/CONFIGURATION.md +39 -0
  357. package/docs/EXTENSIONS.md +2 -2
  358. package/docs/MIGRATION_CLI_SIMPLIFICATION.md +9 -2
  359. package/docs/QUICKSTART.md +2 -0
  360. package/docs/README.md +2 -0
  361. package/docs/RELEASING.md +2 -1
  362. package/docs/SDK.md +80 -1
  363. package/docs/TESTING.md +18 -0
  364. package/package.json +4 -3
  365. package/packages/pm-command-kit/README.md +4 -0
  366. package/packages/pm-todos/extensions/todos/index.js +2 -0
  367. package/packages/pm-todos/extensions/todos/index.ts +2 -0
  368. package/packages/pm-todos/extensions/todos/runtime.js +192 -9
  369. package/packages/pm-todos/extensions/todos/runtime.ts +211 -8
  370. package/dist/cli-bundle/chunks/activity-62I26XZB.js +0 -18
  371. package/dist/cli-bundle/chunks/chunk-2RI3BDFK.js.map +0 -7
  372. package/dist/cli-bundle/chunks/chunk-4BFNWAMQ.js.map +0 -7
  373. package/dist/cli-bundle/chunks/chunk-5QLHQK7V.js.map +0 -7
  374. package/dist/cli-bundle/chunks/chunk-5SRID7DV.js.map +0 -1
  375. package/dist/cli-bundle/chunks/chunk-COHNQLB2.js.map +0 -1
  376. package/dist/cli-bundle/chunks/chunk-DVUU3AHP.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-EMFDZ7N3.js.map +0 -1
  378. package/dist/cli-bundle/chunks/chunk-FP7YLQ52.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-FPQA4ZMA.js.map +0 -7
  380. package/dist/cli-bundle/chunks/chunk-GDOTTY2S.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-I2VJM36R.js.map +0 -1
  382. package/dist/cli-bundle/chunks/chunk-K5TD74VU.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-MAKOMXVM.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-PSWSQHM7.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-QSH34DSQ.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-UA4ANRJY.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-UCNEPMPY.js.map +0 -7
  388. package/dist/cli-bundle/chunks/chunk-X26ODPU4.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-Y4IBSEQ2.js.map +0 -1
  390. package/dist/cli-bundle/chunks/chunk-YOGXK3ON.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-YWAYOWDQ.js.map +0 -1
  392. package/dist/cli-bundle/chunks/chunk-ZZEM2PH7.js.map +0 -1
  393. package/dist/cli-bundle/chunks/close-TQZK43Z5.js +0 -15
  394. package/dist/cli-bundle/chunks/config-UWF3KRP5.js.map +0 -7
  395. package/dist/cli-bundle/chunks/config-YICACPHA.js.map +0 -1
  396. package/dist/cli-bundle/chunks/contracts-7G553BHP.js.map +0 -1
  397. package/dist/cli-bundle/chunks/contracts-B2YWYUV5.js.map +0 -7
  398. package/dist/cli-bundle/chunks/create-UZLJXHLA.js +0 -30
  399. package/dist/cli-bundle/chunks/gc-5RTYXLQU.js +0 -211
  400. package/dist/cli-bundle/chunks/gc-5RTYXLQU.js.map +0 -7
  401. package/dist/cli-bundle/chunks/gc-FK5732EK.js +0 -208
  402. package/dist/cli-bundle/chunks/gc-FK5732EK.js.map +0 -1
  403. package/dist/cli-bundle/chunks/health-JEBESKID.js.map +0 -7
  404. package/dist/cli-bundle/chunks/health-PPTJ7XKW.js.map +0 -1
  405. package/dist/cli-bundle/chunks/history-TKTULEVE.js +0 -20
  406. package/dist/cli-bundle/chunks/history-redact-SPIFIXVY.js +0 -21
  407. package/dist/cli-bundle/chunks/init-A6FTZ5UC.js +0 -20
  408. package/dist/cli-bundle/chunks/plan-BK3OMLGP.js.map +0 -1
  409. package/dist/cli-bundle/chunks/plan-X3STKLED.js.map +0 -7
  410. package/dist/cli-bundle/chunks/register-list-query-FUMXPWZ4.js.map +0 -7
  411. package/dist/cli-bundle/chunks/register-list-query-XDLFESU7.js.map +0 -1
  412. package/dist/cli-bundle/chunks/register-operations-DGSHCS75.js.map +0 -1
  413. package/dist/cli-bundle/chunks/restore-PI3WM4GK.js +0 -19
  414. package/dist/cli-bundle/chunks/search-2JX776KX.js.map +0 -1
  415. package/dist/cli-bundle/chunks/search-AZR2JITW.js.map +0 -7
  416. package/dist/cli-bundle/chunks/update-2BZEAI7B.js +0 -24
  417. package/dist/cli-bundle/chunks/update-GCNLER2H.js +0 -28
  418. package/dist/cli-bundle/chunks/validate-ADKGN37M.js.map +0 -7
  419. package/dist/cli-bundle/chunks/validate-GVY4VE43.js.map +0 -1
  420. /package/dist/cli-bundle/chunks/{activity-62I26XZB.js.map → activity-CIHV64UC.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js.map → activity-KW3IRP44.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js.map → aggregate-3ZKQG5SW.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js.map → aggregate-FIGQEIL3.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{append-BP2ARHOK.js.map → append-EWJYJ7CH.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{append-5U3XR5SD.js.map → append-QEOLX3XB.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js.map → chunk-2EIMPCE4.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js.map → chunk-37QXHBIB.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js.map → chunk-3MDHREEV.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js.map → chunk-5FIEHKEX.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js.map → chunk-5IDI42VV.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js.map → chunk-5QICDWMV.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js.map → chunk-6CJWZAN7.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js.map → chunk-6H4LF7AO.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js.map → chunk-6M4RJS4M.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js.map → chunk-76Z3YSHV.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js.map → chunk-7D3SAQXM.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js.map → chunk-AIS5PGI3.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js.map → chunk-AZMOLBN3.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js.map → chunk-B473GZWW.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js.map → chunk-C3AZ5ZML.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-S673PVHD.js.map → chunk-C4N5I7ZW.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js.map → chunk-CF55WVVS.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js.map → chunk-CZPXY7UW.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js.map → chunk-CZUB4XWO.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js.map → chunk-D7FYS6PG.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js.map → chunk-F5NZWFSW.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js.map → chunk-FKBDKV7Y.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js.map → chunk-FRUFKWNK.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js.map → chunk-FWPDUYEY.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js.map → chunk-GOZUHWFD.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js.map → chunk-H7NJZWG2.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js.map → chunk-HCU6WUSY.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js.map → chunk-LUWW7L4B.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js.map → chunk-M5XALUSL.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js.map → chunk-N5ZJACJ6.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js.map → chunk-NB3PYLQ6.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js.map → chunk-NIGXMNNI.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js.map → chunk-NIUEXCFS.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js.map → chunk-NJHMAJ6N.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js.map → chunk-NJN7LL7U.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js.map → chunk-NSBZ2CKF.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js.map → chunk-O47BPOPC.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js.map → chunk-OTHIWLMB.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js.map → chunk-PFSRUHDH.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js.map → chunk-PP2U4NMT.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js.map → chunk-PUH4D67U.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js.map → chunk-Q2J2HJUN.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js.map → chunk-QQHISQBJ.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js.map → chunk-QZTWBFXJ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js.map → chunk-RLK7P77C.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js.map → chunk-RVHYI7SL.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js.map → chunk-SBGXDO7A.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js.map → chunk-SRYYRVPB.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js.map → chunk-SX75ADBK.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js.map → chunk-TKBHZPKD.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js.map → chunk-UEMNL33O.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js.map → chunk-UPE3CDD7.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js.map → chunk-UV6IYE5U.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js.map → chunk-YCJX76PW.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js.map → claim-RC56YUWG.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js.map → claim-THOJ6CMV.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{close-TQZK43Z5.js.map → close-DNMHGOCX.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{close-3TSX6BYF.js.map → close-SG5MNCVQ.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js.map → close-many-3L3AQZBU.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js.map → close-many-DKQLBGLV.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{comments-M7PAINZT.js.map → comments-M7ZOZNBX.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js.map → comments-SKWMDWCW.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{context-EGUGU4K7.js.map → context-OEC366TO.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{context-V32ZAPL6.js.map → context-PUG2A7RC.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js.map → copy-6QLHILAC.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js.map → copy-JPX7VZCH.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{create-UZLJXHLA.js.map → create-NNP6TSFO.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js.map → create-Y54ZVVZH.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js.map → delete-63PCMQAJ.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js.map → delete-GDSMGAGJ.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js.map → deps-T4ZF5G54.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js.map → deps-XYQ73XRH.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js.map → extension-46NWACO3.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js.map → extension-D5FDZ2CO.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{focus-UGROAMAX.js.map → focus-5STQXDPU.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js.map → focus-MDVPOWB5.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{get-OTXPLWYW.js.map → get-J2IPJRZW.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js.map → get-NT7L2HUZ.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{history-HNWBUDMI.js.map → history-RLH2QCRO.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{history-TKTULEVE.js.map → history-WX3MGFS2.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js.map → history-compact-UXDIFC33.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js.map → history-compact-ZBEBGJM7.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js.map → history-redact-P7I7AWMB.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{history-redact-SPIFIXVY.js.map → history-redact-YQGU3XRA.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js.map → history-repair-52KINVIK.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js.map → history-repair-RM5ITLU5.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{init-QGK4JFF6.js.map → init-2BNZOO6F.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{init-A6FTZ5UC.js.map → init-SC2P6CHP.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js.map → learnings-W6F3FIPL.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js.map → learnings-YGYVHWJK.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js.map → list-K6FPV4J4.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{list-KOJN23UL.js.map → list-KPAYU5KZ.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js.map → notes-PU74EPKV.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js.map → notes-YTD6ZILW.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js.map → register-mutation-X3BUOQEL.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js.map → register-mutation-YINRTS7L.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js.map → register-setup-DYBFLEZX.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js.map → register-setup-EG2U6CEU.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{restore-PI3WM4GK.js.map → restore-5KHR2YYQ.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js.map → restore-XQYSWBV7.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js.map → scheduling-shortcuts-HJMTEXKE.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js.map → scheduling-shortcuts-NNT5ASZR.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js.map → schema-263RI4WW.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js.map → schema-TZXW6XWD.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{test-55RJCGRU.js.map → search-LECJYSXE.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{test-47UQGEXE.js.map → search-SFRJOVDG.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js.map → stats-N7ER2PNK.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{stats-J563NJBY.js.map → stats-VPBGSRQH.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js.map → telemetry-L6K3BUIQ.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js.map → telemetry-PP3FUNBU.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{update-GCNLER2H.js.map → test-3EGNS3T5.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{update-2BZEAI7B.js.map → test-RQCTSWUK.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js.map → test-all-NJ5V2QFS.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js.map → test-all-ZHFAWNC3.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js.map → test-runs-AJHR6IQF.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js.map → test-runs-GN3C6GOI.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js.map → update-many-N2AN6ZDH.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js.map → update-many-RYQ64CFW.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js.map → upgrade-TJXFLZIX.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js.map → upgrade-VPCIYAVW.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../core/item/status-filter.ts","../../../../../../../../core/schema/runtime-field-filters.ts","../../../../../../../../cli/commands/list.ts"],"sourcesContent":["/**\n * @module core/item/status-filter\n *\n * Defines item parsing, formatting, and lifecycle helpers for Status Filter.\n */\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { levenshteinDistanceWithinLimit } from \"../shared/levenshtein.js\";\nimport type { RuntimeStatusRegistry } from \"../schema/runtime-schema.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { normalizeStatusInput } from \"./status.js\";\n\n// Workflow-group aliases shared by every status-filter consumer so that the\n// agent-friendly `open`/`closed`/`canceled` shorthands resolve to whatever the\n// runtime workflow has configured as its open/close/cancel anchors, rather than\n// hardcoding the built-in status ids. `cancelled` is accepted as a spelling\n// variant of `canceled`.\nconst STATUS_GROUP_ALIASES: Readonly<Record<string, \"open_status\" | \"close_status\" | \"canceled_status\">> = {\n open: \"open_status\",\n closed: \"close_status\",\n canceled: \"canceled_status\",\n cancelled: \"canceled_status\",\n};\n\n/**\n * Resolve a single status-filter token to a concrete runtime status id.\n *\n * Returns `undefined` when the token is not a recognized workflow-group alias\n * (open/closed/canceled) and does not normalize to a known registry status.\n * Callers decide whether an unrecognized token is an error (strict mode) or is\n * passed through verbatim (lenient mode) — see {@link parseStatusFilterCsv}.\n */\nexport function resolveStatusFilterToken(\n token: string,\n registry: RuntimeStatusRegistry,\n): ItemStatus | undefined {\n const trimmed = token.trim().toLowerCase();\n if (trimmed.length === 0) {\n return undefined;\n }\n const group = STATUS_GROUP_ALIASES[trimmed];\n if (group) {\n return registry[group] as ItemStatus;\n }\n return normalizeStatusInput(token, registry);\n}\n\nfunction collectStatusSuggestionCandidates(registry: RuntimeStatusRegistry): string[] {\n const candidates = new Set<string>(Object.keys(STATUS_GROUP_ALIASES));\n for (const definition of registry.definitions) {\n candidates.add(definition.id);\n for (const alias of definition.aliases) {\n candidates.add(alias);\n }\n }\n return [...candidates];\n}\n\nfunction suggestClosestStatus(value: string, registry: RuntimeStatusRegistry): string | undefined {\n // Only ever called for an unresolved, already-non-empty token (parseStatusFilterCsv\n // filters blanks first), so no empty-input guard is needed here.\n const normalized = value.trim().toLowerCase();\n let best: string | undefined;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const candidate of collectStatusSuggestionCandidates(registry)) {\n const distance = levenshteinDistanceWithinLimit(normalized, candidate.toLowerCase(), 2);\n if (distance !== null && distance < bestDistance) {\n best = candidate;\n bestDistance = distance;\n }\n }\n return best;\n}\n\n/**\n * Documents the parse status filter options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ParseStatusFilterOptions {\n /**\n * When true, an unrecognized token throws a USAGE error with a did-you-mean\n * hint. When false (default), an unrecognized token is passed through\n * verbatim so custom/unknown statuses still compare against item values by\n * their raw string — preserving the long-standing lenient `pm list` behavior.\n */\n strict?: boolean;\n /** Flag label used in error messages (default: \"--status\"). */\n flagLabel?: string;\n}\n\n/**\n * Parse a comma-separated status filter into a de-duplicated list of concrete\n * status ids. Shared by `pm list` (lenient) and `pm search` (strict, with a\n * did-you-mean hint on typos) so both surfaces resolve the open/closed/canceled\n * workflow-group aliases identically.\n */\nexport function parseStatusFilterCsv(\n raw: unknown,\n registry: RuntimeStatusRegistry,\n options?: ParseStatusFilterOptions,\n): ItemStatus[] | undefined {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const strict = options?.strict === true;\n const flagLabel = options?.flagLabel ?? \"--status\";\n const tokens = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n return undefined;\n }\n const resolved: ItemStatus[] = [];\n for (const token of tokens) {\n const status = resolveStatusFilterToken(token, registry);\n if (status === undefined) {\n if (strict) {\n const suggestion = suggestClosestStatus(token, registry);\n throw new PmCliError(\n `Invalid ${flagLabel} value \"${token}\". Use open|closed|canceled or a configured status id${\n suggestion ? `. Did you mean \"${suggestion}\"?` : \".\"\n }`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.push(token as ItemStatus);\n continue;\n }\n resolved.push(status);\n }\n return [...new Set(resolved)];\n}\n","/**\n * @module core/schema/runtime-field-filters\n *\n * Resolves configurable schema, fields, statuses, and workflows for Runtime Field Filters.\n */\nimport { coerceRuntimeFieldValue, readRuntimeFieldOptionValue } from \"./runtime-field-values.js\";\nimport type { RuntimeFieldCommand, RuntimeFieldRegistry } from \"./runtime-schema.js\";\nimport { stableValueEquals } from \"../shared/serialization.js\";\n\nfunction valuesEqual(left: unknown, right: unknown): boolean {\n return stableValueEquals(left, right);\n}\n\n/**\n * Implements collect runtime filter values for the public runtime surface of this module.\n */\nexport function collectRuntimeFilterValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n command: RuntimeFieldCommand,\n): Record<string, unknown> {\n const filters: Record<string, unknown> = {};\n for (const definition of fieldRegistry.command_to_fields.get(command) ?? []) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n continue;\n }\n filters[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return filters;\n}\n\n/**\n * Implements matches runtime filters for the public runtime surface of this module.\n */\nexport function matchesRuntimeFilters(item: Record<string, unknown>, filters: Record<string, unknown>): boolean {\n for (const [fieldKey, expectedValue] of Object.entries(filters)) {\n const actualValue = item[fieldKey];\n if (Array.isArray(expectedValue)) {\n if (Array.isArray(actualValue)) {\n const normalizedActual = actualValue.map((value) => String(value));\n const normalizedExpected = expectedValue.map((value) => String(value));\n if (!normalizedExpected.every((value) => normalizedActual.includes(value))) {\n return false;\n }\n continue;\n }\n if (!valuesEqual(actualValue, expectedValue[expectedValue.length - 1])) {\n return false;\n }\n continue;\n }\n if (!valuesEqual(actualValue, expectedValue)) {\n return false;\n }\n }\n return true;\n}\n","/**\n * @module cli/commands/list\n *\n * Implements the pm list command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { parseStatusFilterCsv } from \"../../core/item/status-filter.js\";\nimport { resolveItemTypeRegistry, type ItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { parseIntegerLimit, parsePriority, parseType } from \"../shared-parsers.js\";\nimport { collectRuntimeFilterValues, matchesRuntimeFilters } from \"../../core/schema/runtime-field-filters.js\";\nimport {\n hasMissingMetadataFilter,\n itemMatchesMissingMetadata,\n lifecycleClassifierFromStatusRegistry,\n type MissingMetadataFilters,\n} from \"../../core/governance/metadata-coverage.js\";\nimport {\n contentFiltersNeedBody,\n contentFiltersNeedCollections,\n hasContentFieldFilter,\n itemMatchesContentFilters,\n type ContentField,\n type ContentFieldFilters,\n} from \"../../core/governance/content-fields.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { compareTimestampStrings, nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { listAllFrontMatter, listAllFrontMatterLight, listAllFrontMatterWithBody } from \"../../core/store/item-store.js\";\nimport { HEAVY_METADATA_KEYS } from \"../../core/store/front-matter-cache.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, ItemStatus, ItemType } from \"../../types/index.js\";\n\n/**\n * Documents the list options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ListOptions {\n status?: string;\n type?: string;\n tag?: string;\n priority?: string;\n deadlineBefore?: string;\n deadlineAfter?: string;\n updatedAfter?: string;\n updatedBefore?: string;\n createdAfter?: string;\n createdBefore?: string;\n ids?: string;\n assignee?: string;\n assigneeFilter?: string;\n parent?: string;\n sprint?: string;\n release?: string;\n limit?: string;\n offset?: string;\n noTruncate?: boolean;\n includeBody?: boolean;\n compact?: boolean;\n brief?: boolean;\n full?: boolean;\n fields?: string;\n sort?: string;\n order?: string;\n tree?: boolean;\n treeDepth?: string;\n excludeTerminal?: boolean;\n filterAcMissing?: boolean;\n filterEstimatesMissing?: boolean;\n filterResolutionMissing?: boolean;\n filterMetadataMissing?: boolean;\n filterReviewerMissing?: boolean;\n filterRiskMissing?: boolean;\n filterConfidenceMissing?: boolean;\n filterSprintMissing?: boolean;\n filterReleaseMissing?: boolean;\n // Content-field presence filters (GH-242). The has*/no* companions mirror the\n // commander flag camelCase (e.g. --no-notes → noNotes, --empty-body → emptyBody)\n // so the MCP param names and ListOptions fields stay identical (the MCP path\n // forwards params verbatim, unlike the CLI which normalizes first). A field may\n // be requested present XOR absent — a both-set request is a usage error.\n hasNotes?: boolean;\n hasLearnings?: boolean;\n hasFiles?: boolean;\n hasDocs?: boolean;\n hasTests?: boolean;\n hasComments?: boolean;\n hasDeps?: boolean;\n hasBody?: boolean;\n hasLinkedCommand?: boolean;\n noNotes?: boolean;\n noLearnings?: boolean;\n noFiles?: boolean;\n noDocs?: boolean;\n noTests?: boolean;\n noComments?: boolean;\n noDeps?: boolean;\n emptyBody?: boolean;\n noLinkedCommand?: boolean;\n [key: string]: unknown;\n}\n\n/** Extract the missing-metadata selection filters from list/update-many options. */\nexport function resolveMissingMetadataFilters(options: {\n filterAcMissing?: boolean;\n filterEstimatesMissing?: boolean;\n filterResolutionMissing?: boolean;\n filterMetadataMissing?: boolean;\n filterReviewerMissing?: boolean;\n filterRiskMissing?: boolean;\n filterConfidenceMissing?: boolean;\n filterSprintMissing?: boolean;\n filterReleaseMissing?: boolean;\n}): MissingMetadataFilters {\n return {\n acMissing: options.filterAcMissing === true,\n estimatesMissing: options.filterEstimatesMissing === true,\n resolutionMissing: options.filterResolutionMissing === true,\n metadataMissing: options.filterMetadataMissing === true,\n reviewerMissing: options.filterReviewerMissing === true,\n riskMissing: options.filterRiskMissing === true,\n confidenceMissing: options.filterConfidenceMissing === true,\n sprintMissing: options.filterSprintMissing === true,\n releaseMissing: options.filterReleaseMissing === true,\n };\n}\n\n/** Per content field: the present flag and the absence flag on the options shape. */\ninterface ContentFieldFlagMapping {\n field: ContentField;\n presentKey: string;\n absentKey: string;\n /** Human flag names used in the conflict error message. */\n presentFlag: string;\n absentFlag: string;\n}\n\nconst CONTENT_FIELD_FLAG_MAPPINGS: readonly ContentFieldFlagMapping[] = [\n { field: \"notes\", presentKey: \"hasNotes\", absentKey: \"noNotes\", presentFlag: \"--has-notes\", absentFlag: \"--no-notes\" },\n { field: \"learnings\", presentKey: \"hasLearnings\", absentKey: \"noLearnings\", presentFlag: \"--has-learnings\", absentFlag: \"--no-learnings\" },\n { field: \"files\", presentKey: \"hasFiles\", absentKey: \"noFiles\", presentFlag: \"--has-files\", absentFlag: \"--no-files\" },\n { field: \"docs\", presentKey: \"hasDocs\", absentKey: \"noDocs\", presentFlag: \"--has-docs\", absentFlag: \"--no-docs\" },\n { field: \"tests\", presentKey: \"hasTests\", absentKey: \"noTests\", presentFlag: \"--has-tests\", absentFlag: \"--no-tests\" },\n { field: \"comments\", presentKey: \"hasComments\", absentKey: \"noComments\", presentFlag: \"--has-comments\", absentFlag: \"--no-comments\" },\n { field: \"deps\", presentKey: \"hasDeps\", absentKey: \"noDeps\", presentFlag: \"--has-deps\", absentFlag: \"--no-deps\" },\n { field: \"body\", presentKey: \"hasBody\", absentKey: \"emptyBody\", presentFlag: \"--has-body\", absentFlag: \"--empty-body\" },\n { field: \"linked_command\", presentKey: \"hasLinkedCommand\", absentKey: \"noLinkedCommand\", presentFlag: \"--has-linked-command\", absentFlag: \"--no-linked-command\" },\n] as const;\n\n/**\n * Resolve the content-field presence/absence selections from list/search\n * options. A field requested both present AND absent is a usage error (the two\n * selections are mutually exclusive). Returns an empty object when no\n * content-field filter is active.\n */\nexport function resolveContentFieldFilters(options: Record<string, unknown>): ContentFieldFilters {\n const filters: ContentFieldFilters = {};\n for (const mapping of CONTENT_FIELD_FLAG_MAPPINGS) {\n const present = options[mapping.presentKey] === true;\n const absent = options[mapping.absentKey] === true;\n if (present && absent) {\n throw new PmCliError(\n `Cannot combine ${mapping.presentFlag} with ${mapping.absentFlag} for the same field.`,\n EXIT_CODE.USAGE,\n );\n }\n if (present) {\n filters[mapping.field] = \"present\";\n } else if (absent) {\n filters[mapping.field] = \"absent\";\n }\n }\n return filters;\n}\n\n/**\n * Restricts listed item values accepted by command, SDK, and storage contracts.\n */\nexport type ListedItem = ItemFrontMatter | (ItemFrontMatter & { body: string });\n\ntype ListProjectionMode = \"full\" | \"compact\" | \"fields\";\n\ninterface ListProjectionConfig {\n mode: ListProjectionMode;\n fields: string[];\n}\n\nexport const LIST_SORT_FIELDS = [\"priority\", \"deadline\", \"updated_at\", \"created_at\", \"title\", \"parent\"] as const;\n/**\n * Restricts list sort field values accepted by command, SDK, and storage contracts.\n */\nexport type ListSortField = (typeof LIST_SORT_FIELDS)[number];\n\nexport const LIST_SORT_ORDER_VALUES = [\"asc\", \"desc\"] as const;\n/**\n * Restricts list sort order values accepted by command, SDK, and storage contracts.\n */\nexport type ListSortOrder = (typeof LIST_SORT_ORDER_VALUES)[number];\n\nconst DEFAULT_COMPACT_LIST_FIELDS = [\"id\", \"title\", \"status\", \"type\", \"priority\", \"parent\", \"updated_at\"] as const;\nconst BRIEF_LIST_FIELDS = [\"id\", \"status\", \"type\", \"title\"] as const;\nconst TREE_METADATA_FIELDS = [\"tree_depth\", \"tree_parent\", \"tree_children\", \"tree_title\"] as const;\n\n// A projection that selects any heavy collection field (or `--full`, which returns\n// items verbatim) must load the full metadata; everything else takes the light path.\n// Sourced from the single HEAVY_METADATA_KEYS definition in the cache layer so the\n// light/heavy split can never drift between the cache and the projection routing.\nconst HEAVY_PROJECTION_FIELDS: ReadonlySet<string> = new Set<string>(HEAVY_METADATA_KEYS);\n\ninterface ListResultBase {\n items: ListedItem[];\n count: number;\n // Total rows matched before pagination; only emitted when --limit/--offset\n // omitted rows, so agents know how many remain (GH-154).\n total?: number;\n warnings?: string[];\n}\n\n/**\n * Documents the list compact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ListCompactResult extends ListResultBase {\n filters: Record<string, unknown>;\n projection?: undefined;\n sorting?: undefined;\n now?: undefined;\n}\n\n/**\n * Documents the list verbose result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ListVerboseResult extends ListResultBase {\n filters: Record<string, unknown>;\n projection: {\n mode: ListProjectionMode;\n fields: string[] | null;\n };\n sorting: {\n sort: ListSortField | \"default\";\n order: ListSortOrder;\n };\n now: string;\n}\n\n/**\n * Restricts list result values accepted by command, SDK, and storage contracts.\n */\nexport type ListResult = ListCompactResult | ListVerboseResult;\n\nfunction isNonEmptyRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value) && Object.keys(value).length > 0;\n}\n\n// Active content-field filter flags, keyed by the options dest and the snake_case\n// summary key emitted in the filters echo (GH-242). Presence and absence are\n// distinct echo keys (has_notes vs no_notes; has_body vs empty_body).\nconst CONTENT_FILTER_ECHO_ENTRIES: ReadonlyArray<{ key: string; summaryKey: string }> = [\n { key: \"hasNotes\", summaryKey: \"has_notes\" },\n { key: \"hasLearnings\", summaryKey: \"has_learnings\" },\n { key: \"hasFiles\", summaryKey: \"has_files\" },\n { key: \"hasDocs\", summaryKey: \"has_docs\" },\n { key: \"hasTests\", summaryKey: \"has_tests\" },\n { key: \"hasComments\", summaryKey: \"has_comments\" },\n { key: \"hasDeps\", summaryKey: \"has_deps\" },\n { key: \"hasBody\", summaryKey: \"has_body\" },\n { key: \"hasLinkedCommand\", summaryKey: \"has_linked_command\" },\n { key: \"noNotes\", summaryKey: \"no_notes\" },\n { key: \"noLearnings\", summaryKey: \"no_learnings\" },\n { key: \"noFiles\", summaryKey: \"no_files\" },\n { key: \"noDocs\", summaryKey: \"no_docs\" },\n { key: \"noTests\", summaryKey: \"no_tests\" },\n { key: \"noComments\", summaryKey: \"no_comments\" },\n { key: \"noDeps\", summaryKey: \"no_deps\" },\n { key: \"emptyBody\", summaryKey: \"empty_body\" },\n { key: \"noLinkedCommand\", summaryKey: \"no_linked_command\" },\n] as const;\n\n// Active governance-missing filter flags (GH-236), keyed by options dest and the\n// snake_case summary key emitted in the filters echo.\nconst GOVERNANCE_MISSING_ECHO_ENTRIES: ReadonlyArray<{ key: string; summaryKey: string }> = [\n { key: \"filterReviewerMissing\", summaryKey: \"filter_reviewer_missing\" },\n { key: \"filterRiskMissing\", summaryKey: \"filter_risk_missing\" },\n { key: \"filterConfidenceMissing\", summaryKey: \"filter_confidence_missing\" },\n { key: \"filterSprintMissing\", summaryKey: \"filter_sprint_missing\" },\n { key: \"filterReleaseMissing\", summaryKey: \"filter_release_missing\" },\n] as const;\n\nfunction applyContentFilterEcho(filters: Record<string, unknown>, options: Record<string, unknown>): void {\n for (const entry of CONTENT_FILTER_ECHO_ENTRIES) {\n if (options[entry.key] === true) {\n filters[entry.summaryKey] = true;\n }\n }\n}\n\nfunction applyGovernanceMissingFilterEcho(filters: Record<string, unknown>, options: Record<string, unknown>): void {\n for (const entry of GOVERNANCE_MISSING_ECHO_ENTRIES) {\n if (options[entry.key] === true) {\n filters[entry.summaryKey] = true;\n }\n }\n}\n\n/**\n * Implements build content filter echo for the public runtime surface of this module.\n */\nexport function buildContentFilterEcho(options: Record<string, unknown>): Record<string, true> {\n const echo: Record<string, true> = {};\n applyContentFilterEcho(echo, options);\n return echo;\n}\n\n/**\n * Implements build governance missing filter echo for the public runtime surface of this module.\n */\nexport function buildGovernanceMissingFilterEcho(options: Record<string, unknown>): Record<string, true> {\n const echo: Record<string, true> = {};\n applyGovernanceMissingFilterEcho(echo, options);\n return echo;\n}\n\nfunction buildCompactListFilterSummary(params: {\n filtersStatus: string | string[] | null;\n options: ListOptions;\n treeEnabled: boolean;\n treeDepth: number | undefined;\n sortField: ListSortField | undefined;\n sortOrder: ListSortOrder;\n runtimeFieldFilters: Record<string, unknown>;\n}): Record<string, unknown> {\n const {\n filtersStatus,\n options,\n treeEnabled,\n treeDepth,\n sortField,\n sortOrder,\n runtimeFieldFilters,\n } = params;\n const filters: Record<string, unknown> = {};\n if (filtersStatus !== null) {\n filters.status = filtersStatus;\n }\n if (options.type !== undefined) {\n filters.type = options.type;\n }\n if (options.tag !== undefined) {\n filters.tag = options.tag;\n }\n if (options.priority !== undefined) {\n filters.priority = options.priority;\n }\n if (options.deadlineBefore !== undefined) {\n filters.deadline_before = options.deadlineBefore;\n }\n if (options.deadlineAfter !== undefined) {\n filters.deadline_after = options.deadlineAfter;\n }\n if (options.updatedAfter !== undefined) {\n filters.updated_after = options.updatedAfter;\n }\n if (options.updatedBefore !== undefined) {\n filters.updated_before = options.updatedBefore;\n }\n if (options.createdAfter !== undefined) {\n filters.created_after = options.createdAfter;\n }\n if (options.createdBefore !== undefined) {\n filters.created_before = options.createdBefore;\n }\n if (options.ids !== undefined) {\n filters.ids = options.ids;\n }\n if (options.assignee !== undefined) {\n filters.assignee = options.assignee;\n }\n if (options.assigneeFilter !== undefined) {\n filters.assignee_filter = options.assigneeFilter;\n }\n if (options.parent !== undefined) {\n filters.parent = options.parent;\n }\n if (options.sprint !== undefined) {\n filters.sprint = options.sprint;\n }\n if (options.release !== undefined) {\n filters.release = options.release;\n }\n if (options.filterAcMissing === true) {\n filters.filter_ac_missing = true;\n }\n if (options.filterEstimatesMissing === true) {\n filters.filter_estimates_missing = true;\n }\n if (options.filterResolutionMissing === true) {\n filters.filter_resolution_missing = true;\n }\n if (options.filterMetadataMissing === true) {\n filters.filter_metadata_missing = true;\n }\n applyGovernanceMissingFilterEcho(filters, options);\n applyContentFilterEcho(filters, options);\n if (options.limit !== undefined) {\n filters.limit = options.limit;\n }\n if (options.offset !== undefined) {\n filters.offset = options.offset;\n }\n if (options.includeBody === true) {\n filters.include_body = true;\n }\n if (options.fields !== undefined) {\n filters.fields = options.fields;\n }\n if (treeEnabled) {\n filters.tree = true;\n if (treeDepth !== undefined) {\n filters.tree_depth = treeDepth;\n }\n }\n if (sortField !== undefined) {\n filters.sort = sortField;\n filters.order = sortOrder;\n }\n if (isNonEmptyRecord(runtimeFieldFilters)) {\n filters.runtime_filters = runtimeFieldFilters;\n }\n return filters;\n}\n\nfunction compareDefaultSort(left: ListedItem, right: ListedItem, statusRegistry: RuntimeStatusRegistry): number {\n const leftTerminal = isTerminalStatus(left.status, statusRegistry);\n const rightTerminal = isTerminalStatus(right.status, statusRegistry);\n if (leftTerminal !== rightTerminal) {\n return leftTerminal ? 1 : -1;\n }\n const byPriority = left.priority - right.priority;\n if (byPriority !== 0) {\n return byPriority;\n }\n const byUpdated = compareTimestampStrings(right.updated_at, left.updated_at);\n if (byUpdated !== 0) {\n return byUpdated;\n }\n return (left.id ?? \"\").localeCompare(right.id ?? \"\");\n}\n\nfunction sortItemsDefault(items: ListedItem[], statusRegistry: RuntimeStatusRegistry): ListedItem[] {\n return [...items].sort((left, right) => compareDefaultSort(left, right, statusRegistry));\n}\n\nfunction parseDeadline(raw: string | undefined, fieldLabel: string): string | undefined {\n if (raw === undefined) return undefined;\n return resolveIsoOrRelative(raw, new Date(), fieldLabel);\n}\n\n// updated/created date-window filters share the deadline ISO+relative resolver\n// so agents doing incremental \"what changed since my last context window\" syncs\n// can pass either an ISO timestamp (the common case — feed back the previous\n// run's `now`) or a SIGNED relative offset where \"-2h\"/\"-7d\" reach into the\n// past and \"+1d\" into the future (units h/d/w/m, m = months — there is no\n// minutes unit, matching the deadline resolver).\nfunction parseTimestampWindow(raw: unknown, fieldLabel: string): string | undefined {\n if (raw == null) return undefined;\n const value = String(raw).trim();\n if (value.length === 0) return undefined;\n return resolveIsoOrRelative(value, new Date(), fieldLabel);\n}\n\nfunction parseIdsFilter(raw: unknown): Set<string> | undefined {\n if (raw == null) return undefined;\n const value = String(raw).trim();\n if (value.length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n const ids = value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (ids.length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n return new Set(ids);\n}\n\nfunction parseOffset(raw: string | undefined): number | undefined {\n if (raw === undefined) return undefined;\n const parsed = Number(raw);\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw new PmCliError(\"Offset filter must be a non-negative integer\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseFieldSelectors(raw: string | undefined): string[] | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const selectors = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (selectors.length === 0) {\n throw new PmCliError(\"List --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return [...new Set(selectors)];\n}\n\nfunction parseProjectionConfig(options: ListOptions): ListProjectionConfig {\n const compactRequested = options.compact === true;\n const briefRequested = options.brief === true;\n const fullRequested = options.full === true;\n const fieldSelectors = parseFieldSelectors(options.fields);\n const enabledModes =\n Number(compactRequested) + Number(briefRequested) + Number(fullRequested) + Number(fieldSelectors !== undefined);\n if (enabledModes > 1) {\n throw new PmCliError(\n \"List projection options are mutually exclusive. Use one of --compact, --brief, --full, or --fields.\",\n EXIT_CODE.USAGE,\n );\n }\n if (fullRequested) {\n return {\n mode: \"full\",\n fields: [],\n };\n }\n if (briefRequested) {\n return {\n mode: \"compact\",\n fields: [...BRIEF_LIST_FIELDS],\n };\n }\n if (compactRequested) {\n return {\n mode: \"compact\",\n fields: [...DEFAULT_COMPACT_LIST_FIELDS],\n };\n }\n if (fieldSelectors) {\n return {\n mode: \"fields\",\n fields: fieldSelectors,\n };\n }\n return {\n mode: \"full\",\n fields: [],\n };\n}\n\nfunction normalizeProjectionField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateListProjectionFields(projection: ListProjectionConfig, runtimeMetadataKeys: Iterable<string>): void {\n if (projection.mode !== \"fields\") {\n return;\n }\n const allowed = new Set([...FRONT_MATTER_KEY_ORDER, \"body\", ...TREE_METADATA_FIELDS, ...runtimeMetadataKeys]);\n const unknown = projection.fields.filter((field) => !allowed.has(normalizeProjectionField(field)));\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown list --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm list-open --fields id,title,status,type,updated_at\",\n \"pm list --fields id,title,parent,priority --limit 10\",\n \"pm list-all --fields id,title,body --limit 5\",\n ],\n });\n }\n}\n\n// Convenience aliases so agents/humans who reach for the bare verb form\n// (e.g. `--sort updated`) land on the canonical timestamp fields instead of an error.\n// A Map (not a plain object) avoids prototype-chain lookups for keys like \"__proto__\".\nconst LIST_SORT_FIELD_ALIASES: ReadonlyMap<string, ListSortField> = new Map<string, ListSortField>([\n [\"updated\", \"updated_at\"],\n [\"update\", \"updated_at\"],\n [\"modified\", \"updated_at\"],\n [\"created\", \"created_at\"],\n [\"create\", \"created_at\"],\n]);\n\nfunction parseSortField(raw: string | undefined): ListSortField | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n const aliased = LIST_SORT_FIELD_ALIASES.get(normalized);\n if (aliased) {\n return aliased;\n }\n if (!LIST_SORT_FIELDS.includes(normalized as ListSortField)) {\n throw new PmCliError(\n `Sort field must be one of ${LIST_SORT_FIELDS.join(\"|\")} (aliases: updated->updated_at, created->created_at)`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized as ListSortField;\n}\n\nfunction parseSortOrder(raw: string | undefined): ListSortOrder | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!LIST_SORT_ORDER_VALUES.includes(normalized as ListSortOrder)) {\n throw new PmCliError(`Sort order must be one of ${LIST_SORT_ORDER_VALUES.join(\"|\")}`, EXIT_CODE.USAGE);\n }\n return normalized as ListSortOrder;\n}\n\nfunction parseTreeDepth(raw: string | undefined): number | undefined {\n return parseIntegerLimit(raw, \"--tree-depth\");\n}\n\nfunction parseAssigneeFilter(raw: string | undefined): \"assigned\" | \"unassigned\" | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (!normalized) {\n throw new PmCliError(\"Assignee filter must be one of assigned|unassigned\", EXIT_CODE.USAGE);\n }\n if (normalized !== \"assigned\" && normalized !== \"unassigned\") {\n throw new PmCliError(`Invalid assignee filter \"${raw}\". Allowed: assigned|unassigned`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n// `pm list` keeps lenient status parsing (an unknown token is passed through\n// verbatim and simply matches nothing) so custom/unknown statuses never error;\n// the shared CSV parser resolves the open/closed/canceled workflow-group aliases.\nfunction resolveStatusFilter(\n status: ItemStatus | undefined,\n statusRegistry: RuntimeStatusRegistry,\n): ItemStatus[] | undefined {\n return parseStatusFilterCsv(status, statusRegistry, { strict: false });\n}\n\nfunction applyFilters(\n items: ListedItem[],\n status: ItemStatus[] | undefined,\n options: ListOptions,\n typeRegistry: ItemTypeRegistry,\n statusRegistry: RuntimeStatusRegistry,\n runtimeFieldFilters: Record<string, unknown>,\n): ListedItem[] {\n const statusSet = status && status.length > 0 ? new Set<ItemStatus>(status) : undefined;\n const typeFilter = parseType(options.type, typeRegistry);\n const tagFilter = options.tag?.trim().toLowerCase();\n const priorityFilter = parsePriority(options.priority);\n const deadlineBefore = parseDeadline(options.deadlineBefore, \"deadline-before\");\n const deadlineAfter = parseDeadline(options.deadlineAfter, \"deadline-after\");\n const updatedAfter = parseTimestampWindow(options.updatedAfter, \"updated-after\");\n const updatedBefore = parseTimestampWindow(options.updatedBefore, \"updated-before\");\n const createdAfter = parseTimestampWindow(options.createdAfter, \"created-after\");\n const createdBefore = parseTimestampWindow(options.createdBefore, \"created-before\");\n const idsFilter = parseIdsFilter(options.ids);\n const assigneeFilter = options.assignee?.trim();\n const assigneeModeFilter = parseAssigneeFilter(options.assigneeFilter);\n const parentFilter = options.parent?.trim();\n const sprintFilter = options.sprint?.trim();\n const releaseFilter = options.release?.trim();\n const missingMetadataFilters = resolveMissingMetadataFilters(options);\n const missingMetadataActive = hasMissingMetadataFilter(missingMetadataFilters);\n const lifecycleClassifier = lifecycleClassifierFromStatusRegistry(statusRegistry);\n const contentFieldFilters = resolveContentFieldFilters(options as Record<string, unknown>);\n const contentFiltersActive = hasContentFieldFilter(contentFieldFilters);\n\n if (assigneeFilter && (assigneeFilter.toLowerCase() === \"none\" || assigneeFilter.toLowerCase() === \"null\")) {\n throw new PmCliError(\n '--assignee no longer accepts \"none\" or \"null\". Use --assignee-filter unassigned.',\n EXIT_CODE.USAGE,\n );\n }\n if (assigneeFilter !== undefined && assigneeModeFilter === \"unassigned\") {\n throw new PmCliError(\"Cannot combine --assignee with --assignee-filter unassigned\", EXIT_CODE.USAGE);\n }\n\n return items.filter((item) => {\n if (idsFilter && !idsFilter.has(item.id)) return false;\n if (statusSet && !statusSet.has(item.status)) return false;\n if (options.excludeTerminal && isTerminalStatus(item.status, statusRegistry)) return false;\n if (typeFilter && item.type !== typeFilter) return false;\n if (tagFilter && !item.tags.includes(tagFilter)) return false;\n if (priorityFilter !== undefined && item.priority !== priorityFilter) return false;\n if (deadlineBefore && (!item.deadline || compareTimestampStrings(item.deadline, deadlineBefore) > 0)) return false;\n if (deadlineAfter && (!item.deadline || compareTimestampStrings(item.deadline, deadlineAfter) < 0)) return false;\n if (updatedAfter && compareTimestampStrings(item.updated_at, updatedAfter) < 0) return false;\n if (updatedBefore && compareTimestampStrings(item.updated_at, updatedBefore) > 0) return false;\n if (createdAfter && compareTimestampStrings(item.created_at, createdAfter) < 0) return false;\n if (createdBefore && compareTimestampStrings(item.created_at, createdBefore) > 0) return false;\n if (assigneeModeFilter === \"assigned\" && !item.assignee) return false;\n if (assigneeModeFilter === \"unassigned\" && item.assignee) return false;\n if (assigneeFilter !== undefined && item.assignee !== assigneeFilter) {\n return false;\n }\n if (parentFilter !== undefined && options.tree !== true && item.parent !== parentFilter) return false;\n if (sprintFilter !== undefined && item.sprint !== sprintFilter) return false;\n if (releaseFilter !== undefined && item.release !== releaseFilter) return false;\n if (missingMetadataActive && !itemMatchesMissingMetadata(item, missingMetadataFilters, lifecycleClassifier)) {\n return false;\n }\n if (contentFiltersActive && !itemMatchesContentFilters(item, contentFieldFilters)) {\n return false;\n }\n if (!matchesRuntimeFilters(item as Record<string, unknown>, runtimeFieldFilters)) {\n return false;\n }\n return true;\n });\n}\n\nfunction trimNonEmpty(value: string | undefined): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction withTreeMetadata(item: ListedItem, depth: number, childCount: number): ListedItem {\n const itemRecord = toItemRecord(item);\n const title = typeof itemRecord.title === \"string\" ? itemRecord.title : \"\";\n const parent = trimNonEmpty(typeof itemRecord.parent === \"string\" ? itemRecord.parent : undefined) ?? null;\n return {\n ...item,\n tree_depth: depth,\n tree_parent: parent,\n tree_children: childCount,\n tree_title: `${\" \".repeat(depth)}${title}`,\n } as ListedItem;\n}\n\nfunction orderItemsAsTree(\n sortedItems: ListedItem[],\n parentRoot: string | undefined,\n maxDepth: number | undefined,\n): ListedItem[] {\n const byId = new Map<string, ListedItem>();\n const childrenByParent = new Map<string, ListedItem[]>();\n for (const item of sortedItems) {\n byId.set(item.id, item);\n const parentId = trimNonEmpty(item.parent);\n if (!parentId) {\n continue;\n }\n const bucket = childrenByParent.get(parentId);\n if (bucket) {\n bucket.push(item);\n } else {\n childrenByParent.set(parentId, [item]);\n }\n }\n\n const roots = parentRoot\n ? [...(childrenByParent.get(parentRoot) ?? [])]\n : sortedItems.filter((item) => {\n const parentId = trimNonEmpty(item.parent);\n return !parentId || !byId.has(parentId);\n });\n const ordered: ListedItem[] = [];\n const visited = new Set<string>();\n const pushNode = (node: ListedItem, depth: number): void => {\n if (visited.has(node.id)) {\n return;\n }\n visited.add(node.id);\n const children = childrenByParent.get(node.id) ?? [];\n ordered.push(withTreeMetadata(node, depth, children.length));\n if (maxDepth !== undefined && depth >= maxDepth) {\n return;\n }\n for (const child of children) {\n pushNode(child, depth + 1);\n }\n };\n for (const root of roots) {\n pushNode(root, 0);\n }\n return ordered;\n}\n\nfunction compareNullableString(left: string | null, right: string | null): number {\n if (left === right) {\n return 0;\n }\n if (left === null) {\n return 1;\n }\n if (right === null) {\n return -1;\n }\n return left.localeCompare(right);\n}\n\nfunction compareNullableTimestamp(left: string | null, right: string | null): number {\n if (left === right) {\n return 0;\n }\n if (left === null) {\n return 1;\n }\n if (right === null) {\n return -1;\n }\n return compareTimestampStrings(left, right);\n}\n\nfunction compareBySortField(left: ListedItem, right: ListedItem, field: ListSortField): number {\n switch (field) {\n case \"priority\":\n return left.priority - right.priority;\n case \"deadline\":\n return compareNullableTimestamp(left.deadline ?? null, right.deadline ?? null);\n case \"updated_at\":\n return compareTimestampStrings(left.updated_at, right.updated_at);\n case \"created_at\":\n return compareTimestampStrings(left.created_at, right.created_at);\n case \"title\":\n return (left.title ?? \"\").localeCompare(right.title ?? \"\");\n case \"parent\":\n return compareNullableString(left.parent ?? null, right.parent ?? null);\n default:\n return 0;\n }\n}\n\nfunction sortItems(\n items: ListedItem[],\n sortField: ListSortField | undefined,\n sortOrder: ListSortOrder,\n statusRegistry: RuntimeStatusRegistry,\n): ListedItem[] {\n if (!sortField) {\n return sortItemsDefault(items, statusRegistry);\n }\n return [...items].sort((left, right) => {\n const byField = compareBySortField(left, right, sortField);\n if (byField !== 0) {\n return sortOrder === \"desc\" ? -byField : byField;\n }\n const fallback = compareDefaultSort(left, right, statusRegistry);\n return sortOrder === \"desc\" ? -fallback : fallback;\n });\n}\n\nfunction readListFieldValue(item: ListedItem, field: string, treeMode = false): unknown {\n const normalized = normalizeProjectionField(field.trim());\n if (normalized.length === 0) {\n return null;\n }\n const itemRecord = toItemRecord(item);\n if (treeMode && normalized === \"title\" && typeof itemRecord.tree_title === \"string\") {\n return itemRecord.tree_title;\n }\n if (Object.prototype.hasOwnProperty.call(itemRecord, normalized)) {\n return itemRecord[normalized] ?? null;\n }\n return null;\n}\n\nfunction projectListItems(items: ListedItem[], projection: ListProjectionConfig, treeMode = false): ListedItem[] {\n if (projection.mode === \"full\") {\n return items;\n }\n return items.map((item) => {\n const projected: Record<string, unknown> = {};\n for (const field of projection.fields) {\n projected[field] = readListFieldValue(item, field, treeMode);\n }\n return projected as unknown as ListedItem;\n });\n}\n\nfunction runtimeMetadataKeysForProjection(definitions: Array<{ metadata_key: string }>): string[] {\n const keys: string[] = [];\n for (const field of definitions) {\n keys.push(field.metadata_key);\n }\n return keys;\n}\n\n/**\n * Implements run list for the public runtime surface of this module.\n */\nexport async function runList(status: ItemStatus | undefined, options: ListOptions, global: GlobalOptions): Promise<ListResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n const runtimeFieldFilters = collectRuntimeFilterValues(options as Record<string, unknown>, runtimeFieldRegistry, \"list\");\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const projection = parseProjectionConfig(options);\n const runtimeMetadataKeys = runtimeMetadataKeysForProjection(runtimeFieldRegistry.definitions);\n validateListProjectionFields(projection, runtimeMetadataKeys);\n const listWarnings: string[] = [];\n const projectionNeedsBody = projection.fields.some((field) => normalizeProjectionField(field) === \"body\");\n // The heavy collection fields are only emitted by `--full` (verbatim items) or an\n // explicit `--fields <heavy>` selection. Every other projection (default brief,\n // `--compact`, light `--fields`) reads only light scalar fields, so it takes the\n // light path that skips the large collections cache (the hot-path JSON.parse win).\n const projectionNeedsCollections =\n projection.mode === \"full\" ||\n projection.fields.some((field) => HEAVY_PROJECTION_FIELDS.has(normalizeProjectionField(field)));\n // Content-field filters (GH-242) inspect the heavy collection arrays and/or the\n // body, so they force the matching load path even when the projection alone\n // would take the light path. notes/learnings/files/docs/tests/comments/deps/\n // linked_command live in the heavy collections; body needs the body load.\n const contentFieldFilters = resolveContentFieldFilters(options as Record<string, unknown>);\n const contentNeedsCollections = contentFiltersNeedCollections(contentFieldFilters);\n const contentNeedsBody = contentFiltersNeedBody(contentFieldFilters);\n let items: ListedItem[];\n if (options.includeBody || projectionNeedsBody || contentNeedsBody) {\n items = await listAllFrontMatterWithBody(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);\n } else if (projectionNeedsCollections || contentNeedsCollections) {\n items = await listAllFrontMatter(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);\n } else {\n items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);\n }\n const sortField = parseSortField(options.sort);\n const sortOrder = parseSortOrder(options.order) ?? \"asc\";\n const treeEnabled = options.tree === true;\n if (!treeEnabled && options.treeDepth !== undefined) {\n throw new PmCliError(\"List --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n const treeDepth = treeEnabled ? parseTreeDepth(options.treeDepth) : undefined;\n const parentRoot = treeEnabled ? trimNonEmpty(options.parent) : undefined;\n if (!sortField && options.order !== undefined) {\n throw new PmCliError(\"List --order requires --sort\", EXIT_CODE.USAGE);\n }\n const explicitStatus = resolveStatusFilter(options.status as ItemStatus | undefined, statusRegistry);\n const resolvedStatus = explicitStatus ?? resolveStatusFilter(status, statusRegistry);\n const effectiveOptions = explicitStatus ? { ...options, excludeTerminal: false } : options;\n const filtered = applyFilters(items, resolvedStatus, effectiveOptions, typeRegistry, statusRegistry, runtimeFieldFilters);\n const filtersStatus =\n resolvedStatus === undefined\n ? null\n : resolvedStatus.length === 1\n ? resolvedStatus[0]\n : resolvedStatus;\n const sorted = sortItems(filtered, sortField, sortOrder, statusRegistry);\n const ordered = treeEnabled ? orderItemsAsTree(sorted, parentRoot, treeDepth) : sorted;\n // --no-truncate (alias --all) forces full results, overriding any --limit so an\n // agent can pull the entire matched set in one call (GH-154).\n const noTruncate = options.noTruncate === true;\n const limit = noTruncate ? undefined : parseIntegerLimit(options.limit);\n const offset = parseOffset(options.offset) ?? 0;\n const limited = limit === undefined ? ordered.slice(offset) : ordered.slice(offset, offset + limit);\n const projected = projectListItems(limited, projection, treeEnabled);\n const totalMatched = ordered.length;\n // Surface the pre-pagination total only when rows were actually omitted.\n const truncationExtras = projected.length < totalMatched ? { total: totalMatched } : {};\n const now = nowIso();\n const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));\n const projectionFields = projection.mode === \"full\" ? null : [...projection.fields];\n // pm-vhx6: compact-mode list output is primarily consumed by agents. Keep the\n // metadata trailer token-light by returning only active/user-supplied filters\n // and omitting projection/sorting/now boilerplate in this path.\n const compactSummaryMode = projection.mode === \"compact\" && options.compact === true;\n if (compactSummaryMode) {\n const compactFilters = buildCompactListFilterSummary({\n filtersStatus,\n options,\n treeEnabled,\n treeDepth,\n sortField,\n sortOrder,\n runtimeFieldFilters,\n });\n return {\n items: projected,\n count: projected.length,\n ...truncationExtras,\n filters: compactFilters,\n ...(warnings.length > 0 ? { warnings } : {}),\n };\n }\n return {\n items: projected,\n count: projected.length,\n ...truncationExtras,\n filters: {\n status: filtersStatus,\n type: options.type ?? null,\n tag: options.tag ?? null,\n priority: options.priority ?? null,\n deadline_before: options.deadlineBefore ?? null,\n deadline_after: options.deadlineAfter ?? null,\n updated_after: options.updatedAfter ?? null,\n updated_before: options.updatedBefore ?? null,\n created_after: options.createdAfter ?? null,\n created_before: options.createdBefore ?? null,\n ids: options.ids ?? null,\n assignee: options.assignee ?? null,\n assignee_filter: options.assigneeFilter ?? null,\n parent: options.parent ?? null,\n sprint: options.sprint ?? null,\n release: options.release ?? null,\n ...(options.filterAcMissing === true ? { filter_ac_missing: true } : {}),\n ...(options.filterEstimatesMissing === true ? { filter_estimates_missing: true } : {}),\n ...(options.filterResolutionMissing === true ? { filter_resolution_missing: true } : {}),\n ...(options.filterMetadataMissing === true ? { filter_metadata_missing: true } : {}),\n ...buildGovernanceMissingFilterEcho(options),\n ...buildContentFilterEcho(options),\n limit: options.limit ?? null,\n offset: options.offset ?? null,\n ...(noTruncate ? { no_truncate: true } : {}),\n include_body: options.includeBody ?? null,\n compact: options.compact ?? null,\n fields: options.fields ?? null,\n ...(treeEnabled ? { tree: true, tree_depth: treeDepth ?? null } : {}),\n sort: sortField ?? null,\n order: sortField ? sortOrder : null,\n runtime_filters: runtimeFieldFilters,\n },\n projection: {\n mode: projection.mode,\n fields: projectionFields,\n },\n sorting: {\n sort: sortField ?? \"default\",\n order: sortField ? sortOrder : \"asc\",\n },\n now,\n ...(warnings.length > 0 ? { warnings } : {}),\n };\n}\n\nexport const _testOnly = {\n applyFilters,\n buildCompactListFilterSummary,\n buildContentFilterEcho,\n buildGovernanceMissingFilterEcho,\n resolveContentFieldFilters,\n resolveMissingMetadataFilters,\n compareBySortField,\n compareDefaultSort,\n compareNullableString,\n compareNullableTimestamp,\n normalizeProjectionField,\n parseAssigneeFilter,\n parseFieldSelectors,\n parseIdsFilter,\n parseOffset,\n parseProjectionConfig,\n parseSortField,\n parseSortOrder,\n orderItemsAsTree,\n projectListItems,\n readListFieldValue,\n runtimeMetadataKeysForProjection,\n sortItems,\n trimNonEmpty,\n withTreeMetadata,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,uBAAqG;EACzG,MAAM;EACN,QAAQ;EACR,UAAU;EACV,WAAW;;AAWP,SAAU,yBACd,OACA,UAA+B;AAE/B,QAAM,UAAU,MAAM,KAAI,EAAG,YAAW;AACxC,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;EACT;AACA,QAAM,QAAQ,qBAAqB,OAAO;AAC1C,MAAI,OAAO;AACT,WAAO,SAAS,KAAK;EACvB;AACA,SAAO,qBAAqB,OAAO,QAAQ;AAC7C;AAEA,SAAS,kCAAkC,UAA+B;AACxE,QAAM,aAAa,IAAI,IAAY,OAAO,KAAK,oBAAoB,CAAC;AACpE,aAAW,cAAc,SAAS,aAAa;AAC7C,eAAW,IAAI,WAAW,EAAE;AAC5B,eAAW,SAAS,WAAW,SAAS;AACtC,iBAAW,IAAI,KAAK;IACtB;EACF;AACA,SAAO,CAAC,GAAG,UAAU;AACvB;AAEA,SAAS,qBAAqB,OAAe,UAA+B;AAG1E,QAAM,aAAa,MAAM,KAAI,EAAG,YAAW;AAC3C,MAAI;AACJ,MAAI,eAAe,OAAO;AAC1B,aAAW,aAAa,kCAAkC,QAAQ,GAAG;AACnE,UAAM,WAAW,+BAA+B,YAAY,UAAU,YAAW,GAAI,CAAC;AACtF,QAAI,aAAa,QAAQ,WAAW,cAAc;AAChD,aAAO;AACP,qBAAe;IACjB;EACF;AACA,SAAO;AACT;AAuBM,SAAU,qBACd,KACA,UACA,SAAkC;AAElC,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;EACT;AACA,QAAM,SAAS,SAAS,WAAW;AACnC,QAAM,YAAY,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GAAI,cAAc,EAAE,MAAM,MAAM,YAAY,aAAa,KAAI,IAAK,CAAA;MAClE,MAAM,aAAa;MACnB,OAAO,YAAY,YAAY;MAC/B,iBAAiB;;IAEnB,YAAY;MACV,MAAM,WAAW;MACjB,QAAQ;;IAEV,SAAS;MACP,MAAM,aAAa;MACnB,OAAO,YAAY,YAAY;;IAEjC;IACA,GAAI,SAAS,SAAS,IAAI,EAAE,SAAQ,IAAK,CAAA;;AAE7C;AAEO,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"88b2fb91-4804-542a-9b9a-fcd4e392ac36"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../core/diagnostics/remediation.ts"],"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\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\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_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\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 {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. 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 // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\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 (pm history-repair --all repairs every drifted stream in one pass).\",\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 (pm history-repair --all repairs every drifted stream in one pass).\",\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 (pm history-repair --all repairs every drifted stream in one pass).\",\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 (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary: \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\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 {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\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 {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\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":";;;AA2CO,IAAM,uBAAoD,OAAO,OAAO;;EAE7E;IACE,MAAM;IACN,SAAS;IACT,SAAS;;;EAGX;IACE,MAAM;IACN,SAAS;IACT,SACE;;EAEJ;IACE,MAAM;IACN,SAAS;IACT,SACE;;EAEJ;IACE,MAAM;IACN,SAAS;IACT,SAAS;;;EAGX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;;EAGX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SACE;;EAEJ;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX;IACE,MAAM;IACN,SAAS;IACT,SACE;;;EAGJ;IACE,MAAM;IACN,SAAS;IACT,SAAS;;EAEX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