@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,16 @@
1
+ import {
2
+ runActivity
3
+ } from "./chunk-TNPBPNII.js";
4
+ import "./chunk-4CHEG6UK.js";
5
+ import "./chunk-3EOBJOF4.js";
6
+ import "./chunk-SFFVGNHC.js";
7
+ import "./chunk-TP4DDY27.js";
8
+ import "./chunk-2IXCHCLM.js";
9
+ import "./chunk-WCQZBDDH.js";
10
+ import "./chunk-HRMHZ4RV.js";
11
+ import "./chunk-FHHBD7PN.js";
12
+ import "./chunk-UJUT6AHZ.js";
13
+ export {
14
+ runActivity
15
+ };
16
+ //# sourceMappingURL=activity-5UROHJ3D.js.map
@@ -2,19 +2,19 @@
2
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]="45eac7fa-f181-5cca-93b7-cfb58909dbb3")}catch(e){}}();
3
3
  import {
4
4
  runActivity
5
- } from "./chunk-VGO2T3TY.js";
6
- import "./chunk-V3JQ4IPL.js";
7
- import "./chunk-ASQM3IF5.js";
8
- import "./chunk-GFWHHMVV.js";
9
- import "./chunk-CWT53EYT.js";
10
- import "./chunk-SSFMJCPF.js";
11
- import "./chunk-KBG47ZOY.js";
12
- import "./chunk-SZQCER6S.js";
13
- import "./chunk-NQP3ECKF.js";
14
- import "./chunk-4LTBNUYT.js";
5
+ } from "./chunk-YO3THIJF.js";
6
+ import "./chunk-6RZXO5M2.js";
7
+ import "./chunk-3A2CMEM7.js";
8
+ import "./chunk-FY6Z3FYY.js";
9
+ import "./chunk-YBZW2QQ7.js";
10
+ import "./chunk-UT6WFXW2.js";
11
+ import "./chunk-UYQ7HXH4.js";
12
+ import "./chunk-GUZBNB3G.js";
13
+ import "./chunk-B2KZGPM2.js";
14
+ import "./chunk-X4IZKYHP.js";
15
15
  export {
16
16
  runActivity
17
17
  };
18
- //# sourceMappingURL=activity-3RWRRNOW.js.map
18
+ //# sourceMappingURL=activity-YVB3QRTE.js.map
19
19
 
20
20
  //# debugId=45eac7fa-f181-5cca-93b7-cfb58909dbb3
@@ -3,32 +3,32 @@ import {
3
3
  } from "./chunk-3HUE7XOF.js";
4
4
  import {
5
5
  runList
6
- } from "./chunk-N5YF3VFN.js";
7
- import "./chunk-RQAWLSUU.js";
8
- import "./chunk-K47WAYQV.js";
6
+ } from "./chunk-42LOFGJS.js";
7
+ import "./chunk-B5RF3IP7.js";
8
+ import "./chunk-SFFVGNHC.js";
9
9
  import "./chunk-EAOG77HM.js";
10
- import "./chunk-XG7RJYHV.js";
11
- import "./chunk-KA24HME7.js";
10
+ import "./chunk-TP4DDY27.js";
11
+ import "./chunk-2IXCHCLM.js";
12
12
  import {
13
13
  normalizeStatusInput
14
- } from "./chunk-HPH6X4ZZ.js";
15
- import "./chunk-4PJQSECJ.js";
14
+ } from "./chunk-WCQZBDDH.js";
15
+ import "./chunk-HRMHZ4RV.js";
16
16
  import {
17
17
  nowIso
18
- } from "./chunk-RANZIID5.js";
18
+ } from "./chunk-FHHBD7PN.js";
19
19
  import {
20
20
  EXIT_CODE,
21
21
  PmCliError,
22
22
  readSettings,
23
23
  resolvePmRoot,
24
24
  resolveRuntimeStatusRegistry
25
- } from "./chunk-SRVKTWPR.js";
25
+ } from "./chunk-UJUT6AHZ.js";
26
26
 
27
27
  // dist/cli/commands/aggregate.js
28
28
  !(function() {
29
29
  try {
30
30
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
31
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0c8f06f7-0f97-5ae3-ab61-12c1a053d751");
31
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5718f2e5-0007-5359-81bd-71998b031aa5");
32
32
  } catch (e2) {
33
33
  }
34
34
  })();
@@ -52,6 +52,23 @@ function parseStatus(raw, statusRegistry) {
52
52
  }
53
53
  return normalized;
54
54
  }
