@unbrained/pm-cli 2026.6.5 → 2026.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +17 -5
- package/dist/cli/commander-usage.js +74 -4
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +8 -0
- package/dist/cli/commands/aggregate.js +84 -7
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +10 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +13 -10
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.d.ts +1 -1
- package/dist/cli/commands/close.js +20 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +87 -18
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +5 -4
- package/dist/cli/commands/config.js +50 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +6 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/copy.d.ts +14 -0
- package/dist/cli/commands/copy.js +153 -0
- package/dist/cli/commands/copy.js.map +1 -0
- package/dist/cli/commands/extension/doctor.js +62 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +8 -0
- package/dist/cli/commands/extension/install-sources.js +82 -2
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +29 -0
- package/dist/cli/commands/extension.js +61 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +8 -1
- package/dist/cli/commands/gc.js +26 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +9 -0
- package/dist/cli/commands/get.js +23 -2
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +15 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +39 -0
- package/dist/cli/commands/history-compact.js +262 -0
- package/dist/cli/commands/history-compact.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -1
- package/dist/cli/commands/history.js +12 -24
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.js +5 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/list.d.ts +2 -0
- package/dist/cli/commands/list.js +87 -9
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +8 -4
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.d.ts +1 -0
- package/dist/cli/commands/search.js +232 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +8 -1
- package/dist/cli/commands/stats.js +18 -17
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +8 -0
- package/dist/cli/commands/telemetry.js +253 -0
- package/dist/cli/commands/telemetry.js.map +1 -0
- package/dist/cli/error-guidance.js +26 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +1 -0
- package/dist/cli/extension-command-help.js +3 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-content.js +19 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +13 -21
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +24 -6
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +52 -17
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +55 -8
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +5 -5
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +21 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +16 -0
- package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-YVB3QRTE.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-LH66F75F.js} +87 -17
- package/dist/cli-bundle/chunks/aggregate-LH66F75F.js.map +7 -0
- package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-OHSWFQJM.js} +88 -18
- package/dist/cli-bundle/chunks/aggregate-OHSWFQJM.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-2PPYFAG5.js} +8 -8
- package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-AUGT5W6J.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-2IF7WLB7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-2IXCHCLM.js} +5 -6
- package/dist/cli-bundle/chunks/chunk-2IXCHCLM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-2OJHLWBZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-3A2CMEM7.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-3EOBJOF4.js} +5 -4
- package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-42LOFGJS.js} +91 -16
- package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-4CHEG6UK.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-4CHEG6UK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4GHZR3BA.js} +56 -28
- package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-5AXMRKN5.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-6J4K6JLA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-6RZXO5M2.js} +102 -22
- package/dist/cli-bundle/chunks/chunk-6RZXO5M2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-AVJD6VTA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-B2KZGPM2.js} +39 -8
- package/dist/cli-bundle/chunks/chunk-B2KZGPM2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-B5RF3IP7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-C5W2UH56.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-CKLBZHS7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-CLD3XNCH.js} +124 -20
- package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-FHHBD7PN.js} +38 -7
- package/dist/cli-bundle/chunks/chunk-FHHBD7PN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-FY6Z3FYY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-GNIUOLZ2.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-GPXQBR3H.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-GUZBNB3G.js} +27 -5
- package/dist/cli-bundle/chunks/chunk-GUZBNB3G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-H7EO3QA3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-HLC3KTLP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-HMMMWBK2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-HRMHZ4RV.js} +26 -4
- package/dist/cli-bundle/chunks/chunk-HRMHZ4RV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-HV5SSZXF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-IMCJBN2Q.js} +23 -14
- package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-KNGVP5WJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-KR6R465K.js} +304 -215
- package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-LI65XLJR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-LIN2BPJ7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js +112 -0
- package/dist/cli-bundle/chunks/chunk-LMTOY5HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-LQHBENVW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-LXO6V66E.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-M2PW7EZU.js} +26 -7
- package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-MOYM2C3J.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-MWRS7Z4P.js} +127 -23
- package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-NHR2QXXZ.js} +24 -15
- package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-NQL32HQ5.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-O7HSSFCC.js} +65 -16
- package/dist/cli-bundle/chunks/chunk-O7HSSFCC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-OKSKJKHX.js} +9 -9
- package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js +1572 -0
- package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-R3V3YCMH.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-RVPTZKBC.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-SFFVGNHC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-SQPKRA54.js} +14 -14
- package/dist/cli-bundle/chunks/chunk-THDEID2Z.js +115 -0
- package/dist/cli-bundle/chunks/chunk-THDEID2Z.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-TINUJMWN.js} +92 -17
- package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-TNPBPNII.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-TP4DDY27.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-TYJJOTUA.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-UAQOQ7IE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-UEWA73ZZ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-UIIQC5YO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-UJUT6AHZ.js} +314 -39
- package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-UT6WFXW2.js} +6 -7
- package/dist/cli-bundle/chunks/chunk-UT6WFXW2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-UYQ7HXH4.js} +10 -6
- package/dist/cli-bundle/chunks/chunk-UYQ7HXH4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-V6EYFTRL.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-WAA7UI6M.js} +58 -30
- package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-WCQZBDDH.js} +10 -6
- package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-WCQZBDDH.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-WR5567FH.js +1582 -0
- package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-WYEXLDDY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-X4IZKYHP.js} +307 -32
- package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-X7UHMKPE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-XS3O2TFJ.js} +27 -8
- package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-XYNT7UFP.js} +303 -207
- package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-YBZW2QQ7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-YO3THIJF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-YPH4ESA2.js} +66 -17
- package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-BJ4QMPJC.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-KW743OSW.js} +10 -10
- package/dist/cli-bundle/chunks/close-P4ZBKODL.js +13 -0
- package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-SYHSRZDC.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-DBLEYFOY.js} +29 -26
- package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-LAC5VR4G.js} +30 -27
- package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-JEO6HHVM.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-YT2PQ5DD.js} +10 -10
- package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-RZRVS3ZV.js} +127 -11
- package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-YJSAAADD.js} +128 -12
- package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-LGYEEKAW.js} +14 -14
- package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-LGYEEKAW.js.map} +2 -2
- package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-ZUH5IOOI.js} +15 -15
- package/dist/cli-bundle/chunks/context-ZUH5IOOI.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-YXJ6NXKH.js} +11 -5
- package/dist/cli-bundle/chunks/contracts-YXJ6NXKH.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-ZIBXROPE.js} +12 -6
- package/dist/cli-bundle/chunks/contracts-ZIBXROPE.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-BZALX5MQ.js +182 -0
- package/dist/cli-bundle/chunks/copy-BZALX5MQ.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-YPWEIAPD.js +185 -0
- package/dist/cli-bundle/chunks/copy-YPWEIAPD.js.map +7 -0
- package/dist/cli-bundle/chunks/create-4DS2QWQC.js +27 -0
- package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-CF7EVRX7.js} +13 -13
- package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-KR4VBWVE.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-XLZRTRKR.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-2YTXD3VM.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-GZMFMTGS.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-SLROFEQ4.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-ZHISRR2D.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-3C7OOI4F.js} +8 -6
- package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-XYCUXICD.js} +8 -6
- package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-FUWF2FYJ.js} +9 -9
- package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-J4I5IU4O.js} +9 -9
- package/dist/cli-bundle/chunks/gc-34NXSNSN.js +362 -0
- package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-SPIIZX3A.js +372 -0
- package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-SZKNRHMA.js} +34 -12
- package/dist/cli-bundle/chunks/get-SZKNRHMA.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-VITKYP6S.js} +33 -11
- package/dist/cli-bundle/chunks/get-VITKYP6S.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-4SNTA2TF.js} +27 -13
- package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-7G3EPM57.js} +28 -14
- package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-SDAWYZR3.js} +10 -10
- package/dist/cli-bundle/chunks/history-YDUEILKP.js +20 -0
- package/dist/cli-bundle/chunks/history-compact-DMW536VH.js +287 -0
- package/dist/cli-bundle/chunks/history-compact-DMW536VH.js.map +1 -0
- package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js +290 -0
- package/dist/cli-bundle/chunks/history-compact-POTZGG7K.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-EPJ7GENL.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-IJ7LLBET.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-YNESJRT6.js} +11 -11
- package/dist/cli-bundle/chunks/init-IGSS4GNH.js +17 -0
- package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-YHVBTEET.js} +9 -8
- package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-4YBMIVCZ.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-T4PF24YN.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-3KEVBOYW.js} +10 -10
- package/dist/cli-bundle/chunks/list-E44O2K64.js +20 -0
- package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-FLUCNJSH.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-GJKALVZM.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-T5MMZLI3.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-YYMIL3HV.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-I65EZ3HB.js} +33 -27
- package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-OECMHO4G.js} +32 -26
- package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-2FLXORLR.js} +65 -47
- package/dist/cli-bundle/chunks/register-mutation-2FLXORLR.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-5GPDEKHR.js} +64 -46
- package/dist/cli-bundle/chunks/register-mutation-5GPDEKHR.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-BNGAUMGK.js} +71 -35
- package/dist/cli-bundle/chunks/register-operations-BNGAUMGK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-GQKT35H5.js} +70 -34
- package/dist/cli-bundle/chunks/register-operations-GQKT35H5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-DNDCGZ4O.js} +18 -18
- package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-DNDCGZ4O.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-EJY44FPH.js} +17 -17
- package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-EJY44FPH.js.map} +2 -2
- package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-DDJGVZIN.js} +11 -11
- package/dist/cli-bundle/chunks/restore-SJSASGZP.js +17 -0
- package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-B7NQ6XVP.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-HEGYH6CE.js} +8 -8
- package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-DVVQ4UO2.js} +421 -42
- package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-JNEZJV7H.js} +427 -41
- package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-7JDIJRDH.js +202 -0
- package/dist/cli-bundle/chunks/stats-7JDIJRDH.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js +212 -0
- package/dist/cli-bundle/chunks/stats-SYTJRR4Z.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-4HHWD5Y7.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-EGWP7ZUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-IIELLSZX.js} +14 -13
- package/dist/cli-bundle/chunks/test-ML5RLWXE.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-7DNCMML7.js} +14 -13
- package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-7DNCMML7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-IHTUJRRC.js} +16 -15
- package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-IHTUJRRC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-5FEMBV3A.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-RNKZ37PS.js} +5 -5
- package/dist/cli-bundle/chunks/update-6C67X4KS.js +21 -0
- package/dist/cli-bundle/chunks/update-VF26YPT3.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-BSZZZYXY.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-BWKJJEBF.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-RSE5PC44.js} +7 -6
- package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-RSE5PC44.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-YWI5DJFA.js} +5 -4
- package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-YWI5DJFA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-NK3WKB7C.js} +18 -17
- package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-NK3WKB7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-UCEOB7S6.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-UCEOB7S6.js.map} +1 -1
- package/dist/cli-bundle/main.js +198 -1523
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/nested-settings.d.ts +8 -6
- package/dist/core/config/nested-settings.js +71 -5
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +36 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +46 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/drift-scan.d.ts +3 -4
- package/dist/core/history/drift-scan.js +71 -18
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/history/history-diff.d.ts +47 -0
- package/dist/core/history/history-diff.js +152 -0
- package/dist/core/history/history-diff.js.map +1 -0
- package/dist/core/history/history-storage-stats.d.ts +31 -0
- package/dist/core/history/history-storage-stats.js +101 -0
- package/dist/core/history/history-storage-stats.js.map +1 -0
- package/dist/core/item/id.js +4 -5
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/item-format.js +7 -3
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +7 -0
- package/dist/core/item/toon-decode.js +11 -2
- package/dist/core/item/toon-decode.js.map +1 -1
- package/dist/core/item/type-registry.js +25 -7
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock-gc.d.ts +46 -0
- package/dist/core/lock/lock-gc.js +194 -0
- package/dist/core/lock/lock-gc.js.map +1 -0
- package/dist/core/search/cache.js +5 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +6 -0
- package/dist/core/search/corpus.js +22 -9
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/embedding-batches.js +10 -7
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/relevance.d.ts +29 -0
- package/dist/core/search/relevance.js +226 -0
- package/dist/core/search/relevance.js.map +1 -0
- package/dist/core/search/vector-stores.d.ts +3 -0
- package/dist/core/search/vector-stores.js +23 -10
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/shared/constants.js +15 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +6 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +8 -0
- package/dist/core/shared/primitives.js +29 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/serial-queue.d.ts +12 -0
- package/dist/core/shared/serial-queue.js +43 -0
- package/dist/core/shared/serial-queue.js.map +1 -0
- package/dist/core/shared/time.js +42 -6
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/paths.js +25 -7
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +11 -0
- package/dist/core/store/settings-validator.js +14 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +19 -1
- package/dist/core/store/settings.js +199 -17
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +3 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +99 -6
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +187 -42
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
- package/dist/sdk/cli-contracts/commander-types.js +13 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +8 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +39 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +26 -1
- package/dist/sdk/cli-contracts.js +75 -11
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +51 -1
- package/dist/sdk/testing.js +93 -2
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
- package/docs/CODEX_PLUGIN.md +1 -1
- package/docs/COMMANDS.md +42 -4
- package/docs/CONFIGURATION.md +31 -2
- package/docs/EXTENSIONS.md +28 -8
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +2 -2
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +36 -1
- package/docs/SDK.md +66 -0
- package/docs/TESTING.md +33 -1
- package/package.json +6 -2
- package/packages/pm-governance-audit/README.md +14 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
- package/packages/pm-governance-audit/package.json +4 -2
- package/packages/pm-lifecycle-hooks/README.md +21 -0
- package/packages/pm-search-advanced/README.md +38 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +11 -8
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +0 -7
- package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +0 -7
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +0 -1
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +0 -1
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
- package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
- package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +0 -7
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +0 -1
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
- package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +0 -7
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
- package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +0 -31
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
- /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-5UROHJ3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-YVB3QRTE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-2PPYFAG5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-AUGT5W6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-2IF7WLB7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-2OJHLWBZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-3A2CMEM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-3EOBJOF4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-5AXMRKN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-6J4K6JLA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-AVJD6VTA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-B5RF3IP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-C5W2UH56.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-CKLBZHS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-FY6Z3FYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-GNIUOLZ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-GPXQBR3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-H7EO3QA3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-HLC3KTLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-HMMMWBK2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-HV5SSZXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-KNGVP5WJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-LI65XLJR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-LIN2BPJ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-LQHBENVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-LXO6V66E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-MOYM2C3J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-NQL32HQ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-OKSKJKHX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-R3V3YCMH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-RVPTZKBC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-SFFVGNHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-SQPKRA54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-TNPBPNII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-TP4DDY27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-TYJJOTUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-UAQOQ7IE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-UEWA73ZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-UIIQC5YO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-V6EYFTRL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-WYEXLDDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-X7UHMKPE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-YBZW2QQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-YO3THIJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-BJ4QMPJC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-KW743OSW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-P4ZBKODL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-SYHSRZDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-JEO6HHVM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-YT2PQ5DD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-4DS2QWQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-CF7EVRX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-KR4VBWVE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-XLZRTRKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-2YTXD3VM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-GZMFMTGS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-SLROFEQ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-ZHISRR2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-3C7OOI4F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-XYCUXICD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-FUWF2FYJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-J4I5IU4O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-SDAWYZR3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-YDUEILKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-EPJ7GENL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-KASLLPE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-IJ7LLBET.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-YNESJRT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-IGSS4GNH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-YHVBTEET.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-4YBMIVCZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-T4PF24YN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-3KEVBOYW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-E44O2K64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-FLUCNJSH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-GJKALVZM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-T5MMZLI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-YYMIL3HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-DDJGVZIN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-SJSASGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-B7NQ6XVP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-HEGYH6CE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-IIELLSZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-ML5RLWXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-5FEMBV3A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-RNKZ37PS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-6C67X4KS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-VF26YPT3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-BSZZZYXY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-BWKJJEBF.js.map} +0 -0
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3ebcb88b-3dec-5748-a0a5-5396eb6852a8")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
nowIso
|
|
5
|
-
} from "./chunk-NQP3ECKF.js";
|
|
6
|
-
import {
|
|
7
|
-
EXIT_CODE,
|
|
8
|
-
PmCliError,
|
|
9
|
-
getSettingsPath,
|
|
10
|
-
pathExists,
|
|
11
|
-
readSettings,
|
|
12
|
-
resolvePmRoot,
|
|
13
|
-
runActiveOnIndexHooks,
|
|
14
|
-
runActiveOnReadHooks,
|
|
15
|
-
runActiveOnWriteHooks
|
|
16
|
-
} from "./chunk-4LTBNUYT.js";
|
|
17
|
-
|
|
18
|
-
// dist/cli/commands/gc.js
|
|
19
|
-
import fs from "node:fs/promises";
|
|
20
|
-
import path from "node:path";
|
|
21
|
-
var GC_SCOPE_VALUES = ["index", "embeddings", "runtime"];
|
|
22
|
-
var GC_TARGETS = [
|
|
23
|
-
{
|
|
24
|
-
scope: "index",
|
|
25
|
-
relativePath: "index/manifest.json",
|
|
26
|
-
kind: "file"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
scope: "embeddings",
|
|
30
|
-
relativePath: "search/embeddings.jsonl",
|
|
31
|
-
kind: "file"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
scope: "embeddings",
|
|
35
|
-
relativePath: "search/vectorization-status.json",
|
|
36
|
-
kind: "file"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
scope: "embeddings",
|
|
40
|
-
relativePath: "search/lancedb",
|
|
41
|
-
kind: "directory"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
scope: "runtime",
|
|
45
|
-
relativePath: "runtime/test-runs",
|
|
46
|
-
kind: "directory"
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
function isErrno(error, code) {
|
|
50
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
51
|
-
}
|
|
52
|
-
async function removeCacheFile(pmRoot, target, dryRun) {
|
|
53
|
-
const relativePath = target.relativePath;
|
|
54
|
-
const absolutePath = path.join(pmRoot, relativePath);
|
|
55
|
-
const warnings = await runActiveOnReadHooks({
|
|
56
|
-
path: absolutePath,
|
|
57
|
-
scope: "project"
|
|
58
|
-
});
|
|
59
|
-
try {
|
|
60
|
-
const stats = await fs.stat(absolutePath);
|
|
61
|
-
if (target.kind === "file" && !stats.isFile()) {
|
|
62
|
-
return {
|
|
63
|
-
removed: false,
|
|
64
|
-
warnings: [...warnings, `not_a_file:${relativePath}`]
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
if (target.kind === "directory" && !stats.isDirectory()) {
|
|
68
|
-
return {
|
|
69
|
-
removed: false,
|
|
70
|
-
warnings: [...warnings, `not_a_directory:${relativePath}`]
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (dryRun) {
|
|
74
|
-
return {
|
|
75
|
-
removed: true,
|
|
76
|
-
warnings
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
if (target.kind === "file") {
|
|
80
|
-
await fs.unlink(absolutePath);
|
|
81
|
-
} else {
|
|
82
|
-
await fs.rm(absolutePath, { recursive: true, force: true });
|
|
83
|
-
}
|
|
84
|
-
const writeWarnings = await runActiveOnWriteHooks({
|
|
85
|
-
path: absolutePath,
|
|
86
|
-
scope: "project",
|
|
87
|
-
op: "gc:remove"
|
|
88
|
-
});
|
|
89
|
-
return {
|
|
90
|
-
removed: true,
|
|
91
|
-
warnings: [...warnings, ...writeWarnings]
|
|
92
|
-
};
|
|
93
|
-
} catch (error) {
|
|
94
|
-
if (isErrno(error, "ENOENT")) {
|
|
95
|
-
return {
|
|
96
|
-
removed: false,
|
|
97
|
-
warnings
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
throw error;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function parseScopes(raw) {
|
|
104
|
-
if (!raw || raw.length === 0) {
|
|
105
|
-
return [...GC_SCOPE_VALUES];
|
|
106
|
-
}
|
|
107
|
-
const tokens = raw.flatMap((entry) => entry.split(",")).map((entry) => entry.trim().toLowerCase()).filter((entry) => entry.length > 0);
|
|
108
|
-
if (tokens.length === 0) {
|
|
109
|
-
throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(",")})`, EXIT_CODE.USAGE);
|
|
110
|
-
}
|
|
111
|
-
const resolved = /* @__PURE__ */ new Set();
|
|
112
|
-
for (const token of tokens) {
|
|
113
|
-
if (!GC_SCOPE_VALUES.includes(token)) {
|
|
114
|
-
throw new PmCliError(`Invalid --scope value "${token}". Expected one or more of: ${GC_SCOPE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
|
|
115
|
-
}
|
|
116
|
-
resolved.add(token);
|
|
117
|
-
}
|
|
118
|
-
return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));
|
|
119
|
-
}
|
|
120
|
-
function buildGcGuidance(params) {
|
|
121
|
-
const guidance = [];
|
|
122
|
-
if (params.dryRun) {
|
|
123
|
-
guidance.push("Dry-run preview only: no cache artifacts were deleted.");
|
|
124
|
-
}
|
|
125
|
-
const searchScopeSelected = params.scopes.includes("index") || params.scopes.includes("embeddings");
|
|
126
|
-
const searchArtifactsAffected = params.removed.some((entry) => entry === "index/manifest.json" || entry === "search/embeddings.jsonl" || entry === "search/vectorization-status.json" || entry === "search/lancedb");
|
|
127
|
-
if (searchScopeSelected && searchArtifactsAffected) {
|
|
128
|
-
guidance.push('Search artifacts were removed; run "pm install search-advanced --project" if reindex is unavailable, then "pm reindex --mode keyword" (and "--mode semantic" when semantic search is enabled) before search-heavy workflows.');
|
|
129
|
-
}
|
|
130
|
-
return guidance;
|
|
131
|
-
}
|
|
132
|
-
async function runGc(global, options = {}) {
|
|
133
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
134
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
135
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
136
|
-
}
|
|
137
|
-
await readSettings(pmRoot);
|
|
138
|
-
const dryRun = options.dryRun === true;
|
|
139
|
-
const scopes = parseScopes(options.scope);
|
|
140
|
-
const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));
|
|
141
|
-
const removed = [];
|
|
142
|
-
const retained = [];
|
|
143
|
-
const warnings = [];
|
|
144
|
-
for (const target of selectedTargets) {
|
|
145
|
-
const result = await removeCacheFile(pmRoot, target, dryRun);
|
|
146
|
-
if (result.removed) {
|
|
147
|
-
removed.push(target.relativePath);
|
|
148
|
-
} else {
|
|
149
|
-
retained.push(target.relativePath);
|
|
150
|
-
}
|
|
151
|
-
warnings.push(...result.warnings);
|
|
152
|
-
}
|
|
153
|
-
warnings.push(...await runActiveOnIndexHooks({
|
|
154
|
-
mode: dryRun ? "gc:dry-run" : "gc",
|
|
155
|
-
total_items: selectedTargets.length
|
|
156
|
-
}));
|
|
157
|
-
const guidance = buildGcGuidance({
|
|
158
|
-
dryRun,
|
|
159
|
-
scopes,
|
|
160
|
-
removed
|
|
161
|
-
});
|
|
162
|
-
return {
|
|
163
|
-
ok: warnings.length === 0,
|
|
164
|
-
dry_run: dryRun,
|
|
165
|
-
scope: scopes,
|
|
166
|
-
removed,
|
|
167
|
-
retained,
|
|
168
|
-
warnings,
|
|
169
|
-
guidance,
|
|
170
|
-
generated_at: nowIso()
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
export {
|
|
174
|
-
runGc
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=gc-GT552UJH.js.map
|
|
177
|
-
|
|
178
|
-
//# debugId=3ebcb88b-3dec-5748-a0a5-5396eb6852a8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/gc.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nconst GC_SCOPE_VALUES = [\"index\", \"embeddings\", \"runtime\"] as const;\ntype GcScope = (typeof GC_SCOPE_VALUES)[number];\n\ninterface GcTarget {\n scope: GcScope;\n relativePath: string;\n kind: \"file\" | \"directory\";\n}\n\nconst GC_TARGETS: readonly GcTarget[] = [\n {\n scope: \"index\",\n relativePath: \"index/manifest.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/embeddings.jsonl\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/vectorization-status.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/lancedb\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n] as const;\n\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\nexport interface GcResult {\n ok: boolean;\n dry_run: boolean;\n scope: GcScope[];\n removed: string[];\n retained: string[];\n warnings: string[];\n guidance: string[];\n generated_at: string;\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\nasync function removeCacheFile(\n pmRoot: string,\n target: GcTarget,\n dryRun: boolean,\n): Promise<{ removed: boolean; warnings: string[] }> {\n const relativePath = target.relativePath;\n const absolutePath = path.join(pmRoot, relativePath);\n const warnings = await runActiveOnReadHooks({\n path: absolutePath,\n scope: \"project\",\n });\n try {\n const stats = await fs.stat(absolutePath);\n if (target.kind === \"file\" && !stats.isFile()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_file:${relativePath}`],\n };\n }\n if (target.kind === \"directory\" && !stats.isDirectory()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_directory:${relativePath}`],\n };\n }\n if (dryRun) {\n return {\n removed: true,\n warnings,\n };\n }\n if (target.kind === \"file\") {\n await fs.unlink(absolutePath);\n } else {\n await fs.rm(absolutePath, { recursive: true, force: true });\n }\n const writeWarnings = await runActiveOnWriteHooks({\n path: absolutePath,\n scope: \"project\",\n op: \"gc:remove\",\n });\n return {\n removed: true,\n warnings: [...warnings, ...writeWarnings],\n };\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return {\n removed: false,\n warnings,\n };\n }\n throw error;\n }\n}\n\nfunction parseScopes(raw: string[] | undefined): GcScope[] {\n if (!raw || raw.length === 0) {\n return [...GC_SCOPE_VALUES];\n }\n const tokens = raw\n .flatMap((entry) => entry.split(\",\"))\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(\",\")})`, EXIT_CODE.USAGE);\n }\n const resolved = new Set<GcScope>();\n for (const token of tokens) {\n if (!(GC_SCOPE_VALUES as readonly string[]).includes(token)) {\n throw new PmCliError(\n `Invalid --scope value \"${token}\". Expected one or more of: ${GC_SCOPE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.add(token as GcScope);\n }\n return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));\n}\n\nfunction buildGcGuidance(params: {\n dryRun: boolean;\n scopes: GcScope[];\n removed: string[];\n}): string[] {\n const guidance: string[] = [];\n if (params.dryRun) {\n guidance.push(\"Dry-run preview only: no cache artifacts were deleted.\");\n }\n const searchScopeSelected = params.scopes.includes(\"index\") || params.scopes.includes(\"embeddings\");\n const searchArtifactsAffected = params.removed.some(\n (entry) =>\n entry === \"index/manifest.json\" ||\n entry === \"search/embeddings.jsonl\" ||\n entry === \"search/vectorization-status.json\" ||\n entry === \"search/lancedb\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; run \"pm install search-advanced --project\" if reindex is unavailable, then \"pm reindex --mode keyword\" (and \"--mode semantic\" when semantic search is enabled) before search-heavy workflows.',\n );\n }\n return guidance;\n}\n\nexport async function runGc(global: GlobalOptions, options: GcCommandOptions = {}): Promise<GcResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n await readSettings(pmRoot);\n const dryRun = options.dryRun === true;\n const scopes = parseScopes(options.scope);\n const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));\n\n const removed: string[] = [];\n const retained: string[] = [];\n const warnings: string[] = [];\n\n for (const target of selectedTargets) {\n const result = await removeCacheFile(pmRoot, target, dryRun);\n if (result.removed) {\n removed.push(target.relativePath);\n } else {\n retained.push(target.relativePath);\n }\n warnings.push(...result.warnings);\n }\n warnings.push(\n ...(await runActiveOnIndexHooks({\n mode: dryRun ? \"gc:dry-run\" : \"gc\",\n total_items: selectedTargets.length,\n })),\n );\n const guidance = buildGcGuidance({\n dryRun,\n scopes,\n removed,\n });\n\n return {\n ok: warnings.length === 0,\n dry_run: dryRun,\n scope: scopes,\n removed,\n retained,\n warnings,\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAUjB,IAAM,kBAAkB,CAAC,SAAS,cAAc,SAAS;AASzD,IAAM,aAAkC;EACtC;IACE,OAAO;IACP,cAAc;IACd,MAAM;;EAER;IACE,OAAO;IACP,cAAc;IACd,MAAM;;EAER;IACE,OAAO;IACP,cAAc;IACd,MAAM;;EAER;IACE,OAAO;IACP,cAAc;IACd,MAAM;;EAER;IACE,OAAO;IACP,cAAc;IACd,MAAM;;;AAoBV,SAAS,QAAQ,OAAgB,MAAY;AAC3C,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,SAAU,MAA4B,SAAS;AACjH;AAEA,eAAe,gBACb,QACA,QACA,QAAe;AAEf,QAAM,eAAe,OAAO;AAC5B,QAAM,eAAe,KAAK,KAAK,QAAQ,YAAY;AACnD,QAAM,WAAW,MAAM,qBAAqB;IAC1C,MAAM;IACN,OAAO;GACR;AACD,MAAI;AACF,UAAM,QAAQ,MAAM,GAAG,KAAK,YAAY;AACxC,QAAI,OAAO,SAAS,UAAU,CAAC,MAAM,OAAM,GAAI;AAC7C,aAAO;QACL,SAAS;QACT,UAAU,CAAC,GAAG,UAAU,cAAc,YAAY,EAAE;;IAExD;AACA,QAAI,OAAO,SAAS,eAAe,CAAC,MAAM,YAAW,GAAI;AACvD,aAAO;QACL,SAAS;QACT,UAAU,CAAC,GAAG,UAAU,mBAAmB,YAAY,EAAE;;IAE7D;AACA,QAAI,QAAQ;AACV,aAAO;QACL,SAAS;QACT;;IAEJ;AACA,QAAI,OAAO,SAAS,QAAQ;AAC1B,YAAM,GAA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-RANZIID5.js";
|
|
4
|
-
import {
|
|
5
|
-
EXIT_CODE,
|
|
6
|
-
PmCliError,
|
|
7
|
-
getSettingsPath,
|
|
8
|
-
pathExists,
|
|
9
|
-
readSettings,
|
|
10
|
-
resolvePmRoot,
|
|
11
|
-
runActiveOnIndexHooks,
|
|
12
|
-
runActiveOnReadHooks,
|
|
13
|
-
runActiveOnWriteHooks
|
|
14
|
-
} from "./chunk-SRVKTWPR.js";
|
|
15
|
-
|
|
16
|
-
// dist/cli/commands/gc.js
|
|
17
|
-
import fs from "node:fs/promises";
|
|
18
|
-
import path from "node:path";
|
|
19
|
-
!(function() {
|
|
20
|
-
try {
|
|
21
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
22
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4daa69cd-168b-5375-897e-7c642e96582f");
|
|
23
|
-
} catch (e2) {
|
|
24
|
-
}
|
|
25
|
-
})();
|
|
26
|
-
var GC_SCOPE_VALUES = ["index", "embeddings", "runtime"];
|
|
27
|
-
var GC_TARGETS = [
|
|
28
|
-
{
|
|
29
|
-
scope: "index",
|
|
30
|
-
relativePath: "index/manifest.json",
|
|
31
|
-
kind: "file"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
scope: "embeddings",
|
|
35
|
-
relativePath: "search/embeddings.jsonl",
|
|
36
|
-
kind: "file"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
scope: "embeddings",
|
|
40
|
-
relativePath: "search/vectorization-status.json",
|
|
41
|
-
kind: "file"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
scope: "embeddings",
|
|
45
|
-
relativePath: "search/lancedb",
|
|
46
|
-
kind: "directory"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
scope: "runtime",
|
|
50
|
-
relativePath: "runtime/test-runs",
|
|
51
|
-
kind: "directory"
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
function isErrno(error, code) {
|
|
55
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
56
|
-
}
|
|
57
|
-
async function removeCacheFile(pmRoot, target, dryRun) {
|
|
58
|
-
const relativePath = target.relativePath;
|
|
59
|
-
const absolutePath = path.join(pmRoot, relativePath);
|
|
60
|
-
const warnings = await runActiveOnReadHooks({
|
|
61
|
-
path: absolutePath,
|
|
62
|
-
scope: "project"
|
|
63
|
-
});
|
|
64
|
-
try {
|
|
65
|
-
const stats = await fs.stat(absolutePath);
|
|
66
|
-
if (target.kind === "file" && !stats.isFile()) {
|
|
67
|
-
return {
|
|
68
|
-
removed: false,
|
|
69
|
-
warnings: [...warnings, `not_a_file:${relativePath}`]
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (target.kind === "directory" && !stats.isDirectory()) {
|
|
73
|
-
return {
|
|
74
|
-
removed: false,
|
|
75
|
-
warnings: [...warnings, `not_a_directory:${relativePath}`]
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (dryRun) {
|
|
79
|
-
return {
|
|
80
|
-
removed: true,
|
|
81
|
-
warnings
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
if (target.kind === "file") {
|
|
85
|
-
await fs.unlink(absolutePath);
|
|
86
|
-
} else {
|
|
87
|
-
await fs.rm(absolutePath, { recursive: true, force: true });
|
|
88
|
-
}
|
|
89
|
-
const writeWarnings = await runActiveOnWriteHooks({
|
|
90
|
-
path: absolutePath,
|
|
91
|
-
scope: "project",
|
|
92
|
-
op: "gc:remove"
|
|
93
|
-
});
|
|
94
|
-
return {
|
|
95
|
-
removed: true,
|
|
96
|
-
warnings: [...warnings, ...writeWarnings]
|
|
97
|
-
};
|
|
98
|
-
} catch (error) {
|
|
99
|
-
if (isErrno(error, "ENOENT")) {
|
|
100
|
-
return {
|
|
101
|
-
removed: false,
|
|
102
|
-
warnings
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
throw error;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function parseScopes(raw) {
|
|
109
|
-
if (!raw || raw.length === 0) {
|
|
110
|
-
return [...GC_SCOPE_VALUES];
|
|
111
|
-
}
|
|
112
|
-
const tokens = raw.flatMap((entry) => entry.split(",")).map((entry) => entry.trim().toLowerCase()).filter((entry) => entry.length > 0);
|
|
113
|
-
if (tokens.length === 0) {
|
|
114
|
-
throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(",")})`, EXIT_CODE.USAGE);
|
|
115
|
-
}
|
|
116
|
-
const resolved = /* @__PURE__ */ new Set();
|
|
117
|
-
for (const token of tokens) {
|
|
118
|
-
if (!GC_SCOPE_VALUES.includes(token)) {
|
|
119
|
-
throw new PmCliError(`Invalid --scope value "${token}". Expected one or more of: ${GC_SCOPE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
|
|
120
|
-
}
|
|
121
|
-
resolved.add(token);
|
|
122
|
-
}
|
|
123
|
-
return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));
|
|
124
|
-
}
|
|
125
|
-
function buildGcGuidance(params) {
|
|
126
|
-
const guidance = [];
|
|
127
|
-
if (params.dryRun) {
|
|
128
|
-
guidance.push("Dry-run preview only: no cache artifacts were deleted.");
|
|
129
|
-
}
|
|
130
|
-
const searchScopeSelected = params.scopes.includes("index") || params.scopes.includes("embeddings");
|
|
131
|
-
const searchArtifactsAffected = params.removed.some((entry) => entry === "index/manifest.json" || entry === "search/embeddings.jsonl" || entry === "search/vectorization-status.json" || entry === "search/lancedb");
|
|
132
|
-
if (searchScopeSelected && searchArtifactsAffected) {
|
|
133
|
-
guidance.push('Search artifacts were removed; run "pm install search-advanced --project" if reindex is unavailable, then "pm reindex --mode keyword" (and "--mode semantic" when semantic search is enabled) before search-heavy workflows.');
|
|
134
|
-
}
|
|
135
|
-
return guidance;
|
|
136
|
-
}
|
|
137
|
-
async function runGc(global2, options = {}) {
|
|
138
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
139
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
140
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
141
|
-
}
|
|
142
|
-
await readSettings(pmRoot);
|
|
143
|
-
const dryRun = options.dryRun === true;
|
|
144
|
-
const scopes = parseScopes(options.scope);
|
|
145
|
-
const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));
|
|
146
|
-
const removed = [];
|
|
147
|
-
const retained = [];
|
|
148
|
-
const warnings = [];
|
|
149
|
-
for (const target of selectedTargets) {
|
|
150
|
-
const result = await removeCacheFile(pmRoot, target, dryRun);
|
|
151
|
-
if (result.removed) {
|
|
152
|
-
removed.push(target.relativePath);
|
|
153
|
-
} else {
|
|
154
|
-
retained.push(target.relativePath);
|
|
155
|
-
}
|
|
156
|
-
warnings.push(...result.warnings);
|
|
157
|
-
}
|
|
158
|
-
warnings.push(...await runActiveOnIndexHooks({
|
|
159
|
-
mode: dryRun ? "gc:dry-run" : "gc",
|
|
160
|
-
total_items: selectedTargets.length
|
|
161
|
-
}));
|
|
162
|
-
const guidance = buildGcGuidance({
|
|
163
|
-
dryRun,
|
|
164
|
-
scopes,
|
|
165
|
-
removed
|
|
166
|
-
});
|
|
167
|
-
return {
|
|
168
|
-
ok: warnings.length === 0,
|
|
169
|
-
dry_run: dryRun,
|
|
170
|
-
scope: scopes,
|
|
171
|
-
removed,
|
|
172
|
-
retained,
|
|
173
|
-
warnings,
|
|
174
|
-
guidance,
|
|
175
|
-
generated_at: nowIso()
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
export {
|
|
179
|
-
runGc
|
|
180
|
-
};
|
|
181
|
-
//# sourceMappingURL=gc-QNBRJG6H.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/gc.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\nconst GC_SCOPE_VALUES = [\"index\", \"embeddings\", \"runtime\"] as const;\ntype GcScope = (typeof GC_SCOPE_VALUES)[number];\n\ninterface GcTarget {\n scope: GcScope;\n relativePath: string;\n kind: \"file\" | \"directory\";\n}\n\nconst GC_TARGETS: readonly GcTarget[] = [\n {\n scope: \"index\",\n relativePath: \"index/manifest.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/embeddings.jsonl\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/vectorization-status.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/lancedb\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n] as const;\n\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\nexport interface GcResult {\n ok: boolean;\n dry_run: boolean;\n scope: GcScope[];\n removed: string[];\n retained: string[];\n warnings: string[];\n guidance: string[];\n generated_at: string;\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\nasync function removeCacheFile(\n pmRoot: string,\n target: GcTarget,\n dryRun: boolean,\n): Promise<{ removed: boolean; warnings: string[] }> {\n const relativePath = target.relativePath;\n const absolutePath = path.join(pmRoot, relativePath);\n const warnings = await runActiveOnReadHooks({\n path: absolutePath,\n scope: \"project\",\n });\n try {\n const stats = await fs.stat(absolutePath);\n if (target.kind === \"file\" && !stats.isFile()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_file:${relativePath}`],\n };\n }\n if (target.kind === \"directory\" && !stats.isDirectory()) {\n return {\n removed: false,\n warnings: [...warnings, `not_a_directory:${relativePath}`],\n };\n }\n if (dryRun) {\n return {\n removed: true,\n warnings,\n };\n }\n if (target.kind === \"file\") {\n await fs.unlink(absolutePath);\n } else {\n await fs.rm(absolutePath, { recursive: true, force: true });\n }\n const writeWarnings = await runActiveOnWriteHooks({\n path: absolutePath,\n scope: \"project\",\n op: \"gc:remove\",\n });\n return {\n removed: true,\n warnings: [...warnings, ...writeWarnings],\n };\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n return {\n removed: false,\n warnings,\n };\n }\n throw error;\n }\n}\n\nfunction parseScopes(raw: string[] | undefined): GcScope[] {\n if (!raw || raw.length === 0) {\n return [...GC_SCOPE_VALUES];\n }\n const tokens = raw\n .flatMap((entry) => entry.split(\",\"))\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n if (tokens.length === 0) {\n throw new PmCliError(`--scope requires at least one value (${GC_SCOPE_VALUES.join(\",\")})`, EXIT_CODE.USAGE);\n }\n const resolved = new Set<GcScope>();\n for (const token of tokens) {\n if (!(GC_SCOPE_VALUES as readonly string[]).includes(token)) {\n throw new PmCliError(\n `Invalid --scope value \"${token}\". Expected one or more of: ${GC_SCOPE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n resolved.add(token as GcScope);\n }\n return GC_SCOPE_VALUES.filter((scope) => resolved.has(scope));\n}\n\nfunction buildGcGuidance(params: {\n dryRun: boolean;\n scopes: GcScope[];\n removed: string[];\n}): string[] {\n const guidance: string[] = [];\n if (params.dryRun) {\n guidance.push(\"Dry-run preview only: no cache artifacts were deleted.\");\n }\n const searchScopeSelected = params.scopes.includes(\"index\") || params.scopes.includes(\"embeddings\");\n const searchArtifactsAffected = params.removed.some(\n (entry) =>\n entry === \"index/manifest.json\" ||\n entry === \"search/embeddings.jsonl\" ||\n entry === \"search/vectorization-status.json\" ||\n entry === \"search/lancedb\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; run \"pm install search-advanced --project\" if reindex is unavailable, then \"pm reindex --mode keyword\" (and \"--mode semantic\" when semantic search is enabled) before search-heavy workflows.',\n );\n }\n return guidance;\n}\n\nexport async function runGc(global: GlobalOptions, options: GcCommandOptions = {}): Promise<GcResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n await readSettings(pmRoot);\n const dryRun = options.dryRun === true;\n const scopes = parseScopes(options.scope);\n const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));\n\n const removed: string[] = [];\n const retained: string[] = [];\n const warnings: string[] = [];\n\n for (const target of selectedTargets) {\n const result = await removeCacheFile(pmRoot, target, dryRun);\n if (result.removed) {\n removed.push(target.relativePath);\n } else {\n retained.push(target.relativePath);\n }\n warnings.push(...result.warnings);\n }\n warnings.push(\n ...(await runActiveOnIndexHooks({\n mode: dryRun ? \"gc:dry-run\" : \"gc\",\n total_items: selectedTargets.length,\n })),\n );\n const guidance = buildGcGuidance({\n dryRun,\n scopes,\n removed,\n });\n\n return {\n ok: warnings.length === 0,\n dry_run: dryRun,\n scope: scopes,\n removed,\n retained,\n warnings,\n guidance,\n generated_at: nowIso(),\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;AAUjB,IAAM,kBAAkB,CAAC,SAAS,cAAc,SAAS;AASzD,IAAM,aAAkC;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,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AAEA,QAAM,aAAa,MAAM;AACzB,QAAM,SAAS,QAAQ,WAAW;AAClC,QAAM,SAAS,YAAY,QAAQ,KAAK;AACxC,QAAM,kBAAkB,WAAW,OAAO,CAAC,WAAW,OAAO,SAAS,OAAO,KAAK,CAAC;AAEnF,QAAM,UAAoB,CAAA;AAC1B,QAAM,WAAqB,CAAA;AAC3B,QAAM,WAAqB,CAAA;AAE3B,aAAW,UAAU,iBAAiB;AACpC,UAAM,SAAS,MAAM,gBAAgB,QAAQ,QAAQ,MAAM;AAC3D,QAAI,OAAO,SAAS;AAClB,cAAQ,KAAK,OAAO,YAAY;IAClC,OAAO;AACL,eAAS,KAAK,OAAO,YAAY;IACnC;AACA,aAAS,KAAK,GAAG,OAAO,QAAQ;EAClC;AACA,WAAS,KACP,GAAI,MAAM,sBAAsB;IAC9B,MAAM,SAAS,eAAe;IAC9B,aAAa,gBAAgB;GAC9B,CAAE;AAEL,QAAM,WAAW,gBAAgB;IAC/B;IACA;IACA;GACD;AAED,SAAO;IACL,IAAI,SAAS,WAAW;IACxB,SAAS;IACT,OAAO;IACP;IACA;IACA;IACA;IACA,cAAc,OAAM;;AAExB;",
|
|
6
|
-
"names": ["global"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/get.ts"],
|
|
4
|
-
"sourcesContent": ["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { buildItemNotFoundError, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, LinkedDoc, LinkedFile, LinkedTest } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\nexport interface GetResult {\n item: Partial<ItemFrontMatter>;\n body?: string;\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n claim_state?: ClaimStateContext;\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\nexport interface GetOptions {\n depth?: string;\n fields?: string;\n full?: boolean;\n}\n\nfunction toClaimHistoryContext(\n entry: ClaimHistoryEntry,\n): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history].reverse().find((entry) => entry.op === \"claim\");\n const lastRelease = [...history].reverse().find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\"Get --depth must be one of brief|standard|deep|full\", EXIT_CODE.USAGE);\n}\n\nfunction projectItemForDepth(item: ItemFrontMatter, depth: GetDepth): Partial<ItemFrontMatter> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\"Get --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(fields: string[] | null, runtimeMetadataKeys: Iterable<string>): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);\n const allowedRootFields = new Set([\"body\", \"linked\", \"claim_state\"]);\n const allowedLinkedFields = new Set([\"linked.files\", \"linked.tests\", \"linked.docs\"]);\n const allowedClaimStateFields = new Set([\"claim_state.claimed\", \"claim_state.assignee\", \"claim_state.last_claim\", \"claim_state.last_release\"]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown get --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n });\n }\n}\n\nfunction projectItemForFields(item: ItemFrontMatter, fields: string[]): Partial<ItemFrontMatter> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n if (normalized === \"body\" || normalized === \"linked\" || normalized.startsWith(\"linked.\")) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemFrontMatter>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return fields?.some((field) => field === name || field === `item.${name}`) ?? false;\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\nexport async function runGet(id: string, global: GlobalOptions, options: GetOptions = {}): Promise<GetResult> {\n if (options.full && (options.fields !== undefined || options.depth !== undefined)) {\n throw new PmCliError(\"Get projection options are mutually exclusive; remove the extra projection flag and retry.\", EXIT_CODE.USAGE);\n }\n const depth = options.full ? \"deep\" : parseGetDepth(options.depth);\n const fields = parseGetFields(options.fields);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const runtimeMetadataKeys: string[] = [];\n for (const field of resolveRuntimeFieldRegistry(settings.schema).definitions) {\n runtimeMetadataKeys.push(field.metadata_key);\n }\n validateGetFields(fields, runtimeMetadataKeys);\n const files = loaded.document.metadata.files ?? [];\n const tests = loaded.document.metadata.tests ?? [];\n const docs = loaded.document.metadata.docs ?? [];\n const fieldProjection = fields !== null;\n const includeBody = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"body\");\n const includeLinked = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"linked\");\n const includeLinkedFiles = includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests = includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs = includeLinked || fieldsInclude(fields, \"linked.docs\");\n const includeClaimState = !fieldProjection ? depth !== \"brief\" : fieldsIncludeRoot(fields, \"claim_state\");\n let claimState: ClaimStateContext | undefined;\n if (includeClaimState) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n let history: ClaimHistoryEntry[] = [];\n try {\n history = await readHistoryEntries(historyPath, located.id);\n } catch {\n history = [];\n }\n claimState = resolveClaimStateContext(loaded.document.metadata.assignee, history);\n }\n const result: GetResult = {\n item: fieldProjection\n ? projectItemForFields(loaded.document.metadata, fields)\n : projectItemForDepth(loaded.document.metadata, depth),\n };\n if (includeBody) {\n result.body = loaded.document.body;\n }\n if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {\n result.linked = {\n files: includeLinkedFiles ? files : [],\n tests: includeLinkedTests ? tests : [],\n docs: includeLinkedDocs ? docs : [],\n };\n }\n if (claimState) {\n result.claim_state = claimState;\n }\n return result;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,mBAAmB,CAAC,SAAS,YAAY,MAAM;AAUrD,SAAS,sBACP,OAAwB;AAExB,SAAO;IACL,IAAI,MAAM;IACV,QAAQ,MAAM;IACd,SAAS,MAAM,WAAW;;AAE9B;AAEA,SAAS,yBACP,eACA,SAA4B;AAE5B,QAAM,WAAW,eAAe,KAAI;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AQ,MAAM;AACvF,QAAM,gBAAgB,CAAC,kBAAkB,UAAU,UAAU,cAAc,QAAQ,QAAQ;AAC3F,QAAM,qBAAqB,iBAAiB,cAAc,QAAQ,cAAc;AAChF,QAAM,qBAAqB,iBAAiB,cAAc,QAAQ,cAAc;AAChF,QAAM,oBAAoB,iBAAiB,cAAc,QAAQ,aAAa;AAC9E,QAAM,oBAAoB,CAAC,kBAAkB,UAAU,UAAU,kBAAkB,QAAQ,aAAa;AACxG,MAAI;AACJ,MAAI,mBAAmB;AACrB,UAAM,cAAc,eAAe,QAAQ,QAAQ,EAAE;AACrD,QAAI,UAA+B,CAAA;AACnC,QAAI;AACF,gBAAU,MAAM,mBAAmB,aAAa,QAAQ,EAAE;IAC5D,QAAQ;AACN,gBAAU,CAAA;IACZ;AACA,iBAAa,yBAAyB,OAAO,SAAS,SAAS,UAAU,OAAO;EAClF;AACA,QAAM,SAAoB;IACxB,MAAM,kBACF,qBAAqB,OAAO,SAAS,UAAU,MAAM,IACrD,oBAAoB,OAAO,SAAS,UAAU,KAAK;;AAEzD,MAAI,aAAa;AACf,WAAO,OAAO,OAAO,SAAS;EAChC;AACA,MAAI,iBAAiB,sBAAsB,sBAAsB,mBAAmB;AAClF,WAAO,SAAS;MACd,OAAO,qBAAqB,QAAQ,CAAA;MACpC,OAAO,qBAAqB,QAAQ,CAAA;MACpC,MAAM,oBAAoB,OAAO,CAAA;;EAErC;AACA,MAAI,YAAY;AACd,WAAO,cAAc;EACvB;AACA,SAAO;AACT;",
|
|
6
|
-
"names": ["global"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/get.ts"],"sourcesContent":["import { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { buildItemNotFoundError, locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter, LinkedDoc, LinkedFile, LinkedTest } from \"../../types/index.js\";\nimport { readHistoryEntries } from \"./history.js\";\n\ninterface ClaimHistoryContext {\n ts: string;\n author: string;\n message: string | null;\n}\n\ninterface ClaimHistoryEntry {\n op: string;\n ts: string;\n author: string;\n message?: string;\n}\n\ninterface ClaimStateContext {\n claimed: boolean;\n assignee: string | null;\n last_claim: ClaimHistoryContext | null;\n last_release: ClaimHistoryContext | null;\n}\n\nexport interface GetResult {\n item: Partial<ItemFrontMatter>;\n body?: string;\n linked?: {\n files: LinkedFile[];\n tests: LinkedTest[];\n docs: LinkedDoc[];\n };\n claim_state?: ClaimStateContext;\n}\n\nconst GET_DEPTH_VALUES = [\"brief\", \"standard\", \"deep\"] as const;\n\ntype GetDepth = (typeof GET_DEPTH_VALUES)[number];\n\nexport interface GetOptions {\n depth?: string;\n fields?: string;\n full?: boolean;\n}\n\nfunction toClaimHistoryContext(\n entry: ClaimHistoryEntry,\n): ClaimHistoryContext {\n return {\n ts: entry.ts,\n author: entry.author,\n message: entry.message ?? null,\n };\n}\n\nfunction resolveClaimStateContext(\n assigneeValue: string | undefined,\n history: ClaimHistoryEntry[],\n): ClaimStateContext {\n const assignee = assigneeValue?.trim();\n const normalizedAssignee = assignee && assignee.length > 0 ? assignee : null;\n const lastClaim = [...history].reverse().find((entry) => entry.op === \"claim\");\n const lastRelease = [...history].reverse().find((entry) => entry.op === \"release\");\n return {\n claimed: normalizedAssignee !== null,\n assignee: normalizedAssignee,\n last_claim: lastClaim ? toClaimHistoryContext(lastClaim) : null,\n last_release: lastRelease ? toClaimHistoryContext(lastRelease) : null,\n };\n}\n\nfunction parseGetDepth(raw: string | undefined): GetDepth {\n if (raw === undefined || raw.trim().length === 0) {\n return \"standard\";\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"full\") {\n return \"deep\";\n }\n if (GET_DEPTH_VALUES.includes(normalized as GetDepth)) {\n return normalized as GetDepth;\n }\n throw new PmCliError(\"Get --depth must be one of brief|standard|deep|full\", EXIT_CODE.USAGE);\n}\n\nfunction projectItemForDepth(item: ItemFrontMatter, depth: GetDepth): Partial<ItemFrontMatter> {\n if (depth === \"deep\") {\n return item;\n }\n const {\n comments: _comments,\n notes: _notes,\n learnings: _learnings,\n files: _files,\n tests: _tests,\n docs: _docs,\n reminders: _reminders,\n events: _events,\n ...projected\n } = item;\n return projected;\n}\n\nfunction parseGetFields(raw: string | undefined): string[] | null {\n if (raw === undefined) {\n return null;\n }\n const fields = raw\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (fields.length === 0) {\n throw new PmCliError(\"Get --fields requires a comma-separated list of field names\", EXIT_CODE.USAGE);\n }\n return fields;\n}\n\nfunction normalizeGetField(field: string): string {\n return field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n}\n\nfunction validateGetFields(fields: string[] | null, runtimeMetadataKeys: Iterable<string>): void {\n if (fields === null) {\n return;\n }\n const itemFields = new Set([...FRONT_MATTER_KEY_ORDER, ...runtimeMetadataKeys]);\n const allowedRootFields = new Set([\"body\", \"linked\", \"claim_state\"]);\n const allowedLinkedFields = new Set([\"linked.files\", \"linked.tests\", \"linked.docs\"]);\n const allowedClaimStateFields = new Set([\"claim_state.claimed\", \"claim_state.assignee\", \"claim_state.last_claim\", \"claim_state.last_release\"]);\n const unknown = fields.filter((field) => {\n const normalized = normalizeGetField(field);\n return (\n !itemFields.has(normalized) &&\n !allowedRootFields.has(normalized) &&\n !allowedLinkedFields.has(normalized) &&\n !allowedClaimStateFields.has(normalized)\n );\n });\n if (unknown.length > 0) {\n throw new PmCliError(`Unknown get --fields value(s): ${unknown.join(\", \")}`, EXIT_CODE.USAGE, {\n code: \"unknown_field_projection\",\n examples: [\n \"pm get <id> --fields id,title,status,type,updated_at\",\n \"pm get <id> --fields id,title,claim_state\",\n \"pm get <id> --fields id,title,body,linked.files\",\n ],\n });\n }\n}\n\nfunction projectItemForFields(item: ItemFrontMatter, fields: string[]): Partial<ItemFrontMatter> {\n const source = toItemRecord(item);\n const projected: Record<string, unknown> = {};\n for (const field of fields) {\n const normalized = field.startsWith(\"item.\") ? field.slice(\"item.\".length) : field;\n if (normalized === \"body\" || normalized === \"linked\" || normalized.startsWith(\"linked.\")) {\n continue;\n }\n projected[normalized] = source[normalized];\n }\n return projected as Partial<ItemFrontMatter>;\n}\n\nfunction fieldsInclude(fields: string[] | null, name: string): boolean {\n return fields?.some((field) => field === name || field === `item.${name}`) ?? false;\n}\n\nfunction fieldsIncludeRoot(fields: string[], name: string): boolean {\n return fields.some((field) => field === name || field.startsWith(`${name}.`));\n}\n\nexport async function runGet(id: string, global: GlobalOptions, options: GetOptions = {}): Promise<GetResult> {\n if (options.full && (options.fields !== undefined || options.depth !== undefined)) {\n throw new PmCliError(\"Get projection options are mutually exclusive; remove the extra projection flag and retry.\", EXIT_CODE.USAGE);\n }\n const depth = options.full ? \"deep\" : parseGetDepth(options.depth);\n const fields = parseGetFields(options.fields);\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const runtimeMetadataKeys: string[] = [];\n for (const field of resolveRuntimeFieldRegistry(settings.schema).definitions) {\n runtimeMetadataKeys.push(field.metadata_key);\n }\n validateGetFields(fields, runtimeMetadataKeys);\n const files = loaded.document.metadata.files ?? [];\n const tests = loaded.document.metadata.tests ?? [];\n const docs = loaded.document.metadata.docs ?? [];\n const fieldProjection = fields !== null;\n const includeBody = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"body\");\n const includeLinked = !fieldProjection ? depth !== \"brief\" : fieldsInclude(fields, \"linked\");\n const includeLinkedFiles = includeLinked || fieldsInclude(fields, \"linked.files\");\n const includeLinkedTests = includeLinked || fieldsInclude(fields, \"linked.tests\");\n const includeLinkedDocs = includeLinked || fieldsInclude(fields, \"linked.docs\");\n const includeClaimState = !fieldProjection ? depth !== \"brief\" : fieldsIncludeRoot(fields, \"claim_state\");\n let claimState: ClaimStateContext | undefined;\n if (includeClaimState) {\n const historyPath = getHistoryPath(pmRoot, located.id);\n let history: ClaimHistoryEntry[] = [];\n try {\n history = await readHistoryEntries(historyPath, located.id);\n } catch {\n history = [];\n }\n claimState = resolveClaimStateContext(loaded.document.metadata.assignee, history);\n }\n const result: GetResult = {\n item: fieldProjection\n ? projectItemForFields(loaded.document.metadata, fields)\n : projectItemForDepth(loaded.document.metadata, depth),\n };\n if (includeBody) {\n result.body = loaded.document.body;\n }\n if (includeLinked || includeLinkedFiles || includeLinkedTests || includeLinkedDocs) {\n result.linked = {\n files: includeLinkedFiles ? files : [],\n tests: includeLinkedTests ? tests : [],\n docs: includeLinkedDocs ? docs : [],\n };\n }\n if (claimState) {\n result.claim_state = claimState;\n }\n return result;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,mBAAmB,CAAC,SAAS,YAAY,MAAM;AAUrD,SAAS,sBACP,OAAwB;AAExB,SAAO;IACL,IAAI,MAAM;I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