@unbrained/pm-cli 2026.6.30 → 2026.7.2

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 (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  runActivity
3
- } from "./chunk-IF4ERU6A.js";
3
+ } from "./chunk-GFMSLORL.js";
4
4
  import {
5
5
  collectRuntimeFilterValues,
6
6
  matchesRuntimeFilters,
7
7
  runList
8
- } from "./chunk-KTMMTOIP.js";
8
+ } from "./chunk-W47SML5B.js";
9
9
  import {
10
10
  parseIntegerLimit,
11
11
  parsePriority,
12
12
  parseType
13
- } from "./chunk-7L6TXOOC.js";
13
+ } from "./chunk-JMK5GCK2.js";
14
14
  import {
15
15
  listAllFrontMatterLight
16
- } from "./chunk-LBH7UYKY.js";
16
+ } from "./chunk-JXAUVO6X.js";
17
17
  import {
18
18
  isTerminalStatus,
19
19
  normalizeStatusForRegistry,
20
20
  normalizeStatusInput
21
- } from "./chunk-ZFIEEDTJ.js";
21
+ } from "./chunk-IEEJQCZ4.js";
22
22
  import {
23
23
  compareTimestampStrings,
24
24
  nowIso,
25
25
  resolveIsoOrRelative
26
- } from "./chunk-MLHX6DN5.js";
26
+ } from "./chunk-AIAIXG7I.js";
27
27
  import {
28
28
  CONTEXT_DEPTH_VALUES,
29
29
  CONTEXT_SECTION_VALUES,
@@ -40,14 +40,14 @@ import {
40
40
  resolveRuntimeFieldRegistry,
41
41
  resolveRuntimeStatusRegistry,
42
42
  weekdayOrderIndex
43
- } from "./chunk-SNUK7H5J.js";
43
+ } from "./chunk-7NSPKJUS.js";
44
44
 
45
45
  // dist/cli/commands/calendar.js
46
46
  import { encode as encodeToon } from "@toon-format/toon";
47
47
  !(function() {
48
48
  try {
49
49
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
50
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "6c196179-0593-5629-926f-6e0143fb9da2");
50
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "16039cc1-59c0-510f-9ae1-d452ba30096c");
51
51
  } catch (e2) {
52
52
  }
53
53
  })();
@@ -254,122 +254,130 @@ function buildRecurringEventWindow(start, end, nowValue, lookbackDays, lookahead
254
254
  end: compareTimestampStrings(windowEnd, windowStart) > 0 ? windowEnd : addUtcDays(windowStart, 1)
255
255
  };
256
256
  }
257
- function expandRecurringOccurrences(startAt, recurrence, window2, occurrenceLimit) {
258
- const maxOccurrences = occurrenceLimit ?? MAX_RECURRENCE_OCCURRENCES;
259
- const interval = recurrence.interval ?? 1;
260
- const countLimit = recurrence.count ?? Number.POSITIVE_INFINITY;
261
- const until = recurrence.until;
262
- const excluded = buildExcludedInstantSet(recurrence.exdates);
263
- const recurrenceWeekdays = recurrence.by_weekday && recurrence.by_weekday.length > 0 ? [...recurrence.by_weekday] : [weekdayToken(startAt)];
264
- const recurrenceMonthDays = recurrence.by_month_day && recurrence.by_month_day.length > 0 ? [...recurrence.by_month_day] : [new Date(startAt).getUTCDate()];
265
- const weekdayFilter = recurrence.by_weekday ? new Set(recurrence.by_weekday) : void 0;
266
- const monthDayFilter = recurrence.by_month_day ? new Set(recurrence.by_month_day) : void 0;
267
- const sortedWeekdays = [...new Set(recurrenceWeekdays)].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));
268
- const sortedMonthDays = [...new Set(recurrenceMonthDays)].sort((left, right) => left - right);
269
- const occurrences = [];
270
- let produced = 0;
271
- const consumeCandidate = (candidateAt) => {
272
- if (compareTimestampStrings(candidateAt, startAt) < 0) {
273
- return "continue";
274
- }
275
- if (until && compareTimestampStrings(candidateAt, until) > 0) {
276
- return "stop";
277
- }
278
- if (compareTimestampStrings(candidateAt, window2.end) >= 0) {
279
- return "stop";
280
- }
281
- if (excluded.has(candidateAt)) {
282
- return "continue";
283
- }
284
- produced += 1;
285
- if (compareTimestampStrings(candidateAt, window2.start) >= 0) {
286
- occurrences.push(candidateAt);
287
- }
288
- if (produced >= countLimit) {
289
- return "stop";
290
- }
291
- return "continue";
257
+ function buildRecurrenceExpansionContext(startAt, recurrence, window2, occurrenceLimit) {
258
+ const recurrenceWeekdays = recurrence.by_weekday !== void 0 ? [...recurrence.by_weekday] : [weekdayToken(startAt)];
259
+ const recurrenceMonthDays = recurrence.by_month_day !== void 0 ? [...recurrence.by_month_day] : [new Date(startAt).getUTCDate()];
260
+ return {
261
+ startAt,
262
+ startDate: new Date(startAt),
263
+ window: window2,
264
+ maxOccurrences: occurrenceLimit ?? MAX_RECURRENCE_OCCURRENCES,
265
+ interval: recurrence.interval ?? 1,
266
+ countLimit: recurrence.count ?? Number.POSITIVE_INFINITY,
267
+ until: recurrence.until,
268
+ excluded: buildExcludedInstantSet(recurrence.exdates),
269
+ weekdayFilter: recurrence.by_weekday !== void 0 ? new Set(recurrence.by_weekday) : void 0,
270
+ monthDayFilter: recurrence.by_month_day !== void 0 ? new Set(recurrence.by_month_day) : void 0,
271
+ sortedWeekdays: [...new Set(recurrenceWeekdays)].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right)),
272
+ sortedMonthDays: [...new Set(recurrenceMonthDays)].sort((left, right) => left - right),
273
+ occurrences: [],
274
+ produced: 0
292
275
  };