55
+ function parseNumericAggregation(options) {
56
+ const sumField = options.sum?.trim();
57
+ const avgField = options.avg?.trim();
58
+ const normalizedSum = sumField && sumField.length > 0 ? sumField : void 0;
59
+ const normalizedAvg = avgField && avgField.length > 0 ? avgField : void 0;
60
+ if (!normalizedSum && !normalizedAvg) {
61
+ return null;
62
+ }
63
+ if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {
64
+ throw new PmCliError("Aggregate --sum and --avg must target the same numeric field", EXIT_CODE.USAGE);
65
+ }
66
+ return {
67
+ field: normalizedSum ?? normalizedAvg ?? "",
68
+ sum: normalizedSum !== void 0,
69
+ avg: normalizedAvg !== void 0
70
+ };
71
+ }
55
72
  function parseGroupBy(raw) {
56
73
  const value = raw?.trim() ?? "status";
57
74
  if (value.length === 0) {
@@ -126,15 +143,34 @@ function compareAggregateRows(left, right, groupBy) {
126
143
  }
127
144
  return 0;
128
145
  }
146
+ function readNumericAggregateValue(item, field) {
147
+ const source = item;
148
+ const raw = source[field];
149
+ if (typeof raw === "number" && Number.isFinite(raw)) {
150
+ return raw;
151
+ }
152
+ if (typeof raw === "string") {
153
+ const trimmed = raw.trim();
154
+ if (trimmed.length === 0) {
155
+ return null;
156
+ }
157
+ const parsed = Number(trimmed);
158
+ if (Number.isFinite(parsed)) {
159
+ return parsed;
160
+ }
161
+ }
162
+ return null;
163
+ }
129
164
  async function runAggregate(options, global2) {
130
165
  if (options.count === false) {
131
- throw new PmCliError("Aggregate currently supports grouped counts only. Pass --count.", EXIT_CODE.USAGE);
166
+ throw new PmCliError("Aggregate grouped counts are always enabled; omit count=false.", EXIT_CODE.USAGE);
132
167
  }
133
168
  const pmRoot = resolvePmRoot(process.cwd(), global2.path);
134
169
  const settings = await readSettings(pmRoot);
135
170
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
136
171
  const groupBy = parseGroupBy(options.groupBy);
137
172
  const status = parseStatus(options.status, statusRegistry);
173
+ const numericAggregation = parseNumericAggregation(options);
138
174
  const includeUnparented = options.includeUnparented === true;
139
175
  const listed = await runList(status, {
140
176
  type: options.type,
@@ -163,17 +199,46 @@ async function runAggregate(options, global2) {
163
199
  }
164
200
  const key = buildGroupKey(groupBy, group);
165
201
  const existing = grouped.get(key);
202
+ const numericValue = numericAggregation === null ? null : readNumericAggregateValue(item, numericAggregation.field);
166
203
  if (existing) {
167
- existing.count += 1;
204
+ existing.row.count += 1;
205
+ if (numericAggregation !== null) {
206
+ if (numericValue === null) {
207
+ existing.null_count += 1;
208
+ } else {
209
+ existing.numeric_count += 1;
210
+ existing.numeric_sum += numericValue;
211
+ }
212
+ }
168
213
  } else {
169
214
  grouped.set(key, {
170
- group,
171
- count: 1
215
+ row: {
216
+ group,
217
+ count: 1
218
+ },
219
+ numeric_count: numericValue === null ? 0 : 1,
220
+ numeric_sum: numericValue ?? 0,
221
+ null_count: numericValue === null ? 1 : 0
172
222
  });
173
223
  }
174
224
  groupedItemCount += 1;
175
225
  }
176
- const groups = [...grouped.values()].sort((left, right) => compareAggregateRows(left, right, groupBy));
226
+ const groups = [...grouped.values()].map((entry) => {
227
+ if (numericAggregation === null) {
228
+ return entry.row;
229
+ }
230
+ const withNumeric = {
231
+ ...entry.row,
232
+ null_count: entry.null_count
233
+ };
234
+ if (numericAggregation.sum) {
235
+ withNumeric.sum = entry.numeric_sum;
236
+ }
237
+ if (numericAggregation.avg) {
238
+ withNumeric.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;
239
+ }
240
+ return withNumeric;
241
+ }).sort((left, right) => compareAggregateRows(left, right, groupBy));
177
242
  const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : void 0;
178
243
  return {
179
244
  groups,
@@ -197,7 +262,12 @@ async function runAggregate(options, global2) {
197
262
  assignee_filter: options.assigneeFilter ?? null,
198
263
  parent: options.parent ?? null,
199
264
  sprint: options.sprint ?? null,
200
- release: options.release ?? null
265
+ release: options.release ?? null,
266
+ ...numericAggregation !== null ? {
267
+ sum: options.sum ?? null,
268
+ avg: options.avg ?? null,
269
+ numeric_field: numericAggregation.field
270
+ } : {}
201
271
  },
202
272
  now: nowIso(),
203
273
  ...warnings ? { warnings } : {}
@@ -206,4 +276,4 @@ async function runAggregate(options, global2) {
206
276
  export {
207
277
  runAggregate
208
278
  };
209
- //# sourceMappingURL=aggregate-OOAGKWRG.js.map
279
+ //# sourceMappingURL=aggregate-LH66F75F.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/aggregate.ts"],
4
+ "sourcesContent": ["import { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { type ItemStatus } from \"../../types/index.js\";\nimport { runList } from \"./list.js\";\n\ntype AggregateGroupField = \"parent\" | \"type\" | \"priority\" | \"status\" | \"assignee\" | \"tags\" | \"sprint\" | \"release\";\ntype AggregateGroupValue = string | number | null;\ntype AggregateGroupRecord = Partial<Record<AggregateGroupField, AggregateGroupValue>>;\ntype AggregateListedItem = {\n type: string;\n status: ItemStatus;\n priority: number;\n parent?: string;\n assignee?: string;\n tags: string[];\n sprint?: string;\n release?: string;\n};\n\nconst AGGREGATE_GROUP_FIELDS: AggregateGroupField[] = [\n \"parent\",\n \"type\",\n \"priority\",\n \"status\",\n \"assignee\",\n \"tags\",\n \"sprint\",\n \"release\",\n];\n\nexport interface AggregateOptions {\n groupBy?: string;\n count?: boolean;\n sum?: string;\n avg?: string;\n includeUnparented?: boolean;\n status?: string;\n type?: string;\n tag?: string;\n priority?: string;\n deadlineBefore?: string;\n deadlineAfter?: string;\n assignee?: string;\n assigneeFilter?: string;\n parent?: string;\n sprint?: string;\n release?: string;\n}\n\nexport interface AggregateRow {\n group: AggregateGroupRecord;\n count: number;\n null_count?: number;\n sum?: number | null;\n avg?: number | null;\n}\n\nexport interface AggregateResult {\n groups: AggregateRow[];\n count: number;\n totals: {\n items_considered: number;\n items_grouped: number;\n items_skipped_unparented: number;\n };\n filters: {\n group_by: AggregateGroupField[];\n count: boolean;\n sum?: string | null;\n avg?: string | null;\n numeric_field?: string | null;\n include_unparented: boolean;\n status: ItemStatus | null;\n type: string | null;\n tag: string | null;\n priority: string | null;\n deadline_before: string | null;\n deadline_after: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n parent: string | null;\n sprint: string | null;\n release: string | null;\n };\n now: string;\n warnings?: string[];\n}\n\nfunction parseStatus(raw: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(raw, statusRegistry);\n if (!normalized) {\n throw new PmCliError(\n `Status filter must be one of ${statusRegistry.definitions.map((definition) => definition.id).join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\ninterface NumericAggregation {\n field: string;\n sum: boolean;\n avg: boolean;\n}\n\nfunction parseNumericAggregation(options: AggregateOptions): NumericAggregation | null {\n const sumField = options.sum?.trim();\n const avgField = options.avg?.trim();\n const normalizedSum = sumField && sumField.length > 0 ? sumField : undefined;\n const normalizedAvg = avgField && avgField.length > 0 ? avgField : undefined;\n if (!normalizedSum && !normalizedAvg) {\n return null;\n }\n if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {\n throw new PmCliError(\"Aggregate --sum and --avg must target the same numeric field\", EXIT_CODE.USAGE);\n }\n return {\n field: normalizedSum ?? normalizedAvg ?? \"\",\n sum: normalizedSum !== undefined,\n avg: normalizedAvg !== undefined,\n };\n}\n\nfunction parseGroupBy(raw: string | undefined): AggregateGroupField[] {\n const value = raw?.trim() ?? \"status\";\n if (value.length === 0) {\n throw new PmCliError(\"--group-by requires at least one field name\", EXIT_CODE.USAGE);\n }\n const requested = splitCommaList(value);\n if (requested.length === 0) {\n throw new PmCliError(\"--group-by requires a comma-separated list of fields\", EXIT_CODE.USAGE);\n }\n for (const field of requested) {\n if (!AGGREGATE_GROUP_FIELDS.includes(field as AggregateGroupField)) {\n throw new PmCliError(\n `Aggregate group fields must be one of ${AGGREGATE_GROUP_FIELDS.join(\"|\")}; received \"${field}\"`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return requested as AggregateGroupField[];\n}\n\nfunction normalizeTagGroupValue(tags: string[]): string | null {\n const normalized = [...new Set(tags.map((tag) => tag.trim().toLowerCase()).filter((tag) => tag.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n if (normalized.length === 0) {\n return null;\n }\n return normalized.join(\",\");\n}\n\nfunction resolveGroupValue(field: AggregateGroupField, item: AggregateListedItem): AggregateGroupValue {\n switch (field) {\n case \"parent\":\n return item.parent ?? null;\n case \"type\":\n return item.type;\n case \"priority\":\n return item.priority;\n case \"status\":\n return item.status;\n case \"assignee\":\n return item.assignee ?? null;\n case \"tags\":\n return normalizeTagGroupValue(item.tags);\n case \"sprint\":\n return item.sprint ?? null;\n case \"release\":\n return item.release ?? null;\n default:\n return null;\n }\n}\n\nfunction compareNullableGroupValue(left: AggregateGroupValue | undefined, right: AggregateGroupValue | undefined): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === rightValue) {\n return 0;\n }\n if (leftValue === null) {\n return 1;\n }\n if (rightValue === null) {\n return -1;\n }\n if (typeof leftValue === \"number\" && typeof rightValue === \"number\") {\n return leftValue - rightValue;\n }\n return String(leftValue).localeCompare(String(rightValue));\n}\n\nfunction buildGroupKey(groupBy: AggregateGroupField[], group: AggregateGroupRecord): string {\n return groupBy.map((field) => `${field}:${JSON.stringify(group[field] ?? null)}`).join(\"|\");\n}\n\nfunction compareAggregateRows(\n left: AggregateRow,\n right: AggregateRow,\n groupBy: AggregateGroupField[],\n): number {\n for (const field of groupBy) {\n const byField = compareNullableGroupValue(left.group[field], right.group[field]);\n if (byField !== 0) {\n return byField;\n }\n }\n return 0;\n}\n\nfunction readNumericAggregateValue(item: AggregateListedItem, field: string): number | null {\n const source = item as unknown as Record<string, unknown>;\n const raw = source[field];\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n if (typeof raw === \"string\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n return null;\n }\n const parsed = Number(trimmed);\n if (Number.isFinite(parsed)) {\n return parsed;\n }\n }\n return null;\n}\n\ninterface AggregateAccumulator {\n row: AggregateRow;\n numeric_count: number;\n numeric_sum: number;\n null_count: number;\n}\n\nexport async function runAggregate(options: AggregateOptions, global: GlobalOptions): Promise<AggregateResult> {\n if (options.count === false) {\n throw new PmCliError(\"Aggregate grouped counts are always enabled; omit count=false.\", EXIT_CODE.USAGE);\n }\n\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const groupBy = parseGroupBy(options.groupBy);\n const status = parseStatus(options.status, statusRegistry);\n const numericAggregation = parseNumericAggregation(options);\n const includeUnparented = options.includeUnparented === true;\n\n const listed = await runList(\n status,\n {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n deadlineBefore: options.deadlineBefore,\n deadlineAfter: options.deadlineAfter,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n parent: options.parent,\n sprint: options.sprint,\n release: options.release,\n },\n global,\n );\n\n const grouped = new Map<string, AggregateAccumulator>();\n let skippedUnparented = 0;\n let groupedItemCount = 0;\n\n for (const listedItem of listed.items) {\n const item = listedItem as AggregateListedItem;\n const group: AggregateGroupRecord = {};\n for (const field of groupBy) {\n group[field] = resolveGroupValue(field, item);\n }\n if (groupBy.includes(\"parent\") && group.parent === null && !includeUnparented) {\n skippedUnparented += 1;\n continue;\n }\n const key = buildGroupKey(groupBy, group);\n const existing = grouped.get(key);\n const numericValue =\n numericAggregation === null\n ? null\n : readNumericAggregateValue(item, numericAggregation.field);\n if (existing) {\n existing.row.count += 1;\n if (numericAggregation !== null) {\n if (numericValue === null) {\n existing.null_count += 1;\n } else {\n existing.numeric_count += 1;\n existing.numeric_sum += numericValue;\n }\n }\n } else {\n grouped.set(key, {\n row: {\n group,\n count: 1,\n },\n numeric_count: numericValue === null ? 0 : 1,\n numeric_sum: numericValue ?? 0,\n null_count: numericValue === null ? 1 : 0,\n });\n }\n groupedItemCount += 1;\n }\n\n const groups = [...grouped.values()]\n .map((entry) => {\n if (numericAggregation === null) {\n return entry.row;\n }\n const withNumeric: AggregateRow = {\n ...entry.row,\n null_count: entry.null_count,\n };\n if (numericAggregation.sum) {\n withNumeric.sum = entry.numeric_sum;\n }\n if (numericAggregation.avg) {\n withNumeric.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;\n }\n return withNumeric;\n })\n .sort((left, right) => compareAggregateRows(left, right, groupBy));\n const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : undefined;\n\n return {\n groups,\n count: groups.length,\n totals: {\n items_considered: listed.items.length,\n items_grouped: groupedItemCount,\n items_skipped_unparented: skippedUnparented,\n },\n filters: {\n group_by: groupBy,\n count: true,\n include_unparented: includeUnparented,\n status: status ?? null,\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 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 ...(numericAggregation !== null\n ? {\n sum: options.sum ?? null,\n avg: options.avg ?? null,\n numeric_field: numericAggregation.field,\n }\n : {}),\n },\n now: nowIso(),\n ...(warnings ? { warnings } : {}),\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,yBAAgD;EACpD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA6DF,SAAS,YAAY,KAAyB,gBAAqC;AACjF,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,qBAAqB,KAAK,cAAc;AAC3D,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,WACR,gCAAgC,eAAe,YAAY,IAAI,CAAC,eAAe,WAAW,EAAE,EAAE,KAAK,GAAG,CAAC,IACvG,UAAU,KAAK;EAEnB;AACA,SAAO;AACT;AAQA,SAAS,wBAAwB,SAAyB;AACxD,QAAM,WAAW,QAAQ,KAAK,KAAI;AAClC,QAAM,WAAW,QAAQ,KAAK,KAAI;AAClC,QAAM,gBAAgB,YAAY,SAAS,SAAS,IAAI,WAAW;AACnE,QAAM,gBAAgB,YAAY,SAAS,SAAS,IAAI,WAAW;AACnE,MAAI,CAAC,iBAAiB,CAAC,eAAe;AACpC,WAAO;EACT;AACA,MAAI,iBAAiB,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names": ["global"]
7
+ }
@@ -1,30 +1,30 @@
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]="ee0c571c-dc7a-52dd-9d46-9c17bebcc3cb")}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]="c24fe9b2-4bb2-532c-a721-de78c2fb7ee5")}catch(e){}}();
3
3
  import {
4
4
  splitCommaList
5
5
  } from "./chunk-LXYVKYMQ.js";
