@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,31 +1,31 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a060da65-925f-55ab-b13e-d07fceedaeaf")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="95fd55ba-b62a-5ca4-8d6a-02955d7b5692")}catch(e){}}();
3
3
  import {
4
4
  runActivity
5
- } from "./chunk-FBZ5XAAF.js";
5
+ } from "./chunk-YPKFV2JR.js";
6
6
  import {
7
7
  collectRuntimeFilterValues,
8
8
  matchesRuntimeFilters,
9
9
  runList
10
- } from "./chunk-ZIE6WXJ2.js";
10
+ } from "./chunk-Q6K2OACU.js";
11
11
  import {
12
12
  parseIntegerLimit,
13
13
  parsePriority,
14
14
  parseType
15
- } from "./chunk-JVQ7UOYC.js";
15
+ } from "./chunk-2CHRYUXL.js";
16
16
  import {
17
17
  listAllFrontMatterLight
18
- } from "./chunk-KGQ3W65B.js";
18
+ } from "./chunk-NRZS637N.js";
19
19
  import {
20
20
  isTerminalStatus,
21
21
  normalizeStatusForRegistry,
22
22
  normalizeStatusInput
23
- } from "./chunk-V3KLX7U7.js";
23
+ } from "./chunk-KN3URLKS.js";
24
24
  import {
25
25
  compareTimestampStrings,
26
26
  nowIso,
27
27
  resolveIsoOrRelative
28
- } from "./chunk-KRASIL6M.js";
28
+ } from "./chunk-K2VYLVX4.js";
29
29
  import {
30
30
  CONTEXT_DEPTH_VALUES,
31
31
  CONTEXT_SECTION_VALUES,
@@ -42,7 +42,7 @@ import {
42
42
  resolveRuntimeFieldRegistry,
43
43
  resolveRuntimeStatusRegistry,
44
44
  weekdayOrderIndex
45
- } from "./chunk-CY5IJMUM.js";
45
+ } from "./chunk-I66WE2HE.js";
46
46
 
47
47
  // dist/cli/commands/calendar.js
48
48
  import { encode as encodeToon } from "@toon-format/toon";
@@ -249,122 +249,130 @@ function buildRecurringEventWindow(start, end, nowValue, lookbackDays, lookahead
249
249
  end: compareTimestampStrings(windowEnd, windowStart) > 0 ? windowEnd : addUtcDays(windowStart, 1)
250
250
  };
251
251
  }
252
- function expandRecurringOccurrences(startAt, recurrence, window, occurrenceLimit) {
253
- const maxOccurrences = occurrenceLimit ?? MAX_RECURRENCE_OCCURRENCES;
254
- const interval = recurrence.interval ?? 1;
255
- const countLimit = recurrence.count ?? Number.POSITIVE_INFINITY;
256
- const until = recurrence.until;
257
- const excluded = buildExcludedInstantSet(recurrence.exdates);
258
- const recurrenceWeekdays = recurrence.by_weekday && recurrence.by_weekday.length > 0 ? [...recurrence.by_weekday] : [weekdayToken(startAt)];
259
- const recurrenceMonthDays = recurrence.by_month_day && recurrence.by_month_day.length > 0 ? [...recurrence.by_month_day] : [new Date(startAt).getUTCDate()];
260
- const weekdayFilter = recurrence.by_weekday ? new Set(recurrence.by_weekday) : void 0;
261
- const monthDayFilter = recurrence.by_month_day ? new Set(recurrence.by_month_day) : void 0;
262
- const sortedWeekdays = [...new Set(recurrenceWeekdays)].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));
263
- const sortedMonthDays = [...new Set(recurrenceMonthDays)].sort((left, right) => left - right);
264
- const occurrences = [];
265
- let produced = 0;
266
- const consumeCandidate = (candidateAt) => {
267
- if (compareTimestampStrings(candidateAt, startAt) < 0) {
268
- return "continue";
269
- }
270
- if (until && compareTimestampStrings(candidateAt, until) > 0) {
271
- return "stop";
272
- }
273
- if (compareTimestampStrings(candidateAt, window.end) >= 0) {
274
- return "stop";
275
- }
276
- if (excluded.has(candidateAt)) {
277
- return "continue";
278
- }
279
- produced += 1;
280
- if (compareTimestampStrings(candidateAt, window.start) >= 0) {
281
- occurrences.push(candidateAt);
282
- }
283
- if (produced >= countLimit) {
284
- return "stop";
285
- }
286
- return "continue";
252
+ function buildRecurrenceExpansionContext(startAt, recurrence, window, occurrenceLimit) {
253
+ const recurrenceWeekdays = recurrence.by_weekday !== void 0 ? [...recurrence.by_weekday] : [weekdayToken(startAt)];
254
+ const recurrenceMonthDays = recurrence.by_month_day !== void 0 ? [...recurrence.by_month_day] : [new Date(startAt).getUTCDate()];
255
+ return {
256
+ startAt,
257
+ startDate: new Date(startAt),
258
+ window,
259
+ maxOccurrences: occurrenceLimit ?? MAX_RECURRENCE_OCCURRENCES,
260
+ interval: recurrence.interval ?? 1,
261
+ countLimit: recurrence.count ?? Number.POSITIVE_INFINITY,
262
+ until: recurrence.until,
263
+ excluded: buildExcludedInstantSet(recurrence.exdates),
264
+ weekdayFilter: recurrence.by_weekday !== void 0 ? new Set(recurrence.by_weekday) : void 0,
265
+ monthDayFilter: recurrence.by_month_day !== void 0 ? new Set(recurrence.by_month_day) : void 0,
266
+ sortedWeekdays: [...new Set(recurrenceWeekdays)].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right)),
267
+ sortedMonthDays: [...new Set(recurrenceMonthDays)].sort((left, right) => left - right),
268
+ occurrences: [],
269
+ produced: 0
287
270
  };