293
- const startDate = new Date(startAt);
294
- if (recurrence.freq === "daily") {
295
- let candidateAt = startAt;
296
- for (let iteration = 0; iteration < maxOccurrences; iteration += 1) {
297
- const candidateWeekday = weekdayToken(candidateAt);
298
- const candidateMonthDay = new Date(candidateAt).getUTCDate();
299
- const weekdayMatches = !weekdayFilter || weekdayFilter.has(candidateWeekday);
300
- const monthDayMatches = !monthDayFilter || monthDayFilter.has(candidateMonthDay);
301
- if (weekdayMatches && monthDayMatches && consumeCandidate(candidateAt) === "stop") {
302
- break;
303
- }
304
- candidateAt = addUtcDays(candidateAt, interval);
305
- }
306
- return occurrences;
276
+ }
277
+ function consumeRecurrenceCandidate(context, candidateAt) {
278
+ if (compareTimestampStrings(candidateAt, context.startAt) < 0) {
279
+ return "continue";
307
280
  }
308
- if (recurrence.freq === "weekly") {
309
- const weekStart = startOfUtcWeekMonday(startAt);
310
- for (let step = 0; step < maxOccurrences; step += 1) {
311
- const candidateWeekStart = addUtcDays(weekStart, step * interval * 7);
312
- for (const weekday of sortedWeekdays) {
313
- const dayOffset = weekdayOrderIndex(weekday);
314
- const candidateDay = addUtcDays(candidateWeekStart, dayOffset);
315
- const dayDate = new Date(candidateDay);
316
- const candidateAt = new Date(Date.UTC(dayDate.getUTCFullYear(), dayDate.getUTCMonth(), dayDate.getUTCDate(), startDate.getUTCHours(), startDate.getUTCMinutes(), startDate.getUTCSeconds(), startDate.getUTCMilliseconds())).toISOString();
317
- const candidateMonthDay = dayDate.getUTCDate();
318
- if (monthDayFilter && !monthDayFilter.has(candidateMonthDay)) {
319
- continue;
320
- }
321
- const consumed = consumeCandidate(candidateAt);
322
- if (consumed === "stop") {
323
- return occurrences;
324
- }
325
- }
326
- }
327
- return occurrences;
281
+ if (context.until && compareTimestampStrings(candidateAt, context.until) > 0) {
282
+ return "stop";
328
283
  }
329
- if (recurrence.freq === "monthly") {
330
- const startYear = startDate.getUTCFullYear();
331
- const startMonth = startDate.getUTCMonth();
332
- for (let step = 0; step < maxOccurrences; step += 1) {
333
- const monthAnchor = new Date(Date.UTC(startYear, startMonth + step * interval, 1, 0, 0, 0, 0));
334
- const year2 = monthAnchor.getUTCFullYear();
335
- const month2 = monthAnchor.getUTCMonth();
336
- for (const monthDay of sortedMonthDays) {
337
- const candidateAt = buildUtcTimestamp(year2, month2, monthDay, startDate);
338
- if (!candidateAt) {
339
- continue;
340
- }
341
- const candidateWeekday = weekdayToken(candidateAt);
342
- if (weekdayFilter && !weekdayFilter.has(candidateWeekday)) {
343
- continue;
344
- }
345
- const consumed = consumeCandidate(candidateAt);
346
- if (consumed === "stop") {
347
- return occurrences;
348
- }
284
+ if (compareTimestampStrings(candidateAt, context.window.end) >= 0) {
285
+ return "stop";
286
+ }
287
+ if (context.excluded.has(candidateAt)) {
288
+ return "continue";
289
+ }
290
+ context.produced += 1;
291
+ if (compareTimestampStrings(candidateAt, context.window.start) >= 0) {
292
+ context.occurrences.push(candidateAt);
293
+ }
294
+ return context.produced >= context.countLimit || context.occurrences.length >= context.maxOccurrences ? "stop" : "continue";
295
+ }
296
+ function recurrenceDayMatchesFilters(context, candidateAt) {
297
+ const candidateWeekday = weekdayToken(candidateAt);
298
+ const candidateMonthDay = new Date(candidateAt).getUTCDate();
299
+ const weekdayMatches = !context.weekdayFilter || context.weekdayFilter.has(candidateWeekday);
300
+ const monthDayMatches = !context.monthDayFilter || context.monthDayFilter.has(candidateMonthDay);
301
+ return weekdayMatches && monthDayMatches;
302
+ }
303
+ function expandDailyOccurrences(context) {
304
+ let candidateAt = context.startAt;
305
+ for (let iteration = 0; iteration < context.maxOccurrences; iteration += 1) {
306
+ if (recurrenceDayMatchesFilters(context, candidateAt) && consumeRecurrenceCandidate(context, candidateAt) === "stop") {
307
+ break;
308
+ }
309
+ candidateAt = addUtcDays(candidateAt, context.interval);
310
+ }
311
+ return context.occurrences;
312
+ }
313
+ function buildWeeklyCandidateAt(context, candidateWeekStart, weekday) {
314
+ const dayOffset = weekdayOrderIndex(weekday);
315
+ const candidateDay = addUtcDays(candidateWeekStart, dayOffset);
316
+ const dayDate = new Date(candidateDay);
317
+ return new Date(Date.UTC(dayDate.getUTCFullYear(), dayDate.getUTCMonth(), dayDate.getUTCDate(), context.startDate.getUTCHours(), context.startDate.getUTCMinutes(), context.startDate.getUTCSeconds(), context.startDate.getUTCMilliseconds())).toISOString();
318
+ }
319
+ function expandWeeklyOccurrences(context) {
320
+ const weekStart = startOfUtcWeekMonday(context.startAt);
321
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
322
+ const candidateWeekStart = addUtcDays(weekStart, step * context.interval * 7);
323
+ for (const weekday of context.sortedWeekdays) {
324
+ const candidateAt = buildWeeklyCandidateAt(context, candidateWeekStart, weekday);
325
+ if (!recurrenceDayMatchesFilters(context, candidateAt)) {
326
+ continue;
327
+ }
328
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
329
+ return context.occurrences;
349
330
  }
350
331
  }
351
- return occurrences;
352
- }
353
- const year = startDate.getUTCFullYear();
354
- const month = startDate.getUTCMonth();
355
- for (let step = 0; step < maxOccurrences; step += 1) {
356
- const candidateYear = year + step * interval;
357
- for (const monthDay of sortedMonthDays) {
358
- const candidateAt = buildUtcTimestamp(candidateYear, month, monthDay, startDate);
359
- if (!candidateAt) {
332
+ }
333
+ return context.occurrences;
334
+ }
335
+ function expandMonthlyOccurrences(context) {
336
+ const startYear = context.startDate.getUTCFullYear();
337
+ const startMonth = context.startDate.getUTCMonth();
338
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
339
+ const monthAnchor = new Date(Date.UTC(startYear, startMonth + step * context.interval, 1, 0, 0, 0, 0));
340
+ for (const monthDay of context.sortedMonthDays) {
341
+ const candidateAt = buildUtcTimestamp(monthAnchor.getUTCFullYear(), monthAnchor.getUTCMonth(), monthDay, context.startDate);
342
+ if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
360
343
  continue;
361
344
  }
362
- const candidateWeekday = weekdayToken(candidateAt);
363
- if (weekdayFilter && !weekdayFilter.has(candidateWeekday)) {
345
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
346
+ return context.occurrences;
347
+ }
348
+ }
349
+ }
350
+ return context.occurrences;
351
+ }
352
+ function expandYearlyOccurrences(context) {
353
+ const year = context.startDate.getUTCFullYear();
354
+ const month = context.startDate.getUTCMonth();
355
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
356
+ const candidateYear = year + step * context.interval;
357
+ for (const monthDay of context.sortedMonthDays) {
358
+ const candidateAt = buildUtcTimestamp(candidateYear, month, monthDay, context.startDate);
359
+ if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
364
360
  continue;
365
361
  }
366
- const consumed = consumeCandidate(candidateAt);
367
- if (consumed === "stop") {
368
- return occurrences;
362
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
363
+ return context.occurrences;
369
364
  }
370
365
  }
371
366
  }
372
- return occurrences;
367
+ return context.occurrences;
368
+ }
369
+ function expandRecurringOccurrences(startAt, recurrence, window2, occurrenceLimit) {
370
+ const context = buildRecurrenceExpansionContext(startAt, recurrence, window2, occurrenceLimit);
371
+ if (recurrence.freq === "daily") {
372
+ return expandDailyOccurrences(context);
373
+ }
374
+ if (recurrence.freq === "weekly") {
375
+ return expandWeeklyOccurrences(context);
376
+ }
377
+ if (recurrence.freq === "monthly") {
378
+ return expandMonthlyOccurrences(context);
379
+ }
380
+ return expandYearlyOccurrences(context);
373
381
  }
