@unbrained/pm-cli 2026.6.5 → 2026.6.7

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 (596) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +17 -5
  4. package/dist/cli/commander-usage.js +74 -4
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/aggregate.d.ts +8 -0
  7. package/dist/cli/commands/aggregate.js +84 -7
  8. package/dist/cli/commands/aggregate.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +10 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.js +13 -10
  12. package/dist/cli/commands/close-many.js.map +1 -1
  13. package/dist/cli/commands/close.d.ts +1 -1
  14. package/dist/cli/commands/close.js +20 -10
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/completion.js +87 -18
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +5 -4
  19. package/dist/cli/commands/config.js +50 -2
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/contracts.js +6 -3
  22. package/dist/cli/commands/contracts.js.map +1 -1
  23. package/dist/cli/commands/copy.d.ts +14 -0
  24. package/dist/cli/commands/copy.js +153 -0
  25. package/dist/cli/commands/copy.js.map +1 -0
  26. package/dist/cli/commands/extension/doctor.js +62 -2
  27. package/dist/cli/commands/extension/doctor.js.map +1 -1
  28. package/dist/cli/commands/extension/install-sources.d.ts +8 -0
  29. package/dist/cli/commands/extension/install-sources.js +82 -2
  30. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  31. package/dist/cli/commands/extension.d.ts +29 -0
  32. package/dist/cli/commands/extension.js +61 -2
  33. package/dist/cli/commands/extension.js.map +1 -1
  34. package/dist/cli/commands/gc.d.ts +8 -1
  35. package/dist/cli/commands/gc.js +26 -3
  36. package/dist/cli/commands/gc.js.map +1 -1
  37. package/dist/cli/commands/get.d.ts +9 -0
  38. package/dist/cli/commands/get.js +23 -2
  39. package/dist/cli/commands/get.js.map +1 -1
  40. package/dist/cli/commands/health.js +15 -2
  41. package/dist/cli/commands/health.js.map +1 -1
  42. package/dist/cli/commands/history-compact.d.ts +39 -0
  43. package/dist/cli/commands/history-compact.js +262 -0
  44. package/dist/cli/commands/history-compact.js.map +1 -0
  45. package/dist/cli/commands/history.d.ts +4 -1
  46. package/dist/cli/commands/history.js +12 -24
  47. package/dist/cli/commands/history.js.map +1 -1
  48. package/dist/cli/commands/index.d.ts +3 -0
  49. package/dist/cli/commands/index.js +5 -2
  50. package/dist/cli/commands/index.js.map +1 -1
  51. package/dist/cli/commands/list.d.ts +2 -0
  52. package/dist/cli/commands/list.js +87 -9
  53. package/dist/cli/commands/list.js.map +1 -1
  54. package/dist/cli/commands/reindex.js +8 -4
  55. package/dist/cli/commands/reindex.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +1 -0
  57. package/dist/cli/commands/search.js +232 -35
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/stats.d.ts +8 -1
  60. package/dist/cli/commands/stats.js +18 -17
  61. package/dist/cli/commands/stats.js.map +1 -1
  62. package/dist/cli/commands/telemetry.d.ts +8 -0
  63. package/dist/cli/commands/telemetry.js +253 -0
  64. package/dist/cli/commands/telemetry.js.map +1 -0
  65. package/dist/cli/error-guidance.js +26 -2
  66. package/dist/cli/error-guidance.js.map +1 -1
  67. package/dist/cli/extension-command-help.d.ts +1 -0
  68. package/dist/cli/extension-command-help.js +3 -2
  69. package/dist/cli/extension-command-help.js.map +1 -1
  70. package/dist/cli/help-content.js +19 -2
  71. package/dist/cli/help-content.js.map +1 -1
  72. package/dist/cli/main.d.ts +3 -0
  73. package/dist/cli/main.js +13 -21
  74. package/dist/cli/main.js.map +1 -1
  75. package/dist/cli/register-list-query.js +24 -6
  76. package/dist/cli/register-list-query.js.map +1 -1
  77. package/dist/cli/register-mutation.js +52 -17
  78. package/dist/cli/register-mutation.js.map +1 -1
  79. package/dist/cli/register-operations.js +55 -8
  80. package/dist/cli/register-operations.js.map +1 -1
  81. package/dist/cli/register-setup.js +5 -5
  82. package/dist/cli/register-setup.js.map +1 -1
  83. package/dist/cli/registration-helpers.js +21 -3
  84. package/dist/cli/registration-helpers.js.map +1 -1
  85. package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +16 -0
  86. package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-YVB3QRTE.js} +11 -11
  87. package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-LH66F75F.js} +87 -17
  88. package/dist/cli-bundle/chunks/aggregate-LH66F75F.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-OHSWFQJM.js} +88 -18
  90. package/dist/cli-bundle/chunks/aggregate-OHSWFQJM.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-2PPYFAG5.js} +8 -8
  92. package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-AUGT5W6J.js} +8 -8
  93. package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-2IF7WLB7.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-2IXCHCLM.js} +5 -6
  95. package/dist/cli-bundle/chunks/chunk-2IXCHCLM.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-2OJHLWBZ.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-3A2CMEM7.js} +5 -4
  98. package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-3EOBJOF4.js} +5 -4
  99. package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-42LOFGJS.js} +91 -16
  100. package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +7 -0
  101. package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-4CHEG6UK.js} +108 -21
  102. package/dist/cli-bundle/chunks/chunk-4CHEG6UK.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4GHZR3BA.js} +56 -28
  104. package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +1 -0
  105. package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-5AXMRKN5.js} +8 -8
  106. package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-6J4K6JLA.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-6RZXO5M2.js} +102 -22
  108. package/dist/cli-bundle/chunks/chunk-6RZXO5M2.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-AVJD6VTA.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-B2KZGPM2.js} +39 -8
  111. package/dist/cli-bundle/chunks/chunk-B2KZGPM2.js.map +1 -0
  112. package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-B5RF3IP7.js} +3 -3
  113. package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-C5W2UH56.js} +3 -3
  114. package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-CKLBZHS7.js} +6 -6
  115. package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-CLD3XNCH.js} +124 -20
  116. package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-FHHBD7PN.js} +38 -7
  118. package/dist/cli-bundle/chunks/chunk-FHHBD7PN.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-FY6Z3FYY.js} +3 -3
  120. package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-GNIUOLZ2.js} +7 -7
  121. package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-GPXQBR3H.js} +12 -12
  122. package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-GUZBNB3G.js} +27 -5
  123. package/dist/cli-bundle/chunks/chunk-GUZBNB3G.js.map +1 -0
  124. package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-H7EO3QA3.js} +5 -5
  125. package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-HLC3KTLP.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-HMMMWBK2.js} +2 -2
  127. package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-HRMHZ4RV.js} +26 -4
  128. package/dist/cli-bundle/chunks/chunk-HRMHZ4RV.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-HV5SSZXF.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-IMCJBN2Q.js} +23 -14
  131. package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-KNGVP5WJ.js} +3 -3
  133. package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-KR6R465K.js} +304 -215
  134. package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +7 -0
  135. package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-LI65XLJR.js} +8 -8
  136. package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-LIN2BPJ7.js} +2 -2
  137. package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js +112 -0
  138. package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-LQHBENVW.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-LXO6V66E.js} +14 -14
  141. package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-M2PW7EZU.js} +26 -7
  142. package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-MOYM2C3J.js} +9 -9
  144. package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-MWRS7Z4P.js} +127 -23
  145. package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +7 -0
  146. package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-NHR2QXXZ.js} +24 -15
  147. package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +1 -0
  148. package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-NQL32HQ5.js} +12 -12
  149. package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-O7HSSFCC.js} +65 -16
  150. package/dist/cli-bundle/chunks/chunk-O7HSSFCC.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-OKSKJKHX.js} +9 -9
  152. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js +1572 -0
  153. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +1 -0
  154. package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-R3V3YCMH.js} +9 -9
  155. package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-RVPTZKBC.js} +9 -9
  156. package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-SFFVGNHC.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-SQPKRA54.js} +14 -14
  158. package/dist/cli-bundle/chunks/chunk-THDEID2Z.js +115 -0
  159. package/dist/cli-bundle/chunks/chunk-THDEID2Z.js.map +7 -0
  160. package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-TINUJMWN.js} +92 -17
  161. package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-TNPBPNII.js} +7 -7
  163. package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-TP4DDY27.js} +6 -6
  164. package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-TYJJOTUA.js} +6 -6
  165. package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-UAQOQ7IE.js} +2 -2
  166. package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-UEWA73ZZ.js} +5 -5
  167. package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-UIIQC5YO.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-UJUT6AHZ.js} +314 -39
  169. package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +7 -0
  170. package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-UT6WFXW2.js} +6 -7
  171. package/dist/cli-bundle/chunks/chunk-UT6WFXW2.js.map +1 -0
  172. package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-UYQ7HXH4.js} +10 -6
  173. package/dist/cli-bundle/chunks/chunk-UYQ7HXH4.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-V6EYFTRL.js} +7 -7
  175. package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-WAA7UI6M.js} +58 -30
  176. package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +7 -0
  177. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-WCQZBDDH.js} +10 -6
  178. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-WCQZBDDH.js.map} +2 -2
  179. package/dist/cli-bundle/chunks/chunk-WR5567FH.js +1582 -0
  180. package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-WYEXLDDY.js} +3 -3
  182. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-X4IZKYHP.js} +307 -32
  183. package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-X7UHMKPE.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-XS3O2TFJ.js} +27 -8
  186. package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-XYNT7UFP.js} +303 -207
  188. package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-YBZW2QQ7.js} +6 -6
  190. package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-YO3THIJF.js} +7 -7
  191. package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-YPH4ESA2.js} +66 -17
  192. package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-BJ4QMPJC.js} +10 -10
  194. package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-KW743OSW.js} +10 -10
  195. package/dist/cli-bundle/chunks/close-P4ZBKODL.js +13 -0
  196. package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-SYHSRZDC.js} +8 -8
  197. package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-DBLEYFOY.js} +29 -26
  198. package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +7 -0
  199. package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-LAC5VR4G.js} +30 -27
  200. package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +1 -0
  201. package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-JEO6HHVM.js} +10 -10
  202. package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-YT2PQ5DD.js} +10 -10
  203. package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-RZRVS3ZV.js} +127 -11
  204. package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-YJSAAADD.js} +128 -12
  206. package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +7 -0
  207. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-LGYEEKAW.js} +14 -14
  208. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-LGYEEKAW.js.map} +2 -2
  209. package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-ZUH5IOOI.js} +15 -15
  210. package/dist/cli-bundle/chunks/context-ZUH5IOOI.js.map +1 -0
  211. package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-YXJ6NXKH.js} +11 -5
  212. package/dist/cli-bundle/chunks/contracts-YXJ6NXKH.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-ZIBXROPE.js} +12 -6
  214. package/dist/cli-bundle/chunks/contracts-ZIBXROPE.js.map +1 -0
  215. package/dist/cli-bundle/chunks/copy-BZALX5MQ.js +182 -0
  216. package/dist/cli-bundle/chunks/copy-BZALX5MQ.js.map +1 -0
  217. package/dist/cli-bundle/chunks/copy-YPWEIAPD.js +185 -0
  218. package/dist/cli-bundle/chunks/copy-YPWEIAPD.js.map +7 -0
  219. package/dist/cli-bundle/chunks/create-4DS2QWQC.js +27 -0
  220. package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-CF7EVRX7.js} +13 -13
  221. package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-KR4VBWVE.js} +7 -7
  222. package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-XLZRTRKR.js} +7 -7
  223. package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-2YTXD3VM.js} +7 -7
  224. package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-GZMFMTGS.js} +7 -7
  225. package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-SLROFEQ4.js} +9 -9
  226. package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-ZHISRR2D.js} +9 -9
  227. package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-3C7OOI4F.js} +8 -6
  228. package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-XYCUXICD.js} +8 -6
  229. package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-FUWF2FYJ.js} +9 -9
  230. package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-J4I5IU4O.js} +9 -9
  231. package/dist/cli-bundle/chunks/gc-34NXSNSN.js +362 -0
  232. package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +1 -0
  233. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js +372 -0
  234. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +7 -0
  235. package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-SZKNRHMA.js} +34 -12
  236. package/dist/cli-bundle/chunks/get-SZKNRHMA.js.map +1 -0
  237. package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-VITKYP6S.js} +33 -11
  238. package/dist/cli-bundle/chunks/get-VITKYP6S.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-4SNTA2TF.js} +27 -13
  240. package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-7G3EPM57.js} +28 -14
  242. package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +1 -0
  243. package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-SDAWYZR3.js} +10 -10
  244. package/dist/cli-bundle/chunks/history-YDUEILKP.js +20 -0
  245. package/dist/cli-bundle/chunks/history-compact-DMW536VH.js +287 -0
  246. package/dist/cli-bundle/chunks/history-compact-DMW536VH.js.map +1 -0
  247. package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js +290 -0
  248. package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js.map +7 -0
  249. package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-EPJ7GENL.js} +11 -11
  250. package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +19 -0
  251. package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-IJ7LLBET.js} +11 -11
  252. package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-YNESJRT6.js} +11 -11
  253. package/dist/cli-bundle/chunks/init-IGSS4GNH.js +17 -0
  254. package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-YHVBTEET.js} +9 -8
  255. package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-4YBMIVCZ.js} +10 -10
  256. package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-T4PF24YN.js} +10 -10
  257. package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-3KEVBOYW.js} +10 -10
  258. package/dist/cli-bundle/chunks/list-E44O2K64.js +20 -0
  259. package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-FLUCNJSH.js} +10 -10
  260. package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-GJKALVZM.js} +10 -10
  261. package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-T5MMZLI3.js} +13 -13
  262. package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-YYMIL3HV.js} +13 -13
  263. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-I65EZ3HB.js} +33 -27
  264. package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +1 -0
  265. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-OECMHO4G.js} +32 -26
  266. package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +7 -0
  267. package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-2FLXORLR.js} +65 -47
  268. package/dist/cli-bundle/chunks/register-mutation-2FLXORLR.js.map +1 -0
  269. package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-5GPDEKHR.js} +64 -46
  270. package/dist/cli-bundle/chunks/register-mutation-5GPDEKHR.js.map +7 -0
  271. package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-BNGAUMGK.js} +71 -35
  272. package/dist/cli-bundle/chunks/register-operations-BNGAUMGK.js.map +1 -0
  273. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-GQKT35H5.js} +70 -34
  274. package/dist/cli-bundle/chunks/register-operations-GQKT35H5.js.map +7 -0
  275. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-DNDCGZ4O.js} +18 -18
  276. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-DNDCGZ4O.js.map} +1 -1
  277. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-EJY44FPH.js} +17 -17
  278. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-EJY44FPH.js.map} +2 -2
  279. package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-DDJGVZIN.js} +11 -11
  280. package/dist/cli-bundle/chunks/restore-SJSASGZP.js +17 -0
  281. package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-B7NQ6XVP.js} +8 -8
  282. package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-HEGYH6CE.js} +8 -8
  283. package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-DVVQ4UO2.js} +421 -42
  284. package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +1 -0
  285. package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-JNEZJV7H.js} +427 -41
  286. package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +7 -0
  287. package/dist/cli-bundle/chunks/stats-7JDIJRDH.js +202 -0
  288. package/dist/cli-bundle/chunks/stats-7JDIJRDH.js.map +1 -0
  289. package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js +212 -0
  290. package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js.map +7 -0
  291. package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js +251 -0
  292. package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js.map +7 -0
  293. package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js +248 -0
  294. package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js.map +1 -0
  295. package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-IIELLSZX.js} +14 -13
  296. package/dist/cli-bundle/chunks/test-ML5RLWXE.js +32 -0
  297. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-7DNCMML7.js} +14 -13
  298. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-7DNCMML7.js.map} +1 -1
  299. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-IHTUJRRC.js} +16 -15
  300. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-IHTUJRRC.js.map} +1 -1
  301. package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-5FEMBV3A.js} +5 -5
  302. package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-RNKZ37PS.js} +5 -5
  303. package/dist/cli-bundle/chunks/update-6C67X4KS.js +21 -0
  304. package/dist/cli-bundle/chunks/update-VF26YPT3.js +25 -0
  305. package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-BSZZZYXY.js} +22 -22
  306. package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-BWKJJEBF.js} +22 -22
  307. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-RSE5PC44.js} +7 -6
  308. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-RSE5PC44.js.map} +1 -1
  309. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-YWI5DJFA.js} +5 -4
  310. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-YWI5DJFA.js.map} +1 -1
  311. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-NK3WKB7C.js} +18 -17
  312. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-NK3WKB7C.js.map} +1 -1
  313. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-UCEOB7S6.js} +20 -19
  314. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-UCEOB7S6.js.map} +1 -1
  315. package/dist/cli-bundle/main.js +198 -1523
  316. package/dist/cli-bundle/main.js.map +4 -4
  317. package/dist/core/config/nested-settings.d.ts +8 -6
  318. package/dist/core/config/nested-settings.js +71 -5
  319. package/dist/core/config/nested-settings.js.map +1 -1
  320. package/dist/core/config/positional-value.js +4 -2
  321. package/dist/core/config/positional-value.js.map +1 -1
  322. package/dist/core/extensions/extension-types.d.ts +36 -0
  323. package/dist/core/extensions/extension-types.js +2 -2
  324. package/dist/core/extensions/extension-types.js.map +1 -1
  325. package/dist/core/extensions/loader.js +46 -5
  326. package/dist/core/extensions/loader.js.map +1 -1
  327. package/dist/core/history/drift-scan.d.ts +3 -4
  328. package/dist/core/history/drift-scan.js +71 -18
  329. package/dist/core/history/drift-scan.js.map +1 -1
  330. package/dist/core/history/history-diff.d.ts +47 -0
  331. package/dist/core/history/history-diff.js +152 -0
  332. package/dist/core/history/history-diff.js.map +1 -0
  333. package/dist/core/history/history-storage-stats.d.ts +31 -0
  334. package/dist/core/history/history-storage-stats.js +101 -0
  335. package/dist/core/history/history-storage-stats.js.map +1 -0
  336. package/dist/core/item/id.js +4 -5
  337. package/dist/core/item/id.js.map +1 -1
  338. package/dist/core/item/item-format.js +7 -3
  339. package/dist/core/item/item-format.js.map +1 -1
  340. package/dist/core/item/toon-decode.d.ts +7 -0
  341. package/dist/core/item/toon-decode.js +11 -2
  342. package/dist/core/item/toon-decode.js.map +1 -1
  343. package/dist/core/item/type-registry.js +25 -7
  344. package/dist/core/item/type-registry.js.map +1 -1
  345. package/dist/core/lock/lock-gc.d.ts +46 -0
  346. package/dist/core/lock/lock-gc.js +194 -0
  347. package/dist/core/lock/lock-gc.js.map +1 -0
  348. package/dist/core/search/cache.js +5 -3
  349. package/dist/core/search/cache.js.map +1 -1
  350. package/dist/core/search/corpus.d.ts +6 -0
  351. package/dist/core/search/corpus.js +22 -9
  352. package/dist/core/search/corpus.js.map +1 -1
  353. package/dist/core/search/embedding-batches.js +10 -7
  354. package/dist/core/search/embedding-batches.js.map +1 -1
  355. package/dist/core/search/relevance.d.ts +29 -0
  356. package/dist/core/search/relevance.js +226 -0
  357. package/dist/core/search/relevance.js.map +1 -0
  358. package/dist/core/search/vector-stores.d.ts +3 -0
  359. package/dist/core/search/vector-stores.js +23 -10
  360. package/dist/core/search/vector-stores.js.map +1 -1
  361. package/dist/core/shared/constants.js +15 -2
  362. package/dist/core/shared/constants.js.map +1 -1
  363. package/dist/core/shared/errors.d.ts +6 -0
  364. package/dist/core/shared/errors.js +2 -2
  365. package/dist/core/shared/errors.js.map +1 -1
  366. package/dist/core/shared/primitives.d.ts +8 -0
  367. package/dist/core/shared/primitives.js +29 -2
  368. package/dist/core/shared/primitives.js.map +1 -1
  369. package/dist/core/shared/serial-queue.d.ts +12 -0
  370. package/dist/core/shared/serial-queue.js +43 -0
  371. package/dist/core/shared/serial-queue.js.map +1 -0
  372. package/dist/core/shared/time.js +42 -6
  373. package/dist/core/shared/time.js.map +1 -1
  374. package/dist/core/store/paths.js +25 -7
  375. package/dist/core/store/paths.js.map +1 -1
  376. package/dist/core/store/settings-validator.d.ts +11 -0
  377. package/dist/core/store/settings-validator.js +14 -2
  378. package/dist/core/store/settings-validator.js.map +1 -1
  379. package/dist/core/store/settings.d.ts +19 -1
  380. package/dist/core/store/settings.js +199 -17
  381. package/dist/core/store/settings.js.map +1 -1
  382. package/dist/core/telemetry/observability.js +3 -3
  383. package/dist/core/telemetry/observability.js.map +1 -1
  384. package/dist/core/telemetry/runtime.js +99 -6
  385. package/dist/core/telemetry/runtime.js.map +1 -1
  386. package/dist/mcp/server.d.ts +1 -0
  387. package/dist/mcp/server.js +187 -42
  388. package/dist/mcp/server.js.map +1 -1
  389. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  390. package/dist/sdk/cli-contracts/commander-types.js +13 -2
  391. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  392. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  393. package/dist/sdk/cli-contracts/enum-contracts.js +8 -2
  394. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  395. package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
  396. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  397. package/dist/sdk/cli-contracts/tool-parameter-tables.js +39 -7
  398. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  399. package/dist/sdk/cli-contracts.d.ts +26 -1
  400. package/dist/sdk/cli-contracts.js +75 -11
  401. package/dist/sdk/cli-contracts.js.map +1 -1
  402. package/dist/sdk/index.d.ts +2 -2
  403. package/dist/sdk/index.js +3 -3
  404. package/dist/sdk/index.js.map +1 -1
  405. package/dist/sdk/testing.d.ts +51 -1
  406. package/dist/sdk/testing.js +93 -2
  407. package/dist/sdk/testing.js.map +1 -1
  408. package/dist/types.d.ts +14 -0
  409. package/dist/types.js +2 -2
  410. package/dist/types.js.map +1 -1
  411. package/docs/AGENT_GUIDE.md +1 -1
  412. package/docs/ARCHITECTURE.md +11 -1
  413. package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
  414. package/docs/CODEX_PLUGIN.md +1 -1
  415. package/docs/COMMANDS.md +42 -4
  416. package/docs/CONFIGURATION.md +31 -2
  417. package/docs/EXTENSIONS.md +28 -8
  418. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  419. package/docs/ONBOARDING.md +165 -0
  420. package/docs/QUICKSTART.md +2 -2
  421. package/docs/README.md +12 -4
  422. package/docs/RELEASING.md +36 -1
  423. package/docs/SDK.md +66 -0
  424. package/docs/TESTING.md +33 -1
  425. package/package.json +6 -2
  426. package/packages/pm-governance-audit/README.md +14 -0
  427. package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
  428. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
  429. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
  430. package/packages/pm-governance-audit/package.json +4 -2
  431. package/packages/pm-lifecycle-hooks/README.md +21 -0
  432. package/packages/pm-search-advanced/README.md +38 -0
  433. package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
  434. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
  435. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
  436. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
  437. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  438. package/plugins/pm-claude/README.md +11 -8
  439. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  440. package/plugins/pm-claude/commands/pm-init.md +1 -1
  441. package/plugins/pm-codex/README.md +1 -1
  442. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
  443. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +0 -1
  444. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +0 -7
  461. package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +0 -1
  465. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
  470. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
  471. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +0 -1
  472. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +0 -7
  473. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +0 -7
  474. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +0 -1
  475. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +0 -1
  476. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
  477. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +0 -1
  478. package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
  479. package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
  480. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
  481. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
  482. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
  483. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +0 -7
  484. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +0 -1
  485. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
  486. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
  487. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
  488. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
  489. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
  490. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
  491. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +0 -7
  492. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +0 -1
  493. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +0 -1
  494. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +0 -7
  495. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
  496. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +0 -7
  497. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
  498. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +0 -7
  499. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +0 -1
  500. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
  501. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
  502. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
  503. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
  504. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +0 -31
  505. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
  506. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
  507. /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-5UROHJ3D.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-YVB3QRTE.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-2PPYFAG5.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-AUGT5W6J.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-2IF7WLB7.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-2OJHLWBZ.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-3A2CMEM7.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-3EOBJOF4.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-5AXMRKN5.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-6J4K6JLA.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-AVJD6VTA.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-B5RF3IP7.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-C5W2UH56.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-CKLBZHS7.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-FY6Z3FYY.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-GNIUOLZ2.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-GPXQBR3H.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-H7EO3QA3.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-HLC3KTLP.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-HMMMWBK2.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-HV5SSZXF.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-KNGVP5WJ.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-LI65XLJR.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-LIN2BPJ7.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-LQHBENVW.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-LXO6V66E.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-MOYM2C3J.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-NQL32HQ5.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-OKSKJKHX.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-R3V3YCMH.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-RVPTZKBC.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-SFFVGNHC.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-SQPKRA54.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-TNPBPNII.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-TP4DDY27.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-TYJJOTUA.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-UAQOQ7IE.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-UEWA73ZZ.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-UIIQC5YO.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-V6EYFTRL.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-WYEXLDDY.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-X7UHMKPE.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-YBZW2QQ7.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-YO3THIJF.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-BJ4QMPJC.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-KW743OSW.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-P4ZBKODL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-SYHSRZDC.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-JEO6HHVM.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-YT2PQ5DD.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-4DS2QWQC.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-CF7EVRX7.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-KR4VBWVE.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-XLZRTRKR.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-2YTXD3VM.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-GZMFMTGS.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-SLROFEQ4.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-ZHISRR2D.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-3C7OOI4F.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-XYCUXICD.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-FUWF2FYJ.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-J4I5IU4O.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-SDAWYZR3.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-YDUEILKP.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-EPJ7GENL.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-KASLLPE7.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-IJ7LLBET.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-YNESJRT6.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-IGSS4GNH.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-YHVBTEET.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-4YBMIVCZ.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-T4PF24YN.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-3KEVBOYW.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-E44O2K64.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-FLUCNJSH.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-GJKALVZM.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-T5MMZLI3.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-YYMIL3HV.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-DDJGVZIN.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-SJSASGZP.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-B7NQ6XVP.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-HEGYH6CE.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-IIELLSZX.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-ML5RLWXE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-5FEMBV3A.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-RNKZ37PS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-6C67X4KS.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-VF26YPT3.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-BSZZZYXY.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-BWKJJEBF.js.map} +0 -0