288
- const startDate = new Date(startAt);
289
- if (recurrence.freq === "daily") {
290
- let candidateAt = startAt;
291
- for (let iteration = 0; iteration < maxOccurrences; iteration += 1) {
292
- const candidateWeekday = weekdayToken(candidateAt);
293
- const candidateMonthDay = new Date(candidateAt).getUTCDate();
294
- const weekdayMatches = !weekdayFilter || weekdayFilter.has(candidateWeekday);
295
- const monthDayMatches = !monthDayFilter || monthDayFilter.has(candidateMonthDay);
296
- if (weekdayMatches && monthDayMatches && consumeCandidate(candidateAt) === "stop") {
297
- break;
298
- }
299
- candidateAt = addUtcDays(candidateAt, interval);
300
- }
301
- return occurrences;
271
+ }
272
+ function consumeRecurrenceCandidate(context, candidateAt) {
273
+ if (compareTimestampStrings(candidateAt, context.startAt) < 0) {
274
+ return "continue";
302
275
  }
303
- if (recurrence.freq === "weekly") {
304
- const weekStart = startOfUtcWeekMonday(startAt);
305
- for (let step = 0; step < maxOccurrences; step += 1) {
306
- const candidateWeekStart = addUtcDays(weekStart, step * interval * 7);
307
- for (const weekday of sortedWeekdays) {
308
- const dayOffset = weekdayOrderIndex(weekday);
309
- const candidateDay = addUtcDays(candidateWeekStart, dayOffset);
310
- const dayDate = new Date(candidateDay);
311
- const candidateAt = new Date(Date.UTC(dayDate.getUTCFullYear(), dayDate.getUTCMonth(), dayDate.getUTCDate(), startDate.getUTCHours(), startDate.getUTCMinutes(), startDate.getUTCSeconds(), startDate.getUTCMilliseconds())).toISOString();
312
- const candidateMonthDay = dayDate.getUTCDate();
313
- if (monthDayFilter && !monthDayFilter.has(candidateMonthDay)) {
314
- continue;
315
- }
316
- const consumed = consumeCandidate(candidateAt);
317
- if (consumed === "stop") {
318
- return occurrences;
319
- }
320
- }
321
- }
322
- return occurrences;
276
+ if (context.until && compareTimestampStrings(candidateAt, context.until) > 0) {
277
+ return "stop";
323
278
  }
324
- if (recurrence.freq === "monthly") {
325
- const startYear = startDate.getUTCFullYear();
326
- const startMonth = startDate.getUTCMonth();
327
- for (let step = 0; step < maxOccurrences; step += 1) {
328
- const monthAnchor = new Date(Date.UTC(startYear, startMonth + step * interval, 1, 0, 0, 0, 0));
329
- const year2 = monthAnchor.getUTCFullYear();
330
- const month2 = monthAnchor.getUTCMonth();
331
- for (const monthDay of sortedMonthDays) {
332
- const candidateAt = buildUtcTimestamp(year2, month2, monthDay, startDate);
333
- if (!candidateAt) {
334
- continue;
335
- }
336
- const candidateWeekday = weekdayToken(candidateAt);
337
- if (weekdayFilter && !weekdayFilter.has(candidateWeekday)) {
338
- continue;
339
- }
340
- const consumed = consumeCandidate(candidateAt);
341
- if (consumed === "stop") {
342
- return occurrences;
343
- }
279
+ if (compareTimestampStrings(candidateAt, context.window.end) >= 0) {
280
+ return "stop";
281
+ }
282
+ if (context.excluded.has(candidateAt)) {
283
+ return "continue";
284
+ }
285
+ context.produced += 1;
286
+ if (compareTimestampStrings(candidateAt, context.window.start) >= 0) {
287
+ context.occurrences.push(candidateAt);
288
+ }
289
+ return context.produced >= context.countLimit || context.occurrences.length >= context.maxOccurrences ? "stop" : "continue";
290
+ }
291
+ function recurrenceDayMatchesFilters(context, candidateAt) {
292
+ const candidateWeekday = weekdayToken(candidateAt);
293
+ const candidateMonthDay = new Date(candidateAt).getUTCDate();
294
+ const weekdayMatches = !context.weekdayFilter || context.weekdayFilter.has(candidateWeekday);
295
+ const monthDayMatches = !context.monthDayFilter || context.monthDayFilter.has(candidateMonthDay);
296
+ return weekdayMatches && monthDayMatches;
297
+ }
298
+ function expandDailyOccurrences(context) {
299
+ let candidateAt = context.startAt;
300
+ for (let iteration = 0; iteration < context.maxOccurrences; iteration += 1) {
301
+ if (recurrenceDayMatchesFilters(context, candidateAt) && consumeRecurrenceCandidate(context, candidateAt) === "stop") {
302
+ break;
303
+ }
304
+ candidateAt = addUtcDays(candidateAt, context.interval);
305
+ }
306
+ return context.occurrences;
307
+ }
308
+ function buildWeeklyCandidateAt(context, candidateWeekStart, weekday) {
309
+ const dayOffset = weekdayOrderIndex(weekday);
310
+ const candidateDay = addUtcDays(candidateWeekStart, dayOffset);
311
+ const dayDate = new Date(candidateDay);
312
+ return new Date(Date.UTC(dayDate.getUTCFullYear(), dayDate.getUTCMonth(), dayDate.getUTCDate(), context.startDate.getUTCHours(), context.startDate.getUTCMinutes(), context.startDate.getUTCSeconds(), context.startDate.getUTCMilliseconds())).toISOString();
313
+ }
314
+ function expandWeeklyOccurrences(context) {
315
+ const weekStart = startOfUtcWeekMonday(context.startAt);
316
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
317
+ const candidateWeekStart = addUtcDays(weekStart, step * context.interval * 7);
318
+ for (const weekday of context.sortedWeekdays) {
319
+ const candidateAt = buildWeeklyCandidateAt(context, candidateWeekStart, weekday);
320
+ if (!recurrenceDayMatchesFilters(context, candidateAt)) {
321
+ continue;
322
+ }
323
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
324
+ return context.occurrences;
344
325
  }
345
326
  }
346
- return occurrences;
347
- }
348
- const year = startDate.getUTCFullYear();
349
- const month = startDate.getUTCMonth();
350
- for (let step = 0; step < maxOccurrences; step += 1) {
351
- const candidateYear = year + step * interval;
352
- for (const monthDay of sortedMonthDays) {
353
- const candidateAt = buildUtcTimestamp(candidateYear, month, monthDay, startDate);
354
- if (!candidateAt) {
327
+ }
328
+ return context.occurrences;
329
+ }
330
+ function expandMonthlyOccurrences(context) {
331
+ const startYear = context.startDate.getUTCFullYear();
332
+ const startMonth = context.startDate.getUTCMonth();
333
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
334
+ const monthAnchor = new Date(Date.UTC(startYear, startMonth + step * context.interval, 1, 0, 0, 0, 0));
335
+ for (const monthDay of context.sortedMonthDays) {
336
+ const candidateAt = buildUtcTimestamp(monthAnchor.getUTCFullYear(), monthAnchor.getUTCMonth(), monthDay, context.startDate);
337
+ if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
355
338
  continue;
356
339
  }
357
- const candidateWeekday = weekdayToken(candidateAt);
358
- if (weekdayFilter && !weekdayFilter.has(candidateWeekday)) {
340
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
341
+ return context.occurrences;
342
+ }
343
+ }
344
+ }
345
+ return context.occurrences;
346
+ }
347
+ function expandYearlyOccurrences(context) {
348
+ const year = context.startDate.getUTCFullYear();
349
+ const month = context.startDate.getUTCMonth();
350
+ for (let step = 0; step < context.maxOccurrences; step += 1) {
351
+ const candidateYear = year + step * context.interval;
352
+ for (const monthDay of context.sortedMonthDays) {
353
+ const candidateAt = buildUtcTimestamp(candidateYear, month, monthDay, context.startDate);
354
+ if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
359
355
  continue;
360
356
  }
361
- const consumed = consumeCandidate(candidateAt);
362
- if (consumed === "stop") {
363
- return occurrences;
357
+ if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
358
+ return context.occurrences;
364
359
  }
365
360
  }
366
361
  }
367
- return occurrences;
362
+ return context.occurrences;
363
+ }
364
+ function expandRecurringOccurrences(startAt, recurrence, window, occurrenceLimit) {
365
+ const context = buildRecurrenceExpansionContext(startAt, recurrence, window, occurrenceLimit);
366
+ if (recurrence.freq === "daily") {
367
+ return expandDailyOccurrences(context);
368
+ }
369
+ if (recurrence.freq === "weekly") {
370
+ return expandWeeklyOccurrences(context);
371
+ }
372
+ if (recurrence.freq === "monthly") {
373
+ return expandMonthlyOccurrences(context);
374
+ }
375
+ return expandYearlyOccurrences(context);
368
376
  }
369
377
  function sortEvents(values) {
370
378
  return [...values].sort((a, b) => {
@@ -386,92 +394,98 @@ function sortEvents(values) {
386
394
  return String(a.reminder_text).localeCompare(String(b.reminder_text));
387
395
  });
388
396
  }
397
+ function buildItemCalendarRowBase(item) {
398
+ return {
399
+ item_id: item.id,
400
+ item_title: item.title,
401
+ item_type: item.type,
402
+ item_status: item.status,
403
+ item_priority: item.priority,
404
+ item_assignee: item.assignee ?? null,
405
+ item_deadline: item.deadline ?? null,
406
+ item_tags: item.tags
407
+ };
408
+ }
409
+ function buildDeadlineRow(item) {
410
+ if (!item.deadline) {
411
+ return null;
412
+ }
413
+ return {
414
+ at: item.deadline,
415
+ date: toUtcDayKey(item.deadline),
416
+ kind: "deadline",
417
+ reminder_text: null,
418
+ event_title: null,
419
+ event_end: null,
420
+ event_location: null,
421
+ event_all_day: null,
422
+ event_timezone: null,
423
+ event_recurring: null,
424
+ event_recurrence_rule: null,
425
+ ...buildItemCalendarRowBase(item),
426
+ item_deadline: item.deadline
427
+ };
428
+ }
429
+ function buildReminderRows(item) {
430
+ return (item.reminders ?? []).map((reminder) => ({
431
+ at: reminder.at,
432
+ date: toUtcDayKey(reminder.at),
433
+ kind: "reminder",
434
+ reminder_text: reminder.text,
435
+ event_title: null,
436
+ event_end: null,
437
+ event_location: null,
438
+ event_all_day: null,
439
+ event_timezone: null,
440
+ event_recurring: null,
441
+ event_recurrence_rule: null,
442
+ ...buildItemCalendarRowBase(item)
443
+ }));
444
+ }
445
+ function recurringDurationMs(startAt, endAt) {
446
+ if (!endAt) {
447
+ return null;
448
+ }
449
+ const duration = Date.parse(endAt) - Date.parse(startAt);
450
+ return Number.isFinite(duration) && duration > 0 ? duration : null;
451
+ }
452
+ function eventOccurrenceEnd(occurrenceAt, event, durationMs) {
453
+ return event.recurrence && durationMs !== null ? new Date(new Date(occurrenceAt).getTime() + durationMs).toISOString() : event.end_at ?? null;
454
+ }
455
+ function buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit) {
456
+ const recurrenceRuleSummary = formatRecurrenceRuleForSummary(event.recurrence);
457
+ const durationMs = recurringDurationMs(event.start_at, event.end_at);
458
+ const occurrences = event.recurrence ? expandRecurringOccurrences(event.start_at, event.recurrence, recurringWindow, occurrenceLimit) : [event.start_at];
459
+ return occurrences.map((occurrenceAt) => ({
460
+ at: occurrenceAt,
461
+ // All-day events are timezone-agnostic calendar dates: bucket by the
462
+ // literal start date. Timed events bucket by their local day in the
463
+ // event's timezone (defaults to UTC when unset).
464
+ date: event.all_day === true ? occurrenceAt.slice(0, 10) : toLocalDayKey(occurrenceAt, event.timezone),
465
+ kind: "event",
466
+ reminder_text: event.description ?? null,
467
+ event_title: event.title ?? item.title,
468
+ event_end: eventOccurrenceEnd(occurrenceAt, event, durationMs),
469
+ event_location: event.location ?? null,
470
+ event_all_day: event.all_day ?? null,
471
+ event_timezone: event.timezone ?? null,
472
+ event_recurring: event.recurrence ? true : false,
473
+ event_recurrence_rule: recurrenceRuleSummary,
474
+ ...buildItemCalendarRowBase(item)
475
+ }));
476
+ }
389
477
  function buildEventSeed(items, recurringWindow, includeSources, occurrenceLimit) {
390
478
  const events = [];
391
479
  for (const item of items) {
392
- if (includeSources.has("deadlines") && item.deadline) {
393
- events.push({
394
- at: item.deadline,
395
- date: toUtcDayKey(item.deadline),
396
- kind: "deadline",
397
- reminder_text: null,
398
- event_title: null,
399
- event_end: null,
400
- event_location: null,
401
- event_all_day: null,
402
- event_timezone: null,
403
- event_recurring: null,
404
- event_recurrence_rule: null,
405
- item_id: item.id,
406
- item_title: item.title,
407
- item_type: item.type,
408
- item_status: item.status,
409
- item_priority: item.priority,
410
- item_assignee: item.assignee ?? null,
411
- item_deadline: item.deadline,
412
- item_tags: item.tags
413
- });
480
+ const deadlineRow = includeSources.has("deadlines") ? buildDeadlineRow(item) : null;
481
+ if (deadlineRow) {
482
+ events.push(deadlineRow);
414
483
  }
415
- for (const reminder of includeSources.has("reminders") ? item.reminders ?? [] : []) {
416
- events.push({
417
- at: reminder.at,
418
- date: toUtcDayKey(reminder.at),
419
- kind: "reminder",
420
- reminder_text: reminder.text,
421
- event_title: null,
422
- event_end: null,
423
- event_location: null,
424
- event_all_day: null,
425
- event_timezone: null,
426
- event_recurring: null,
427
- event_recurrence_rule: null,
428
- item_id: item.id,
429
- item_title: item.title,
430
- item_type: item.type,
431
- item_status: item.status,
432
- item_priority: item.priority,
433
- item_assignee: item.assignee ?? null,
434
- item_deadline: item.deadline ?? null,
435
- item_tags: item.tags
436
- });
484
+ if (includeSources.has("reminders")) {
485
+ events.push(...buildReminderRows(item));
437
486
  }
438
487
  for (const event of includeSources.has("events") ? item.events ?? [] : []) {
439
- const recurrenceRuleSummary = formatRecurrenceRuleForSummary(event.recurrence);
440
- const recurringDurationMs = (() => {
441
- if (!event.end_at) {
442
- return null;
443
- }
444
- const duration = Date.parse(event.end_at) - Date.parse(event.start_at);
445
- return Number.isFinite(duration) && duration > 0 ? duration : null;
446
- })();
447
- const occurrences = event.recurrence ? expandRecurringOccurrences(event.start_at, event.recurrence, recurringWindow, occurrenceLimit) : [event.start_at];
448
- for (const occurrenceAt of occurrences) {
449
- const occurrenceEnd = event.recurrence && recurringDurationMs !== null ? new Date(new Date(occurrenceAt).getTime() + recurringDurationMs).toISOString() : event.end_at ?? null;
450
- events.push({
451
- at: occurrenceAt,
452
- // All-day events are timezone-agnostic calendar dates: bucket by the
453
- // literal start date. Timed events bucket by their local day in the
454
- // event's timezone (defaults to UTC when unset).
455
- date: event.all_day === true ? occurrenceAt.slice(0, 10) : toLocalDayKey(occurrenceAt, event.timezone),
456
- kind: "event",
457
- reminder_text: event.description ?? null,
458
- event_title: event.title ?? item.title,
459
- event_end: occurrenceEnd,
460
- event_location: event.location ?? null,
461
- event_all_day: event.all_day ?? null,
462
- event_timezone: event.timezone ?? null,
463
- event_recurring: event.recurrence ? true : false,
464
- event_recurrence_rule: recurrenceRuleSummary,
465
- item_id: item.id,
466
- item_title: item.title,
467
- item_type: item.type,
468
- item_status: item.status,
469
- item_priority: item.priority,
470
- item_assignee: item.assignee ?? null,
471
- item_deadline: item.deadline ?? null,
472
- item_tags: item.tags
473
- });
474
- }
488
+ events.push(...buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit));
475
489
  }
476
490
  }
477
491
  return sortEvents(events);
@@ -491,30 +505,44 @@ function filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldF
491
505
  if (assigneeFilter !== void 0 && assigneeModeFilter === "unassigned") {
492
506
  throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned", EXIT_CODE.USAGE);
493
507
  }
494
- return items.filter((item) => {
495
- if (typeFilter && item.type !== typeFilter)
496
- return false;
497
- if (tagFilter && !item.tags.some((tag) => tag.trim().toLowerCase() === tagFilter))
498
- return false;
499
- if (priorityFilter !== void 0 && item.priority !== priorityFilter)
500
- return false;
501
- if (statusFilter && item.status !== statusFilter)
502
- return false;
503
- if (assigneeModeFilter === "assigned" && !item.assignee)
504
- return false;
505
- if (assigneeModeFilter === "unassigned" && item.assignee)
506
- return false;
507
- if (assigneeFilter !== void 0 && item.assignee !== assigneeFilter) {
508
- return false;
509
- }
510
- if (sprintFilter !== void 0 && item.sprint !== sprintFilter)
511
- return false;
512
- if (releaseFilter !== void 0 && item.release !== releaseFilter)
513
- return false;
514
- if (!matchesRuntimeFilters(item, runtimeFieldFilters))
515
- return false;
516
- return true;
517
- });
508
+ return items.filter((item) => itemMatchesCalendarFilters(item, {
509
+ typeFilter,
510
+ tagFilter,
511
+ priorityFilter,
512
+ statusFilter,
513
+ assigneeFilter,
514
+ assigneeModeFilter,
515
+ sprintFilter,
516
+ releaseFilter,
517
+ runtimeFieldFilters
518
+ }));
519
+ }
520
+ function itemMatchesCalendarFilters(item, filters) {
521
+ return itemMatchesCalendarIdentityFilters(item, filters) && itemMatchesCalendarOwnerFilters(item, filters) && matchesRuntimeFilters(item, filters.runtimeFieldFilters);
522
+ }
523
+ function itemMatchesCalendarIdentityFilters(item, filters) {
524
+ if (filters.typeFilter && item.type !== filters.typeFilter)
525
+ return false;
526
+ if (filters.tagFilter && !item.tags.some((tag) => tag.trim().toLowerCase() === filters.tagFilter))
527
+ return false;
528
+ if (filters.priorityFilter !== void 0 && item.priority !== filters.priorityFilter)
529
+ return false;
530
+ if (filters.statusFilter && item.status !== filters.statusFilter)
531
+ return false;
532
+ return true;
533
+ }
534
+ function itemMatchesCalendarOwnerFilters(item, filters) {
535
+ if (filters.assigneeModeFilter === "assigned" && !item.assignee)
536
+ return false;
537
+ if (filters.assigneeModeFilter === "unassigned" && item.assignee)
538
+ return false;
539
+ if (filters.assigneeFilter !== void 0 && item.assignee !== filters.assigneeFilter)
540
+ return false;
541
+ if (filters.sprintFilter !== void 0 && item.sprint !== filters.sprintFilter)
542
+ return false;
543
+ if (filters.releaseFilter !== void 0 && item.release !== filters.releaseFilter)
544
+ return false;
545
+ return true;
518
546
  }
519
547
  function includeEventInWindow(event, start, end) {
520
548
  if (start && compareTimestampStrings(event.at, start) < 0) {
@@ -544,53 +572,38 @@ function buildRange(view, options, nowValue) {
544
572
  throw new PmCliError("--from and --to are only supported for --view agenda", EXIT_CODE.USAGE);
545
573
  }
546
574
  if (view === "agenda") {
547
- if (fullPeriodRequested) {
548
- throw new PmCliError("--full-period is only supported for --view day|week|month. For agenda windows, use --from and --to.", EXIT_CODE.USAGE);
549
- }
550
- const start2 = from ?? (options.date ? anchor : includePast ? void 0 : nowValue);
551
- return {
552
- anchor,
553
- start: start2,
554
- end: to,
555
- fullPeriod: false
556
- };
575
+ return buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to);
557
576
  }
558
577
  if (view === "day") {
559
578
  const dayStart = startOfUtcDay(anchor);
560
- const fullPeriod2 = includePast || fullPeriodRequested;
561
- const start2 = fullPeriod2 ? dayStart : maxTimestamp(dayStart, nowValue);
562
- return {
563
- anchor,
564
- start: start2,
565
- end: addUtcDays(dayStart, 1),
566
- periodStart: dayStart,
567
- periodEnd: addUtcDays(dayStart, 1),
568
- fullPeriod: fullPeriod2
569
- };
579
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, dayStart, addUtcDays(dayStart, 1));
570
580
  }
571
581
  if (view === "week") {
572
582
  const weekStart = startOfUtcWeekMonday(anchor);
573
- const fullPeriod2 = includePast || fullPeriodRequested;
574
- const start2 = fullPeriod2 ? weekStart : maxTimestamp(weekStart, nowValue);
575
- return {
576
- anchor,
577
- start: start2,
578
- end: addUtcDays(weekStart, 7),
579
- periodStart: weekStart,
580
- periodEnd: addUtcDays(weekStart, 7),
581
- fullPeriod: fullPeriod2
582
- };
583
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, weekStart, addUtcDays(weekStart, 7));
583
584
  }
584
585
  const monthStart = startOfUtcMonth(anchor);
585
- const monthEnd = startOfNextUtcMonth(anchor);
586
+ return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, monthStart, startOfNextUtcMonth(anchor));
587
+ }
588
+ function buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to) {
589
+ if (fullPeriodRequested) {
590
+ throw new PmCliError("--full-period is only supported for --view day|week|month. For agenda windows, use --from and --to.", EXIT_CODE.USAGE);
591
+ }
592
+ return {
593
+ anchor,
594
+ start: from ?? (options.date ? anchor : includePast ? void 0 : nowValue),
595
+ end: to,
596
+ fullPeriod: false
597
+ };
598
+ }
599
+ function buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, periodStart, periodEnd) {
586
600
  const fullPeriod = includePast || fullPeriodRequested;
587
- const start = fullPeriod ? monthStart : maxTimestamp(monthStart, nowValue);
588
601
  return {
589
602
  anchor,
590
- start,
591
- end: monthEnd,
592
- periodStart: monthStart,
593
- periodEnd: monthEnd,
603
+ start: fullPeriod ? periodStart : maxTimestamp(periodStart, nowValue),
604
+ end: periodEnd,
605
+ periodStart,
606
+ periodEnd,
594
607
  fullPeriod
595
608
  };
596
609
  }