6
6
  import {
7
7
  runList
8
- } from "./chunk-G5BACLYH.js";
9
- import "./chunk-JQI2HE55.js";
10
- import "./chunk-GFWHHMVV.js";
8
+ } from "./chunk-TINUJMWN.js";
9
+ import "./chunk-6J4K6JLA.js";
10
+ import "./chunk-FY6Z3FYY.js";
11
11
  import "./chunk-XSLQSXAH.js";
12
- import "./chunk-CWT53EYT.js";
13
- import "./chunk-SSFMJCPF.js";
12
+ import "./chunk-YBZW2QQ7.js";
13
+ import "./chunk-UT6WFXW2.js";
14
14
  import {
15
15
  normalizeStatusInput
16
- } from "./chunk-KBG47ZOY.js";
17
- import "./chunk-SZQCER6S.js";
16
+ } from "./chunk-UYQ7HXH4.js";
17
+ import "./chunk-GUZBNB3G.js";
18
18
  import {
19
19
  nowIso
20
- } from "./chunk-NQP3ECKF.js";
20
+ } from "./chunk-B2KZGPM2.js";
21
21
  import {
22
22
  EXIT_CODE,
23
23
  PmCliError,
24
24
  readSettings,
25
25
  resolvePmRoot,
26
26
  resolveRuntimeStatusRegistry
27
- } from "./chunk-4LTBNUYT.js";
27
+ } from "./chunk-X4IZKYHP.js";
28
28
 