@@ -0,0 +1,372 @@
1
+ import {
2
+ nowIso
3
+ } from "./chunk-FHHBD7PN.js";
4
+ import {
5
+ EXIT_CODE,
6
+ PmCliError,
7
+ getSettingsPath,
8
+ pathExists,
9
+ readSettings,
10
+ resolvePmRoot,
11
+ runActiveOnIndexHooks,
12
+ runActiveOnReadHooks,
13
+ runActiveOnWriteHooks
14
+ } from "./chunk-UJUT6AHZ.js";
15
+
16
+ // dist/cli/commands/gc.js
17
+ import fs2 from "node:fs/promises";
18
+ import path2 from "node:path";
19
+
20
+ // dist/core/lock/lock-gc.js
21
+ import fs from "node:fs/promises";
22
+ import path from "node:path";
23
+ !(function() {
24
+ try {
25
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
26
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1a412027-5c73-58d4-b696-4a909dde88a8");
27
+ } catch (e2) {
28
+ }
29
+ })();
30
+ function parseLock(raw) {
31
+ let parsed;
32
+ try {
33
+ parsed = JSON.parse(raw);
34
+ } catch {
35
+ return null;
36
+ }
37
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
38
+ return null;
39
+ }
40
+ const candidate = parsed;
41
+ const { id, owner, created_at, ttl_seconds } = candidate;
42
+ if (typeof id !== "string" || typeof owner !== "string" || typeof created_at !== "string" || typeof ttl_seconds !== "number" || !Number.isFinite(ttl_seconds)) {
43
+ return null;
44
+ }
45
+ return { id, owner, created_at, ttl_seconds };
46
+ }
47
+ function isErrno(error, code) {
48
+ return typeof error === "object" && error !== null && "code" in error && error.code === code;
49
+ }
50
+ async function runLockGc(pmRoot, options) {
51
+ const { dryRun, hooks } = options;
52
+ const nowMs = options.now ?? Date.now();
53
+ const locksDir = path.join(pmRoot, "locks");
54
+ const result = {
55
+ scanned: 0,
56
+ removed: [],
57
+ retained: [],
58
+ warnings: [],
59
+ entries: []
60
+ };
61
+ let dirEntries;
62
+ try {
63
+ const raw = await fs.readdir(locksDir);
64
+ dirEntries = raw.filter((f) => f.endsWith(".lock")).sort();
65
+ } catch (error) {
66
+ if (isErrno(error, "ENOENT")) {
67
+ return result;
68
+ }
69
+ throw error;
70
+ }
71
+ for (const file of dirEntries) {
72
+ result.scanned += 1;
73
+ const absPath = path.join(locksDir, file);
74
+ const relPath = `locks/${file}`;
75
+ if (hooks?.onRead) {
76
+ const hookWarnings = await hooks.onRead(absPath);
77
+ result.warnings.push(...hookWarnings);
78
+ }
79
+ let raw;
80
+ try {
81
+ raw = await fs.readFile(absPath, "utf8");
82
+ } catch (readError) {
83
+ if (isErrno(readError, "ENOENT")) {
84
+ result.scanned -= 1;
85
+ continue;
86
+ }
87
+ result.warnings.push(`lock_unreadable:${file}`);
88
+ result.retained.push(relPath);
89
+ result.entries.push({
90
+ file,
91
+ id: null,
92
+ owner: null,
93
+ created_at: null,
94
+ ttl_seconds: null,
95
+ age_seconds: null,
96
+ stale: false,
97
+ reason: "unparseable"
98
+ });
99
+ continue;
100
+ }
101
+ const lock = parseLock(raw);
102
+ if (lock === null) {
103
+ result.warnings.push(`lock_unparseable:${file}`);
104
+ result.retained.push(relPath);
105
+ result.entries.push({
106
+ file,
107
+ id: null,
108
+ owner: null,
109
+ created_at: null,
110
+ ttl_seconds: null,
111
+ age_seconds: null,
112
+ stale: false,
113
+ reason: "unparseable"
114
+ });
115
+ continue;
116
+ }
117
+ const createdAtMs = Date.parse(lock.created_at);
118
+ if (!Number.isFinite(createdAtMs)) {
119
+ result.warnings.push(`lock_invalid_timestamp:${file}`);
120
+ result.retained.push(relPath);
121
+ result.entries.push({
122
+ file,
123
+ id: lock.id,
124
+ owner: lock.owner,
125
+ created_at: lock.created_at,
126
+ ttl_seconds: lock.ttl_seconds,
127
+ age_seconds: null,
128
+ stale: false,
129
+ reason: "unparseable"
130
+ });
131
+ continue;
132
+ }
133
+ const ageMs = nowMs - createdAtMs;
134
+ const age_seconds = Math.floor(ageMs / 1e3);
135
+ const stale = ageMs > lock.ttl_seconds * 1e3;
136
+ if (!stale) {
137
+ result.retained.push(relPath);
138
+ result.entries.push({
139
+ file,
140
+ id: lock.id,
141
+ owner: lock.owner,
142
+ created_at: lock.created_at,
143
+ ttl_seconds: lock.ttl_seconds,
144
+ age_seconds,
145
+ stale: false,
146
+ reason: "active"
147
+ });
148
+ continue;
149
+ }
150
+ if (!dryRun) {
151
+ try {
152
+ await fs.unlink(absPath);
153
+ } catch (unlinkError) {
154
+ if (!isErrno(unlinkError, "ENOENT")) {
155
+ result.warnings.push(`lock_remove_failed:${file}`);
156
+ result.retained.push(relPath);
157
+ result.entries.push({
158
+ file,
159
+ id: lock.id,
160
+ owner: lock.owner,
161
+ created_at: lock.created_at,
162
+ ttl_seconds: lock.ttl_seconds,
163
+ age_seconds,
164
+ stale: true,
165
+ reason: "expired"
166
+ });
167
+ continue;
168
+ }
169
+ }
170
+ if (hooks?.onWrite) {
171
+ const hookWarnings = await hooks.onWrite(absPath);
172
+ result.warnings.push(...hookWarnings);
173
+ }
174
+ }
175
+ result.removed.push(relPath);
176
+ result.entries.push({
177
+ file,
178
+ id: lock.id,
179
+ owner: lock.owner,
180
+ created_at: lock.created_at,
181
+ ttl_seconds: lock.ttl_seconds,
182
+ age_seconds,
183
+ stale: true,
184
+ reason: "expired"
185
+ });
186
+ }
187
+ return result;
188
+ }
189
+
190
+ // dist/cli/commands/gc.js
191
+ !(function() {
192
+ try {
193
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
194
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ddcbdf59-d0c8-5ae8-84e3-c4af1966deb6");
195
+ } catch (e2) {
196
+ }
197
+ })();
198
+ var GC_SCOPE_VALUES = ["index", "embeddings", "runtime", "locks"];
199
+ var GC_TARGETS = [
200
+ {
201
+ scope: "index",
202
+ relativePath: "index/manifest.json",
203
+ kind: "file"
204
+ },
205
+ {
206
+ scope: "embeddings",
207
+ relativePath: "search/embeddings.jsonl",
208
+ kind: "file"
209
+ },
210
+ {
211
+ scope: "embeddings",
212
+ relativePath: "search/vectorization-status.json",
213
+ kind: "file"
214
+ },
215
+ {
216
+ scope: "embeddings",
217
+ relativePath: "search/lancedb",
218
+ kind: "directory"
219
+ },
220
+ {
221
+ scope: "runtime",
222
+ relativePath: "runtime/test-runs",
223
+ kind: "directory"
224
+ }
225
+ ];
226
+ function isErrno2(error, code) {
227
+ return typeof error === "object" && error !== null && "code" in error && error.code === code;
228
+ }
229
+ async function removeCacheFile(pmRoot, target, dryRun) {
230
+ const relativePath = target.relativePath;
231
+ const absolutePath = path2.join(pmRoot, relativePath);
232
+ const warnings = await runActiveOnReadHooks({
233
+ path: absolutePath,
234
+ scope: "project"
235
+ });
236
+ try {
237
+ const stats = await fs2.stat(absolutePath);
238
+ if (target.kind === "file" && !stats.isFile()) {
239
+ return {
240
+ removed: false,
241
+ warnings: [...warnings, `not_a_file:${relativePath}`]
242
+ };
243
+ }
244
+ if (target.kind === "directory" && !stats.isDirectory()) {
245
+ return {
246
+ removed: false,
247
+ warnings: [...warnings, `not_a_directory:${relativePath}`]
248
+ };
249
+ }
250
+ if (dryRun) {
251
+ return {
252
+ removed: true,
253
+ warnings
254
+ };
255
+ }
256
+ if (target.kind === "file") {
257
+ await fs2.unlink(absolutePath);
258
+ } else {
259
+ await fs2.rm(absolutePath, { recursive: true, force: true });
260
+ }
261
+ const writeWarnings = await runActiveOnWriteHooks({
262
+ path: absolutePath,
263
+ scope: "project",
264
+ op: "gc:remove"
265
+ });
266
+ return {
267
+ removed: true,
268
+ warnings: [...warnings, ...writeWarnings]
269
+ };
270
+ } catch (error) {
271
+ if (isErrno2(error, "ENOENT")) {
272
+ return {
273
+ removed: false,
274
+ warnings
275
+ };
276
+ }
277
+ throw error;
278
+ }
279
+ }
280
+ function parseScopes(raw) {
281
+ if (!raw || raw.length === 0) {
282
+ return [...GC_SCOPE_VALUES];
283
+ }
284
+ const tokens = raw.flatMap((entry) => entry.split(",")).map((entry) => entry.trim().toLowerCase()).filter((entry) => entry.length > 0);
285
+ if (tokens.length === 0) {
286
+ throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(",")})`, EXIT_CODE.USAGE);
287
+ }
288
+ const resolved = /* @__PURE__ */ new Set();
289
+ for (const token of tokens) {
290
+ if (!GC_SCOPE_VALUES.includes(token)) {
291
+ throw new PmCliError(`Invalid --scope value "${token}". Expected one or more of: ${GC_SCOPE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
292
+ }
293
+ resolved.add(token);
294
+ }
295
+ return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));
296
+ }
297
+ function buildGcGuidance(params) {
298
+ const guidance = [];
299
+ if (params.dryRun) {
300
+ guidance.push("Dry-run preview only: no cache artifacts were deleted.");
301
+ }
302
+ const searchScopeSelected = params.scopes.includes("index") || params.scopes.includes("embeddings");
303
+ const searchArtifactsAffected = params.removed.some((entry) => entry === "index/manifest.json" || entry === "search/embeddings.jsonl" || entry === "search/vectorization-status.json" || entry === "search/lancedb");
304
+ if (searchScopeSelected && searchArtifactsAffected) {
305
+ guidance.push('Search artifacts were removed; run "pm install search-advanced --project" if reindex is unavailable, then "pm reindex --mode keyword" (and "--mode semantic" when semantic search is enabled) before search-heavy workflows.');
306
+ }
307
+ return guidance;
308
+ }
309
+ async function runGc(global2, options = {}) {
310
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
311
+ if (!await pathExists(getSettingsPath(pmRoot))) {
312
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
313
+ }
314
+ await readSettings(pmRoot);
315
+ const dryRun = options.dryRun === true;
316
+ const scopes = parseScopes(options.scope);
317
+ const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));
318
+ const removed = [];
319
+ const retained = [];
320
+ const warnings = [];
321
+ for (const target of selectedTargets) {
322
+ const result = await removeCacheFile(pmRoot, target, dryRun);
323
+ if (result.removed) {
324
+ removed.push(target.relativePath);
325
+ } else {
326
+ retained.push(target.relativePath);
327
+ }
328
+ warnings.push(...result.warnings);
329
+ }
330
+ let locksSummary;
331
+ if (scopes.includes("locks")) {
332
+ const lockResult = await runLockGc(pmRoot, {
333
+ dryRun,
334
+ hooks: {
335
+ onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: "project" }),
336
+ onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: "project", op: "gc:lock_remove" })
337
+ }
338
+ });
339
+ removed.push(...lockResult.removed);
340
+ retained.push(...lockResult.retained);
341
+ warnings.push(...lockResult.warnings);
342
+ locksSummary = {
343
+ scanned: lockResult.scanned,
344
+ removed: lockResult.removed.length,
345
+ retained: lockResult.retained.length
346
+ };
347
+ }
348
+ warnings.push(...await runActiveOnIndexHooks({
349
+ mode: dryRun ? "gc:dry-run" : "gc",
350
+ total_items: selectedTargets.length
351
+ }));
352
+ const guidance = buildGcGuidance({
353
+ dryRun,
354
+ scopes,
355
+ removed
356
+ });
357
+ return {
358
+ ok: warnings.length === 0,
359
+ dry_run: dryRun,
360
+ scope: scopes,
361
+ removed,
362
+ retained,
363
+ warnings,
364
+ ...locksSummary ? { locks: locksSummary } : {},
365
+ guidance,
366
+ generated_at: nowIso()
367
+ };
368
+ }
369
+ export {
370
+ runGc
371
+ };
372
+ //# sourceMappingURL=gc-SPIIZX3A.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/gc.ts", "../../../../../../../../core/lock/lock-gc.ts"],
4
+ "sourcesContent": ["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { runLockGc } from \"../../core/lock/lock-gc.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nconst GC_SCOPE_VALUES = [\"index\", \"embeddings\", \"runtime\", \"locks\"] as const;\ntype GcScope = (typeof GC_SCOPE_VALUES)[number];\n\ninterface GcTarget {\n scope: GcScope;\n relativePath: string;\n kind: \"file\" | \"directory\";\n}\n\nconst GC_TARGETS: readonly GcTarget[] = [\n {\n scope: \"index\",\n relativePath: \"index/manifest.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/embeddings.jsonl\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/vectorization-status.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/lancedb\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n] as const;\n\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\nexport interface GcLocksSummary {\n scanned: number;\n removed: number;\n retained: number;\n}\n\nexport interface GcResult {\n ok: boolean;\n dry_run: boolean;\n scope: GcScope[];\n removed: string[];\n retained: string[];\n warnings: string[];\n guidance: string[];\n /** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */\n locks?: GcLocksSummary;\n generated_at: string;\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\nasync function removeCacheFile(\n pmRoot: string,\n target: GcTarget,\n dryRun: boolean,\n): Promise<{ removed: boolean; warnings: string[] }> {\n const relativePath = target.relativePath;\n const absolutePath = path.join(pmRoot, relativePath);\n const warnings = await runActiveOnReadHooks({\n path: absolutePath,\n scope: \"project\",\n });\n try {\n const stats = await fs.stat(absolutePath);\n if (target.kind === \"file\" && !stats.isFile()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_file:${relativePath}`],\n };\n }\n if (target.kind === \"directory\" && !stats.isDirectory()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_directory:${relativePath}`],\n };\n }\n if (dryRun) {\n return {\n removed: true,\n warnings,\n };\n }\n if (target.kind === \"file\") {\n await fs.unlink(absolutePath);\n } else {\n await fs.rm(absolutePath, { recursive: true, force: true });\n }\n const writeWarnings = await runActiveOnWriteHooks({\n path: absolutePath,\n scope: \"project\",\n op: \"gc:remove\",\n });\n return {\n removed: true,\n warnings: [...warnings, ...writeWarnings],\n };\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return {\n removed: false,\n warnings,\n };\n }\n throw error;\n }\n}\n\nfunction parseScopes(raw: string[] | undefined): GcScope[] {\n if (!raw || raw.length === 0) {\n return [...GC_SCOPE_VALUES];\n }\n const tokens = raw\n .flatMap((entry) => entry.split(\",\"))\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(\",\")})`, EXIT_CODE.USAGE);\n }\n const resolved = new Set<GcScope>();\n for (const token of tokens) {\n if (!(GC_SCOPE_VALUES as readonly string[]).includes(token)) {\n throw new PmCliError(\n `Invalid --scope value \"${token}\". Expected one or more of: ${GC_SCOPE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.add(token as GcScope);\n }\n return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));\n}\n\nfunction buildGcGuidance(params: {\n dryRun: boolean;\n scopes: GcScope[];\n removed: string[];\n}): string[] {\n const guidance: string[] = [];\n if (params.dryRun) {\n guidance.push(\"Dry-run preview only: no cache artifacts were deleted.\");\n }\n const searchScopeSelected = params.scopes.includes(\"index\") || params.scopes.includes(\"embeddings\");\n const searchArtifactsAffected = params.removed.some(\n (entry) =>\n entry === \"index/manifest.json\" ||\n entry === \"search/embeddings.jsonl\" ||\n entry === \"search/vectorization-status.json\" ||\n entry === \"search/lancedb\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; run \"pm install search-advanced --project\" if reindex is unavailable, then \"pm reindex --mode keyword\" (and \"--mode semantic\" when semantic search is enabled) before search-heavy workflows.',\n );\n }\n return guidance;\n}\n\nexport async function runGc(global: GlobalOptions, options: GcCommandOptions = {}): Promise<GcResult> {\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\n await readSettings(pmRoot);\n const dryRun = options.dryRun === true;\n const scopes = parseScopes(options.scope);\n const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));\n\n const removed: string[] = [];\n const retained: string[] = [];\n const warnings: string[] = [];\n\n for (const target of selectedTargets) {\n const result = await removeCacheFile(pmRoot, target, dryRun);\n if (result.removed) {\n removed.push(target.relativePath);\n } else {\n retained.push(target.relativePath);\n }\n warnings.push(...result.warnings);\n }\n\n // The locks scope is not a path-based GC_TARGET: it sweeps the locks/ directory\n // and removes only locks whose own embedded ttl has expired (crashed-process\n // debris), retaining active and unparseable locks. See core/lock/lock-gc.ts.\n let locksSummary: GcLocksSummary | undefined;\n if (scopes.includes(\"locks\")) {\n const lockResult = await runLockGc(pmRoot, {\n dryRun,\n hooks: {\n onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: \"project\" }),\n onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: \"project\", op: \"gc:lock_remove\" }),\n },\n });\n removed.push(...lockResult.removed);\n retained.push(...lockResult.retained);\n warnings.push(...lockResult.warnings);\n locksSummary = {\n scanned: lockResult.scanned,\n removed: lockResult.removed.length,\n retained: lockResult.retained.length,\n };\n }\n\n warnings.push(\n ...(await runActiveOnIndexHooks({\n mode: dryRun ? \"gc:dry-run\" : \"gc\",\n total_items: selectedTargets.length,\n })),\n );\n const guidance = buildGcGuidance({\n dryRun,\n scopes,\n removed,\n });\n\n return {\n ok: warnings.length === 0,\n dry_run: dryRun,\n scope: scopes,\n removed,\n retained,\n warnings,\n ...(locksSummary ? { locks: locksSummary } : {}),\n guidance,\n generated_at: nowIso(),\n };\n}\n", "/**\n * lock-gc.ts — Stale lock file garbage collector.\n *\n * Safety-first policy: if a lock file cannot be read or parsed, it is RETAINED\n * rather than deleted. We only remove locks whose staleness can be conclusively\n * determined from the lock's own embedded `ttl_seconds` field.\n *\n * Staleness formula: (now_ms - Date.parse(created_at)) > ttl_seconds * 1000\n * Zero ttl means any lock older than 0 ms is stale. Negative ttl means always stale.\n */\n\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nexport interface StaleLockScanEntry {\n /** e.g. \"pm-abc1.lock\" */\n file: string;\n /** parsed id, or null if unparseable */\n id: string | null;\n owner: string | null;\n created_at: string | null;\n ttl_seconds: number | null;\n /** floor((now - created_at)/1000), null if unparseable */\n age_seconds: number | null;\n /** true only when classified expired */\n stale: boolean;\n reason: \"expired\" | \"active\" | \"unparseable\";\n}\n\nexport interface LockGcHooks {\n onRead?: (lockPath: string) => Promise<string[]> | string[];\n onWrite?: (lockPath: string) => Promise<string[]> | string[];\n}\n\nexport interface LockGcOptions {\n dryRun: boolean;\n /** epoch ms; defaults to Date.now() — injectable for deterministic tests */\n now?: number;\n hooks?: LockGcHooks;\n}\n\nexport interface LockGcResult {\n /** number of *.lock files examined */\n scanned: number;\n /** relative paths like \"locks/pm-abc1.lock\" (removed, or would-remove under dryRun) */\n removed: string[];\n /** relative paths retained (active OR unparseable — never delete what we can't reason about) */\n retained: string[];\n warnings: string[];\n /** one per scanned *.lock file, sorted by file name asc */\n entries: StaleLockScanEntry[];\n}\n\ninterface ParsedLock {\n id: string;\n owner: string;\n created_at: string;\n ttl_seconds: number;\n}\n\nfunction parseLock(raw: string): ParsedLock | null {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return null;\n }\n const candidate = parsed as Record<string, unknown>;\n const { id, owner, created_at, ttl_seconds } = candidate;\n if (\n typeof id !== \"string\" ||\n typeof owner !== \"string\" ||\n typeof created_at !== \"string\" ||\n typeof ttl_seconds !== \"number\" ||\n !Number.isFinite(ttl_seconds)\n ) {\n return null;\n }\n return { id, owner, created_at, ttl_seconds };\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n (error as { code?: string }).code === code\n );\n}\n\nexport async function runLockGc(pmRoot: string, options: LockGcOptions): Promise<LockGcResult> {\n const { dryRun, hooks } = options;\n const nowMs = options.now ?? Date.now();\n const locksDir = path.join(pmRoot, \"locks\");\n\n const result: LockGcResult = {\n scanned: 0,\n removed: [],\n retained: [],\n warnings: [],\n entries: [],\n };\n\n let dirEntries: string[];\n try {\n const raw = await fs.readdir(locksDir);\n dirEntries = raw.filter((f) => f.endsWith(\".lock\")).sort();\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return result;\n }\n throw error;\n }\n\n for (const file of dirEntries) {\n result.scanned += 1;\n const absPath = path.join(locksDir, file);\n const relPath = `locks/${file}`;\n\n // --- onRead hook ---\n if (hooks?.onRead) {\n const hookWarnings = await hooks.onRead(absPath);\n result.warnings.push(...hookWarnings);\n }\n\n // --- read file ---\n let raw: string;\n try {\n raw = await fs.readFile(absPath, \"utf8\");\n } catch (readError: unknown) {\n if (isErrno(readError, \"ENOENT\")) {\n // Disappeared between readdir and readFile — treat as a ghost; skip quietly.\n result.scanned -= 1;\n continue;\n }\n result.warnings.push(`lock_unreadable:${file}`);\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: null,\n owner: null,\n created_at: null,\n ttl_seconds: null,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n });\n continue;\n }\n\n // --- parse ---\n const lock = parseLock(raw);\n if (lock === null) {\n result.warnings.push(`lock_unparseable:${file}`);\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: null,\n owner: null,\n created_at: null,\n ttl_seconds: null,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n });\n continue;\n }\n\n // --- validate timestamp ---\n const createdAtMs = Date.parse(lock.created_at);\n if (!Number.isFinite(createdAtMs)) {\n result.warnings.push(`lock_invalid_timestamp:${file}`);\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds: null,\n stale: false,\n reason: \"unparseable\",\n });\n continue;\n }\n\n const ageMs = nowMs - createdAtMs;\n const age_seconds = Math.floor(ageMs / 1000);\n const stale = ageMs > lock.ttl_seconds * 1000;\n\n if (!stale) {\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds,\n stale: false,\n reason: \"active\",\n });\n continue;\n }\n\n // --- stale: remove or preview ---\n if (!dryRun) {\n try {\n await fs.unlink(absPath);\n } catch (unlinkError: unknown) {\n if (!isErrno(unlinkError, \"ENOENT\")) {\n result.warnings.push(`lock_remove_failed:${file}`);\n result.retained.push(relPath);\n result.entries.push({\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds,\n stale: true,\n reason: \"expired\",\n });\n continue;\n }\n // ENOENT on unlink = already gone (race); treat as removed\n }\n // onWrite hook after successful removal\n if (hooks?.onWrite) {\n const hookWarnings = await hooks.onWrite(absPath);\n result.warnings.push(...hookWarnings);\n }\n }\n\n result.removed.push(relPath);\n result.entries.push({\n file,\n id: lock.id,\n owner: lock.owner,\n created_at: lock.created_at,\n ttl_seconds: lock.ttl_seconds,\n age_seconds,\n stale: true,\n reason: \"expired\",\n });\n }\n\n return result;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA,OAAOA,SAAQ;AACf,OAAOC,WAAU;;;ACUjB,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;AAgDjB,SAAS,UAAU,KAAW;AAC5B,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,GAAG;EACzB,QAAQ;AACN,WAAO;EACT;AACA,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM,GAAG;AAC1E,WAAO;EACT;AACA,QAAM,YAAY;AAClB,QAAM,EAAE,IAAI,OAAO,YAAY,YAAW,IAAK;AAC/C,MACE,OAAO,OAAO,YACd,OAAO,UAAU,YACjB,OAAO,eAAe,YACtB,OAAO,gBAAgB,YACvB,CAAC,OAAO,SAAS,WAAW,GAC5B;AACA,WAAO;EACT;AACA,SAAO,EAAE,IAAI,OAAO,YAAY,YAAW;AAC7C;AAEA,SAAS,QAAQ,OAAgB,MAAY;AAC3C,SACE,OAAO,UAAU,YACjB,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AAQ;MAC5B,UAAU,WAAW,SAAS;;EAElC;AAEA,WAAS,KACP,GAAI,MAAM,sBAAsB;IAC9B,MAAM,SAAS,eAAe;IAC9B,aAAa,gBAAgB;GAC9B,CAAE;AAEL,QAAM,WAAW,gBAAgB;IAC/B;IACA;IACA;GACD;AAED,SAAO;IACL,IAAI,SAAS,WAAW;IACxB,SAAS;IACT,OAAO;IACP;IACA;IACA;IACA,GAAI,eAAe,EAAE,OAAO,aAAY,IAAK,CAAA;IAC7C;IACA,cAAc,OAAM;;AAExB;",
6
+ "names": ["fs", "path", "isErrno", "path", "fs", "global"]
7
+ }
@@ -1,22 +1,24 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ee4af23f-e74f-5512-a4da-786f9a459b45")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8d05da97-b537-5f04-9c8b-7b8ebdb34993")}catch(e){}}();
3
3
  import {
4
4
  readHistoryEntries
5
- } from "./chunk-V3JQ4IPL.js";
6
- import "./chunk-ASQM3IF5.js";
7
- import "./chunk-GFWHHMVV.js";
5
+ } from "./chunk-6RZXO5M2.js";
6
+ import "./chunk-3A2CMEM7.js";
7
+ import {
8
+ parseIntegerLimit
9
+ } from "./chunk-FY6Z3FYY.js";
8
10
  import {
9
11
  buildItemNotFoundError,
10
12
  locateItem,
11
13
  readLocatedItem,
12
14
  toItemRecord
13
- } from "./chunk-CWT53EYT.js";
14
- import "./chunk-SSFMJCPF.js";
15
- import "./chunk-KBG47ZOY.js";
15
+ } from "./chunk-YBZW2QQ7.js";
16
+ import "./chunk-UT6WFXW2.js";
17
+ import "./chunk-UYQ7HXH4.js";
16
18
  import {
17
19
  resolveItemTypeRegistry
18
- } from "./chunk-SZQCER6S.js";
19
- import "./chunk-NQP3ECKF.js";
20
+ } from "./chunk-GUZBNB3G.js";
21
+ import "./chunk-B2KZGPM2.js";
20
22
  import {
21
23
  EXIT_CODE,
22
24
  FRONT_MATTER_KEY_ORDER,
@@ -28,7 +30,7 @@ import {
28
30
  readSettings,
29
31
  resolvePmRoot,
30
32
  resolveRuntimeFieldRegistry
31
- } from "./chunk-4LTBNUYT.js";
33
+ } from "./chunk-X4IZKYHP.js";
32
34
 