@@ -646,11 +659,7 @@ function summarize(events) {
646
659
  recurring_events: recurringEvents
647
660
  };
648
661
  }
649
- async function runCalendar(options, global) {
650
- const pmRoot = resolvePmRoot(process.cwd(), global.path);
651
- if (!await pathExists(getSettingsPath(pmRoot))) {
652
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
653
- }
662
+ function resolveCalendarExecutionInputs(options) {
654
663
  const nowValue = nowIso();
655
664
  const view = parseView(options.view);
656
665
  const rangeBounds = buildRange(view, options, nowValue);
@@ -663,59 +672,85 @@ async function runCalendar(options, global) {
663
672
  throw new PmCliError("Calendar occurrence limit must be >= 1", EXIT_CODE.USAGE);
664
673
  }
665
674
  const eventsOnly = includeSources.has("events") && !includeSources.has("deadlines") && !includeSources.has("reminders");
666
- const hasExplicitBounds = options.to !== void 0 || explicitLookahead !== void 0 || occurrenceLimit !== void 0;
675
+ const hasExplicitBounds = options.to !== void 0 || explicitLookahead !== void 0 || recurrenceLookbackDays !== void 0 || occurrenceLimit !== void 0;
667
676
  const eventsOnlyCapApplied = eventsOnly && !hasExplicitBounds;
668
- const recurrenceLookaheadDays = eventsOnlyCapApplied ? DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS : explicitLookahead;
669
- const recurrenceLookbackWindowDays = eventsOnlyCapApplied && recurrenceLookbackDays === void 0 ? 0 : recurrenceLookbackDays;
677
+ return {
678
+ nowValue,
679
+ view,
680
+ rangeBounds,
681
+ limit,
682
+ includeSources,
683
+ occurrenceLimit,
684
+ recurrenceLookaheadDays: eventsOnlyCapApplied ? DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS : explicitLookahead,
685
+ recurrenceLookbackWindowDays: eventsOnlyCapApplied && recurrenceLookbackDays === void 0 ? 0 : recurrenceLookbackDays,
686
+ eventsOnlyCapApplied
687
+ };
688
+ }
689
+ function appendCalendarCapWarning(warnings, capApplied) {
690
+ if (!capApplied) {
691
+ return;
692
+ }
693
+ 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`);
694
+ }
695
+ function buildCalendarFiltersResult(options, runtimeFieldFilters) {
696
+ return {
697
+ type: options.type ?? null,
698
+ tag: options.tag ?? null,
699
+ priority: options.priority ?? null,
700
+ status: options.status ?? null,
701
+ assignee: options.assignee ?? null,
702
+ assignee_filter: options.assigneeFilter ?? null,
703
+ sprint: options.sprint ?? null,
704
+ release: options.release ?? null,
705
+ runtime_filters: runtimeFieldFilters,
706
+ limit: options.limit ?? null,
707
+ include: options.include ?? null,
708
+ full_period: options.fullPeriod === true ? "true" : null,
709
+ recurrence_lookahead_days: options.recurrenceLookaheadDays ?? null,
710
+ recurrence_lookback_days: options.recurrenceLookbackDays ?? null,
711
+ occurrence_limit: options.occurrenceLimit ?? null
712
+ };
713
+ }
714
+ function buildCalendarRangeResult(options, rangeBounds) {
715
+ return {
716
+ start: rangeBounds.start ?? null,
717
+ end: rangeBounds.end ?? null,
718
+ period_start: rangeBounds.periodStart ?? null,
719
+ period_end: rangeBounds.periodEnd ?? null,
720
+ full_period: rangeBounds.fullPeriod,
721
+ past: options.past === true,
722
+ from: options.from ?? null,
723
+ to: options.to ?? null
724
+ };
725
+ }
726
+ async function runCalendar(options, global) {
727
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
728
+ if (!await pathExists(getSettingsPath(pmRoot))) {
729
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
730
+ }
731
+ const inputs = resolveCalendarExecutionInputs(options);
670
732
  const settings = await readSettings(pmRoot);
671
733
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
672
734
  const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
673
735
  const runtimeFieldFilters = collectRuntimeFilterValues(options, runtimeFieldRegistry, "calendar");
674
736
  const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
675
737
  const listWarnings = [];
676
- if (eventsOnlyCapApplied) {
677
- 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`);
678
- }
738
+ appendCalendarCapWarning(listWarnings, inputs.eventsOnlyCapApplied);
679
739
  const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);