374
382
  function sortEvents(values) {
375
383
  return [...values].sort((a, b) => {
@@ -391,92 +399,98 @@ function sortEvents(values) {
391
399
  return String(a.reminder_text).localeCompare(String(b.reminder_text));
392
400
  });
393
401
  }
402
+ function buildItemCalendarRowBase(item) {
403
+ return {
404
+ item_id: item.id,
405
+ item_title: item.title,
406
+ item_type: item.type,
407
+ item_status: item.status,
408
+ item_priority: item.priority,
409
+ item_assignee: item.assignee ?? null,
410
+ item_deadline: item.deadline ?? null,
411
+ item_tags: item.tags
412
+ };
413
+ }
414
+ function buildDeadlineRow(item) {
415
+ if (!item.deadline) {
416
+ return null;
417
+ }
418
+ return {
419
+ at: item.deadline,
420
+ date: toUtcDayKey(item.deadline),
421
+ kind: "deadline",
422
+ reminder_text: null,
423
+ event_title: null,
424
+ event_end: null,
425
+ event_location: null,
426
+ event_all_day: null,
427
+ event_timezone: null,
428
+ event_recurring: null,
429
+ event_recurrence_rule: null,
430
+ ...buildItemCalendarRowBase(item),
431
+ item_deadline: item.deadline
432
+ };
433
+ }
434
+ function buildReminderRows(item) {
435
+ return (item.reminders ?? []).map((reminder) => ({
436
+ at: reminder.at,
437
+ date: toUtcDayKey(reminder.at),
438
+ kind: "reminder",
439
+ reminder_text: reminder.text,
440
+ event_title: null,
441
+ event_end: null,
442
+ event_location: null,
443
+ event_all_day: null,
444
+ event_timezone: null,
445
+ event_recurring: null,
446
+ event_recurrence_rule: null,
447
+ ...buildItemCalendarRowBase(item)
448
+ }));
449
+ }
450
+ function recurringDurationMs(startAt, endAt) {
451
+ if (!endAt) {
452
+ return null;
453
+ }
454
+ const duration = Date.parse(endAt) - Date.parse(startAt);
455
+ return Number.isFinite(duration) && duration > 0 ? duration : null;
456
+ }
457
+ function eventOccurrenceEnd(occurrenceAt, event, durationMs) {
458
+ return event.recurrence && durationMs !== null ? new Date(new Date(occurrenceAt).getTime() + durationMs).toISOString() : event.end_at ?? null;
459
+ }
460
+ function buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit) {
461
+ const recurrenceRuleSummary = formatRecurrenceRuleForSummary(event.recurrence);
462
+ const durationMs = recurringDurationMs(event.start_at, event.end_at);
463
+ const occurrences = event.recurrence ? expandRecurringOccurrences(event.start_at, event.recurrence, recurringWindow, occurrenceLimit) : [event.start_at];
464
+ return occurrences.map((occurrenceAt) => ({
465
+ at: occurrenceAt,
466
+ // All-day events are timezone-agnostic calendar dates: bucket by the
467
+ // literal start date. Timed events bucket by their local day in the
468
+ // event's timezone (defaults to UTC when unset).
469
+ date: event.all_day === true ? occurrenceAt.slice(0, 10) : toLocalDayKey(occurrenceAt, event.timezone),
470
+ kind: "event",
471
+ reminder_text: event.description ?? null,
472
+ event_title: event.title ?? item.title,
473
+ event_end: eventOccurrenceEnd(occurrenceAt, event, durationMs),
474
+ event_location: event.location ?? null,
475
+ event_all_day: event.all_day ?? null,
476
+ event_timezone: event.timezone ?? null,
477
+ event_recurring: event.recurrence ? true : false,
478
+ event_recurrence_rule: recurrenceRuleSummary,
479
+ ...buildItemCalendarRowBase(item)
480
+ }));
481
+ }
394
482
  function buildEventSeed(items, recurringWindow, includeSources, occurrenceLimit) {
395
483
  const events = [];
396
484
  for (const item of items) {
397
- if (includeSources.has("deadlines") && item.deadline) {
398
- events.push({
399
- at: item.deadline,
400
- date: toUtcDayKey(item.deadline),
401
- kind: "deadline",
402
- reminder_text: null,
403
- event_title: null,
404
- event_end: null,
405
- event_location: null,
406
- event_all_day: null,
407
- event_timezone: null,
408
- event_recurring: null,
409
- event_recurrence_rule: null,
410
- item_id: item.id,
411
- item_title: item.title,
412
- item_type: item.type,
413
- item_status: item.status,
414
- item_priority: item.priority,
415
- item_assignee: item.assignee ?? null,
416
- item_deadline: item.deadline,
417
- item_tags: item.tags
418
- });
485
+ const deadlineRow = includeSources.has("deadlines") ? buildDeadlineRow(item) : null;
486
+ if (deadlineRow) {
487
+ events.push(deadlineRow);
419
488
  }
420
- for (const reminder of includeSources.has("reminders") ? item.reminders ?? [] : []) {
421
- events.push({
422
- at: reminder.at,
423
- date: toUtcDayKey(reminder.at),
424
- kind: "reminder",
425
- reminder_text: reminder.text,
426
- event_title: null,
427
- event_end: null,
428
- event_location: null,
429
- event_all_day: null,
430
- event_timezone: null,
431
- event_recurring: null,
432
- event_recurrence_rule: null,
433
- item_id: item.id,
434
- item_title: item.title,
435
- item_type: item.type,
436
- item_status: item.status,
437
- item_priority: item.priority,
438
- item_assignee: item.assignee ?? null,
439
- item_deadline: item.deadline ?? null,
440
- item_tags: item.tags
441
- });
489
+ if (includeSources.has("reminders")) {
490
+ events.push(...buildReminderRows(item));
442
491
  }
443
492
  for (const event of includeSources.has("events") ? item.events ?? [] : []) {
444
- const recurrenceRuleSummary = formatRecurrenceRuleForSummary(event.recurrence);
445
- const recurringDurationMs = (() => {
446
- if (!event.end_at) {
447
- return null;
448
- }
449
- const duration = Date.parse(event.end_at) - Date.parse(event.start_at);
450
- return Number.isFinite(duration) && duration > 0 ? duration : null;
451
- })();
452
- const occurrences = event.recurrence ? expandRecurringOccurrences(event.start_at, event.recurrence, recurringWindow, occurrenceLimit) : [event.start_at];
453
- for (const occurrenceAt of occurrences) {
454
- const occurrenceEnd = event.recurrence && recurringDurationMs !== null ? new Date(new Date(occurrenceAt).getTime() + recurringDurationMs).toISOString() : event.end_at ?? null;
455
- events.push({
456
- at: occurrenceAt,
457
- // All-day events are timezone-agnostic calendar dates: bucket by the
458
- // literal start date. Timed events bucket by their local day in the
459
- // event's timezone (defaults to UTC when unset).
460
- date: event.all_day === true ? occurrenceAt.slice(0, 10) : toLocalDayKey(occurrenceAt, event.timezone),
461
- kind: "event",
462
- reminder_text: event.description ?? null,
463
- event_title: event.title ?? item.title,
464
- event_end: occurrenceEnd,
465
- event_location: event.location ?? null,
466
- event_all_day: event.all_day ?? null,
467
- event_timezone: event.timezone ?? null,
468
- event_recurring: event.recurrence ? true : false,
469
- event_recurrence_rule: recurrenceRuleSummary,
470
- item_id: item.id,
471
- item_title: item.title,
472
- item_type: item.type,
473
- item_status: item.status,
474
- item_priority: item.priority,
475
- item_assignee: item.assignee ?? null,
476
- item_deadline: item.deadline ?? null,
477
- item_tags: item.tags
478
- });
479
- }
493
+ events.push(...buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit));
480
494
  }
481
495
  }
482
496
  return sortEvents(events);
@@ -496,30 +510,44 @@ function filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldF
496
510
  if (assigneeFilter !== void 0 && assigneeModeFilter === "unassigned") {
497
511
  throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned", EXIT_CODE.USAGE);
498
512
  }
499
- return items.filter((item) => {
500
- if (typeFilter && item.type !== typeFilter)
501
- return false;
502
- if (tagFilter && !item.tags.some((tag) => tag.trim().toLowerCase() === tagFilter))
503
- return false;
504
- if (priorityFilter !== void 0 && item.priority !== priorityFilter)
505
- return false;
506
- if (statusFilter && item.status !== statusFilter)
507
- return false;
508
- if (assigneeModeFilter === "assigned" && !item.assignee)
509
- return false;
510
- if (assigneeModeFilter === "unassigned" && item.assignee)
511
- return false;
512
- if (assigneeFilter !== void 0 && item.assignee !== assigneeFilter) {
513
- return false;
514
- }
515
- if (sprintFilter !== void 0 && item.sprint !== sprintFilter)
516
- return false;
517
- if (releaseFilter !== void 0 && item.release !== releaseFilter)
518
- return false;
519
- if (!matchesRuntimeFilters(item, runtimeFieldFilters))
520
- return false;
521
- return true;
522
- });
513
+ return items.filter((item) => itemMatchesCalendarFilters(item, {
514
+ typeFilter,
515
+ tagFilter,
516
+ priorityFilter,
517
+ statusFilter,
518
+ assigneeFilter,
519
+ assigneeModeFilter,
520
+ sprintFilter,
521
+ releaseFilter,
522
+ runtimeFieldFilters
523
+ }));
524
+ }
525
+ function itemMatchesCalendarFilters(item, filters) {
526
+ return itemMatchesCalendarIdentityFilters(item, filters) && itemMatchesCalendarOwnerFilters(item, filters) && matchesRuntimeFilters(item, filters.runtimeFieldFilters);
527
+ }
528
+ function itemMatchesCalendarIdentityFilters(item, filters) {
529
+ if (filters.typeFilter && item.type !== filters.typeFilter)
530
+ return false;
531
+ if (filters.tagFilter && !item.tags.some((tag) => tag.trim().toLowerCase() === filters.tagFilter))
532
+ return false;
533
+ if (filters.priorityFilter !== void 0 && item.priority !== filters.priorityFilter)
534
+ return false;
535
+ if (filters.statusFilter && item.status !== filters.statusFilter)
536
+ return false;
537
+ return true;
538
+ }
539
+ function itemMatchesCalendarOwnerFilters(item, filters) {
540
+ if (filters.assigneeModeFilter === "assigned" && !item.assignee)
541
+ return false;
542
+ if (filters.assigneeModeFilter === "unassigned" && item.assignee)
543
+ return false;
544
+ if (filters.assigneeFilter !== void 0 && item.assignee !== filters.assigneeFilter)
545
+ return false;
546
+ if (filters.sprintFilter !== void 0 && item.sprint !== filters.sprintFilter)
547
+ return false;
548
+ if (filters.releaseFilter !== void 0 && item.release !== filters.releaseFilter)
549
+ return false;
550
+ return true;
523
551
  }
524
552
  function includeEventInWindow(event, start, end) {
525
553
  if (start && compareTimestampStrings(event.at, start) < 0) {
@@ -549,53 +577,38 @@ function buildRange(view, options, nowValue) {
549
577
  throw new PmCliError("--from and --to are only supported for --view agenda", EXIT_CODE.USAGE);
550
578
  }
551
579
  if (view === "agenda") {
552
- if (fullPeriodRequested) {
553
- throw new PmCliError("--full-period is only supported for --view day|week|month. For agenda windows, use --from and --to.", EXIT_CODE.USAGE);
554
- }
555
- const start2 = from ?? (options.date ? anchor : includePast ? void 0 : nowValue);
556
- return {
557
- anchor,
558
- start: start2,
559
- end: to,
560
- fullPeriod: false
561
- };
580
+ return buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to);
562
581
  }
563
582
  if (view === "day") {
564
583
  const dayStart = startOfUtcDay(anchor);
565
- const fullPeriod2 = includePast || fullPeriodRequested;
566
- const start2 = fullPeriod2 ? dayStart : maxTimestamp(dayStart, nowValue);
567
- return {
568
- anchor,
569
- start: start2,
570
- end: addUtcDays(dayStart, 1),
571
- periodStart: dayStart,
572
- periodEnd: addUtcDays(dayStart, 1),
573
- fullPeriod: fullPeriod2
574
- };
584
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, dayStart, addUtcDays(dayStart, 1));
575
585
  }
576
586
  if (view === "week") {
577
587
  const weekStart = startOfUtcWeekMonday(anchor);
578
- const fullPeriod2 = includePast || fullPeriodRequested;
579
- const start2 = fullPeriod2 ? weekStart : maxTimestamp(weekStart, nowValue);
580
- return {
581
- anchor,
582
- start: start2,
583
- end: addUtcDays(weekStart, 7),
584
- periodStart: weekStart,
585
- periodEnd: addUtcDays(weekStart, 7),
586
- fullPeriod: fullPeriod2
587
- };
588
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, weekStart, addUtcDays(weekStart, 7));
588
589
  }