29
29
  // dist/cli/commands/aggregate.js
30
30
  var AGGREGATE_GROUP_FIELDS = [
@@ -47,6 +47,23 @@ function parseStatus(raw, statusRegistry) {
47
47
  }
48
48
  return normalized;
49
49
  }
50
+ function parseNumericAggregation(options) {
51
+ const sumField = options.sum?.trim();
52
+ const avgField = options.avg?.trim();
53
+ const normalizedSum = sumField && sumField.length > 0 ? sumField : void 0;
54
+ const normalizedAvg = avgField && avgField.length > 0 ? avgField : void 0;
55
+ if (!normalizedSum && !normalizedAvg) {
56
+ return null;
57
+ }
58
+ if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {
59
+ throw new PmCliError("Aggregate --sum and --avg must target the same numeric field", EXIT_CODE.USAGE);
60
+ }
61
+ return {
62
+ field: normalizedSum ?? normalizedAvg ?? "",
63
+ sum: normalizedSum !== void 0,
64
+ avg: normalizedAvg !== void 0
65
+ };
66
+ }
50
67
  function parseGroupBy(raw) {
51
68
  const value = raw?.trim() ?? "status";
52
69
  if (value.length === 0) {
@@ -121,15 +138,34 @@ function compareAggregateRows(left, right, groupBy) {
121
138
  }
122
139
  return 0;
123
140
  }
141
+ function readNumericAggregateValue(item, field) {
142
+ const source = item;
143
+ const raw = source[field];
144
+ if (typeof raw === "number" && Number.isFinite(raw)) {
145
+ return raw;
146
+ }
147
+ if (typeof raw === "string") {
148
+ const trimmed = raw.trim();
149
+ if (trimmed.length === 0) {
150
+ return null;
151
+ }
152
+ const parsed = Number(trimmed);
153
+ if (Number.isFinite(parsed)) {
154
+ return parsed;
155
+ }
156
+ }
157
+ return null;
158
+ }
124
159
  async function runAggregate(options, global) {
125
160
  if (options.count === false) {
126
- throw new PmCliError("Aggregate currently supports grouped counts only. Pass --count.", EXIT_CODE.USAGE);
161
+ throw new PmCliError("Aggregate grouped counts are always enabled; omit count=false.", EXIT_CODE.USAGE);
127
162
  }
128
163
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
129
164
  const settings = await readSettings(pmRoot);
130
165
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
131
166
  const groupBy = parseGroupBy(options.groupBy);
132
167
  const status = parseStatus(options.status, statusRegistry);
168
+ const numericAggregation = parseNumericAggregation(options);
133
169
  const includeUnparented = options.includeUnparented === true;
134
170
  const listed = await runList(status, {
135
171
  type: options.type,
@@ -158,17 +194,46 @@ async function runAggregate(options, global) {
158
194
  }
159
195
  const key = buildGroupKey(groupBy, group);
160
196
  const existing = grouped.get(key);
197
+ const numericValue = numericAggregation === null ? null : readNumericAggregateValue(item, numericAggregation.field);
161
198
  if (existing) {
162
- existing.count += 1;
199
+ existing.row.count += 1;
200
+ if (numericAggregation !== null) {
201
+ if (numericValue === null) {
202
+ existing.null_count += 1;
203
+ } else {
204
+ existing.numeric_count += 1;
205
+ existing.numeric_sum += numericValue;
206
+ }
207
+ }
163
208
  } else {
164
209
  grouped.set(key, {
165
- group,
166
- count: 1
210
+ row: {
211
+ group,
212
+ count: 1
213
+ },
214
+ numeric_count: numericValue === null ? 0 : 1,
215
+ numeric_sum: numericValue ?? 0,
216
+ null_count: numericValue === null ? 1 : 0
167
217
  });
168
218
  }
169
219
  groupedItemCount += 1;
170
220
  }
171
- const groups = [...grouped.values()].sort((left, right) => compareAggregateRows(left, right, groupBy));
221
+ const groups = [...grouped.values()].map((entry) => {
222
+ if (numericAggregation === null) {
223
+ return entry.row;
224
+ }
225
+ const withNumeric = {
226
+ ...entry.row,
227
+ null_count: entry.null_count
228
+ };
229
+ if (numericAggregation.sum) {
230
+ withNumeric.sum = entry.numeric_sum;
231
+ }
232
+ if (numericAggregation.avg) {
233
+ withNumeric.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;
234
+ }
235
+ return withNumeric;
236
+ }).sort((left, right) => compareAggregateRows(left, right, groupBy));
172
237
  const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : void 0;
173
238
  return {
174
239
  groups,
@@ -192,7 +257,12 @@ async function runAggregate(options, global) {
192
257
  assignee_filter: options.assigneeFilter ?? null,
193
258
  parent: options.parent ?? null,
194
259
  sprint: options.sprint ?? null,
195
- release: options.release ?? null
260
+ release: options.release ?? null,
261
+ ...numericAggregation !== null ? {
262
+ sum: options.sum ?? null,
263
+ avg: options.avg ?? null,
264
+ numeric_field: numericAggregation.field
265
+ } : {}
196
266
  },
197
267
  now: nowIso(),
198
268
  ...warnings ? { warnings } : {}
@@ -201,6 +271,6 @@ async function runAggregate(options, global) {
201
271
  export {
202
272
  runAggregate
203
273
  };
204
- //# sourceMappingURL=aggregate-J35K7WZB.js.map
274
+ //# sourceMappingURL=aggregate-OHSWFQJM.js.map
205
275
 
206
- //# debugId=ee0c571c-dc7a-52dd-9d46-9c17bebcc3cb
276
+ //# debugId=c24fe9b2-4bb2-532c-a721-de78c2fb7ee5
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/aggregate.ts"],"sourcesContent":["import { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { type ItemStatus } from \"../../types/index.js\";\nimport { runList } from \"./list.js\";\n\ntype AggregateGroupField = \"parent\" | \"type\" | \"priority\" | \"status\" | \"assignee\" | \"tags\" | \"sprint\" | \"release\";\ntype AggregateGroupValue = string | number | null;\ntype AggregateGroupRecord = Partial<Record<AggregateGroupField, AggregateGroupValue>>;\ntype AggregateListedItem = {\n type: string;\n status: ItemStatus;\n priority: number;\n parent?: string;\n assignee?: string;\n tags: string[];\n sprint?: string;\n release?: string;\n};\n\nconst AGGREGATE_GROUP_FIELDS: AggregateGroupField[] = [\n \"parent\",\n \"type\",\n \"priority\",\n \"status\",\n \"assignee\",\n \"tags\",\n \"sprint\",\n \"release\",\n];\n\nexport interface AggregateOptions {\n groupBy?: string;\n count?: boolean;\n sum?: string;\n avg?: string;\n includeUnparented?: boolean;\n status?: string;\n type?: string;\n tag?: string;\n priority?: string;\n deadlineBefore?: string;\n deadlineAfter?: string;\n assignee?: string;\n assigneeFilter?: string;\n parent?: string;\n sprint?: string;\n release?: string;\n}\n\nexport interface AggregateRow {\n group: AggregateGroupRecord;\n count: number;\n null_count?: number;\n sum?: number | null;\n avg?: number | null;\n}\n\nexport interface AggregateResult {\n groups: AggregateRow[];\n count: number;\n totals: {\n items_considered: number;\n items_grouped: number;\n items_skipped_unparented: number;\n };\n filters: {\n group_by: AggregateGroupField[];\n count: boolean;\n sum?: string | null;\n avg?: string | null;\n numeric_field?: string | null;\n include_unparented: boolean;\n status: ItemStatus | null;\n type: string | null;\n tag: string | null;\n priority: string | null;\n deadline_before: string | null;\n deadline_after: string | null;\n assignee: string | null;\n assignee_filter: string | null;\n parent: string | null;\n sprint: string | null;\n release: string | null;\n };\n now: string;\n warnings?: string[];\n}\n\nfunction parseStatus(raw: string | undefined, statusRegistry: RuntimeStatusRegistry): ItemStatus | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(raw, statusRegistry);\n if (!normalized) {\n throw new PmCliError(\n `Status filter must be one of ${statusRegistry.definitions.map((definition) => definition.id).join(\"|\")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\ninterface NumericAggregation {\n field: string;\n sum: boolean;\n avg: boolean;\n}\n\nfunction parseNumericAggregation(options: AggregateOptions): NumericAggregation | null {\n const sumField = options.sum?.trim();\n const avgField = options.avg?.trim();\n const normalizedSum = sumField && sumField.length > 0 ? sumField : undefined;\n const normalizedAvg = avgField && avgField.length > 0 ? avgField : undefined;\n if (!normalizedSum && !normalizedAvg) {\n return null;\n }\n if (normalizedSum && normalizedAvg && normalizedSum !== normalizedAvg) {\n throw new PmCliError(\"Aggregate --sum and --avg must target the same numeric field\", EXIT_CODE.USAGE);\n }\n return {\n field: normalizedSum ?? normalizedAvg ?? \"\",\n sum: normalizedSum !== undefined,\n avg: normalizedAvg !== undefined,\n };\n}\n\nfunction parseGroupBy(raw: string | undefined): AggregateGroupField[] {\n const value = raw?.trim() ?? \"status\";\n if (value.length === 0) {\n throw new PmCliError(\"--group-by requires at least one field name\", EXIT_CODE.USAGE);\n }\n const requested = splitCommaList(value);\n if (requested.length === 0) {\n throw new PmCliError(\"--group-by requires a comma-separated list of fields\", EXIT_CODE.USAGE);\n }\n for (const field of requested) {\n if (!AGGREGATE_GROUP_FIELDS.includes(field as AggregateGroupField)) {\n throw new PmCliError(\n `Aggregate group fields must be one of ${AGGREGATE_GROUP_FIELDS.join(\"|\")}; received \"${field}\"`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return requested as AggregateGroupField[];\n}\n\nfunction normalizeTagGroupValue(tags: string[]): string | null {\n const normalized = [...new Set(tags.map((tag) => tag.trim().toLowerCase()).filter((tag) => tag.length > 0))].sort((left, right) =>\n left.localeCompare(right),\n );\n if (normalized.length === 0) {\n return null;\n }\n return normalized.join(\",\");\n}\n\nfunction resolveGroupValue(field: AggregateGroupField, item: AggregateListedItem): AggregateGroupValue {\n switch (field) {\n case \"parent\":\n return item.parent ?? null;\n case \"type\":\n return item.type;\n case \"priority\":\n return item.priority;\n case \"status\":\n return item.status;\n case \"assignee\":\n return item.assignee ?? null;\n case \"tags\":\n return normalizeTagGroupValue(item.tags);\n case \"sprint\":\n return item.sprint ?? null;\n case \"release\":\n return item.release ?? null;\n default:\n return null;\n }\n}\n\nfunction compareNullableGroupValue(left: AggregateGroupValue | undefined, right: AggregateGroupValue | undefined): number {\n const leftValue = left ?? null;\n const rightValue = right ?? null;\n if (leftValue === rightValue) {\n return 0;\n }\n if (leftValue === null) {\n return 1;\n }\n if (rightValue === null) {\n return -1;\n }\n if (typeof leftValue === \"number\" && typeof rightValue === \"number\") {\n return leftValue - rightValue;\n }\n return String(leftValue).localeCompare(String(rightValue));\n}\n\nfunction buildGroupKey(groupBy: AggregateGroupField[], group: AggregateGroupRecord): string {\n return groupBy.map((field) => `${field}:${JSON.stringify(group[field] ?? null)}`).join(\"|\");\n}\n\nfunction compareAggregateRows(\n left: AggregateRow,\n right: AggregateRow,\n groupBy: AggregateGroupField[],\n): number {\n for (const field of groupBy) {\n const byField = compareNullableGroupValue(left.group[field], right.group[field]);\n if (byField !== 0) {\n return byField;\n }\n }\n return 0;\n}\n\nfunction readNumericAggregateValue(item: AggregateListedItem, field: string): number | null {\n const source = item as unknown as Record<string, unknown>;\n const raw = source[field];\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n if (typeof raw === \"string\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n return null;\n }\n const parsed = Number(trimmed);\n if (Number.isFinite(parsed)) {\n return parsed;\n }\n }\n return null;\n}\n\ninterface AggregateAccumulator {\n row: AggregateRow;\n numeric_count: number;\n numeric_sum: number;\n null_count: number;\n}\n\nexport async function runAggregate(options: AggregateOptions, global: GlobalOptions): Promise<AggregateResult> {\n if (options.count === false) {\n throw new PmCliError(\"Aggregate grouped counts are always enabled; omit count=false.\", EXIT_CODE.USAGE);\n }\n\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const groupBy = parseGroupBy(options.groupBy);\n const status = parseStatus(options.status, statusRegistry);\n const numericAggregation = parseNumericAggregation(options);\n const includeUnparented = options.includeUnparented === true;\n\n const listed = await runList(\n status,\n {\n type: options.type,\n tag: options.tag,\n priority: options.priority,\n deadlineBefore: options.deadlineBefore,\n deadlineAfter: options.deadlineAfter,\n assignee: options.assignee,\n assigneeFilter: options.assigneeFilter,\n parent: options.parent,\n sprint: options.sprint,\n release: options.release,\n },\n global,\n );\n\n const grouped = new Map<string, AggregateAccumulator>();\n let skippedUnparented = 0;\n let groupedItemCount = 0;\n\n for (const listedItem of listed.items) {\n const item = listedItem as AggregateListedItem;\n const group: AggregateGroupRecord = {};\n for (const field of groupBy) {\n group[field] = resolveGroupValue(field, item);\n }\n if (groupBy.includes(\"parent\") && group.parent === null && !includeUnparented) {\n skippedUnparented += 1;\n continue;\n }\n const key = buildGroupKey(groupBy, group);\n const existing = grouped.get(key);\n const numericValue =\n numericAggregation === null\n ? null\n : readNumericAggregateValue(item, numericAggregation.field);\n if (existing) {\n existing.row.count += 1;\n if (numericAggregation !== null) {\n if (numericValue === null) {\n existing.null_count += 1;\n } else {\n existing.numeric_count += 1;\n existing.numeric_sum += numericValue;\n }\n }\n } else {\n grouped.set(key, {\n row: {\n group,\n count: 1,\n },\n numeric_count: numericValue === null ? 0 : 1,\n numeric_sum: numericValue ?? 0,\n null_count: numericValue === null ? 1 : 0,\n });\n }\n groupedItemCount += 1;\n }\n\n const groups = [...grouped.values()]\n .map((entry) => {\n if (numericAggregation === null) {\n return entry.row;\n }\n const withNumeric: AggregateRow = {\n ...entry.row,\n null_count: entry.null_count,\n };\n if (numericAggregation.sum) {\n withNumeric.sum = entry.numeric_sum;\n }\n if (numericAggregation.avg) {\n withNumeric.avg = entry.numeric_count === 0 ? null : entry.numeric_sum / entry.numeric_count;\n }\n return withNumeric;\n })\n .sort((left, right) => compareAggregateRows(left, right, groupBy));\n const warnings = listed.warnings && listed.warnings.length > 0 ? listed.warnings : undefined;\n\n return {\n groups,\n count: groups.length,\n totals: {\n items_considered: listed.items.length,\n items_grouped: groupedItemCount,\n items_skipped_unparented: skippedUnparented,\n },\n filters: {\n group_by: groupBy,\n count: true,\n include_unparented: includeUnparented,\n status: status ?? null,\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 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 ...(numericAggregation !== null\n ? {\n sum: options.sum ?? null,\n avg: options.avg ?? null,\n numeric_field: numericAggregation.field,\n }\n : {}),\n },\n now: nowIso(),\n ...(warnings ? { warnings } : {}),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,yBAAgD;EACpD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA6DF,SAAS,YAAY,KAAyB,gBAAqC;AACjF,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,qBAAqB,KAAK,cAAc;AAC3D,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,WACR,gCAAgC,eAAe,YAAY,IAAI,CAAC,eAAe,WAAW,EAAE,EAAE,KAAK,GAAG,CAAC,IACvG,UAAU,KAAK;EAEnB;AACA,SAAO;AACT;AAQA,SAAS,wBAAwB,SAAyB;AACxD,QAAM,WAAW,QAAQ,KAAK,KAAI;AAClC,QAAM,WAAW,QAAQ,KAAK,KAAI;AAClC,QAAM,gBAAgB,YAAY,SAAS,SAAS,IAAI,WAAW;AACnE,QAAM,gBAAgB,YAAY,SAAS,SAAS,IAAI,WAAW;AACnE,MAAI,CAAC,iBAAiB,CAAC,eAAe;AACpC,WAAO;EACT;AACA,MAAI,iBAAiB,iBAAiB,kBAAkB,eAAe;AACrE,UAAM,IAAI,WAAW,gEAAgE,UAAU,KAAK;EACtG;AACA,SAAO;IACL,OAAO,iBAAiB,iBAAiB;IACzC,KAAK,kBAAkB;IACvB,KAAK,kBAAkB;;AAE3B;AAEA,SAAS,aAAa,KAAuB;AAC3C,QAAM,QAAQ,KAAK,KAAI,KAAM;AAC7B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,IAAI,WAAW,+CAA+C,UAAU,KAAK;EACrF;AACA,QAAM,YAAY,eAAe,KAAK;AACtC,MAAI,UAAU,WAAW,GAAG;AAC1B,UAAM,IAAI,WAAW,wDAAwD,UAAU,KAAK;EAC9F;AACA,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AAM,cAAc,MAAM;IACjF;AACA,WAAO;EACT,CAAC,EACA,KAAK,CAAC,MAAM,UAAU,qBAAqB,MAAM,OAAO,OAAO,CAAC;AACnE,QAAM,WAAW,OAAO,YAAY,OAAO,SAAS,SAAS,IAAI,OAAO,WAAW;AAEnF,SAAO;IACL;IACA,OAAO,OAAO;IACd,QAAQ;MACN,kBAAkB,OAAO,MAAM;MAC/B,eAAe;MACf,0BAA0B;;IAE5B,SAAS;MACP,UAAU;MACV,OAAO;MACP,oBAAoB;MACpB,QAAQ,UAAU;MAClB,MAAM,QAAQ,QAAQ;MACtB,KAAK,QAAQ,OAAO;MACpB,UAAU,QAAQ,YAAY;MAC9B,iBAAiB,QAAQ,kBAAkB;MAC3C,gBAAgB,QAAQ,iBAAiB;MACzC,UAAU,QAAQ,YAAY;MAC9B,iBAAiB,QAAQ,kBAAkB;MAC3C,QAAQ,QAAQ,UAAU;MAC1B,QAAQ,QAAQ,UAAU;MAC1B,SAAS,QAAQ,WAAW;MAC5B,GAAI,uBAAuB,OACvB;QACE,KAAK,QAAQ,OAAO;QACpB,KAAK,QAAQ,OAAO;QACpB,eAAe,mBAAmB;UAEpC,CAAA;;IAEN,KAAK,OAAM;IACX,GAAI,WAAW,EAAE,SAAQ,IAAK,CAAA;;AAElC","debugId":"c24fe9b2-4bb2-532c-a721-de78c2fb7ee5"}
@@ -5,15 +5,15 @@ import {
5
5
  } from "./chunk-J27KIHTG.js";
6
6
  import {
7
7
  createStdinTokenResolver
8
- } from "./chunk-O5IBJE6S.js";
8
+ } from "./chunk-UIIQC5YO.js";
9
9
  import {
10
10
  mutateItem,
11
11
  toItemRecord
12
- } from "./chunk-CWT53EYT.js";
13
- import "./chunk-SSFMJCPF.js";
14
- import "./chunk-KBG47ZOY.js";
15
- import "./chunk-SZQCER6S.js";
16
- import "./chunk-NQP3ECKF.js";
12
+ } from "./chunk-YBZW2QQ7.js";
13
+ import "./chunk-UT6WFXW2.js";
14
+ import "./chunk-UYQ7HXH4.js";
15
+ import "./chunk-GUZBNB3G.js";
16
+ import "./chunk-B2KZGPM2.js";
17
17
  import {
18
18
  EXIT_CODE,
19
19
  PmCliError,
@@ -21,7 +21,7 @@ import {
21
21
  pathExists,
22
22
  readSettings,
23
23
  resolvePmRoot
24
- } from "./chunk-4LTBNUYT.js";
24
+ } from "./chunk-X4IZKYHP.js";
25
25
 
26
26
  // dist/cli/commands/append.js
27
27
  async function runAppend(id, options, global) {
@@ -64,6 +64,6 @@ async function runAppend(id, options, global) {
64
64
  export {
65
65
  runAppend
66
66
  };
67
- //# sourceMappingURL=append-PNN6UIBZ.js.map
67
+ //# sourceMappingURL=append-2PPYFAG5.js.map
68
68
 
69
69
  //# debugId=d55ae411-c33e-5225-b6a5-d0d0b8006d7c
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-O7IWB35H.js";
4
4
  import {
5
5
  createStdinTokenResolver
6
- } from "./chunk-CJDQB2ED.js";
6
+ } from "./chunk-HV5SSZXF.js";
7
7
  import {
8
8
  mutateItem,
9
9
  toItemRecord
10
- } from "./chunk-XG7RJYHV.js";
11
- import "./chunk-KA24HME7.js";
12
- import "./chunk-HPH6X4ZZ.js";
13
- import "./chunk-4PJQSECJ.js";
14
- import "./chunk-RANZIID5.js";
10
+ } from "./chunk-TP4DDY27.js";
11
+ import "./chunk-2IXCHCLM.js";
12
+ import "./chunk-WCQZBDDH.js";
13
+ import "./chunk-HRMHZ4RV.js";
14
+ import "./chunk-FHHBD7PN.js";
15
15
  import {
16
16
  EXIT_CODE,
17
17
  PmCliError,
@@ -19,7 +19,7 @@ import {
19
19
  pathExists,
20
20
  readSettings,
21
21
  resolvePmRoot
22
- } from "./chunk-SRVKTWPR.js";
22
+ } from "./chunk-UJUT6AHZ.js";
23
23
 
24
24
  // dist/cli/commands/append.js
25
25
  !(function() {
@@ -69,4 +69,4 @@ async function runAppend(id, options, global2) {
69
69
  export {
70
70
  runAppend
71
71
  };
72
- //# sourceMappingURL=append-5JE3YGXU.js.map
72
+ //# sourceMappingURL=append-AUGT5W6J.js.map
@@ -2,7 +2,7 @@
2
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]="9d7e4d46-ea22-536a-8a47-90006a264b88")}catch(e){}}();
3
3
  import {
4
4
  BUILTIN_ITEM_TYPE_VALUES
5
- } from "./chunk-4LTBNUYT.js";
5
+ } from "./chunk-X4IZKYHP.js";
6
6
 
7
7
  // dist/core/schema/item-types-file.js
8
8
  var BUILTIN_NAME_LOOKUP = new Map(BUILTIN_ITEM_TYPE_VALUES.map((name) => [name.toLowerCase(), name]));
@@ -213,6 +213,6 @@ export {
213
213
  buildInvalidTypeHint,
214
214
  buildInvalidTypeError
215
215
  };
216
- //# sourceMappingURL=chunk-26KTVXJW.js.map
216
+ //# sourceMappingURL=chunk-2IF7WLB7.js.map
217
217
 
218
218
  //# debugId=9d7e4d46-ea22-536a-8a47-90006a264b88
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TYPE_TO_FOLDER,
3
3
  pathExists
4
- } from "./chunk-SRVKTWPR.js";
4
+ } from "./chunk-UJUT6AHZ.js";
5
5
 
