@unbrained/pm-cli 2026.6.19 → 2026.6.21
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 +328 -258
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.d.ts +12 -1
- package/dist/cli/bootstrap-args.js +20 -9
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +31 -25
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/completion.js +3 -3
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +62 -0
- package/dist/cli/commands/eval.js +158 -0
- package/dist/cli/commands/eval.js.map +1 -0
- package/dist/cli/commands/extension/install-sources.d.ts +12 -0
- package/dist/cli/commands/extension/install-sources.js +77 -10
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +49 -3
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.js +9 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +12 -1
- package/dist/cli/commands/gc.js +53 -6
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/health.js +27 -9
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/linked-artifacts.js +13 -3
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/list.js +12 -9
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/plan.js +2 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/restore.js +5 -11
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.d.ts +39 -1
- package/dist/cli/commands/search.js +89 -12
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/update.js +96 -58
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.js +44 -2
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +9 -0
- package/dist/cli/extension-command-help.js +13 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +8 -0
- package/dist/cli/extension-command-options.js +27 -2
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +15 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.js +49 -9
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +34 -4
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.js +3 -3
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CIHV64UC.js +18 -0
- package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js → activity-KW3IRP44.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js → aggregate-3ZKQG5SW.js} +10 -10
- package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js → aggregate-FIGQEIL3.js} +10 -10
- package/dist/cli-bundle/chunks/{append-BP2ARHOK.js → append-EWJYJ7CH.js} +8 -8
- package/dist/cli-bundle/chunks/{append-5U3XR5SD.js → append-QEOLX3XB.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js → chunk-2EIMPCE4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MAKOMXVM.js → chunk-2GCDRRIF.js} +106 -67
- package/dist/cli-bundle/chunks/chunk-2GCDRRIF.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-AZR2JITW.js → chunk-2PKHRP6G.js} +190 -22
- package/dist/cli-bundle/chunks/chunk-2PKHRP6G.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YWAYOWDQ.js → chunk-32R4PIC6.js} +118 -15
- package/dist/cli-bundle/chunks/chunk-32R4PIC6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js → chunk-37QXHBIB.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UCNEPMPY.js → chunk-3EWSGA7N.js} +105 -66
- package/dist/cli-bundle/chunks/chunk-3EWSGA7N.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js → chunk-3MDHREEV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I2VJM36R.js → chunk-434HM6Z5.js} +21 -21
- package/dist/cli-bundle/chunks/chunk-434HM6Z5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4IBSEQ2.js → chunk-52OCIDPG.js} +20 -8
- package/dist/cli-bundle/chunks/chunk-52OCIDPG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js → chunk-5FIEHKEX.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js → chunk-5IDI42VV.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UA4ANRJY.js → chunk-5PCI3UBT.js} +119 -16
- package/dist/cli-bundle/chunks/chunk-5PCI3UBT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js → chunk-5QICDWMV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js → chunk-6CJWZAN7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js → chunk-6H4LF7AO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js → chunk-6M4RJS4M.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4BFNWAMQ.js → chunk-6ZXM2XNF.js} +29 -12
- package/dist/cli-bundle/chunks/chunk-6ZXM2XNF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js → chunk-76Z3YSHV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js → chunk-7D3SAQXM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DVUU3AHP.js → chunk-A4Z7ZOL5.js} +17 -6
- package/dist/cli-bundle/chunks/chunk-A4Z7ZOL5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js → chunk-AIS5PGI3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js → chunk-AZMOLBN3.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js → chunk-B473GZWW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js → chunk-C3AZ5ZML.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-S673PVHD.js → chunk-C4N5I7ZW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js → chunk-CF55WVVS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js → chunk-CZPXY7UW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js → chunk-CZUB4XWO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js → chunk-D7FYS6PG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5SRID7DV.js → chunk-EBH56IXK.js} +29 -12
- package/dist/cli-bundle/chunks/chunk-EBH56IXK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js → chunk-F5NZWFSW.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-PSWSQHM7.js → chunk-F7K5GWP3.js} +15 -19
- package/dist/cli-bundle/chunks/chunk-F7K5GWP3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js → chunk-FKBDKV7Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js → chunk-FRUFKWNK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js → chunk-FWPDUYEY.js} +7 -7
- package/dist/cli-bundle/chunks/{search-2JX776KX.js → chunk-GMHPNNYG.js} +184 -23
- package/dist/cli-bundle/chunks/chunk-GMHPNNYG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js → chunk-GOZUHWFD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js → chunk-H7NJZWG2.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-FPQA4ZMA.js → chunk-HC4AWIKT.js} +18 -7
- package/dist/cli-bundle/chunks/chunk-HC4AWIKT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js → chunk-HCU6WUSY.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-2RI3BDFK.js → chunk-HIP7WVTL.js} +10 -9
- package/dist/cli-bundle/chunks/chunk-HIP7WVTL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5QLHQK7V.js → chunk-HMOADQVT.js} +26 -26
- package/dist/cli-bundle/chunks/chunk-HMOADQVT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K5TD74VU.js → chunk-J4MYYSOL.js} +19 -7
- package/dist/cli-bundle/chunks/chunk-J4MYYSOL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GDOTTY2S.js → chunk-JINYH2DB.js} +40 -2
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EMFDZ7N3.js → chunk-LEU5GHRC.js} +55 -5
- package/dist/cli-bundle/chunks/chunk-LEU5GHRC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js → chunk-LUWW7L4B.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js → chunk-M5XALUSL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js → chunk-N5ZJACJ6.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js → chunk-NB3PYLQ6.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js → chunk-NIGXMNNI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js → chunk-NIUEXCFS.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js → chunk-NJHMAJ6N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js → chunk-NJN7LL7U.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js → chunk-NSBZ2CKF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZZEM2PH7.js → chunk-NXS7ZKAK.js} +19 -14
- package/dist/cli-bundle/chunks/chunk-NXS7ZKAK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js → chunk-O47BPOPC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X26ODPU4.js → chunk-OFYMIDF2.js} +14 -18
- package/dist/cli-bundle/chunks/chunk-OFYMIDF2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js → chunk-OTHIWLMB.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js → chunk-PFSRUHDH.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js → chunk-PP2U4NMT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js → chunk-PUH4D67U.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js → chunk-Q2J2HJUN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QSH34DSQ.js → chunk-QGG32QHW.js} +61 -4
- package/dist/cli-bundle/chunks/chunk-QGG32QHW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js → chunk-QQHISQBJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js → chunk-QZTWBFXJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-COHNQLB2.js → chunk-R2EMWY7Q.js} +41 -3
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js → chunk-RLK7P77C.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js → chunk-RVHYI7SL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js → chunk-SBGXDO7A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js → chunk-SRYYRVPB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js → chunk-SX75ADBK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js → chunk-TKBHZPKD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js → chunk-UEMNL33O.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js → chunk-UPE3CDD7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js → chunk-UV6IYE5U.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YOGXK3ON.js → chunk-WQ7NIVDK.js} +18 -13
- package/dist/cli-bundle/chunks/chunk-WQ7NIVDK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js → chunk-YCJX76PW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FP7YLQ52.js → chunk-Z6T4PQI2.js} +11 -10
- package/dist/cli-bundle/chunks/chunk-Z6T4PQI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js → claim-RC56YUWG.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js → claim-THOJ6CMV.js} +10 -10
- package/dist/cli-bundle/chunks/close-DNMHGOCX.js +15 -0
- package/dist/cli-bundle/chunks/{close-3TSX6BYF.js → close-SG5MNCVQ.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js → close-many-3L3AQZBU.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js → close-many-DKQLBGLV.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-M7PAINZT.js → comments-M7ZOZNBX.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js → comments-SKWMDWCW.js} +10 -10
- package/dist/cli-bundle/chunks/{config-YICACPHA.js → config-7CK62S7T.js} +30 -10
- package/dist/cli-bundle/chunks/config-7CK62S7T.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-UWF3KRP5.js → config-OZCUABPB.js} +29 -9
- package/dist/cli-bundle/chunks/config-OZCUABPB.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-EGUGU4K7.js → context-OEC366TO.js} +13 -13
- package/dist/cli-bundle/chunks/{context-V32ZAPL6.js → context-PUG2A7RC.js} +13 -13
- package/dist/cli-bundle/chunks/{contracts-B2YWYUV5.js → contracts-3THOLA7L.js} +10 -8
- package/dist/cli-bundle/chunks/contracts-3THOLA7L.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-7G553BHP.js → contracts-N65FXEOL.js} +10 -8
- package/dist/cli-bundle/chunks/contracts-N65FXEOL.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js → copy-6QLHILAC.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js → copy-JPX7VZCH.js} +7 -7
- package/dist/cli-bundle/chunks/create-NNP6TSFO.js +30 -0
- package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js → create-Y54ZVVZH.js} +14 -14
- package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js → delete-63PCMQAJ.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js → delete-GDSMGAGJ.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js → deps-T4ZF5G54.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js → deps-XYQ73XRH.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js → docs-C75YIXHC.js} +10 -9
- package/dist/cli-bundle/chunks/{docs-3FXRDYA7.js.map → docs-C75YIXHC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js → docs-EHNPDWUL.js} +12 -11
- package/dist/cli-bundle/chunks/{docs-2H2UGIT6.js.map → docs-EHNPDWUL.js.map} +1 -1
- package/dist/cli-bundle/chunks/eval-3WKDTRMH.js +276 -0
- package/dist/cli-bundle/chunks/eval-3WKDTRMH.js.map +1 -0
- package/dist/cli-bundle/chunks/eval-GTENKE24.js +286 -0
- package/dist/cli-bundle/chunks/eval-GTENKE24.js.map +7 -0
- package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js → extension-46NWACO3.js} +5 -5
- package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js → extension-D5FDZ2CO.js} +5 -5
- package/dist/cli-bundle/chunks/{files-TXEQOA7C.js → files-DSZBOSSN.js} +12 -11
- package/dist/cli-bundle/chunks/{files-TXEQOA7C.js.map → files-DSZBOSSN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{files-UAZFB3EA.js → files-X3H7CCBQ.js} +10 -9
- package/dist/cli-bundle/chunks/{files-UAZFB3EA.js.map → files-X3H7CCBQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-UGROAMAX.js → focus-5STQXDPU.js} +8 -8
- package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js → focus-MDVPOWB5.js} +8 -8
- package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js +395 -0
- package/dist/cli-bundle/chunks/gc-ZC7JHBG7.js.map +7 -0
- package/dist/cli-bundle/chunks/gc-ZMST3WQP.js +385 -0
- package/dist/cli-bundle/chunks/gc-ZMST3WQP.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-OTXPLWYW.js → get-J2IPJRZW.js} +11 -11
- package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js → get-NT7L2HUZ.js} +11 -11
- package/dist/cli-bundle/chunks/{health-PPTJ7XKW.js → health-IVMA3XQC.js} +38 -26
- package/dist/cli-bundle/chunks/health-IVMA3XQC.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-JEBESKID.js → health-WOYBR3KU.js} +37 -25
- package/dist/cli-bundle/chunks/health-WOYBR3KU.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-HNWBUDMI.js → history-RLH2QCRO.js} +10 -10
- package/dist/cli-bundle/chunks/history-WX3MGFS2.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js → history-compact-UXDIFC33.js} +12 -12
- package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js → history-compact-ZBEBGJM7.js} +12 -12
- package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js → history-redact-P7I7AWMB.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-YQGU3XRA.js +21 -0
- package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js → history-repair-52KINVIK.js} +12 -12
- package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js → history-repair-RM5ITLU5.js} +12 -12
- package/dist/cli-bundle/chunks/{init-QGK4JFF6.js → init-2BNZOO6F.js} +10 -10
- package/dist/cli-bundle/chunks/init-SC2P6CHP.js +20 -0
- package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js → learnings-W6F3FIPL.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js → learnings-YGYVHWJK.js} +10 -10
- package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js → list-K6FPV4J4.js} +10 -10
- package/dist/cli-bundle/chunks/{list-KOJN23UL.js → list-KPAYU5KZ.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js → notes-PU74EPKV.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js → notes-YTD6ZILW.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-X3STKLED.js → plan-FNXHXRCI.js} +15 -15
- package/dist/cli-bundle/chunks/plan-FNXHXRCI.js.map +7 -0
- package/dist/cli-bundle/chunks/{plan-BK3OMLGP.js → plan-GEQYUCBW.js} +16 -16
- package/dist/cli-bundle/chunks/plan-GEQYUCBW.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-XDLFESU7.js → register-list-query-PHWYHENI.js} +43 -22
- package/dist/cli-bundle/chunks/register-list-query-PHWYHENI.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-FUMXPWZ4.js → register-list-query-QI45RMKN.js} +42 -21
- package/dist/cli-bundle/chunks/register-list-query-QI45RMKN.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js → register-mutation-X3BUOQEL.js} +33 -33
- package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js → register-mutation-YINRTS7L.js} +33 -33
- package/dist/cli-bundle/chunks/{register-operations-DGSHCS75.js → register-operations-E5JEASRK.js} +35 -35
- package/dist/cli-bundle/chunks/register-operations-E5JEASRK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js → register-operations-MIDTRW7S.js} +34 -34
- package/dist/cli-bundle/chunks/{register-operations-6UURPZN5.js.map → register-operations-MIDTRW7S.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js → register-setup-DYBFLEZX.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js → register-setup-EG2U6CEU.js} +15 -15
- package/dist/cli-bundle/chunks/restore-5KHR2YYQ.js +19 -0
- package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js → restore-XQYSWBV7.js} +11 -11
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js → scheduling-shortcuts-HJMTEXKE.js} +14 -14
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js → scheduling-shortcuts-NNT5ASZR.js} +14 -14
- package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js → schema-263RI4WW.js} +9 -9
- package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js → schema-TZXW6XWD.js} +9 -9
- package/dist/cli-bundle/chunks/search-LECJYSXE.js +33 -0
- package/dist/cli-bundle/chunks/search-SFRJOVDG.js +37 -0
- package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js → stats-N7ER2PNK.js} +8 -8
- package/dist/cli-bundle/chunks/{stats-J563NJBY.js → stats-VPBGSRQH.js} +8 -8
- package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js → telemetry-L6K3BUIQ.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js → telemetry-PP3FUNBU.js} +4 -4
- package/dist/cli-bundle/chunks/{test-47UQGEXE.js → test-3EGNS3T5.js} +15 -15
- package/dist/cli-bundle/chunks/{test-55RJCGRU.js → test-RQCTSWUK.js} +15 -15
- package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js → test-all-NJ5V2QFS.js} +15 -15
- package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js → test-all-ZHFAWNC3.js} +15 -15
- package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js → test-runs-AJHR6IQF.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js → test-runs-GN3C6GOI.js} +5 -5
- package/dist/cli-bundle/chunks/update-6YXOGHRT.js +24 -0
- package/dist/cli-bundle/chunks/update-6YXOGHRT.js.map +7 -0
- package/dist/cli-bundle/chunks/update-V33YUBRP.js +28 -0
- package/dist/cli-bundle/chunks/update-V33YUBRP.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js → update-many-N2AN6ZDH.js} +23 -23
- package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js → update-many-RYQ64CFW.js} +23 -23
- package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js → upgrade-TJXFLZIX.js} +5 -5
- package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js → upgrade-VPCIYAVW.js} +5 -5
- package/dist/cli-bundle/chunks/{validate-GVY4VE43.js → validate-JMNWEUYF.js} +62 -24
- package/dist/cli-bundle/chunks/validate-JMNWEUYF.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-ADKGN37M.js → validate-PHKIYGSY.js} +61 -23
- package/dist/cli-bundle/chunks/validate-PHKIYGSY.js.map +7 -0
- package/dist/cli-bundle/main.js +133 -55
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/core/checkpoint/checkpoint-gc.d.ts +69 -0
- package/dist/core/checkpoint/checkpoint-gc.js +175 -0
- package/dist/core/checkpoint/checkpoint-gc.js.map +1 -0
- package/dist/core/config/nested-settings.js +22 -2
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +40 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +0 -9
- package/dist/core/extensions/extension-types.js +2 -27
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/fs/fs-utils.d.ts +17 -1
- package/dist/core/fs/fs-utils.js +19 -3
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/history/drift-scan.d.ts +17 -5
- package/dist/core/history/drift-scan.js +22 -14
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/history/replay.d.ts +7 -0
- package/dist/core/history/replay.js +11 -6
- package/dist/core/history/replay.js.map +1 -1
- package/dist/core/item/item-format-version.d.ts +87 -0
- package/dist/core/item/item-format-version.js +85 -0
- package/dist/core/item/item-format-version.js.map +1 -0
- package/dist/core/item/item-format.js +8 -2
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/status-filter.d.ts +7 -3
- package/dist/core/item/status-filter.js +26 -5
- package/dist/core/item/status-filter.js.map +1 -1
- package/dist/core/search/bm25.d.ts +113 -0
- package/dist/core/search/bm25.js +178 -0
- package/dist/core/search/bm25.js.map +1 -0
- package/dist/core/search/eval.d.ts +114 -0
- package/dist/core/search/eval.js +217 -0
- package/dist/core/search/eval.js.map +1 -0
- package/dist/core/sentry/instrument.d.ts +14 -0
- package/dist/core/sentry/instrument.js +43 -3
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.js +6 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/store/paths.js +4 -3
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +7 -0
- package/dist/core/store/settings-validator.js +10 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +6 -2
- package/dist/core/store/settings.js.map +1 -1
- package/dist/mcp/tool-definitions.js +4 -3
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +4 -4
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts.js +11 -2
- 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/runtime.d.ts +1 -0
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/testing.d.ts +48 -1
- package/dist/sdk/testing.js +98 -2
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +26 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +1 -0
- package/docs/ARCHITECTURE.md +126 -11
- package/docs/CLAUDE_CODE_PLUGIN.md +5 -13
- package/docs/COMMANDS.md +57 -5
- package/docs/CONFIGURATION.md +39 -0
- package/docs/EXTENSIONS.md +2 -2
- package/docs/MIGRATION_CLI_SIMPLIFICATION.md +9 -2
- package/docs/QUICKSTART.md +2 -0
- package/docs/README.md +2 -0
- package/docs/RELEASING.md +2 -1
- package/docs/SDK.md +80 -1
- package/docs/TESTING.md +18 -0
- package/package.json +4 -3
- package/packages/pm-command-kit/README.md +4 -0
- package/packages/pm-todos/extensions/todos/index.js +2 -0
- package/packages/pm-todos/extensions/todos/index.ts +2 -0
- package/packages/pm-todos/extensions/todos/runtime.js +192 -9
- package/packages/pm-todos/extensions/todos/runtime.ts +211 -8
- package/dist/cli-bundle/chunks/activity-62I26XZB.js +0 -18
- package/dist/cli-bundle/chunks/chunk-2RI3BDFK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BFNWAMQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5QLHQK7V.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5SRID7DV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-COHNQLB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DVUU3AHP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EMFDZ7N3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FP7YLQ52.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FPQA4ZMA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GDOTTY2S.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-I2VJM36R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K5TD74VU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MAKOMXVM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PSWSQHM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QSH34DSQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UA4ANRJY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UCNEPMPY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-X26ODPU4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y4IBSEQ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YOGXK3ON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YWAYOWDQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZZEM2PH7.js.map +0 -1
- package/dist/cli-bundle/chunks/close-TQZK43Z5.js +0 -15
- package/dist/cli-bundle/chunks/config-UWF3KRP5.js.map +0 -7
- package/dist/cli-bundle/chunks/config-YICACPHA.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-7G553BHP.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-B2YWYUV5.js.map +0 -7
- package/dist/cli-bundle/chunks/create-UZLJXHLA.js +0 -30
- package/dist/cli-bundle/chunks/gc-5RTYXLQU.js +0 -211
- package/dist/cli-bundle/chunks/gc-5RTYXLQU.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-FK5732EK.js +0 -208
- package/dist/cli-bundle/chunks/gc-FK5732EK.js.map +0 -1
- package/dist/cli-bundle/chunks/health-JEBESKID.js.map +0 -7
- package/dist/cli-bundle/chunks/health-PPTJ7XKW.js.map +0 -1
- package/dist/cli-bundle/chunks/history-TKTULEVE.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-SPIFIXVY.js +0 -21
- package/dist/cli-bundle/chunks/init-A6FTZ5UC.js +0 -20
- package/dist/cli-bundle/chunks/plan-BK3OMLGP.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-X3STKLED.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-FUMXPWZ4.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-XDLFESU7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-DGSHCS75.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PI3WM4GK.js +0 -19
- package/dist/cli-bundle/chunks/search-2JX776KX.js.map +0 -1
- package/dist/cli-bundle/chunks/search-AZR2JITW.js.map +0 -7
- package/dist/cli-bundle/chunks/update-2BZEAI7B.js +0 -24
- package/dist/cli-bundle/chunks/update-GCNLER2H.js +0 -28
- package/dist/cli-bundle/chunks/validate-ADKGN37M.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-GVY4VE43.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-62I26XZB.js.map → activity-CIHV64UC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-XJ7WRNWS.js.map → activity-KW3IRP44.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-LBCWF6UJ.js.map → aggregate-3ZKQG5SW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-OFT4YVB6.js.map → aggregate-FIGQEIL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BP2ARHOK.js.map → append-EWJYJ7CH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-5U3XR5SD.js.map → append-QEOLX3XB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CSRFOIHG.js.map → chunk-2EIMPCE4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-II3WDRCM.js.map → chunk-37QXHBIB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UMTPQMEG.js.map → chunk-3MDHREEV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DJ3YYLHG.js.map → chunk-5FIEHKEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OURX4WVG.js.map → chunk-5IDI42VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RVG3WLY3.js.map → chunk-5QICDWMV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LIVRA6VG.js.map → chunk-6CJWZAN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVMSP2HH.js.map → chunk-6H4LF7AO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B2NEFANY.js.map → chunk-6M4RJS4M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A5JPMD4Q.js.map → chunk-76Z3YSHV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5NS6TJ2F.js.map → chunk-7D3SAQXM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2E3KSWFG.js.map → chunk-AIS5PGI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-47BYN6CA.js.map → chunk-AZMOLBN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DYZKSIVX.js.map → chunk-B473GZWW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RNWE2HZR.js.map → chunk-C3AZ5ZML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S673PVHD.js.map → chunk-C4N5I7ZW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TYQBGXH2.js.map → chunk-CF55WVVS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4EOS35RL.js.map → chunk-CZPXY7UW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MPEWACTG.js.map → chunk-CZUB4XWO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22YA6GCA.js.map → chunk-D7FYS6PG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UIMLAFOE.js.map → chunk-F5NZWFSW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H3DP6OUM.js.map → chunk-FKBDKV7Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SO2IOH37.js.map → chunk-FRUFKWNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7R5YKVKO.js.map → chunk-FWPDUYEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-USVOBLGB.js.map → chunk-GOZUHWFD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZBVYKWT2.js.map → chunk-H7NJZWG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4L7Q4OVT.js.map → chunk-HCU6WUSY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PRUB7RI4.js.map → chunk-LUWW7L4B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N7LDJRB4.js.map → chunk-M5XALUSL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NPNNW5TU.js.map → chunk-N5ZJACJ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NNMBNN6Q.js.map → chunk-NB3PYLQ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-USKTNI7P.js.map → chunk-NIGXMNNI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GL3QKIET.js.map → chunk-NIUEXCFS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUG4CL4H.js.map → chunk-NJHMAJ6N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2K56AWDP.js.map → chunk-NJN7LL7U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5P2LQV2F.js.map → chunk-NSBZ2CKF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XV6N3QND.js.map → chunk-O47BPOPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCHNPN24.js.map → chunk-OTHIWLMB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YVYJQR6S.js.map → chunk-PFSRUHDH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M35R7LFX.js.map → chunk-PP2U4NMT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZGEWEO7B.js.map → chunk-PUH4D67U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LEC57E7K.js.map → chunk-Q2J2HJUN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QG6M6XQE.js.map → chunk-QQHISQBJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BQVESTOG.js.map → chunk-QZTWBFXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5LZPDRFW.js.map → chunk-RLK7P77C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QTWWHFI3.js.map → chunk-RVHYI7SL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVZSUIN5.js.map → chunk-SBGXDO7A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VP4Z36GO.js.map → chunk-SRYYRVPB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X7RKOJXL.js.map → chunk-SX75ADBK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MTDEEUGV.js.map → chunk-TKBHZPKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HMQMRHQJ.js.map → chunk-UEMNL33O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDUZTZ55.js.map → chunk-UPE3CDD7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VG3B2CYD.js.map → chunk-UV6IYE5U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MTGMNUMJ.js.map → chunk-YCJX76PW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-2BSYPJTJ.js.map → claim-RC56YUWG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-EZ6JKY5X.js.map → claim-THOJ6CMV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TQZK43Z5.js.map → close-DNMHGOCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3TSX6BYF.js.map → close-SG5MNCVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-HB4UFCS3.js.map → close-many-3L3AQZBU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-B7DBVA46.js.map → close-many-DKQLBGLV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-M7PAINZT.js.map → comments-M7ZOZNBX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-X7M7XM6I.js.map → comments-SKWMDWCW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-EGUGU4K7.js.map → context-OEC366TO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-V32ZAPL6.js.map → context-PUG2A7RC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NWFFRYWM.js.map → copy-6QLHILAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-RMLXLZOL.js.map → copy-JPX7VZCH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-UZLJXHLA.js.map → create-NNP6TSFO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-GK4MX2LJ.js.map → create-Y54ZVVZH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RMGNIL2S.js.map → delete-63PCMQAJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-EFQLVEAS.js.map → delete-GDSMGAGJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WKHUPVD3.js.map → deps-T4ZF5G54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-K2I7QV4Y.js.map → deps-XYQ73XRH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-4LPTFTV4.js.map → extension-46NWACO3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ASUPTDCC.js.map → extension-D5FDZ2CO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-UGROAMAX.js.map → focus-5STQXDPU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-ELOPN2SR.js.map → focus-MDVPOWB5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-OTXPLWYW.js.map → get-J2IPJRZW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-IWZ7IMPS.js.map → get-NT7L2HUZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-HNWBUDMI.js.map → history-RLH2QCRO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-TKTULEVE.js.map → history-WX3MGFS2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-MMQC7MCW.js.map → history-compact-UXDIFC33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-EQXVPK3V.js.map → history-compact-ZBEBGJM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-UBDHBEJE.js.map → history-redact-P7I7AWMB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SPIFIXVY.js.map → history-redact-YQGU3XRA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-GMMHFAGH.js.map → history-repair-52KINVIK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-7DSDRPMX.js.map → history-repair-RM5ITLU5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-QGK4JFF6.js.map → init-2BNZOO6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-A6FTZ5UC.js.map → init-SC2P6CHP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-DR53TWRA.js.map → learnings-W6F3FIPL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-A6DGBMG3.js.map → learnings-YGYVHWJK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-LJ5DBXC3.js.map → list-K6FPV4J4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-KOJN23UL.js.map → list-KPAYU5KZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-7VLTHKPW.js.map → notes-PU74EPKV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-K5I3TAYR.js.map → notes-YTD6ZILW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-RXRX4P7D.js.map → register-mutation-X3BUOQEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-ZAGVKMBQ.js.map → register-mutation-YINRTS7L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-LTJG52WP.js.map → register-setup-DYBFLEZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-2FEGSFLM.js.map → register-setup-EG2U6CEU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PI3WM4GK.js.map → restore-5KHR2YYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-SJUWYOCK.js.map → restore-XQYSWBV7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-VWAMP2S2.js.map → scheduling-shortcuts-HJMTEXKE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-W4F2LKHW.js.map → scheduling-shortcuts-NNT5ASZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-N5ETYD4P.js.map → schema-263RI4WW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-DXQRIEFM.js.map → schema-TZXW6XWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-55RJCGRU.js.map → search-LECJYSXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-47UQGEXE.js.map → search-SFRJOVDG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-ZFESFVQC.js.map → stats-N7ER2PNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-J563NJBY.js.map → stats-VPBGSRQH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-BNGLIFEM.js.map → telemetry-L6K3BUIQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-SC7HPRXX.js.map → telemetry-PP3FUNBU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-GCNLER2H.js.map → test-3EGNS3T5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2BZEAI7B.js.map → test-RQCTSWUK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-DN6KG4FX.js.map → test-all-NJ5V2QFS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-5SFTTRNL.js.map → test-all-ZHFAWNC3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-NHRBT7SN.js.map → test-runs-AJHR6IQF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-DZEDJ4GH.js.map → test-runs-GN3C6GOI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-IRNV3OTG.js.map → update-many-N2AN6ZDH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-OKYWFCBO.js.map → update-many-RYQ64CFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-KP4I45V5.js.map → upgrade-TJXFLZIX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-3RIAFQIK.js.map → upgrade-VPCIYAVW.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
2
|
-
declare const GC_SCOPE_VALUES: readonly ["index", "embeddings", "runtime", "locks"];
|
|
2
|
+
declare const GC_SCOPE_VALUES: readonly ["index", "embeddings", "runtime", "locks", "checkpoints"];
|
|
3
3
|
type GcScope = (typeof GC_SCOPE_VALUES)[number];
|
|
4
4
|
/**
|
|
5
5
|
* Documents the gc command options payload exchanged by command, SDK, and package integrations.
|
|
@@ -16,6 +16,15 @@ export interface GcLocksSummary {
|
|
|
16
16
|
removed: number;
|
|
17
17
|
retained: number;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Documents the gc checkpoints summary payload exchanged by command, SDK, and package integrations.
|
|
21
|
+
*/
|
|
22
|
+
export interface GcCheckpointsSummary {
|
|
23
|
+
scanned: number;
|
|
24
|
+
removed: number;
|
|
25
|
+
retained: number;
|
|
26
|
+
retention_days: number;
|
|
27
|
+
}
|
|
19
28
|
/**
|
|
20
29
|
* Documents the gc result payload exchanged by command, SDK, and package integrations.
|
|
21
30
|
*/
|
|
@@ -29,6 +38,8 @@ export interface GcResult {
|
|
|
29
38
|
guidance: string[];
|
|
30
39
|
/** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */
|
|
31
40
|
locks?: GcLocksSummary;
|
|
41
|
+
/** Present only when the checkpoints scope was selected. Summarizes the rollback-checkpoint sweep. */
|
|
42
|
+
checkpoints?: GcCheckpointsSummary;
|
|
32
43
|
generated_at: string;
|
|
33
44
|
}
|
|
34
45
|
/**
|
package/dist/cli/commands/gc.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* Implements the pm gc command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="15ee0289-1af7-5b11-b023-f19cfc3363fc")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
|
+
import { runCheckpointGc } from "../../core/checkpoint/checkpoint-gc.js";
|
|
10
11
|
import { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../core/extensions/index.js";
|
|
11
12
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
12
13
|
import { runLockGc } from "../../core/lock/lock-gc.js";
|
|
@@ -15,7 +16,7 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
15
16
|
import { nowIso } from "../../core/shared/time.js";
|
|
16
17
|
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
17
18
|
import { readSettings } from "../../core/store/settings.js";
|
|
18
|
-
const GC_SCOPE_VALUES = ["index", "embeddings", "runtime", "locks"];
|
|
19
|
+
const GC_SCOPE_VALUES = ["index", "embeddings", "runtime", "locks", "checkpoints"];
|
|
19
20
|
const GC_TARGETS = [
|
|
20
21
|
{
|
|
21
22
|
scope: "index",
|
|
@@ -37,6 +38,21 @@ const GC_TARGETS = [
|
|
|
37
38
|
relativePath: "search/lancedb",
|
|
38
39
|
kind: "directory",
|
|
39
40
|
},
|
|
41
|
+
{
|
|
42
|
+
// Removing embeddings invalidates the whole semantic index, so the queued
|
|
43
|
+
// background-refresh work is also meaningless: a worker draining a stale
|
|
44
|
+
// queue against an empty ledger would rebuild a partial, inconsistent index
|
|
45
|
+
// (only the queued items vectorized). Clear the queue and its gate so the
|
|
46
|
+
// next mutation re-seeds from a clean slate. See core/search/background-refresh.ts.
|
|
47
|
+
scope: "embeddings",
|
|
48
|
+
relativePath: "search/pending-refresh.json",
|
|
49
|
+
kind: "file",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
scope: "embeddings",
|
|
53
|
+
relativePath: "search/pending-refresh.gate.lock",
|
|
54
|
+
kind: "directory",
|
|
55
|
+
},
|
|
40
56
|
{
|
|
41
57
|
scope: "runtime",
|
|
42
58
|
relativePath: "runtime/test-runs",
|
|
@@ -133,13 +149,18 @@ function buildGcGuidance(params) {
|
|
|
133
149
|
const searchArtifactsAffected = params.removed.some((entry) => entry === "index/manifest.json" ||
|
|
134
150
|
entry === "search/embeddings.jsonl" ||
|
|
135
151
|
entry === "search/vectorization-status.json" ||
|
|
136
|
-
entry === "search/lancedb"
|
|
152
|
+
entry === "search/lancedb" ||
|
|
153
|
+
entry === "search/pending-refresh.json" ||
|
|
154
|
+
entry === "search/pending-refresh.gate.lock");
|
|
137
155
|
if (searchScopeSelected && searchArtifactsAffected) {
|
|
138
|
-
guidance.push('Search artifacts were removed;
|
|
156
|
+
guidance.push('Search artifacts were removed; the semantic index (including any queued background refresh) is invalidated. 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.');
|
|
139
157
|
}
|
|
140
158
|
if (params.removed.includes("runtime/history-drift-cache.json")) {
|
|
141
159
|
guidance.push('History drift cache was removed; the next "pm health" run performs a full history-drift re-scan.');
|
|
142
160
|
}
|
|
161
|
+
if (!params.dryRun && params.removed.some((entry) => entry.startsWith("checkpoints/"))) {
|
|
162
|
+
guidance.push('Aged rollback checkpoints were removed; their "pm update-many"/"pm close-many --rollback" windows are no longer recoverable.');
|
|
163
|
+
}
|
|
143
164
|
return guidance;
|
|
144
165
|
}
|
|
145
166
|
/**
|
|
@@ -150,7 +171,7 @@ export async function runGc(global, options = {}) {
|
|
|
150
171
|
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
151
172
|
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
152
173
|
}
|
|
153
|
-
await readSettings(pmRoot);
|
|
174
|
+
const settings = await readSettings(pmRoot);
|
|
154
175
|
const dryRun = options.dryRun === true;
|
|
155
176
|
const scopes = parseScopes(options.scope);
|
|
156
177
|
const selectedTargets = GC_TARGETS.filter((target) => scopes.includes(target.scope));
|
|
@@ -188,6 +209,31 @@ export async function runGc(global, options = {}) {
|
|
|
188
209
|
retained: lockResult.retained.length,
|
|
189
210
|
};
|
|
190
211
|
}
|
|
212
|
+
// The checkpoints scope is also not a path-based GC_TARGET: it sweeps
|
|
213
|
+
// checkpoints/ and removes only rollback checkpoints older than the configured
|
|
214
|
+
// checkpoints.retention_days, retaining active and unparseable files. See
|
|
215
|
+
// core/checkpoint/checkpoint-gc.ts.
|
|
216
|
+
let checkpointsSummary;
|
|
217
|
+
if (scopes.includes("checkpoints")) {
|
|
218
|
+
const retentionDays = settings.checkpoints.retention_days;
|
|
219
|
+
const checkpointResult = await runCheckpointGc(pmRoot, {
|
|
220
|
+
dryRun,
|
|
221
|
+
retentionDays,
|
|
222
|
+
hooks: {
|
|
223
|
+
onRead: (checkpointPath) => runActiveOnReadHooks({ path: checkpointPath, scope: "project" }),
|
|
224
|
+
onWrite: (checkpointPath) => runActiveOnWriteHooks({ path: checkpointPath, scope: "project", op: "gc:checkpoint_remove" }),
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
removed.push(...checkpointResult.removed);
|
|
228
|
+
retained.push(...checkpointResult.retained);
|
|
229
|
+
warnings.push(...checkpointResult.warnings);
|
|
230
|
+
checkpointsSummary = {
|
|
231
|
+
scanned: checkpointResult.scanned,
|
|
232
|
+
removed: checkpointResult.removed.length,
|
|
233
|
+
retained: checkpointResult.retained.length,
|
|
234
|
+
retention_days: retentionDays,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
191
237
|
warnings.push(...(await runActiveOnIndexHooks({
|
|
192
238
|
mode: dryRun ? "gc:dry-run" : "gc",
|
|
193
239
|
total_items: selectedTargets.length,
|
|
@@ -205,9 +251,10 @@ export async function runGc(global, options = {}) {
|
|
|
205
251
|
retained,
|
|
206
252
|
warnings,
|
|
207
253
|
...(locksSummary ? { locks: locksSummary } : {}),
|
|
254
|
+
...(checkpointsSummary ? { checkpoints: checkpointsSummary } : {}),
|
|
208
255
|
guidance,
|
|
209
256
|
generated_at: nowIso(),
|
|
210
257
|
};
|
|
211
258
|
}
|
|
212
259
|
//# sourceMappingURL=gc.js.map
|
|
213
|
-
//# debugId=
|
|
260
|
+
//# debugId=15ee0289-1af7-5b11-b023-f19cfc3363fc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc.js","sources":["cli/commands/gc.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/gc\n *\n * Implements the pm gc command surface and its agent-facing runtime behavior.\n */\nimport 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 { runLockGc } from \"../../core/lock/lock-gc.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\", \"locks\"] 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 {\n scope: \"runtime\",\n relativePath: \"runtime/history-drift-cache.json\",\n kind: \"file\",\n },\n] as const;\n\n/**\n * Documents the gc command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\n/**\n * Documents the gc locks summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface GcLocksSummary {\n scanned: number;\n removed: number;\n retained: number;\n}\n\n/**\n * Documents the gc result payload exchanged by command, SDK, and package integrations.\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 /** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */\n locks?: GcLocksSummary;\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 if (params.removed.includes(\"runtime/history-drift-cache.json\")) {\n guidance.push('History drift cache was removed; the next \"pm health\" run performs a full history-drift re-scan.');\n }\n return guidance;\n}\n\n/**\n * Implements run gc for the public runtime surface of this module.\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\n // The locks scope is not a path-based GC_TARGET: it sweeps the locks/ directory\n // and removes only locks whose own embedded ttl has expired (crashed-process\n // debris), retaining active and unparseable locks. See core/lock/lock-gc.ts.\n let locksSummary: GcLocksSummary | undefined;\n if (scopes.includes(\"locks\")) {\n const lockResult = await runLockGc(pmRoot, {\n dryRun,\n hooks: {\n onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: \"project\" }),\n onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: \"project\", op: \"gc:lock_remove\" }),\n },\n });\n removed.push(...lockResult.removed);\n retained.push(...lockResult.retained);\n warnings.push(...lockResult.warnings);\n locksSummary = {\n scanned: lockResult.scanned,\n removed: lockResult.removed.length,\n retained: lockResult.retained.length,\n };\n }\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 ...(locksSummary ? { locks: locksSummary } : {}),\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAS7E,MAAM,UAAU,GAAwB;IACtC;QACE,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,qBAAqB;QACnC,IAAI,EAAE,MAAM;KACb;IACD;QACE,KAAK,EAAE,YAAY;QACnB,YAAY,EAAE,yBAAyB;QACvC,IAAI,EAAE,MAAM;KACb;IACD;QACE,KAAK,EAAE,YAAY;QACnB,YAAY,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AAC,MAAM;SACrC,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,GAAG,CAAC,MAAM,qBAAqB,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;QAClC,WAAW,EAAE,eAAe,CAAC,MAAM;KACpC,CAAC,CAAC,CACJ,CAAC;IACF,MAAM,QAAQ,GAAG,eAAe,CAAC;QAC/B,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QACzB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,QAAQ;QACR,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"ba470490-f30a-5975-bcde-78ef3a04f30a"}
|
|
1
|
+
{"version":3,"file":"gc.js","sources":["cli/commands/gc.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/gc\n *\n * Implements the pm gc command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { runCheckpointGc } from \"../../core/checkpoint/checkpoint-gc.js\";\nimport { runActiveOnIndexHooks, runActiveOnReadHooks, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { runLockGc } from \"../../core/lock/lock-gc.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\", \"locks\", \"checkpoints\"] 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 // Removing embeddings invalidates the whole semantic index, so the queued\n // background-refresh work is also meaningless: a worker draining a stale\n // queue against an empty ledger would rebuild a partial, inconsistent index\n // (only the queued items vectorized). Clear the queue and its gate so the\n // next mutation re-seeds from a clean slate. See core/search/background-refresh.ts.\n scope: \"embeddings\",\n relativePath: \"search/pending-refresh.json\",\n kind: \"file\",\n },\n {\n scope: \"embeddings\",\n relativePath: \"search/pending-refresh.gate.lock\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/test-runs\",\n kind: \"directory\",\n },\n {\n scope: \"runtime\",\n relativePath: \"runtime/history-drift-cache.json\",\n kind: \"file\",\n },\n] as const;\n\n/**\n * Documents the gc command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface GcCommandOptions {\n dryRun?: boolean;\n scope?: string[];\n}\n\n/**\n * Documents the gc locks summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface GcLocksSummary {\n scanned: number;\n removed: number;\n retained: number;\n}\n\n/**\n * Documents the gc checkpoints summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface GcCheckpointsSummary {\n scanned: number;\n removed: number;\n retained: number;\n retention_days: number;\n}\n\n/**\n * Documents the gc result payload exchanged by command, SDK, and package integrations.\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 /** Present only when the locks scope was selected. Summarizes the stale-lock sweep. */\n locks?: GcLocksSummary;\n /** Present only when the checkpoints scope was selected. Summarizes the rollback-checkpoint sweep. */\n checkpoints?: GcCheckpointsSummary;\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 entry === \"search/pending-refresh.json\" ||\n entry === \"search/pending-refresh.gate.lock\",\n );\n if (searchScopeSelected && searchArtifactsAffected) {\n guidance.push(\n 'Search artifacts were removed; the semantic index (including any queued background refresh) is invalidated. 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 if (params.removed.includes(\"runtime/history-drift-cache.json\")) {\n guidance.push('History drift cache was removed; the next \"pm health\" run performs a full history-drift re-scan.');\n }\n if (!params.dryRun && params.removed.some((entry) => entry.startsWith(\"checkpoints/\"))) {\n guidance.push(\n 'Aged rollback checkpoints were removed; their \"pm update-many\"/\"pm close-many --rollback\" windows are no longer recoverable.',\n );\n }\n return guidance;\n}\n\n/**\n * Implements run gc for the public runtime surface of this module.\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 const settings = 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\n // The locks scope is not a path-based GC_TARGET: it sweeps the locks/ directory\n // and removes only locks whose own embedded ttl has expired (crashed-process\n // debris), retaining active and unparseable locks. See core/lock/lock-gc.ts.\n let locksSummary: GcLocksSummary | undefined;\n if (scopes.includes(\"locks\")) {\n const lockResult = await runLockGc(pmRoot, {\n dryRun,\n hooks: {\n onRead: (lockPath) => runActiveOnReadHooks({ path: lockPath, scope: \"project\" }),\n onWrite: (lockPath) => runActiveOnWriteHooks({ path: lockPath, scope: \"project\", op: \"gc:lock_remove\" }),\n },\n });\n removed.push(...lockResult.removed);\n retained.push(...lockResult.retained);\n warnings.push(...lockResult.warnings);\n locksSummary = {\n scanned: lockResult.scanned,\n removed: lockResult.removed.length,\n retained: lockResult.retained.length,\n };\n }\n\n // The checkpoints scope is also not a path-based GC_TARGET: it sweeps\n // checkpoints/ and removes only rollback checkpoints older than the configured\n // checkpoints.retention_days, retaining active and unparseable files. See\n // core/checkpoint/checkpoint-gc.ts.\n let checkpointsSummary: GcCheckpointsSummary | undefined;\n if (scopes.includes(\"checkpoints\")) {\n const retentionDays = settings.checkpoints.retention_days;\n const checkpointResult = await runCheckpointGc(pmRoot, {\n dryRun,\n retentionDays,\n hooks: {\n onRead: (checkpointPath) => runActiveOnReadHooks({ path: checkpointPath, scope: \"project\" }),\n onWrite: (checkpointPath) =>\n runActiveOnWriteHooks({ path: checkpointPath, scope: \"project\", op: \"gc:checkpoint_remove\" }),\n },\n });\n removed.push(...checkpointResult.removed);\n retained.push(...checkpointResult.retained);\n warnings.push(...checkpointResult.warnings);\n checkpointsSummary = {\n scanned: checkpointResult.scanned,\n removed: checkpointResult.removed.length,\n retained: checkpointResult.retained.length,\n retention_days: retentionDays,\n };\n }\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 ...(locksSummary ? { locks: locksSummary } : {}),\n ...(checkpointsSummary ? { checkpoints: checkpointsSummary } : {}),\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,CAAU,CAAC;AAS5F,MAAM,UAAU,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,QAAQ;QACR,YAAY,EAAE,MAAM,EAAE;KACvB,CAAC;AACJ,CAAC","debugId":"15ee0289-1af7-5b11-b023-f19cfc3363fc"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm health command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="7b0dc685-2469-5d2e-98c8-07eebf79ee3e")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
@@ -27,6 +27,7 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
27
27
|
import { toNonEmptyStringOrUndefined } from "../../core/shared/primitives.js";
|
|
28
28
|
import { nowIso } from "../../core/shared/time.js";
|
|
29
29
|
import { parseItemDocument } from "../../core/item/item-format.js";
|
|
30
|
+
import { effectiveItemFormatVersion, scanItemFormatVersions } from "../../core/item/item-format-version.js";
|
|
30
31
|
import { listAllFrontMatter, listAllFrontMatterWithBody } from "../../core/store/item-store.js";
|
|
31
32
|
import { PM_TELEMETRY_SOURCE_CONTEXT_VALUES, TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS, TELEMETRY_SCHEMA_VERSION, } from "../../core/telemetry/runtime.js";
|
|
32
33
|
const PM_TELEMETRY_SOURCE_CONTEXT_SET = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
|
|
@@ -154,6 +155,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
154
155
|
const itemUnreadable = [];
|
|
155
156
|
const itemConflictMarkers = [];
|
|
156
157
|
const itemParseFailures = [];
|
|
158
|
+
const formatVersionEntries = [];
|
|
157
159
|
const extensionFieldNames = collectRegisteredItemFieldNames(getActiveExtensionRegistrations());
|
|
158
160
|
for (const itemPath of itemPaths) {
|
|
159
161
|
const relativePath = normalizeRelativePath(pmRoot, itemPath);
|
|
@@ -175,12 +177,14 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
175
177
|
continue;
|
|
176
178
|
}
|
|
177
179
|
try {
|
|
178
|
-
parseItemDocument(raw, { format: getItemFormatFromPath(itemPath), schema, extensionFieldNames });
|
|
180
|
+
const parsed = parseItemDocument(raw, { format: getItemFormatFromPath(itemPath), schema, extensionFieldNames });
|
|
181
|
+
formatVersionEntries.push({ ref: relativePath, version: effectiveItemFormatVersion(parsed.metadata) });
|
|
179
182
|
}
|
|
180
183
|
catch {
|
|
181
184
|
itemParseFailures.push(relativePath);
|
|
182
185
|
}
|
|
183
186
|
}
|
|
187
|
+
const formatVersionScan = scanItemFormatVersions(formatVersionEntries);
|
|
184
188
|
const historyDir = path.join(pmRoot, "history");
|
|
185
189
|
const historyUnreadable = [];
|
|
186
190
|
const historyConflictMarkers = [];
|
|
@@ -240,6 +244,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
240
244
|
...historyUnreadable.map((entry) => `integrity_history_unreadable:${entry}`),
|
|
241
245
|
...historyConflictMarkers.map((entry) => `integrity_history_conflict_marker:${entry.id}:L${entry.line}`),
|
|
242
246
|
...historyInvalidJson.map((entry) => `integrity_history_invalid_json:${entry.id}:L${entry.line}`),
|
|
247
|
+
/* c8 ignore start -- outdated-version items are unreachable until CURRENT_ITEM_FORMAT_VERSION advances past the baseline (an effective version below 1 cannot occur); the per-item mapping is covered in item-format-version.spec, and the ahead path below is covered by health-command.spec */
|
|
248
|
+
...formatVersionScan.outdated.map((entry) => `integrity_item_outdated_format_version:${entry}`),
|
|
249
|
+
/* c8 ignore stop */
|
|
250
|
+
...formatVersionScan.ahead.map((entry) => `integrity_item_ahead_format_version:${entry}`),
|
|
243
251
|
];
|
|
244
252
|
const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
|
|
245
253
|
return {
|
|
@@ -256,10 +264,14 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
|
|
|
256
264
|
history_unreadable: historyUnreadable.length,
|
|
257
265
|
history_conflict_markers: historyConflictMarkers.length,
|
|
258
266
|
history_invalid_json: historyInvalidJson.length,
|
|
267
|
+
item_outdated_format_version: formatVersionScan.outdated.length,
|
|
268
|
+
item_ahead_format_version: formatVersionScan.ahead.length,
|
|
259
269
|
},
|
|
260
270
|
item_unreadable: itemUnreadable,
|
|
261
271
|
item_conflict_markers: itemConflictMarkers,
|
|
262
272
|
item_parse_failures: itemParseFailures,
|
|
273
|
+
item_outdated_format_version: formatVersionScan.outdated,
|
|
274
|
+
item_ahead_format_version: formatVersionScan.ahead,
|
|
263
275
|
history_unreadable: historyUnreadable,
|
|
264
276
|
history_conflict_markers: historyConflictMarkers,
|
|
265
277
|
history_invalid_json: historyInvalidJson,
|
|
@@ -1121,7 +1133,8 @@ async function buildLocksCheck(pmRoot) {
|
|
|
1121
1133
|
};
|
|
1122
1134
|
}
|
|
1123
1135
|
async function buildHistoryDriftCheck(pmRoot, items) {
|
|
1124
|
-
const
|
|
1136
|
+
const cacheHitVerification = "metadata";
|
|
1137
|
+
const { missingStreams, unreadableStreams, hashMismatches, chainMismatches, driftedItems } = await scanHistoryDrift(pmRoot, items, { cacheHitVerification });
|
|
1125
1138
|
const warnings = [
|
|
1126
1139
|
...missingStreams.map((id) => `history_drift_missing_stream:${id}`),
|
|
1127
1140
|
...unreadableStreams.map((id) => `history_drift_unreadable_stream:${id}`),
|
|
@@ -1134,6 +1147,7 @@ async function buildHistoryDriftCheck(pmRoot, items) {
|
|
|
1134
1147
|
status: warnings.length === 0 ? "ok" : "warn",
|
|
1135
1148
|
details: {
|
|
1136
1149
|
checked_items: items.length,
|
|
1150
|
+
cache_hit_verification: cacheHitVerification,
|
|
1137
1151
|
drifted_items: driftedItems,
|
|
1138
1152
|
counts: {
|
|
1139
1153
|
drifted: driftedItems.length,
|
|
@@ -1435,11 +1449,19 @@ export async function runHealth(global, options = {}) {
|
|
|
1435
1449
|
// never have to hardcode the warning-code -> fix mapping. The extensions check
|
|
1436
1450
|
// keeps its richer, contextual `details.triage.remediation`; brief/summary
|
|
1437
1451
|
// projections omit remediation_map (it lives only in full check details).
|
|
1452
|
+
// Every health check contributes its warning tokens as a remediation source.
|
|
1453
|
+
// Most resolve to a registered fix command; the extensions check passes its
|
|
1454
|
+
// full warning list because only the system-wide partial-coverage adoption
|
|
1455
|
+
// gap is registered — per-extension findings resolve to nothing here and keep
|
|
1456
|
+
// their richer `details.triage.remediation`, so buildRemediationMap simply
|
|
1457
|
+
// skips every unregistered code (pm-bdvm). The map is total over
|
|
1458
|
+
// HealthCheck["name"], so no check is ever silently missing a source.
|
|
1438
1459
|
const checkRemediationSources = {
|
|
1439
1460
|
settings: normalizedSettingsReadWarnings,
|
|
1440
1461
|
directories: missingDirs.map((dir) => `missing_directory:${dir}`),
|
|
1441
1462
|
settings_values: settingWarnings,
|
|
1442
1463
|
telemetry: telemetryCheck.warnings,
|
|
1464
|
+
extensions: extensionCheck.warnings,
|
|
1443
1465
|
storage: historySummary.over_threshold.map((id) => `history_stream_over_compact_threshold:${id}`),
|
|
1444
1466
|
locks: locksCheck.warnings,
|
|
1445
1467
|
integrity: integrityCheck.warnings,
|
|
@@ -1450,11 +1472,7 @@ export async function runHealth(global, options = {}) {
|
|
|
1450
1472
|
? (historyDriftCheck.check.details.counts.drifted)
|
|
1451
1473
|
: 0;
|
|
1452
1474
|
for (const check of checks) {
|
|
1453
|
-
const
|
|
1454
|
-
if (sources === undefined) {
|
|
1455
|
-
continue;
|
|
1456
|
-
}
|
|
1457
|
-
const remediationMap = buildRemediationMap(sources);
|
|
1475
|
+
const remediationMap = buildRemediationMap(checkRemediationSources[check.name]);
|
|
1458
1476
|
// With multiple drifted streams the per-item `pm history-repair <id>`
|
|
1459
1477
|
// template would have to be run once per stream; suggest the bulk audited
|
|
1460
1478
|
// pass instead so agents repair everything in one command.
|
|
@@ -1511,4 +1529,4 @@ export const _testOnlyHealthCommand = {
|
|
|
1511
1529
|
warningCode,
|
|
1512
1530
|
};
|
|
1513
1531
|
//# sourceMappingURL=health.js.map
|
|
1514
|
-
//# debugId=
|
|
1532
|
+
//# debugId=7b0dc685-2469-5d2e-98c8-07eebf79ee3e
|