@unbrained/pm-cli 2026.7.6 → 2026.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-2APXX4TZ.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-2LEJGRQ7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-42LXP4VO.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-43UQN754.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-4BKDAEDF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-4IQKDKGE.js} +15 -23
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-5FIQ4EX3.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-6G6O3OPQ.js} +256 -36
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-ARKHKYYS.js} +13 -21
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-D2DCTFTL.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-DDDWVPID.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-DG6BSXZ7.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-EOUVR7JN.js} +12 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-F6MT7KKE.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-GPIDUMMN.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-GTM5HQL4.js} +11 -15
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-I74FMIWA.js} +10 -16
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-IDIBF4E2.js} +20 -24
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-IDIBF4E2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-II7R6KD4.js} +8 -7
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-LCFJ7XAM.js} +22 -2
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-MCEUKJKW.js} +12 -14
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-MHNMCDWR.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-NWWL22C7.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-Q64AYQYW.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-QDABF2RB.js} +26 -34
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-RB3KLPAH.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-S547WBYG.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-S5BNGFN5.js} +24 -32
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-S6VC2A2K.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-SIM5JDON.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-SY75LYXR.js} +11 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-TNC6MZUD.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-UO7XAZK6.js} +17 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-V5ZWKJNY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-VGO73OCK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-W5HXHC7C.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-XBX5CBRQ.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-XHCVAZGM.js} +13 -17
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-XS2TMNXR.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-XXIYUTLK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-YCVWWIKY.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-YH5NBDFA.js} +22 -26
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-YH5NBDFA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-YPD7SQ5P.js} +7 -6
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-ZNEG2UDO.js} +261 -34
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-44RT5GDW.js} +4 -8
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-YQ2VPXNF.js} +4 -8
- package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-BU5EBJDU.js} +4 -8
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-OQBSJNIA.js} +6 -10
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-HTSB2KJG.js} +6 -10
- package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-FOG4ALC2.js} +7 -9
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-M6IFAMBP.js} +9 -13
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-NHOJG7WO.js} +9 -13
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-T63JGKKN.js} +9 -11
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-TN537L24.js} +10 -15
- package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-MHAMXMHQ.js} +9 -13
- package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-TIGLAKJ7.js} +9 -13
- package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-V6PIYEDU.js} +79 -46
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-V6VKTG54.js} +78 -45
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-6RVAWT6W.js} +129 -29
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-6YVUSQYD.js} +130 -30
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +129 -107
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +122 -117
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +151 -8
- package/dist/sdk/runtime.js +255 -14
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/SDK.md +35 -0
- package/docs/TESTING.md +3 -0
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
- package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-2LEJGRQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-V5ZWKJNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-U7L6HQQ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-OSCNYFGC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-TN537L24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-MHAMXMHQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-TIGLAKJ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-HC3YSWF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-LFAMMRYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DAGSYO6E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-UBXJCQAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-CJGG5WMV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-LKD64AFP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-G4SM7BHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-VLIV3D7R.js.map} +0 -0
|
@@ -1,2043 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
collectRuntimeFilterValues,
|
|
3
|
-
matchesRuntimeFilters,
|
|
4
|
-
runList
|
|
5
|
-
} from "./chunk-46CUF5L6.js";
|
|
6
|
-
import {
|
|
7
|
-
runActivity
|
|
8
|
-
} from "./chunk-2XG4IZON.js";
|
|
9
|
-
import {
|
|
10
|
-
parseIntegerLimit,
|
|
11
|
-
parsePriority,
|
|
12
|
-
parseType
|
|
13
|
-
} from "./chunk-7DT4WSH2.js";
|
|
14
|
-
import {
|
|
15
|
-
listAllFrontMatterLight
|
|
16
|
-
} from "./chunk-5VAA4YHR.js";
|
|
17
|
-
import {
|
|
18
|
-
isTerminalStatus,
|
|
19
|
-
normalizeStatusForRegistry,
|
|
20
|
-
normalizeStatusInput
|
|
21
|
-
} from "./chunk-NMP5I3I5.js";
|
|
22
|
-
import {
|
|
23
|
-
compareTimestampStrings,
|
|
24
|
-
nowIso,
|
|
25
|
-
resolveIsoOrRelative
|
|
26
|
-
} from "./chunk-FLZSGSQR.js";
|
|
27
|
-
import {
|
|
28
|
-
PmCliError,
|
|
29
|
-
getActiveExtensionRegistrations,
|
|
30
|
-
readSettings
|
|
31
|
-
} from "./chunk-SHQY2IDC.js";
|
|
32
|
-
import {
|
|
33
|
-
CONTEXT_DEPTH_VALUES,
|
|
34
|
-
CONTEXT_SECTION_VALUES,
|
|
35
|
-
EXIT_CODE,
|
|
36
|
-
SETTINGS_DEFAULTS,
|
|
37
|
-
getSettingsPath,
|
|
38
|
-
levenshteinDistanceWithinLimit,
|
|
39
|
-
pathExists,
|
|
40
|
-
resolveItemTypeRegistry,
|
|
41
|
-
resolvePmRoot,
|
|
42
|
-
resolveRuntimeFieldRegistry,
|
|
43
|
-
resolveRuntimeStatusRegistry,
|
|
44
|
-
weekdayOrderIndex
|
|
45
|
-
} from "./chunk-LK6XLOGP.js";
|
|
46
|
-
|
|
47
|
-
// dist/cli/commands/calendar.js
|
|
48
|
-
import { encode as encodeToon } from "@toon-format/toon";
|
|
49
|
-
!(function() {
|
|
50
|
-
try {
|
|
51
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
52
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b58c505e-43e8-5bc4-ae0e-a241ee5e72b9");
|
|
53
|
-
} catch (e2) {
|
|
54
|
-
}
|
|
55
|
-
})();
|
|
56
|
-
var CALENDAR_VIEW_VALUES = ["agenda", "day", "week", "month"];
|
|
57
|
-
var CALENDAR_OUTPUT_VALUES = ["markdown", "toon", "json"];
|
|
58
|
-
var UTC_DAY_TO_WEEKDAY = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
59
|
-
var DEFAULT_RECURRENCE_LOOKAHEAD_DAYS = 365;
|
|
60
|
-
var DEFAULT_RECURRENCE_LOOKBACK_DAYS = 365;
|
|
61
|
-
var DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS = 28;
|
|
62
|
-
var MAX_RECURRENCE_OCCURRENCES = 1e3;
|
|
63
|
-
function parseNonNegativeInteger(raw, label) {
|
|
64
|
-
if (raw === void 0)
|
|
65
|
-
return void 0;
|
|
66
|
-
const parsed = Number(raw);
|
|
67
|
-
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
68
|
-
throw new PmCliError(`${label} must be a non-negative integer`, EXIT_CODE.USAGE);
|
|
69
|
-
}
|
|
70
|
-
return parsed;
|
|
71
|
-
}
|
|
72
|
-
function parseIncludeSources(raw) {
|
|
73
|
-
if (!raw) {
|
|
74
|
-
return /* @__PURE__ */ new Set(["deadlines", "reminders", "events"]);
|
|
75
|
-
}
|
|
76
|
-
const normalized = raw.trim().toLowerCase();
|
|
77
|
-
if (normalized === "all") {
|
|
78
|
-
return /* @__PURE__ */ new Set(["deadlines", "reminders", "events"]);
|
|
79
|
-
}
|
|
80
|
-
const values = normalized.split(/[|,]/).map((value) => value.trim()).filter((value) => value.length > 0);
|
|
81
|
-
if (values.length === 0) {
|
|
82
|
-
throw new PmCliError("Calendar include filter must not be empty", EXIT_CODE.USAGE);
|
|
83
|
-
}
|
|
84
|
-
const include = /* @__PURE__ */ new Set();
|
|
85
|
-
for (const value of values) {
|
|
86
|
-
if (value === "deadlines" || value === "deadline") {
|
|
87
|
-
include.add("deadlines");
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (value === "reminders" || value === "reminder") {
|
|
91
|
-
include.add("reminders");
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (value === "events" || value === "event" || value === "scheduled") {
|
|
95
|
-
include.add("events");
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
throw new PmCliError("Calendar include filter must be deadlines|reminders|events|scheduled|all", EXIT_CODE.USAGE);
|
|
99
|
-
}
|
|
100
|
-
return include;
|
|
101
|
-
}
|
|
102
|
-
function suggestClosestChoice(value, choices) {
|
|
103
|
-
let best;
|
|
104
|
-
for (const choice of choices) {
|
|
105
|
-
const distance = levenshteinDistanceWithinLimit(value, choice, 2);
|
|
106
|
-
if (distance !== null && (best === void 0 || distance < best.distance)) {
|
|
107
|
-
best = { choice, distance };
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return best?.choice;
|
|
111
|
-
}
|
|
112
|
-
function parseView(raw) {
|
|
113
|
-
if (!raw)
|
|
114
|
-
return "agenda";
|
|
115
|
-
const normalized = raw.trim().toLowerCase();
|
|
116
|
-
if (!CALENDAR_VIEW_VALUES.includes(normalized)) {
|
|
117
|
-
const suggestion = suggestClosestChoice(normalized, CALENDAR_VIEW_VALUES);
|
|
118
|
-
throw new PmCliError(`Calendar view must be one of ${CALENDAR_VIEW_VALUES.join("|")}${suggestion ? `. Did you mean "${suggestion}"?` : "."}`, EXIT_CODE.USAGE);
|
|
119
|
-
}
|
|
120
|
-
return normalized;
|
|
121
|
-
}
|
|
122
|
-
function parseOutputFormat(raw) {
|
|
123
|
-
if (!raw)
|
|
124
|
-
return void 0;
|
|
125
|
-
const normalized = raw.trim().toLowerCase();
|
|
126
|
-
if (!CALENDAR_OUTPUT_VALUES.includes(normalized)) {
|
|
127
|
-
const suggestion = suggestClosestChoice(normalized, CALENDAR_OUTPUT_VALUES);
|
|
128
|
-
throw new PmCliError(`Calendar format must be one of ${CALENDAR_OUTPUT_VALUES.join("|")}${suggestion ? `. Did you mean "${suggestion}"?` : "."}`, EXIT_CODE.USAGE);
|
|
129
|
-
}
|
|
130
|
-
return normalized;
|
|
131
|
-
}
|
|
132
|
-
function resolveCalendarOutputFormat(options, global2) {
|
|
133
|
-
const commandFormat = parseOutputFormat(options.format);
|
|
134
|
-
if (global2.json && commandFormat && commandFormat !== "json") {
|
|
135
|
-
throw new PmCliError("Cannot combine --json with --format markdown|toon", EXIT_CODE.USAGE);
|
|
136
|
-
}
|
|
137
|
-
if (global2.json) {
|
|
138
|
-
return "json";
|
|
139
|
-
}
|
|
140
|
-
return commandFormat ?? "markdown";
|
|
141
|
-
}
|
|
142
|
-
function parseStatus(raw, statusRegistry) {
|
|
143
|
-
if (raw === void 0)
|
|
144
|
-
return void 0;
|
|
145
|
-
const normalized = normalizeStatusInput(raw, statusRegistry);
|
|
146
|
-
if (!normalized) {
|
|
147
|
-
const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);
|
|
148
|
-
throw new PmCliError(`Calendar status filter must be one of ${allowedStatuses.join("|")}`, EXIT_CODE.USAGE);
|
|
149
|
-
}
|
|
150
|
-
return normalized;
|
|
151
|
-
}
|
|
152
|
-
function parseAssigneeFilter(raw) {
|
|
153
|
-
if (raw === void 0) {
|
|
154
|
-
return void 0;
|
|
155
|
-
}
|
|
156
|
-
const normalized = raw.trim().toLowerCase();
|
|
157
|
-
if (!normalized) {
|
|
158
|
-
throw new PmCliError("Calendar assignee filter must be one of assigned|unassigned", EXIT_CODE.USAGE);
|
|
159
|
-
}
|
|
160
|
-
if (normalized !== "assigned" && normalized !== "unassigned") {
|
|
161
|
-
throw new PmCliError(`Invalid calendar assignee filter "${raw}". Allowed: assigned|unassigned`, EXIT_CODE.USAGE);
|
|
162
|
-
}
|
|
163
|
-
return normalized;
|
|
164
|
-
}
|
|
165
|
-
function toUtcDayKey(timestamp) {
|
|
166
|
-
return new Date(timestamp).toISOString().slice(0, 10);
|
|
167
|
-
}
|
|
168
|
-
function toLocalDayKey(timestamp, timezone) {
|
|
169
|
-
if (!timezone || timezone === "UTC") {
|
|
170
|
-
return toUtcDayKey(timestamp);
|
|
171
|
-
}
|
|
172
|
-
try {
|
|
173
|
-
const parts = new Intl.DateTimeFormat("en-CA", {
|
|
174
|
-
timeZone: timezone,
|
|
175
|
-
year: "numeric",
|
|
176
|
-
month: "2-digit",
|
|
177
|
-
day: "2-digit"
|
|
178
|
-
}).formatToParts(new Date(timestamp));
|
|
179
|
-
const year = parts.find((part) => part.type === "year")?.value;
|
|
180
|
-
const month = parts.find((part) => part.type === "month")?.value;
|
|
181
|
-
const day = parts.find((part) => part.type === "day")?.value;
|
|
182
|
-
if (year && month && day) {
|
|
183
|
-
return `${year}-${month}-${day}`;
|
|
184
|
-
}
|
|
185
|
-
} catch {
|
|
186
|
-
}
|
|
187
|
-
return toUtcDayKey(timestamp);
|
|
188
|
-
}
|
|
189
|
-
function startOfUtcDay(timestamp) {
|
|
190
|
-
const date = new Date(timestamp);
|
|
191
|
-
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0, 0)).toISOString();
|
|
192
|
-
}
|
|
193
|
-
function addUtcDays(timestamp, days) {
|
|
194
|
-
const date = new Date(timestamp);
|
|
195
|
-
return new Date(date.getTime() + days * 24 * 60 * 60 * 1e3).toISOString();
|
|
196
|
-
}
|
|
197
|
-
function startOfUtcWeekMonday(timestamp) {
|
|
198
|
-
const base = new Date(startOfUtcDay(timestamp));
|
|
199
|
-
const day = base.getUTCDay();
|
|
200
|
-
const delta = day === 0 ? -6 : 1 - day;
|
|
201
|
-
return addUtcDays(base.toISOString(), delta);
|
|
202
|
-
}
|
|
203
|
-
function startOfUtcMonth(timestamp) {
|
|
204
|
-
const date = new Date(timestamp);
|
|
205
|
-
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1, 0, 0, 0, 0)).toISOString();
|
|
206
|
-
}
|
|
207
|
-
function startOfNextUtcMonth(timestamp) {
|
|
208
|
-
const date = new Date(timestamp);
|
|
209
|
-
return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1, 0, 0, 0, 0)).toISOString();
|
|
210
|
-
}
|
|
211
|
-
function maxTimestamp(left, right) {
|
|
212
|
-
return compareTimestampStrings(left, right) >= 0 ? left : right;
|
|
213
|
-
}
|
|
214
|
-
function toSortedCountRecord(values) {
|
|
215
|
-
return Object.fromEntries([...values.entries()].sort(([left], [right]) => left.localeCompare(right)));
|
|
216
|
-
}
|
|
217
|
-
function incrementCount(values, key) {
|
|
218
|
-
values.set(key, (values.get(key) ?? 0) + 1);
|
|
219
|
-
}
|
|
220
|
-
function formatRecurrenceRuleForSummary(rule) {
|
|
221
|
-
if (!rule) {
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
const parts = [`freq=${rule.freq}`];
|
|
225
|
-
if (rule.interval !== void 0) {
|
|
226
|
-
parts.push(`interval=${rule.interval}`);
|
|
227
|
-
}
|
|
228
|
-
if (rule.count !== void 0) {
|
|
229
|
-
parts.push(`count=${rule.count}`);
|
|
230
|
-
}
|
|
231
|
-
if (rule.until) {
|
|
232
|
-
parts.push(`until=${rule.until}`);
|
|
233
|
-
}
|
|
234
|
-
if (rule.by_weekday && rule.by_weekday.length > 0) {
|
|
235
|
-
const weekdays = [...rule.by_weekday].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));
|
|
236
|
-
parts.push(`by_weekday=${weekdays.join("|")}`);
|
|
237
|
-
}
|
|
238
|
-
if (rule.by_month_day && rule.by_month_day.length > 0) {
|
|
239
|
-
const monthDays = [...rule.by_month_day].sort((left, right) => left - right);
|
|
240
|
-
parts.push(`by_month_day=${monthDays.join("|")}`);
|
|
241
|
-
}
|
|
242
|
-
if (rule.exdates && rule.exdates.length > 0) {
|
|
243
|
-
const exdates = [...rule.exdates].sort((left, right) => left.localeCompare(right));
|
|
244
|
-
parts.push(`exdates=${exdates.join("|")}`);
|
|
245
|
-
}
|
|
246
|
-
return parts.join(",");
|
|
247
|
-
}
|
|
248
|
-
function buildUtcTimestamp(year, month, day, timeSource) {
|
|
249
|
-
const candidate = new Date(Date.UTC(year, month, day, timeSource.getUTCHours(), timeSource.getUTCMinutes(), timeSource.getUTCSeconds(), timeSource.getUTCMilliseconds()));
|
|
250
|
-
if (candidate.getUTCFullYear() !== year || candidate.getUTCMonth() !== month || candidate.getUTCDate() !== day) {
|
|
251
|
-
return void 0;
|
|
252
|
-
}
|
|
253
|
-
return candidate.toISOString();
|
|
254
|
-
}
|
|
255
|
-
function weekdayToken(timestamp) {
|
|
256
|
-
return UTC_DAY_TO_WEEKDAY[new Date(timestamp).getUTCDay()];
|
|
257
|
-
}
|
|
258
|
-
function normalizeInstantKey(timestamp) {
|
|
259
|
-
const parsed = Date.parse(timestamp);
|
|
260
|
-
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : null;
|
|
261
|
-
}
|
|
262
|
-
function buildExcludedInstantSet(exdates) {
|
|
263
|
-
const excluded = /* @__PURE__ */ new Set();
|
|
264
|
-
for (const exdate of exdates ?? []) {
|
|
265
|
-
const instantKey = normalizeInstantKey(exdate);
|
|
266
|
-
if (instantKey) {
|
|
267
|
-
excluded.add(instantKey);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return excluded;
|
|
271
|
-
}
|
|
272
|
-
function buildRecurringEventWindow(start, end, nowValue, lookbackDays, lookaheadDays) {
|
|
273
|
-
const windowStart = start ?? addUtcDays(nowValue, -(lookbackDays ?? DEFAULT_RECURRENCE_LOOKBACK_DAYS));
|
|
274
|
-
const windowEnd = end ?? addUtcDays(start ?? nowValue, lookaheadDays ?? DEFAULT_RECURRENCE_LOOKAHEAD_DAYS);
|
|
275
|
-
return {
|
|
276
|
-
start: windowStart,
|
|
277
|
-
end: compareTimestampStrings(windowEnd, windowStart) > 0 ? windowEnd : addUtcDays(windowStart, 1)
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
function buildRecurrenceExpansionContext(startAt, recurrence, window2, occurrenceLimit) {
|
|
281
|
-
const recurrenceWeekdays = recurrence.by_weekday !== void 0 ? [...recurrence.by_weekday] : [weekdayToken(startAt)];
|
|
282
|
-
const recurrenceMonthDays = recurrence.by_month_day !== void 0 ? [...recurrence.by_month_day] : [new Date(startAt).getUTCDate()];
|
|
283
|
-
return {
|
|
284
|
-
startAt,
|
|
285
|
-
startDate: new Date(startAt),
|
|
286
|
-
window: window2,
|
|
287
|
-
maxOccurrences: occurrenceLimit ?? MAX_RECURRENCE_OCCURRENCES,
|
|
288
|
-
interval: recurrence.interval ?? 1,
|
|
289
|
-
countLimit: recurrence.count ?? Number.POSITIVE_INFINITY,
|
|
290
|
-
until: recurrence.until,
|
|
291
|
-
excluded: buildExcludedInstantSet(recurrence.exdates),
|
|
292
|
-
weekdayFilter: recurrence.by_weekday !== void 0 ? new Set(recurrence.by_weekday) : void 0,
|
|
293
|
-
monthDayFilter: recurrence.by_month_day !== void 0 ? new Set(recurrence.by_month_day) : void 0,
|
|
294
|
-
sortedWeekdays: [...new Set(recurrenceWeekdays)].sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right)),
|
|
295
|
-
sortedMonthDays: [...new Set(recurrenceMonthDays)].sort((left, right) => left - right),
|
|
296
|
-
occurrences: [],
|
|
297
|
-
produced: 0
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
function consumeRecurrenceCandidate(context, candidateAt) {
|
|
301
|
-
if (compareTimestampStrings(candidateAt, context.startAt) < 0) {
|
|
302
|
-
return "continue";
|
|
303
|
-
}
|
|
304
|
-
if (context.until && compareTimestampStrings(candidateAt, context.until) > 0) {
|
|
305
|
-
return "stop";
|
|
306
|
-
}
|
|
307
|
-
if (compareTimestampStrings(candidateAt, context.window.end) >= 0) {
|
|
308
|
-
return "stop";
|
|
309
|
-
}
|
|
310
|
-
if (context.excluded.has(candidateAt)) {
|
|
311
|
-
return "continue";
|
|
312
|
-
}
|
|
313
|
-
context.produced += 1;
|
|
314
|
-
if (compareTimestampStrings(candidateAt, context.window.start) >= 0) {
|
|
315
|
-
context.occurrences.push(candidateAt);
|
|
316
|
-
}
|
|
317
|
-
return context.produced >= context.countLimit || context.occurrences.length >= context.maxOccurrences ? "stop" : "continue";
|
|
318
|
-
}
|
|
319
|
-
function recurrenceDayMatchesFilters(context, candidateAt) {
|
|
320
|
-
const candidateWeekday = weekdayToken(candidateAt);
|
|
321
|
-
const candidateMonthDay = new Date(candidateAt).getUTCDate();
|
|
322
|
-
const weekdayMatches = !context.weekdayFilter || context.weekdayFilter.has(candidateWeekday);
|
|
323
|
-
const monthDayMatches = !context.monthDayFilter || context.monthDayFilter.has(candidateMonthDay);
|
|
324
|
-
return weekdayMatches && monthDayMatches;
|
|
325
|
-
}
|
|
326
|
-
function expandDailyOccurrences(context) {
|
|
327
|
-
let candidateAt = context.startAt;
|
|
328
|
-
for (let iteration = 0; iteration < context.maxOccurrences; iteration += 1) {
|
|
329
|
-
if (recurrenceDayMatchesFilters(context, candidateAt) && consumeRecurrenceCandidate(context, candidateAt) === "stop") {
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
candidateAt = addUtcDays(candidateAt, context.interval);
|
|
333
|
-
}
|
|
334
|
-
return context.occurrences;
|
|
335
|
-
}
|
|
336
|
-
function buildWeeklyCandidateAt(context, candidateWeekStart, weekday) {
|
|
337
|
-
const dayOffset = weekdayOrderIndex(weekday);
|
|
338
|
-
const candidateDay = addUtcDays(candidateWeekStart, dayOffset);
|
|
339
|
-
const dayDate = new Date(candidateDay);
|
|
340
|
-
return new Date(Date.UTC(dayDate.getUTCFullYear(), dayDate.getUTCMonth(), dayDate.getUTCDate(), context.startDate.getUTCHours(), context.startDate.getUTCMinutes(), context.startDate.getUTCSeconds(), context.startDate.getUTCMilliseconds())).toISOString();
|
|
341
|
-
}
|
|
342
|
-
function expandWeeklyOccurrences(context) {
|
|
343
|
-
const weekStart = startOfUtcWeekMonday(context.startAt);
|
|
344
|
-
for (let step = 0; step < context.maxOccurrences; step += 1) {
|
|
345
|
-
const candidateWeekStart = addUtcDays(weekStart, step * context.interval * 7);
|
|
346
|
-
for (const weekday of context.sortedWeekdays) {
|
|
347
|
-
const candidateAt = buildWeeklyCandidateAt(context, candidateWeekStart, weekday);
|
|
348
|
-
if (!recurrenceDayMatchesFilters(context, candidateAt)) {
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
|
|
352
|
-
return context.occurrences;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return context.occurrences;
|
|
357
|
-
}
|
|
358
|
-
function expandMonthlyOccurrences(context) {
|
|
359
|
-
const startYear = context.startDate.getUTCFullYear();
|
|
360
|
-
const startMonth = context.startDate.getUTCMonth();
|
|
361
|
-
for (let step = 0; step < context.maxOccurrences; step += 1) {
|
|
362
|
-
const monthAnchor = new Date(Date.UTC(startYear, startMonth + step * context.interval, 1, 0, 0, 0, 0));
|
|
363
|
-
for (const monthDay of context.sortedMonthDays) {
|
|
364
|
-
const candidateAt = buildUtcTimestamp(monthAnchor.getUTCFullYear(), monthAnchor.getUTCMonth(), monthDay, context.startDate);
|
|
365
|
-
if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
|
|
366
|
-
continue;
|
|
367
|
-
}
|
|
368
|
-
if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
|
|
369
|
-
return context.occurrences;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return context.occurrences;
|
|
374
|
-
}
|
|
375
|
-
function expandYearlyOccurrences(context) {
|
|
376
|
-
const year = context.startDate.getUTCFullYear();
|
|
377
|
-
const month = context.startDate.getUTCMonth();
|
|
378
|
-
for (let step = 0; step < context.maxOccurrences; step += 1) {
|
|
379
|
-
const candidateYear = year + step * context.interval;
|
|
380
|
-
for (const monthDay of context.sortedMonthDays) {
|
|
381
|
-
const candidateAt = buildUtcTimestamp(candidateYear, month, monthDay, context.startDate);
|
|
382
|
-
if (!candidateAt || !recurrenceDayMatchesFilters(context, candidateAt)) {
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
385
|
-
if (consumeRecurrenceCandidate(context, candidateAt) === "stop") {
|
|
386
|
-
return context.occurrences;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
return context.occurrences;
|
|
391
|
-
}
|
|
392
|
-
function expandRecurringOccurrences(startAt, recurrence, window2, occurrenceLimit) {
|
|
393
|
-
const context = buildRecurrenceExpansionContext(startAt, recurrence, window2, occurrenceLimit);
|
|
394
|
-
if (recurrence.freq === "daily") {
|
|
395
|
-
return expandDailyOccurrences(context);
|
|
396
|
-
}
|
|
397
|
-
if (recurrence.freq === "weekly") {
|
|
398
|
-
return expandWeeklyOccurrences(context);
|
|
399
|
-
}
|
|
400
|
-
if (recurrence.freq === "monthly") {
|
|
401
|
-
return expandMonthlyOccurrences(context);
|
|
402
|
-
}
|
|
403
|
-
return expandYearlyOccurrences(context);
|
|
404
|
-
}
|
|
405
|
-
function sortEvents(values) {
|
|
406
|
-
return [...values].sort((a, b) => {
|
|
407
|
-
const byAt = compareTimestampStrings(a.at, b.at);
|
|
408
|
-
if (byAt !== 0)
|
|
409
|
-
return byAt;
|
|
410
|
-
const byPriority = a.item_priority - b.item_priority;
|
|
411
|
-
if (byPriority !== 0)
|
|
412
|
-
return byPriority;
|
|
413
|
-
const byId = a.item_id.localeCompare(b.item_id);
|
|
414
|
-
if (byId !== 0)
|
|
415
|
-
return byId;
|
|
416
|
-
const byKind = a.kind.localeCompare(b.kind);
|
|
417
|
-
if (byKind !== 0)
|
|
418
|
-
return byKind;
|
|
419
|
-
const byEventTitle = String(a.event_title).localeCompare(String(b.event_title));
|
|
420
|
-
if (byEventTitle !== 0)
|
|
421
|
-
return byEventTitle;
|
|
422
|
-
return String(a.reminder_text).localeCompare(String(b.reminder_text));
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
function buildItemCalendarRowBase(item) {
|
|
426
|
-
return {
|
|
427
|
-
item_id: item.id,
|
|
428
|
-
item_title: item.title,
|
|
429
|
-
item_type: item.type,
|
|
430
|
-
item_status: item.status,
|
|
431
|
-
item_priority: item.priority,
|
|
432
|
-
item_assignee: item.assignee ?? null,
|
|
433
|
-
item_deadline: item.deadline ?? null,
|
|
434
|
-
item_tags: item.tags
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function buildDeadlineRow(item) {
|
|
438
|
-
if (!item.deadline) {
|
|
439
|
-
return null;
|
|
440
|
-
}
|
|
441
|
-
return {
|
|
442
|
-
at: item.deadline,
|
|
443
|
-
date: toUtcDayKey(item.deadline),
|
|
444
|
-
kind: "deadline",
|
|
445
|
-
reminder_text: null,
|
|
446
|
-
event_title: null,
|
|
447
|
-
event_end: null,
|
|
448
|
-
event_location: null,
|
|
449
|
-
event_all_day: null,
|
|
450
|
-
event_timezone: null,
|
|
451
|
-
event_recurring: null,
|
|
452
|
-
event_recurrence_rule: null,
|
|
453
|
-
...buildItemCalendarRowBase(item),
|
|
454
|
-
item_deadline: item.deadline
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
function buildReminderRows(item) {
|
|
458
|
-
return (item.reminders ?? []).map((reminder) => ({
|
|
459
|
-
at: reminder.at,
|
|
460
|
-
date: toUtcDayKey(reminder.at),
|
|
461
|
-
kind: "reminder",
|
|
462
|
-
reminder_text: reminder.text,
|
|
463
|
-
event_title: null,
|
|
464
|
-
event_end: null,
|
|
465
|
-
event_location: null,
|
|
466
|
-
event_all_day: null,
|
|
467
|
-
event_timezone: null,
|
|
468
|
-
event_recurring: null,
|
|
469
|
-
event_recurrence_rule: null,
|
|
470
|
-
...buildItemCalendarRowBase(item)
|
|
471
|
-
}));
|
|
472
|
-
}
|
|
473
|
-
function recurringDurationMs(startAt, endAt) {
|
|
474
|
-
if (!endAt) {
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
const duration = Date.parse(endAt) - Date.parse(startAt);
|
|
478
|
-
return Number.isFinite(duration) && duration > 0 ? duration : null;
|
|
479
|
-
}
|
|
480
|
-
function eventOccurrenceEnd(occurrenceAt, event, durationMs) {
|
|
481
|
-
return event.recurrence && durationMs !== null ? new Date(new Date(occurrenceAt).getTime() + durationMs).toISOString() : event.end_at ?? null;
|
|
482
|
-
}
|
|
483
|
-
function buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit) {
|
|
484
|
-
const recurrenceRuleSummary = formatRecurrenceRuleForSummary(event.recurrence);
|
|
485
|
-
const durationMs = recurringDurationMs(event.start_at, event.end_at);
|
|
486
|
-
const occurrences = event.recurrence ? expandRecurringOccurrences(event.start_at, event.recurrence, recurringWindow, occurrenceLimit) : [event.start_at];
|
|
487
|
-
return occurrences.map((occurrenceAt) => ({
|
|
488
|
-
at: occurrenceAt,
|
|
489
|
-
// All-day events are timezone-agnostic calendar dates: bucket by the
|
|
490
|
-
// literal start date. Timed events bucket by their local day in the
|
|
491
|
-
// event's timezone (defaults to UTC when unset).
|
|
492
|
-
date: event.all_day === true ? occurrenceAt.slice(0, 10) : toLocalDayKey(occurrenceAt, event.timezone),
|
|
493
|
-
kind: "event",
|
|
494
|
-
reminder_text: event.description ?? null,
|
|
495
|
-
event_title: event.title ?? item.title,
|
|
496
|
-
event_end: eventOccurrenceEnd(occurrenceAt, event, durationMs),
|
|
497
|
-
event_location: event.location ?? null,
|
|
498
|
-
event_all_day: event.all_day ?? null,
|
|
499
|
-
event_timezone: event.timezone ?? null,
|
|
500
|
-
event_recurring: event.recurrence ? true : false,
|
|
501
|
-
event_recurrence_rule: recurrenceRuleSummary,
|
|
502
|
-
...buildItemCalendarRowBase(item)
|
|
503
|
-
}));
|
|
504
|
-
}
|
|
505
|
-
function buildEventSeed(items, recurringWindow, includeSources, occurrenceLimit) {
|
|
506
|
-
const events = [];
|
|
507
|
-
for (const item of items) {
|
|
508
|
-
const deadlineRow = includeSources.has("deadlines") ? buildDeadlineRow(item) : null;
|
|
509
|
-
if (deadlineRow) {
|
|
510
|
-
events.push(deadlineRow);
|
|
511
|
-
}
|
|
512
|
-
if (includeSources.has("reminders")) {
|
|
513
|
-
events.push(...buildReminderRows(item));
|
|
514
|
-
}
|
|
515
|
-
for (const event of includeSources.has("events") ? item.events ?? [] : []) {
|
|
516
|
-
events.push(...buildScheduledEventRows(item, event, recurringWindow, occurrenceLimit));
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return sortEvents(events);
|
|
520
|
-
}
|
|
521
|
-
function filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldFilters) {
|
|
522
|
-
const typeFilter = parseType(options.type, typeRegistry);
|
|
523
|
-
const tagFilter = options.tag?.trim().toLowerCase();
|
|
524
|
-
const priorityFilter = parsePriority(options.priority);
|
|
525
|
-
const statusFilter = parseStatus(options.status, statusRegistry);
|
|
526
|
-
const assigneeFilter = options.assignee?.trim();
|
|
527
|
-
const assigneeModeFilter = parseAssigneeFilter(options.assigneeFilter);
|
|
528
|
-
const sprintFilter = options.sprint?.trim();
|
|
529
|
-
const releaseFilter = options.release?.trim();
|
|
530
|
-
if (assigneeFilter && (assigneeFilter.toLowerCase() === "none" || assigneeFilter.toLowerCase() === "null")) {
|
|
531
|
-
throw new PmCliError('--assignee no longer accepts "none" or "null". Use --assignee-filter unassigned.', EXIT_CODE.USAGE);
|
|
532
|
-
}
|
|
533
|
-
if (assigneeFilter !== void 0 && assigneeModeFilter === "unassigned") {
|
|
534
|
-
throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned", EXIT_CODE.USAGE);
|
|
535
|
-
}
|
|
536
|
-
return items.filter((item) => itemMatchesCalendarFilters(item, {
|
|
537
|
-
typeFilter,
|
|
538
|
-
tagFilter,
|
|
539
|
-
priorityFilter,
|
|
540
|
-
statusFilter,
|
|
541
|
-
assigneeFilter,
|
|
542
|
-
assigneeModeFilter,
|
|
543
|
-
sprintFilter,
|
|
544
|
-
releaseFilter,
|
|
545
|
-
runtimeFieldFilters
|
|
546
|
-
}));
|
|
547
|
-
}
|
|
548
|
-
function itemMatchesCalendarFilters(item, filters) {
|
|
549
|
-
return itemMatchesCalendarIdentityFilters(item, filters) && itemMatchesCalendarOwnerFilters(item, filters) && matchesRuntimeFilters(item, filters.runtimeFieldFilters);
|
|
550
|
-
}
|
|
551
|
-
function itemMatchesCalendarIdentityFilters(item, filters) {
|
|
552
|
-
if (filters.typeFilter && item.type !== filters.typeFilter)
|
|
553
|
-
return false;
|
|
554
|
-
if (filters.tagFilter && !item.tags.some((tag) => tag.trim().toLowerCase() === filters.tagFilter))
|
|
555
|
-
return false;
|
|
556
|
-
if (filters.priorityFilter !== void 0 && item.priority !== filters.priorityFilter)
|
|
557
|
-
return false;
|
|
558
|
-
if (filters.statusFilter && item.status !== filters.statusFilter)
|
|
559
|
-
return false;
|
|
560
|
-
return true;
|
|
561
|
-
}
|
|
562
|
-
function itemMatchesCalendarOwnerFilters(item, filters) {
|
|
563
|
-
if (filters.assigneeModeFilter === "assigned" && !item.assignee)
|
|
564
|
-
return false;
|
|
565
|
-
if (filters.assigneeModeFilter === "unassigned" && item.assignee)
|
|
566
|
-
return false;
|
|
567
|
-
if (filters.assigneeFilter !== void 0 && item.assignee !== filters.assigneeFilter)
|
|
568
|
-
return false;
|
|
569
|
-
if (filters.sprintFilter !== void 0 && item.sprint !== filters.sprintFilter)
|
|
570
|
-
return false;
|
|
571
|
-
if (filters.releaseFilter !== void 0 && item.release !== filters.releaseFilter)
|
|
572
|
-
return false;
|
|
573
|
-
return true;
|
|
574
|
-
}
|
|
575
|
-
function includeEventInWindow(event, start, end) {
|
|
576
|
-
if (start && compareTimestampStrings(event.at, start) < 0) {
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
-
if (end && compareTimestampStrings(event.at, end) >= 0) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
|
-
return true;
|
|
583
|
-
}
|
|
584
|
-
function resolveCalendarBoundaryInput(raw, nowValue, fieldLabel) {
|
|
585
|
-
if (raw.trim().toLowerCase() === "today") {
|
|
586
|
-
return startOfUtcDay(nowValue);
|
|
587
|
-
}
|
|
588
|
-
return resolveIsoOrRelative(raw, new Date(nowValue), fieldLabel);
|
|
589
|
-
}
|
|
590
|
-
function buildRange(view, options, nowValue) {
|
|
591
|
-
const anchor = options.date ? resolveCalendarBoundaryInput(options.date, nowValue, "--date") : nowValue;
|
|
592
|
-
const includePast = options.past === true;
|
|
593
|
-
const fullPeriodRequested = options.fullPeriod === true;
|
|
594
|
-
const from = options.from ? resolveCalendarBoundaryInput(options.from, nowValue, "--from") : void 0;
|
|
595
|
-
const to = options.to ? resolveCalendarBoundaryInput(options.to, nowValue, "--to") : void 0;
|
|
596
|
-
if (from && to && compareTimestampStrings(from, to) >= 0) {
|
|
597
|
-
throw new PmCliError("Calendar --from must be before --to", EXIT_CODE.USAGE);
|
|
598
|
-
}
|
|
599
|
-
if (view !== "agenda" && (options.from !== void 0 || options.to !== void 0)) {
|
|
600
|
-
throw new PmCliError("--from and --to are only supported for --view agenda", EXIT_CODE.USAGE);
|
|
601
|
-
}
|
|
602
|
-
if (view === "agenda") {
|
|
603
|
-
return buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to);
|
|
604
|
-
}
|
|
605
|
-
if (view === "day") {
|
|
606
|
-
const dayStart = startOfUtcDay(anchor);
|
|
607
|
-
return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, dayStart, addUtcDays(dayStart, 1));
|
|
608
|
-
}
|
|
609
|
-
if (view === "week") {
|
|
610
|
-
const weekStart = startOfUtcWeekMonday(anchor);
|
|
611
|
-
return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, weekStart, addUtcDays(weekStart, 7));
|
|
612
|
-
}
|
|
613
|
-
const monthStart = startOfUtcMonth(anchor);
|
|
614
|
-
return buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, monthStart, startOfNextUtcMonth(anchor));
|
|
615
|
-
}
|
|
616
|
-
function buildAgendaRange(anchor, options, nowValue, includePast, fullPeriodRequested, from, to) {
|
|
617
|
-
if (fullPeriodRequested) {
|
|
618
|
-
throw new PmCliError("--full-period is only supported for --view day|week|month. For agenda windows, use --from and --to.", EXIT_CODE.USAGE);
|
|
619
|
-
}
|
|
620
|
-
return {
|
|
621
|
-
anchor,
|
|
622
|
-
start: from ?? (options.date ? anchor : includePast ? void 0 : nowValue),
|
|
623
|
-
end: to,
|
|
624
|
-
fullPeriod: false
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
function buildFixedPeriodRange(anchor, nowValue, includePast, fullPeriodRequested, periodStart, periodEnd) {
|
|
628
|
-
const fullPeriod = includePast || fullPeriodRequested;
|
|
629
|
-
return {
|
|
630
|
-
anchor,
|
|
631
|
-
start: fullPeriod ? periodStart : maxTimestamp(periodStart, nowValue),
|
|
632
|
-
end: periodEnd,
|
|
633
|
-
periodStart,
|
|
634
|
-
periodEnd,
|
|
635
|
-
fullPeriod
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
function bucketEventsByDay(events) {
|
|
639
|
-
const dayMap = /* @__PURE__ */ new Map();
|
|
640
|
-
for (const event of events) {
|
|
641
|
-
const list = dayMap.get(event.date) ?? [];
|
|
642
|
-
list.push(event);
|
|
643
|
-
dayMap.set(event.date, list);
|
|
644
|
-
}
|
|
645
|
-
return [...dayMap.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([date, dayEvents]) => ({
|
|
646
|
-
date,
|
|
647
|
-
count: dayEvents.length,
|
|
648
|
-
events: sortEvents(dayEvents)
|
|
649
|
-
}));
|
|
650
|
-
}
|
|
651
|
-
function summarize(events) {
|
|
652
|
-
const itemIds = /* @__PURE__ */ new Set();
|
|
653
|
-
const byType = /* @__PURE__ */ new Map();
|
|
654
|
-
const byStatus = /* @__PURE__ */ new Map();
|
|
655
|
-
let deadlines = 0;
|
|
656
|
-
let reminders = 0;
|
|
657
|
-
let scheduled = 0;
|
|
658
|
-
let recurringEvents = 0;
|
|
659
|
-
for (const event of events) {
|
|
660
|
-
itemIds.add(event.item_id);
|
|
661
|
-
incrementCount(byType, event.item_type);
|
|
662
|
-
incrementCount(byStatus, event.item_status);
|
|
663
|
-
if (event.kind === "deadline") {
|
|
664
|
-
deadlines += 1;
|
|
665
|
-
} else if (event.kind === "reminder") {
|
|
666
|
-
reminders += 1;
|
|
667
|
-
} else {
|
|
668
|
-
scheduled += 1;
|
|
669
|
-
if (event.event_recurring === true) {
|
|
670
|
-
recurringEvents += 1;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
return {
|
|
675
|
-
events: events.length,
|
|
676
|
-
items: itemIds.size,
|
|
677
|
-
deadlines,
|
|
678
|
-
reminders,
|
|
679
|
-
scheduled,
|
|
680
|
-
by_kind: {
|
|
681
|
-
deadline: deadlines,
|
|
682
|
-
reminder: reminders,
|
|
683
|
-
event: scheduled
|
|
684
|
-
},
|
|
685
|
-
by_type: toSortedCountRecord(byType),
|
|
686
|
-
by_status: toSortedCountRecord(byStatus),
|
|
687
|
-
recurring_events: recurringEvents
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
function formatWindow(range) {
|
|
691
|
-
const start = range.start ?? "unbounded";
|
|
692
|
-
const end = range.end ?? "unbounded";
|
|
693
|
-
return `${start} -> ${end}`;
|
|
694
|
-
}
|
|
695
|
-
function formatClock(timestamp, timezone) {
|
|
696
|
-
if (timezone && timezone !== "UTC") {
|
|
697
|
-
try {
|
|
698
|
-
const parts = new Intl.DateTimeFormat("en-GB", {
|
|
699
|
-
timeZone: timezone,
|
|
700
|
-
hour: "2-digit",
|
|
701
|
-
minute: "2-digit",
|
|
702
|
-
hourCycle: "h23"
|
|
703
|
-
}).formatToParts(new Date(timestamp));
|
|
704
|
-
const hour = parts.find((part) => part.type === "hour")?.value;
|
|
705
|
-
const minute = parts.find((part) => part.type === "minute")?.value;
|
|
706
|
-
if (hour && minute) {
|
|
707
|
-
return `${hour}:${minute}`;
|
|
708
|
-
}
|
|
709
|
-
} catch {
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
return `${new Date(timestamp).toISOString().slice(11, 16)}Z`;
|
|
713
|
-
}
|
|
714
|
-
function formatSummaryCountRecord(values) {
|
|
715
|
-
const entries = Object.entries(values);
|
|
716
|
-
if (entries.length === 0) {
|
|
717
|
-
return "empty";
|
|
718
|
-
}
|
|
719
|
-
return entries.map(([key, value]) => `${key}=${value}`).join(", ");
|
|
720
|
-
}
|
|
721
|
-
function formatEventEnd(event) {
|
|
722
|
-
if (!event.event_end) {
|
|
723
|
-
return null;
|
|
724
|
-
}
|
|
725
|
-
if (event.event_all_day === true) {
|
|
726
|
-
return event.event_end.slice(0, 10);
|
|
727
|
-
}
|
|
728
|
-
if (event.date === toLocalDayKey(event.event_end, event.event_timezone)) {
|
|
729
|
-
return formatClock(event.event_end, event.event_timezone);
|
|
730
|
-
}
|
|
731
|
-
return event.event_end;
|
|
732
|
-
}
|
|
733
|
-
function formatEventLine(event) {
|
|
734
|
-
const core = `${formatClock(event.at, event.event_timezone)} [${event.kind}] ${event.item_id} type=${event.item_type} p${event.item_priority} ${event.item_status} ${event.item_title}`;
|
|
735
|
-
if (event.kind === "reminder") {
|
|
736
|
-
const reminderText = event.reminder_text ?? "";
|
|
737
|
-
return `${core} \u2014 ${reminderText} reminder=${JSON.stringify(reminderText)}`;
|
|
738
|
-
}
|
|
739
|
-
if (event.kind === "event") {
|
|
740
|
-
const details = [];
|
|
741
|
-
const title = event.event_title ?? event.item_title;
|
|
742
|
-
const titleDiffers = event.event_title !== null && event.event_title !== event.item_title;
|
|
743
|
-
if (titleDiffers) {
|
|
744
|
-
details.push(title);
|
|
745
|
-
details.push(`title=${JSON.stringify(title)}`);
|
|
746
|
-
}
|
|
747
|
-
if (event.event_recurring) {
|
|
748
|
-
details.push("(recurring)");
|
|
749
|
-
details.push("recurring=true");
|
|
750
|
-
}
|
|
751
|
-
const end = formatEventEnd(event);
|
|
752
|
-
if (end) {
|
|
753
|
-
details.push(`end=${end}`);
|
|
754
|
-
}
|
|
755
|
-
if (event.event_all_day !== null) {
|
|
756
|
-
details.push(`all_day=${event.event_all_day ? "true" : "false"}`);
|
|
757
|
-
}
|
|
758
|
-
if (event.event_timezone) {
|
|
759
|
-
details.push(`timezone=${event.event_timezone}`);
|
|
760
|
-
}
|
|
761
|
-
if (event.event_location) {
|
|
762
|
-
details.push(`@ ${event.event_location}`);
|
|
763
|
-
details.push(`location=${JSON.stringify(event.event_location)}`);
|
|
764
|
-
}
|
|
765
|
-
if (event.event_recurrence_rule) {
|
|
766
|
-
details.push(`recurrence=${event.event_recurrence_rule}`);
|
|
767
|
-
}
|
|
768
|
-
if (event.reminder_text) {
|
|
769
|
-
details.push(`description=${JSON.stringify(event.reminder_text)}`);
|
|
770
|
-
}
|
|
771
|
-
return `${core} \u2014 ${details.join(" ")}`;
|
|
772
|
-
}
|
|
773
|
-
return core;
|
|
774
|
-
}
|
|
775
|
-
function renderCalendarMarkdown(result) {
|
|
776
|
-
const lines = [];
|
|
777
|
-
lines.push(`# pm calendar (${result.view})`);
|
|
778
|
-
lines.push("");
|
|
779
|
-
lines.push(`- now: ${result.now}`);
|
|
780
|
-
lines.push(`- window: ${formatWindow(result.range)}`);
|
|
781
|
-
if (result.range.period_start && result.range.period_end) {
|
|
782
|
-
lines.push(`- period: ${result.range.period_start} -> ${result.range.period_end}`);
|
|
783
|
-
lines.push(`- period-mode: ${result.range.full_period ? "full-period" : "active-window"}`);
|
|
784
|
-
}
|
|
785
|
-
lines.push(`- events: ${result.summary.events} (deadlines: ${result.summary.deadlines}, reminders: ${result.summary.reminders}, scheduled: ${result.summary.scheduled})`);
|
|
786
|
-
lines.push(`- items: ${result.summary.items}`);
|
|
787
|
-
lines.push(`- by-kind: ${formatSummaryCountRecord(result.summary.by_kind)}`);
|
|
788
|
-
lines.push(`- by-type: ${formatSummaryCountRecord(result.summary.by_type)}`);
|
|
789
|
-
lines.push(`- by-status: ${formatSummaryCountRecord(result.summary.by_status)}`);
|
|
790
|
-
lines.push(`- recurring-events: ${result.summary.recurring_events}`);
|
|
791
|
-
lines.push("");
|
|
792
|
-
if (result.events.length === 0) {
|
|
793
|
-
lines.push("No calendar events matched the selected filters.");
|
|
794
|
-
return lines.join("\n");
|
|
795
|
-
}
|
|
796
|
-
for (const day of result.days) {
|
|
797
|
-
lines.push(`## ${day.date} (${day.count})`);
|
|
798
|
-
for (const event of day.events) {
|
|
799
|
-
lines.push(`- ${formatEventLine(event)}`);
|
|
800
|
-
}
|
|
801
|
-
lines.push("");
|
|
802
|
-
}
|
|
803
|
-
if (result.warnings && result.warnings.length > 0) {
|
|
804
|
-
lines.push("### warnings");
|
|
805
|
-
for (const warning of result.warnings) {
|
|
806
|
-
lines.push(`- ${warning}`);
|
|
807
|
-
}
|
|
808
|
-
lines.push("");
|
|
809
|
-
}
|
|
810
|
-
return trimTrailingNewlines(lines.join("\n"));
|
|
811
|
-
}
|
|
812
|
-
function renderCalendarToon(result) {
|
|
813
|
-
return encodeToon(result);
|
|
814
|
-
}
|
|
815
|
-
function trimTrailingNewlines(value) {
|
|
816
|
-
let end = value.length;
|
|
817
|
-
while (end > 0 && value[end - 1] === "\n") {
|
|
818
|
-
end -= 1;
|
|
819
|
-
}
|
|
820
|
-
return value.slice(0, end);
|
|
821
|
-
}
|
|
822
|
-
function resolveCalendarExecutionInputs(options) {
|
|
823
|
-
const nowValue = nowIso();
|
|
824
|
-
const view = parseView(options.view);
|
|
825
|
-
const rangeBounds = buildRange(view, options, nowValue);
|
|
826
|
-
const limit = parseIntegerLimit(options.limit);
|
|
827
|
-
const includeSources = parseIncludeSources(options.include);
|
|
828
|
-
const explicitLookahead = parseNonNegativeInteger(options.recurrenceLookaheadDays, "Calendar recurrence lookahead days");
|
|
829
|
-
const recurrenceLookbackDays = parseNonNegativeInteger(options.recurrenceLookbackDays, "Calendar recurrence lookback days");
|
|
830
|
-
const occurrenceLimit = parseNonNegativeInteger(options.occurrenceLimit, "Calendar occurrence limit");
|
|
831
|
-
if (occurrenceLimit !== void 0 && occurrenceLimit < 1) {
|
|
832
|
-
throw new PmCliError("Calendar occurrence limit must be >= 1", EXIT_CODE.USAGE);
|
|
833
|
-
}
|
|
834
|
-
const eventsOnly = includeSources.has("events") && !includeSources.has("deadlines") && !includeSources.has("reminders");
|
|
835
|
-
const hasExplicitBounds = options.to !== void 0 || explicitLookahead !== void 0 || recurrenceLookbackDays !== void 0 || occurrenceLimit !== void 0;
|
|
836
|
-
const eventsOnlyCapApplied = eventsOnly && !hasExplicitBounds;
|
|
837
|
-
return {
|
|
838
|
-
nowValue,
|
|
839
|
-
view,
|
|
840
|
-
rangeBounds,
|
|
841
|
-
limit,
|
|
842
|
-
includeSources,
|
|
843
|
-
occurrenceLimit,
|
|
844
|
-
recurrenceLookaheadDays: eventsOnlyCapApplied ? DEFAULT_EVENTS_ONLY_LOOKAHEAD_DAYS : explicitLookahead,
|
|
845
|
-
recurrenceLookbackWindowDays: eventsOnlyCapApplied && recurrenceLookbackDays === void 0 ? 0 : recurrenceLookbackDays,
|
|
846
|
-
eventsOnlyCapApplied
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
function appendCalendarCapWarning(warnings, capApplied) {
|
|
850
|
-
if (!capApplied) {
|
|
851
|
-
return;
|
|
852
|
-
}
|
|
853
|
-
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`);
|
|
854
|
-
}
|
|
855
|
-
function buildCalendarFiltersResult(options, runtimeFieldFilters) {
|
|
856
|
-
return {
|
|
857
|
-
type: options.type ?? null,
|
|
858
|
-
tag: options.tag ?? null,
|
|
859
|
-
priority: options.priority ?? null,
|
|
860
|
-
status: options.status ?? null,
|
|
861
|
-
assignee: options.assignee ?? null,
|
|
862
|
-
assignee_filter: options.assigneeFilter ?? null,
|
|
863
|
-
sprint: options.sprint ?? null,
|
|
864
|
-
release: options.release ?? null,
|
|
865
|
-
runtime_filters: runtimeFieldFilters,
|
|
866
|
-
limit: options.limit ?? null,
|
|
867
|
-
include: options.include ?? null,
|
|
868
|
-
full_period: options.fullPeriod === true ? "true" : null,
|
|
869
|
-
recurrence_lookahead_days: options.recurrenceLookaheadDays ?? null,
|
|
870
|
-
recurrence_lookback_days: options.recurrenceLookbackDays ?? null,
|
|
871
|
-
occurrence_limit: options.occurrenceLimit ?? null
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
function buildCalendarRangeResult(options, rangeBounds) {
|
|
875
|
-
return {
|
|
876
|
-
start: rangeBounds.start ?? null,
|
|
877
|
-
end: rangeBounds.end ?? null,
|
|
878
|
-
period_start: rangeBounds.periodStart ?? null,
|
|
879
|
-
period_end: rangeBounds.periodEnd ?? null,
|
|
880
|
-
full_period: rangeBounds.fullPeriod,
|
|
881
|
-
past: options.past === true,
|
|
882
|
-
from: options.from ?? null,
|
|
883
|
-
to: options.to ?? null
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
async function runCalendar(options, global2) {
|
|
887
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
888
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
889
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
890
|
-
}
|
|
891
|
-
const inputs = resolveCalendarExecutionInputs(options);
|
|
892
|
-
const settings = await readSettings(pmRoot);
|
|
893
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
894
|
-
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
895
|
-
const runtimeFieldFilters = collectRuntimeFilterValues(options, runtimeFieldRegistry, "calendar");
|
|
896
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
897
|
-
const listWarnings = [];
|
|
898
|
-
appendCalendarCapWarning(listWarnings, inputs.eventsOnlyCapApplied);
|
|
899
|
-
const items = await listAllFrontMatterLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, listWarnings, settings.schema);
|
|
900
|
-
const filteredItems = filterItems(items, options, typeRegistry, statusRegistry, runtimeFieldFilters);
|
|
901
|
-
const recurringWindow = buildRecurringEventWindow(inputs.rangeBounds.start, inputs.rangeBounds.end, inputs.nowValue, inputs.recurrenceLookbackWindowDays, inputs.recurrenceLookaheadDays);
|
|
902
|
-
const seededEvents = buildEventSeed(filteredItems, recurringWindow, inputs.includeSources, inputs.occurrenceLimit);
|
|
903
|
-
const rangedEvents = seededEvents.filter((event) => includeEventInWindow(event, inputs.rangeBounds.start, inputs.rangeBounds.end));
|
|
904
|
-
const limitedEvents = inputs.limit === void 0 ? rangedEvents : rangedEvents.slice(0, inputs.limit);
|
|
905
|
-
const days = bucketEventsByDay(limitedEvents);
|
|
906
|
-
const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
|
|
907
|
-
return {
|
|
908
|
-
view: inputs.view,
|
|
909
|
-
output_default: "markdown",
|
|
910
|
-
now: inputs.nowValue,
|
|
911
|
-
anchor: inputs.rangeBounds.anchor,
|
|
912
|
-
range: buildCalendarRangeResult(options, inputs.rangeBounds),
|
|
913
|
-
filters: buildCalendarFiltersResult(options, runtimeFieldFilters),
|
|
914
|
-
summary: summarize(limitedEvents),
|
|
915
|
-
events: limitedEvents,
|
|
916
|
-
days,
|
|
917
|
-
...warnings.length > 0 ? { warnings } : {}
|
|
918
|
-
};
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
// dist/cli/commands/context.js
|
|
922
|
-
!(function() {
|
|
923
|
-
try {
|
|
924
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
925
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f244506b-038b-5a3d-8184-f0b73e30f300");
|
|
926
|
-
} catch (e2) {
|
|
927
|
-
}
|
|
928
|
-
})();
|
|
929
|
-
var CONTEXT_OUTPUT_VALUES = ["markdown", "toon", "json"];
|
|
930
|
-
var HIGH_LEVEL_TYPES = /* @__PURE__ */ new Set(["Epic", "Feature"]);
|
|
931
|
-
var DEFAULT_CONTEXT_LIMIT = 10;
|
|
932
|
-
var STANDARD_SECTIONS = ["hierarchy", "activity", "progress", "recently_created", "unparented", "workload"];
|
|
933
|
-
var DEEP_SECTIONS = [
|
|
934
|
-
...STANDARD_SECTIONS,
|
|
935
|
-
"blockers",
|
|
936
|
-
"files",
|
|
937
|
-
"staleness",
|
|
938
|
-
"tests"
|
|
939
|
-
];
|
|
940
|
-
var LEADING_HYPHEN_DATE = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
941
|
-
var LEADING_COMPACT_DATE = /^(\d{4})(\d{2})(\d{2})(?:[T ]?\d{2}|$)/;
|
|
942
|
-
var COMPACT_DATE = /^(\d{4})(\d{2})(\d{2})$/;
|
|
943
|
-
var COMPACT_DATETIME = /^(\d{4})(\d{2})(\d{2})(?:[T\s]?)(\d{2})(\d{2})(\d{2})?(Z|[+-]\d{2}:?\d{2})?$/i;
|
|
944
|
-
function parseOutputFormat2(raw) {
|
|
945
|
-
if (!raw)
|
|
946
|
-
return void 0;
|
|
947
|
-
const normalized = raw.trim().toLowerCase();
|
|
948
|
-
if (!CONTEXT_OUTPUT_VALUES.includes(normalized)) {
|
|
949
|
-
throw new PmCliError("Context format must be one of markdown|toon|json", EXIT_CODE.USAGE);
|
|
950
|
-
}
|
|
951
|
-
return normalized;
|
|
952
|
-
}
|
|
953
|
-
var FOCUS_PROJECTION_FIELDS = /* @__PURE__ */ new Set([
|
|
954
|
-
"id",
|
|
955
|
-
"title",
|
|
956
|
-
"type",
|
|
957
|
-
"status",
|
|
958
|
-
"priority",
|
|
959
|
-
"order",
|
|
960
|
-
"deadline",
|
|
961
|
-
"assignee",
|
|
962
|
-
"tags",
|
|
963
|
-
"updated_at",
|
|
964
|
-
"parent",
|
|
965
|
-
"children_total",
|
|
966
|
-
"children_closed",
|
|
967
|
-
"completion_pct",
|
|
968
|
-
"created_at"
|
|
969
|
-
]);
|
|
970
|
-
function parseContextFocusFields(raw) {
|
|
971
|
-
if (raw === void 0)
|
|
972
|
-
return void 0;
|
|
973
|
-
const fields = [];
|
|
974
|
-
for (const token of raw.split(",")) {
|
|
975
|
-
const normalized = token.trim().toLowerCase();
|
|
976
|
-
if (normalized.length === 0)
|
|
977
|
-
continue;
|
|
978
|
-
if (!FOCUS_PROJECTION_FIELDS.has(normalized)) {
|
|
979
|
-
throw new PmCliError(`Context --fields value not projectable: ${normalized} (valid: ${[...FOCUS_PROJECTION_FIELDS].join(", ")})`, EXIT_CODE.USAGE);
|
|
980
|
-
}
|
|
981
|
-
if (!fields.includes(normalized))
|
|
982
|
-
fields.push(normalized);
|
|
983
|
-
}
|
|
984
|
-
if (fields.length === 0) {
|
|
985
|
-
throw new PmCliError("Context --fields requires at least one field name", EXIT_CODE.USAGE);
|
|
986
|
-
}
|
|
987
|
-
return fields;
|
|
988
|
-
}
|
|
989
|
-
function projectContextFocusRows(rows, fields) {
|
|
990
|
-
return rows.map((row) => {
|
|
991
|
-
const projected = {};
|
|
992
|
-
const source = row;
|
|
993
|
-
for (const field of fields) {
|
|
994
|
-
projected[field] = source[field] ?? null;
|
|
995
|
-
}
|
|
996
|
-
return projected;
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
function resolveContextOutputFormat(options, global2) {
|
|
1000
|
-
const commandFormat = parseOutputFormat2(options.format);
|
|
1001
|
-
if (global2.json && commandFormat && commandFormat !== "json") {
|
|
1002
|
-
throw new PmCliError("Cannot combine --json with --format markdown|toon", EXIT_CODE.USAGE);
|
|
1003
|
-
}
|
|
1004
|
-
if (global2.json) {
|
|
1005
|
-
return "json";
|
|
1006
|
-
}
|
|
1007
|
-
return commandFormat ?? "toon";
|
|
1008
|
-
}
|
|
1009
|
-
function parseContextLimit(raw, depth) {
|
|
1010
|
-
return parseIntegerLimit(raw, "--limit") ?? (depth === "full" ? Number.MAX_SAFE_INTEGER : DEFAULT_CONTEXT_LIMIT);
|
|
1011
|
-
}
|
|
1012
|
-
function parseContextDepth(raw, settings) {
|
|
1013
|
-
if (!raw)
|
|
1014
|
-
return settings.default_depth;
|
|
1015
|
-
const normalized = raw.trim().toLowerCase();
|
|
1016
|
-
if (!CONTEXT_DEPTH_VALUES.includes(normalized)) {
|
|
1017
|
-
throw new PmCliError(`Context --depth must be one of ${CONTEXT_DEPTH_VALUES.join("|")}`, EXIT_CODE.USAGE);
|
|
1018
|
-
}
|
|
1019
|
-
return normalized;
|
|
1020
|
-
}
|
|
1021
|
-
function parseContextSections(raw, depth, settings) {
|
|
1022
|
-
if (raw && raw.length > 0) {
|
|
1023
|
-
const sections = [];
|
|
1024
|
-
for (const value of raw) {
|
|
1025
|
-
const normalized = value.trim().toLowerCase();
|
|
1026
|
-
if (!CONTEXT_SECTION_VALUES.includes(normalized)) {
|
|
1027
|
-
throw new PmCliError(`Context --section must be one of ${CONTEXT_SECTION_VALUES.join("|")}`, EXIT_CODE.USAGE);
|
|
1028
|
-
}
|
|
1029
|
-
if (!sections.includes(normalized)) {
|
|
1030
|
-
sections.push(normalized);
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
return sections;
|
|
1034
|
-
}
|
|
1035
|
-
if (depth === "brief")
|
|
1036
|
-
return [];
|
|
1037
|
-
if (depth === "full")
|
|
1038
|
-
return [...CONTEXT_SECTION_VALUES];
|
|
1039
|
-
const pool = depth === "deep" ? DEEP_SECTIONS : STANDARD_SECTIONS;
|
|
1040
|
-
return pool.filter((section) => settings.sections[section]);
|
|
1041
|
-
}
|
|
1042
|
-
function parseActivityLimit(raw, settings) {
|
|
1043
|
-
if (!raw)
|
|
1044
|
-
return settings.activity_limit;
|
|
1045
|
-
const parsed = parseIntegerLimit(raw, "--activity-limit");
|
|
1046
|
-
return parsed ?? settings.activity_limit;
|
|
1047
|
-
}
|
|
1048
|
-
function parseStaleThresholdDays(raw, settings) {
|
|
1049
|
-
if (!raw)
|
|
1050
|
-
return settings.stale_threshold_days;
|
|
1051
|
-
const trimmed = raw.trim().toLowerCase();
|
|
1052
|
-
const match = /^(\d+)d?$/.exec(trimmed);
|
|
1053
|
-
if (!match) {
|
|
1054
|
-
throw new PmCliError("--stale-threshold must be a number of days (e.g. 7 or 7d)", EXIT_CODE.USAGE);
|
|
1055
|
-
}
|
|
1056
|
-
const days = parseInt(match[1], 10);
|
|
1057
|
-
if (days <= 0) {
|
|
1058
|
-
throw new PmCliError("--stale-threshold must be positive", EXIT_CODE.USAGE);
|
|
1059
|
-
}
|
|
1060
|
-
return days;
|
|
1061
|
-
}
|
|
1062
|
-
function statusRank(status, statusRegistry) {
|
|
1063
|
-
const normalizedStatus = normalizeStatusForRegistry(status, statusRegistry);
|
|
1064
|
-
const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
|
|
1065
|
-
const openStatus = normalizeStatusInput("open", statusRegistry);
|
|
1066
|
-
const blockedStatus = normalizeStatusInput("blocked", statusRegistry);
|
|
1067
|
-
const draftStatus = normalizeStatusInput("draft", statusRegistry);
|
|
1068
|
-
if (inProgressStatus && normalizedStatus === inProgressStatus)
|
|
1069
|
-
return 0;
|
|
1070
|
-
if (openStatus && normalizedStatus === openStatus)
|
|
1071
|
-
return 1;
|
|
1072
|
-
if (blockedStatus && normalizedStatus === blockedStatus)
|
|
1073
|
-
return 2;
|
|
1074
|
-
if (draftStatus && normalizedStatus === draftStatus)
|
|
1075
|
-
return 3;
|
|
1076
|
-
if (statusRegistry.active_statuses.has(normalizedStatus))
|
|
1077
|
-
return 4;
|
|
1078
|
-
if (statusRegistry.blocked_statuses.has(normalizedStatus))
|
|
1079
|
-
return 5;
|
|
1080
|
-
if (statusRegistry.terminal_statuses.has(normalizedStatus))
|
|
1081
|
-
return 7;
|
|
1082
|
-
return 6;
|
|
1083
|
-
}
|
|
1084
|
-
function isClosedStatus(status, statusRegistry) {
|
|
1085
|
-
const closeStatus = normalizeStatusInput("closed", statusRegistry);
|
|
1086
|
-
return normalizeStatusForRegistry(status, statusRegistry) === closeStatus;
|
|
1087
|
-
}
|
|
1088
|
-
function isInProgressStatus(status, statusRegistry) {
|
|
1089
|
-
const inProgressStatus = normalizeStatusInput("in_progress", statusRegistry);
|
|
1090
|
-
return normalizeStatusForRegistry(status, statusRegistry) === inProgressStatus;
|
|
1091
|
-
}
|
|
1092
|
-
function isOpenStatus(status, statusRegistry) {
|
|
1093
|
-
const openStatus = normalizeStatusInput("open", statusRegistry);
|
|
1094
|
-
return normalizeStatusForRegistry(status, statusRegistry) === openStatus;
|
|
1095
|
-
}
|
|
1096
|
-
function isBlockedStatus(status, statusRegistry) {
|
|
1097
|
-
return statusRegistry.blocked_statuses.has(normalizeStatusForRegistry(status, statusRegistry));
|
|
1098
|
-
}
|
|
1099
|
-
var LIST_PROJECTION_FLAGS = ["compact", "brief", "fields", "includeBody", "include_body", "parent"];
|
|
1100
|
-
function stripListProjectionFlags(options) {
|
|
1101
|
-
const copy = { ...options };
|
|
1102
|
-
for (const key of LIST_PROJECTION_FLAGS) {
|
|
1103
|
-
delete copy[key];
|
|
1104
|
-
}
|
|
1105
|
-
return copy;
|
|
1106
|
-
}
|
|
1107
|
-
function collectSubtreeIds(corpus, parentId) {
|
|
1108
|
-
const target = parentId.trim().toLowerCase();
|
|
1109
|
-
const anchor = corpus.find((item) => item.id.trim().toLowerCase() === target);
|
|
1110
|
-
if (!anchor) {
|
|
1111
|
-
return { ids: /* @__PURE__ */ new Set(), found: false };
|
|
1112
|
-
}
|
|
1113
|
-
const childrenByParent = buildChildrenByParent(corpus);
|
|
1114
|
-
const descendants = collectDescendants(anchor.id, childrenByParent);
|
|
1115
|
-
const ids = new Set([anchor.id, ...descendants.map((item) => item.id)].map((id) => id.trim().toLowerCase()));
|
|
1116
|
-
return { ids, found: true };
|
|
1117
|
-
}
|
|
1118
|
-
function parseContextParent(raw) {
|
|
1119
|
-
if (raw === void 0)
|
|
1120
|
-
return void 0;
|
|
1121
|
-
const trimmed = raw.trim();
|
|
1122
|
-
if (trimmed.length === 0) {
|
|
1123
|
-
throw new PmCliError("Context --parent requires an item id", EXIT_CODE.USAGE);
|
|
1124
|
-
}
|
|
1125
|
-
return trimmed;
|
|
1126
|
-
}
|
|
1127
|
-
function compareOptionalOrder(left, right) {
|
|
1128
|
-
const leftValue = left ?? null;
|
|
1129
|
-
const rightValue = right ?? null;
|
|
1130
|
-
if (leftValue === null && rightValue === null)
|
|
1131
|
-
return 0;
|
|
1132
|
-
if (leftValue === null)
|
|
1133
|
-
return 1;
|
|
1134
|
-
if (rightValue === null)
|
|
1135
|
-
return -1;
|
|
1136
|
-
return leftValue - rightValue;
|
|
1137
|
-
}
|
|
1138
|
-
function compareOptionalDeadline(left, right) {
|
|
1139
|
-
const leftValue = left ?? null;
|
|
1140
|
-
const rightValue = right ?? null;
|
|
1141
|
-
if (leftValue === null && rightValue === null)
|
|
1142
|
-
return 0;
|
|
1143
|
-
if (leftValue === null)
|
|
1144
|
-
return 1;
|
|
1145
|
-
if (rightValue === null)
|
|
1146
|
-
return -1;
|
|
1147
|
-
return compareTimestampStrings(leftValue, rightValue);
|
|
1148
|
-
}
|
|
1149
|
-
function daysInUtcMonth(year, monthIndex) {
|
|
1150
|
-
return new Date(Date.UTC(year, monthIndex + 1, 0)).getUTCDate();
|
|
1151
|
-
}
|
|
1152
|
-
function hasNoInvalidDatePrefix(value) {
|
|
1153
|
-
const match = LEADING_HYPHEN_DATE.exec(value) ?? LEADING_COMPACT_DATE.exec(value);
|
|
1154
|
-
if (!match) {
|
|
1155
|
-
return true;
|
|
1156
|
-
}
|
|
1157
|
-
const year = Number.parseInt(match[1], 10);
|
|
1158
|
-
const month = Number.parseInt(match[2], 10);
|
|
1159
|
-
const day = Number.parseInt(match[3], 10);
|
|
1160
|
-
return month >= 1 && month <= 12 && day >= 1 && day <= daysInUtcMonth(year, month - 1);
|
|
1161
|
-
}
|
|
1162
|
-
function normalizeTimestampCandidate(value) {
|
|
1163
|
-
const compactDate = COMPACT_DATE.exec(value);
|
|
1164
|
-
if (compactDate) {
|
|
1165
|
-
return `${compactDate[1]}-${compactDate[2]}-${compactDate[3]}`;
|
|
1166
|
-
}
|
|
1167
|
-
const compactDateTime = COMPACT_DATETIME.exec(value);
|
|
1168
|
-
if (compactDateTime) {
|
|
1169
|
-
const [, year, month, day, hour, minute, secondRaw, offsetRaw] = compactDateTime;
|
|
1170
|
-
const second = secondRaw ? `:${secondRaw}` : "";
|
|
1171
|
-
const offset = offsetRaw && offsetRaw.length === 5 && offsetRaw !== "Z" ? `${offsetRaw.slice(0, 3)}:${offsetRaw.slice(3)}` : offsetRaw ?? "";
|
|
1172
|
-
return `${year}-${month}-${day}T${hour}:${minute}${second}${offset}`;
|
|
1173
|
-
}
|
|
1174
|
-
return value;
|
|
1175
|
-
}
|
|
1176
|
-
function parseContextTimestampMs(value) {
|
|
1177
|
-
if (typeof value !== "string") {
|
|
1178
|
-
return Number.NaN;
|
|
1179
|
-
}
|
|
1180
|
-
const trimmed = value.trim();
|
|
1181
|
-
if (trimmed.length === 0 || !hasNoInvalidDatePrefix(trimmed)) {
|
|
1182
|
-
return Number.NaN;
|
|
1183
|
-
}
|
|
1184
|
-
const parsed = Date.parse(normalizeTimestampCandidate(trimmed));
|
|
1185
|
-
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
1186
|
-
}
|
|
1187
|
-
function sortableTimestamp(value) {
|
|
1188
|
-
const parsed = parseContextTimestampMs(value);
|
|
1189
|
-
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : "";
|
|
1190
|
-
}
|
|
1191
|
-
function dateTokenForTimestamp(value) {
|
|
1192
|
-
const parsed = parseContextTimestampMs(value);
|
|
1193
|
-
return Number.isFinite(parsed) ? new Date(parsed).toISOString().slice(0, 10) : "unknown";
|
|
1194
|
-
}
|
|
1195
|
-
function normalizedParentId(value) {
|
|
1196
|
-
if (typeof value !== "string") {
|
|
1197
|
-
return null;
|
|
1198
|
-
}
|
|
1199
|
-
const trimmed = value.trim();
|
|
1200
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
1201
|
-
}
|
|
1202
|
-
function compareCriticalItems(left, right, statusRegistry) {
|
|
1203
|
-
const byStatus = statusRank(left.status, statusRegistry) - statusRank(right.status, statusRegistry);
|
|
1204
|
-
if (byStatus !== 0)
|
|
1205
|
-
return byStatus;
|
|
1206
|
-
const byPriority = left.priority - right.priority;
|
|
1207
|
-
if (byPriority !== 0)
|
|
1208
|
-
return byPriority;
|
|
1209
|
-
const byOrder = compareOptionalOrder(left.order, right.order);
|
|
1210
|
-
if (byOrder !== 0)
|
|
1211
|
-
return byOrder;
|
|
1212
|
-
const byDeadline = compareOptionalDeadline(left.deadline, right.deadline);
|
|
1213
|
-
if (byDeadline !== 0)
|
|
1214
|
-
return byDeadline;
|
|
1215
|
-
const byUpdated = compareTimestampStrings(sortableTimestamp(right.updated_at), sortableTimestamp(left.updated_at));
|
|
1216
|
-
const byId = left.id.localeCompare(right.id);
|
|
1217
|
-
return byUpdated !== 0 ? byUpdated : byId;
|
|
1218
|
-
}
|
|
1219
|
-
function completionPct(closed, total) {
|
|
1220
|
-
return total > 0 ? Math.round(closed / total * 100) : 0;
|
|
1221
|
-
}
|
|
1222
|
-
function buildChildrenByParent(allItems) {
|
|
1223
|
-
const childrenByParent = /* @__PURE__ */ new Map();
|
|
1224
|
-
for (const item of allItems) {
|
|
1225
|
-
const parent = normalizedParentId(item.parent);
|
|
1226
|
-
if (!parent)
|
|
1227
|
-
continue;
|
|
1228
|
-
const children = childrenByParent.get(parent) ?? [];
|
|
1229
|
-
children.push(item);
|
|
1230
|
-
childrenByParent.set(parent, children);
|
|
1231
|
-
}
|
|
1232
|
-
return childrenByParent;
|
|
1233
|
-
}
|
|
1234
|
-
function toContextFocusItem(item, statusRegistry, childrenByParent) {
|
|
1235
|
-
const focus = {
|
|
1236
|
-
id: item.id,
|
|
1237
|
-
title: item.title,
|
|
1238
|
-
type: item.type,
|
|
1239
|
-
status: item.status,
|
|
1240
|
-
priority: item.priority,
|
|
1241
|
-
order: item.order ?? null,
|
|
1242
|
-
deadline: item.deadline ?? null,
|
|
1243
|
-
assignee: item.assignee ?? null,
|
|
1244
|
-
tags: Array.isArray(item.tags) ? [...item.tags] : [],
|
|
1245
|
-
updated_at: item.updated_at,
|
|
1246
|
-
parent: normalizedParentId(item.parent)
|
|
1247
|
-
};
|
|
1248
|
-
if (statusRegistry && childrenByParent) {
|
|
1249
|
-
const descendants = collectDescendants(item.id, childrenByParent);
|
|
1250
|
-
const total = descendants.length;
|
|
1251
|
-
if (total > 0) {
|
|
1252
|
-
const closed = descendants.filter((desc) => isClosedStatus(desc.status, statusRegistry)).length;
|
|
1253
|
-
focus.children_total = total;
|
|
1254
|
-
focus.children_closed = closed;
|
|
1255
|
-
focus.completion_pct = completionPct(closed, total);
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
return focus;
|
|
1259
|
-
}
|
|
1260
|
-
function summarizeAgenda(events) {
|
|
1261
|
-
let deadlines = 0;
|
|
1262
|
-
let reminders = 0;
|
|
1263
|
-
let scheduled = 0;
|
|
1264
|
-
const itemIds = /* @__PURE__ */ new Set();
|
|
1265
|
-
for (const event of events) {
|
|
1266
|
-
itemIds.add(event.item_id);
|
|
1267
|
-
if (event.kind === "deadline") {
|
|
1268
|
-
deadlines += 1;
|
|
1269
|
-
continue;
|
|
1270
|
-
}
|
|
1271
|
-
if (event.kind === "reminder") {
|
|
1272
|
-
reminders += 1;
|
|
1273
|
-
continue;
|
|
1274
|
-
}
|
|
1275
|
-
scheduled += 1;
|
|
1276
|
-
}
|
|
1277
|
-
return {
|
|
1278
|
-
events: events.length,
|
|
1279
|
-
items: itemIds.size,
|
|
1280
|
-
deadlines,
|
|
1281
|
-
reminders,
|
|
1282
|
-
scheduled
|
|
1283
|
-
};
|
|
1284
|
-
}
|
|
1285
|
-
function mergeSortedWarnings(...warningGroups) {
|
|
1286
|
-
return [...new Set(warningGroups.flatMap((group) => group ?? []))].sort((left, right) => left.localeCompare(right));
|
|
1287
|
-
}
|
|
1288
|
-
function filterTerminalCalendarEvents(events, statusRegistry) {
|
|
1289
|
-
return events.filter((event) => !statusRegistry.terminal_statuses.has(normalizeStatusForRegistry(event.item_status, statusRegistry)));
|
|
1290
|
-
}
|
|
1291
|
-
function buildHierarchy(allItems, activeItems, statusRegistry, limit) {
|
|
1292
|
-
const itemMap = /* @__PURE__ */ new Map();
|
|
1293
|
-
for (const item of allItems) {
|
|
1294
|
-
itemMap.set(item.id, item);
|
|
1295
|
-
}
|
|
1296
|
-
const childrenByParent = buildChildrenByParent(allItems);
|
|
1297
|
-
const activeHighLevelIds = new Set(activeItems.filter((item) => HIGH_LEVEL_TYPES.has(item.type)).map((item) => item.id));
|
|
1298
|
-
const nodes = [];
|
|
1299
|
-
for (const parentId of activeHighLevelIds) {
|
|
1300
|
-
const parent = itemMap.get(parentId);
|
|
1301
|
-
if (!parent)
|
|
1302
|
-
continue;
|
|
1303
|
-
const allDescendants = collectDescendants(parentId, childrenByParent);
|
|
1304
|
-
const childItems = childrenByParent.get(parentId) ?? [];
|
|
1305
|
-
let closedCount = 0;
|
|
1306
|
-
let openCount = 0;
|
|
1307
|
-
let inProgressCount = 0;
|
|
1308
|
-
let blockedCount = 0;
|
|
1309
|
-
for (const desc of allDescendants) {
|
|
1310
|
-
if (isClosedStatus(desc.status, statusRegistry))
|
|
1311
|
-
closedCount++;
|
|
1312
|
-
else if (isInProgressStatus(desc.status, statusRegistry))
|
|
1313
|
-
inProgressCount++;
|
|
1314
|
-
else if (isBlockedStatus(desc.status, statusRegistry))
|
|
1315
|
-
blockedCount++;
|
|
1316
|
-
else if (isOpenStatus(desc.status, statusRegistry))
|
|
1317
|
-
openCount++;
|
|
1318
|
-
}
|
|
1319
|
-
const children = childItems.sort((a, b) => compareCriticalItems(a, b, statusRegistry)).slice(0, limit).map((child) => {
|
|
1320
|
-
const grandchildren = collectDescendants(child.id, childrenByParent);
|
|
1321
|
-
const gcClosed = grandchildren.filter((gc) => isClosedStatus(gc.status, statusRegistry)).length;
|
|
1322
|
-
return {
|
|
1323
|
-
id: child.id,
|
|
1324
|
-
title: child.title,
|
|
1325
|
-
type: child.type,
|
|
1326
|
-
status: child.status,
|
|
1327
|
-
children_total: grandchildren.length,
|
|
1328
|
-
children_closed: gcClosed
|
|
1329
|
-
};
|
|
1330
|
-
});
|
|
1331
|
-
nodes.push({
|
|
1332
|
-
id: parent.id,
|
|
1333
|
-
title: parent.title,
|
|
1334
|
-
type: parent.type,
|
|
1335
|
-
status: parent.status,
|
|
1336
|
-
children_total: allDescendants.length,
|
|
1337
|
-
children_closed: closedCount,
|
|
1338
|
-
children_open: openCount,
|
|
1339
|
-
children_in_progress: inProgressCount,
|
|
1340
|
-
children_blocked: blockedCount,
|
|
1341
|
-
children
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
return nodes.sort((a, b) => {
|
|
1345
|
-
const aParent = itemMap.get(a.id);
|
|
1346
|
-
const bParent = itemMap.get(b.id);
|
|
1347
|
-
return compareCriticalItems(aParent, bParent, statusRegistry);
|
|
1348
|
-
}).slice(0, limit);
|
|
1349
|
-
}
|
|
1350
|
-
function collectDescendants(parentId, childrenByParent) {
|
|
1351
|
-
const result = [];
|
|
1352
|
-
const stack = [parentId];
|
|
1353
|
-
const visited = /* @__PURE__ */ new Set();
|
|
1354
|
-
while (stack.length > 0) {
|
|
1355
|
-
const current = stack.pop();
|
|
1356
|
-
if (visited.has(current))
|
|
1357
|
-
continue;
|
|
1358
|
-
visited.add(current);
|
|
1359
|
-
const children = childrenByParent.get(current) ?? [];
|
|
1360
|
-
for (const child of children) {
|
|
1361
|
-
result.push(child);
|
|
1362
|
-
stack.push(child.id);
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
return result;
|
|
1366
|
-
}
|
|
1367
|
-
var _testOnly = {
|
|
1368
|
-
buildActivity,
|
|
1369
|
-
buildBlockers,
|
|
1370
|
-
buildChildrenByParent,
|
|
1371
|
-
buildHierarchy,
|
|
1372
|
-
buildHotFiles,
|
|
1373
|
-
buildProgress,
|
|
1374
|
-
buildRecentlyCreated,
|
|
1375
|
-
buildStaleness,
|
|
1376
|
-
buildTestHealth,
|
|
1377
|
-
buildUnparented,
|
|
1378
|
-
buildWorkload,
|
|
1379
|
-
collectDescendants,
|
|
1380
|
-
collectSubtreeIds,
|
|
1381
|
-
compareCriticalItems,
|
|
1382
|
-
compareOptionalDeadline,
|
|
1383
|
-
compareOptionalOrder,
|
|
1384
|
-
completionPct,
|
|
1385
|
-
dateTokenForTimestamp,
|
|
1386
|
-
filterTerminalCalendarEvents,
|
|
1387
|
-
isBlockedStatus,
|
|
1388
|
-
isClosedStatus,
|
|
1389
|
-
isInProgressStatus,
|
|
1390
|
-
isOpenStatus,
|
|
1391
|
-
mergeSortedWarnings,
|
|
1392
|
-
normalizedParentId,
|
|
1393
|
-
parseActivityLimit,
|
|
1394
|
-
parseContextLimit,
|
|
1395
|
-
parseContextParent,
|
|
1396
|
-
parseContextTimestampMs,
|
|
1397
|
-
parseStaleThresholdDays,
|
|
1398
|
-
sortableTimestamp,
|
|
1399
|
-
statusRank,
|
|
1400
|
-
stripListProjectionFlags,
|
|
1401
|
-
summarizeAgenda,
|
|
1402
|
-
toContextFocusItem
|
|
1403
|
-
};
|
|
1404
|
-
async function buildActivity(activityLimit, global2) {
|
|
1405
|
-
const result = await runActivity({ compact: true, limit: String(activityLimit) }, global2);
|
|
1406
|
-
return result.compact_activity ?? [];
|
|
1407
|
-
}
|
|
1408
|
-
function buildProgress(allItems, activeItems, statusRegistry, limit) {
|
|
1409
|
-
const childrenByParent = /* @__PURE__ */ new Map();
|
|
1410
|
-
for (const item of allItems) {
|
|
1411
|
-
if (!item.parent)
|
|
1412
|
-
continue;
|
|
1413
|
-
const children = childrenByParent.get(item.parent) ?? [];
|
|
1414
|
-
children.push(item);
|
|
1415
|
-
childrenByParent.set(item.parent, children);
|
|
1416
|
-
}
|
|
1417
|
-
const activeHighLevel = activeItems.filter((item) => HIGH_LEVEL_TYPES.has(item.type));
|
|
1418
|
-
const entries = [];
|
|
1419
|
-
for (const parent of activeHighLevel) {
|
|
1420
|
-
const descendants = collectDescendants(parent.id, childrenByParent);
|
|
1421
|
-
const total = descendants.length;
|
|
1422
|
-
if (total === 0)
|
|
1423
|
-
continue;
|
|
1424
|
-
let closed = 0;
|
|
1425
|
-
let open = 0;
|
|
1426
|
-
let inProgress = 0;
|
|
1427
|
-
let blocked = 0;
|
|
1428
|
-
for (const desc of descendants) {
|
|
1429
|
-
if (isClosedStatus(desc.status, statusRegistry))
|
|
1430
|
-
closed++;
|
|
1431
|
-
else if (isInProgressStatus(desc.status, statusRegistry))
|
|
1432
|
-
inProgress++;
|
|
1433
|
-
else if (isBlockedStatus(desc.status, statusRegistry))
|
|
1434
|
-
blocked++;
|
|
1435
|
-
else if (isOpenStatus(desc.status, statusRegistry))
|
|
1436
|
-
open++;
|
|
1437
|
-
}
|
|
1438
|
-
entries.push({
|
|
1439
|
-
id: parent.id,
|
|
1440
|
-
title: parent.title,
|
|
1441
|
-
type: parent.type,
|
|
1442
|
-
total,
|
|
1443
|
-
closed,
|
|
1444
|
-
open,
|
|
1445
|
-
in_progress: inProgress,
|
|
1446
|
-
blocked,
|
|
1447
|
-
completion_pct: completionPct(closed, total)
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
return entries.sort((a, b) => a.completion_pct - b.completion_pct).slice(0, limit);
|
|
1451
|
-
}
|
|
1452
|
-
function buildBlockers(blockedItems, itemMap, limit) {
|
|
1453
|
-
return blockedItems.slice(0, limit).map((item) => {
|
|
1454
|
-
const blockerItem = item.blocked_by ? itemMap.get(item.blocked_by) : void 0;
|
|
1455
|
-
return {
|
|
1456
|
-
id: item.id,
|
|
1457
|
-
title: item.title,
|
|
1458
|
-
blocked_by: item.blocked_by ?? null,
|
|
1459
|
-
blocked_by_title: blockerItem?.title ?? null,
|
|
1460
|
-
blocked_by_status: blockerItem?.status ?? null,
|
|
1461
|
-
blocked_reason: item.blocked_reason ?? null,
|
|
1462
|
-
unblock_note: item.unblock_note ?? null
|
|
1463
|
-
};
|
|
1464
|
-
});
|
|
1465
|
-
}
|
|
1466
|
-
function buildHotFiles(activeItems, limit) {
|
|
1467
|
-
const fileMap = /* @__PURE__ */ new Map();
|
|
1468
|
-
for (const item of activeItems) {
|
|
1469
|
-
for (const file of item.files ?? []) {
|
|
1470
|
-
const existing = fileMap.get(file.path) ?? /* @__PURE__ */ new Set();
|
|
1471
|
-
existing.add(item.id);
|
|
1472
|
-
fileMap.set(file.path, existing);
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
return [...fileMap.entries()].map(([filePath, itemIds]) => ({
|
|
1476
|
-
path: filePath,
|
|
1477
|
-
references: itemIds.size,
|
|
1478
|
-
items: [...itemIds].sort()
|
|
1479
|
-
})).sort((a, b) => b.references - a.references).slice(0, limit);
|
|
1480
|
-
}
|
|
1481
|
-
function buildWorkload(activeItems, statusRegistry, limit) {
|
|
1482
|
-
const groups = /* @__PURE__ */ new Map();
|
|
1483
|
-
for (const item of activeItems) {
|
|
1484
|
-
const key = item.assignee ?? null;
|
|
1485
|
-
const existing = groups.get(key) ?? [];
|
|
1486
|
-
existing.push(item);
|
|
1487
|
-
groups.set(key, existing);
|
|
1488
|
-
}
|
|
1489
|
-
return [...groups.entries()].map(([assignee, items]) => ({
|
|
1490
|
-
assignee,
|
|
1491
|
-
active: items.length,
|
|
1492
|
-
in_progress: items.filter((item) => isInProgressStatus(item.status, statusRegistry)).length,
|
|
1493
|
-
items: items.map((item) => item.id).sort()
|
|
1494
|
-
})).sort((a, b) => b.active - a.active).slice(0, limit);
|
|
1495
|
-
}
|
|
1496
|
-
function buildStaleness(allNonTerminal, staleThresholdDays, now, limit) {
|
|
1497
|
-
const cutoffMs = new Date(now).getTime() - staleThresholdDays * 24 * 60 * 60 * 1e3;
|
|
1498
|
-
return allNonTerminal.filter((item) => new Date(item.updated_at).getTime() < cutoffMs).map((item) => ({
|
|
1499
|
-
id: item.id,
|
|
1500
|
-
title: item.title,
|
|
1501
|
-
status: item.status,
|
|
1502
|
-
updated_at: item.updated_at,
|
|
1503
|
-
stale_days: Math.floor((new Date(now).getTime() - new Date(item.updated_at).getTime()) / (24 * 60 * 60 * 1e3))
|
|
1504
|
-
})).sort((a, b) => b.stale_days - a.stale_days).slice(0, limit);
|
|
1505
|
-
}
|
|
1506
|
-
function buildRecentlyCreated(allNonTerminal, statusRegistry, childrenByParent, limit) {
|
|
1507
|
-
return allNonTerminal.map((item) => ({ item, sortKey: sortableTimestamp(item.created_at) })).sort((left, right) => {
|
|
1508
|
-
const byCreated = compareTimestampStrings(right.sortKey, left.sortKey);
|
|
1509
|
-
return byCreated !== 0 ? byCreated : left.item.id.localeCompare(right.item.id);
|
|
1510
|
-
}).slice(0, limit).map(({ item }) => ({
|
|
1511
|
-
...toContextFocusItem(item, statusRegistry, childrenByParent),
|
|
1512
|
-
created_at: item.created_at
|
|
1513
|
-
}));
|
|
1514
|
-
}
|
|
1515
|
-
function buildUnparented(allNonTerminal, statusRegistry, childrenByParent, limit) {
|
|
1516
|
-
return allNonTerminal.filter((item) => !normalizedParentId(item.parent) && !HIGH_LEVEL_TYPES.has(item.type)).sort((left, right) => compareCriticalItems(left, right, statusRegistry)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, childrenByParent));
|
|
1517
|
-
}
|
|
1518
|
-
function buildTestHealth(activeItems) {
|
|
1519
|
-
let itemsWithTests = 0;
|
|
1520
|
-
let itemsWithRecentRuns = 0;
|
|
1521
|
-
let passed = 0;
|
|
1522
|
-
let failed = 0;
|
|
1523
|
-
let skipped = 0;
|
|
1524
|
-
const itemsFailing = [];
|
|
1525
|
-
for (const item of activeItems) {
|
|
1526
|
-
if ((item.tests ?? []).length > 0) {
|
|
1527
|
-
itemsWithTests++;
|
|
1528
|
-
}
|
|
1529
|
-
const runs = item.test_runs ?? [];
|
|
1530
|
-
if (runs.length > 0) {
|
|
1531
|
-
itemsWithRecentRuns++;
|
|
1532
|
-
let itemHasFailure = false;
|
|
1533
|
-
for (const run of runs) {
|
|
1534
|
-
passed += run.passed ?? 0;
|
|
1535
|
-
failed += run.failed ?? 0;
|
|
1536
|
-
skipped += run.skipped ?? 0;
|
|
1537
|
-
if ((run.failed ?? 0) > 0) {
|
|
1538
|
-
itemHasFailure = true;
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
if (itemHasFailure) {
|
|
1542
|
-
itemsFailing.push(item.id);
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
return {
|
|
1547
|
-
items_with_tests: itemsWithTests,
|
|
1548
|
-
items_with_recent_runs: itemsWithRecentRuns,
|
|
1549
|
-
recent_runs: { passed, failed, skipped },
|
|
1550
|
-
items_failing: itemsFailing.sort()
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
function formatClock2(timestamp) {
|
|
1554
|
-
return `${new Date(timestamp).toISOString().slice(11, 16)}Z`;
|
|
1555
|
-
}
|
|
1556
|
-
function formatFocusLine(item) {
|
|
1557
|
-
const orderToken = item.order === null ? "-" : String(item.order);
|
|
1558
|
-
const deadlineToken = item.deadline ?? "-";
|
|
1559
|
-
const parentToken = item.parent ? ` parent:${item.parent}` : "";
|
|
1560
|
-
const progressToken = item.children_total !== void 0 && item.children_closed !== void 0 && item.completion_pct !== void 0 ? ` children:${item.children_closed}/${item.children_total} done:${item.completion_pct}%` : "";
|
|
1561
|
-
return `${item.id} p${item.priority} ${item.status} ${item.type} order:${orderToken} deadline:${deadlineToken}${parentToken}${progressToken} ${item.title}`;
|
|
1562
|
-
}
|
|
1563
|
-
function formatProjectedFocusLine(item, fields) {
|
|
1564
|
-
const source = item;
|
|
1565
|
-
return fields.map((field) => {
|
|
1566
|
-
const value = source[field];
|
|
1567
|
-
if (Array.isArray(value))
|
|
1568
|
-
return `${field}:${value.join(",")}`;
|
|
1569
|
-
return `${field}:${value ?? "-"}`;
|
|
1570
|
-
}).join(" ");
|
|
1571
|
-
}
|
|
1572
|
-
function formatAgendaLine(event) {
|
|
1573
|
-
const base = `${formatClock2(event.at)} [${event.kind}] ${event.item_id} p${event.item_priority} ${event.item_status} ${event.item_title}`;
|
|
1574
|
-
if (event.kind === "reminder") {
|
|
1575
|
-
return `${base} \u2014 ${event.reminder_text}`;
|
|
1576
|
-
}
|
|
1577
|
-
if (event.kind === "event") {
|
|
1578
|
-
const recurringSuffix = event.event_recurring ? " (recurring)" : "";
|
|
1579
|
-
const title = event.event_title ?? event.item_title;
|
|
1580
|
-
return `${base} \u2014 ${title}${recurringSuffix}`;
|
|
1581
|
-
}
|
|
1582
|
-
return base;
|
|
1583
|
-
}
|
|
1584
|
-
function pushContextFocusSection(lines, title, rows, emptyText, renderFocus) {
|
|
1585
|
-
lines.push(`## ${title}`);
|
|
1586
|
-
if (rows.length === 0) {
|
|
1587
|
-
lines.push(emptyText);
|
|
1588
|
-
} else {
|
|
1589
|
-
for (const item of rows) {
|
|
1590
|
-
lines.push(`- ${renderFocus(item)}`);
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
lines.push("");
|
|
1594
|
-
}
|
|
1595
|
-
function pushBlockedFallbackSection(lines, result, renderFocus) {
|
|
1596
|
-
if (result.blocked_fallback.length === 0) {
|
|
1597
|
-
return;
|
|
1598
|
-
}
|
|
1599
|
-
lines.push("## Blocked fallback");
|
|
1600
|
-
for (const item of result.blocked_fallback) {
|
|
1601
|
-
lines.push(`- ${renderFocus(item)}`);
|
|
1602
|
-
}
|
|
1603
|
-
lines.push("");
|
|
1604
|
-
}
|
|
1605
|
-
function pushAgendaSection(lines, result) {
|
|
1606
|
-
lines.push("## Agenda");
|
|
1607
|
-
lines.push(`- events: ${result.agenda.summary.events} (deadlines: ${result.agenda.summary.deadlines}, reminders: ${result.agenda.summary.reminders}, scheduled: ${result.agenda.summary.scheduled})`);
|
|
1608
|
-
if (result.agenda.events.length === 0) {
|
|
1609
|
-
lines.push("No agenda events matched the selected filters.");
|
|
1610
|
-
} else {
|
|
1611
|
-
for (const event of result.agenda.events) {
|
|
1612
|
-
lines.push(`- ${formatAgendaLine(event)}`);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
lines.push("");
|
|
1616
|
-
}
|
|
1617
|
-
function pushHierarchySection(lines, result) {
|
|
1618
|
-
if (!result.hierarchy || result.hierarchy.length === 0) {
|
|
1619
|
-
return;
|
|
1620
|
-
}
|
|
1621
|
-
lines.push("## Hierarchy");
|
|
1622
|
-
for (const node of result.hierarchy) {
|
|
1623
|
-
const pct = node.children_total > 0 ? Math.round(node.children_closed / node.children_total * 100) : 0;
|
|
1624
|
-
lines.push(`- ${node.id} ${node.type} ${node.status} "${node.title}" [${node.children_closed}/${node.children_total} done ${pct}%]`);
|
|
1625
|
-
for (const child of node.children) {
|
|
1626
|
-
const cpct = child.children_total > 0 ? Math.round(child.children_closed / child.children_total * 100) : 0;
|
|
1627
|
-
lines.push(` - ${child.id} ${child.type} ${child.status} "${child.title}" [${child.children_closed}/${child.children_total} done ${cpct}%]`);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
lines.push("");
|
|
1631
|
-
}
|
|
1632
|
-
function pushProgressSection(lines, result) {
|
|
1633
|
-
if (!result.progress || result.progress.length === 0) {
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
lines.push("## Progress");
|
|
1637
|
-
for (const entry of result.progress) {
|
|
1638
|
-
lines.push(`- ${entry.id} "${entry.title}" ${entry.completion_pct}% (${entry.closed}/${entry.total} closed, ${entry.in_progress} wip, ${entry.open} open, ${entry.blocked} blocked)`);
|
|
1639
|
-
}
|
|
1640
|
-
lines.push("");
|
|
1641
|
-
}
|
|
1642
|
-
function pushRecentlyCreatedSection(lines, result, focusFields, renderFocus) {
|
|
1643
|
-
if (!result.recently_created || result.recently_created.length === 0) {
|
|
1644
|
-
return;
|
|
1645
|
-
}
|
|
1646
|
-
lines.push("## Recently created");
|
|
1647
|
-
for (const item of result.recently_created) {
|
|
1648
|
-
lines.push(focusFields ? `- ${renderFocus(item)}` : `- ${dateTokenForTimestamp(item.created_at)} ${formatFocusLine(item)}`);
|
|
1649
|
-
}
|
|
1650
|
-
lines.push("");
|
|
1651
|
-
}
|
|
1652
|
-
function pushUnparentedSection(lines, result, renderFocus) {
|
|
1653
|
-
if (!result.unparented || result.unparented.length === 0) {
|
|
1654
|
-
return;
|
|
1655
|
-
}
|
|
1656
|
-
lines.push("## Unparented");
|
|
1657
|
-
for (const item of result.unparented) {
|
|
1658
|
-
lines.push(`- ${renderFocus(item)}`);
|
|
1659
|
-
}
|
|
1660
|
-
lines.push("");
|
|
1661
|
-
}
|
|
1662
|
-
function pushActivitySection(lines, result) {
|
|
1663
|
-
if (!result.activity || result.activity.length === 0) {
|
|
1664
|
-
return;
|
|
1665
|
-
}
|
|
1666
|
-
lines.push("## Recent activity");
|
|
1667
|
-
for (const entry of result.activity) {
|
|
1668
|
-
const msg = entry.msg ? ` ${entry.msg}` : "";
|
|
1669
|
-
lines.push(`- ${entry.ts.slice(0, 16)}Z ${entry.id} ${entry.op} by:${entry.author}${msg}`);
|
|
1670
|
-
}
|
|
1671
|
-
lines.push("");
|
|
1672
|
-
}
|
|
1673
|
-
function pushBlockersSection(lines, result) {
|
|
1674
|
-
if (!result.blockers || result.blockers.length === 0) {
|
|
1675
|
-
return;
|
|
1676
|
-
}
|
|
1677
|
-
lines.push("## Blockers");
|
|
1678
|
-
for (const entry of result.blockers) {
|
|
1679
|
-
const by = entry.blocked_by ? `blocked_by:${entry.blocked_by}(${entry.blocked_by_status ?? "?"})` : "blocked_by:-";
|
|
1680
|
-
const reason = entry.blocked_reason ? ` reason:"${entry.blocked_reason}"` : "";
|
|
1681
|
-
const note = entry.unblock_note ? ` unblock:"${entry.unblock_note}"` : "";
|
|
1682
|
-
lines.push(`- ${entry.id} "${entry.title}" ${by}${reason}${note}`);
|
|
1683
|
-
}
|
|
1684
|
-
lines.push("");
|
|
1685
|
-
}
|
|
1686
|
-
function pushFilesSection(lines, result) {
|
|
1687
|
-
if (!result.files || result.files.length === 0) {
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
lines.push("## Hot files");
|
|
1691
|
-
for (const file of result.files) {
|
|
1692
|
-
lines.push(`- ${file.path} refs:${file.references} items:[${file.items.join(",")}]`);
|
|
1693
|
-
}
|
|
1694
|
-
lines.push("");
|
|
1695
|
-
}
|
|
1696
|
-
function pushWorkloadSection(lines, result) {
|
|
1697
|
-
if (!result.workload || result.workload.length === 0) {
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
lines.push("## Workload");
|
|
1701
|
-
for (const entry of result.workload) {
|
|
1702
|
-
const who = entry.assignee ?? "(unassigned)";
|
|
1703
|
-
lines.push(`- ${who} active:${entry.active} wip:${entry.in_progress} items:[${entry.items.join(",")}]`);
|
|
1704
|
-
}
|
|
1705
|
-
lines.push("");
|
|
1706
|
-
}
|
|
1707
|
-
function pushStalenessSection(lines, result) {
|
|
1708
|
-
if (!result.staleness || result.staleness.length === 0) {
|
|
1709
|
-
return;
|
|
1710
|
-
}
|
|
1711
|
-
lines.push("## Stale items");
|
|
1712
|
-
for (const entry of result.staleness) {
|
|
1713
|
-
lines.push(`- ${entry.id} ${entry.status} stale:${entry.stale_days}d last:${entry.updated_at.slice(0, 10)} "${entry.title}"`);
|
|
1714
|
-
}
|
|
1715
|
-
lines.push("");
|
|
1716
|
-
}
|
|
1717
|
-
function pushTestHealthSection(lines, result) {
|
|
1718
|
-
if (!result.tests) {
|
|
1719
|
-
return;
|
|
1720
|
-
}
|
|
1721
|
-
lines.push("## Test health");
|
|
1722
|
-
lines.push(`- items_with_tests: ${result.tests.items_with_tests}`);
|
|
1723
|
-
lines.push(`- items_with_recent_runs: ${result.tests.items_with_recent_runs}`);
|
|
1724
|
-
lines.push(`- passed: ${result.tests.recent_runs.passed}, failed: ${result.tests.recent_runs.failed}, skipped: ${result.tests.recent_runs.skipped}`);
|
|
1725
|
-
if (result.tests.items_failing.length > 0) {
|
|
1726
|
-
lines.push(`- items_failing: [${result.tests.items_failing.join(",")}]`);
|
|
1727
|
-
}
|
|
1728
|
-
lines.push("");
|
|
1729
|
-
}
|
|
1730
|
-
function pushEmptyContextSuggestions(lines, result) {
|
|
1731
|
-
const isEmpty = result.summary.active_items === 0 && result.summary.blocked === 0 && result.agenda.summary.events === 0;
|
|
1732
|
-
if (!isEmpty) {
|
|
1733
|
-
return;
|
|
1734
|
-
}
|
|
1735
|
-
lines.push("## Suggestions");
|
|
1736
|
-
lines.push("No active work items or upcoming events. Consider:");
|
|
1737
|
-
lines.push('- `pm create --type Task --title "..."` to add a new work item');
|
|
1738
|
-
lines.push("- `pm list --status closed --limit 5` to review recent completions");
|
|
1739
|
-
lines.push("- `pm search <keywords>` to find related past work");
|
|
1740
|
-
lines.push("- `pm aggregate` for a full project status overview");
|
|
1741
|
-
}
|
|
1742
|
-
function renderContextMarkdown(result) {
|
|
1743
|
-
const lines = [];
|
|
1744
|
-
const focusFields = result.focus_fields;
|
|
1745
|
-
const renderFocus = (item) => focusFields ? formatProjectedFocusLine(item, focusFields) : formatFocusLine(item);
|
|
1746
|
-
lines.push("# pm context");
|
|
1747
|
-
lines.push("");
|
|
1748
|
-
lines.push(`- now: ${result.now}`);
|
|
1749
|
-
lines.push(`- depth: ${result.depth}`);
|
|
1750
|
-
if (result.filters.parent) {
|
|
1751
|
-
lines.push(`- scope: subtree of ${result.filters.parent}`);
|
|
1752
|
-
}
|
|
1753
|
-
lines.push(`- active_items: ${result.summary.active_items} (in_progress: ${result.summary.in_progress}, open: ${result.summary.open})`);
|
|
1754
|
-
if (result.summary.total_items !== void 0) {
|
|
1755
|
-
lines.push(`- total_items: ${result.summary.total_items} (closed: ${result.summary.closed ?? 0}, canceled: ${result.summary.canceled ?? 0})`);
|
|
1756
|
-
}
|
|
1757
|
-
lines.push(`- agenda_events: ${result.summary.agenda_events}`);
|
|
1758
|
-
lines.push(`- blocked_fallback_used: ${result.summary.blocked_fallback_used}`);
|
|
1759
|
-
const renderedSections = result.sections_included.filter((section) => section !== "blockers" || (result.blockers?.length ?? 0) > 0);
|
|
1760
|
-
if (renderedSections.length > 0) {
|
|
1761
|
-
lines.push(`- sections: ${renderedSections.join(", ")}`);
|
|
1762
|
-
}
|
|
1763
|
-
lines.push("");
|
|
1764
|
-
pushContextFocusSection(lines, "High-level focus", result.high_level, "No high-level active items.", renderFocus);
|
|
1765
|
-
pushContextFocusSection(lines, "Low-level focus", result.low_level, "No low-level active items.", renderFocus);
|
|
1766
|
-
pushBlockedFallbackSection(lines, result, renderFocus);
|
|
1767
|
-
pushAgendaSection(lines, result);
|
|
1768
|
-
pushHierarchySection(lines, result);
|
|
1769
|
-
pushProgressSection(lines, result);
|
|
1770
|
-
pushRecentlyCreatedSection(lines, result, focusFields, renderFocus);
|
|
1771
|
-
pushUnparentedSection(lines, result, renderFocus);
|
|
1772
|
-
pushActivitySection(lines, result);
|
|
1773
|
-
pushBlockersSection(lines, result);
|
|
1774
|
-
pushFilesSection(lines, result);
|
|
1775
|
-
pushWorkloadSection(lines, result);
|
|
1776
|
-
pushStalenessSection(lines, result);
|
|
1777
|
-
pushTestHealthSection(lines, result);
|
|
1778
|
-
pushEmptyContextSuggestions(lines, result);
|
|
1779
|
-
return lines.join("\n");
|
|
1780
|
-
}
|
|
1781
|
-
async function resolveContextRuntime(options, global2) {
|
|
1782
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
1783
|
-
const settings = await readSettings(pmRoot);
|
|
1784
|
-
const contextSettings = settings.context ?? SETTINGS_DEFAULTS.context;
|
|
1785
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
1786
|
-
const depth = parseContextDepth(options.depth, contextSettings);
|
|
1787
|
-
return {
|
|
1788
|
-
settings,
|
|
1789
|
-
contextSettings,
|
|
1790
|
-
statusRegistry,
|
|
1791
|
-
depth,
|
|
1792
|
-
limit: parseContextLimit(options.limit, depth),
|
|
1793
|
-
sectionsIncluded: parseContextSections(options.section, depth, contextSettings),
|
|
1794
|
-
activityLimit: parseActivityLimit(options.activityLimit, contextSettings),
|
|
1795
|
-
staleThresholdDays: parseStaleThresholdDays(options.staleThreshold, contextSettings),
|
|
1796
|
-
parentScope: parseContextParent(options.parent),
|
|
1797
|
-
focusFields: parseContextFocusFields(options.fields),
|
|
1798
|
-
baseListOptions: stripListProjectionFlags(options)
|
|
1799
|
-
};
|
|
1800
|
-
}
|
|
1801
|
-
function contextNeedsAllItems(sectionsIncluded) {
|
|
1802
|
-
return sectionsIncluded.some((section) => ["hierarchy", "progress", "blockers", "staleness", "recently_created", "unparented"].includes(section));
|
|
1803
|
-
}
|
|
1804
|
-
function buildUnpaginatedContextListOptions(baseListOptions, extra) {
|
|
1805
|
-
return {
|
|
1806
|
-
...baseListOptions,
|
|
1807
|
-
...extra,
|
|
1808
|
-
noTruncate: true,
|
|
1809
|
-
limit: void 0,
|
|
1810
|
-
offset: void 0
|
|
1811
|
-
};
|
|
1812
|
-
}
|
|
1813
|
-
async function loadContextCorpus(options, global2, runtime) {
|
|
1814
|
-
const needsAllItems = contextNeedsAllItems(runtime.sectionsIncluded);
|
|
1815
|
-
const listOptions = runtime.parentScope === void 0 ? { ...runtime.baseListOptions, excludeTerminal: true } : buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: true });
|
|
1816
|
-
const listed = await runList(void 0, listOptions, global2);
|
|
1817
|
-
let listedFrontMatter = listed.items;
|
|
1818
|
-
let allItems = listedFrontMatter;
|
|
1819
|
-
if (needsAllItems || runtime.parentScope !== void 0) {
|
|
1820
|
-
const allListed = await runList(void 0, buildUnpaginatedContextListOptions(runtime.baseListOptions, { excludeTerminal: false }), global2);
|
|
1821
|
-
allItems = allListed.items;
|
|
1822
|
-
}
|
|
1823
|
-
const fullCorpus = allItems;
|
|
1824
|
-
const subtreeIds = resolveContextSubtreeIds(runtime.parentScope, fullCorpus);
|
|
1825
|
-
if (subtreeIds) {
|
|
1826
|
-
listedFrontMatter = listedFrontMatter.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
|
|
1827
|
-
allItems = allItems.filter((item) => subtreeIds.has(item.id.trim().toLowerCase()));
|
|
1828
|
-
}
|
|
1829
|
-
return { listed, listedFrontMatter, allItems, fullCorpus, subtreeIds };
|
|
1830
|
-
}
|
|
1831
|
-
function resolveContextSubtreeIds(parentScope, fullCorpus) {
|
|
1832
|
-
if (parentScope === void 0) {
|
|
1833
|
-
return void 0;
|
|
1834
|
-
}
|
|
1835
|
-
const subtree = collectSubtreeIds(fullCorpus, parentScope);
|
|
1836
|
-
if (!subtree.found) {
|
|
1837
|
-
throw new PmCliError(`Context --parent item not found: ${parentScope}`, EXIT_CODE.NOT_FOUND);
|
|
1838
|
-
}
|
|
1839
|
-
return subtree.ids;
|
|
1840
|
-
}
|
|
1841
|
-
function resolveContextFocusGroups(listedFrontMatter, allItems, statusRegistry, sectionsIncluded, limit) {
|
|
1842
|
-
const ranked = [...listedFrontMatter].sort((left, right) => compareCriticalItems(left, right, statusRegistry));
|
|
1843
|
-
const activeStatuses = statusRegistry.active_statuses;
|
|
1844
|
-
const activeItems = ranked.filter((item) => activeStatuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
|
|
1845
|
-
const blockedItems = ranked.filter((item) => statusRegistry.blocked_statuses.has(normalizeStatusForRegistry(item.status, statusRegistry)));
|
|
1846
|
-
const childrenByParent = buildChildrenByParent(allItems);
|
|
1847
|
-
const focusChildrenByParent = contextNeedsAllItems(sectionsIncluded) ? childrenByParent : void 0;
|
|
1848
|
-
const highLevel = activeItems.filter((item) => HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
|
|
1849
|
-
const lowLevel = activeItems.filter((item) => !HIGH_LEVEL_TYPES.has(item.type)).slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent));
|
|
1850
|
-
const blockedFallbackUsed = activeItems.length === 0;
|
|
1851
|
-
return {
|
|
1852
|
-
activeItems,
|
|
1853
|
-
blockedItems,
|
|
1854
|
-
highLevel,
|
|
1855
|
-
lowLevel,
|
|
1856
|
-
blockedFallback: blockedFallbackUsed ? blockedItems.slice(0, limit).map((item) => toContextFocusItem(item, statusRegistry, focusChildrenByParent)) : [],
|
|
1857
|
-
blockedFallbackUsed
|
|
1858
|
-
};
|
|
1859
|
-
}
|
|
1860
|
-
async function buildContextAgenda(options, global2, runtime, subtreeIds) {
|
|
1861
|
-
const calendarOptions = {
|
|
1862
|
-
...runtime.baseListOptions,
|
|
1863
|
-
view: "agenda",
|
|
1864
|
-
include: "all",
|
|
1865
|
-
limit: runtime.parentScope === void 0 ? String(runtime.limit) : void 0
|
|
1866
|
-
};
|
|
1867
|
-
const agenda = await runCalendar(calendarOptions, global2);
|
|
1868
|
-
const scopedAgenda = subtreeIds === void 0 ? agenda.events : agenda.events.filter((event) => subtreeIds.has(event.item_id.trim().toLowerCase()));
|
|
1869
|
-
const agendaEvents = filterTerminalCalendarEvents(scopedAgenda, runtime.statusRegistry).slice(0, runtime.limit);
|
|
1870
|
-
return { agenda, agendaEvents, agendaSummary: summarizeAgenda(agendaEvents) };
|
|
1871
|
-
}
|
|
1872
|
-
function countContextStatus(items, status, statusRegistry) {
|
|
1873
|
-
const targetStatus = String(status);
|
|
1874
|
-
return items.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === targetStatus).length;
|
|
1875
|
-
}
|
|
1876
|
-
async function buildOptionalContextSections(params) {
|
|
1877
|
-
const { runtime, allItems, fullCorpus, focusGroups, now, global: global2 } = params;
|
|
1878
|
-
const childrenByParent = buildChildrenByParent(allItems);
|
|
1879
|
-
const itemMap = new Map(fullCorpus.map((item) => [item.id, item]));
|
|
1880
|
-
const allNonTerminal = allItems.filter((item) => !isTerminalStatus(item.status, runtime.statusRegistry));
|
|
1881
|
-
const has = (section) => runtime.sectionsIncluded.includes(section);
|
|
1882
|
-
return {
|
|
1883
|
-
hierarchy: has("hierarchy") ? buildHierarchy(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
|
|
1884
|
-
activity: has("activity") ? await buildActivity(runtime.activityLimit, global2) : void 0,
|
|
1885
|
-
progress: has("progress") ? buildProgress(allItems, focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
|
|
1886
|
-
blockersSection: has("blockers") ? buildBlockers(focusGroups.blockedItems, itemMap, runtime.limit) : void 0,
|
|
1887
|
-
recentlyCreated: has("recently_created") ? buildRecentlyCreated(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
|
|
1888
|
-
unparented: has("unparented") ? buildUnparented(allNonTerminal, runtime.statusRegistry, childrenByParent, runtime.limit) : void 0,
|
|
1889
|
-
filesSection: has("files") ? buildHotFiles(focusGroups.activeItems, runtime.limit) : void 0,
|
|
1890
|
-
workload: has("workload") ? buildWorkload(focusGroups.activeItems, runtime.statusRegistry, runtime.limit) : void 0,
|
|
1891
|
-
staleness: has("staleness") ? buildStaleness(allNonTerminal, runtime.staleThresholdDays, now, runtime.limit) : void 0,
|
|
1892
|
-
tests: has("tests") ? buildTestHealth(focusGroups.activeItems) : void 0
|
|
1893
|
-
};
|
|
1894
|
-
}
|
|
1895
|
-
function buildContextSummaryExtras(needsAllItems, allItems, statusRegistry) {
|
|
1896
|
-
if (!needsAllItems) {
|
|
1897
|
-
return {};
|
|
1898
|
-
}
|
|
1899
|
-
const canceledStatus = normalizeStatusInput("canceled", statusRegistry);
|
|
1900
|
-
return {
|
|
1901
|
-
total_items: allItems.length,
|
|
1902
|
-
closed: allItems.filter((item) => isClosedStatus(item.status, statusRegistry)).length,
|
|
1903
|
-
canceled: allItems.filter((item) => normalizeStatusForRegistry(item.status, statusRegistry) === canceledStatus).length
|
|
1904
|
-
};
|
|
1905
|
-
}
|
|
1906
|
-
function attachOptionalContextSections(result, sections) {
|
|
1907
|
-
if (sections.hierarchy)
|
|
1908
|
-
result.hierarchy = sections.hierarchy;
|
|
1909
|
-
if (sections.activity)
|
|
1910
|
-
result.activity = sections.activity;
|
|
1911
|
-
if (sections.progress)
|
|
1912
|
-
result.progress = sections.progress;
|
|
1913
|
-
if (sections.blockersSection)
|
|
1914
|
-
result.blockers = sections.blockersSection;
|
|
1915
|
-
if (sections.recentlyCreated)
|
|
1916
|
-
result.recently_created = sections.recentlyCreated;
|
|
1917
|
-
if (sections.unparented)
|
|
1918
|
-
result.unparented = sections.unparented;
|
|
1919
|
-
if (sections.filesSection)
|
|
1920
|
-
result.files = sections.filesSection;
|
|
1921
|
-
if (sections.workload)
|
|
1922
|
-
result.workload = sections.workload;
|
|
1923
|
-
if (sections.staleness)
|
|
1924
|
-
result.staleness = sections.staleness;
|
|
1925
|
-
if (sections.tests)
|
|
1926
|
-
result.tests = sections.tests;
|
|
1927
|
-
}
|
|
1928
|
-
function applyContextFocusProjection(result, focusFields) {
|
|
1929
|
-
if (!focusFields) {
|
|
1930
|
-
return;
|
|
1931
|
-
}
|
|
1932
|
-
result.focus_fields = focusFields;
|
|
1933
|
-
result.high_level = projectContextFocusRows(result.high_level, focusFields);
|
|
1934
|
-
result.low_level = projectContextFocusRows(result.low_level, focusFields);
|
|
1935
|
-
result.blocked_fallback = projectContextFocusRows(result.blocked_fallback, focusFields);
|
|
1936
|
-
if (result.recently_created) {
|
|
1937
|
-
result.recently_created = projectContextFocusRows(result.recently_created, focusFields);
|
|
1938
|
-
}
|
|
1939
|
-
if (result.unparented) {
|
|
1940
|
-
result.unparented = projectContextFocusRows(result.unparented, focusFields);
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
function maybeAttachEmptyContextSuggestions(result, activeItems, blockedItems) {
|
|
1944
|
-
if (activeItems.length > 0 || blockedItems.length > 0 || result.agenda.events.length > 0) {
|
|
1945
|
-
return;
|
|
1946
|
-
}
|
|
1947
|
-
result.suggestions = [
|
|
1948
|
-
'pm create --type Task --title "..." to add a new work item',
|
|
1949
|
-
"pm list --status closed --limit 5 to review recent completions",
|
|
1950
|
-
"pm search <keywords> to find related past work",
|
|
1951
|
-
"pm aggregate for a full project status overview"
|
|
1952
|
-
];
|
|
1953
|
-
}
|
|
1954
|
-
async function runContext(options, global2) {
|
|
1955
|
-
const runtime = await resolveContextRuntime(options, global2);
|
|
1956
|
-
const corpus = await loadContextCorpus(options, global2, runtime);
|
|
1957
|
-
const focusGroups = resolveContextFocusGroups(corpus.listedFrontMatter, corpus.allItems, runtime.statusRegistry, runtime.sectionsIncluded, runtime.limit);
|
|
1958
|
-
const agendaContext = await buildContextAgenda(options, global2, runtime, corpus.subtreeIds);
|
|
1959
|
-
const warnings = mergeSortedWarnings(corpus.listed.warnings, agendaContext.agenda.warnings);
|
|
1960
|
-
const inProgressCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("in_progress", runtime.statusRegistry), runtime.statusRegistry);
|
|
1961
|
-
const openCount = countContextStatus(focusGroups.activeItems, normalizeStatusInput("open", runtime.statusRegistry), runtime.statusRegistry);
|
|
1962
|
-
const sections = await buildOptionalContextSections({
|
|
1963
|
-
runtime,
|
|
1964
|
-
allItems: corpus.allItems,
|
|
1965
|
-
fullCorpus: corpus.fullCorpus,
|
|
1966
|
-
focusGroups,
|
|
1967
|
-
now: agendaContext.agenda.now,
|
|
1968
|
-
global: global2
|
|
1969
|
-
});
|
|
1970
|
-
const summaryExtras = buildContextSummaryExtras(contextNeedsAllItems(runtime.sectionsIncluded), corpus.allItems, runtime.statusRegistry);
|
|
1971
|
-
const result = {
|
|
1972
|
-
output_default: "toon",
|
|
1973
|
-
now: agendaContext.agenda.now,
|
|
1974
|
-
depth: runtime.depth,
|
|
1975
|
-
sections_included: runtime.sectionsIncluded,
|
|
1976
|
-
window: {
|
|
1977
|
-
anchor: agendaContext.agenda.anchor,
|
|
1978
|
-
start: agendaContext.agenda.range.start,
|
|
1979
|
-
end: agendaContext.agenda.range.end,
|
|
1980
|
-
past: agendaContext.agenda.range.past,
|
|
1981
|
-
from: agendaContext.agenda.range.from,
|
|
1982
|
-
to: agendaContext.agenda.range.to
|
|
1983
|
-
},
|
|
1984
|
-
filters: {
|
|
1985
|
-
type: options.type ?? null,
|
|
1986
|
-
tag: options.tag ?? null,
|
|
1987
|
-
priority: options.priority ?? null,
|
|
1988
|
-
assignee: options.assignee ?? null,
|
|
1989
|
-
assignee_filter: options.assigneeFilter ?? null,
|
|
1990
|
-
sprint: options.sprint ?? null,
|
|
1991
|
-
release: options.release ?? null,
|
|
1992
|
-
limit: options.limit ?? null,
|
|
1993
|
-
parent: runtime.parentScope ?? null,
|
|
1994
|
-
/* c8 ignore next -- listed/calendar runtime filters are always materialized by their command handlers */
|
|
1995
|
-
runtime_filters: corpus.listed.filters.runtime_filters ?? agendaContext.agenda.filters.runtime_filters ?? {}
|
|
1996
|
-
},
|
|
1997
|
-
summary: {
|
|
1998
|
-
active_items: focusGroups.activeItems.length,
|
|
1999
|
-
in_progress: inProgressCount,
|
|
2000
|
-
open: openCount,
|
|
2001
|
-
blocked: focusGroups.blockedItems.length,
|
|
2002
|
-
blocked_fallback_used: focusGroups.blockedFallbackUsed,
|
|
2003
|
-
high_level: focusGroups.highLevel.length,
|
|
2004
|
-
low_level: focusGroups.lowLevel.length,
|
|
2005
|
-
agenda_events: agendaContext.agendaSummary.events,
|
|
2006
|
-
...summaryExtras
|
|
2007
|
-
},
|
|
2008
|
-
high_level: focusGroups.highLevel,
|
|
2009
|
-
low_level: focusGroups.lowLevel,
|
|
2010
|
-
blocked_fallback: focusGroups.blockedFallback,
|
|
2011
|
-
agenda: {
|
|
2012
|
-
summary: agendaContext.agendaSummary,
|
|
2013
|
-
events: agendaContext.agendaEvents
|
|
2014
|
-
}
|
|
2015
|
-
};
|
|
2016
|
-
attachOptionalContextSections(result, sections);
|
|
2017
|
-
applyContextFocusProjection(result, runtime.focusFields);
|
|
2018
|
-
if (warnings.length > 0)
|
|
2019
|
-
result.warnings = warnings;
|
|
2020
|
-
maybeAttachEmptyContextSuggestions(result, focusGroups.activeItems, focusGroups.blockedItems);
|
|
2021
|
-
return result;
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
export {
|
|
2025
|
-
resolveCalendarOutputFormat,
|
|
2026
|
-
renderCalendarMarkdown,
|
|
2027
|
-
renderCalendarToon,
|
|
2028
|
-
runCalendar,
|
|
2029
|
-
CONTEXT_OUTPUT_VALUES,
|
|
2030
|
-
parseContextFocusFields,
|
|
2031
|
-
projectContextFocusRows,
|
|
2032
|
-
resolveContextOutputFormat,
|
|
2033
|
-
parseContextDepth,
|
|
2034
|
-
parseContextSections,
|
|
2035
|
-
collectSubtreeIds,
|
|
2036
|
-
compareCriticalItems,
|
|
2037
|
-
buildChildrenByParent,
|
|
2038
|
-
toContextFocusItem,
|
|
2039
|
-
_testOnly,
|
|
2040
|
-
renderContextMarkdown,
|
|
2041
|
-
runContext
|
|
2042
|
-
};
|
|
2043
|
-
//# sourceMappingURL=chunk-MR6FJ7LL.js.map
|