6
6
  // dist/core/item/id.js
7
7
  import crypto from "node:crypto";
@@ -9,7 +9,7 @@ import path from "node:path";
9
9
  !(function() {
10
10
  try {
11
11
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
12
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f427a735-ffab-5a1c-b4cf-7069624a58cd");
12
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "681913fe-dcec-59f2-a0dc-0f3578f11e37");
13
13
  } catch (e2) {
14
14
  }
15
15
  })();
@@ -35,10 +35,9 @@ function normalizeItemId(input, prefix) {
35
35
  return `${canonicalPrefix}${normalized}`;
36
36
  }
37
37
  function randomToken(length) {
38
- const bytes = crypto.randomBytes(length);
39
38
  let token = "";
40
- for (const byte of bytes) {
41
- token += (byte % 36).toString(36);
39
+ for (let index = 0; index < length; index += 1) {
40
+ token += crypto.randomInt(0, 36).toString(36);
42
41
  }
43
42
  return token;
44
43
  }
@@ -76,4 +75,4 @@ export {
76
75
  normalizeItemId,
77
76
  generateItemId
78
77
  };
79
- //# sourceMappingURL=chunk-KA24HME7.js.map
78
+ //# sourceMappingURL=chunk-2IXCHCLM.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../core/item/id.ts"],
4
+ "sourcesContent": ["import crypto from \"node:crypto\";\nimport path from \"node:path\";\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport { pathExists } from \"../fs/fs-utils.js\";\n\nexport function normalizePrefix(input: string | undefined): string {\n const normalized = (input ?? \"\").trim().toLowerCase();\n if (!normalized) return \"pm-\";\n return normalized.endsWith(\"-\") ? normalized : `${normalized}-`;\n}\n\nexport function normalizeRawItemId(input: string): string {\n let normalized = input.trim().toLowerCase();\n if (normalized.startsWith(\"#\")) {\n normalized = normalized.slice(1);\n }\n return normalized;\n}\n\nexport function normalizeItemId(input: string, prefix: string): string {\n const canonicalPrefix = normalizePrefix(prefix);\n const normalized = normalizeRawItemId(input);\n if (normalized.startsWith(canonicalPrefix)) {\n return normalized;\n }\n return `${canonicalPrefix}${normalized}`;\n}\n\nfunction randomToken(length: number): string {\n let token = \"\";\n for (let index = 0; index < length; index += 1) {\n token += crypto.randomInt(0, 36).toString(36);\n }\n return token;\n}\n\nasync function idExists(pmRoot: string, id: string): Promise<boolean> {\n const checks = Object.values(TYPE_TO_FOLDER).flatMap((folder) => [\n path.join(pmRoot, folder, `${id}.md`),\n path.join(pmRoot, folder, `${id}.toon`),\n ]);\n for (const target of checks) {\n if (await pathExists(target)) {\n return true;\n }\n }\n return false;\n}\n\nexport async function generateItemId(pmRoot: string, prefix: string): Promise<string> {\n let tokenLength = 4;\n let attempts = 0;\n\n while (tokenLength <= 10) {\n for (let i = 0; i < 32; i += 1) {\n const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;\n if (!(await idExists(pmRoot, id))) {\n return id;\n }\n attempts += 1;\n }\n tokenLength += 1;\n }\n\n throw new Error(`Unable to generate unique id after ${attempts} attempts`);\n}\n"],
5
+ "mappings": ";;;;;;AAAA,OAAO,YAAY;AACnB,OAAO,UAAU;;;;;;;;AAIX,SAAU,gBAAgB,OAAyB;AACvD,QAAM,cAAc,SAAS,IAAI,KAAI,EAAG,YAAW;AACnD,MAAI,CAAC;AAAY,WAAO;AACxB,SAAO,WAAW,SAAS,GAAG,IAAI,aAAa,GAAG,UAAU;AAC9D;AAEM,SAAU,mBAAmB,OAAa;AAC9C,MAAI,aAAa,MAAM,KAAI,EAAG,YAAW;AACzC,MAAI,WAAW,WAAW,GAAG,GAAG;AAC9B,iBAAa,WAAW,MAAM,CAAC;EACjC;AACA,SAAO;AACT;AAEM,SAAU,gBAAgB,OAAe,QAAc;AAC3D,QAAM,kBAAkB,gBAAgB,MAAM;AAC9C,QAAM,aAAa,mBAAmB,KAAK;AAC3C,MAAI,WAAW,WAAW,eAAe,GAAG;AAC1C,WAAO;EACT;AACA,SAAO,GAAG,eAAe,GAAG,UAAU;AACxC;AAEA,SAAS,YAAY,QAAc;AACjC,MAAI,QAAQ;AACZ,WAAS,QAAQ,GAAG,QAAQ,QAAQ,SAAS,GAAG;AAC9C,aAAS,OAAO,UAAU,GAAG,EAAE,EAAE,SAAS,EAAE;EAC9C;AACA,SAAO;AACT;AAEA,eAAe,SAAS,QAAgB,IAAU;AAChD,QAAM,SAAS,OAAO,OAAO,cAAc,EAAE,QAAQ,CAAC,WAAW;IAC/D,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;IACpC,KAAK,KAAK,QAAQ,QAAQ,GAAG,EAAE,OAAO;GACvC;AACD,aAAW,UAAU,QAAQ;AAC3B,QAAI,MAAM,WAAW,MAAM,GAAG;AAC5B,aAAO;IACT;EACF;AACA,SAAO;AACT;AAEA,eAAsB,eAAe,QAAgB,QAAc;AACjE,MAAI,cAAc;AAClB,MAAI,WAAW;AAEf,SAAO,eAAe,IAAI;AACxB,aAAS,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG;AAC9B,YAAM,KAAK,GAAG,gBAAgB,MAAM,CAAC,GAAG,YAAY,WAAW,CAAC;AAChE,UAAI,CAAE,MAAM,SAAS,QAAQ,EAAE,GAAI;AACjC,eAAO;MACT;AACA,kBAAY;IACd;AACA,mBAAe;EACjB;AAEA,QAAM,IAAI,MAAM,sCAAsC,QAAQ,WAAW;AAC3E;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EXIT_CODE,
3
3
  PmCliError
4
- } from "./chunk-SRVKTWPR.js";
4
+ } from "./chunk-UJUT6AHZ.js";
5
5
 
6
6
  // dist/core/item/parent-reference-policy.js
7
7
  !(function() {
@@ -87,4 +87,4 @@ export {
87
87
  normalizeSprintReleaseFormatPolicy,
88
88
  validateSprintOrReleaseValue
89
89
  };
90
- //# sourceMappingURL=chunk-XX5LRINW.js.map
90
+ //# sourceMappingURL=chunk-2OJHLWBZ.js.map