33
35
  // dist/cli/commands/get.js
34
36
  var GET_DEPTH_VALUES = ["brief", "standard", "deep"];
@@ -129,7 +131,11 @@ async function runGet(id, global, options = {}) {
129
131
  if (options.full && (options.fields !== void 0 || options.depth !== void 0)) {
130
132
  throw new PmCliError("Get projection options are mutually exclusive; remove the extra projection flag and retry.", EXIT_CODE.USAGE);
131
133
  }
134
+ if (options.tree !== true && options.treeDepth !== void 0) {
135
+ throw new PmCliError("Get --tree-depth requires --tree", EXIT_CODE.USAGE);
136
+ }
132
137
  const depth = options.full ? "deep" : parseGetDepth(options.depth);
138
+ const treeDepth = options.tree === true ? parseIntegerLimit(options.treeDepth, "--tree-depth") : void 0;
133
139
  const fields = parseGetFields(options.fields);
134
140
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
135
141
  if (!await pathExists(getSettingsPath(pmRoot))) {
@@ -184,11 +190,27 @@ async function runGet(id, global, options = {}) {
184
190
  if (claimState) {
185
191
  result.claim_state = claimState;
186
192
  }
193
+ if (options.tree === true) {
194
+ const { runList } = await import("./list-3KEVBOYW.js");
195
+ const subtree = await runList(void 0, {
196
+ parent: located.id,
197
+ tree: true,
198
+ treeDepth: treeDepth === void 0 ? void 0 : String(treeDepth),
199
+ full: true
200
+ }, global);
201
+ result.tree = {
202
+ root_id: located.id,
203
+ root_title: loaded.document.metadata.title,
204
+ depth_limit: treeDepth ?? null,
205
+ count: subtree.count,
206
+ items: subtree.items.map((entry) => toItemRecord(entry))
207
+ };
208
+ }
187
209
  return result;
188
210
  }
189
211
  export {
190
212
  runGet
191
213
  };
192
- //# sourceMappingURL=get-WXMLRG7M.js.map
214
+ //# sourceMappingURL=get-SZKNRHMA.js.map
193
215
 
194
- //# debugId=ee4af23f-e74f-5512-a4da-786f9a459b45
216
+ //# debugId=8d05da97-b537-5f04-9c8b-7b8ebdb34993
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/get.ts"],"sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeFieldRegistry } 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 { buildItemNotFoundError, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseIntegerLimit } from \"../shared-parsers.js\";\nimport type { ItemFrontMatter, LinkedDoc, LinkedFile, LinkedTest } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\nexport interface GetResult {\n item: Partial<ItemFrontMatter>;\n body?: string;\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n claim_state?: ClaimStateContext;\n tree?: {\n root_id: string;\n root_title: string | null;\n depth_limit: number | null;\n count: number;\n items: Record<string, unknown>[];\n };\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\nexport interface GetOptions {\n depth?: string;\n fields?: string;\n full?: boolean;\n tree?: boolean;\n treeDepth?: string;\n}\n\nfunction toClaimHistoryContext(\n entry: ClaimHistoryEntry,\n): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history].reverse().find((entry) => entry.op === \"claim\");\n const lastRelease = [...history].reverse().find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\"Get --depth must be one of brief|standard|deep|full\", EXIT_CODE.USAGE);\n}\n\nfunction projectItemForDepth(item: ItemFrontMatter, depth: GetDepth): Partial<ItemFrontMatter> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\"Get --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(fields: string[] | null, runtimeMetadataKeys: Iterable<string>): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);\n const allowedRootFields = new Set([\"body\", \"linked\", \"claim_state\"]);\n const allowedLinkedFields = new Set([\"linked.files\", \"linked.tests\", \"linked.docs\"]);\n const allowedClaimStateFields = new Set([\"claim_state.claimed\", \"claim_state.assignee\", \"claim_state.last_claim\", \"claim_state.last_release\"]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown get --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n });\n }\n}\n\nfunction projectItemForFields(item: ItemFrontMatter, fields: string[]): Partial<ItemFrontMatter> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n if (normalized === \"body\" || normalized === \"linked\" || normalized.startsWith(\"linked.\")) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemFrontMatter>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return fields?.some((field) => field === name || field === `item.${name}`) ?? false;\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\nexport async function runGet(id: string, global: GlobalOptions, options: GetOptions = {}): Promise<GetResult> {\n if (options.full && (options.fields !== undefined || options.depth !== undefined)) {\n throw new PmCliError(\"Get projection options are mutually exclusive; remove the extra projection flag and retry.\", EXIT_CODE.USAGE);\n }\n if (options.tree !== true && options.treeDepth !== undefined) {\n throw new PmCliError(\"Get --tree-depth requires --tree\", EXIT_CODE.USAGE);\n }\n const depth = options.full ? \"deep\" : parseGetDepth(options.depth);\n const treeDepth = options.tree === true ? parseIntegerLimit(options.treeDepth, \"--tree-depth\") : undefined;\n const fields = parseGetFields(options.fields);\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 typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const runtimeMetadataKeys: string[] = [];\n for (const field of resolveRuntimeFieldRegistry(settings.schema).definitions) {\n runtimeMetadataKeys.push(field.metadata_key);\n }\n validateGetFields(fields, runtimeMetadataKeys);\n const files = loaded.document.metadata.files ?? [];\n const tests = loaded.document.metadata.tests ?? [];\n const docs = loaded.document.metadata.docs ?? [];\n const fieldProjection = fields !== null;\n const includeBody = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"body\");\n const includeLinked = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"linked\");\n const includeLinkedFiles = includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests = includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs = includeLinked || fieldsInclude(fields, \"linked.docs\");\n const includeClaimState = !fieldProjection ? depth !== \"brief\" : fieldsIncludeRoot(fields, \"claim_state\");\n let claimState: ClaimStateContext | undefined;\n if (includeClaimState) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n let history: ClaimHistoryEntry[] = [];\n try {\n history = await readHistoryEntries(historyPath, located.id);\n } catch {\n history = [];\n }\n claimState = resolveClaimStateContext(loaded.document.metadata.assignee, history);\n }\n const result: GetResult = {\n item: fieldProjection\n ? projectItemForFields(loaded.document.metadata, fields)\n : projectItemForDepth(loaded.document.metadata, depth),\n };\n if (includeBody) {\n result.body = loaded.document.body;\n }\n if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {\n result.linked = {\n files: includeLinkedFiles ? files : [],\n tests: includeLinkedTests ? tests : [],\n docs: includeLinkedDocs ? docs : [],\n };\n }\n if (claimState) {\n result.claim_state = claimState;\n }\n if (options.tree === true) {\n const { runList } = await import(\"./list.js\");\n const subtree = await runList(\n undefined,\n {\n parent: located.id,\n tree: true,\n treeDepth: treeDepth === undefined ? undefined : String(treeDepth),\n full: true,\n },\n global,\n );\n result.tree = {\n root_id: located.id,\n root_title: loaded.document.metadata.title,\n depth_limit: treeDepth ?? null,\n count: subtree.count,\n items: subtree.items.map((entry) => toItemRecord(entry)),\n };\n }\n return result;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,IAAM,mBAAmB,CAAC,SAAS,YAAY,MAAM;AAYrD,SAAS,sBACP,OAAwB;AAExB,SAAO;IACL,IAAI,MAAM;IACV,QAAQ,MAAM;IACd,SAAS,MAAM,WAAW;;AAE9B;AAEA,SAAS,yBACP,eACA,SAA4B;AAE5B,QAAM,WAAW,eAAe,KAAI;AACpC,QAAM,qBAAqB,YAAY,SAAS,SAAS,IAAI,WAAW;AACxE,QAAM,YAA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AM;AAER,WAAO,OAAO;MACZ,SAAS,QAAQ;MACjB,YAAY,OAAO,SAAS,SAAS;MACrC,aAAa,aAAa;MAC1B,OAAO,QAAQ;MACf,OAAO,QAAQ,MAAM,IAAI,CAAC,UAAU,aAAa,KAAK,CAAC;;EAE3D;AACA,SAAO;AACT","debugId":"8d05da97-b537-5f04-9c8b-7b8ebdb34993"}
@@ -1,20 +1,22 @@
1
1
  import {
2
2
  readHistoryEntries
3
- } from "./chunk-WIKR7KFL.js";
4
- import "./chunk-S3CV7JGJ.js";
5
- import "./chunk-K47WAYQV.js";
3
+ } from "./chunk-4CHEG6UK.js";
4
+ import "./chunk-3EOBJOF4.js";
5
+ import {
6
+ parseIntegerLimit
7
+ } from "./chunk-SFFVGNHC.js";
6
8
  import {
7
9
  buildItemNotFoundError,
8
10
  locateItem,
9
11
  readLocatedItem,
10
12
  toItemRecord
11
- } from "./chunk-XG7RJYHV.js";
12
- import "./chunk-KA24HME7.js";
13
- import "./chunk-HPH6X4ZZ.js";
13
+ } from "./chunk-TP4DDY27.js";
14
+ import "./chunk-2IXCHCLM.js";
15
+ import "./chunk-WCQZBDDH.js";
14
16
  import {
15
17
  resolveItemTypeRegistry
16
- } from "./chunk-4PJQSECJ.js";
17
- import "./chunk-RANZIID5.js";
18
+ } from "./chunk-HRMHZ4RV.js";
19
+ import "./chunk-FHHBD7PN.js";
18
20
  import {
19
21
  EXIT_CODE,
20
22
  FRONT_MATTER_KEY_ORDER,
@@ -26,13 +28,13 @@ import {
26
28
  readSettings,
27
29
  resolvePmRoot,
28
30
  resolveRuntimeFieldRegistry
29
- } from "./chunk-SRVKTWPR.js";
31
+ } from "./chunk-UJUT6AHZ.js";
30
32
 
