@unbrained/pm-cli 2026.7.6 → 2026.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-2APXX4TZ.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-2LEJGRQ7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-42LXP4VO.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-43UQN754.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-4BKDAEDF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-4IQKDKGE.js} +15 -23
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-5FIQ4EX3.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-6G6O3OPQ.js} +256 -36
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-ARKHKYYS.js} +13 -21
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-D2DCTFTL.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-DDDWVPID.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-DG6BSXZ7.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-EOUVR7JN.js} +12 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-F6MT7KKE.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-GPIDUMMN.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-GTM5HQL4.js} +11 -15
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-I74FMIWA.js} +10 -16
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-IDIBF4E2.js} +20 -24
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-IDIBF4E2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-II7R6KD4.js} +8 -7
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-LCFJ7XAM.js} +22 -2
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-MCEUKJKW.js} +12 -14
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-MHNMCDWR.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-NWWL22C7.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-Q64AYQYW.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-QDABF2RB.js} +26 -34
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-RB3KLPAH.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-S547WBYG.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-S5BNGFN5.js} +24 -32
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-S6VC2A2K.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-SIM5JDON.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-SY75LYXR.js} +11 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-TNC6MZUD.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-UO7XAZK6.js} +17 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-V5ZWKJNY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-VGO73OCK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-W5HXHC7C.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-XBX5CBRQ.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-XHCVAZGM.js} +13 -17
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-XS2TMNXR.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-XXIYUTLK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-YCVWWIKY.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-YH5NBDFA.js} +22 -26
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-YH5NBDFA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-YPD7SQ5P.js} +7 -6
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-ZNEG2UDO.js} +261 -34
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-44RT5GDW.js} +4 -8
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-YQ2VPXNF.js} +4 -8
- package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-BU5EBJDU.js} +4 -8
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-OQBSJNIA.js} +6 -10
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-HTSB2KJG.js} +6 -10
- package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-FOG4ALC2.js} +7 -9
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-M6IFAMBP.js} +9 -13
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-NHOJG7WO.js} +9 -13
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-T63JGKKN.js} +9 -11
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-TN537L24.js} +10 -15
- package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-MHAMXMHQ.js} +9 -13
- package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-TIGLAKJ7.js} +9 -13
- package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-V6PIYEDU.js} +79 -46
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-V6VKTG54.js} +78 -45
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-6RVAWT6W.js} +129 -29
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-6YVUSQYD.js} +130 -30
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +129 -107
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +122 -117
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +151 -8
- package/dist/sdk/runtime.js +255 -14
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/SDK.md +35 -0
- package/docs/TESTING.md +3 -0
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
- package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-2LEJGRQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-V5ZWKJNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-U7L6HQQ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-OSCNYFGC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-TN537L24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-MHAMXMHQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-TIGLAKJ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-HC3YSWF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-LFAMMRYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DAGSYO6E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-UBXJCQAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-CJGG5WMV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-LKD64AFP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-G4SM7BHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-VLIV3D7R.js.map} +0 -0
|
@@ -1,1749 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
canonicalDocument,
|
|
3
|
-
normalizeItemId,
|
|
4
|
-
normalizeRawItemId,
|
|
5
|
-
parseItemDocument,
|
|
6
|
-
serializeItemDocument
|
|
7
|
-
} from "./chunk-NMP5I3I5.js";
|
|
8
|
-
import {
|
|
9
|
-
nowIso
|
|
10
|
-
} from "./chunk-FLZSGSQR.js";
|
|
11
|
-
import {
|
|
12
|
-
PmCliError,
|
|
13
|
-
getActiveExtensionRegistrations,
|
|
14
|
-
hasActiveOnReadHooks,
|
|
15
|
-
orderObject,
|
|
16
|
-
projectAfterCommandItemSnapshot,
|
|
17
|
-
recordAfterCommandAffectedItem,
|
|
18
|
-
resolveGovernanceKnobs,
|
|
19
|
-
runActiveOnReadHooks,
|
|
20
|
-
runActiveOnWriteHooks,
|
|
21
|
-
runActiveServiceOverride,
|
|
22
|
-
sha256Hex,
|
|
23
|
-
stableStringify
|
|
24
|
-
} from "./chunk-SHQY2IDC.js";
|
|
25
|
-
import {
|
|
26
|
-
evictOldestMemoEntries
|
|
27
|
-
} from "./chunk-7C2O74AE.js";
|
|
28
|
-
import {
|
|
29
|
-
EMPTY_CANONICAL_DOCUMENT,
|
|
30
|
-
EXIT_CODE,
|
|
31
|
-
FRONT_MATTER_KEY_ORDER,
|
|
32
|
-
ITEM_FILE_EXTENSIONS,
|
|
33
|
-
TYPE_TO_FOLDER,
|
|
34
|
-
appendLineAtomic,
|
|
35
|
-
ensureDir,
|
|
36
|
-
getHistoryPath,
|
|
37
|
-
getItemFormatFromPath,
|
|
38
|
-
getItemPath,
|
|
39
|
-
getLockPath,
|
|
40
|
-
levenshteinDistanceWithinLimit,
|
|
41
|
-
normalizeItemFieldType,
|
|
42
|
-
pathExists,
|
|
43
|
-
resolveItemTypeRegistry,
|
|
44
|
-
toErrorMessage,
|
|
45
|
-
writeFileAtomic
|
|
46
|
-
} from "./chunk-LK6XLOGP.js";
|
|
47
|
-
|
|
48
|
-
// dist/core/extensions/item-fields.js
|
|
49
|
-
!(function() {
|
|
50
|
-
try {
|
|
51
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
52
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "455e46e5-2843-5222-8d87-bc9d62238ff4");
|
|
53
|
-
} catch (e2) {
|
|
54
|
-
}
|
|
55
|
-
})();
|
|
56
|
-
var RESERVED_ITEM_FIELD_NAMES = new Set(FRONT_MATTER_KEY_ORDER);
|
|
57
|
-
function normalizeFieldName(value) {
|
|
58
|
-
if (typeof value !== "string") {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
const normalized = value.trim();
|
|
62
|
-
return normalized.length > 0 ? normalized : null;
|
|
63
|
-
}
|
|
64
|
-
function normalizeFieldType(value) {
|
|
65
|
-
if (typeof value !== "string") {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
return normalizeItemFieldType(value);
|
|
69
|
-
}
|
|
70
|
-
function cloneFieldValue(value) {
|
|
71
|
-
try {
|
|
72
|
-
return structuredClone(value);
|
|
73
|
-
} catch {
|
|
74
|
-
return value;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function parseFieldAssignment(raw) {
|
|
78
|
-
const trimmed = raw.trim();
|
|
79
|
-
const separatorIndex = trimmed.indexOf("=");
|
|
80
|
-
if (separatorIndex <= 0) {
|
|
81
|
-
throw new PmCliError(`--field entries must use name=value syntax, received: ${raw}`, EXIT_CODE.USAGE);
|
|
82
|
-
}
|
|
83
|
-
const key = trimmed.slice(0, separatorIndex).trim();
|
|
84
|
-
const value = trimmed.slice(separatorIndex + 1);
|
|
85
|
-
return { key, value };
|
|
86
|
-
}
|
|
87
|
-
function parseJsonFieldValue(raw, fieldName, expectedType) {
|
|
88
|
-
try {
|
|
89
|
-
const parsed = JSON.parse(raw);
|
|
90
|
-
if (expectedType === "array" && Array.isArray(parsed)) {
|
|
91
|
-
return parsed;
|
|
92
|
-
}
|
|
93
|
-
if (expectedType === "object" && typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
94
|
-
return parsed;
|
|
95
|
-
}
|
|
96
|
-
} catch {
|
|
97
|
-
}
|
|
98
|
-
throw new PmCliError(`--field ${fieldName}=... must be valid JSON ${expectedType}`, EXIT_CODE.USAGE);
|
|
99
|
-
}
|
|
100
|
-
function coerceRegisteredFieldValue(fieldName, fieldType, raw) {
|
|
101
|
-
if (fieldType === "string") {
|
|
102
|
-
return raw;
|
|
103
|
-
}
|
|
104
|
-
if (fieldType === "number") {
|
|
105
|
-
const trimmed = raw.trim();
|
|
106
|
-
if (trimmed.length === 0) {
|
|
107
|
-
throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);
|
|
108
|
-
}
|
|
109
|
-
const parsed = Number(trimmed);
|
|
110
|
-
if (!Number.isFinite(parsed)) {
|
|
111
|
-
throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);
|
|
112
|
-
}
|
|
113
|
-
return parsed;
|
|
114
|
-
}
|
|
115
|
-
if (fieldType === "boolean") {
|
|
116
|
-
const normalized = raw.trim().toLowerCase();
|
|
117
|
-
if (normalized === "true" || normalized === "1" || normalized === "yes") {
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
if (normalized === "false" || normalized === "0" || normalized === "no") {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
throw new PmCliError(`--field ${fieldName}=... must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);
|
|
124
|
-
}
|
|
125
|
-
return parseJsonFieldValue(raw, fieldName, fieldType);
|
|
126
|
-
}
|
|
127
|
-
function collectRegisteredFieldDefinitions(registrations) {
|
|
128
|
-
const definitions = /* @__PURE__ */ new Map();
|
|
129
|
-
if (!registrations) {
|
|
130
|
-
return definitions;
|
|
131
|
-
}
|
|
132
|
-
for (const registration of registrations.item_fields) {
|
|
133
|
-
for (const definition of registration.fields) {
|
|
134
|
-
const fieldName = normalizeFieldName(definition.name);
|
|
135
|
-
const fieldType = normalizeFieldType(definition.type);
|
|
136
|
-
if (!fieldName || !fieldType) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
const existing = definitions.get(fieldName);
|
|
140
|
-
if (existing && existing.type !== fieldType) {
|
|
141
|
-
throw new PmCliError(`Extension item field "${fieldName}" is declared with conflicting types: ${existing.type}, ${fieldType}`, EXIT_CODE.USAGE, {
|
|
142
|
-
code: "extension_item_field_type_conflict",
|
|
143
|
-
nextSteps: ["Make every active extension declaration for this field use the same type."]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
definitions.set(fieldName, { name: fieldName, type: fieldType });
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return definitions;
|
|
150
|
-
}
|
|
151
|
-
function assertNotReservedItemFieldName(fieldName) {
|
|
152
|
-
if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
throw new PmCliError(`Extension item field "${fieldName}" collides with reserved item metadata`, EXIT_CODE.USAGE, {
|
|
156
|
-
code: "extension_item_field_reserved",
|
|
157
|
-
nextSteps: ["Rename the extension item field, preferably with an extension-specific prefix."]
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function collectRegisteredItemFieldNames(registrations) {
|
|
161
|
-
return [...collectRegisteredFieldDefinitions(registrations).keys()].sort((left, right) => left.localeCompare(right));
|
|
162
|
-
}
|
|
163
|
-
function parseRegisteredItemFieldAssignments(rawFields, registrations) {
|
|
164
|
-
if (!rawFields || rawFields.length === 0) {
|
|
165
|
-
return {};
|
|
166
|
-
}
|
|
167
|
-
const definitions = collectRegisteredFieldDefinitions(registrations);
|
|
168
|
-
const values = {};
|
|
169
|
-
for (const raw of rawFields) {
|
|
170
|
-
const { key, value } = parseFieldAssignment(raw);
|
|
171
|
-
const definition = definitions.get(key);
|
|
172
|
-
if (!definition) {
|
|
173
|
-
const known = [...definitions.keys()].sort((left, right) => left.localeCompare(right));
|
|
174
|
-
throw new PmCliError(`--field ${key} is not declared by an active extension item-field registration`, EXIT_CODE.USAGE, {
|
|
175
|
-
code: "extension_item_field_unknown",
|
|
176
|
-
recovery: { provided_fields: known },
|
|
177
|
-
nextSteps: known.length > 0 ? [`Use one of the declared fields: ${known.join(", ")}`] : ["Activate an extension that calls registerItemFields before setting extension fields."]
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
assertNotReservedItemFieldName(definition.name);
|
|
181
|
-
values[definition.name] = coerceRegisteredFieldValue(definition.name, definition.type, value);
|
|
182
|
-
}
|
|
183
|
-
return values;
|
|
184
|
-
}
|
|
185
|
-
function isValidFieldType(value, expectedType) {
|
|
186
|
-
if (expectedType === "string") {
|
|
187
|
-
return typeof value === "string";
|
|
188
|
-
}
|
|
189
|
-
if (expectedType === "number") {
|
|
190
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
191
|
-
}
|
|
192
|
-
if (expectedType === "boolean") {
|
|
193
|
-
return typeof value === "boolean";
|
|
194
|
-
}
|
|
195
|
-
if (expectedType === "array") {
|
|
196
|
-
return Array.isArray(value);
|
|
197
|
-
}
|
|
198
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
199
|
-
}
|
|
200
|
-
function isAllowedFieldValue(value, allowed) {
|
|
201
|
-
if (!allowed || allowed.length === 0) {
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
return allowed.some((candidate) => Object.is(candidate, value));
|
|
205
|
-
}
|
|
206
|
-
function applyRegisteredItemFieldDefaultsAndValidation(frontMatter, registrations, options = {}) {
|
|
207
|
-
if (!registrations) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
collectRegisteredFieldDefinitions(registrations);
|
|
211
|
-
for (const registration of registrations.item_fields) {
|
|
212
|
-
for (const definition of registration.fields) {
|
|
213
|
-
const fieldName = normalizeFieldName(definition.name);
|
|
214
|
-
if (!fieldName) {
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
assertNotReservedItemFieldName(fieldName);
|
|
218
|
-
if (!(fieldName in frontMatter) && !options.skipDefaultFields?.has(fieldName) && Object.prototype.hasOwnProperty.call(definition, "default")) {
|
|
219
|
-
frontMatter[fieldName] = cloneFieldValue(definition.default);
|
|
220
|
-
}
|
|
221
|
-
const currentValue = frontMatter[fieldName];
|
|
222
|
-
if (currentValue === void 0) {
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
225
|
-
const expectedType = normalizeFieldType(definition.type);
|
|
226
|
-
if (expectedType && !isValidFieldType(currentValue, expectedType)) {
|
|
227
|
-
throw new TypeError(`Item field "${fieldName}" must be of type ${expectedType}`);
|
|
228
|
-
}
|
|
229
|
-
const allowedValues = Array.isArray(definition.values) ? definition.values : void 0;
|
|
230
|
-
if (!isAllowedFieldValue(currentValue, allowedValues)) {
|
|
231
|
-
throw new TypeError(`Item field "${fieldName}" must match one of the configured allowed values`);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// dist/core/item/item-record.js
|
|
238
|
-
!(function() {
|
|
239
|
-
try {
|
|
240
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
241
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "15ec7791-0156-5f73-84a4-0b0b80eaa2f3");
|
|
242
|
-
} catch (e2) {
|
|
243
|
-
}
|
|
244
|
-
})();
|
|
245
|
-
function toItemRecord(item) {
|
|
246
|
-
return item;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// dist/core/history/history.js
|
|
250
|
-
import jsonPatch from "fast-json-patch";
|
|
251
|
-
!(function() {
|
|
252
|
-
try {
|
|
253
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
254
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f19df987-de61-5a9d-8d7e-93b7d5ca162c");
|
|
255
|
-
} catch (e2) {
|
|
256
|
-
}
|
|
257
|
-
})();
|
|
258
|
-
var EMPTY_LEGACY_HASH_DOCUMENT = {
|
|
259
|
-
front_matter: {},
|
|
260
|
-
body: ""
|
|
261
|
-
};
|
|
262
|
-
function decodeJsonPointer(path5) {
|
|
263
|
-
if (!path5 || path5 === "/") {
|
|
264
|
-
return [];
|
|
265
|
-
}
|
|
266
|
-
if (!path5.startsWith("/")) {
|
|
267
|
-
return [];
|
|
268
|
-
}
|
|
269
|
-
return path5.slice(1).split("/").map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~"));
|
|
270
|
-
}
|
|
271
|
-
function isDefinedPointerPath(document, path5) {
|
|
272
|
-
const segments = decodeJsonPointer(path5);
|
|
273
|
-
if (segments.length === 0) {
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
let cursor = document;
|
|
277
|
-
for (const segment of segments) {
|
|
278
|
-
if (Array.isArray(cursor)) {
|
|
279
|
-
if (segment === "-" || !/^(0|[1-9]\d*)$/.test(segment)) {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
const index = Number(segment);
|
|
283
|
-
if (!Number.isInteger(index) || index < 0 || index >= cursor.length) {
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
286
|
-
const next2 = cursor[index];
|
|
287
|
-
if (next2 === void 0) {
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
cursor = next2;
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
if (typeof cursor !== "object" || cursor === null) {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
if (!Object.prototype.hasOwnProperty.call(cursor, segment)) {
|
|
297
|
-
return false;
|
|
298
|
-
}
|
|
299
|
-
const next = cursor[segment];
|
|
300
|
-
if (next === void 0) {
|
|
301
|
-
return false;
|
|
302
|
-
}
|
|
303
|
-
cursor = next;
|
|
304
|
-
}
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
function normalizeHistoryPatchOps(beforeDocument, patch) {
|
|
308
|
-
const normalized = [];
|
|
309
|
-
let replayCursor = structuredClone(beforeDocument);
|
|
310
|
-
for (const operation of patch) {
|
|
311
|
-
const normalizedOperation = operation.op === "replace" && !isDefinedPointerPath(replayCursor, operation.path) ? { ...operation, op: "add" } : operation;
|
|
312
|
-
normalized.push(normalizedOperation);
|
|
313
|
-
replayCursor = jsonPatch.applyPatch(replayCursor, [normalizedOperation], true, true).newDocument;
|
|
314
|
-
}
|
|
315
|
-
return normalized;
|
|
316
|
-
}
|
|
317
|
-
function canonicalHashDocument(document) {
|
|
318
|
-
const hasMetadata = document.metadata && Object.keys(document.metadata).length > 0;
|
|
319
|
-
if (!hasMetadata) {
|
|
320
|
-
return {
|
|
321
|
-
front_matter: {},
|
|
322
|
-
body: document.body ?? ""
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
const canonical = canonicalDocument(document);
|
|
326
|
-
const orderedFrontMatter = orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER);
|
|
327
|
-
return {
|
|
328
|
-
front_matter: orderedFrontMatter,
|
|
329
|
-
body: canonical.body
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
function canonicalPatchDocument(document) {
|
|
333
|
-
const hasMetadata = document.metadata && Object.keys(document.metadata).length > 0;
|
|
334
|
-
if (!hasMetadata) {
|
|
335
|
-
return {
|
|
336
|
-
metadata: {},
|
|
337
|
-
body: document.body ?? ""
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
const canonical = canonicalDocument(document);
|
|
341
|
-
const orderedMetadata = orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER);
|
|
342
|
-
return {
|
|
343
|
-
metadata: orderedMetadata,
|
|
344
|
-
body: canonical.body
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
function hashDocument(document) {
|
|
348
|
-
return sha256Hex(stableStringify(canonicalHashDocument(document)));
|
|
349
|
-
}
|
|
350
|
-
function hashEmptyDocument() {
|
|
351
|
-
return sha256Hex(stableStringify(EMPTY_LEGACY_HASH_DOCUMENT));
|
|
352
|
-
}
|
|
353
|
-
function createHistoryEntry(params) {
|
|
354
|
-
const beforeHashCanonical = canonicalHashDocument(params.before);
|
|
355
|
-
const afterHashCanonical = canonicalHashDocument(params.after);
|
|
356
|
-
const beforePatchCanonical = canonicalPatchDocument(params.before);
|
|
357
|
-
const afterPatchCanonical = canonicalPatchDocument(params.after);
|
|
358
|
-
const rawPatch = jsonPatch.compare(beforePatchCanonical, afterPatchCanonical);
|
|
359
|
-
const patch = normalizeHistoryPatchOps(beforePatchCanonical, rawPatch);
|
|
360
|
-
return {
|
|
361
|
-
ts: params.nowIso,
|
|
362
|
-
author: params.author,
|
|
363
|
-
op: params.op,
|
|
364
|
-
patch,
|
|
365
|
-
before_hash: sha256Hex(stableStringify(beforeHashCanonical)),
|
|
366
|
-
after_hash: sha256Hex(stableStringify(afterHashCanonical)),
|
|
367
|
-
message: params.message === void 0 ? void 0 : params.message
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
function isRecord(value) {
|
|
371
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
372
|
-
}
|
|
373
|
-
function fallbackHistoryTimestamp(entry) {
|
|
374
|
-
const ts = entry.ts.trim();
|
|
375
|
-
return ts.length > 0 ? ts : nowIso();
|
|
376
|
-
}
|
|
377
|
-
function withHistoryTimestamp(value, fallbackTs) {
|
|
378
|
-
const ts = value.ts;
|
|
379
|
-
if (typeof ts === "string" && ts.trim().length > 0) {
|
|
380
|
-
return value;
|
|
381
|
-
}
|
|
382
|
-
return { ...value, ts: fallbackTs };
|
|
383
|
-
}
|
|
384
|
-
function serializeHistoryLine(value, fallbackEntry) {
|
|
385
|
-
const fallbackTs = fallbackHistoryTimestamp(fallbackEntry);
|
|
386
|
-
if (typeof value === "string") {
|
|
387
|
-
try {
|
|
388
|
-
const parsed = JSON.parse(value);
|
|
389
|
-
if (isRecord(parsed)) {
|
|
390
|
-
return JSON.stringify(withHistoryTimestamp(parsed, fallbackTs));
|
|
391
|
-
}
|
|
392
|
-
} catch {
|
|
393
|
-
}
|
|
394
|
-
return value;
|
|
395
|
-
}
|
|
396
|
-
if (isRecord(value)) {
|
|
397
|
-
return JSON.stringify(withHistoryTimestamp(value, fallbackTs));
|
|
398
|
-
}
|
|
399
|
-
return JSON.stringify(value);
|
|
400
|
-
}
|
|
401
|
-
async function appendHistoryEntry(historyPath, entry) {
|
|
402
|
-
const override = await runActiveServiceOverride("history_append", {
|
|
403
|
-
history_path: historyPath,
|
|
404
|
-
entry
|
|
405
|
-
});
|
|
406
|
-
if (override.handled) {
|
|
407
|
-
if (override.result === false) {
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
if (typeof override.result === "string") {
|
|
411
|
-
await appendLineAtomic(historyPath, serializeHistoryLine(override.result, entry));
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
if (typeof override.result === "object" && override.result !== null) {
|
|
415
|
-
const record = override.result;
|
|
416
|
-
if (record.skip === true) {
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
const nextHistoryPath = typeof record.history_path === "string" ? record.history_path : historyPath;
|
|
420
|
-
if (typeof record.line === "string") {
|
|
421
|
-
await appendLineAtomic(nextHistoryPath, serializeHistoryLine(record.line, entry));
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
await appendLineAtomic(nextHistoryPath, serializeHistoryLine(record.entry ?? entry, entry));
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
await appendLineAtomic(historyPath, serializeHistoryLine(entry, entry));
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// dist/core/history/history-stream-policy.js
|
|
432
|
-
import fs from "node:fs/promises";
|
|
433
|
-
import path from "node:path";
|
|
434
|
-
!(function() {
|
|
435
|
-
try {
|
|
436
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
437
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "02991bdb-fced-50c6-bd43-2e3693f0f438");
|
|
438
|
-
} catch (e2) {
|
|
439
|
-
}
|
|
440
|
-
})();
|
|
441
|
-
function toSortedUniqueItemIds(itemIds) {
|
|
442
|
-
return [...new Set(itemIds.filter((value) => value.trim().length > 0))].sort((left, right) => left.localeCompare(right));
|
|
443
|
-
}
|
|
444
|
-
function strictMissingStreamError(itemId, commandLabel) {
|
|
445
|
-
return new PmCliError(`Missing history stream for ${itemId}. ${commandLabel} requires history streams when settings.history.missing_stream is strict_error.`, EXIT_CODE.NOT_FOUND);
|
|
446
|
-
}
|
|
447
|
-
async function createStream(historyPath, commandLabel) {
|
|
448
|
-
await ensureDir(path.dirname(historyPath));
|
|
449
|
-
const handle = await fs.open(historyPath, "a");
|
|
450
|
-
await handle.close();
|
|
451
|
-
return runActiveOnWriteHooks({
|
|
452
|
-
path: historyPath,
|
|
453
|
-
scope: "project",
|
|
454
|
-
op: `${commandLabel}:history:auto_create`
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
async function enforceHistoryStreamPolicyForItem(params) {
|
|
458
|
-
return enforceHistoryStreamPolicyForItems({
|
|
459
|
-
pmRoot: params.pmRoot,
|
|
460
|
-
settings: params.settings,
|
|
461
|
-
itemIds: [params.itemId],
|
|
462
|
-
commandLabel: params.commandLabel
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
async function enforceHistoryStreamPolicyForItems(params) {
|
|
466
|
-
const ids = toSortedUniqueItemIds(params.itemIds);
|
|
467
|
-
const autoCreated = [];
|
|
468
|
-
const warnings = [];
|
|
469
|
-
for (const itemId of ids) {
|
|
470
|
-
const historyPath = getHistoryPath(params.pmRoot, itemId);
|
|
471
|
-
if (await pathExists(historyPath)) {
|
|
472
|
-
continue;
|
|
473
|
-
}
|
|
474
|
-
if (params.settings.history.missing_stream === "strict_error") {
|
|
475
|
-
throw strictMissingStreamError(itemId, params.commandLabel);
|
|
476
|
-
}
|
|
477
|
-
warnings.push(...await createStream(historyPath, params.commandLabel));
|
|
478
|
-
warnings.push(`history_stream_auto_created:${itemId}`);
|
|
479
|
-
autoCreated.push(itemId);
|
|
480
|
-
}
|
|
481
|
-
return {
|
|
482
|
-
auto_created_ids: autoCreated,
|
|
483
|
-
warnings
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
// dist/core/lock/lock.js
|
|
488
|
-
import fs2 from "node:fs/promises";
|
|
489
|
-
import path2 from "node:path";
|
|
490
|
-
import { randomUUID } from "node:crypto";
|
|
491
|
-
!(function() {
|
|
492
|
-
try {
|
|
493
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
494
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "54aefb1b-1723-52fc-bd7f-a29840fe26dc");
|
|
495
|
-
} catch (e2) {
|
|
496
|
-
}
|
|
497
|
-
})();
|
|
498
|
-
function parseLockInfo(raw) {
|
|
499
|
-
let parsed;
|
|
500
|
-
try {
|
|
501
|
-
parsed = JSON.parse(raw);
|
|
502
|
-
} catch {
|
|
503
|
-
return {
|
|
504
|
-
info: null,
|
|
505
|
-
warnings: ["lock_info_invalid_json"]
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
509
|
-
return {
|
|
510
|
-
info: null,
|
|
511
|
-
warnings: ["lock_info_invalid_shape"]
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
const candidate = parsed;
|
|
515
|
-
const id = candidate.id;
|
|
516
|
-
const pid = candidate.pid;
|
|
517
|
-
const owner = candidate.owner;
|
|
518
|
-
const createdAt = candidate.created_at;
|
|
519
|
-
const ttlSeconds = candidate.ttl_seconds;
|
|
520
|
-
if (typeof id !== "string" || typeof pid !== "number" || !Number.isFinite(pid) || typeof owner !== "string" || typeof createdAt !== "string" || typeof ttlSeconds !== "number" || !Number.isFinite(ttlSeconds)) {
|
|
521
|
-
return {
|
|
522
|
-
info: null,
|
|
523
|
-
warnings: ["lock_info_invalid_shape"]
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
return {
|
|
527
|
-
info: {
|
|
528
|
-
id,
|
|
529
|
-
pid,
|
|
530
|
-
owner,
|
|
531
|
-
created_at: createdAt,
|
|
532
|
-
ttl_seconds: ttlSeconds
|
|
533
|
-
},
|
|
534
|
-
warnings: []
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
async function readLockInfo(lockPath) {
|
|
538
|
-
try {
|
|
539
|
-
const raw = await fs2.readFile(lockPath, "utf8");
|
|
540
|
-
await runActiveOnReadHooks({
|
|
541
|
-
path: lockPath,
|
|
542
|
-
scope: "project"
|
|
543
|
-
});
|
|
544
|
-
return parseLockInfo(raw);
|
|
545
|
-
} catch (error) {
|
|
546
|
-
if (isErrno(error, "ENOENT")) {
|
|
547
|
-
return {
|
|
548
|
-
info: null,
|
|
549
|
-
warnings: []
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
return {
|
|
553
|
-
info: null,
|
|
554
|
-
warnings: ["lock_info_read_failed"]
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function isErrno(error, code) {
|
|
559
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
560
|
-
}
|
|
561
|
-
async function emitLockWriteHook(lockPath, op) {
|
|
562
|
-
await runActiveOnWriteHooks({
|
|
563
|
-
path: lockPath,
|
|
564
|
-
scope: "project",
|
|
565
|
-
op
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
function buildLockPayload(id, owner, ttlSeconds) {
|
|
569
|
-
return {
|
|
570
|
-
id,
|
|
571
|
-
pid: process.pid,
|
|
572
|
-
owner,
|
|
573
|
-
created_at: nowIso(),
|
|
574
|
-
ttl_seconds: ttlSeconds
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
async function createLockFile(lockPath, id, owner, ttlSeconds) {
|
|
578
|
-
await fs2.mkdir(path2.dirname(lockPath), { recursive: true });
|
|
579
|
-
const handle = await fs2.open(lockPath, "wx");
|
|
580
|
-
try {
|
|
581
|
-
await handle.writeFile(`${JSON.stringify(buildLockPayload(id, owner, ttlSeconds), null, 2)}
|
|
582
|
-
`, "utf8");
|
|
583
|
-
} finally {
|
|
584
|
-
await handle.close();
|
|
585
|
-
}
|
|
586
|
-
await emitLockWriteHook(lockPath, "lock:create");
|
|
587
|
-
}
|
|
588
|
-
async function unlinkLockWithHook(lockPath, op) {
|
|
589
|
-
try {
|
|
590
|
-
await fs2.unlink(lockPath);
|
|
591
|
-
await emitLockWriteHook(lockPath, op);
|
|
592
|
-
return true;
|
|
593
|
-
} catch {
|
|
594
|
-
return false;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function isStaleLock(info, ttlSeconds) {
|
|
598
|
-
const createdAtMs = info?.created_at ? Date.parse(info.created_at) : Number.NaN;
|
|
599
|
-
const ageMs = Number.isFinite(createdAtMs) ? Date.now() - createdAtMs : Number.POSITIVE_INFINITY;
|
|
600
|
-
return ageMs > ttlSeconds * 1e3;
|
|
601
|
-
}
|
|
602
|
-
function lockOwnerSuffix(info) {
|
|
603
|
-
return info?.owner ? ` (owner ${info.owner})` : "";
|
|
604
|
-
}
|
|
605
|
-
var LOCK_WAIT_INITIAL_DELAY_MS = 25;
|
|
606
|
-
var LOCK_WAIT_MAX_DELAY_MS = 200;
|
|
607
|
-
var LOCK_CONFLICT_RETRY_HINT_MS = 250;
|
|
608
|
-
var MAX_STALE_LOCK_REMOVALS = 3;
|
|
609
|
-
var STALE_CLEANUP_GATE_SUFFIX = ".stale-cleanup";
|
|
610
|
-
var STALE_CLEANUP_GATE_OWNER_FILE = "owner.json";
|
|
611
|
-
var STALE_CLEANUP_GATE_STALE_MS = 1e4;
|
|
612
|
-
var STALE_CLEANUP_GATE_MAX_ACTIVE_MS = 5 * 6e4;
|
|
613
|
-
function parseNonNegativeIntegerWaitMs(value) {
|
|
614
|
-
if (typeof value === "string") {
|
|
615
|
-
const trimmed = value.trim();
|
|
616
|
-
if (!/^\d+$/.test(trimmed)) {
|
|
617
|
-
return void 0;
|
|
618
|
-
}
|
|
619
|
-
const parsed = Number(trimmed);
|
|
620
|
-
return Number.isSafeInteger(parsed) ? parsed : void 0;
|
|
621
|
-
}
|
|
622
|
-
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
623
|
-
return Math.trunc(value);
|
|
624
|
-
}
|
|
625
|
-
return void 0;
|
|
626
|
-
}
|
|
627
|
-
function resolveLockWaitMs(waitMs) {
|
|
628
|
-
const envRaw = process.env.PM_LOCK_WAIT_MS;
|
|
629
|
-
const envParsed = parseNonNegativeIntegerWaitMs(envRaw);
|
|
630
|
-
if (envParsed !== void 0) {
|
|
631
|
-
return envParsed;
|
|
632
|
-
}
|
|
633
|
-
const callerParsed = parseNonNegativeIntegerWaitMs(waitMs);
|
|
634
|
-
if (callerParsed !== void 0) {
|
|
635
|
-
return callerParsed;
|
|
636
|
-
}
|
|
637
|
-
return 0;
|
|
638
|
-
}
|
|
639
|
-
function sleepWithJitter(baseDelayMs) {
|
|
640
|
-
const jitteredMs = Math.max(1, Math.round(baseDelayMs * (0.5 + Math.random())));
|
|
641
|
-
return new Promise((resolve) => setTimeout(resolve, jitteredMs));
|
|
642
|
-
}
|
|
643
|
-
function buildLockConflictError(id, info, waitedMs) {
|
|
644
|
-
const waitedSuffix = waitedMs > 0 ? ` after waiting ${waitedMs}ms` : "";
|
|
645
|
-
return new PmCliError(`Item ${id} is locked${lockOwnerSuffix(info)}${waitedSuffix}`, EXIT_CODE.CONFLICT, {
|
|
646
|
-
code: "lock_conflict",
|
|
647
|
-
recovery: {
|
|
648
|
-
retry_after_ms: LOCK_CONFLICT_RETRY_HINT_MS
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
function resolveLockOverrideRelease(result) {
|
|
653
|
-
if (typeof result === "function") {
|
|
654
|
-
return result;
|
|
655
|
-
}
|
|
656
|
-
if (typeof result === "object" && result !== null && "release" in result) {
|
|
657
|
-
const release = result.release;
|
|
658
|
-
return typeof release === "function" ? release : null;
|
|
659
|
-
}
|
|
660
|
-
return null;
|
|
661
|
-
}
|
|
662
|
-
function throwIfStaleLockNeedsForce(id, lockInfo, force, forceRequired) {
|
|
663
|
-
if (!force && forceRequired) {
|
|
664
|
-
const warningSuffix = lockInfo.warnings.length > 0 ? ` (${lockInfo.warnings.join(",")})` : "";
|
|
665
|
-
throw new PmCliError(`Item ${id} lock is stale${warningSuffix}; rerun with --force when supported for this command`, EXIT_CODE.CONFLICT);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
function parseStaleCleanupGateOwner(raw) {
|
|
669
|
-
let parsed;
|
|
670
|
-
try {
|
|
671
|
-
parsed = JSON.parse(raw);
|
|
672
|
-
} catch {
|
|
673
|
-
return null;
|
|
674
|
-
}
|
|
675
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
676
|
-
return null;
|
|
677
|
-
}
|
|
678
|
-
const candidate = parsed;
|
|
679
|
-
const pid = candidate.pid;
|
|
680
|
-
const token = candidate.token;
|
|
681
|
-
if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0 || typeof token !== "string" || token.length === 0) {
|
|
682
|
-
return null;
|
|
683
|
-
}
|
|
684
|
-
return { pid, token };
|
|
685
|
-
}
|
|
686
|
-
async function readStaleCleanupGateOwner(gatePath) {
|
|
687
|
-
try {
|
|
688
|
-
return parseStaleCleanupGateOwner(await fs2.readFile(path2.join(gatePath, STALE_CLEANUP_GATE_OWNER_FILE), "utf8"));
|
|
689
|
-
} catch {
|
|
690
|
-
return null;
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
function isProcessAlive(pid) {
|
|
694
|
-
try {
|
|
695
|
-
process.kill(pid, 0);
|
|
696
|
-
return true;
|
|
697
|
-
} catch (error) {
|
|
698
|
-
if (isErrno(error, "ESRCH")) {
|
|
699
|
-
return false;
|
|
700
|
-
}
|
|
701
|
-
return true;
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
async function removeStaleCleanupGateDirectory(gatePath) {
|
|
705
|
-
try {
|
|
706
|
-
await fs2.rm(gatePath, { recursive: true, force: true });
|
|
707
|
-
return true;
|
|
708
|
-
} catch {
|
|
709
|
-
return false;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
async function releaseStaleCleanupGate(gatePath, token) {
|
|
713
|
-
const owner = await readStaleCleanupGateOwner(gatePath);
|
|
714
|
-
if (owner === null || owner.token !== token) {
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
await removeStaleCleanupGateDirectory(gatePath);
|
|
718
|
-
}
|
|
719
|
-
async function tryCreateStaleCleanupGate(gatePath) {
|
|
720
|
-
try {
|
|
721
|
-
await fs2.mkdir(gatePath);
|
|
722
|
-
} catch (error) {
|
|
723
|
-
if (isErrno(error, "EEXIST")) {
|
|
724
|
-
return null;
|
|
725
|
-
}
|
|
726
|
-
return null;
|
|
727
|
-
}
|
|
728
|
-
const owner = { pid: process.pid, token: randomUUID() };
|
|
729
|
-
try {
|
|
730
|
-
await fs2.writeFile(path2.join(gatePath, STALE_CLEANUP_GATE_OWNER_FILE), `${JSON.stringify(owner)}
|
|
731
|
-
`, "utf8");
|
|
732
|
-
} catch {
|
|
733
|
-
await removeStaleCleanupGateDirectory(gatePath);
|
|
734
|
-
return null;
|
|
735
|
-
}
|
|
736
|
-
return owner;
|
|
737
|
-
}
|
|
738
|
-
async function removeExpiredStaleCleanupGate(gatePath) {
|
|
739
|
-
let gateAgeMs;
|
|
740
|
-
try {
|
|
741
|
-
const stats = await fs2.stat(gatePath);
|
|
742
|
-
gateAgeMs = Date.now() - stats.mtimeMs;
|
|
743
|
-
if (gateAgeMs <= STALE_CLEANUP_GATE_STALE_MS) {
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
} catch (error) {
|
|
747
|
-
return isErrno(error, "ENOENT");
|
|
748
|
-
}
|
|
749
|
-
const owner = await readStaleCleanupGateOwner(gatePath);
|
|
750
|
-
if (owner !== null && isProcessAlive(owner.pid) && gateAgeMs <= STALE_CLEANUP_GATE_MAX_ACTIVE_MS) {
|
|
751
|
-
return false;
|
|
752
|
-
}
|
|
753
|
-
return removeStaleCleanupGateDirectory(gatePath);
|
|
754
|
-
}
|
|
755
|
-
async function acquireStaleCleanupGate(lockPath, _id) {
|
|
756
|
-
const gatePath = `${lockPath}${STALE_CLEANUP_GATE_SUFFIX}`;
|
|
757
|
-
const owner = await tryCreateStaleCleanupGate(gatePath);
|
|
758
|
-
if (owner !== null) {
|
|
759
|
-
return async () => releaseStaleCleanupGate(gatePath, owner.token);
|
|
760
|
-
}
|
|
761
|
-
if (!await removeExpiredStaleCleanupGate(gatePath)) {
|
|
762
|
-
return null;
|
|
763
|
-
}
|
|
764
|
-
const recoveredOwner = await tryCreateStaleCleanupGate(gatePath);
|
|
765
|
-
if (recoveredOwner === null) {
|
|
766
|
-
return null;
|
|
767
|
-
}
|
|
768
|
-
return async () => releaseStaleCleanupGate(gatePath, recoveredOwner.token);
|
|
769
|
-
}
|
|
770
|
-
async function removeConfirmedStaleLock(params) {
|
|
771
|
-
const releaseCleanupGate = await acquireStaleCleanupGate(params.lockPath, params.id);
|
|
772
|
-
if (releaseCleanupGate === null) {
|
|
773
|
-
return {
|
|
774
|
-
lockInfo: params.fallbackLockInfo,
|
|
775
|
-
shouldRetryCreate: false,
|
|
776
|
-
staleRemovalCounted: false
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
try {
|
|
780
|
-
const currentLockInfo = await readLockInfo(params.lockPath);
|
|
781
|
-
if (currentLockInfo.info === null && currentLockInfo.warnings.length === 0) {
|
|
782
|
-
return {
|
|
783
|
-
lockInfo: currentLockInfo,
|
|
784
|
-
shouldRetryCreate: true,
|
|
785
|
-
staleRemovalCounted: false
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
if (!isStaleLock(currentLockInfo.info, params.ttlSeconds)) {
|
|
789
|
-
return {
|
|
790
|
-
lockInfo: currentLockInfo,
|
|
791
|
-
shouldRetryCreate: false,
|
|
792
|
-
staleRemovalCounted: false
|
|
793
|
-
};
|
|
794
|
-
}
|
|
795
|
-
throwIfStaleLockNeedsForce(params.id, currentLockInfo, params.force, params.forceRequiredForStaleLock);
|
|
796
|
-
if (params.staleRemovals >= MAX_STALE_LOCK_REMOVALS) {
|
|
797
|
-
throw buildLockConflictError(params.id, currentLockInfo.info, Date.now() - params.startedAtMs);
|
|
798
|
-
}
|
|
799
|
-
return {
|
|
800
|
-
lockInfo: currentLockInfo,
|
|
801
|
-
shouldRetryCreate: await unlinkLockWithHook(params.lockPath, "lock:stale_remove"),
|
|
802
|
-
staleRemovalCounted: true
|
|
803
|
-
};
|
|
804
|
-
} finally {
|
|
805
|
-
await releaseCleanupGate();
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
async function acquireLock(pmRoot, id, ttlSeconds, owner, force = false, forceRequiredForStaleLock = true, waitMs) {
|
|
809
|
-
const lockOverride = await runActiveServiceOverride("lock_acquire", {
|
|
810
|
-
pm_root: pmRoot,
|
|
811
|
-
id,
|
|
812
|
-
ttl_seconds: ttlSeconds,
|
|
813
|
-
owner,
|
|
814
|
-
force,
|
|
815
|
-
force_required_for_stale_lock: forceRequiredForStaleLock
|
|
816
|
-
});
|
|
817
|
-
if (lockOverride.handled) {
|
|
818
|
-
const release = resolveLockOverrideRelease(lockOverride.result);
|
|
819
|
-
if (release) {
|
|
820
|
-
return async () => {
|
|
821
|
-
await Promise.resolve(release());
|
|
822
|
-
await runActiveServiceOverride("lock_release", {
|
|
823
|
-
pm_root: pmRoot,
|
|
824
|
-
id,
|
|
825
|
-
owner
|
|
826
|
-
});
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
const lockPath = getLockPath(pmRoot, id);
|
|
831
|
-
const waitBudgetMs = resolveLockWaitMs(waitMs);
|
|
832
|
-
const startedAtMs = Date.now();
|
|
833
|
-
let staleRemovals = 0;
|
|
834
|
-
let backoffMs = LOCK_WAIT_INITIAL_DELAY_MS;
|
|
835
|
-
for (; ; ) {
|
|
836
|
-
try {
|
|
837
|
-
await createLockFile(lockPath, id, owner, ttlSeconds);
|
|
838
|
-
return async () => {
|
|
839
|
-
await unlinkLockWithHook(lockPath, "lock:release");
|
|
840
|
-
await runActiveServiceOverride("lock_release", {
|
|
841
|
-
pm_root: pmRoot,
|
|
842
|
-
id,
|
|
843
|
-
owner
|
|
844
|
-
});
|
|
845
|
-
};
|
|
846
|
-
} catch (error) {
|
|
847
|
-
if (!isErrno(error, "EEXIST")) {
|
|
848
|
-
throw new PmCliError(`Failed to acquire lock for ${id}: ${toErrorMessage(error)}`, EXIT_CODE.GENERIC_FAILURE);
|
|
849
|
-
}
|
|
850
|
-
let lockInfo = await readLockInfo(lockPath);
|
|
851
|
-
if (isStaleLock(lockInfo.info, ttlSeconds)) {
|
|
852
|
-
const staleRemoval = await removeConfirmedStaleLock({
|
|
853
|
-
lockPath,
|
|
854
|
-
id,
|
|
855
|
-
ttlSeconds,
|
|
856
|
-
force,
|
|
857
|
-
forceRequiredForStaleLock,
|
|
858
|
-
staleRemovals,
|
|
859
|
-
waitBudgetMs,
|
|
860
|
-
startedAtMs,
|
|
861
|
-
fallbackLockInfo: lockInfo
|
|
862
|
-
});
|
|
863
|
-
lockInfo = staleRemoval.lockInfo;
|
|
864
|
-
if (staleRemoval.staleRemovalCounted) {
|
|
865
|
-
staleRemovals += 1;
|
|
866
|
-
}
|
|
867
|
-
if (staleRemoval.shouldRetryCreate) {
|
|
868
|
-
continue;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
const elapsedMs = Date.now() - startedAtMs;
|
|
872
|
-
if (waitBudgetMs === 0 || elapsedMs >= waitBudgetMs) {
|
|
873
|
-
throw buildLockConflictError(id, lockInfo.info, waitBudgetMs === 0 ? 0 : elapsedMs);
|
|
874
|
-
}
|
|
875
|
-
await sleepWithJitter(Math.min(backoffMs, waitBudgetMs - elapsedMs));
|
|
876
|
-
backoffMs = Math.min(backoffMs * 2, LOCK_WAIT_MAX_DELAY_MS);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
// dist/core/store/front-matter-cache.js
|
|
882
|
-
import fs3 from "node:fs/promises";
|
|
883
|
-
import path3 from "node:path";
|
|
884
|
-
import { createHash } from "node:crypto";
|
|
885
|
-
!(function() {
|
|
886
|
-
try {
|
|
887
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
888
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "33a7cae0-25bf-5973-afc6-7666b14bf957");
|
|
889
|
-
} catch (e2) {
|
|
890
|
-
}
|
|
891
|
-
})();
|
|
892
|
-
var CACHE_VERSION = 6;
|
|
893
|
-
var CACHE_FILENAME = "metadata-cache.json";
|
|
894
|
-
var BODY_CACHE_FILENAME = "metadata-cache-bodies.json";
|
|
895
|
-
var COLLECTIONS_CACHE_FILENAME = "metadata-cache-collections.json";
|
|
896
|
-
var HEAVY_METADATA_KEYS = [
|
|
897
|
-
"comments",
|
|
898
|
-
"notes",
|
|
899
|
-
"learnings",
|
|
900
|
-
"files",
|
|
901
|
-
"tests",
|
|
902
|
-
"test_runs",
|
|
903
|
-
"docs"
|
|
904
|
-
];
|
|
905
|
-
function resolveActiveExtensionFieldNames() {
|
|
906
|
-
return collectRegisteredItemFieldNames(getActiveExtensionRegistrations());
|
|
907
|
-
}
|
|
908
|
-
function splitHeavyMetadata(metadata) {
|
|
909
|
-
const light = { ...metadata };
|
|
910
|
-
const heavy = {};
|
|
911
|
-
for (const key of HEAVY_METADATA_KEYS) {
|
|
912
|
-
if (key in light) {
|
|
913
|
-
heavy[key] = light[key];
|
|
914
|
-
delete light[key];
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
return { light, heavy };
|
|
918
|
-
}
|
|
919
|
-
function mergeHeavyMetadata(light, heavy) {
|
|
920
|
-
if (!heavy || Object.keys(heavy).length === 0) {
|
|
921
|
-
return light;
|
|
922
|
-
}
|
|
923
|
-
return { ...light, ...heavy };
|
|
924
|
-
}
|
|
925
|
-
function computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames) {
|
|
926
|
-
const hash = createHash("sha256");
|
|
927
|
-
hash.update(`format:${preferredFormat ?? "default"}`);
|
|
928
|
-
const sortedTypes = Object.entries(typeToFolder).sort(([a], [b]) => a.localeCompare(b)).map(([type, folder]) => `${type}=${folder}`).join(",");
|
|
929
|
-
hash.update(`|types:${sortedTypes}`);
|
|
930
|
-
if (schema) {
|
|
931
|
-
hash.update(`|schema:${JSON.stringify(schema)}`);
|
|
932
|
-
}
|
|
933
|
-
if (extensionFieldNames.length > 0) {
|
|
934
|
-
hash.update(`|extension_fields:${extensionFieldNames.join(",")}`);
|
|
935
|
-
}
|
|
936
|
-
return hash.digest("hex").slice(0, 16);
|
|
937
|
-
}
|
|
938
|
-
function getCachePath(pmRoot) {
|
|
939
|
-
return path3.join(pmRoot, "runtime", CACHE_FILENAME);
|
|
940
|
-
}
|
|
941
|
-
function getBodyCachePath(pmRoot) {
|
|
942
|
-
return path3.join(pmRoot, "runtime", BODY_CACHE_FILENAME);
|
|
943
|
-
}
|
|
944
|
-
function getCollectionsCachePath(pmRoot) {
|
|
945
|
-
return path3.join(pmRoot, "runtime", COLLECTIONS_CACHE_FILENAME);
|
|
946
|
-
}
|
|
947
|
-
var ENVELOPE_MEMO_MAX_ENTRIES = 24;
|
|
948
|
-
var envelopeMemo = /* @__PURE__ */ new Map();
|
|
949
|
-
function memoizeEnvelope(cachePath, entry) {
|
|
950
|
-
if (envelopeMemo.size >= ENVELOPE_MEMO_MAX_ENTRIES && !envelopeMemo.has(cachePath)) {
|
|
951
|
-
evictOldestMemoEntries(envelopeMemo);
|
|
952
|
-
}
|
|
953
|
-
envelopeMemo.set(cachePath, entry);
|
|
954
|
-
}
|
|
955
|
-
async function loadEnvelopeMemoized(cachePath, parse) {
|
|
956
|
-
let stat;
|
|
957
|
-
try {
|
|
958
|
-
stat = await fs3.stat(cachePath);
|
|
959
|
-
} catch {
|
|
960
|
-
envelopeMemo.delete(cachePath);
|
|
961
|
-
return null;
|
|
962
|
-
}
|
|
963
|
-
const memoized = envelopeMemo.get(cachePath);
|
|
964
|
-
if (memoized && statMatches(memoized.signature, stat.mtimeMs, stat.ctimeMs, stat.size)) {
|
|
965
|
-
envelopeMemo.delete(cachePath);
|
|
966
|
-
envelopeMemo.set(cachePath, memoized);
|
|
967
|
-
return memoized.envelope;
|
|
968
|
-
}
|
|
969
|
-
let envelope;
|
|
970
|
-
try {
|
|
971
|
-
envelope = parse(await fs3.readFile(cachePath, "utf8"));
|
|
972
|
-
} catch {
|
|
973
|
-
envelope = null;
|
|
974
|
-
}
|
|
975
|
-
memoizeEnvelope(cachePath, {
|
|
976
|
-
signature: { mtime_ms: stat.mtimeMs, ctime_ms: stat.ctimeMs, size: stat.size },
|
|
977
|
-
envelope
|
|
978
|
-
});
|
|
979
|
-
return envelope;
|
|
980
|
-
}
|
|
981
|
-
async function loadCache(pmRoot) {
|
|
982
|
-
return await loadEnvelopeMemoized(getCachePath(pmRoot), (raw) => {
|
|
983
|
-
const parsed = JSON.parse(raw);
|
|
984
|
-
if (parsed.version !== CACHE_VERSION || typeof parsed.entries !== "object" || parsed.entries === null) {
|
|
985
|
-
return null;
|
|
986
|
-
}
|
|
987
|
-
return parsed;
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
async function loadBodyCache(pmRoot) {
|
|
991
|
-
return await loadEnvelopeMemoized(getBodyCachePath(pmRoot), (raw) => {
|
|
992
|
-
const parsed = JSON.parse(raw);
|
|
993
|
-
if (parsed.version !== CACHE_VERSION || typeof parsed.bodies !== "object" || parsed.bodies === null) {
|
|
994
|
-
return null;
|
|
995
|
-
}
|
|
996
|
-
return parsed;
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
async function loadCollectionsCache(pmRoot) {
|
|
1000
|
-
return await loadEnvelopeMemoized(getCollectionsCachePath(pmRoot), (raw) => {
|
|
1001
|
-
const parsed = JSON.parse(raw);
|
|
1002
|
-
if (parsed.version !== CACHE_VERSION || typeof parsed.collections !== "object" || parsed.collections === null) {
|
|
1003
|
-
return null;
|
|
1004
|
-
}
|
|
1005
|
-
return parsed;
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
async function persistCache(cachePath, envelope) {
|
|
1009
|
-
await fs3.mkdir(path3.dirname(cachePath), { recursive: true });
|
|
1010
|
-
await writeFileAtomic(cachePath, JSON.stringify(envelope));
|
|
1011
|
-
try {
|
|
1012
|
-
const stat = await fs3.stat(cachePath);
|
|
1013
|
-
memoizeEnvelope(cachePath, {
|
|
1014
|
-
signature: { mtime_ms: stat.mtimeMs, ctime_ms: stat.ctimeMs, size: stat.size },
|
|
1015
|
-
envelope
|
|
1016
|
-
});
|
|
1017
|
-
} catch {
|
|
1018
|
-
envelopeMemo.delete(cachePath);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
function shouldReplaceCachedDocumentCandidate(existingFormat, candidateFormat, preferredFormat) {
|
|
1022
|
-
if (preferredFormat) {
|
|
1023
|
-
return candidateFormat === preferredFormat && existingFormat !== preferredFormat;
|
|
1024
|
-
}
|
|
1025
|
-
return candidateFormat === "toon" && existingFormat !== "toon";
|
|
1026
|
-
}
|
|
1027
|
-
function appendWarning(warnings, warning) {
|
|
1028
|
-
if (warnings && !warnings.includes(warning)) {
|
|
1029
|
-
warnings.push(warning);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
function statMatches(signature, mtimeMs, ctimeMs, size) {
|
|
1033
|
-
return signature.mtime_ms === mtimeMs && signature.ctime_ms === ctimeMs && signature.size === size;
|
|
1034
|
-
}
|
|
1035
|
-
async function readItemDirectoryFiles(pmRoot, folder, warnings) {
|
|
1036
|
-
const dirPath = path3.join(pmRoot, folder);
|
|
1037
|
-
try {
|
|
1038
|
-
const files = await fs3.readdir(dirPath);
|
|
1039
|
-
return { folder, dirPath, files };
|
|
1040
|
-
} catch (error) {
|
|
1041
|
-
if (typeof error === "object" && error !== null && "code" in error && error.code !== "ENOENT") {
|
|
1042
|
-
appendWarning(warnings, `item_list_directory_read_failed:${folder}`);
|
|
1043
|
-
}
|
|
1044
|
-
return { folder, dirPath, files: [] };
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
function isItemDocumentFile(file) {
|
|
1048
|
-
return ITEM_FILE_EXTENSIONS.some((ext) => file.toLowerCase().endsWith(ext));
|
|
1049
|
-
}
|
|
1050
|
-
function markDocumentCacheMisses(misses, includeBody, includeCollections, metadataCached, bodyCached, collectionsCached) {
|
|
1051
|
-
if (!metadataCached) {
|
|
1052
|
-
misses.metadata = true;
|
|
1053
|
-
}
|
|
1054
|
-
if (includeBody && !bodyCached) {
|
|
1055
|
-
misses.body = true;
|
|
1056
|
-
}
|
|
1057
|
-
if (includeCollections && !collectionsCached) {
|
|
1058
|
-
misses.collections = true;
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
async function dispatchCachedDocumentReadHooks(filePath, warnings, dispatchReadHooks) {
|
|
1062
|
-
if (!dispatchReadHooks) {
|
|
1063
|
-
return;
|
|
1064
|
-
}
|
|
1065
|
-
for (const warning of await runActiveOnReadHooks({ path: filePath, scope: "project" })) {
|
|
1066
|
-
appendWarning(warnings, warning);
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
async function readCachedDocumentParts(filePath, relativePath, context) {
|
|
1070
|
-
const stat = await fs3.stat(filePath);
|
|
1071
|
-
const mtimeMs = stat.mtimeMs;
|
|
1072
|
-
const ctimeMs = stat.ctimeMs;
|
|
1073
|
-
const { size } = stat;
|
|
1074
|
-
const itemFormat = getItemFormatFromPath(filePath);
|
|
1075
|
-
await dispatchCachedDocumentReadHooks(filePath, context.warnings, context.dispatchReadHooks);
|
|
1076
|
-
const cachedEntry = context.previousEntries[relativePath];
|
|
1077
|
-
const metadataCached = cachedEntry !== void 0 && statMatches(cachedEntry, mtimeMs, ctimeMs, size);
|
|
1078
|
-
const cachedBody = context.previousBodies[relativePath];
|
|
1079
|
-
const bodyCached = cachedBody !== void 0 && statMatches(cachedBody, mtimeMs, ctimeMs, size);
|
|
1080
|
-
const cachedCollections = context.previousCollections[relativePath];
|
|
1081
|
-
const collectionsCached = cachedCollections !== void 0 && statMatches(cachedCollections, mtimeMs, ctimeMs, size);
|
|
1082
|
-
const needRead = !metadataCached || context.includeBody && !bodyCached || context.includeCollections && !collectionsCached;
|
|
1083
|
-
if (!needRead) {
|
|
1084
|
-
return {
|
|
1085
|
-
mtimeMs,
|
|
1086
|
-
ctimeMs,
|
|
1087
|
-
size,
|
|
1088
|
-
itemFormat,
|
|
1089
|
-
lightMetadata: cachedEntry.metadata,
|
|
1090
|
-
heavyMetadata: context.includeCollections && cachedCollections ? cachedCollections.collections : void 0,
|
|
1091
|
-
bodyLength: cachedEntry.body_length,
|
|
1092
|
-
body: context.includeBody ? cachedBody.body : void 0
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
const raw = await fs3.readFile(filePath, "utf8");
|
|
1096
|
-
const parsed = parseItemDocument(raw, {
|
|
1097
|
-
format: itemFormat,
|
|
1098
|
-
schema: context.schema,
|
|
1099
|
-
extensionFieldNames: context.extensionFieldNames,
|
|
1100
|
-
onWarning: (warning) => appendWarning(context.warnings, warning)
|
|
1101
|
-
});
|
|
1102
|
-
const split = splitHeavyMetadata(parsed.metadata);
|
|
1103
|
-
markDocumentCacheMisses(context.state.misses, context.includeBody, context.includeCollections, metadataCached, bodyCached, collectionsCached);
|
|
1104
|
-
return {
|
|
1105
|
-
mtimeMs,
|
|
1106
|
-
ctimeMs,
|
|
1107
|
-
size,
|
|
1108
|
-
itemFormat,
|
|
1109
|
-
lightMetadata: metadataCached ? cachedEntry.metadata : split.light,
|
|
1110
|
-
heavyMetadata: context.includeCollections ? collectionsCached ? cachedCollections.collections : split.heavy : void 0,
|
|
1111
|
-
bodyLength: metadataCached ? cachedEntry.body_length : parsed.body.length,
|
|
1112
|
-
body: context.includeBody ? parsed.body : void 0
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
function recordCachedDocumentCandidate(filePath, relativePath, context, parts) {
|
|
1116
|
-
context.state.newEntries[relativePath] = {
|
|
1117
|
-
mtime_ms: parts.mtimeMs,
|
|
1118
|
-
ctime_ms: parts.ctimeMs,
|
|
1119
|
-
size: parts.size,
|
|
1120
|
-
metadata: parts.lightMetadata,
|
|
1121
|
-
body_length: parts.bodyLength
|
|
1122
|
-
};
|
|
1123
|
-
if (context.includeBody && parts.body !== void 0) {
|
|
1124
|
-
context.state.newBodies[relativePath] = {
|
|
1125
|
-
mtime_ms: parts.mtimeMs,
|
|
1126
|
-
ctime_ms: parts.ctimeMs,
|
|
1127
|
-
size: parts.size,
|
|
1128
|
-
body: parts.body
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
if (context.includeCollections && parts.heavyMetadata !== void 0) {
|
|
1132
|
-
context.state.newCollections[relativePath] = {
|
|
1133
|
-
mtime_ms: parts.mtimeMs,
|
|
1134
|
-
ctime_ms: parts.ctimeMs,
|
|
1135
|
-
size: parts.size,
|
|
1136
|
-
collections: parts.heavyMetadata
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
const metadata = context.includeCollections ? mergeHeavyMetadata(parts.lightMetadata, parts.heavyMetadata) : parts.lightMetadata;
|
|
1140
|
-
const existing = context.state.documentsById.get(metadata.id);
|
|
1141
|
-
const candidate = {
|
|
1142
|
-
metadata,
|
|
1143
|
-
body: parts.body,
|
|
1144
|
-
item_format: parts.itemFormat,
|
|
1145
|
-
item_path: filePath
|
|
1146
|
-
};
|
|
1147
|
-
if (!existing || shouldReplaceCachedDocumentCandidate(existing.itemFormat, parts.itemFormat, context.preferredFormat)) {
|
|
1148
|
-
context.state.documentsById.set(metadata.id, { candidate, itemFormat: parts.itemFormat });
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
async function processCachedDocumentFile(folder, filePath, relativePath, context) {
|
|
1152
|
-
try {
|
|
1153
|
-
const parts = await readCachedDocumentParts(filePath, relativePath, context);
|
|
1154
|
-
recordCachedDocumentCandidate(filePath, relativePath, context, parts);
|
|
1155
|
-
} catch {
|
|
1156
|
-
appendWarning(context.warnings, `item_list_item_read_failed:${folder}/${path3.basename(filePath)}`);
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
function selectPreviousMetadataEntries(existingCache, contextFingerprint) {
|
|
1160
|
-
return existingCache && existingCache.context_fingerprint === contextFingerprint ? existingCache.entries : {};
|
|
1161
|
-
}
|
|
1162
|
-
function selectPreviousBodyEntries(existingBodyCache, contextFingerprint) {
|
|
1163
|
-
return existingBodyCache && existingBodyCache.context_fingerprint === contextFingerprint ? existingBodyCache.bodies : {};
|
|
1164
|
-
}
|
|
1165
|
-
function selectPreviousCollectionEntries(existingCollectionsCache, contextFingerprint) {
|
|
1166
|
-
return existingCollectionsCache && existingCollectionsCache.context_fingerprint === contextFingerprint ? existingCollectionsCache.collections : {};
|
|
1167
|
-
}
|
|
1168
|
-
function createDocumentCacheMutableState() {
|
|
1169
|
-
return {
|
|
1170
|
-
newEntries: {},
|
|
1171
|
-
newBodies: {},
|
|
1172
|
-
newCollections: {},
|
|
1173
|
-
documentsById: /* @__PURE__ */ new Map(),
|
|
1174
|
-
misses: {
|
|
1175
|
-
metadata: false,
|
|
1176
|
-
body: false,
|
|
1177
|
-
collections: false
|
|
1178
|
-
}
|
|
1179
|
-
};
|
|
1180
|
-
}
|
|
1181
|
-
function collectCachedDocumentParseTasks(dirResults, context) {
|
|
1182
|
-
const parseTasks = [];
|
|
1183
|
-
for (const { folder, dirPath, files } of dirResults) {
|
|
1184
|
-
for (const file of files) {
|
|
1185
|
-
if (!isItemDocumentFile(file)) {
|
|
1186
|
-
continue;
|
|
1187
|
-
}
|
|
1188
|
-
const filePath = path3.join(dirPath, file);
|
|
1189
|
-
const relativePath = path3.relative(context.pmRoot, filePath);
|
|
1190
|
-
parseTasks.push(processCachedDocumentFile(folder, filePath, relativePath, context));
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
return parseTasks;
|
|
1194
|
-
}
|
|
1195
|
-
async function persistMetadataCacheIfNeeded(params) {
|
|
1196
|
-
const metadataDirty = params.state.misses.metadata || Object.keys(params.previousEntries).length !== Object.keys(params.state.newEntries).length;
|
|
1197
|
-
if (!metadataDirty && params.existingCache !== null && params.existingCache.context_fingerprint === params.contextFingerprint) {
|
|
1198
|
-
return;
|
|
1199
|
-
}
|
|
1200
|
-
await persistCache(getCachePath(params.pmRoot), {
|
|
1201
|
-
version: CACHE_VERSION,
|
|
1202
|
-
context_fingerprint: params.contextFingerprint,
|
|
1203
|
-
entries: params.state.newEntries
|
|
1204
|
-
}).catch(() => {
|
|
1205
|
-
});
|
|
1206
|
-
}
|
|
1207
|
-
async function persistBodyCacheIfNeeded(params) {
|
|
1208
|
-
const bodyDirty = params.state.misses.body || Object.keys(params.previousBodies).length !== Object.keys(params.state.newBodies).length;
|
|
1209
|
-
if (!bodyDirty && params.existingBodyCache !== null && params.existingBodyCache.context_fingerprint === params.contextFingerprint) {
|
|
1210
|
-
return;
|
|
1211
|
-
}
|
|
1212
|
-
await persistCache(getBodyCachePath(params.pmRoot), {
|
|
1213
|
-
version: CACHE_VERSION,
|
|
1214
|
-
context_fingerprint: params.contextFingerprint,
|
|
1215
|
-
bodies: params.state.newBodies
|
|
1216
|
-
}).catch(() => {
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
async function persistCollectionsCacheIfNeeded(params) {
|
|
1220
|
-
const collectionsDirty = params.state.misses.collections || Object.keys(params.previousCollections).length !== Object.keys(params.state.newCollections).length;
|
|
1221
|
-
if (!collectionsDirty && params.existingCollectionsCache !== null && params.existingCollectionsCache.context_fingerprint === params.contextFingerprint) {
|
|
1222
|
-
return;
|
|
1223
|
-
}
|
|
1224
|
-
await persistCache(getCollectionsCachePath(params.pmRoot), {
|
|
1225
|
-
version: CACHE_VERSION,
|
|
1226
|
-
context_fingerprint: params.contextFingerprint,
|
|
1227
|
-
collections: params.state.newCollections
|
|
1228
|
-
}).catch(() => {
|
|
1229
|
-
});
|
|
1230
|
-
}
|
|
1231
|
-
function sortedCachedDocumentCandidates(state) {
|
|
1232
|
-
return [...state.documentsById.values()].sort((left, right) => left.candidate.metadata.id.localeCompare(right.candidate.metadata.id)).map((entry) => entry.candidate);
|
|
1233
|
-
}
|
|
1234
|
-
async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, options = {}) {
|
|
1235
|
-
const includeBody = options.includeBody !== false;
|
|
1236
|
-
const includeCollections = options.includeCollections !== false;
|
|
1237
|
-
const extensionFieldNames = resolveActiveExtensionFieldNames();
|
|
1238
|
-
const contextFingerprint = computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames);
|
|
1239
|
-
const existingCache = await loadCache(pmRoot);
|
|
1240
|
-
const previousEntries = selectPreviousMetadataEntries(existingCache, contextFingerprint);
|
|
1241
|
-
const existingBodyCache = includeBody ? await loadBodyCache(pmRoot) : null;
|
|
1242
|
-
const previousBodies = selectPreviousBodyEntries(existingBodyCache, contextFingerprint);
|
|
1243
|
-
const existingCollectionsCache = includeCollections ? await loadCollectionsCache(pmRoot) : null;
|
|
1244
|
-
const previousCollections = selectPreviousCollectionEntries(existingCollectionsCache, contextFingerprint);
|
|
1245
|
-
const entries = Object.entries(typeToFolder);
|
|
1246
|
-
const dirResults = await Promise.all(entries.map(([, folder]) => readItemDirectoryFiles(pmRoot, folder, warnings)));
|
|
1247
|
-
const dispatchReadHooks = hasActiveOnReadHooks();
|
|
1248
|
-
const state = createDocumentCacheMutableState();
|
|
1249
|
-
const context = {
|
|
1250
|
-
pmRoot,
|
|
1251
|
-
preferredFormat,
|
|
1252
|
-
warnings,
|
|
1253
|
-
schema,
|
|
1254
|
-
extensionFieldNames,
|
|
1255
|
-
includeBody,
|
|
1256
|
-
includeCollections,
|
|
1257
|
-
dispatchReadHooks,
|
|
1258
|
-
previousEntries,
|
|
1259
|
-
previousBodies,
|
|
1260
|
-
previousCollections,
|
|
1261
|
-
state
|
|
1262
|
-
};
|
|
1263
|
-
await Promise.all(collectCachedDocumentParseTasks(dirResults, context));
|
|
1264
|
-
await persistMetadataCacheIfNeeded({ pmRoot, contextFingerprint, existingCache, previousEntries, state });
|
|
1265
|
-
if (includeBody) {
|
|
1266
|
-
await persistBodyCacheIfNeeded({ pmRoot, contextFingerprint, existingBodyCache, previousBodies, state });
|
|
1267
|
-
}
|
|
1268
|
-
if (includeCollections) {
|
|
1269
|
-
await persistCollectionsCacheIfNeeded({ pmRoot, contextFingerprint, existingCollectionsCache, previousCollections, state });
|
|
1270
|
-
}
|
|
1271
|
-
return sortedCachedDocumentCandidates(state);
|
|
1272
|
-
}
|
|
1273
|
-
async function listAllDocumentsCached(pmRoot, preferredFormat, typeToFolder, warnings, schema) {
|
|
1274
|
-
const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {
|
|
1275
|
-
includeBody: false
|
|
1276
|
-
});
|
|
1277
|
-
return candidates.map((candidate) => ({
|
|
1278
|
-
metadata: candidate.metadata,
|
|
1279
|
-
body: candidate.body ?? ""
|
|
1280
|
-
}));
|
|
1281
|
-
}
|
|
1282
|
-
async function listAllDocumentsCachedLight(pmRoot, preferredFormat, typeToFolder, warnings, schema) {
|
|
1283
|
-
const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, {
|
|
1284
|
-
includeBody: false,
|
|
1285
|
-
includeCollections: false
|
|
1286
|
-
});
|
|
1287
|
-
return candidates.map((candidate) => ({
|
|
1288
|
-
metadata: candidate.metadata,
|
|
1289
|
-
body: candidate.body ?? ""
|
|
1290
|
-
}));
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
// dist/core/store/item-store.js
|
|
1294
|
-
import fs4 from "node:fs/promises";
|
|
1295
|
-
import path4 from "node:path";
|
|
1296
|
-
!(function() {
|
|
1297
|
-
try {
|
|
1298
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
1299
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c869c984-c9d5-5346-b651-d1b95418a628");
|
|
1300
|
-
} catch (e2) {
|
|
1301
|
-
}
|
|
1302
|
-
})();
|
|
1303
|
-
async function fileExists(targetPath) {
|
|
1304
|
-
try {
|
|
1305
|
-
await fs4.access(targetPath);
|
|
1306
|
-
return true;
|
|
1307
|
-
} catch {
|
|
1308
|
-
return false;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
function appendWarning2(warnings, warning) {
|
|
1312
|
-
if (!warnings) {
|
|
1313
|
-
return;
|
|
1314
|
-
}
|
|
1315
|
-
if (!warnings.includes(warning)) {
|
|
1316
|
-
warnings.push(warning);
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
function resolveActiveExtensionFieldNames2(explicit) {
|
|
1320
|
-
return explicit ?? collectRegisteredItemFieldNames(getActiveExtensionRegistrations());
|
|
1321
|
-
}
|
|
1322
|
-
function resolveItemFormatSearchOrder(preferredFormat) {
|
|
1323
|
-
if (preferredFormat === "toon") {
|
|
1324
|
-
return ["toon", "json_markdown"];
|
|
1325
|
-
}
|
|
1326
|
-
if (preferredFormat === "json_markdown") {
|
|
1327
|
-
return ["json_markdown", "toon"];
|
|
1328
|
-
}
|
|
1329
|
-
return ["toon", "json_markdown"];
|
|
1330
|
-
}
|
|
1331
|
-
async function locateItem(pmRoot, rawId, idPrefix = "pm-", preferredFormat, typeToFolder = TYPE_TO_FOLDER) {
|
|
1332
|
-
const normalizedId = normalizeItemId(rawId, idPrefix);
|
|
1333
|
-
const rawNormalizedId = normalizeRawItemId(rawId);
|
|
1334
|
-
const candidateIds = normalizedId === rawNormalizedId ? [normalizedId] : [normalizedId, rawNormalizedId];
|
|
1335
|
-
const entries = Object.entries(typeToFolder);
|
|
1336
|
-
const searchOrder = resolveItemFormatSearchOrder(preferredFormat);
|
|
1337
|
-
for (const candidateId of candidateIds) {
|
|
1338
|
-
for (const [type] of entries) {
|
|
1339
|
-
for (const itemFormat of searchOrder) {
|
|
1340
|
-
const itemPath = getItemPath(pmRoot, type, candidateId, itemFormat, typeToFolder);
|
|
1341
|
-
if (await fileExists(itemPath)) {
|
|
1342
|
-
return {
|
|
1343
|
-
id: candidateId,
|
|
1344
|
-
type,
|
|
1345
|
-
itemPath,
|
|
1346
|
-
item_format: itemFormat
|
|
1347
|
-
};
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
return null;
|
|
1353
|
-
}
|
|
1354
|
-
async function readLocatedItem(item, options = {}) {
|
|
1355
|
-
const raw = await fs4.readFile(item.itemPath, "utf8");
|
|
1356
|
-
await runActiveOnReadHooks({
|
|
1357
|
-
path: item.itemPath,
|
|
1358
|
-
scope: "project"
|
|
1359
|
-
});
|
|
1360
|
-
const document = parseItemDocument(raw, {
|
|
1361
|
-
format: item.item_format,
|
|
1362
|
-
schema: options.schema,
|
|
1363
|
-
extensionFieldNames: resolveActiveExtensionFieldNames2(options.extensionFieldNames),
|
|
1364
|
-
onWarning: (warning) => appendWarning2(options.warnings, warning)
|
|
1365
|
-
});
|
|
1366
|
-
return { raw, document };
|
|
1367
|
-
}
|
|
1368
|
-
async function listAllFrontMatter(pmRoot, preferredFormat, typeToFolder = TYPE_TO_FOLDER, warnings, schema) {
|
|
1369
|
-
const documents = await listAllDocumentsCached(pmRoot, preferredFormat, typeToFolder, warnings, schema);
|
|
1370
|
-
return documents.map((document) => document.metadata);
|
|
1371
|
-
}
|
|
1372
|
-
async function listAllFrontMatterLight(pmRoot, preferredFormat, typeToFolder = TYPE_TO_FOLDER, warnings, schema) {
|
|
1373
|
-
const documents = await listAllDocumentsCachedLight(pmRoot, preferredFormat, typeToFolder, warnings, schema);
|
|
1374
|
-
return documents.map((document) => document.metadata);
|
|
1375
|
-
}
|
|
1376
|
-
async function listAllFrontMatterWithBody(pmRoot, preferredFormat, typeToFolder = TYPE_TO_FOLDER, warnings, schema) {
|
|
1377
|
-
const candidates = await listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFolder, warnings, schema, { includeBody: true });
|
|
1378
|
-
return candidates.map((candidate) => ({
|
|
1379
|
-
...candidate.metadata,
|
|
1380
|
-
// includeBody:true guarantees candidate bodies are materialized.
|
|
1381
|
-
body: candidate.body
|
|
1382
|
-
}));
|
|
1383
|
-
}
|
|
1384
|
-
async function listKnownItemIds(pmRoot, typeToFolder) {
|
|
1385
|
-
const folders = new Set(Object.values(typeToFolder));
|
|
1386
|
-
const allIds = [];
|
|
1387
|
-
await Promise.all([...folders].map(async (folder) => {
|
|
1388
|
-
try {
|
|
1389
|
-
const entries = await fs4.readdir(path4.join(pmRoot, folder));
|
|
1390
|
-
for (const entry of entries) {
|
|
1391
|
-
for (const ext of ITEM_FILE_EXTENSIONS) {
|
|
1392
|
-
if (entry.toLowerCase().endsWith(ext)) {
|
|
1393
|
-
allIds.push(entry.slice(0, -ext.length));
|
|
1394
|
-
break;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
} catch {
|
|
1399
|
-
}
|
|
1400
|
-
}));
|
|
1401
|
-
return allIds;
|
|
1402
|
-
}
|
|
1403
|
-
async function buildDidYouMeanSuggestions(pmRoot, badId, idPrefix, typeToFolder) {
|
|
1404
|
-
const normalized = normalizeItemId(badId, idPrefix);
|
|
1405
|
-
const ids = await listKnownItemIds(pmRoot, typeToFolder);
|
|
1406
|
-
if (ids.length === 0)
|
|
1407
|
-
return [];
|
|
1408
|
-
const limit = Math.max(3, Math.floor(normalized.length / 2));
|
|
1409
|
-
const scored = ids.map((id) => ({ id, distance: levenshteinDistanceWithinLimit(id, normalized, limit) })).filter((entry) => entry.distance !== null).sort((left, right) => left.distance - right.distance).slice(0, 3).map((entry) => entry.id);
|
|
1410
|
-
return scored;
|
|
1411
|
-
}
|
|
1412
|
-
async function buildItemNotFoundError(pmRoot, badId, idPrefix, typeToFolder) {
|
|
1413
|
-
const suggestions = await buildDidYouMeanSuggestions(pmRoot, badId, idPrefix, typeToFolder);
|
|
1414
|
-
const nextSteps = ["Confirm the active --path/PM_PATH scope, then retry with a valid id."];
|
|
1415
|
-
if (suggestions.length > 0) {
|
|
1416
|
-
nextSteps.unshift(`Did you mean one of: ${suggestions.join(", ")}?`);
|
|
1417
|
-
}
|
|
1418
|
-
return new PmCliError(`Item ${badId} not found`, EXIT_CODE.NOT_FOUND, { nextSteps });
|
|
1419
|
-
}
|
|
1420
|
-
function bypassesAssigneeConflict(op, bypassAssigneeConflict) {
|
|
1421
|
-
return op === "claim" || bypassAssigneeConflict === true && (op === "comment_add" || op === "comment_edit" || op === "comment_delete" || op === "note_add" || op === "learning_add" || op === "release" || op === "update" || op === "update_audit");
|
|
1422
|
-
}
|
|
1423
|
-
async function prepareLockedItem(params) {
|
|
1424
|
-
const typeToFolder = params.typeToFolder ?? resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations()).type_to_folder;
|
|
1425
|
-
const located = await locateItem(params.pmRoot, params.id, params.settings.id_prefix, params.settings.item_format, typeToFolder);
|
|
1426
|
-
if (!located) {
|
|
1427
|
-
throw await buildItemNotFoundError(params.pmRoot, params.id, params.settings.id_prefix, typeToFolder);
|
|
1428
|
-
}
|
|
1429
|
-
const releaseLock = await acquireLock(params.pmRoot, located.id, params.settings.locks.ttl_seconds, params.author, Boolean(params.force), params.settings.governance.force_required_for_stale_lock, params.settings.locks.wait_ms);
|
|
1430
|
-
try {
|
|
1431
|
-
const warnings = [];
|
|
1432
|
-
const { raw: originalRaw, document } = await readLocatedItem(located, {
|
|
1433
|
-
schema: params.settings.schema,
|
|
1434
|
-
extensionFieldNames: params.extensionFieldNames,
|
|
1435
|
-
warnings
|
|
1436
|
-
});
|
|
1437
|
-
const assigned = document.metadata.assignee?.trim();
|
|
1438
|
-
const governance = resolveGovernanceKnobs(params.settings);
|
|
1439
|
-
const hasOwnershipConflict = assigned && assigned !== params.author && !params.force && !bypassesAssigneeConflict(params.op, params.bypassAssigneeConflict);
|
|
1440
|
-
if (hasOwnershipConflict) {
|
|
1441
|
-
if (governance.ownership_enforcement === "strict") {
|
|
1442
|
-
throw new PmCliError(`Item ${located.id} is assigned to ${assigned}. Use --force to override.`, EXIT_CODE.CONFLICT);
|
|
1443
|
-
}
|
|
1444
|
-
if (governance.ownership_enforcement === "warn") {
|
|
1445
|
-
warnings.push(`ownership_warning:assignee_conflict:${located.id}:${assigned}`);
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
return {
|
|
1449
|
-
typeToFolder,
|
|
1450
|
-
located,
|
|
1451
|
-
originalRaw,
|
|
1452
|
-
document,
|
|
1453
|
-
warnings,
|
|
1454
|
-
releaseLock
|
|
1455
|
-
};
|
|
1456
|
-
} catch (error) {
|
|
1457
|
-
await releaseLock();
|
|
1458
|
-
throw error;
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
function resolveItemStoreWriteOverride(serviceWriteOverride, targetItemPath, serializedAfter) {
|
|
1462
|
-
if (!serviceWriteOverride.handled || typeof serviceWriteOverride.result !== "object" || serviceWriteOverride.result === null) {
|
|
1463
|
-
return { effectiveTargetItemPath: targetItemPath, effectiveSerializedAfter: serializedAfter, skipItemWrite: false };
|
|
1464
|
-
}
|
|
1465
|
-
const overrideRecord = serviceWriteOverride.result;
|
|
1466
|
-
return {
|
|
1467
|
-
effectiveTargetItemPath: typeof overrideRecord.target_item_path === "string" && overrideRecord.target_item_path.trim().length > 0 ? overrideRecord.target_item_path : targetItemPath,
|
|
1468
|
-
effectiveSerializedAfter: typeof overrideRecord.contents === "string" ? overrideRecord.contents : serializedAfter,
|
|
1469
|
-
skipItemWrite: overrideRecord.skip_write === true
|
|
1470
|
-
};
|
|
1471
|
-
}
|
|
1472
|
-
async function rollbackMutatedItemWrite(params) {
|
|
1473
|
-
if (params.skipItemWrite) {
|
|
1474
|
-
return;
|
|
1475
|
-
}
|
|
1476
|
-
if (params.effectiveTargetItemPath !== params.originalItemPath) {
|
|
1477
|
-
await writeFileAtomic(params.originalItemPath, params.originalRaw);
|
|
1478
|
-
await fs4.rm(params.effectiveTargetItemPath, { force: true });
|
|
1479
|
-
return;
|
|
1480
|
-
}
|
|
1481
|
-
await writeFileAtomic(params.originalItemPath, params.originalRaw);
|
|
1482
|
-
}
|
|
1483
|
-
async function mutateItem(params) {
|
|
1484
|
-
const prepared = await prepareLockedItem({
|
|
1485
|
-
pmRoot: params.pmRoot,
|
|
1486
|
-
settings: params.settings,
|
|
1487
|
-
id: params.id,
|
|
1488
|
-
op: params.op,
|
|
1489
|
-
author: params.author,
|
|
1490
|
-
force: params.force,
|
|
1491
|
-
bypassAssigneeConflict: params.bypassAssigneeConflict,
|
|
1492
|
-
extensionFieldNames: params.extensionFieldNames,
|
|
1493
|
-
typeToFolder: params.typeToFolder
|
|
1494
|
-
});
|
|
1495
|
-
const { typeToFolder, located, originalRaw, document, warnings: parseWarnings, releaseLock } = prepared;
|
|
1496
|
-
try {
|
|
1497
|
-
const beforeDocument = canonicalDocument(document, {
|
|
1498
|
-
schema: params.settings.schema,
|
|
1499
|
-
extensionFieldNames: params.extensionFieldNames
|
|
1500
|
-
});
|
|
1501
|
-
const mutableDocument = canonicalDocument(structuredClone(document), {
|
|
1502
|
-
schema: params.settings.schema,
|
|
1503
|
-
extensionFieldNames: params.extensionFieldNames
|
|
1504
|
-
});
|
|
1505
|
-
const mutation = params.mutate(mutableDocument);
|
|
1506
|
-
if (params.skipNoop === true && mutation.changedFields.length === 0) {
|
|
1507
|
-
return {
|
|
1508
|
-
item: beforeDocument.metadata,
|
|
1509
|
-
body: beforeDocument.body,
|
|
1510
|
-
changedFields: [],
|
|
1511
|
-
warnings: [...parseWarnings, ...mutation.warnings ?? []]
|
|
1512
|
-
};
|
|
1513
|
-
}
|
|
1514
|
-
const historyPolicy = await enforceHistoryStreamPolicyForItem({
|
|
1515
|
-
pmRoot: params.pmRoot,
|
|
1516
|
-
settings: params.settings,
|
|
1517
|
-
itemId: located.id,
|
|
1518
|
-
commandLabel: params.op
|
|
1519
|
-
});
|
|
1520
|
-
mutableDocument.metadata.updated_at = nowIso();
|
|
1521
|
-
const afterDocument = canonicalDocument(mutableDocument, {
|
|
1522
|
-
schema: params.settings.schema,
|
|
1523
|
-
extensionFieldNames: params.extensionFieldNames
|
|
1524
|
-
});
|
|
1525
|
-
const targetItemFormat = "toon";
|
|
1526
|
-
const serializedAfter = serializeItemDocument(afterDocument, {
|
|
1527
|
-
format: targetItemFormat,
|
|
1528
|
-
schema: params.settings.schema,
|
|
1529
|
-
extensionFieldNames: params.extensionFieldNames
|
|
1530
|
-
});
|
|
1531
|
-
const targetItemPath = getItemPath(params.pmRoot, afterDocument.metadata.type, located.id, targetItemFormat, typeToFolder);
|
|
1532
|
-
const historyPath = getHistoryPath(params.pmRoot, located.id);
|
|
1533
|
-
const serviceWriteOverride = await runActiveServiceOverride("item_store_write", {
|
|
1534
|
-
op: params.op,
|
|
1535
|
-
pm_root: params.pmRoot,
|
|
1536
|
-
item_id: located.id,
|
|
1537
|
-
source_item_path: located.itemPath,
|
|
1538
|
-
target_item_path: targetItemPath,
|
|
1539
|
-
history_path: historyPath,
|
|
1540
|
-
item_format: targetItemFormat,
|
|
1541
|
-
before: beforeDocument,
|
|
1542
|
-
after: afterDocument,
|
|
1543
|
-
contents: serializedAfter
|
|
1544
|
-
});
|
|
1545
|
-
const { effectiveTargetItemPath, effectiveSerializedAfter, skipItemWrite } = resolveItemStoreWriteOverride(serviceWriteOverride, targetItemPath, serializedAfter);
|
|
1546
|
-
if (!skipItemWrite) {
|
|
1547
|
-
await writeFileAtomic(effectiveTargetItemPath, effectiveSerializedAfter);
|
|
1548
|
-
}
|
|
1549
|
-
if (!skipItemWrite && effectiveTargetItemPath !== located.itemPath) {
|
|
1550
|
-
await fs4.rm(located.itemPath);
|
|
1551
|
-
}
|
|
1552
|
-
const entry = createHistoryEntry({
|
|
1553
|
-
nowIso: afterDocument.metadata.updated_at,
|
|
1554
|
-
author: params.author,
|
|
1555
|
-
op: params.op,
|
|
1556
|
-
before: beforeDocument,
|
|
1557
|
-
after: afterDocument,
|
|
1558
|
-
message: params.message
|
|
1559
|
-
});
|
|
1560
|
-
try {
|
|
1561
|
-
await appendHistoryEntry(historyPath, entry);
|
|
1562
|
-
} catch (error) {
|
|
1563
|
-
await rollbackMutatedItemWrite({
|
|
1564
|
-
skipItemWrite,
|
|
1565
|
-
effectiveTargetItemPath,
|
|
1566
|
-
originalItemPath: located.itemPath,
|
|
1567
|
-
originalRaw
|
|
1568
|
-
});
|
|
1569
|
-
throw error;
|
|
1570
|
-
}
|
|
1571
|
-
const hookWarnings = [
|
|
1572
|
-
...await runActiveOnWriteHooks({
|
|
1573
|
-
path: effectiveTargetItemPath,
|
|
1574
|
-
scope: "project",
|
|
1575
|
-
op: params.op,
|
|
1576
|
-
item_id: afterDocument.metadata.id,
|
|
1577
|
-
item_type: afterDocument.metadata.type,
|
|
1578
|
-
before: beforeDocument,
|
|
1579
|
-
after: afterDocument,
|
|
1580
|
-
changed_fields: mutation.changedFields
|
|
1581
|
-
}),
|
|
1582
|
-
...await runActiveOnWriteHooks({
|
|
1583
|
-
path: historyPath,
|
|
1584
|
-
scope: "project",
|
|
1585
|
-
op: `${params.op}:history`,
|
|
1586
|
-
item_id: afterDocument.metadata.id,
|
|
1587
|
-
item_type: afterDocument.metadata.type,
|
|
1588
|
-
before: beforeDocument,
|
|
1589
|
-
after: afterDocument,
|
|
1590
|
-
changed_fields: mutation.changedFields
|
|
1591
|
-
})
|
|
1592
|
-
];
|
|
1593
|
-
recordAfterCommandAffectedItem({
|
|
1594
|
-
id: afterDocument.metadata.id,
|
|
1595
|
-
op: params.op,
|
|
1596
|
-
item_type: afterDocument.metadata.type,
|
|
1597
|
-
previous_status: beforeDocument.metadata.status,
|
|
1598
|
-
status: afterDocument.metadata.status,
|
|
1599
|
-
previous: projectAfterCommandItemSnapshot(beforeDocument.metadata, mutation.changedFields),
|
|
1600
|
-
current: projectAfterCommandItemSnapshot(afterDocument.metadata, mutation.changedFields),
|
|
1601
|
-
changed_fields: mutation.changedFields
|
|
1602
|
-
});
|
|
1603
|
-
return {
|
|
1604
|
-
item: afterDocument.metadata,
|
|
1605
|
-
body: afterDocument.body,
|
|
1606
|
-
changedFields: mutation.changedFields,
|
|
1607
|
-
warnings: [
|
|
1608
|
-
...parseWarnings,
|
|
1609
|
-
...mutation.warnings ?? [],
|
|
1610
|
-
...historyPolicy.warnings,
|
|
1611
|
-
...serviceWriteOverride.warnings,
|
|
1612
|
-
...hookWarnings
|
|
1613
|
-
]
|
|
1614
|
-
};
|
|
1615
|
-
} finally {
|
|
1616
|
-
await releaseLock();
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
async function deleteItem(params) {
|
|
1620
|
-
const prepared = await prepareLockedItem({
|
|
1621
|
-
pmRoot: params.pmRoot,
|
|
1622
|
-
settings: params.settings,
|
|
1623
|
-
id: params.id,
|
|
1624
|
-
op: "delete",
|
|
1625
|
-
author: params.author,
|
|
1626
|
-
force: params.force
|
|
1627
|
-
});
|
|
1628
|
-
const { located, originalRaw, document, warnings: parseWarnings, releaseLock } = prepared;
|
|
1629
|
-
try {
|
|
1630
|
-
const historyPolicy = await enforceHistoryStreamPolicyForItem({
|
|
1631
|
-
pmRoot: params.pmRoot,
|
|
1632
|
-
settings: params.settings,
|
|
1633
|
-
itemId: located.id,
|
|
1634
|
-
commandLabel: "delete"
|
|
1635
|
-
});
|
|
1636
|
-
const beforeDocument = canonicalDocument(document, { schema: params.settings.schema });
|
|
1637
|
-
const deletionTimestamp = nowIso();
|
|
1638
|
-
const tombstoneDocument = EMPTY_CANONICAL_DOCUMENT;
|
|
1639
|
-
const historyEntry = createHistoryEntry({
|
|
1640
|
-
nowIso: deletionTimestamp,
|
|
1641
|
-
author: params.author,
|
|
1642
|
-
op: "delete",
|
|
1643
|
-
before: beforeDocument,
|
|
1644
|
-
after: tombstoneDocument,
|
|
1645
|
-
message: params.message
|
|
1646
|
-
});
|
|
1647
|
-
const historyPath = getHistoryPath(params.pmRoot, located.id);
|
|
1648
|
-
const serviceDeleteOverride = await runActiveServiceOverride("item_store_delete", {
|
|
1649
|
-
op: "delete",
|
|
1650
|
-
pm_root: params.pmRoot,
|
|
1651
|
-
item_id: located.id,
|
|
1652
|
-
item_path: located.itemPath,
|
|
1653
|
-
history_path: historyPath,
|
|
1654
|
-
before: beforeDocument
|
|
1655
|
-
});
|
|
1656
|
-
let effectiveItemPath = located.itemPath;
|
|
1657
|
-
let skipDelete = false;
|
|
1658
|
-
if (serviceDeleteOverride.handled && typeof serviceDeleteOverride.result === "object" && serviceDeleteOverride.result !== null) {
|
|
1659
|
-
const overrideRecord = serviceDeleteOverride.result;
|
|
1660
|
-
if (typeof overrideRecord.item_path === "string" && overrideRecord.item_path.trim().length > 0) {
|
|
1661
|
-
effectiveItemPath = overrideRecord.item_path;
|
|
1662
|
-
}
|
|
1663
|
-
if (overrideRecord.skip_delete === true) {
|
|
1664
|
-
skipDelete = true;
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
if (params.dryRun === true) {
|
|
1668
|
-
return {
|
|
1669
|
-
item: beforeDocument.metadata,
|
|
1670
|
-
changedFields: ["deleted"],
|
|
1671
|
-
targetPath: effectiveItemPath,
|
|
1672
|
-
warnings: [...parseWarnings, ...historyPolicy.warnings, ...serviceDeleteOverride.warnings]
|
|
1673
|
-
};
|
|
1674
|
-
}
|
|
1675
|
-
if (!skipDelete) {
|
|
1676
|
-
await fs4.rm(effectiveItemPath);
|
|
1677
|
-
}
|
|
1678
|
-
try {
|
|
1679
|
-
await appendHistoryEntry(historyPath, historyEntry);
|
|
1680
|
-
} catch (error) {
|
|
1681
|
-
if (!skipDelete) {
|
|
1682
|
-
await writeFileAtomic(effectiveItemPath, originalRaw);
|
|
1683
|
-
}
|
|
1684
|
-
throw error;
|
|
1685
|
-
}
|
|
1686
|
-
const hookWarnings = [
|
|
1687
|
-
...await runActiveOnWriteHooks({
|
|
1688
|
-
path: effectiveItemPath,
|
|
1689
|
-
scope: "project",
|
|
1690
|
-
op: "delete",
|
|
1691
|
-
item_id: beforeDocument.metadata.id,
|
|
1692
|
-
item_type: beforeDocument.metadata.type,
|
|
1693
|
-
before: beforeDocument,
|
|
1694
|
-
after: tombstoneDocument,
|
|
1695
|
-
changed_fields: ["deleted"]
|
|
1696
|
-
}),
|
|
1697
|
-
...await runActiveOnWriteHooks({
|
|
1698
|
-
path: historyPath,
|
|
1699
|
-
scope: "project",
|
|
1700
|
-
op: "delete:history",
|
|
1701
|
-
item_id: beforeDocument.metadata.id,
|
|
1702
|
-
item_type: beforeDocument.metadata.type,
|
|
1703
|
-
before: beforeDocument,
|
|
1704
|
-
after: tombstoneDocument,
|
|
1705
|
-
changed_fields: ["deleted"]
|
|
1706
|
-
})
|
|
1707
|
-
];
|
|
1708
|
-
recordAfterCommandAffectedItem({
|
|
1709
|
-
id: beforeDocument.metadata.id,
|
|
1710
|
-
op: "delete",
|
|
1711
|
-
item_type: beforeDocument.metadata.type,
|
|
1712
|
-
previous_status: beforeDocument.metadata.status,
|
|
1713
|
-
previous: projectAfterCommandItemSnapshot(beforeDocument.metadata, Object.keys(beforeDocument.metadata)),
|
|
1714
|
-
changed_fields: ["deleted"]
|
|
1715
|
-
});
|
|
1716
|
-
return {
|
|
1717
|
-
item: beforeDocument.metadata,
|
|
1718
|
-
changedFields: ["deleted"],
|
|
1719
|
-
warnings: [...parseWarnings, ...historyPolicy.warnings, ...serviceDeleteOverride.warnings, ...hookWarnings]
|
|
1720
|
-
};
|
|
1721
|
-
} finally {
|
|
1722
|
-
await releaseLock();
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
export {
|
|
1727
|
-
collectRegisteredItemFieldNames,
|
|
1728
|
-
parseRegisteredItemFieldAssignments,
|
|
1729
|
-
applyRegisteredItemFieldDefaultsAndValidation,
|
|
1730
|
-
toItemRecord,
|
|
1731
|
-
hashDocument,
|
|
1732
|
-
hashEmptyDocument,
|
|
1733
|
-
createHistoryEntry,
|
|
1734
|
-
appendHistoryEntry,
|
|
1735
|
-
enforceHistoryStreamPolicyForItem,
|
|
1736
|
-
enforceHistoryStreamPolicyForItems,
|
|
1737
|
-
acquireLock,
|
|
1738
|
-
HEAVY_METADATA_KEYS,
|
|
1739
|
-
listAllDocumentCandidatesCached,
|
|
1740
|
-
locateItem,
|
|
1741
|
-
readLocatedItem,
|
|
1742
|
-
listAllFrontMatter,
|
|
1743
|
-
listAllFrontMatterLight,
|
|
1744
|
-
listAllFrontMatterWithBody,
|
|
1745
|
-
buildItemNotFoundError,
|
|
1746
|
-
mutateItem,
|
|
1747
|
-
deleteItem
|
|
1748
|
-
};
|
|
1749
|
-
//# sourceMappingURL=chunk-5VAA4YHR.js.map
|