589
590
  const monthStart = startOfUtcMonth(anchor);
590
- const monthEnd = startOfNextUtcMonth(anchor);
591
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, monthStart, startOfNextUtcMonth(anchor));
592
+ }
593
+ function buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to) {
594
+ if (fullPeriodRequested) {
595
+ throw new PmCliError("--full-period is only supported for --view day|week|month. For agenda windows, use --from and --to.", EXIT_CODE.USAGE);
596
+ }
597
+ return {
598
+ anchor,
599
+ start: from ?? (options.date ? anchor : includePast ? void 0 : nowValue),
600
+ end: to,
601
+ fullPeriod: false
602
+ };
603
+ }
604
+ function buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, periodStart, periodEnd) {
591
605
  const fullPeriod = includePast || fullPeriodRequested;
592
- const start = fullPeriod ? monthStart : maxTimestamp(monthStart, nowValue);
593
606
  return {
594
607
  anchor,
595
- start,
596
- end: monthEnd,
597
- periodStart: monthStart,
598
- periodEnd: monthEnd,
608
+ start: fullPeriod ? periodStart : maxTimestamp(periodStart, nowValue),
609
+ end: periodEnd,
610
+ periodStart,
611
+ periodEnd,
599
612
  fullPeriod
600
613
  };
601
614
  }
@@ -651,11 +664,7 @@ function summarize(events) {
651
664
  recurring_events: recurringEvents
652
665
  };
653
666
  }
654
- async function runCalendar(options, global2) {
655
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
656
- if (!await pathExists(getSettingsPath(pmRoot))) {
657
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
658
- }
667
+ function resolveCalendarExecutionInputs(options) {
659
668
  const nowValue = nowIso();
660
669
  const view = parseView(options.view);
661
670
  const rangeBounds = buildRange(view, options, nowValue);
@@ -668,59 +677,85 @@ async function runCalendar(options, global2) {
668
677
  throw new PmCliError("Calendar occurrence limit must be >= 1", EXIT_CODE.USAGE);
669
678
  }
670
679
  const eventsOnly = includeSources.has("events") && !includeSources.has("deadlines") && !includeSources.has("reminders");
671
- const hasExplicitBounds = options.to !== void 0 || explicitLookahead !== void 0 || occurrenceLimit !== void 0;
680
+ const hasExplicitBounds = options.to !== void 0 || explicitLookahead !== void 0 || recurrenceLookbackDays !== void 0 || occurrenceLimit !== void 0;
672
681
  const eventsOnlyCapApplied = eventsOnly && !hasExplicitBounds;
673
- const recurrenceLookaheadDays = eventsOnlyCapApplied ? DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS : explicitLookahead;
674
- const recurrenceLookbackWindowDays = eventsOnlyCapApplied && recurrenceLookbackDays === void 0 ? 0 : recurrenceLookbackDays;
682
+ return {
683
+ nowValue,
684
+ view,
685
+ rangeBounds,
686
+ limit,
687
+ includeSources,
688
+ occurrenceLimit,
689
+ recurrenceLookaheadDays: eventsOnlyCapApplied ? DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS : explicitLookahead,
690
+ recurrenceLookbackWindowDays: eventsOnlyCapApplied && recurrenceLookbackDays === void 0 ? 0 : recurrenceLookbackDays,
691
+ eventsOnlyCapApplied
692
+ };
693
+ }
694
+ function appendCalendarCapWarning(warnings, capApplied) {
695
+ if (!capApplied) {
696
+ return;
697
+ }
698
+ warnings.push(`recurring_events_default_cap_applied:lookback=0d,lookahead=${DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS}d -- use --recurrence-lookback-days/--recurrence-lookahead-days or --to for wider range`);
699
+ }
700
+ function buildCalendarFiltersResult(options, runtimeFieldFilters) {
701
+ return {
702
+ type: options.type ?? null,
703
+ tag: options.tag ?? null,
704
+ priority: options.priority ?? null,
705
+ status: options.status ?? null,
706
+ assignee: options.assignee ?? null,
707
+ assignee_filter: options.assigneeFilter ?? null,
708
+ sprint: options.sprint ?? null,
709
+ release: options.release ?? null,
710
+ runtime_filters: runtimeFieldFilters,
711
+ limit: options.limit ?? null,
712
+ include: options.include ?? null,
713
+ full_period: options.fullPeriod === true ? "true" : null,
714
+ recurrence_lookahead_days: options.recurrenceLookaheadDays ?? null,
715
+ recurrence_lookback_days: options.recurrenceLookbackDays ?? null,
716
+ occurrence_limit: options.occurrenceLimit ?? null
717
+ };
718
+ }
719
+ function buildCalendarRangeResult(options, rangeBounds) {
720
+ return {
721
+ start: rangeBounds.start ?? null,
722
+ end: rangeBounds.end ?? null,
723
+ period_start: rangeBounds.periodStart ?? null,
724
+ period_end: rangeBounds.periodEnd ?? null,
725
+ full_period: rangeBounds.fullPeriod,
726
+ past: options.past === true,
727
+ from: options.from ?? null,
728
+ to: options.to ?? null
729
+ };
730
+ }
731
+ async function runCalendar(options, global2) {
732
+ const pmRoot = resolvePmRoot(process.cwd(), global2.path);
733
+ if (!await pathExists(getSettingsPath(pmRoot))) {
734
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
735
+ }
736
+ const inputs = resolveCalendarExecutionInputs(options);
675
737
  const settings = await readSettings(pmRoot);
676
738
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
677
739
  const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
678
740
  const runtimeFieldFilters = collectRuntimeFilterValues(options, runtimeFieldRegistry, "calendar");
679
741
  const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
680
742
  const listWarnings = [];
681
- if (eventsOnlyCapApplied) {
682
- listWarnings.push(`recurring_events_default_cap_applied:lookback=0d,lookahead=${DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS}d -- use --recurrence-lookback-days/--recurrence-lookahead-days or --to for wider range`);
683
- }
743
+ appendCalendarCapWarning(listWarnings, inputs.eventsOnlyCapApplied);
684
744
  const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);
685
745
  const filteredItems = filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldFilters);
686
- const recurringWindow = buildRecurringEventWindow(rangeBounds.start, rangeBounds.end, nowValue, recurrenceLookbackWindowDays, recurrenceLookaheadDays);
687
- const seededEvents = buildEventSeed(filteredItems, recurringWindow, includeSources, occurrenceLimit);
688
- const rangedEvents = seededEvents.filter((event) => includeEventInWindow(event, rangeBounds.start, rangeBounds.end));
689
- const limitedEvents = limit === void 0 ? rangedEvents : rangedEvents.slice(0, limit);
746
+ const recurringWindow = buildRecurringEventWindow(inputs.rangeBounds.start, inputs.rangeBounds.end, inputs.nowValue, inputs.recurrenceLookbackWindowDays, inputs.recurrenceLookaheadDays);
747
+ const seededEvents = buildEventSeed(filteredItems, recurringWindow, inputs.includeSources, inputs.occurrenceLimit);
748
+ const rangedEvents = seededEvents.filter((event) => includeEventInWindow(event, inputs.rangeBounds.start, inputs.rangeBounds.end));
749
+ const limitedEvents = inputs.limit === void 0 ? rangedEvents : rangedEvents.slice(0, inputs.limit);
690
750
  const days = bucketEventsByDay(limitedEvents);
691
751
  const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