31
33
  // dist/cli/commands/get.js
32
34
  !(function() {
33
35
  try {
34
36
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
35
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "808844af-e84f-5fd7-97c3-e4c81ff86193");
37
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a8eb7675-53ef-5cf4-a41e-4eb9f5b44a5c");
36
38
  } catch (e2) {
37
39
  }
38
40
  })();
@@ -134,7 +136,11 @@ async function runGet(id, global2, options = {}) {
134
136
  if (options.full && (options.fields !== void 0 || options.depth !== void 0)) {
135
137
  throw new PmCliError("Get projection options are mutually exclusive; remove the extra projection flag and retry.", EXIT_CODE.USAGE);
136
138
  }
139
+ if (options.tree !== true && options.treeDepth !== void 0) {
140
+ throw new PmCliError("Get --tree-depth requires --tree", EXIT_CODE.USAGE);
141
+ }
137
142
  const depth = options.full ? "deep" : parseGetDepth(options.depth);
143
+ const treeDepth = options.tree === true ? parseIntegerLimit(options.treeDepth, "--tree-depth") : void 0;
138
144
  const fields = parseGetFields(options.fields);
139
145
  const pmRoot = resolvePmRoot(process.cwd(), global2.path);
140
146
  if (!await pathExists(getSettingsPath(pmRoot))) {
@@ -189,9 +195,25 @@ async function runGet(id, global2, options = {}) {
189
195
  if (claimState) {
190
196
  result.claim_state = claimState;
191
197
  }
198
+ if (options.tree === true) {
199
+ const { runList } = await import("./list-E44O2K64.js");
200
+ const subtree = await runList(void 0, {
201
+ parent: located.id,
202
+ tree: true,
203
+ treeDepth: treeDepth === void 0 ? void 0 : String(treeDepth),
204
+ full: true
205
+ }, global2);
206
+ result.tree = {
207
+ root_id: located.id,
208
+ root_title: loaded.document.metadata.title,
209
+ depth_limit: treeDepth ?? null,
210
+ count: subtree.count,
211
+ items: subtree.items.map((entry) => toItemRecord(entry))
212
+ };
213
+ }
192
214
  return result;
193
215
  }
194
216
  export {
195
217
  runGet
196
218
  };
197
- //# sourceMappingURL=get-CINFEUIY.js.map
219
+ //# sourceMappingURL=get-VITKYP6S.js.map