680
740
  const filteredItems = filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldFilters);
681
- const recurringWindow = buildRecurringEventWindow(rangeBounds.start, rangeBounds.end, nowValue, recurrenceLookbackWindowDays, recurrenceLookaheadDays);
682
- const seededEvents = buildEventSeed(filteredItems, recurringWindow, includeSources, occurrenceLimit);
683
- const rangedEvents = seededEvents.filter((event) => includeEventInWindow(event, rangeBounds.start, rangeBounds.end));
684
- const limitedEvents = limit === void 0 ? rangedEvents : rangedEvents.slice(0, limit);
741
+ const recurringWindow = buildRecurringEventWindow(inputs.rangeBounds.start, inputs.rangeBounds.end, inputs.nowValue, inputs.recurrenceLookbackWindowDays, inputs.recurrenceLookaheadDays);
742
+ const seededEvents = buildEventSeed(filteredItems, recurringWindow, inputs.includeSources, inputs.occurrenceLimit);
743
+ const rangedEvents = seededEvents.filter((event) => includeEventInWindow(event, inputs.rangeBounds.start, inputs.rangeBounds.end));
744
+ const limitedEvents = inputs.limit === void 0 ? rangedEvents : rangedEvents.slice(0, inputs.limit);
685
745
  const days = bucketEventsByDay(limitedEvents);
686
746
  const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
687
747
  return {
688
- view,
748
+ view: inputs.view,
689
749
  output_default: "markdown",
690
- now: nowValue,
691
- anchor: rangeBounds.anchor,
692
- range: {
693
- start: rangeBounds.start ?? null,
694
- end: rangeBounds.end ?? null,
695
- period_start: rangeBounds.periodStart ?? null,
696
- period_end: rangeBounds.periodEnd ?? null,
697
- full_period: rangeBounds.fullPeriod,
698
- past: options.past === true,
699
- from: options.from ?? null,
700
- to: options.to ?? null
701
- },
702
- filters: {
703
- type: options.type ?? null,
704
- tag: options.tag ?? null,
705
- priority: options.priority ?? null,
706
- status: options.status ?? null,
707
- assignee: options.assignee ?? null,
708
- assignee_filter: options.assigneeFilter ?? null,
709
- sprint: options.sprint ?? null,
710
- release: options.release ?? null,
711
- runtime_filters: runtimeFieldFilters,
712
- limit: options.limit ?? null,
713
- include: options.include ?? null,
714
- full_period: options.fullPeriod === true ? "true" : null,
715
- recurrence_lookahead_days: options.recurrenceLookaheadDays ?? null,
716
- recurrence_lookback_days: options.recurrenceLookbackDays ?? null,
717
- occurrence_limit: options.occurrenceLimit ?? null
718
- },
750
+ now: inputs.nowValue,
751
+ anchor: inputs.rangeBounds.anchor,
752
+ range: buildCalendarRangeResult(options, inputs.rangeBounds),
753
+ filters: buildCalendarFiltersResult(options, runtimeFieldFilters),
719
754
  summary: summarize(limitedEvents),
720
755
  events: limitedEvents,
721
756
  days,
@@ -1379,53 +1414,28 @@ function formatAgendaLine(event) {
1379
1414
  }
1380
1415
  return base;
1381
1416
  }