692
752
  return {
693
- view,
753
+ view: inputs.view,
694
754
  output_default: "markdown",
695
- now: nowValue,
696
- anchor: rangeBounds.anchor,
697
- range: {
698
- start: rangeBounds.start ?? null,
699
- end: rangeBounds.end ?? null,
700
- period_start: rangeBounds.periodStart ?? null,
701
- period_end: rangeBounds.periodEnd ?? null,
702
- full_period: rangeBounds.fullPeriod,
703
- past: options.past === true,
704
- from: options.from ?? null,
705
- to: options.to ?? null
706
- },
707
- filters: {
708
- type: options.type ?? null,
709
- tag: options.tag ?? null,
710
- priority: options.priority ?? null,
711
- status: options.status ?? null,
712
- assignee: options.assignee ?? null,
713
- assignee_filter: options.assigneeFilter ?? null,
714
- sprint: options.sprint ?? null,
715
- release: options.release ?? null,
716
- runtime_filters: runtimeFieldFilters,
717
- limit: options.limit ?? null,
718
- include: options.include ?? null,
719
- full_period: options.fullPeriod === true ? "true" : null,
720
- recurrence_lookahead_days: options.recurrenceLookaheadDays ?? null,
721
- recurrence_lookback_days: options.recurrenceLookbackDays ?? null,
722
- occurrence_limit: options.occurrenceLimit ?? null
723
- },
755
+ now: inputs.nowValue,
756
+ anchor: inputs.rangeBounds.anchor,
757
+ range: buildCalendarRangeResult(options, inputs.rangeBounds),
758
+ filters: buildCalendarFiltersResult(options, runtimeFieldFilters),
724
759
  summary: summarize(limitedEvents),
725
760
  events: limitedEvents,
726
761
  days,
@@ -732,7 +767,7 @@ async function runCalendar(options, global2) {
732
767
  !(function() {
733
768
  try {
734
769
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
735
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7794eae6-2b67-5061-891e-af78b0682685");
770
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f244506b-038b-5a3d-8184-f0b73e30f300");
736
771
  } catch (e2) {
737
772
  }
738
773
  })();
@@ -1391,53 +1426,28 @@ function formatAgendaLine(event) {
1391
1426
  }
1392
1427
  return base;
1393
1428
  }
1394
- function renderContextMarkdown(result) {
1395
- const lines = [];
1396
- const focusFields = result.focus_fields;
1397
- const renderFocus = (item) => focusFields ? formatProjectedFocusLine(item, focusFields) : formatFocusLine(item);
1398
- lines.push("# pm context");
1399
- lines.push("");
1400
- lines.push(`- now: ${result.now}`);
1401
- lines.push(`- depth: ${result.depth}`);
1402
- if (result.filters.parent) {
1403
- lines.push(`- scope: subtree of ${result.filters.parent}`);
1404
- }
1405
- lines.push(`- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`);
1406
- if (result.summary.total_items !== void 0) {
1407
- lines.push(`- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`);
1408
- }
1409
- lines.push(`- agenda_events: ${result.summary.agenda_events}`);
1410
- lines.push(`- blocked_fallback_used: ${result.summary.blocked_fallback_used}`);
1411
- const renderedSections = result.sections_included.filter((section) => section !== "blockers" || (result.blockers?.length ?? 0) > 0);
1412
- if (renderedSections.length > 0) {
1413
- lines.push(`- sections: ${renderedSections.join(", ")}`);
1414
- }
1415
- lines.push("");
1416
- lines.push("## High-level focus");
1417
- if (result.high_level.length === 0) {
1418
- lines.push("No high-level active items.");
1429
+ function pushContextFocusSection(lines, title, rows, emptyText, renderFocus) {
1430
+ lines.push(`## ${title}`);
1431
+ if (rows.length === 0) {
1432
+ lines.push(emptyText);
1419
1433
  } else {
1420
- for (const item of result.high_level) {
1434
+ for (const item of rows) {
1421
1435
  lines.push(`- ${renderFocus(item)}`);
1422
1436
  }
1423
1437
  }
1424
1438
  lines.push("");
1425
- lines.push("## Low-level focus");
1426
- if (result.low_level.length === 0) {
1427
- lines.push("No low-level active items.");
1428
- } else {
1429
- for (const item of result.low_level) {
1430
- lines.push(`- ${renderFocus(item)}`);
1431
- }
1439
+ }
1440
+ function pushBlockedFallbackSection(lines, result, renderFocus) {
1441
+ if (result.blocked_fallback.length === 0) {
1442
+ return;
1432
1443
  }
1433
- lines.push("");
1434
- if (result.blocked_fallback.length > 0) {
1435
- lines.push("## Blocked fallback");
1436
- for (const item of result.blocked_fallback) {
1437
- lines.push(`- ${renderFocus(item)}`);
1438
- }
1439
- lines.push("");
1444
+ lines.push("## Blocked fallback");
1445
+ for (const item of result.blocked_fallback) {
1446
+ lines.push(`- ${renderFocus(item)}`);
1440
1447
  }
1448
+ lines.push("");
1449
+ }
1450
+ function pushAgendaSection(lines, result) {
1441
1451
  lines.push("## Agenda");
1442
1452
  lines.push(`- events: ${result.agenda.summary.events} (deadlines: ${result.agenda.summary.deadlines}, reminders: ${result.agenda.summary.reminders}, scheduled: ${result.agenda.summary.scheduled})`);
1443
1453
  if (result.agenda.events.length === 0) {
@@ -1448,205 +1458,373 @@ function renderContextMarkdown(result) {
1448
1458
  }
1449
1459
  }
1450
1460
  lines.push("");
1451
- if (result.hierarchy && result.hierarchy.length > 0) {
1452
- lines.push("## Hierarchy");
1453
- for (const node of result.hierarchy) {
1454
- const pct = node.children_total > 0 ? Math.round(node.children_closed / node.children_total * 100) : 0;
1455
- lines.push(`- ${node.id} ${node.type} ${node.status} "${node.title}" [${node.children_closed}/${node.children_total} done ${pct}%]`);
1456
- for (const child of node.children) {
1457
- const cpct = child.children_total > 0 ? Math.round(child.children_closed / child.children_total * 100) : 0;
1458
- lines.push(` - ${child.id} ${child.type} ${child.status} "${child.title}" [${child.children_closed}/${child.children_total} done ${cpct}%]`);
1459
- }
1461
+ }
1462
+ function pushHierarchySection(lines, result) {
1463
+ if (!result.hierarchy || result.hierarchy.length === 0) {
1464
+ return;
1465
+ }
1466
+ lines.push("## Hierarchy");
1467
+ for (const node of result.hierarchy) {
1468
+ const pct = node.children_total > 0 ? Math.round(node.children_closed / node.children_total * 100) : 0;
1469
+ lines.push(`- ${node.id} ${node.type} ${node.status} "${node.title}" [${node.children_closed}/${node.children_total} done ${pct}%]`);
1470
+ for (const child of node.children) {
1471
+ const cpct = child.children_total > 0 ? Math.round(child.children_closed / child.children_total * 100) : 0;
1472
+ lines.push(` - ${child.id} ${child.type} ${child.status} "${child.title}" [${child.children_closed}/${child.children_total} done ${cpct}%]`);
1460
1473
  }
1461
- lines.push("");
1462
1474
  }
1463
- if (result.progress && result.progress.length > 0) {
1464
- lines.push("## Progress");
1465
- for (const entry of result.progress) {
1466
- lines.push(`- ${entry.id} "${entry.title}" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`);
1467
- }
1468
- lines.push("");
1475
+ lines.push("");
1476
+ }
1477
+ function pushProgressSection(lines, result) {
1478
+ if (!result.progress || result.progress.length === 0) {
1479
+ return;
1469
1480
  }
1470
- if (result.recently_created && result.recently_created.length > 0) {
1471
- lines.push("## Recently created");
1472
- for (const item of result.recently_created) {
1473
- lines.push(focusFields ? `- ${renderFocus(item)}` : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`);
1474
- }
1475
- lines.push("");
1481
+ lines.push("## Progress");
1482
+ for (const entry of result.progress) {
1483
+ lines.push(`- ${entry.id} "${entry.title}" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`);
1476
1484
  }
1477
- if (result.unparented && result.unparented.length > 0) {
1478
- lines.push("## Unparented");
1479
- for (const item of result.unparented) {
1480
- lines.push(`- ${renderFocus(item)}`);
1481
- }
1482
- lines.push("");
1485
+ lines.push("");
1486
+ }
1487
+ function pushRecentlyCreatedSection(lines, result, focusFields, renderFocus) {
1488
+ if (!result.recently_created || result.recently_created.length === 0) {
1489
+ return;
1483
1490
  }
1484
- if (result.activity && result.activity.length > 0) {
1485
- lines.push("## Recent activity");
1486
- for (const entry of result.activity) {
1487
- const msg = entry.msg ? ` ${entry.msg}` : "";
1488
- lines.push(`- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`);
1489
- }
1490
- lines.push("");
1491
- }
1492
- if (result.blockers && result.blockers.length > 0) {
1493
- lines.push("## Blockers");
1494
- for (const entry of result.blockers) {
1495
- const by = entry.blocked_by ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? "?"})` : "blocked_by:-";
1496
- const reason = entry.blocked_reason ? ` reason:"${entry.blocked_reason}"` : "";
1497
- const note = entry.unblock_note ? ` unblock:"${entry.unblock_note}"` : "";
1498
- lines.push(`- ${entry.id} "${entry.title}" ${by}${reason}${note}`);
1499
- }
1500
- lines.push("");
1491
+ lines.push("## Recently created");
1492
+ for (const item of result.recently_created) {
1493
+ lines.push(focusFields ? `- ${renderFocus(item)}` : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`);
1501
1494
  }
1502
- if (result.files && result.files.length > 0) {
1503
- lines.push("## Hot files");
1504
- for (const file of result.files) {
1505
- lines.push(`- ${file.path} refs:${file.references} items:[${file.items.join(",")}]`);
1506
- }
1507
- lines.push("");
1495
+ lines.push("");
1496
+ }
1497
+ function pushUnparentedSection(lines, result, renderFocus) {
1498
+ if (!result.unparented || result.unparented.length === 0) {
1499
+ return;
1508
1500
  }
1509
- if (result.workload && result.workload.length > 0) {
1510
- lines.push("## Workload");
1511
- for (const entry of result.workload) {
1512
- const who = entry.assignee ?? "(unassigned)";
1513
- lines.push(`- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(",")}]`);
1514
- }
1515
- lines.push("");
1501
+ lines.push("## Unparented");
1502
+ for (const item of result.unparented) {
1503
+ lines.push(`- ${renderFocus(item)}`);
1516
1504
  }
1517
- if (result.staleness && result.staleness.length > 0) {
1518
- lines.push("## Stale items");
1519
- for (const entry of result.staleness) {
1520
- lines.push(`- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} "${entry.title}"`);
1521
- }
1522
- lines.push("");
1523
- }
1524
- if (result.tests) {
1525
- lines.push("## Test health");
1526
- lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);
1527
- lines.push(`- items_with_recent_runs: ${result.tests.items_with_recent_runs}`);
1528
- lines.push(`- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`);
1529
- if (result.tests.items_failing.length > 0) {
1530
- lines.push(`- items_failing: [${result.tests.items_failing.join(",")}]`);
1531
- }
1532
- lines.push("");
1505
+ lines.push("");
1506
+ }
1507
+ function pushActivitySection(lines, result) {
1508
+ if (!result.activity || result.activity.length === 0) {
1509
+ return;
1510
+ }
1511
+ lines.push("## Recent activity");
1512
+ for (const entry of result.activity) {
1513
+ const msg = entry.msg ? ` ${entry.msg}` : "";
1514
+ lines.push(`- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`);
1515
+ }
1516
+ lines.push("");
1517
+ }
1518
+ function pushBlockersSection(lines, result) {
1519
+ if (!result.blockers || result.blockers.length === 0) {
1520
+ return;
1521
+ }
1522
+ lines.push("## Blockers");
1523
+ for (const entry of result.blockers) {
1524
+ const by = entry.blocked_by ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? "?"})` : "blocked_by:-";
1525
+ const reason = entry.blocked_reason ? ` reason:"${entry.blocked_reason}"` : "";
1526
+ const note = entry.unblock_note ? ` unblock:"${entry.unblock_note}"` : "";
1527
+ lines.push(`- ${entry.id} "${entry.title}" ${by}${reason}${note}`);
1528
+ }
1529
+ lines.push("");
1530
+ }
1531
+ function pushFilesSection(lines, result) {
1532
+ if (!result.files || result.files.length === 0) {
1533
+ return;
1534
+ }
1535
+ lines.push("## Hot files");
1536
+ for (const file of result.files) {
1537
+ lines.push(`- ${file.path} refs:${file.references} items:[${file.items.join(",")}]`);
1538
+ }
1539
+ lines.push("");
1540
+ }
1541
+ function pushWorkloadSection(lines, result) {
1542
+ if (!result.workload || result.workload.length === 0) {
1543
+ return;
1544
+ }
1545
+ lines.push("## Workload");
1546
+ for (const entry of result.workload) {
1547
+ const who = entry.assignee ?? "(unassigned)";
1548
+ lines.push(`- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(",")}]`);
1549
+ }
1550
+ lines.push("");
1551
+ }
1552
+ function pushStalenessSection(lines, result) {
1553
+ if (!result.staleness || result.staleness.length === 0) {
1554
+ return;
1555
+ }
1556
+ lines.push("## Stale items");
1557
+ for (const entry of result.staleness) {
1558
+ lines.push(`- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} "${entry.title}"`);
1559
+ }
1560
+ lines.push("");
1561
+ }
1562
+ function pushTestHealthSection(lines, result) {
1563
+ if (!result.tests) {
1564
+ return;
1565
+ }
1566
+ lines.push("## Test health");
1567
+ lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);
1568
+ lines.push(`- items_with_recent_runs: ${result.tests.items_with_recent_runs}`);
1569
+ lines.push(`- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`);
1570
+ if (result.tests.items_failing.length > 0) {
1571
+ lines.push(`- items_failing: [${result.tests.items_failing.join(",")}]`);
1533
1572
  }
1573
+ lines.push("");
1574
+ }
1575
+ function pushEmptyContextSuggestions(lines, result) {
1534
1576
  const isEmpty = result.summary.active_items === 0 && result.summary.blocked === 0 && result.agenda.summary.events === 0;
1535
- if (isEmpty) {
1536
- lines.push("## Suggestions");
1537
- lines.push("No active work items or upcoming events. Consider:");
1538
- lines.push('- `pm create --type Task --title "..."` to add a new work item');
1539
- lines.push("- `pm list --status closed --limit 5` to review recent completions");
1540
- lines.push("- `pm search <keywords>` to find related past work");
1541
- lines.push("- `pm aggregate` for a full project status overview");
1577
+ if (!isEmpty) {
1578
+ return;
1542
1579
  }
1580
+ lines.push("## Suggestions");
1581
+ lines.push("No active work items or upcoming events. Consider:");
1582
+ lines.push('- `pm create --type Task --title "..."` to add a new work item');
1583
+ lines.push("- `pm list --status closed --limit 5` to review recent completions");
1584
+ lines.push("- `pm search <keywords>` to find related past work");
1585
+ lines.push("- `pm aggregate` for a full project status overview");
1586
+ }
1587
+ function renderContextMarkdown(result) {
1588
+ const lines = [];
1589
+ const focusFields = result.focus_fields;
1590
+ const renderFocus = (item) => focusFields ? formatProjectedFocusLine(item, focusFields) : formatFocusLine(item);
1591
+ lines.push("# pm context");
1592
+ lines.push("");
1593
+ lines.push(`- now: ${result.now}`);
1594
+ lines.push(`- depth: ${result.depth}`);
1595
+ if (result.filters.parent) {
1596
+ lines.push(`- scope: subtree of ${result.filters.parent}`);
1597
+ }
1598
+ lines.push(`- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`);
1599
+ if (result.summary.total_items !== void 0) {
1600
+ lines.push(`- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`);
1601
+ }
1602
+ lines.push(`- agenda_events: ${result.summary.agenda_events}`);
1603
+ lines.push(`- blocked_fallback_used: ${result.summary.blocked_fallback_used}`);
1604
+ const renderedSections = result.sections_included.filter((section) => section !== "blockers" || (result.blockers?.length ?? 0) > 0);
1605
+ if (renderedSections.length > 0) {
1606
+ lines.push(`- sections: ${renderedSections.join(", ")}`);
1607
+ }
1608
+ lines.push("");
1609
+ pushContextFocusSection(lines, "High-level focus", result.high_level, "No high-level active items.", renderFocus);
1610
+ pushContextFocusSection(lines, "Low-level focus", result.low_level, "No low-level active items.", renderFocus);
1611
+ pushBlockedFallbackSection(lines, result, renderFocus);
1612
+ pushAgendaSection(lines, result);
1613
+ pushHierarchySection(lines, result);
1614
+ pushProgressSection(lines, result);
1615
+ pushRecentlyCreatedSection(lines, result, focusFields, renderFocus);
1616
+ pushUnparentedSection(lines, result, renderFocus);
1617
+ pushActivitySection(lines, result);
1618
+ pushBlockersSection(lines, result);
1619
+ pushFilesSection(lines, result);
1620
+ pushWorkloadSection(lines, result);
1621
+ pushStalenessSection(lines, result);
1622
+ pushTestHealthSection(lines, result);
1623
+ pushEmptyContextSuggestions(lines, result);
1543
1624
  return lines.join("\n");
1544
1625
  }
1545
- async function runContext(options, global2) {
1626
+ async function resolveContextRuntime(options, global2) {
1546
1627
  const pmRoot = resolvePmRoot(process.cwd(), global2.path);
1547
1628
  const settings = await readSettings(pmRoot);
1548
1629
  const contextSettings = settings.context ?? SETTINGS_DEFAULTS.context;
1549
1630
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1550
1631
  const depth = parseContextDepth(options.depth, contextSettings);
1551
- const limit = parseContextLimit(options.limit, depth);
1552
- const sectionsIncluded = parseContextSections(options.section, depth, contextSettings);
1553
- const activityLimit = parseActivityLimit(options.activityLimit, contextSettings);
1554
- const staleThresholdDays = parseStaleThresholdDays(options.staleThreshold, contextSettings);
1555
- const parentScope = parseContextParent(options.parent);
1556
- const focusFields = parseContextFocusFields(options.fields);
1557
- const needsAllItems = sectionsIncluded.some((s) => ["hierarchy", "progress", "blockers", "staleness", "recently_created", "unparented"].includes(s));
1558
- const baseListOptions = stripListProjectionFlags(options);
1559
- const unpaginatedListOptions = (extra) => ({
1632
+ return {
1633
+ settings,
1634
+ contextSettings,
1635
+ statusRegistry,
1636
+ depth,
1637
+ limit: parseContextLimit(options.limit, depth),
1638
+ sectionsIncluded: parseContextSections(options.section, depth, contextSettings),
1639
+ activityLimit: parseActivityLimit(options.activityLimit, contextSettings),
1640
+ staleThresholdDays: parseStaleThresholdDays(options.staleThreshold, contextSettings),
1641
+ parentScope: parseContextParent(options.parent),
1642
+ focusFields: parseContextFocusFields(options.fields),
1643
+ baseListOptions: stripListProjectionFlags(options)
1644
+ };
1645
+ }
1646
+ function contextNeedsAllItems(sectionsIncluded) {
1647
+ return sectionsIncluded.some((section) => ["hierarchy", "progress", "blockers", "staleness", "recently_created", "unparented"].includes(section));
1648
+ }
1649
+ function buildUnpaginatedContextListOptions(baseListOptions, extra) {
1650
+ return {
1560
1651
  ...baseListOptions,
1561
1652
  ...extra,
1562
1653
  noTruncate: true,
1563
1654
  limit: void 0,
1564
1655
  offset: void 0
1565
- });
1566
- const listOptions = parentScope === void 0 ? { ...baseListOptions, excludeTerminal: true } : unpaginatedListOptions({ excludeTerminal: true });
1656
+ };
1657
+ }
1658
+ async function loadContextCorpus(options, global2, runtime) {
1659
+ const needsAllItems = contextNeedsAllItems(runtime.sectionsIncluded);
1660
+ const listOptions = runtime.parentScope === void 0 ? { ...runtime.baseListOptions, excludeTerminal: true } : buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: true });
1567
1661
  const listed = await runList(void 0, listOptions, global2);
1568
1662
  let listedFrontMatter = listed.items;
1569
1663
  let allItems = listedFrontMatter;
1570
- if (needsAllItems || parentScope !== void 0) {
1571
- const allListed = await runList(void 0, unpaginatedListOptions({ excludeTerminal: false }), global2);
1664
+ if (needsAllItems || runtime.parentScope !== void 0) {
1665
+ const allListed = await runList(void 0, buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: false }), global2);
1572
1666
  allItems = allListed.items;
1573
1667
  }
1574
1668
  const fullCorpus = allItems;
1575
- let subtreeIds;
1576
- if (parentScope !== void 0) {
1577
- const subtree = collectSubtreeIds(fullCorpus, parentScope);
1578
- if (!subtree.found) {
1579
- throw new PmCliError(`Context --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
1580
- }
1581
- subtreeIds = subtree.ids;
1582
- listedFrontMatter = listedFrontMatter.filter((item) => subtreeIds?.has(item.id.trim().toLowerCase()));
1583
- allItems = allItems.filter((item) => subtreeIds?.has(item.id.trim().toLowerCase()));
1669
+ const subtreeIds = resolveContextSubtreeIds(runtime.parentScope, fullCorpus);
1670
+ if (subtreeIds) {
1671
+ listedFrontMatter = listedFrontMatter.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
1672
+ allItems = allItems.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
1584
1673
  }
1674
+ return { listed, listedFrontMatter, allItems, fullCorpus, subtreeIds };
1675
+ }
1676
+ function resolveContextSubtreeIds(parentScope, fullCorpus) {
1677
+ if (parentScope === void 0) {
1678
+ return void 0;
1679
+ }
1680
+ const subtree = collectSubtreeIds(fullCorpus, parentScope);
1681
+ if (!subtree.found) {
1682
+ throw new PmCliError(`Context --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
1683
+ }
1684
+ return subtree.ids;
1685
+ }
1686
+ function resolveContextFocusGroups(listedFrontMatter, allItems, statusRegistry, sectionsIncluded, limit) {
1585
1687
  const ranked = [...listedFrontMatter].sort((left, right) => compareCriticalItems(left, right, statusRegistry));
1586
- const activeStatuses = statusRegistry.active_statuses.size > 0 ? statusRegistry.active_statuses : /* @__PURE__ */ new Set([statusRegistry.open_status]);
1587
- const blockedStatuses = statusRegistry.blocked_statuses;
1688
+ const activeStatuses = statusRegistry.active_statuses;
1588
1689
  const activeItems = ranked.filter((item) => activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1589
- const blockedItems = ranked.filter((item) => blockedStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1690
+ const blockedItems = ranked.filter((item) => statusRegistry.blocked_statuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1590
1691
  const childrenByParent = buildChildrenByParent(allItems);
1591
- const focusChildrenByParent = needsAllItems ? childrenByParent : void 0;
1692
+ const focusChildrenByParent = contextNeedsAllItems(sectionsIncluded) ? childrenByParent : void 0;
1592
1693
  const highLevel = activeItems.filter((item) => HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
1593
1694
  const lowLevel = activeItems.filter((item) => !HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
1594
1695
  const blockedFallbackUsed = activeItems.length === 0;
1595
- const blockedFallback = blockedFallbackUsed ? blockedItems.slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent)) : [];
1696
+ return {
1697
+ activeItems,
1698
+ blockedItems,
1699
+ highLevel,
1700
+ lowLevel,
1701
+ blockedFallback: blockedFallbackUsed ? blockedItems.slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent)) : [],
1702
+ blockedFallbackUsed
1703
+ };
1704
+ }
1705
+ async function buildContextAgenda(options, global2, runtime, subtreeIds) {
1596
1706
  const calendarOptions = {
1597
- ...baseListOptions,
1707
+ ...runtime.baseListOptions,
1598
1708
  view: "agenda",
1599
1709
  include: "all",
1600
- // When scoping to a subtree, pull the full agenda so the subtree filter sees
1601
- // every candidate event before the final per-section slice.
1602
- limit: parentScope === void 0 ? String(limit) : void 0
1710
+ limit: runtime.parentScope === void 0 ? String(runtime.limit) : void 0
1603
1711
  };
1604
1712
  const agenda = await runCalendar(calendarOptions, global2);
1605
1713
  const scopedAgenda = subtreeIds === void 0 ? agenda.events : agenda.events.filter((event) => subtreeIds.has(event.item_id.trim().toLowerCase()));
1606
- const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, statusRegistry).slice(0, limit);
1607
- const agendaSummary = summarizeAgenda(agendaEvents);
1608
- const warnings = mergeSortedWarnings(listed.warnings, agenda.warnings);
1609
- const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
1610
- const openStatus = normalizeStatusInput("open", statusRegistry);
1611
- const inProgressCount = activeItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).length;
1612
- const openCount = activeItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === openStatus).length;
1613
- const now = agenda.now;
1614
- const itemMap = /* @__PURE__ */ new Map();
1615
- for (const item of fullCorpus) {
1616
- itemMap.set(item.id, item);
1714
+ const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, runtime.statusRegistry).slice(0, runtime.limit);
1715
+ return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };
1716
+ }
1717
+ function countContextStatus(items, status, statusRegistry) {
1718
+ const targetStatus = String(status);
1719
+ return items.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === targetStatus).length;
1720
+ }
1721
+ async function buildOptionalContextSections(params) {
1722
+ const { runtime, allItems, fullCorpus, focusGroups, now, global: global2 } = params;
1723
+ const childrenByParent = buildChildrenByParent(allItems);
1724
+ const itemMap = new Map(fullCorpus.map((item) => [item.id, item]));
1725
+ const allNonTerminal = allItems.filter((item) => !isTerminalStatus(item.status, runtime.statusRegistry));
1726
+ const has = (section) => runtime.sectionsIncluded.includes(section);
1727
+ return {
1728
+ hierarchy: has("hierarchy") ? buildHierarchy(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1729
+ activity: has("activity") ? await buildActivity(runtime.activityLimit, global2) : void 0,
1730
+ progress: has("progress") ? buildProgress(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1731
+ blockersSection: has("blockers") ? buildBlockers(focusGroups.blockedItems, itemMap, runtime.limit) : void 0,
1732
+ recentlyCreated: has("recently_created") ? buildRecentlyCreated(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
1733
+ unparented: has("unparented") ? buildUnparented(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
1734
+ filesSection: has("files") ? buildHotFiles(focusGroups.activeItems, runtime.limit) : void 0,
1735
+ workload: has("workload") ? buildWorkload(focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1736
+ staleness: has("staleness") ? buildStaleness(allNonTerminal, runtime.staleThresholdDays, now, runtime.limit) : void 0,
1737
+ tests: has("tests") ? buildTestHealth(focusGroups.activeItems) : void 0
1738
+ };
1739
+ }
1740
+ function buildContextSummaryExtras(needsAllItems, allItems, statusRegistry) {
1741
+ if (!needsAllItems) {
1742
+ return {};
1617
1743
  }
1618
- const allNonTerminal = allItems.filter((item) => !isTerminalStatus(item.status, statusRegistry));
1619
- const has = (section) => sectionsIncluded.includes(section);
1620
- const hierarchy = has("hierarchy") ? buildHierarchy(allItems, activeItems, statusRegistry, limit) : void 0;
1621
- const activity = has("activity") ? await buildActivity(activityLimit, global2) : void 0;
1622
- const progress = has("progress") ? buildProgress(allItems, activeItems, statusRegistry, limit) : void 0;
1623
- const blockersSection = has("blockers") ? buildBlockers(blockedItems, itemMap, limit) : void 0;
1624
- const recentlyCreated = has("recently_created") ? buildRecentlyCreated(allNonTerminal, statusRegistry, childrenByParent, limit) : void 0;
1625
- const unparented = has("unparented") ? buildUnparented(allNonTerminal, statusRegistry, childrenByParent, limit) : void 0;
1626
- const filesSection = has("files") ? buildHotFiles(activeItems, limit) : void 0;
1627
- const workload = has("workload") ? buildWorkload(activeItems, statusRegistry, limit) : void 0;
1628
- const staleness = has("staleness") ? buildStaleness(allNonTerminal, staleThresholdDays, now, limit) : void 0;
1629
- const tests = has("tests") ? buildTestHealth(activeItems) : void 0;
1630
- const summaryExtras = needsAllItems ? {
1744
+ const canceledStatus = normalizeStatusInput("canceled", statusRegistry);
1745
+ return {
1631
1746
  total_items: allItems.length,
1632
- closed: allItems.filter((i) => isClosedStatus(i.status, statusRegistry)).length,
1633
- canceled: allItems.filter((i) => {
1634
- const canceledStatus = normalizeStatusInput("canceled", statusRegistry);
1635
- return normalizeStatusForRegistry(i.status, statusRegistry) === canceledStatus;
1636
- }).length
1637
- } : {};
1747
+ closed: allItems.filter((item) => isClosedStatus(item.status, statusRegistry)).length,
1748
+ canceled: allItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === canceledStatus).length
1749
+ };
1750
+ }
1751
+ function attachOptionalContextSections(result, sections) {
1752
+ if (sections.hierarchy)
1753
+ result.hierarchy = sections.hierarchy;
1754
+ if (sections.activity)
1755
+ result.activity = sections.activity;
1756
+ if (sections.progress)
1757
+ result.progress = sections.progress;
1758
+ if (sections.blockersSection)
1759
+ result.blockers = sections.blockersSection;
1760
+ if (sections.recentlyCreated)
1761
+ result.recently_created = sections.recentlyCreated;
1762
+ if (sections.unparented)
1763
+ result.unparented = sections.unparented;
1764
+ if (sections.filesSection)
1765
+ result.files = sections.filesSection;
1766
+ if (sections.workload)
1767
+ result.workload = sections.workload;
1768
+ if (sections.staleness)
1769
+ result.staleness = sections.staleness;
1770
+ if (sections.tests)
1771
+ result.tests = sections.tests;
1772
+ }
1773
+ function applyContextFocusProjection(result, focusFields) {
1774
+ if (!focusFields) {
1775
+ return;
1776
+ }
1777
+ result.focus_fields = focusFields;
1778
+ result.high_level = projectContextFocusRows(result.high_level, focusFields);
1779
+ result.low_level = projectContextFocusRows(result.low_level, focusFields);
1780
+ result.blocked_fallback = projectContextFocusRows(result.blocked_fallback, focusFields);
1781
+ if (result.recently_created) {
1782
+ result.recently_created = projectContextFocusRows(result.recently_created, focusFields);
1783
+ }
1784
+ if (result.unparented) {
1785
+ result.unparented = projectContextFocusRows(result.unparented, focusFields);
1786
+ }
1787
+ }
1788
+ function maybeAttachEmptyContextSuggestions(result, activeItems, blockedItems) {
1789
+ if (activeItems.length > 0 || blockedItems.length > 0 || result.agenda.events.length > 0) {
1790
+ return;
1791
+ }
1792
+ result.suggestions = [
1793
+ 'pm create --type Task --title "..." to add a new work item',
1794
+ "pm list --status closed --limit 5 to review recent completions",
1795
+ "pm search <keywords> to find related past work",
1796
+ "pm aggregate for a full project status overview"
1797
+ ];
1798
+ }
1799
+ async function runContext(options, global2) {
1800
+ const runtime = await resolveContextRuntime(options, global2);
1801
+ const corpus = await loadContextCorpus(options, global2, runtime);
1802
+ const focusGroups = resolveContextFocusGroups(corpus.listedFrontMatter, corpus.allItems, runtime.statusRegistry, runtime.sectionsIncluded, runtime.limit);
1803
+ const agendaContext = await buildContextAgenda(options, global2, runtime, corpus.subtreeIds);
1804
+ const warnings = mergeSortedWarnings(corpus.listed.warnings, agendaContext.agenda.warnings);
1805
+ const inProgressCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("in_progress", runtime.statusRegistry), runtime.statusRegistry);
1806
+ const openCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("open", runtime.statusRegistry), runtime.statusRegistry);
1807
+ const sections = await buildOptionalContextSections({
1808
+ runtime,
1809
+ allItems: corpus.allItems,
1810
+ fullCorpus: corpus.fullCorpus,
1811
+ focusGroups,
1812
+ now: agendaContext.agenda.now,
1813
+ global: global2
1814
+ });
1815
+ const summaryExtras = buildContextSummaryExtras(contextNeedsAllItems(runtime.sectionsIncluded), corpus.allItems, runtime.statusRegistry);
1638
1816
  const result = {
1639
1817
  output_default: "toon",
1640
- now,
1641
- depth,
1642
- sections_included: sectionsIncluded,
1818
+ now: agendaContext.agenda.now,
1819
+ depth: runtime.depth,
1820
+ sections_included: runtime.sectionsIncluded,
1643
1821
  window: {
1644
- anchor: agenda.anchor,
1645
- start: agenda.range.start,
1646
- end: agenda.range.end,
1647
- past: agenda.range.past,
1648
- from: agenda.range.from,
1649
- to: agenda.range.to
1822
+ anchor: agendaContext.agenda.anchor,
1823
+ start: agendaContext.agenda.range.start,
1824
+ end: agendaContext.agenda.range.end,
1825
+ past: agendaContext.agenda.range.past,
1826
+ from: agendaContext.agenda.range.from,
1827
+ to: agendaContext.agenda.range.to
1650
1828
  },
1651
1829
  filters: {
1652
1830
  type: options.type ?? null,
@@ -1657,71 +1835,34 @@ async function runContext(options, global2) {
1657
1835
  sprint: options.sprint ?? null,
1658
1836
  release: options.release ?? null,
1659
1837
  limit: options.limit ?? null,
1660
- parent: parentScope ?? null,
1838
+ parent: runtime.parentScope ?? null,
1661
1839
  /* c8 ignore next -- listed/calendar runtime filters are always materialized by their command handlers */
1662
- runtime_filters: listed.filters.runtime_filters ?? agenda.filters.runtime_filters ?? {}
1840
+ runtime_filters: corpus.listed.filters.runtime_filters ?? agendaContext.agenda.filters.runtime_filters ?? {}
1663
1841
  },
1664
1842
  summary: {
1665
- active_items: activeItems.length,
1843
+ active_items: focusGroups.activeItems.length,
1666
1844
  in_progress: inProgressCount,
1667
1845
  open: openCount,
1668
- blocked: blockedItems.length,
1669
- blocked_fallback_used: blockedFallbackUsed,
1670
- high_level: highLevel.length,
1671
- low_level: lowLevel.length,
1672
- agenda_events: agendaSummary.events,
1846
+ blocked: focusGroups.blockedItems.length,
1847
+ blocked_fallback_used: focusGroups.blockedFallbackUsed,
1848
+ high_level: focusGroups.highLevel.length,
1849
+ low_level: focusGroups.lowLevel.length,
1850
+ agenda_events: agendaContext.agendaSummary.events,
1673
1851
  ...summaryExtras
1674
1852
  },
1675
- high_level: highLevel,
1676
- low_level: lowLevel,
1677
- blocked_fallback: blockedFallback,
1853
+ high_level: focusGroups.highLevel,
1854
+ low_level: focusGroups.lowLevel,
1855
+ blocked_fallback: focusGroups.blockedFallback,
1678
1856
  agenda: {
1679
- summary: agendaSummary,
1680
- events: agendaEvents
1857
+ summary: agendaContext.agendaSummary,
1858
+ events: agendaContext.agendaEvents
1681
1859
  }
1682
1860
  };
1683
- if (hierarchy)
1684
- result.hierarchy = hierarchy;
1685
- if (activity)
1686
- result.activity = activity;
1687
- if (progress)
1688
- result.progress = progress;
1689
- if (blockersSection)
1690
- result.blockers = blockersSection;
1691
- if (recentlyCreated)
1692
- result.recently_created = recentlyCreated;
1693
- if (unparented)
1694
- result.unparented = unparented;
1695
- if (filesSection)
1696
- result.files = filesSection;
1697
- if (workload)
1698
- result.workload = workload;
1699
- if (staleness)
1700
- result.staleness = staleness;
1701
- if (tests)
1702
- result.tests = tests;
1703
- if (focusFields) {
1704
- result.focus_fields = focusFields;
1705
- result.high_level = projectContextFocusRows(result.high_level, focusFields);
1706
- result.low_level = projectContextFocusRows(result.low_level, focusFields);
1707
- result.blocked_fallback = projectContextFocusRows(result.blocked_fallback, focusFields);
1708
- if (result.recently_created) {
1709
- result.recently_created = projectContextFocusRows(result.recently_created, focusFields);
1710
- }
1711
- if (result.unparented) {
1712
- result.unparented = projectContextFocusRows(result.unparented, focusFields);
1713
- }
1714
- }
1861
+ attachOptionalContextSections(result, sections);
1862
+ applyContextFocusProjection(result, runtime.focusFields);
1715
1863
  if (warnings.length > 0)
1716
1864
  result.warnings = warnings;
1717
- if (activeItems.length === 0 && blockedItems.length === 0 && agendaEvents.length === 0) {
1718
- result.suggestions = [
1719
- 'pm create --type Task --title "..." to add a new work item',
1720
- "pm list --status closed --limit 5 to review recent completions",
1721
- "pm search <keywords> to find related past work",
1722
- "pm aggregate for a full project status overview"
1723
- ];
1724
- }
1865
+ maybeAttachEmptyContextSuggestions(result, focusGroups.activeItems, focusGroups.blockedItems);
1725
1866
  return result;
1726
1867
  }
1727
1868
 
@@ -1740,4 +1881,4 @@ export {
1740
1881
  renderContextMarkdown,
1741
1882
  runContext
1742
1883
  };
1743
- //# sourceMappingURL=chunk-DJDXAU74.js.map
1884
+ //# sourceMappingURL=chunk-XEWQKDYZ.js.map