@unbrained/pm-cli 2026.5.31 → 2026.6.6
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 +167 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +12 -4
- package/dist/cli/argv-utils.js +7 -3
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +1 -0
- package/dist/cli/bootstrap-args.js +23 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/calendar.js +17 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +63 -0
- package/dist/cli/commands/close-many.js +302 -0
- package/dist/cli/commands/close-many.js.map +1 -0
- package/dist/cli/commands/completion.d.ts +1 -0
- package/dist/cli/commands/completion.js +260 -32
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/config.js +115 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +193 -162
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +77 -114
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +12 -0
- package/dist/cli/commands/extension/doctor.js +97 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +49 -48
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.js +51 -23
- 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.js +7 -7
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +51 -3
- package/dist/cli/commands/health.js.map +1 -1
- 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 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +107 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.js +58 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +163 -47
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +25 -4
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +122 -1
- package/dist/cli/commands/schema.js +536 -6
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +1 -0
- package/dist/cli/commands/search.js +18 -4
- 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/commands/test.js +4 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +69 -140
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -0
- package/dist/cli/commands/update.js +138 -119
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -0
- package/dist/cli/commands/validate.js +63 -33
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -3
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/help-content.js +91 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +377 -23
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +14 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +200 -28
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +31 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +31 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js +20 -0
- package/dist/cli-bundle/chunks/activity-JM6DTDND.js.map +1 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js +206 -0
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-VNAHUNNF.js} +11 -11
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-7H5N64R2.js} +8 -9
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-7H5N64R2.js.map} +1 -1
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js +69 -0
- package/dist/cli-bundle/chunks/append-WMKRXKCE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-23YFZ3IG.js} +210 -132
- package/dist/cli-bundle/chunks/chunk-23YFZ3IG.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js +128 -0
- package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js +266 -0
- package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js +631 -0
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js +380 -0
- package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js +1664 -0
- package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-3FI4SEFT.js} +175 -54
- package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3LB74A67.js} +119 -6
- package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js +57 -0
- package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js +1832 -0
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js +422 -0
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js +412 -0
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js +5622 -0
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-6ER6DXH5.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-6ER6DXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js +218 -0
- package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js +80 -0
- package/dist/cli-bundle/chunks/chunk-77GFDHGF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-AO442XLN.js} +26 -15
- package/dist/cli-bundle/chunks/chunk-AO442XLN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js +751 -0
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-BQHUILZS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js +242 -0
- package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-ECCMVXGM.js} +164 -53
- package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js +182 -0
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js +130 -0
- package/dist/cli-bundle/chunks/chunk-GCOQW437.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js +1340 -0
- package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-GU2ZJ2VV.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js +231 -0
- package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js +76 -0
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js +346 -0
- package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js +140 -0
- package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-IJGCZSIQ.js} +251 -251
- package/dist/cli-bundle/chunks/chunk-IJGCZSIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-KAG77BY3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-KJ33AOCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-KJE2FOS4.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js +3883 -0
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js +1325 -0
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-LCM63IXU.js} +18 -6
- package/dist/cli-bundle/chunks/chunk-LCM63IXU.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js +182 -0
- package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js +1809 -0
- package/dist/cli-bundle/chunks/chunk-MITFDD35.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-N7ACFE26.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js +332 -0
- package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-OVQCEJPG.js} +22 -3
- package/dist/cli-bundle/chunks/chunk-OVQCEJPG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-OZ7NSQHL.js} +12 -11
- package/dist/cli-bundle/chunks/chunk-OZ7NSQHL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-PDDFYW4X.js} +35 -8
- package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-PIU6RSL3.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-PIU6RSL3.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js +338 -0
- package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-PRJCELV4.js} +108 -21
- package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-PROOHX4K.js} +332 -32
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-Q7SPNHLW.js} +54 -32
- package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-QO7EBBOM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-R6UFP2GE.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js +154 -0
- package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js +119 -0
- package/dist/cli-bundle/chunks/chunk-RZN6VURO.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-T3LC5LKB.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js +173 -0
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js +2988 -0
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-U5SXYXSY.js} +821 -200
- package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js +540 -0
- package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-UM2GBHS4.js} +5 -4
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js +454 -0
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-WKY2IBOQ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js +698 -0
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-XLTD2HN3.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js +131 -0
- package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XTGLRY2Y.js} +484 -49
- package/dist/cli-bundle/chunks/chunk-XTGLRY2Y.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-YL2DJGYS.js} +7 -7
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-4DBF6RVG.js} +10 -11
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-4DBF6RVG.js.map} +1 -1
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js +129 -0
- package/dist/cli-bundle/chunks/claim-X2P4IB7J.js.map +1 -0
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js +17 -0
- package/dist/cli-bundle/chunks/close-PTYFA45H.js.map +1 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js +314 -0
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +7 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js +311 -0
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +1 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js +100 -0
- package/dist/cli-bundle/chunks/comments-OONGABK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-QKBYCWKD.js} +10 -11
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-QKBYCWKD.js.map} +1 -1
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js +1671 -0
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-U4RZ4CQB.js} +121 -10
- package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-FYYJGFWS.js} +32 -19
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-FYYJGFWS.js.map} +2 -2
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js +1461 -0
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +1 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js +1278 -0
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-RFSPGVVJ.js} +198 -162
- package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +7 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js +31 -0
- package/dist/cli-bundle/chunks/create-I5L4EYYZ.js.map +1 -0
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js +55 -0
- package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-VXUPH5RS.js} +7 -8
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-VXUPH5RS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-JSRRWC3Z.js} +7 -8
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-JSRRWC3Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js +225 -0
- package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js.map +1 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js +31 -0
- package/dist/cli-bundle/chunks/docs-GJK6K4VP.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-WW4N3MBM.js} +9 -10
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-WW4N3MBM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-J7IBMFTD.js} +4 -5
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js +28 -0
- package/dist/cli-bundle/chunks/extension-VDY2U33M.js.map +1 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js +282 -0
- package/dist/cli-bundle/chunks/files-ISZJGILQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-WKOD326U.js} +9 -10
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-WKOD326U.js.map} +1 -1
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js +194 -0
- package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-WXU6WI5P.js} +16 -17
- package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-6L6EH4WR.js} +57 -16
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js +1271 -0
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js +24 -0
- package/dist/cli-bundle/chunks/history-PKN67D5O.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js +23 -0
- package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-HIBCBIKK.js} +12 -14
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-HIBCBIKK.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js +193 -0
- package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js.map +1 -0
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js +20 -0
- package/dist/cli-bundle/chunks/init-P56QYWJF.js.map +1 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js +44 -0
- package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js.map +1 -0
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-MIXSESLK.js} +10 -11
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-MIXSESLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js +24 -0
- package/dist/cli-bundle/chunks/list-FGOWQMSM.js.map +1 -0
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-4XVSH2AZ.js} +10 -11
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-4XVSH2AZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js +44 -0
- package/dist/cli-bundle/chunks/notes-5UK3GEH2.js.map +1 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js +1171 -0
- package/dist/cli-bundle/chunks/plan-DUMBV3QB.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-SLMODHWX.js} +13 -14
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-SLMODHWX.js.map} +1 -1
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js +229 -0
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-WST76HSQ.js} +26 -26
- package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +7 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js +813 -0
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-OA675SOU.js} +154 -43
- package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js +383 -0
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-N3PMHXH5.js} +49 -37
- package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js +242 -0
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-ZHJI2DI3.js} +18 -19
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-ZHJI2DI3.js.map} +2 -2
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js +21 -0
- package/dist/cli-bundle/chunks/restore-PBL6T5TW.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js +780 -0
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +7 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js +770 -0
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +1 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js +1127 -0
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-HENBL456.js → search-OA6JX27A.js} +25 -16
- package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +7 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
- package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
- package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
- package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
- package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
- package/dist/cli-bundle/chunks/test-MXX3E5JL.js +31 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js +35 -0
- package/dist/cli-bundle/chunks/test-WBROAJIE.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js +328 -0
- package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-NTOZ7C3M.js} +13 -14
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-NTOZ7C3M.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js +929 -0
- package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-WMVTQU3Y.js} +5 -5
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js.map +1 -0
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js +605 -0
- package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-KGGEYABR.js} +78 -146
- package/dist/cli-bundle/chunks/update-many-KGGEYABR.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-BLI7XBAJ.js} +5 -7
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-BLI7XBAJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js +266 -0
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-AGOAUOVW.js} +61 -48
- package/dist/cli-bundle/chunks/validate-AGOAUOVW.js.map +7 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js +1120 -0
- package/dist/cli-bundle/chunks/validate-L5J6A7YO.js.map +1 -0
- package/dist/cli-bundle/main.js +534 -1505
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
- package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
- package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.d.ts +73 -0
- package/dist/core/diagnostics/remediation.js +328 -0
- package/dist/core/diagnostics/remediation.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.js +9 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +60 -4
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +5 -1
- package/dist/core/extensions/index.js +61 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.d.ts +5 -1
- package/dist/core/extensions/item-fields.js +126 -4
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +283 -8
- package/dist/core/extensions/loader.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/item-format.d.ts +3 -2
- package/dist/core/item/item-format.js +15 -10
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/status-filter.d.ts +29 -0
- package/dist/core/item/status-filter.js +97 -0
- package/dist/core/item/status-filter.js.map +1 -0
- package/dist/core/item/type-registry.js +4 -2
- 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/output/output.js +17 -5
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +15 -0
- package/dist/core/schema/item-types-file.js +27 -2
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +4 -3
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.d.ts +1 -1
- package/dist/core/schema/runtime-field-values.js +10 -4
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +75 -2
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.d.ts +113 -0
- package/dist/core/schema/status-defs-file.js +260 -0
- package/dist/core/schema/status-defs-file.js.map +1 -0
- package/dist/core/schema/type-workflows.d.ts +64 -0
- package/dist/core/schema/type-workflows.js +98 -0
- package/dist/core/schema/type-workflows.js.map +1 -0
- package/dist/core/search/cache.d.ts +3 -1
- package/dist/core/search/cache.js +104 -28
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/http-client.d.ts +2 -2
- package/dist/core/search/http-client.js +2 -2
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -0
- package/dist/core/search/vector-stores.js +64 -14
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/search/vectorization-metadata.d.ts +13 -0
- package/dist/core/search/vectorization-metadata.js +65 -0
- package/dist/core/search/vectorization-metadata.js.map +1 -0
- 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/serialization.d.ts +1 -0
- package/dist/core/shared/serialization.js +86 -2
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +14 -5
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +61 -6
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.js +18 -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 +130 -10
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.js +5 -4
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +16 -4
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +372 -45
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +7 -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 +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +42 -10
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +42 -1
- package/dist/sdk/cli-contracts.js +225 -19
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/errors.d.ts +22 -0
- package/dist/sdk/errors.js +46 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/package-import-adapters.js +14 -3
- package/dist/sdk/package-import-adapters.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 +77 -0
- package/dist/sdk/testing.js +239 -0
- package/dist/sdk/testing.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +22 -3
- package/docs/ARCHITECTURE.md +11 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +118 -7
- package/docs/CONFIGURATION.md +57 -2
- package/docs/EXTENSIONS.md +125 -6
- package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
- package/docs/ONBOARDING.md +165 -0
- package/docs/QUICKSTART.md +3 -1
- package/docs/README.md +12 -4
- package/docs/RELEASING.md +38 -3
- package/docs/SDK.md +273 -1
- package/docs/TESTING.md +36 -1
- package/docs/examples/policy-restricted-extension/manifest.json +1 -0
- package/docs/examples/starter-extension/index.js +9 -1
- package/docs/examples/starter-extension/manifest.json +1 -0
- package/package.json +16 -7
- package/packages/pm-beads/extensions/beads/index.js +2 -4
- package/packages/pm-beads/extensions/beads/index.ts +43 -33
- package/packages/pm-beads/extensions/beads/manifest.json +12 -1
- package/packages/pm-calendar/README.md +6 -0
- package/packages/pm-calendar/extensions/calendar/index.js +6 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
- package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
- package/packages/pm-guide-shell/README.md +4 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
- package/packages/pm-lifecycle-hooks/README.md +29 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
- package/packages/pm-lifecycle-hooks/package.json +52 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
- package/packages/pm-templates/extensions/templates/manifest.json +6 -1
- package/packages/pm-todos/extensions/todos/index.js +3 -7
- package/packages/pm-todos/extensions/todos/index.ts +55 -42
- package/packages/pm-todos/extensions/todos/manifest.json +13 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -4
- package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/scripts/bundle-cli.mjs +121 -17
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js +0 -181
- package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +0 -7
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
- package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
- package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
- package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
- package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +0 -124
- package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +0 -7
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-CVXTCHYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-VNAHUNNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-BQHUILZS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-KAG77BY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-KJ33AOCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-N7ACFE26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-QO7EBBOM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-R6UFP2GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-T3LC5LKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-UM2GBHS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-WKY2IBOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-XLTD2HN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-YL2DJGYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-3HDWDA3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-JTZNCTQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-J7IBMFTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-2BA3T5AE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-HIVSNX3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-MUSQNMTD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-D4RGNX33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-MXX3E5JL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-YRXSUGYQ.js.map} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
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]="918ae1b0-5b96-58f5-b586-3d1dcb074122")}catch(e){}}();
|
|
3
|
+
import { toNonEmptyString } from "../shared/primitives.js";
|
|
4
|
+
export function buildVectorizationEmbeddingIdentity(provider, model) {
|
|
5
|
+
const normalizedProvider = toNonEmptyString(provider);
|
|
6
|
+
const normalizedModel = toNonEmptyString(model);
|
|
7
|
+
if (!normalizedProvider || !normalizedModel) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
provider: normalizedProvider,
|
|
12
|
+
model: normalizedModel,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function normalizeVectorizationEmbeddingMetadata(value) {
|
|
16
|
+
if (value === undefined || value === null) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (typeof value !== "object" || Array.isArray(value)) {
|
|
20
|
+
throw new Error("Vectorization embedding metadata must be an object when set");
|
|
21
|
+
}
|
|
22
|
+
const identity = buildVectorizationEmbeddingIdentity(value.provider, value.model);
|
|
23
|
+
const vectorDimension = value.vector_dimension;
|
|
24
|
+
if (!identity || typeof vectorDimension !== "number" || !Number.isInteger(vectorDimension) || vectorDimension <= 0) {
|
|
25
|
+
throw new Error("Vectorization embedding metadata must include provider, model, and positive vector_dimension");
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
...identity,
|
|
29
|
+
vector_dimension: vectorDimension,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function buildVectorizationEmbeddingMetadata(identity, vectorDimension) {
|
|
33
|
+
if (!Number.isInteger(vectorDimension) || vectorDimension <= 0) {
|
|
34
|
+
throw new Error("Vectorization embedding metadata requires a positive vector dimension");
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
provider: identity.provider,
|
|
38
|
+
model: identity.model,
|
|
39
|
+
vector_dimension: vectorDimension,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function hasVectorizationEmbeddingIdentityChanged(metadata, identity) {
|
|
43
|
+
return !metadata || metadata.provider !== identity.provider || metadata.model !== identity.model;
|
|
44
|
+
}
|
|
45
|
+
export function hasVectorizationVectorDimensionChanged(metadata, vectorDimension) {
|
|
46
|
+
return Boolean(metadata && metadata.vector_dimension !== vectorDimension);
|
|
47
|
+
}
|
|
48
|
+
export function inferConsistentVectorDimension(vectors, context) {
|
|
49
|
+
if (vectors.length === 0) {
|
|
50
|
+
throw new Error(`${context} returned no vectors`);
|
|
51
|
+
}
|
|
52
|
+
const firstVector = vectors[0];
|
|
53
|
+
const dimension = firstVector.length;
|
|
54
|
+
if (!Number.isInteger(dimension) || dimension <= 0) {
|
|
55
|
+
throw new Error(`${context} returned an empty vector`);
|
|
56
|
+
}
|
|
57
|
+
for (let index = 1; index < vectors.length; index += 1) {
|
|
58
|
+
if (vectors[index]?.length !== dimension) {
|
|
59
|
+
throw new Error(`${context} returned mixed vector dimensions`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return dimension;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=vectorization-metadata.js.map
|
|
65
|
+
//# debugId=918ae1b0-5b96-58f5-b586-3d1dcb074122
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectorization-metadata.js","sources":["core/search/vectorization-metadata.ts"],"sourceRoot":"/","sourcesContent":["import { toNonEmptyString } from \"../shared/primitives.js\";\n\nexport interface VectorizationEmbeddingIdentity {\n provider: string;\n model: string;\n}\n\nexport interface VectorizationEmbeddingMetadata extends VectorizationEmbeddingIdentity {\n vector_dimension: number;\n}\n\nexport function buildVectorizationEmbeddingIdentity(\n provider: unknown,\n model: unknown,\n): VectorizationEmbeddingIdentity | null {\n const normalizedProvider = toNonEmptyString(provider);\n const normalizedModel = toNonEmptyString(model);\n if (!normalizedProvider || !normalizedModel) {\n return null;\n }\n return {\n provider: normalizedProvider,\n model: normalizedModel,\n };\n}\n\nexport function normalizeVectorizationEmbeddingMetadata(value: unknown): VectorizationEmbeddingMetadata | null {\n if (value === undefined || value === null) {\n return null;\n }\n if (typeof value !== \"object\" || Array.isArray(value)) {\n throw new Error(\"Vectorization embedding metadata must be an object when set\");\n }\n const identity = buildVectorizationEmbeddingIdentity(\n (value as { provider?: unknown }).provider,\n (value as { model?: unknown }).model,\n );\n const vectorDimension = (value as { vector_dimension?: unknown }).vector_dimension;\n if (!identity || typeof vectorDimension !== \"number\" || !Number.isInteger(vectorDimension) || vectorDimension <= 0) {\n throw new Error(\"Vectorization embedding metadata must include provider, model, and positive vector_dimension\");\n }\n return {\n ...identity,\n vector_dimension: vectorDimension,\n };\n}\n\nexport function buildVectorizationEmbeddingMetadata(\n identity: VectorizationEmbeddingIdentity,\n vectorDimension: number,\n): VectorizationEmbeddingMetadata {\n if (!Number.isInteger(vectorDimension) || vectorDimension <= 0) {\n throw new Error(\"Vectorization embedding metadata requires a positive vector dimension\");\n }\n return {\n provider: identity.provider,\n model: identity.model,\n vector_dimension: vectorDimension,\n };\n}\n\nexport function hasVectorizationEmbeddingIdentityChanged(\n metadata: VectorizationEmbeddingMetadata | null | undefined,\n identity: VectorizationEmbeddingIdentity,\n): boolean {\n return !metadata || metadata.provider !== identity.provider || metadata.model !== identity.model;\n}\n\nexport function hasVectorizationVectorDimensionChanged(\n metadata: VectorizationEmbeddingMetadata | null | undefined,\n vectorDimension: number,\n): boolean {\n return Boolean(metadata && metadata.vector_dimension !== vectorDimension);\n}\n\nexport function inferConsistentVectorDimension(vectors: readonly number[][], context: string): number {\n if (vectors.length === 0) {\n throw new Error(`${context} returned no vectors`);\n }\n const firstVector = vectors[0] as number[];\n const dimension = firstVector.length;\n if (!Number.isInteger(dimension) || dimension <= 0) {\n throw new Error(`${context} returned an empty vector`);\n }\n for (let index = 1; index < vectors.length; index += 1) {\n if (vectors[index]?.length !== dimension) {\n throw new Error(`${context} returned mixed vector dimensions`);\n }\n }\n return dimension;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAW3D,MAAM,UAAU,mCAAmC,CACjD,QAAiB,EACjB,KAAc;IAEd,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACtD,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAChD,IAAI,CAAC,kBAAkB,IAAI,CAAC,eAAe,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,eAAe;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uCAAuC,CAAC,KAAc;IACpE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,QAAQ,GAAG,mCAAmC,CACjD,KAAgC,CAAC,QAAQ,EACzC,KAA6B,CAAC,KAAK,CACrC,CAAC;IACF,MAAM,eAAe,GAAI,KAAwC,CAAC,gBAAgB,CAAC;IACnF,IAAI,CAAC,QAAQ,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,eAAe,IAAI,CAAC,EAAE,CAAC;QACnH,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAC;IAClH,CAAC;IACD,OAAO;QACL,GAAG,QAAQ;QACX,gBAAgB,EAAE,eAAe;KAClC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mCAAmC,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IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,mCAAmC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","debugId":"918ae1b0-5b96-58f5-b586-3d1dcb074122"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SerialQueue {
|
|
2
|
+
/**
|
|
3
|
+
* Schedule `task` to run after every previously-enqueued task has settled.
|
|
4
|
+
* Returns a promise for this task's result (or rejection) so callers can
|
|
5
|
+
* await individual outcomes. A rejected task never wedges the queue: later
|
|
6
|
+
* tasks still run in order.
|
|
7
|
+
*/
|
|
8
|
+
enqueue<T>(task: () => Promise<T> | T): Promise<T>;
|
|
9
|
+
/** Resolves once the queue has fully drained (no pending tasks remain). */
|
|
10
|
+
idle(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createSerialQueue(): SerialQueue;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// pm-3puw: a minimal FIFO async queue. Tasks enqueued onto a single instance run
|
|
2
|
+
// strictly one-at-a-time in arrival order — the next task does not start until
|
|
3
|
+
// the previous one has fully settled. The MCP stdio transport uses this to
|
|
4
|
+
// process JSON-RPC lines in arrival order, so a client that pipelines two
|
|
5
|
+
// mutations on the same item (without awaiting the first response) no longer
|
|
6
|
+
// races into a lock conflict on the second.
|
|
7
|
+
|
|
8
|
+
!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]="fe4d0072-839a-5253-9671-03e55327380e")}catch(e){}}();
|
|
9
|
+
export function createSerialQueue() {
|
|
10
|
+
// `tail` is the error-isolated chain the next task waits on; it is kept
|
|
11
|
+
// separate from the per-task promise returned to callers so one rejection
|
|
12
|
+
// does not break the chain or surface as an unhandled rejection.
|
|
13
|
+
let tail = Promise.resolve();
|
|
14
|
+
let pending = 0;
|
|
15
|
+
const idleWaiters = [];
|
|
16
|
+
const notifyIdle = () => {
|
|
17
|
+
if (pending !== 0) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const waiters = idleWaiters.splice(0);
|
|
21
|
+
for (const resolve of waiters) {
|
|
22
|
+
resolve();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
enqueue(task) {
|
|
27
|
+
pending++;
|
|
28
|
+
const run = tail.then(() => task());
|
|
29
|
+
tail = run
|
|
30
|
+
.then(() => undefined, () => undefined)
|
|
31
|
+
.finally(() => {
|
|
32
|
+
pending--;
|
|
33
|
+
notifyIdle();
|
|
34
|
+
});
|
|
35
|
+
return run;
|
|
36
|
+
},
|
|
37
|
+
idle() {
|
|
38
|
+
return pending === 0 ? Promise.resolve() : new Promise((resolve) => idleWaiters.push(resolve));
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=serial-queue.js.map
|
|
43
|
+
//# debugId=fe4d0072-839a-5253-9671-03e55327380e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serial-queue.js","sources":["core/shared/serial-queue.ts"],"sourceRoot":"/","sourcesContent":["// pm-3puw: a minimal FIFO async queue. Tasks enqueued onto a single instance run\n// strictly one-at-a-time in arrival order — the next task does not start until\n// the previous one has fully settled. The MCP stdio transport uses this to\n// process JSON-RPC lines in arrival order, so a client that pipelines two\n// mutations on the same item (without awaiting the first response) no longer\n// races into a lock conflict on the second.\n\nexport interface SerialQueue {\n /**\n * Schedule `task` to run after every previously-enqueued task has settled.\n * Returns a promise for this task's result (or rejection) so callers can\n * await individual outcomes. A rejected task never wedges the queue: later\n * tasks still run in order.\n */\n enqueue<T>(task: () => Promise<T> | T): Promise<T>;\n /** Resolves once the queue has fully drained (no pending tasks remain). */\n idle(): Promise<void>;\n}\n\nexport function createSerialQueue(): SerialQueue {\n // `tail` is the error-isolated chain the next task waits on; it is kept\n // separate from the per-task promise returned to callers so one rejection\n // does not break the chain or surface as an unhandled rejection.\n let tail: Promise<void> = Promise.resolve();\n let pending = 0;\n const idleWaiters: Array<() => void> = [];\n const notifyIdle = () => {\n if (pending !== 0) {\n return;\n }\n const waiters = idleWaiters.splice(0);\n for (const resolve of waiters) {\n resolve();\n }\n };\n return {\n enqueue<T>(task: () => Promise<T> | T): Promise<T> {\n pending++;\n const run = tail.then(() => task());\n tail = run\n .then(\n () => undefined,\n () => undefined,\n )\n .finally(() => {\n pending--;\n notifyIdle();\n });\n return run;\n },\n idle(): Promise<void> {\n return pending === 0 ? Promise.resolve() : new Promise((resolve) => idleWaiters.push(resolve));\n },\n };\n}\n"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,4CAA4C;;;AAc5C,MAAM,UAAU,iBAAiB;IAC/B,wEAAwE;IACxE,0EAA0E;IAC1E,iEAAiE;IACjE,IAAI,IAAI,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5C,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,MAAM,WAAW,GAAsB,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QACD,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACtC,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IACF,OAAO;QACL,OAAO,CAAI,IAA0B;YACnC,OAAO,EAAE,CAAC;YACV,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;YACpC,IAAI,GAAG,GAAG;iBACP,IAAI,CACH,GAAG,EAAE,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,SAAS,CAChB;iBACA,OAAO,CAAC,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAC;gBACV,UAAU,EAAE,CAAC;YACf,CAAC,CAAC,CAAC;YACL,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI;YACF,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACjG,CAAC;KACF,CAAC;AACJ,CAAC","debugId":"fe4d0072-839a-5253-9671-03e55327380e"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function stableStringify(value: unknown): string;
|
|
2
|
+
export declare function stableValueEquals(left: unknown, right: unknown): boolean;
|
|
2
3
|
export declare function sha256Hex(value: string): string;
|
|
3
4
|
export declare function orderObject<T extends Record<string, unknown>>(value: T, keyOrder: ReadonlyArray<string>): Record<string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="559577ae-1fd4-5045-8165-b89edb52bb21")}catch(e){}}();
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
function sortObjectKeys(value) {
|
|
5
5
|
if (value === null)
|
|
@@ -47,6 +47,90 @@ function sortObjectKeys(value) {
|
|
|
47
47
|
export function stableStringify(value) {
|
|
48
48
|
return JSON.stringify(sortObjectKeys(value));
|
|
49
49
|
}
|
|
50
|
+
export function stableValueEquals(left, right) {
|
|
51
|
+
if (Object.is(left, right)) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (left instanceof RegExp || right instanceof RegExp) {
|
|
58
|
+
return left instanceof RegExp && right instanceof RegExp && left.toString() === right.toString();
|
|
59
|
+
}
|
|
60
|
+
if (left instanceof Date || right instanceof Date) {
|
|
61
|
+
return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
|
|
62
|
+
}
|
|
63
|
+
if (left instanceof Set || right instanceof Set) {
|
|
64
|
+
if (!(left instanceof Set && right instanceof Set) || left.size !== right.size) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const rightValues = [...right];
|
|
68
|
+
const matched = new Set();
|
|
69
|
+
for (const leftValue of left) {
|
|
70
|
+
let found = false;
|
|
71
|
+
for (let index = 0; index < rightValues.length; index += 1) {
|
|
72
|
+
if (matched.has(index)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (stableValueEquals(leftValue, rightValues[index])) {
|
|
76
|
+
matched.add(index);
|
|
77
|
+
found = true;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!found) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
if (left instanceof Map || right instanceof Map) {
|
|
88
|
+
if (!(left instanceof Map && right instanceof Map) || left.size !== right.size) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const rightEntries = [...right.entries()];
|
|
92
|
+
const matched = new Set();
|
|
93
|
+
for (const [leftKey, leftValue] of left.entries()) {
|
|
94
|
+
let found = false;
|
|
95
|
+
for (let index = 0; index < rightEntries.length; index += 1) {
|
|
96
|
+
if (matched.has(index)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const [rightKey, rightValue] = rightEntries[index];
|
|
100
|
+
if (stableValueEquals(leftKey, rightKey) && stableValueEquals(leftValue, rightValue)) {
|
|
101
|
+
matched.add(index);
|
|
102
|
+
found = true;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!found) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
113
|
+
if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return left.every((value, index) => stableValueEquals(value, right[index]));
|
|
117
|
+
}
|
|
118
|
+
const leftKeys = Object.keys(left).sort((a, b) => a.localeCompare(b));
|
|
119
|
+
const rightKeys = Object.keys(right).sort((a, b) => a.localeCompare(b));
|
|
120
|
+
if (leftKeys.length !== rightKeys.length) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
for (let index = 0; index < leftKeys.length; index += 1) {
|
|
124
|
+
const leftKey = leftKeys[index];
|
|
125
|
+
if (leftKey !== rightKeys[index]) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (!stableValueEquals(left[leftKey], right[leftKey])) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
50
134
|
export function sha256Hex(value) {
|
|
51
135
|
return crypto.createHash("sha256").update(value, "utf8").digest("hex");
|
|
52
136
|
}
|
|
@@ -70,4 +154,4 @@ export function orderObject(value, keyOrder) {
|
|
|
70
154
|
return ordered;
|
|
71
155
|
}
|
|
72
156
|
//# sourceMappingURL=serialization.js.map
|
|
73
|
-
//# debugId=
|
|
157
|
+
//# debugId=559577ae-1fd4-5045-8165-b89edb52bb21
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","sources":["core/shared/serialization.ts"],"sourceRoot":"/","sourcesContent":["import crypto from \"node:crypto\";\n\ntype JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\nfunction sortObjectKeys(value: unknown): JsonValue {\n if (value === null) return null;\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"symbol\") {\n return value.toString();\n }\n if (typeof value === \"function\") {\n return `[function:${value.name || \"anonymous\"}]`;\n }\n if (Array.isArray(value)) {\n return value.map((entry) => sortObjectKeys(entry));\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n const maybeJson = value as { toJSON?: () => unknown };\n if (typeof maybeJson.toJSON === \"function\") {\n const normalized = maybeJson.toJSON();\n if (normalized !== value) {\n return sortObjectKeys(normalized);\n }\n }\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n const result: Record<string, JsonValue> = {};\n for (const key of sortedKeys) {\n const nested = obj[key];\n if (nested === undefined) {\n continue;\n }\n result[key] = sortObjectKeys(nested);\n }\n return result;\n}\n\nexport function stableStringify(value: unknown): string {\n return JSON.stringify(sortObjectKeys(value));\n}\n\nexport function sha256Hex(value: string): string {\n return crypto.createHash(\"sha256\").update(value, \"utf8\").digest(\"hex\");\n}\n\nexport function orderObject<T extends Record<string, unknown>>(\n value: T,\n keyOrder: ReadonlyArray<string>,\n): Record<string, unknown> {\n const ordered: Record<string, unknown> = {};\n\n for (const key of keyOrder) {\n const entry = value[key];\n if (entry !== undefined) {\n ordered[key] = entry;\n }\n }\n\n const unknownKeys = Object.keys(value)\n .filter((key) => !keyOrder.includes(key))\n .sort((a, b) => a.localeCompare(b));\n\n for (const key of unknownKeys) {\n const entry = value[key];\n if (entry !== undefined) {\n ordered[key] = entry;\n }\n }\n\n return ordered;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAIjC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,aAAa,KAAK,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IACnD,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,SAAS,GAAG,KAAmC,CAAC;IACtD,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QAC3C,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QACtC,IAAI,UAAU,KAAK,KAAK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,CAAC,IAAI,CAAC,KAAK,CAAC;SACnC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACxC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtC,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","debugId":"9077bf31-377c-5b65-9e68-dd85503b2a0a"}
|
|
1
|
+
{"version":3,"file":"serialization.js","sources":["core/shared/serialization.ts"],"sourceRoot":"/","sourcesContent":["import crypto from \"node:crypto\";\n\ntype JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\nfunction sortObjectKeys(value: unknown): JsonValue {\n if (value === null) return null;\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"symbol\") {\n return value.toString();\n }\n if (typeof value === \"function\") {\n return `[function:${value.name || \"anonymous\"}]`;\n }\n if (Array.isArray(value)) {\n return value.map((entry) => sortObjectKeys(entry));\n }\n if (value instanceof Date) {\n return value.toISOString();\n }\n const maybeJson = value as { toJSON?: () => unknown };\n if (typeof maybeJson.toJSON === \"function\") {\n const normalized = maybeJson.toJSON();\n if (normalized !== value) {\n return sortObjectKeys(normalized);\n }\n }\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n const result: Record<string, JsonValue> = {};\n for (const key of sortedKeys) {\n const nested = obj[key];\n if (nested === undefined) {\n continue;\n }\n result[key] = sortObjectKeys(nested);\n }\n return result;\n}\n\nexport function stableStringify(value: unknown): string {\n return JSON.stringify(sortObjectKeys(value));\n}\n\nexport function stableValueEquals(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) {\n return true;\n }\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\") {\n return false;\n }\n if (left instanceof RegExp || right instanceof RegExp) {\n return left instanceof RegExp && right instanceof RegExp && left.toString() === right.toString();\n }\n if (left instanceof Date || right instanceof Date) {\n return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();\n }\n if (left instanceof Set || right instanceof Set) {\n if (!(left instanceof Set && right instanceof Set) || left.size !== right.size) {\n return false;\n }\n const rightValues = [...right];\n const matched = new Set<number>();\n for (const leftValue of left) {\n let found = false;\n for (let index = 0; index < rightValues.length; index += 1) {\n if (matched.has(index)) {\n continue;\n }\n if (stableValueEquals(leftValue, rightValues[index])) {\n matched.add(index);\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n if (left instanceof Map || right instanceof Map) {\n if (!(left instanceof Map && right instanceof Map) || left.size !== right.size) {\n return false;\n }\n const rightEntries = [...right.entries()];\n const matched = new Set<number>();\n for (const [leftKey, leftValue] of left.entries()) {\n let found = false;\n for (let index = 0; index < rightEntries.length; index += 1) {\n if (matched.has(index)) {\n continue;\n }\n const [rightKey, rightValue] = rightEntries[index]!;\n if (stableValueEquals(leftKey, rightKey) && stableValueEquals(leftValue, rightValue)) {\n matched.add(index);\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {\n return false;\n }\n return left.every((value, index) => stableValueEquals(value, right[index]));\n }\n const leftKeys = Object.keys(left).sort((a, b) => a.localeCompare(b));\n const rightKeys = Object.keys(right).sort((a, b) => a.localeCompare(b));\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n for (let index = 0; index < leftKeys.length; index += 1) {\n const leftKey = leftKeys[index]!;\n if (leftKey !== rightKeys[index]) {\n return false;\n }\n if (!stableValueEquals((left as Record<string, unknown>)[leftKey], (right as Record<string, unknown>)[leftKey])) {\n return false;\n }\n }\n return true;\n}\n\nexport function sha256Hex(value: string): string {\n return crypto.createHash(\"sha256\").update(value, \"utf8\").digest(\"hex\");\n}\n\nexport function orderObject<T extends Record<string, unknown>>(\n value: T,\n keyOrder: ReadonlyArray<string>,\n): Record<string, unknown> {\n const ordered: Record<string, unknown> = {};\n\n for (const key of keyOrder) {\n const entry = value[key];\n if (entry !== undefined) {\n ordered[key] = entry;\n }\n }\n\n const unknownKeys = Object.keys(value)\n .filter((key) => !keyOrder.includes(key))\n .sort((a, b) => a.localeCompare(b));\n\n for (const key of unknownKeys) {\n const entry = value[key];\n if (entry !== undefined) {\n ordered[key] = entry;\n }\n }\n\n return ordered;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAIjC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,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AC,CAAC;QACzB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","debugId":"559577ae-1fd4-5045-8165-b89edb52bb21"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="0b313ee5-78cb-5aa7-a288-d41e3ad6ecf8")}catch(e){}}();
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
|
-
import { hasActiveOnReadHooks, runActiveOnReadHooks } from "../extensions/index.js";
|
|
6
|
+
import { getActiveExtensionRegistrations, hasActiveOnReadHooks, runActiveOnReadHooks } from "../extensions/index.js";
|
|
7
|
+
import { collectRegisteredItemFieldNames } from "../extensions/item-fields.js";
|
|
7
8
|
import { parseItemDocument } from "../item/item-format.js";
|
|
8
9
|
import { writeFileAtomic } from "../fs/fs-utils.js";
|
|
9
10
|
import { ITEM_FILE_EXTENSIONS, getItemFormatFromPath } from "./paths.js";
|
|
@@ -28,6 +29,9 @@ export const HEAVY_METADATA_KEYS = [
|
|
|
28
29
|
"test_runs",
|
|
29
30
|
"docs",
|
|
30
31
|
];
|
|
32
|
+
function resolveActiveExtensionFieldNames() {
|
|
33
|
+
return collectRegisteredItemFieldNames(getActiveExtensionRegistrations());
|
|
34
|
+
}
|
|
31
35
|
/**
|
|
32
36
|
* Split parsed front-matter into the light scalar/small fields (everything except the
|
|
33
37
|
* heavy collection arrays) and the heavy collection fields. Only keys that are actually
|
|
@@ -55,7 +59,7 @@ function mergeHeavyMetadata(light, heavy) {
|
|
|
55
59
|
}
|
|
56
60
|
return { ...light, ...heavy };
|
|
57
61
|
}
|
|
58
|
-
function computeContextFingerprint(preferredFormat, typeToFolder, schema) {
|
|
62
|
+
function computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames) {
|
|
59
63
|
const hash = createHash("sha256");
|
|
60
64
|
hash.update(`format:${preferredFormat ?? "default"}`);
|
|
61
65
|
const sortedTypes = Object.entries(typeToFolder)
|
|
@@ -66,6 +70,9 @@ function computeContextFingerprint(preferredFormat, typeToFolder, schema) {
|
|
|
66
70
|
if (schema) {
|
|
67
71
|
hash.update(`|schema:${JSON.stringify(schema)}`);
|
|
68
72
|
}
|
|
73
|
+
if (extensionFieldNames.length > 0) {
|
|
74
|
+
hash.update(`|extension_fields:${extensionFieldNames.join(",")}`);
|
|
75
|
+
}
|
|
69
76
|
return hash.digest("hex").slice(0, 16);
|
|
70
77
|
}
|
|
71
78
|
function getCachePath(pmRoot) {
|
|
@@ -141,7 +148,8 @@ function statMatches(signature, mtimeMs, ctimeMs, size) {
|
|
|
141
148
|
export async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, options = {}) {
|
|
142
149
|
const includeBody = options.includeBody !== false;
|
|
143
150
|
const includeCollections = options.includeCollections !== false;
|
|
144
|
-
const
|
|
151
|
+
const extensionFieldNames = resolveActiveExtensionFieldNames();
|
|
152
|
+
const contextFingerprint = computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames);
|
|
145
153
|
const existingCache = await loadCache(pmRoot);
|
|
146
154
|
const previousEntries = existingCache && existingCache.context_fingerprint === contextFingerprint ? existingCache.entries : {};
|
|
147
155
|
const existingBodyCache = includeBody ? await loadBodyCache(pmRoot) : null;
|
|
@@ -211,6 +219,7 @@ export async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, t
|
|
|
211
219
|
const parsed = parseItemDocument(raw, {
|
|
212
220
|
format: itemFormat,
|
|
213
221
|
schema,
|
|
222
|
+
extensionFieldNames,
|
|
214
223
|
onWarning: (w) => appendWarning(warnings, w),
|
|
215
224
|
});
|
|
216
225
|
const split = splitHeavyMetadata(parsed.metadata);
|
|
@@ -338,4 +347,4 @@ export async function listAllDocumentsCachedLight(pmRoot, preferredFormat, typeT
|
|
|
338
347
|
}));
|
|
339
348
|
}
|
|
340
349
|
//# sourceMappingURL=front-matter-cache.js.map
|
|
341
|
-
//# debugId=
|
|
350
|
+
//# debugId=0b313ee5-78cb-5aa7-a288-d41e3ad6ecf8
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"front-matter-cache.js","sources":["core/store/front-matter-cache.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { hasActiveOnReadHooks, runActiveOnReadHooks } from \"../extensions/index.js\";\nimport { parseItemDocument } from \"../item/item-format.js\";\nimport { writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { ITEM_FILE_EXTENSIONS, getItemFormatFromPath } from \"./paths.js\";\nimport type { ItemDocument, ItemFormat, ItemMetadata, ItemType, RuntimeSchemaSettings } from \"../../types/index.js\";\n\nconst CACHE_VERSION = 6;\nconst CACHE_FILENAME = \"metadata-cache.json\";\nconst BODY_CACHE_FILENAME = \"metadata-cache-bodies.json\";\nconst COLLECTIONS_CACHE_FILENAME = \"metadata-cache-collections.json\";\n\n/**\n * Heavy \"collection\" front-matter fields. These arrays dominate the on-disk cache\n * (e.g. a single item's comment thread can be hundreds of KB) yet the hot list path\n * (`pm list`, stats, deps, activity, calendar, close) never reads them. They are\n * stored in a separate collections cache that is parsed only when a caller opts in\n * (`includeCollections`), keeping the always-loaded light cache an order of magnitude\n * smaller and its JSON.parse correspondingly cheaper.\n */\nexport const HEAVY_METADATA_KEYS = [\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"test_runs\",\n \"docs\",\n] as const;\n\ninterface StatSignature {\n mtime_ms: number;\n ctime_ms: number;\n size: number;\n}\n\ninterface CachedEntry extends StatSignature {\n metadata: ItemMetadata;\n body_length: number;\n}\n\ninterface CachedBody extends StatSignature {\n body: string;\n}\n\ninterface CachedCollections extends StatSignature {\n collections: Record<string, unknown>;\n}\n\ninterface CacheEnvelope {\n version: number;\n context_fingerprint: string;\n entries: Record<string, CachedEntry>;\n}\n\ninterface BodyCacheEnvelope {\n version: number;\n context_fingerprint: string;\n bodies: Record<string, CachedBody>;\n}\n\ninterface CollectionsCacheEnvelope {\n version: number;\n context_fingerprint: string;\n collections: Record<string, CachedCollections>;\n}\n\n/**\n * Split parsed front-matter into the light scalar/small fields (everything except the\n * heavy collection arrays) and the heavy collection fields. Only keys that are actually\n * present are moved, so an item without comments stays without comments in both tiers.\n */\nfunction splitHeavyMetadata(metadata: ItemMetadata): {\n light: ItemMetadata;\n heavy: Record<string, unknown>;\n} {\n const light = { ...metadata } as Record<string, unknown>;\n const heavy: Record<string, unknown> = {};\n for (const key of HEAVY_METADATA_KEYS) {\n if (key in light) {\n heavy[key] = light[key];\n delete light[key];\n }\n }\n return { light: light as ItemMetadata, heavy };\n}\n\n/**\n * Recombine light metadata with cached heavy collection fields. Key order differs from\n * the on-disk document, but every downstream hash/serialization canonicalizes and\n * sorts keys (`stableStringify`), so the merged record is byte-identical once hashed.\n */\nfunction mergeHeavyMetadata(light: ItemMetadata, heavy: Record<string, unknown> | undefined): ItemMetadata {\n if (!heavy || Object.keys(heavy).length === 0) {\n return light;\n }\n return { ...light, ...heavy } as ItemMetadata;\n}\n\nexport interface CachedDocumentCandidate {\n metadata: ItemMetadata;\n body?: string;\n item_format: ItemFormat;\n item_path: string;\n}\n\nfunction computeContextFingerprint(\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n schema: RuntimeSchemaSettings | undefined,\n): string {\n const hash = createHash(\"sha256\");\n hash.update(`format:${preferredFormat ?? \"default\"}`);\n const sortedTypes = Object.entries(typeToFolder)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([type, folder]) => `${type}=${folder}`)\n .join(\",\");\n hash.update(`|types:${sortedTypes}`);\n if (schema) {\n hash.update(`|schema:${JSON.stringify(schema)}`);\n }\n return hash.digest(\"hex\").slice(0, 16);\n}\n\nfunction getCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", CACHE_FILENAME);\n}\n\nfunction getBodyCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", BODY_CACHE_FILENAME);\n}\n\nfunction getCollectionsCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", COLLECTIONS_CACHE_FILENAME);\n}\n\nasync function loadCache(pmRoot: string): Promise<CacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as CacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.entries !== \"object\" || parsed.entries === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function loadBodyCache(pmRoot: string): Promise<BodyCacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getBodyCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as BodyCacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.bodies !== \"object\" || parsed.bodies === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function loadCollectionsCache(pmRoot: string): Promise<CollectionsCacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getCollectionsCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as CollectionsCacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.collections !== \"object\" || parsed.collections === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function persistCache(\n cachePath: string,\n envelope: CacheEnvelope | BodyCacheEnvelope | CollectionsCacheEnvelope,\n): Promise<void> {\n await fs.mkdir(path.dirname(cachePath), { recursive: true });\n await writeFileAtomic(cachePath, JSON.stringify(envelope));\n}\n\nfunction appendWarning(warnings: string[] | undefined, warning: string): void {\n if (warnings && !warnings.includes(warning)) {\n warnings.push(warning);\n }\n}\n\nfunction statMatches(signature: StatSignature, mtimeMs: number, ctimeMs: number, size: number): boolean {\n return signature.mtime_ms === mtimeMs && signature.ctime_ms === ctimeMs && signature.size === size;\n}\n\nexport interface ListCacheOptions {\n /**\n * When false, item bodies are neither loaded from nor written to the separate\n * body cache. Metadata-only callers (`pm list`, stats, deps, activity, …) skip\n * the large body cache entirely; only body consumers (search/reindex) pay for it.\n */\n includeBody?: boolean;\n /**\n * When false, heavy collection fields (comments/notes/learnings/files/tests/\n * test_runs/docs) are neither loaded from nor written to the separate collections\n * cache, and are absent from the returned metadata. Light-only callers (`pm list`\n * compact, stats, deps, activity, calendar, close) skip the large collections cache\n * entirely. Defaults to true so any caller that does read those fields stays correct.\n */\n includeCollections?: boolean;\n}\n\n/**\n * List all item documents using a persistent on-disk metadata cache.\n *\n * Metadata and bodies are stored in two separate cache files so the hot path\n * (`pm list` and friends, which discard bodies) never loads or rewrites the much\n * larger body payload. Each file is rewritten only when its contents actually\n * change, and per-file onRead hooks are dispatched only when an extension\n * registers one. Only files whose mtime/ctime/size changed since the last run are\n * re-parsed.\n */\nexport async function listAllDocumentCandidatesCached(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n options: ListCacheOptions = {},\n): Promise<CachedDocumentCandidate[]> {\n const includeBody = options.includeBody !== false;\n const includeCollections = options.includeCollections !== false;\n const contextFingerprint = computeContextFingerprint(preferredFormat, typeToFolder, schema);\n\n const existingCache = await loadCache(pmRoot);\n const previousEntries: Record<string, CachedEntry> =\n existingCache && existingCache.context_fingerprint === contextFingerprint ? existingCache.entries : {};\n\n const existingBodyCache = includeBody ? await loadBodyCache(pmRoot) : null;\n const previousBodies: Record<string, CachedBody> =\n existingBodyCache && existingBodyCache.context_fingerprint === contextFingerprint ? existingBodyCache.bodies : {};\n\n const existingCollectionsCache = includeCollections ? await loadCollectionsCache(pmRoot) : null;\n const previousCollections: Record<string, CachedCollections> =\n existingCollectionsCache && existingCollectionsCache.context_fingerprint === contextFingerprint\n ? existingCollectionsCache.collections\n : {};\n\n const entries = Object.entries(typeToFolder) as Array<[ItemType, string]>;\n const dirResults = await Promise.all(\n entries.map(async ([, folder]) => {\n const dirPath = path.join(pmRoot, folder);\n try {\n const files = await fs.readdir(dirPath);\n return { folder, dirPath, files };\n } catch (error: unknown) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code !== \"ENOENT\") {\n appendWarning(warnings, `item_list_directory_read_failed:${folder}`);\n }\n return { folder, dirPath, files: [] as string[] };\n }\n }),\n );\n\n const dispatchReadHooks = hasActiveOnReadHooks();\n const newEntries: Record<string, CachedEntry> = {};\n const newBodies: Record<string, CachedBody> = {};\n const newCollections: Record<string, CachedCollections> = {};\n const documentsById = new Map<string, { candidate: CachedDocumentCandidate; itemFormat: ItemFormat }>();\n let metadataMiss = false;\n let bodyMiss = false;\n let collectionsMiss = false;\n\n const parseTasks: Array<Promise<void>> = [];\n\n for (const { folder, dirPath, files } of dirResults) {\n for (const file of files) {\n if (!ITEM_FILE_EXTENSIONS.some((ext) => file.toLowerCase().endsWith(ext))) {\n continue;\n }\n const filePath = path.join(dirPath, file);\n const relativePath = path.relative(pmRoot, filePath);\n\n parseTasks.push(\n (async () => {\n try {\n const stat = await fs.stat(filePath);\n const mtimeMs = stat.mtimeMs;\n const ctimeMs = stat.ctimeMs;\n const { size } = stat;\n const itemFormat = getItemFormatFromPath(filePath) as ItemFormat;\n\n // Preserve onRead hook semantics even when served from cache, but only\n // when an extension actually observes reads. Surface hook warnings so\n // read-hook failures are not silently hidden.\n if (dispatchReadHooks) {\n for (const warning of await runActiveOnReadHooks({ path: filePath, scope: \"project\" })) {\n appendWarning(warnings, warning);\n }\n }\n\n const cachedEntry = previousEntries[relativePath];\n const metadataCached = cachedEntry !== undefined && statMatches(cachedEntry, mtimeMs, ctimeMs, size);\n const cachedBody = previousBodies[relativePath];\n const bodyCached = cachedBody !== undefined && statMatches(cachedBody, mtimeMs, ctimeMs, size);\n const cachedCollections = previousCollections[relativePath];\n const collectionsCached =\n cachedCollections !== undefined && statMatches(cachedCollections, mtimeMs, ctimeMs, size);\n\n const needRead =\n !metadataCached || (includeBody && !bodyCached) || (includeCollections && !collectionsCached);\n let lightMetadata: ItemMetadata;\n let heavyMetadata: Record<string, unknown> | undefined;\n let bodyLength: number;\n let body: string | undefined;\n\n if (needRead) {\n const raw = await fs.readFile(filePath, \"utf8\");\n const parsed = parseItemDocument(raw, {\n format: itemFormat,\n schema,\n onWarning: (w) => appendWarning(warnings, w),\n });\n const split = splitHeavyMetadata(parsed.metadata);\n lightMetadata = metadataCached ? cachedEntry.metadata : split.light;\n bodyLength = metadataCached ? cachedEntry.body_length : parsed.body.length;\n body = includeBody ? parsed.body : undefined;\n if (includeCollections) {\n heavyMetadata = collectionsCached ? cachedCollections.collections : split.heavy;\n }\n if (!metadataCached) {\n metadataMiss = true;\n }\n if (includeBody && !bodyCached) {\n bodyMiss = true;\n }\n if (includeCollections && !collectionsCached) {\n collectionsMiss = true;\n }\n } else {\n lightMetadata = cachedEntry.metadata;\n bodyLength = cachedEntry.body_length;\n body = includeBody ? cachedBody.body : undefined;\n heavyMetadata = includeCollections && cachedCollections ? cachedCollections.collections : undefined;\n }\n\n newEntries[relativePath] = {\n mtime_ms: mtimeMs,\n ctime_ms: ctimeMs,\n size,\n metadata: lightMetadata,\n body_length: bodyLength,\n };\n if (includeBody && body !== undefined) {\n newBodies[relativePath] = { mtime_ms: mtimeMs, ctime_ms: ctimeMs, size, body };\n }\n if (includeCollections && heavyMetadata !== undefined) {\n newCollections[relativePath] = { mtime_ms: mtimeMs, ctime_ms: ctimeMs, size, collections: heavyMetadata };\n }\n\n const metadata = includeCollections ? mergeHeavyMetadata(lightMetadata, heavyMetadata) : lightMetadata;\n const existing = documentsById.get(metadata.id);\n const candidate: CachedDocumentCandidate = {\n metadata,\n body,\n item_format: itemFormat,\n item_path: filePath,\n };\n if (!existing) {\n documentsById.set(metadata.id, { candidate, itemFormat });\n } else {\n const shouldReplace = preferredFormat\n ? itemFormat === preferredFormat && existing.itemFormat !== preferredFormat\n : itemFormat === \"toon\" && existing.itemFormat !== \"toon\";\n if (shouldReplace) {\n documentsById.set(metadata.id, { candidate, itemFormat });\n }\n }\n } catch {\n appendWarning(warnings, `item_list_item_read_failed:${folder}/${file}`);\n }\n })(),\n );\n }\n }\n\n await Promise.all(parseTasks);\n\n // Rewrite a cache file only when its contents changed: any re-parsed (missing or\n // stale) entry, or a different set of keys (additions/deletions).\n const metadataDirty = metadataMiss || Object.keys(previousEntries).length !== Object.keys(newEntries).length;\n if (metadataDirty || existingCache === null || existingCache.context_fingerprint !== contextFingerprint) {\n await persistCache(getCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n entries: newEntries,\n }).catch(() => {});\n }\n\n if (includeBody) {\n const bodyDirty = bodyMiss || Object.keys(previousBodies).length !== Object.keys(newBodies).length;\n if (bodyDirty || existingBodyCache === null || existingBodyCache.context_fingerprint !== contextFingerprint) {\n await persistCache(getBodyCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n bodies: newBodies,\n }).catch(() => {});\n }\n }\n\n if (includeCollections) {\n const collectionsDirty =\n collectionsMiss || Object.keys(previousCollections).length !== Object.keys(newCollections).length;\n if (\n collectionsDirty ||\n existingCollectionsCache === null ||\n existingCollectionsCache.context_fingerprint !== contextFingerprint\n ) {\n await persistCache(getCollectionsCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n collections: newCollections,\n }).catch(() => {});\n }\n }\n\n return [...documentsById.values()]\n .sort((left, right) => left.candidate.metadata.id.localeCompare(right.candidate.metadata.id))\n .map((entry) => entry.candidate);\n}\n\nexport async function listAllDocumentsCached(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n): Promise<ItemDocument[]> {\n const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {\n includeBody: false,\n });\n return candidates.map((candidate) => ({\n metadata: candidate.metadata,\n body: candidate.body ?? \"\",\n }));\n}\n\n/**\n * Light variant of {@link listAllDocumentsCached}: returns metadata WITHOUT the heavy\n * collection fields (comments/notes/learnings/files/tests/test_runs/docs), skipping the\n * large collections cache entirely. Only safe for callers that read just the light\n * scalar/small fields (id/title/status/type/priority/parent/tags/dates/dependencies/…).\n */\nexport async function listAllDocumentsCachedLight(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n): Promise<ItemDocument[]> {\n const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {\n includeBody: false,\n includeCollections: false,\n });\n return candidates.map((candidate) => ({\n metadata: candidate.metadata,\n body: candidate.body ?? \"\",\n }));\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CA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H,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAc,EACd,eAAuC,EACvC,YAAoC,EACpC,QAA8B,EAC9B,MAAyC;IAEzC,MAAM,UAAU,GAAG,MAAM,+BAA+B,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE;QAChH,WAAW,EAAE,KAAK;QAClB,kBAAkB,EAAE,KAAK;KAC1B,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC","debugId":"a14ed5c7-eb26-57d5-8b28-58d736a3c11c"}
|
|
1
|
+
{"version":3,"file":"front-matter-cache.js","sources":["core/store/front-matter-cache.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { getActiveExtensionRegistrations, hasActiveOnReadHooks, runActiveOnReadHooks } from \"../extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../extensions/item-fields.js\";\nimport { parseItemDocument } from \"../item/item-format.js\";\nimport { writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { ITEM_FILE_EXTENSIONS, getItemFormatFromPath } from \"./paths.js\";\nimport type { ItemDocument, ItemFormat, ItemMetadata, ItemType, RuntimeSchemaSettings } from \"../../types/index.js\";\n\nconst CACHE_VERSION = 6;\nconst CACHE_FILENAME = \"metadata-cache.json\";\nconst BODY_CACHE_FILENAME = \"metadata-cache-bodies.json\";\nconst COLLECTIONS_CACHE_FILENAME = \"metadata-cache-collections.json\";\n\n/**\n * Heavy \"collection\" front-matter fields. These arrays dominate the on-disk cache\n * (e.g. a single item's comment thread can be hundreds of KB) yet the hot list path\n * (`pm list`, stats, deps, activity, calendar, close) never reads them. They are\n * stored in a separate collections cache that is parsed only when a caller opts in\n * (`includeCollections`), keeping the always-loaded light cache an order of magnitude\n * smaller and its JSON.parse correspondingly cheaper.\n */\nexport const HEAVY_METADATA_KEYS = [\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"test_runs\",\n \"docs\",\n] as const;\n\nfunction resolveActiveExtensionFieldNames(): readonly string[] {\n return collectRegisteredItemFieldNames(getActiveExtensionRegistrations());\n}\n\ninterface StatSignature {\n mtime_ms: number;\n ctime_ms: number;\n size: number;\n}\n\ninterface CachedEntry extends StatSignature {\n metadata: ItemMetadata;\n body_length: number;\n}\n\ninterface CachedBody extends StatSignature {\n body: string;\n}\n\ninterface CachedCollections extends StatSignature {\n collections: Record<string, unknown>;\n}\n\ninterface CacheEnvelope {\n version: number;\n context_fingerprint: string;\n entries: Record<string, CachedEntry>;\n}\n\ninterface BodyCacheEnvelope {\n version: number;\n context_fingerprint: string;\n bodies: Record<string, CachedBody>;\n}\n\ninterface CollectionsCacheEnvelope {\n version: number;\n context_fingerprint: string;\n collections: Record<string, CachedCollections>;\n}\n\n/**\n * Split parsed front-matter into the light scalar/small fields (everything except the\n * heavy collection arrays) and the heavy collection fields. Only keys that are actually\n * present are moved, so an item without comments stays without comments in both tiers.\n */\nfunction splitHeavyMetadata(metadata: ItemMetadata): {\n light: ItemMetadata;\n heavy: Record<string, unknown>;\n} {\n const light = { ...metadata } as Record<string, unknown>;\n const heavy: Record<string, unknown> = {};\n for (const key of HEAVY_METADATA_KEYS) {\n if (key in light) {\n heavy[key] = light[key];\n delete light[key];\n }\n }\n return { light: light as ItemMetadata, heavy };\n}\n\n/**\n * Recombine light metadata with cached heavy collection fields. Key order differs from\n * the on-disk document, but every downstream hash/serialization canonicalizes and\n * sorts keys (`stableStringify`), so the merged record is byte-identical once hashed.\n */\nfunction mergeHeavyMetadata(light: ItemMetadata, heavy: Record<string, unknown> | undefined): ItemMetadata {\n if (!heavy || Object.keys(heavy).length === 0) {\n return light;\n }\n return { ...light, ...heavy } as ItemMetadata;\n}\n\nexport interface CachedDocumentCandidate {\n metadata: ItemMetadata;\n body?: string;\n item_format: ItemFormat;\n item_path: string;\n}\n\nfunction computeContextFingerprint(\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n schema: RuntimeSchemaSettings | undefined,\n extensionFieldNames: readonly string[],\n): string {\n const hash = createHash(\"sha256\");\n hash.update(`format:${preferredFormat ?? \"default\"}`);\n const sortedTypes = Object.entries(typeToFolder)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([type, folder]) => `${type}=${folder}`)\n .join(\",\");\n hash.update(`|types:${sortedTypes}`);\n if (schema) {\n hash.update(`|schema:${JSON.stringify(schema)}`);\n }\n if (extensionFieldNames.length > 0) {\n hash.update(`|extension_fields:${extensionFieldNames.join(\",\")}`);\n }\n return hash.digest(\"hex\").slice(0, 16);\n}\n\nfunction getCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", CACHE_FILENAME);\n}\n\nfunction getBodyCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", BODY_CACHE_FILENAME);\n}\n\nfunction getCollectionsCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", COLLECTIONS_CACHE_FILENAME);\n}\n\nasync function loadCache(pmRoot: string): Promise<CacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as CacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.entries !== \"object\" || parsed.entries === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function loadBodyCache(pmRoot: string): Promise<BodyCacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getBodyCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as BodyCacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.bodies !== \"object\" || parsed.bodies === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function loadCollectionsCache(pmRoot: string): Promise<CollectionsCacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getCollectionsCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as CollectionsCacheEnvelope;\n if (parsed.version !== CACHE_VERSION || typeof parsed.collections !== \"object\" || parsed.collections === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nasync function persistCache(\n cachePath: string,\n envelope: CacheEnvelope | BodyCacheEnvelope | CollectionsCacheEnvelope,\n): Promise<void> {\n await fs.mkdir(path.dirname(cachePath), { recursive: true });\n await writeFileAtomic(cachePath, JSON.stringify(envelope));\n}\n\nfunction appendWarning(warnings: string[] | undefined, warning: string): void {\n if (warnings && !warnings.includes(warning)) {\n warnings.push(warning);\n }\n}\n\nfunction statMatches(signature: StatSignature, mtimeMs: number, ctimeMs: number, size: number): boolean {\n return signature.mtime_ms === mtimeMs && signature.ctime_ms === ctimeMs && signature.size === size;\n}\n\nexport interface ListCacheOptions {\n /**\n * When false, item bodies are neither loaded from nor written to the separate\n * body cache. Metadata-only callers (`pm list`, stats, deps, activity, …) skip\n * the large body cache entirely; only body consumers (search/reindex) pay for it.\n */\n includeBody?: boolean;\n /**\n * When false, heavy collection fields (comments/notes/learnings/files/tests/\n * test_runs/docs) are neither loaded from nor written to the separate collections\n * cache, and are absent from the returned metadata. Light-only callers (`pm list`\n * compact, stats, deps, activity, calendar, close) skip the large collections cache\n * entirely. Defaults to true so any caller that does read those fields stays correct.\n */\n includeCollections?: boolean;\n}\n\n/**\n * List all item documents using a persistent on-disk metadata cache.\n *\n * Metadata and bodies are stored in two separate cache files so the hot path\n * (`pm list` and friends, which discard bodies) never loads or rewrites the much\n * larger body payload. Each file is rewritten only when its contents actually\n * change, and per-file onRead hooks are dispatched only when an extension\n * registers one. Only files whose mtime/ctime/size changed since the last run are\n * re-parsed.\n */\nexport async function listAllDocumentCandidatesCached(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n options: ListCacheOptions = {},\n): Promise<CachedDocumentCandidate[]> {\n const includeBody = options.includeBody !== false;\n const includeCollections = options.includeCollections !== false;\n const extensionFieldNames = resolveActiveExtensionFieldNames();\n const contextFingerprint = computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames);\n\n const existingCache = await loadCache(pmRoot);\n const previousEntries: Record<string, CachedEntry> =\n existingCache && existingCache.context_fingerprint === contextFingerprint ? existingCache.entries : {};\n\n const existingBodyCache = includeBody ? await loadBodyCache(pmRoot) : null;\n const previousBodies: Record<string, CachedBody> =\n existingBodyCache && existingBodyCache.context_fingerprint === contextFingerprint ? existingBodyCache.bodies : {};\n\n const existingCollectionsCache = includeCollections ? await loadCollectionsCache(pmRoot) : null;\n const previousCollections: Record<string, CachedCollections> =\n existingCollectionsCache && existingCollectionsCache.context_fingerprint === contextFingerprint\n ? existingCollectionsCache.collections\n : {};\n\n const entries = Object.entries(typeToFolder) as Array<[ItemType, string]>;\n const dirResults = await Promise.all(\n entries.map(async ([, folder]) => {\n const dirPath = path.join(pmRoot, folder);\n try {\n const files = await fs.readdir(dirPath);\n return { folder, dirPath, files };\n } catch (error: unknown) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code !== \"ENOENT\") {\n appendWarning(warnings, `item_list_directory_read_failed:${folder}`);\n }\n return { folder, dirPath, files: [] as string[] };\n }\n }),\n );\n\n const dispatchReadHooks = hasActiveOnReadHooks();\n const newEntries: Record<string, CachedEntry> = {};\n const newBodies: Record<string, CachedBody> = {};\n const newCollections: Record<string, CachedCollections> = {};\n const documentsById = new Map<string, { candidate: CachedDocumentCandidate; itemFormat: ItemFormat }>();\n let metadataMiss = false;\n let bodyMiss = false;\n let collectionsMiss = false;\n\n const parseTasks: Array<Promise<void>> = [];\n\n for (const { folder, dirPath, files } of dirResults) {\n for (const file of files) {\n if (!ITEM_FILE_EXTENSIONS.some((ext) => file.toLowerCase().endsWith(ext))) {\n continue;\n }\n const filePath = path.join(dirPath, file);\n const relativePath = path.relative(pmRoot, filePath);\n\n parseTasks.push(\n (async () => {\n try {\n const stat = await fs.stat(filePath);\n const mtimeMs = stat.mtimeMs;\n const ctimeMs = stat.ctimeMs;\n const { size } = stat;\n const itemFormat = getItemFormatFromPath(filePath) as ItemFormat;\n\n // Preserve onRead hook semantics even when served from cache, but only\n // when an extension actually observes reads. Surface hook warnings so\n // read-hook failures are not silently hidden.\n if (dispatchReadHooks) {\n for (const warning of await runActiveOnReadHooks({ path: filePath, scope: \"project\" })) {\n appendWarning(warnings, warning);\n }\n }\n\n const cachedEntry = previousEntries[relativePath];\n const metadataCached = cachedEntry !== undefined && statMatches(cachedEntry, mtimeMs, ctimeMs, size);\n const cachedBody = previousBodies[relativePath];\n const bodyCached = cachedBody !== undefined && statMatches(cachedBody, mtimeMs, ctimeMs, size);\n const cachedCollections = previousCollections[relativePath];\n const collectionsCached =\n cachedCollections !== undefined && statMatches(cachedCollections, mtimeMs, ctimeMs, size);\n\n const needRead =\n !metadataCached || (includeBody && !bodyCached) || (includeCollections && !collectionsCached);\n let lightMetadata: ItemMetadata;\n let heavyMetadata: Record<string, unknown> | undefined;\n let bodyLength: number;\n let body: string | undefined;\n\n if (needRead) {\n const raw = await fs.readFile(filePath, \"utf8\");\n const parsed = parseItemDocument(raw, {\n format: itemFormat,\n schema,\n extensionFieldNames,\n onWarning: (w) => appendWarning(warnings, w),\n });\n const split = splitHeavyMetadata(parsed.metadata);\n lightMetadata = metadataCached ? cachedEntry.metadata : split.light;\n bodyLength = metadataCached ? cachedEntry.body_length : parsed.body.length;\n body = includeBody ? parsed.body : undefined;\n if (includeCollections) {\n heavyMetadata = collectionsCached ? cachedCollections.collections : split.heavy;\n }\n if (!metadataCached) {\n metadataMiss = true;\n }\n if (includeBody && !bodyCached) {\n bodyMiss = true;\n }\n if (includeCollections && !collectionsCached) {\n collectionsMiss = true;\n }\n } else {\n lightMetadata = cachedEntry.metadata;\n bodyLength = cachedEntry.body_length;\n body = includeBody ? cachedBody.body : undefined;\n heavyMetadata = includeCollections && cachedCollections ? cachedCollections.collections : undefined;\n }\n\n newEntries[relativePath] = {\n mtime_ms: mtimeMs,\n ctime_ms: ctimeMs,\n size,\n metadata: lightMetadata,\n body_length: bodyLength,\n };\n if (includeBody && body !== undefined) {\n newBodies[relativePath] = { mtime_ms: mtimeMs, ctime_ms: ctimeMs, size, body };\n }\n if (includeCollections && heavyMetadata !== undefined) {\n newCollections[relativePath] = { mtime_ms: mtimeMs, ctime_ms: ctimeMs, size, collections: heavyMetadata };\n }\n\n const metadata = includeCollections ? mergeHeavyMetadata(lightMetadata, heavyMetadata) : lightMetadata;\n const existing = documentsById.get(metadata.id);\n const candidate: CachedDocumentCandidate = {\n metadata,\n body,\n item_format: itemFormat,\n item_path: filePath,\n };\n if (!existing) {\n documentsById.set(metadata.id, { candidate, itemFormat });\n } else {\n const shouldReplace = preferredFormat\n ? itemFormat === preferredFormat && existing.itemFormat !== preferredFormat\n : itemFormat === \"toon\" && existing.itemFormat !== \"toon\";\n if (shouldReplace) {\n documentsById.set(metadata.id, { candidate, itemFormat });\n }\n }\n } catch {\n appendWarning(warnings, `item_list_item_read_failed:${folder}/${file}`);\n }\n })(),\n );\n }\n }\n\n await Promise.all(parseTasks);\n\n // Rewrite a cache file only when its contents changed: any re-parsed (missing or\n // stale) entry, or a different set of keys (additions/deletions).\n const metadataDirty = metadataMiss || Object.keys(previousEntries).length !== Object.keys(newEntries).length;\n if (metadataDirty || existingCache === null || existingCache.context_fingerprint !== contextFingerprint) {\n await persistCache(getCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n entries: newEntries,\n }).catch(() => {});\n }\n\n if (includeBody) {\n const bodyDirty = bodyMiss || Object.keys(previousBodies).length !== Object.keys(newBodies).length;\n if (bodyDirty || existingBodyCache === null || existingBodyCache.context_fingerprint !== contextFingerprint) {\n await persistCache(getBodyCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n bodies: newBodies,\n }).catch(() => {});\n }\n }\n\n if (includeCollections) {\n const collectionsDirty =\n collectionsMiss || Object.keys(previousCollections).length !== Object.keys(newCollections).length;\n if (\n collectionsDirty ||\n existingCollectionsCache === null ||\n existingCollectionsCache.context_fingerprint !== contextFingerprint\n ) {\n await persistCache(getCollectionsCachePath(pmRoot), {\n version: CACHE_VERSION,\n context_fingerprint: contextFingerprint,\n collections: newCollections,\n }).catch(() => {});\n }\n }\n\n return [...documentsById.values()]\n .sort((left, right) => left.candidate.metadata.id.localeCompare(right.candidate.metadata.id))\n .map((entry) => entry.candidate);\n}\n\nexport async function listAllDocumentsCached(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n): Promise<ItemDocument[]> {\n const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {\n includeBody: false,\n });\n return candidates.map((candidate) => ({\n metadata: candidate.metadata,\n body: candidate.body ?? \"\",\n }));\n}\n\n/**\n * Light variant of {@link listAllDocumentsCached}: returns metadata WITHOUT the heavy\n * collection fields (comments/notes/learnings/files/tests/test_runs/docs), skipping the\n * large collections cache entirely. Only safe for callers that read just the light\n * scalar/small fields (id/title/status/type/priority/parent/tags/dates/dependencies/…).\n */\nexport async function listAllDocumentsCachedLight(\n pmRoot: string,\n preferredFormat: ItemFormat | undefined,\n typeToFolder: Record<string, string>,\n warnings: string[] | undefined,\n schema: RuntimeSchemaSettings | undefined,\n): Promise<ItemDocument[]> {\n const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {\n includeBody: false,\n includeCollections: false,\n });\n return candidates.map((candidate) => ({\n metadata: candidate.metadata,\n body: candidate.body ?? \"\",\n }));\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrH,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGzE,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAC7C,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AACzD,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,OAAO;IACP,WAAW;IACX,OAAO;IACP,OAAO;IACP,WAAW;IACX,MAAM;CACE,CAAC;AAEX,SAAS,gCAAgC;IACvC,OAAO,+BAA+B,CAAC,+BAA+B,EAAE,CAAC,CAAC;AAC5E,CAAC;AAuCD;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,QAAsB;IAIhD,MAAM,KAAK,GAAG,EAAE,GAAG,QAAQ,EAA6B,CAAC;IACzD,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,KAAK,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;Q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AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAc,EACd,eAAuC,EACvC,YAAoC,EACpC,QAA8B,EAC9B,MAAyC;IAEzC,MAAM,UAAU,GAAG,MAAM,+BAA+B,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE;QAChH,WAAW,EAAE,KAAK;QAClB,kBAAkB,EAAE,KAAK;KAC1B,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACpC,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC","debugId":"0b313ee5-78cb-5aa7-a288-d41e3ad6ecf8"}
|
|
@@ -9,6 +9,7 @@ export interface LocatedItem {
|
|
|
9
9
|
export declare function locateItem(pmRoot: string, rawId: string, idPrefix: string, preferredFormat?: ItemFormat, typeToFolder?: Record<string, string>): Promise<LocatedItem | null>;
|
|
10
10
|
export declare function readLocatedItem(item: LocatedItem, options?: {
|
|
11
11
|
schema?: RuntimeSchemaSettings;
|
|
12
|
+
extensionFieldNames?: readonly string[];
|
|
12
13
|
warnings?: string[];
|
|
13
14
|
}): Promise<{
|
|
14
15
|
raw: string;
|
|
@@ -35,6 +36,7 @@ export declare function mutateItem(params: {
|
|
|
35
36
|
message?: string;
|
|
36
37
|
force?: boolean;
|
|
37
38
|
bypassAssigneeConflict?: boolean;
|
|
39
|
+
extensionFieldNames?: readonly string[];
|
|
38
40
|
typeToFolder?: Record<string, string>;
|
|
39
41
|
mutate: (document: ItemDocument) => {
|
|
40
42
|
changedFields: string[];
|