1382
- function renderContextMarkdown(result) {
1383
- const lines = [];
1384
- const focusFields = result.focus_fields;
1385
- const renderFocus = (item) => focusFields ? formatProjectedFocusLine(item, focusFields) : formatFocusLine(item);
1386
- lines.push("# pm context");
1387
- lines.push("");
1388
- lines.push(`- now: ${result.now}`);
1389
- lines.push(`- depth: ${result.depth}`);
1390
- if (result.filters.parent) {
1391
- lines.push(`- scope: subtree of ${result.filters.parent}`);
1392
- }
1393
- lines.push(`- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`);
1394
- if (result.summary.total_items !== void 0) {
1395
- lines.push(`- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`);
1396
- }
1397
- lines.push(`- agenda_events: ${result.summary.agenda_events}`);
1398
- lines.push(`- blocked_fallback_used: ${result.summary.blocked_fallback_used}`);
1399
- const renderedSections = result.sections_included.filter((section) => section !== "blockers" || (result.blockers?.length ?? 0) > 0);
1400
- if (renderedSections.length > 0) {
1401
- lines.push(`- sections: ${renderedSections.join(", ")}`);
1402
- }
1403
- lines.push("");
1404
- lines.push("## High-level focus");
1405
- if (result.high_level.length === 0) {
1406
- lines.push("No high-level active items.");
1417
+ function pushContextFocusSection(lines, title, rows, emptyText, renderFocus) {
1418
+ lines.push(`## ${title}`);
1419
+ if (rows.length === 0) {
1420
+ lines.push(emptyText);
1407
1421
  } else {
1408
- for (const item of result.high_level) {
1422
+ for (const item of rows) {
1409
1423
  lines.push(`- ${renderFocus(item)}`);
1410
1424
  }
1411
1425
  }
1412
1426
  lines.push("");
1413
- lines.push("## Low-level focus");
1414
- if (result.low_level.length === 0) {
1415
- lines.push("No low-level active items.");
1416
- } else {
1417
- for (const item of result.low_level) {
1418
- lines.push(`- ${renderFocus(item)}`);
1419
- }
1427
+ }
1428
+ function pushBlockedFallbackSection(lines, result, renderFocus) {
1429
+ if (result.blocked_fallback.length === 0) {
1430
+ return;
1420
1431
  }
1421
- lines.push("");
1422
- if (result.blocked_fallback.length > 0) {
1423
- lines.push("## Blocked fallback");
1424
- for (const item of result.blocked_fallback) {
1425
- lines.push(`- ${renderFocus(item)}`);
1426
- }
1427
- lines.push("");
1432
+ lines.push("## Blocked fallback");
1433
+ for (const item of result.blocked_fallback) {
1434
+ lines.push(`- ${renderFocus(item)}`);
1428
1435
  }
1436
+ lines.push("");
1437
+ }
1438
+ function pushAgendaSection(lines, result) {
1429
1439
  lines.push("## Agenda");
1430
1440
  lines.push(`- events: ${result.agenda.summary.events} (deadlines: ${result.agenda.summary.deadlines}, reminders: ${result.agenda.summary.reminders}, scheduled: ${result.agenda.summary.scheduled})`);
1431
1441
  if (result.agenda.events.length === 0) {
@@ -1436,205 +1446,373 @@ function renderContextMarkdown(result) {
1436
1446
  }
1437
1447
  }
1438
1448
  lines.push("");
1439
- if (result.hierarchy && result.hierarchy.length > 0) {
1440
- lines.push("## Hierarchy");
1441
- for (const node of result.hierarchy) {
1442
- const pct = node.children_total > 0 ? Math.round(node.children_closed / node.children_total * 100) : 0;
1443
- lines.push(`- ${node.id} ${node.type} ${node.status} "${node.title}" [${node.children_closed}/${node.children_total} done ${pct}%]`);
1444
- for (const child of node.children) {
1445
- const cpct = child.children_total > 0 ? Math.round(child.children_closed / child.children_total * 100) : 0;
1446
- lines.push(` - ${child.id} ${child.type} ${child.status} "${child.title}" [${child.children_closed}/${child.children_total} done ${cpct}%]`);
1447
- }
1449
+ }
1450
+ function pushHierarchySection(lines, result) {
1451
+ if (!result.hierarchy || result.hierarchy.length === 0) {
1452
+ return;
1453
+ }
1454
+ lines.push("## Hierarchy");
1455
+ for (const node of result.hierarchy) {
1456
+ const pct = node.children_total > 0 ? Math.round(node.children_closed / node.children_total * 100) : 0;
1457
+ lines.push(`- ${node.id} ${node.type} ${node.status} "${node.title}" [${node.children_closed}/${node.children_total} done ${pct}%]`);
1458
+ for (const child of node.children) {
1459
+ const cpct = child.children_total > 0 ? Math.round(child.children_closed / child.children_total * 100) : 0;
1460
+ lines.push(` - ${child.id} ${child.type} ${child.status} "${child.title}" [${child.children_closed}/${child.children_total} done ${cpct}%]`);
1448
1461
  }
1449
- lines.push("");
1450
1462
  }
1451
- if (result.progress && result.progress.length > 0) {
1452
- lines.push("## Progress");
1453
- for (const entry of result.progress) {
1454
- lines.push(`- ${entry.id} "${entry.title}" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`);
1455
- }
1456
- lines.push("");
1463
+ lines.push("");
1464
+ }
1465
+ function pushProgressSection(lines, result) {
1466
+ if (!result.progress || result.progress.length === 0) {
1467
+ return;
1457
1468
  }
1458
- if (result.recently_created && result.recently_created.length > 0) {
1459
- lines.push("## Recently created");
1460
- for (const item of result.recently_created) {
1461
- lines.push(focusFields ? `- ${renderFocus(item)}` : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`);
1462
- }
1463
- lines.push("");
1469
+ lines.push("## Progress");
1470
+ for (const entry of result.progress) {
1471
+ lines.push(`- ${entry.id} "${entry.title}" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`);
1464
1472
  }
1465
- if (result.unparented && result.unparented.length > 0) {
1466
- lines.push("## Unparented");
1467
- for (const item of result.unparented) {
1468
- lines.push(`- ${renderFocus(item)}`);
1469
- }
1470
- lines.push("");
1473
+ lines.push("");
1474
+ }
1475
+ function pushRecentlyCreatedSection(lines, result, focusFields, renderFocus) {
1476
+ if (!result.recently_created || result.recently_created.length === 0) {
1477
+ return;
1471
1478
  }
1472
- if (result.activity && result.activity.length > 0) {
1473
- lines.push("## Recent activity");
1474
- for (const entry of result.activity) {
1475
- const msg = entry.msg ? ` ${entry.msg}` : "";
1476
- lines.push(`- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`);
1477
- }
1478
- lines.push("");
1479
- }
1480
- if (result.blockers && result.blockers.length > 0) {
1481
- lines.push("## Blockers");
1482
- for (const entry of result.blockers) {
1483
- const by = entry.blocked_by ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? "?"})` : "blocked_by:-";
1484
- const reason = entry.blocked_reason ? ` reason:"${entry.blocked_reason}"` : "";
1485
- const note = entry.unblock_note ? ` unblock:"${entry.unblock_note}"` : "";
1486
- lines.push(`- ${entry.id} "${entry.title}" ${by}${reason}${note}`);
1487
- }
1488
- lines.push("");
1479
+ lines.push("## Recently created");
1480
+ for (const item of result.recently_created) {
1481
+ lines.push(focusFields ? `- ${renderFocus(item)}` : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`);
1489
1482
  }
1490
- if (result.files && result.files.length > 0) {
1491
- lines.push("## Hot files");
1492
- for (const file of result.files) {
1493
- lines.push(`- ${file.path} refs:${file.references} items:[${file.items.join(",")}]`);
1494
- }
1495
- lines.push("");
1483
+ lines.push("");
1484
+ }
1485
+ function pushUnparentedSection(lines, result, renderFocus) {
1486
+ if (!result.unparented || result.unparented.length === 0) {
1487
+ return;
1496
1488
  }
1497
- if (result.workload && result.workload.length > 0) {
1498
- lines.push("## Workload");
1499
- for (const entry of result.workload) {
1500
- const who = entry.assignee ?? "(unassigned)";
1501
- lines.push(`- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(",")}]`);
1502
- }
1503
- lines.push("");
1489
+ lines.push("## Unparented");
1490
+ for (const item of result.unparented) {
1491
+ lines.push(`- ${renderFocus(item)}`);
1504
1492
  }
1505
- if (result.staleness && result.staleness.length > 0) {
1506
- lines.push("## Stale items");
1507
- for (const entry of result.staleness) {
1508
- lines.push(`- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} "${entry.title}"`);
1509
- }
1510
- lines.push("");
1511
- }
1512
- if (result.tests) {
1513
- lines.push("## Test health");
1514
- lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);
1515
- lines.push(`- items_with_recent_runs: ${result.tests.items_with_recent_runs}`);
1516
- lines.push(`- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`);
1517
- if (result.tests.items_failing.length > 0) {
1518
- lines.push(`- items_failing: [${result.tests.items_failing.join(",")}]`);
1519
- }
1520
- lines.push("");
1493
+ lines.push("");
1494
+ }
1495
+ function pushActivitySection(lines, result) {
1496
+ if (!result.activity || result.activity.length === 0) {
1497
+ return;
1498
+ }
1499
+ lines.push("## Recent activity");
1500
+ for (const entry of result.activity) {
1501
+ const msg = entry.msg ? ` ${entry.msg}` : "";
1502
+ lines.push(`- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`);
1503
+ }
1504
+ lines.push("");
1505
+ }
1506
+ function pushBlockersSection(lines, result) {
1507
+ if (!result.blockers || result.blockers.length === 0) {
1508
+ return;
1509
+ }
1510
+ lines.push("## Blockers");
1511
+ for (const entry of result.blockers) {
1512
+ const by = entry.blocked_by ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? "?"})` : "blocked_by:-";
1513
+ const reason = entry.blocked_reason ? ` reason:"${entry.blocked_reason}"` : "";
1514
+ const note = entry.unblock_note ? ` unblock:"${entry.unblock_note}"` : "";
1515
+ lines.push(`- ${entry.id} "${entry.title}" ${by}${reason}${note}`);
1516
+ }
1517
+ lines.push("");
1518
+ }
1519
+ function pushFilesSection(lines, result) {
1520
+ if (!result.files || result.files.length === 0) {
1521
+ return;
1522
+ }
1523
+ lines.push("## Hot files");
1524
+ for (const file of result.files) {
1525
+ lines.push(`- ${file.path} refs:${file.references} items:[${file.items.join(",")}]`);
1526
+ }
1527
+ lines.push("");
1528
+ }
1529
+ function pushWorkloadSection(lines, result) {
1530
+ if (!result.workload || result.workload.length === 0) {
1531
+ return;
1532
+ }
1533
+ lines.push("## Workload");
1534
+ for (const entry of result.workload) {
1535
+ const who = entry.assignee ?? "(unassigned)";
1536
+ lines.push(`- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(",")}]`);
1537
+ }
1538
+ lines.push("");
1539
+ }
1540
+ function pushStalenessSection(lines, result) {
1541
+ if (!result.staleness || result.staleness.length === 0) {
1542
+ return;
1543
+ }
1544
+ lines.push("## Stale items");
1545
+ for (const entry of result.staleness) {
1546
+ lines.push(`- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} "${entry.title}"`);
1547
+ }
1548
+ lines.push("");
1549
+ }
1550
+ function pushTestHealthSection(lines, result) {
1551
+ if (!result.tests) {
1552
+ return;
1553
+ }
1554
+ lines.push("## Test health");
1555
+ lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);
1556
+ lines.push(`- items_with_recent_runs: ${result.tests.items_with_recent_runs}`);
1557
+ lines.push(`- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`);
1558
+ if (result.tests.items_failing.length > 0) {
1559
+ lines.push(`- items_failing: [${result.tests.items_failing.join(",")}]`);
1521
1560
  }
1561
+ lines.push("");
1562
+ }
1563
+ function pushEmptyContextSuggestions(lines, result) {
1522
1564
  const isEmpty = result.summary.active_items === 0 && result.summary.blocked === 0 && result.agenda.summary.events === 0;
1523
- if (isEmpty) {
1524
- lines.push("## Suggestions");
1525
- lines.push("No active work items or upcoming events. Consider:");
1526
- lines.push('- `pm create --type Task --title "..."` to add a new work item');
1527
- lines.push("- `pm list --status closed --limit 5` to review recent completions");
1528
- lines.push("- `pm search <keywords>` to find related past work");
1529
- lines.push("- `pm aggregate` for a full project status overview");
1565
+ if (!isEmpty) {
1566
+ return;
1530
1567
  }
1568
+ lines.push("## Suggestions");
1569
+ lines.push("No active work items or upcoming events. Consider:");
1570
+ lines.push('- `pm create --type Task --title "..."` to add a new work item');
1571
+ lines.push("- `pm list --status closed --limit 5` to review recent completions");
1572
+ lines.push("- `pm search <keywords>` to find related past work");
1573
+ lines.push("- `pm aggregate` for a full project status overview");
1574
+ }
1575
+ function renderContextMarkdown(result) {
1576
+ const lines = [];
1577
+ const focusFields = result.focus_fields;
1578
+ const renderFocus = (item) => focusFields ? formatProjectedFocusLine(item, focusFields) : formatFocusLine(item);
1579
+ lines.push("# pm context");
1580
+ lines.push("");
1581
+ lines.push(`- now: ${result.now}`);
1582
+ lines.push(`- depth: ${result.depth}`);
1583
+ if (result.filters.parent) {
1584
+ lines.push(`- scope: subtree of ${result.filters.parent}`);
1585
+ }
1586
+ lines.push(`- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`);
1587
+ if (result.summary.total_items !== void 0) {
1588
+ lines.push(`- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`);
1589
+ }
1590
+ lines.push(`- agenda_events: ${result.summary.agenda_events}`);
1591
+ lines.push(`- blocked_fallback_used: ${result.summary.blocked_fallback_used}`);
1592
+ const renderedSections = result.sections_included.filter((section) => section !== "blockers" || (result.blockers?.length ?? 0) > 0);
1593
+ if (renderedSections.length > 0) {
1594
+ lines.push(`- sections: ${renderedSections.join(", ")}`);
1595
+ }
1596
+ lines.push("");
1597
+ pushContextFocusSection(lines, "High-level focus", result.high_level, "No high-level active items.", renderFocus);
1598
+ pushContextFocusSection(lines, "Low-level focus", result.low_level, "No low-level active items.", renderFocus);
1599
+ pushBlockedFallbackSection(lines, result, renderFocus);
1600
+ pushAgendaSection(lines, result);
1601
+ pushHierarchySection(lines, result);
1602
+ pushProgressSection(lines, result);
1603
+ pushRecentlyCreatedSection(lines, result, focusFields, renderFocus);
1604
+ pushUnparentedSection(lines, result, renderFocus);
1605
+ pushActivitySection(lines, result);
1606
+ pushBlockersSection(lines, result);
1607
+ pushFilesSection(lines, result);
1608
+ pushWorkloadSection(lines, result);
1609
+ pushStalenessSection(lines, result);
1610
+ pushTestHealthSection(lines, result);
1611
+ pushEmptyContextSuggestions(lines, result);
1531
1612
  return lines.join("\n");
1532
1613
  }
1533
- async function runContext(options, global) {
1614
+ async function resolveContextRuntime(options, global) {
1534
1615
  const pmRoot = resolvePmRoot(process.cwd(), global.path);
1535
1616
  const settings = await readSettings(pmRoot);
1536
1617
  const contextSettings = settings.context ?? SETTINGS_DEFAULTS.context;
1537
1618
  const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1538
1619
  const depth = parseContextDepth(options.depth, contextSettings);
1539
- const limit = parseContextLimit(options.limit, depth);
1540
- const sectionsIncluded = parseContextSections(options.section, depth, contextSettings);
1541
- const activityLimit = parseActivityLimit(options.activityLimit, contextSettings);
1542
- const staleThresholdDays = parseStaleThresholdDays(options.staleThreshold, contextSettings);
1543
- const parentScope = parseContextParent(options.parent);
1544
- const focusFields = parseContextFocusFields(options.fields);
1545
- const needsAllItems = sectionsIncluded.some((s) => ["hierarchy", "progress", "blockers", "staleness", "recently_created", "unparented"].includes(s));
1546
- const baseListOptions = stripListProjectionFlags(options);
1547
- const unpaginatedListOptions = (extra) => ({
1620
+ return {
1621
+ settings,
1622
+ contextSettings,
1623
+ statusRegistry,
1624
+ depth,
1625
+ limit: parseContextLimit(options.limit, depth),
1626
+ sectionsIncluded: parseContextSections(options.section, depth, contextSettings),
1627
+ activityLimit: parseActivityLimit(options.activityLimit, contextSettings),
1628
+ staleThresholdDays: parseStaleThresholdDays(options.staleThreshold, contextSettings),
1629
+ parentScope: parseContextParent(options.parent),
1630
+ focusFields: parseContextFocusFields(options.fields),
1631
+ baseListOptions: stripListProjectionFlags(options)
1632
+ };
1633
+ }
1634
+ function contextNeedsAllItems(sectionsIncluded) {
1635
+ return sectionsIncluded.some((section) => ["hierarchy", "progress", "blockers", "staleness", "recently_created", "unparented"].includes(section));
1636
+ }
1637
+ function buildUnpaginatedContextListOptions(baseListOptions, extra) {
1638
+ return {
1548
1639
  ...baseListOptions,
1549
1640
  ...extra,
1550
1641
  noTruncate: true,
1551
1642
  limit: void 0,
1552
1643
  offset: void 0
1553
- });
1554
- const listOptions = parentScope === void 0 ? { ...baseListOptions, excludeTerminal: true } : unpaginatedListOptions({ excludeTerminal: true });
1644
+ };
1645
+ }
1646
+ async function loadContextCorpus(options, global, runtime) {
1647
+ const needsAllItems = contextNeedsAllItems(runtime.sectionsIncluded);
1648
+ const listOptions = runtime.parentScope === void 0 ? { ...runtime.baseListOptions, excludeTerminal: true } : buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: true });
1555
1649
  const listed = await runList(void 0, listOptions, global);
1556
1650
  let listedFrontMatter = listed.items;
1557
1651
  let allItems = listedFrontMatter;
1558
- if (needsAllItems || parentScope !== void 0) {
1559
- const allListed = await runList(void 0, unpaginatedListOptions({ excludeTerminal: false }), global);
1652
+ if (needsAllItems || runtime.parentScope !== void 0) {
1653
+ const allListed = await runList(void 0, buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: false }), global);
1560
1654
  allItems = allListed.items;
1561
1655
  }
1562
1656
  const fullCorpus = allItems;
1563
- let subtreeIds;
1564
- if (parentScope !== void 0) {
1565
- const subtree = collectSubtreeIds(fullCorpus, parentScope);
1566
- if (!subtree.found) {
1567
- throw new PmCliError(`Context --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
1568
- }
1569
- subtreeIds = subtree.ids;
1570
- listedFrontMatter = listedFrontMatter.filter((item) => subtreeIds?.has(item.id.trim().toLowerCase()));
1571
- allItems = allItems.filter((item) => subtreeIds?.has(item.id.trim().toLowerCase()));
1657
+ const subtreeIds = resolveContextSubtreeIds(runtime.parentScope, fullCorpus);
1658
+ if (subtreeIds) {
1659
+ listedFrontMatter = listedFrontMatter.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
1660
+ allItems = allItems.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
1572
1661
  }
1662
+ return { listed, listedFrontMatter, allItems, fullCorpus, subtreeIds };
1663
+ }
1664
+ function resolveContextSubtreeIds(parentScope, fullCorpus) {
1665
+ if (parentScope === void 0) {
1666
+ return void 0;
1667
+ }
1668
+ const subtree = collectSubtreeIds(fullCorpus, parentScope);
1669
+ if (!subtree.found) {
1670
+ throw new PmCliError(`Context --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
1671
+ }
1672
+ return subtree.ids;
1673
+ }
1674
+ function resolveContextFocusGroups(listedFrontMatter, allItems, statusRegistry, sectionsIncluded, limit) {
1573
1675
  const ranked = [...listedFrontMatter].sort((left, right) => compareCriticalItems(left, right, statusRegistry));
1574
- const activeStatuses = statusRegistry.active_statuses.size > 0 ? statusRegistry.active_statuses : /* @__PURE__ */ new Set([statusRegistry.open_status]);
1575
- const blockedStatuses = statusRegistry.blocked_statuses;
1676
+ const activeStatuses = statusRegistry.active_statuses;
1576
1677
  const activeItems = ranked.filter((item) => activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1577
- const blockedItems = ranked.filter((item) => blockedStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1678
+ const blockedItems = ranked.filter((item) => statusRegistry.blocked_statuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
1578
1679
  const childrenByParent = buildChildrenByParent(allItems);
1579
- const focusChildrenByParent = needsAllItems ? childrenByParent : void 0;
1680
+ const focusChildrenByParent = contextNeedsAllItems(sectionsIncluded) ? childrenByParent : void 0;
1580
1681
  const highLevel = activeItems.filter((item) => HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
1581
1682
  const lowLevel = activeItems.filter((item) => !HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
1582
1683
  const blockedFallbackUsed = activeItems.length === 0;
1583
- const blockedFallback = blockedFallbackUsed ? blockedItems.slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent)) : [];
1684
+ return {
1685
+ activeItems,
1686
+ blockedItems,
1687
+ highLevel,
1688
+ lowLevel,
1689
+ blockedFallback: blockedFallbackUsed ? blockedItems.slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent)) : [],
1690
+ blockedFallbackUsed
1691
+ };
1692
+ }
1693
+ async function buildContextAgenda(options, global, runtime, subtreeIds) {
1584
1694
  const calendarOptions = {
1585
- ...baseListOptions,
1695
+ ...runtime.baseListOptions,
1586
1696
  view: "agenda",
1587
1697
  include: "all",
1588
- // When scoping to a subtree, pull the full agenda so the subtree filter sees
1589
- // every candidate event before the final per-section slice.
1590
- limit: parentScope === void 0 ? String(limit) : void 0
1698
+ limit: runtime.parentScope === void 0 ? String(runtime.limit) : void 0
1591
1699
  };
1592
1700
  const agenda = await runCalendar(calendarOptions, global);
1593
1701
  const scopedAgenda = subtreeIds === void 0 ? agenda.events : agenda.events.filter((event) => subtreeIds.has(event.item_id.trim().toLowerCase()));
1594
- const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, statusRegistry).slice(0, limit);
1595
- const agendaSummary = summarizeAgenda(agendaEvents);
1596
- const warnings = mergeSortedWarnings(listed.warnings, agenda.warnings);
1597
- const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
1598
- const openStatus = normalizeStatusInput("open", statusRegistry);
1599
- const inProgressCount = activeItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === inProgressStatus).length;
1600
- const openCount = activeItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === openStatus).length;
1601
- const now = agenda.now;
1602
- const itemMap = /* @__PURE__ */ new Map();
1603
- for (const item of fullCorpus) {
1604
- itemMap.set(item.id, item);
1702
+ const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, runtime.statusRegistry).slice(0, runtime.limit);
1703
+ return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };
1704
+ }
1705
+ function countContextStatus(items, status, statusRegistry) {
1706
+ const targetStatus = String(status);
1707
+ return items.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === targetStatus).length;
1708
+ }
1709
+ async function buildOptionalContextSections(params) {
1710
+ const { runtime, allItems, fullCorpus, focusGroups, now, global } = params;
1711
+ const childrenByParent = buildChildrenByParent(allItems);
1712
+ const itemMap = new Map(fullCorpus.map((item) => [item.id, item]));
1713
+ const allNonTerminal = allItems.filter((item) => !isTerminalStatus(item.status, runtime.statusRegistry));
1714
+ const has = (section) => runtime.sectionsIncluded.includes(section);
1715
+ return {
1716
+ hierarchy: has("hierarchy") ? buildHierarchy(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1717
+ activity: has("activity") ? await buildActivity(runtime.activityLimit, global) : void 0,
1718
+ progress: has("progress") ? buildProgress(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1719
+ blockersSection: has("blockers") ? buildBlockers(focusGroups.blockedItems, itemMap, runtime.limit) : void 0,
1720
+ recentlyCreated: has("recently_created") ? buildRecentlyCreated(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
1721
+ unparented: has("unparented") ? buildUnparented(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
1722
+ filesSection: has("files") ? buildHotFiles(focusGroups.activeItems, runtime.limit) : void 0,
1723
+ workload: has("workload") ? buildWorkload(focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
1724
+ staleness: has("staleness") ? buildStaleness(allNonTerminal, runtime.staleThresholdDays, now, runtime.limit) : void 0,
1725
+ tests: has("tests") ? buildTestHealth(focusGroups.activeItems) : void 0
1726
+ };
1727
+ }
1728
+ function buildContextSummaryExtras(needsAllItems, allItems, statusRegistry) {
1729
+ if (!needsAllItems) {
1730
+ return {};
1605
1731
  }
1606
- const allNonTerminal = allItems.filter((item) => !isTerminalStatus(item.status, statusRegistry));
1607
- const has = (section) => sectionsIncluded.includes(section);
1608
- const hierarchy = has("hierarchy") ? buildHierarchy(allItems, activeItems, statusRegistry, limit) : void 0;
1609
- const activity = has("activity") ? await buildActivity(activityLimit, global) : void 0;
1610
- const progress = has("progress") ? buildProgress(allItems, activeItems, statusRegistry, limit) : void 0;
1611
- const blockersSection = has("blockers") ? buildBlockers(blockedItems, itemMap, limit) : void 0;
1612
- const recentlyCreated = has("recently_created") ? buildRecentlyCreated(allNonTerminal, statusRegistry, childrenByParent, limit) : void 0;
1613
- const unparented = has("unparented") ? buildUnparented(allNonTerminal, statusRegistry, childrenByParent, limit) : void 0;
1614
- const filesSection = has("files") ? buildHotFiles(activeItems, limit) : void 0;
1615
- const workload = has("workload") ? buildWorkload(activeItems, statusRegistry, limit) : void 0;
1616
- const staleness = has("staleness") ? buildStaleness(allNonTerminal, staleThresholdDays, now, limit) : void 0;
1617
- const tests = has("tests") ? buildTestHealth(activeItems) : void 0;
1618
- const summaryExtras = needsAllItems ? {
1732
+ const canceledStatus = normalizeStatusInput("canceled", statusRegistry);
1733
+ return {
1619
1734
  total_items: allItems.length,
1620
- closed: allItems.filter((i) => isClosedStatus(i.status, statusRegistry)).length,
1621
- canceled: allItems.filter((i) => {
1622
- const canceledStatus = normalizeStatusInput("canceled", statusRegistry);
1623
- return normalizeStatusForRegistry(i.status, statusRegistry) === canceledStatus;
1624
- }).length
1625
- } : {};
1735
+ closed: allItems.filter((item) => isClosedStatus(item.status, statusRegistry)).length,
1736
+ canceled: allItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === canceledStatus).length
1737
+ };
1738
+ }
1739
+ function attachOptionalContextSections(result, sections) {
1740
+ if (sections.hierarchy)
1741
+ result.hierarchy = sections.hierarchy;
1742
+ if (sections.activity)
1743
+ result.activity = sections.activity;
1744
+ if (sections.progress)
1745
+ result.progress = sections.progress;
1746
+ if (sections.blockersSection)
1747
+ result.blockers = sections.blockersSection;
1748
+ if (sections.recentlyCreated)
1749
+ result.recently_created = sections.recentlyCreated;
1750
+ if (sections.unparented)
1751
+ result.unparented = sections.unparented;
1752
+ if (sections.filesSection)
1753
+ result.files = sections.filesSection;
1754
+ if (sections.workload)
1755
+ result.workload = sections.workload;
1756
+ if (sections.staleness)
1757
+ result.staleness = sections.staleness;
1758
+ if (sections.tests)
1759
+ result.tests = sections.tests;
1760
+ }
1761
+ function applyContextFocusProjection(result, focusFields) {
1762
+ if (!focusFields) {
1763
+ return;
1764
+ }
1765
+ result.focus_fields = focusFields;
1766
+ result.high_level = projectContextFocusRows(result.high_level, focusFields);
1767
+ result.low_level = projectContextFocusRows(result.low_level, focusFields);
1768
+ result.blocked_fallback = projectContextFocusRows(result.blocked_fallback, focusFields);
1769
+ if (result.recently_created) {
1770
+ result.recently_created = projectContextFocusRows(result.recently_created, focusFields);
1771
+ }
1772
+ if (result.unparented) {
1773
+ result.unparented = projectContextFocusRows(result.unparented, focusFields);
1774
+ }
1775
+ }
1776
+ function maybeAttachEmptyContextSuggestions(result, activeItems, blockedItems) {
1777
+ if (activeItems.length > 0 || blockedItems.length > 0 || result.agenda.events.length > 0) {
1778
+ return;
1779
+ }
1780
+ result.suggestions = [
1781
+ 'pm create --type Task --title "..." to add a new work item',
1782
+ "pm list --status closed --limit 5 to review recent completions",
1783
+ "pm search <keywords> to find related past work",
1784
+ "pm aggregate for a full project status overview"
1785
+ ];
1786
+ }
1787
+ async function runContext(options, global) {
1788
+ const runtime = await resolveContextRuntime(options, global);
1789
+ const corpus = await loadContextCorpus(options, global, runtime);
1790
+ const focusGroups = resolveContextFocusGroups(corpus.listedFrontMatter, corpus.allItems, runtime.statusRegistry, runtime.sectionsIncluded, runtime.limit);
1791
+ const agendaContext = await buildContextAgenda(options, global, runtime, corpus.subtreeIds);
1792
+ const warnings = mergeSortedWarnings(corpus.listed.warnings, agendaContext.agenda.warnings);
1793
+ const inProgressCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("in_progress", runtime.statusRegistry), runtime.statusRegistry);
1794
+ const openCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("open", runtime.statusRegistry), runtime.statusRegistry);
1795
+ const sections = await buildOptionalContextSections({
1796
+ runtime,
1797
+ allItems: corpus.allItems,
1798
+ fullCorpus: corpus.fullCorpus,
1799
+ focusGroups,
1800
+ now: agendaContext.agenda.now,
1801
+ global
1802
+ });
1803
+ const summaryExtras = buildContextSummaryExtras(contextNeedsAllItems(runtime.sectionsIncluded), corpus.allItems, runtime.statusRegistry);
1626
1804
  const result = {
1627
1805
  output_default: "toon",
1628
- now,
1629
- depth,
1630
- sections_included: sectionsIncluded,
1806
+ now: agendaContext.agenda.now,
1807
+ depth: runtime.depth,
1808
+ sections_included: runtime.sectionsIncluded,
1631
1809
  window: {
1632
- anchor: agenda.anchor,
1633
- start: agenda.range.start,
1634
- end: agenda.range.end,
1635
- past: agenda.range.past,
1636
- from: agenda.range.from,
1637
- to: agenda.range.to
1810
+ anchor: agendaContext.agenda.anchor,
1811
+ start: agendaContext.agenda.range.start,
1812
+ end: agendaContext.agenda.range.end,
1813
+ past: agendaContext.agenda.range.past,
1814
+ from: agendaContext.agenda.range.from,
1815
+ to: agendaContext.agenda.range.to
1638
1816
  },
1639
1817
  filters: {
1640
1818
  type: options.type ?? null,
@@ -1645,71 +1823,34 @@ async function runContext(options, global) {
1645
1823
  sprint: options.sprint ?? null,
1646
1824
  release: options.release ?? null,
1647
1825
  limit: options.limit ?? null,
1648
- parent: parentScope ?? null,
1826
+ parent: runtime.parentScope ?? null,
1649
1827
  /* c8 ignore next -- listed/calendar runtime filters are always materialized by their command handlers */
1650
- runtime_filters: listed.filters.runtime_filters ?? agenda.filters.runtime_filters ?? {}
1828
+ runtime_filters: corpus.listed.filters.runtime_filters ?? agendaContext.agenda.filters.runtime_filters ?? {}
1651
1829
  },
1652
1830
  summary: {
1653
- active_items: activeItems.length,
1831
+ active_items: focusGroups.activeItems.length,
1654
1832
  in_progress: inProgressCount,
1655
1833
  open: openCount,
1656
- blocked: blockedItems.length,
1657
- blocked_fallback_used: blockedFallbackUsed,
1658
- high_level: highLevel.length,
1659
- low_level: lowLevel.length,
1660
- agenda_events: agendaSummary.events,
1834
+ blocked: focusGroups.blockedItems.length,
1835
+ blocked_fallback_used: focusGroups.blockedFallbackUsed,
1836
+ high_level: focusGroups.highLevel.length,
1837
+ low_level: focusGroups.lowLevel.length,
1838
+ agenda_events: agendaContext.agendaSummary.events,
1661
1839
  ...summaryExtras
1662
1840
  },
1663
- high_level: highLevel,
1664
- low_level: lowLevel,
1665
- blocked_fallback: blockedFallback,
1841
+ high_level: focusGroups.highLevel,
1842
+ low_level: focusGroups.lowLevel,
1843
+ blocked_fallback: focusGroups.blockedFallback,
1666
1844
  agenda: {
1667
- summary: agendaSummary,
1668
- events: agendaEvents
1845
+ summary: agendaContext.agendaSummary,
1846
+ events: agendaContext.agendaEvents
1669
1847
  }
1670
1848
  };
1671
- if (hierarchy)
1672
- result.hierarchy = hierarchy;
1673
- if (activity)
1674
- result.activity = activity;
1675
- if (progress)
1676
- result.progress = progress;
1677
- if (blockersSection)
1678
- result.blockers = blockersSection;
1679
- if (recentlyCreated)
1680
- result.recently_created = recentlyCreated;
1681
- if (unparented)
1682
- result.unparented = unparented;
1683
- if (filesSection)
1684
- result.files = filesSection;
1685
- if (workload)
1686
- result.workload = workload;
1687
- if (staleness)
1688
- result.staleness = staleness;
1689
- if (tests)
1690
- result.tests = tests;
1691
- if (focusFields) {
1692
- result.focus_fields = focusFields;
1693
- result.high_level = projectContextFocusRows(result.high_level, focusFields);
1694
- result.low_level = projectContextFocusRows(result.low_level, focusFields);
1695
- result.blocked_fallback = projectContextFocusRows(result.blocked_fallback, focusFields);
1696
- if (result.recently_created) {
1697
- result.recently_created = projectContextFocusRows(result.recently_created, focusFields);
1698
- }
1699
- if (result.unparented) {
1700
- result.unparented = projectContextFocusRows(result.unparented, focusFields);
1701
- }
1702
- }
1849
+ attachOptionalContextSections(result, sections);
1850
+ applyContextFocusProjection(result, runtime.focusFields);
1703
1851
  if (warnings.length > 0)
1704
1852
  result.warnings = warnings;
1705
- if (activeItems.length === 0 && blockedItems.length === 0 && agendaEvents.length === 0) {
1706
- result.suggestions = [
1707
- 'pm create --type Task --title "..." to add a new work item',
1708
- "pm list --status closed --limit 5 to review recent completions",
1709
- "pm search <keywords> to find related past work",
1710
- "pm aggregate for a full project status overview"
1711
- ];
1712
- }
1853
+ maybeAttachEmptyContextSuggestions(result, focusGroups.activeItems, focusGroups.blockedItems);
1713
1854
  return result;
1714
1855
  }
1715
1856
 
@@ -1728,6 +1869,6 @@ export {
1728
1869
  renderContextMarkdown,
1729
1870
  runContext
1730
1871
  };
1731
- //# sourceMappingURL=chunk-HIBK6H4S.js.map
1872
+ //# sourceMappingURL=chunk-XCHUVHKU.js.map
1732
1873
 
1733
- //# debugId=a060da65-925f-55ab-b13e-d07fceedaeaf
1874
+ //# debugId=95fd55ba-b62a-5ca4-8d6a-02955d7b5692