@unbrained/pm-cli 2026.7.3 → 2026.7.5
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 +36 -0
- package/CONTRIBUTING.md +36 -7
- package/README.md +1 -9
- package/dist/cli/commands/calendar.d.ts +3 -2
- package/dist/cli/commands/calendar.js +5 -5
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +17 -3
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +34 -16
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +231 -345
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/copy.js +3 -3
- package/dist/cli/commands/copy.js.map +1 -1
- package/dist/cli/commands/create.d.ts +9 -59
- package/dist/cli/commands/create.js +162 -132
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +6 -0
- package/dist/cli/commands/extension/bundled-catalog.js +15 -2
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +6 -3
- package/dist/cli/commands/extension/describe.js +21 -9
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +0 -4
- package/dist/cli/commands/extension/doctor.js +3 -3
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +59 -133
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +2 -7
- package/dist/cli/commands/extension/shared.js +4 -10
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.js +33 -8
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +3 -3
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/history-compact.js +9 -18
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +9 -19
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +133 -97
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.js +3 -3
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item-filter-options.d.ts +2 -0
- package/dist/cli/commands/item-filter-options.js +2 -2
- package/dist/cli/commands/item-filter-options.js.map +1 -1
- package/dist/cli/commands/mutation-command-options.d.ts +78 -0
- package/dist/cli/commands/mutation-command-options.js +10 -0
- package/dist/cli/commands/mutation-command-options.js.map +1 -0
- package/dist/cli/commands/profile.js +3 -3
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -4
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js +3 -3
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +10 -10
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/shared-unset-fields.d.ts +19 -0
- package/dist/cli/commands/shared-unset-fields.js +31 -2
- package/dist/cli/commands/shared-unset-fields.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -59
- package/dist/cli/commands/update.js +29 -98
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +4 -4
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +107 -7
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +6 -2
- package/dist/cli/main.js +33 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +4 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/registration-helpers.js +12 -6
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +18 -0
- package/dist/cli-bundle/chunks/{activity-5YWLSPGE.js → activity-YKAKZTZ4.js} +11 -9
- package/dist/cli-bundle/chunks/{aggregate-2V2M3JZU.js → aggregate-EQX2RGB7.js} +16 -13
- package/dist/cli-bundle/chunks/{aggregate-2V2M3JZU.js.map → aggregate-EQX2RGB7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{aggregate-EK7DXML7.js → aggregate-PEGZGJXD.js} +18 -15
- package/dist/cli-bundle/chunks/{aggregate-EK7DXML7.js.map → aggregate-PEGZGJXD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-EZESUVJT.js → append-CZGUZ45Q.js} +11 -8
- package/dist/cli-bundle/chunks/{append-EZESUVJT.js.map → append-CZGUZ45Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-JFG4WQMG.js → append-NSQBCXZJ.js} +13 -10
- package/dist/cli-bundle/chunks/{append-JFG4WQMG.js.map → append-NSQBCXZJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js +1413 -0
- package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NOIEVOK5.js → chunk-3PL6LEKP.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-NOIEVOK5.js.map → chunk-3PL6LEKP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6KRFL33E.js → chunk-3U3VEWK6.js} +277 -119
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Z5F6XZXE.js → chunk-3Y4OESPP.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-Z5F6XZXE.js.map → chunk-3Y4OESPP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HB4FAT3O.js → chunk-4LRVSBO6.js} +21 -15
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-T3P7PMZP.js → chunk-4OFLJHX6.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-T3P7PMZP.js.map → chunk-4OFLJHX6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JPATY4SE.js → chunk-4QQ6PM7M.js} +45 -557
- package/dist/cli-bundle/chunks/chunk-4QQ6PM7M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6CDCWKSX.js → chunk-53BTLLAF.js} +68 -331
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4WB6S4YX.js → chunk-57C2RLW5.js} +277 -112
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PULUSQAV.js → chunk-5B3X4Y22.js} +52 -63
- package/dist/cli-bundle/chunks/{chunk-PULUSQAV.js.map → chunk-5B3X4Y22.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7LYO6S5A.js → chunk-5J2XPTAD.js} +10 -8
- package/dist/cli-bundle/chunks/{chunk-7LYO6S5A.js.map → chunk-5J2XPTAD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QCDTQCMW.js → chunk-5JE6SMYS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MHRS5FUX.js → chunk-5JZ7APJU.js} +153 -108
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KHVGM5CS.js → chunk-5VVUKE3U.js} +544 -2368
- package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RJH5VQHW.js → chunk-75U6M5ZD.js} +22 -16
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +23 -0
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZFTKYWIF.js → chunk-7EQNAZX2.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-ZFTKYWIF.js.map → chunk-7EQNAZX2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Z4DGFQDH.js → chunk-7LQKVMPA.js} +14 -4
- package/dist/cli-bundle/chunks/chunk-7LQKVMPA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ERG65A2L.js → chunk-7MDXZAZS.js} +29 -7
- package/dist/cli-bundle/chunks/chunk-7MDXZAZS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGLGI22K.js → chunk-7QH7DHUB.js} +74 -8
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JBZ2NTKX.js → chunk-7WYXBPYQ.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-JBZ2NTKX.js.map → chunk-7WYXBPYQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js +150 -0
- package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K5DT2YKM.js → chunk-ABRA3BHY.js} +18 -16
- package/dist/cli-bundle/chunks/{chunk-K5DT2YKM.js.map → chunk-ABRA3BHY.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js +47 -0
- package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7CLLC75T.js → chunk-BFVHCAOO.js} +9 -7
- package/dist/cli-bundle/chunks/{chunk-7CLLC75T.js.map → chunk-BFVHCAOO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MDHWWBNZ.js → chunk-BVEUCSH2.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-MDHWWBNZ.js.map → chunk-BVEUCSH2.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js +160 -0
- package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-T4XBKJ3F.js → chunk-D3UCE7RW.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-T4XBKJ3F.js.map → chunk-D3UCE7RW.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +275 -0
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js +634 -0
- package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AJHYQCBJ.js → chunk-DRBV5UC2.js} +8 -23
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NZ7QIUP5.js → chunk-E2FUG6GD.js} +67 -351
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4PFVUUYV.js → chunk-EEY54JMF.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-4PFVUUYV.js.map → chunk-EEY54JMF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3W2HJKJX.js → chunk-EZFKWSC7.js} +94 -16
- package/dist/cli-bundle/chunks/{chunk-3W2HJKJX.js.map → chunk-EZFKWSC7.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-F6WNBITZ.js → chunk-FDBARR33.js} +40 -19
- package/dist/cli-bundle/chunks/{chunk-F6WNBITZ.js.map → chunk-FDBARR33.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WRYERRZX.js → chunk-FGQKEDE4.js} +36 -12
- package/dist/cli-bundle/chunks/chunk-FGQKEDE4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CXR3CMBQ.js → chunk-FJRKQREY.js} +10 -18
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QNNQAAZ5.js → chunk-FUM6UMY4.js} +10 -11
- package/dist/cli-bundle/chunks/{chunk-QNNQAAZ5.js.map → chunk-FUM6UMY4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TQ6AX5SQ.js → chunk-GIWXVMZ3.js} +140 -334
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FZJM2TXF.js → chunk-HBYZDSK5.js} +19 -17
- package/dist/cli-bundle/chunks/{chunk-FZJM2TXF.js.map → chunk-HBYZDSK5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5IZUBZBR.js → chunk-HJE4JTKQ.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-5IZUBZBR.js.map → chunk-HJE4JTKQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YSDFIY7N.js → chunk-HK72NWAD.js} +89 -18
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LBE5QFMZ.js → chunk-IJ6CO3JV.js} +41 -20
- package/dist/cli-bundle/chunks/{chunk-LBE5QFMZ.js.map → chunk-IJ6CO3JV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YF746GTH.js → chunk-JFCVQXZX.js} +139 -326
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A3OQ7TFW.js → chunk-JLA7EVYV.js} +12 -10
- package/dist/cli-bundle/chunks/{chunk-A3OQ7TFW.js.map → chunk-JLA7EVYV.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +76 -0
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-32IUNTG4.js → chunk-K3AGVXSF.js} +37 -13
- package/dist/cli-bundle/chunks/chunk-K3AGVXSF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +79 -0
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-KGHH652T.js +44 -0
- package/dist/cli-bundle/chunks/chunk-KGHH652T.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +915 -0
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BI4R7HI2.js → chunk-KLG4ZULO.js} +12 -10
- package/dist/cli-bundle/chunks/{chunk-BI4R7HI2.js.map → chunk-KLG4ZULO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XRYSCRZR.js → chunk-LEKT4K7I.js} +74 -8
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-X74F2GSM.js → chunk-MNZ7DRNC.js} +13 -10
- package/dist/cli-bundle/chunks/{contracts-X74F2GSM.js.map → chunk-MNZ7DRNC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4EXFFP7T.js → chunk-MTTXDAK4.js} +206 -147
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KEZOIPCR.js → chunk-MZ7VNEVY.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-KEZOIPCR.js.map → chunk-MZ7VNEVY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5JIWFWOZ.js → chunk-N6DNM2FA.js} +2 -2
- package/dist/cli-bundle/chunks/{test-runs-QIR5MJPL.js → chunk-N7X4WP6L.js} +11 -8
- package/dist/cli-bundle/chunks/{test-runs-QIR5MJPL.js.map → chunk-N7X4WP6L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-U3S2B7TA.js → chunk-NBFCNJ7Q.js} +206 -147
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GVJE5T7Q.js → chunk-NER3KUUS.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +20 -0
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +918 -0
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YPWUSH72.js → chunk-OESSOFJ4.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-YPWUSH72.js.map → chunk-OESSOFJ4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +238 -0
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FUFFPIYA.js → chunk-OWTIRHX4.js} +28 -6
- package/dist/cli-bundle/chunks/chunk-OWTIRHX4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Z7RPDF2Y.js → chunk-P3VRG72Q.js} +10 -8
- package/dist/cli-bundle/chunks/{chunk-Z7RPDF2Y.js.map → chunk-P3VRG72Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js +1423 -0
- package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +1977 -0
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MEZZZBYX.js → chunk-PDXT6Q55.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EJ2OCBHF.js → chunk-PJ3A56YF.js} +46 -537
- package/dist/cli-bundle/chunks/chunk-PJ3A56YF.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-MG5VIGSK.js → chunk-PPAJG4GB.js} +13 -10
- package/dist/cli-bundle/chunks/{test-runs-MG5VIGSK.js.map → chunk-PPAJG4GB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-572FKBRL.js → chunk-PPE4YUQM.js} +1725 -1663
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ER4ME5U2.js → chunk-QHZO65XW.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-ER4ME5U2.js.map → chunk-QHZO65XW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T6AXEBOP.js → chunk-R3ZBLGTC.js} +9 -10
- package/dist/cli-bundle/chunks/{chunk-T6AXEBOP.js.map → chunk-R3ZBLGTC.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js +624 -0
- package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YVKZ3ANP.js → chunk-RX3HQSYG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LOWVNZBZ.js → chunk-S4APD35C.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FH2H3CBD.js → chunk-S5AYOUT5.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-FH2H3CBD.js.map → chunk-S5AYOUT5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SYE6WMV6.js → chunk-STPSZ2XY.js} +19 -744
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6NYJGMTY.js → chunk-T35XLYZF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P5L7Z2O6.js → chunk-T3ABIMGW.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-P5L7Z2O6.js.map → chunk-T3ABIMGW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SU2E4AWU.js → chunk-T3F4DF23.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-SU2E4AWU.js.map → chunk-T3F4DF23.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +272 -0
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js +5354 -0
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ECU6MMTQ.js → chunk-TSPKZRRW.js} +50 -116
- package/dist/cli-bundle/chunks/chunk-TSPKZRRW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BE2SR6QL.js → chunk-TT42JUMF.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +165 -0
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RAHINBVP.js → chunk-UI5BJ6DO.js} +1339 -1277
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +1932 -0
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +175 -0
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-B4O5S7I3.js → chunk-VUHVWI4C.js} +13 -3
- package/dist/cli-bundle/chunks/chunk-VUHVWI4C.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-L6ODXNUM.js → chunk-VZIYHZDX.js} +11 -8
- package/dist/cli-bundle/chunks/{contracts-L6ODXNUM.js.map → chunk-VZIYHZDX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-U5TR4N7J.js → chunk-WISPVC2E.js} +9 -7
- package/dist/cli-bundle/chunks/{chunk-U5TR4N7J.js.map → chunk-WISPVC2E.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HQAF23Q2.js → chunk-XQCG2JGW.js} +17 -749
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-Y76TWC45.js +550 -0
- package/dist/cli-bundle/chunks/chunk-Y76TWC45.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L4SLHV6G.js → chunk-YD5FML7K.js} +464 -2239
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YSGTMDWC.js → chunk-YFIE7YK6.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-YSGTMDWC.js.map → chunk-YFIE7YK6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WYOIIFSE.js → chunk-YMABYTNG.js} +49 -115
- package/dist/cli-bundle/chunks/chunk-YMABYTNG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SU3TB4NS.js → chunk-YOF5VPKM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WJA3PXW7.js → chunk-YPPVU5GX.js} +11 -9
- package/dist/cli-bundle/chunks/{chunk-WJA3PXW7.js.map → chunk-YPPVU5GX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GUYNUXQT.js → chunk-YQMMMONE.js} +6 -4
- package/dist/cli-bundle/chunks/{chunk-GUYNUXQT.js.map → chunk-YQMMMONE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AIKU3IIL.js → chunk-YSAH5FY5.js} +16 -14
- package/dist/cli-bundle/chunks/{chunk-AIKU3IIL.js.map → chunk-YSAH5FY5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KS6ATO47.js → chunk-YZIR4R3U.js} +153 -108
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LCWQP6NM.js → chunk-Z2CRRZYF.js} +14 -12
- package/dist/cli-bundle/chunks/{chunk-LCWQP6NM.js.map → chunk-Z2CRRZYF.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js +533 -0
- package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UMNQZS4H.js → chunk-ZCJAA3JK.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-UMNQZS4H.js.map → chunk-ZCJAA3JK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EQURFOMH.js → chunk-ZD34OFFQ.js} +5 -3
- package/dist/cli-bundle/chunks/{chunk-EQURFOMH.js.map → chunk-ZD34OFFQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-67LARBDL.js → chunk-ZJB3UV5U.js} +54 -58
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5E7N4T2Z.js → chunk-ZMD35NYG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +241 -0
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-5GU7OE67.js → claim-4DROPSIS.js} +30 -13
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-2BGBGSVI.js → claim-VX54TV5U.js} +29 -12
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-AFVKPR57.js → close-3YRR3XY6.js} +9 -7
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +16 -0
- package/dist/cli-bundle/chunks/{close-many-JKUJMHLG.js → close-many-AP4MWU36.js} +21 -18
- package/dist/cli-bundle/chunks/{close-many-JKUJMHLG.js.map → close-many-AP4MWU36.js.map} +1 -1
- package/dist/cli-bundle/chunks/{close-many-7KLOSYLP.js → close-many-OMZIGZB4.js} +19 -16
- package/dist/cli-bundle/chunks/{close-many-7KLOSYLP.js.map → close-many-OMZIGZB4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-DNWHEBOS.js → comments-MIW5MZOX.js} +12 -9
- package/dist/cli-bundle/chunks/{comments-DNWHEBOS.js.map → comments-MIW5MZOX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-RW23R3VE.js → comments-SAG5LSKL.js} +14 -11
- package/dist/cli-bundle/chunks/{comments-RW23R3VE.js.map → comments-SAG5LSKL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-AUM5WBYA.js → config-DJJKZB5R.js} +20 -17
- package/dist/cli-bundle/chunks/{config-AUM5WBYA.js.map → config-DJJKZB5R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-OZWSA2NP.js → config-V57QD47V.js} +22 -19
- package/dist/cli-bundle/chunks/{config-OZWSA2NP.js.map → config-V57QD47V.js.map} +1 -1
- package/dist/cli-bundle/chunks/{context-PKCEHQY3.js → context-4OQGIPSO.js} +15 -12
- package/dist/cli-bundle/chunks/{context-OYXRGY7S.js → context-WLA6IAWE.js} +15 -12
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +12 -0
- package/dist/cli-bundle/chunks/contracts-OJEXMKVW.js +16 -0
- package/dist/cli-bundle/chunks/{copy-I4NCLBR4.js → copy-LEE6P6EM.js} +17 -14
- package/dist/cli-bundle/chunks/{copy-I4NCLBR4.js.map → copy-LEE6P6EM.js.map} +2 -2
- package/dist/cli-bundle/chunks/{copy-6XOR3HKN.js → copy-OTJOWFL6.js} +18 -15
- package/dist/cli-bundle/chunks/{copy-6XOR3HKN.js.map → copy-OTJOWFL6.js.map} +1 -1
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +30 -0
- package/dist/cli-bundle/chunks/{create-PM45M6PE.js → create-XWWQFQ6S.js} +14 -12
- package/dist/cli-bundle/chunks/{delete-7YXHYG67.js → delete-62JQTYT4.js} +10 -7
- package/dist/cli-bundle/chunks/{delete-7YXHYG67.js.map → delete-62JQTYT4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-LPISP43T.js → delete-HQKGRNRZ.js} +12 -9
- package/dist/cli-bundle/chunks/{delete-LPISP43T.js.map → delete-HQKGRNRZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-WATKQDE3.js → deps-55FTG6Z5.js} +12 -9
- package/dist/cli-bundle/chunks/{deps-WATKQDE3.js.map → deps-55FTG6Z5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-N2T26FME.js → deps-L2FPIAD3.js} +10 -7
- package/dist/cli-bundle/chunks/{deps-N2T26FME.js.map → deps-L2FPIAD3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-6LQ3GLM7.js → docs-6CRCSVKK.js} +11 -9
- package/dist/cli-bundle/chunks/{docs-6LQ3GLM7.js.map → docs-6CRCSVKK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-Z3X6JZLT.js → docs-S6UTOTO5.js} +9 -7
- package/dist/cli-bundle/chunks/{docs-Z3X6JZLT.js.map → docs-S6UTOTO5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-6DCLG52D.js → eval-N6UHFWVO.js} +15 -11
- package/dist/cli-bundle/chunks/{eval-6DCLG52D.js.map → eval-N6UHFWVO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-Y3ZCUTHK.js → eval-PHOTWYHI.js} +17 -13
- package/dist/cli-bundle/chunks/{eval-Y3ZCUTHK.js.map → eval-PHOTWYHI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-BNINIMT7.js → extension-NBAH62ML.js} +17 -11
- package/dist/cli-bundle/chunks/{extension-QWE4YYK5.js → extension-ZF6ZZPOU.js} +17 -11
- package/dist/cli-bundle/chunks/{files-FUYPSOFJ.js → files-6P57MRKL.js} +14 -11
- package/dist/cli-bundle/chunks/files-6P57MRKL.js.map +7 -0
- package/dist/cli-bundle/chunks/{files-6SGKHS6O.js → files-JPU3FNJ7.js} +15 -12
- package/dist/cli-bundle/chunks/files-JPU3FNJ7.js.map +1 -0
- package/dist/cli-bundle/chunks/{focus-2Q3K76G2.js → focus-LFZ6IDBR.js} +15 -11
- package/dist/cli-bundle/chunks/{focus-2Q3K76G2.js.map → focus-LFZ6IDBR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-ATLBWXXD.js → focus-WNMYCVYA.js} +13 -9
- package/dist/cli-bundle/chunks/{focus-ATLBWXXD.js.map → focus-WNMYCVYA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-RUYEMNRF.js → gc-AETFKZ44.js} +10 -7
- package/dist/cli-bundle/chunks/{gc-RUYEMNRF.js.map → gc-AETFKZ44.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-TDWSDR66.js → gc-RLBP4QVN.js} +12 -9
- package/dist/cli-bundle/chunks/{gc-TDWSDR66.js.map → gc-RLBP4QVN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-LY6M2JIM.js → get-NH2MPBCI.js} +18 -15
- package/dist/cli-bundle/chunks/{get-LY6M2JIM.js.map → get-NH2MPBCI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-2WGLX74N.js → get-P4ZQXCPZ.js} +16 -13
- package/dist/cli-bundle/chunks/{get-2WGLX74N.js.map → get-P4ZQXCPZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-4RKHYS3T.js → health-3GVPMQBL.js} +36 -29
- package/dist/cli-bundle/chunks/{health-4RKHYS3T.js.map → health-3GVPMQBL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-TMFVNYRA.js → health-DNTM72GJ.js} +34 -27
- package/dist/cli-bundle/chunks/{health-TMFVNYRA.js.map → health-DNTM72GJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +20 -0
- package/dist/cli-bundle/chunks/{history-SGRRS72R.js → history-SGPYRAFT.js} +10 -8
- package/dist/cli-bundle/chunks/{history-compact-LOED43R3.js → history-compact-3F6VELO7.js} +26 -30
- package/dist/cli-bundle/chunks/history-compact-3F6VELO7.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-V5DNAQHH.js → history-compact-656Y2TN4.js} +27 -31
- package/dist/cli-bundle/chunks/history-compact-656Y2TN4.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-IRL7WJ3E.js → history-redact-54ICFKXM.js} +11 -9
- package/dist/cli-bundle/chunks/{history-repair-PGYQJMGD.js → history-repair-4N6SDVHK.js} +25 -30
- package/dist/cli-bundle/chunks/history-repair-4N6SDVHK.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-4WVBVHFR.js → history-repair-EVTO6LIH.js} +26 -31
- package/dist/cli-bundle/chunks/history-repair-EVTO6LIH.js.map +1 -0
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +32 -0
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +28 -0
- package/dist/cli-bundle/chunks/{learnings-4FJY7WIW.js → learnings-2HTPZNGZ.js} +10 -8
- package/dist/cli-bundle/chunks/{learnings-4FJY7WIW.js.map → learnings-2HTPZNGZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-4BHWFFUV.js → learnings-YBIHY3D6.js} +12 -10
- package/dist/cli-bundle/chunks/{learnings-4BHWFFUV.js.map → learnings-YBIHY3D6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{list-472TIOVK.js → list-64LHZ3HM.js} +10 -8
- package/dist/cli-bundle/chunks/{list-D7BF5CL2.js → list-7LXBTEKI.js} +10 -8
- package/dist/cli-bundle/chunks/{next-SFQZVX2B.js → next-7ODPAQ4U.js} +22 -18
- package/dist/cli-bundle/chunks/{next-SFQZVX2B.js.map → next-7ODPAQ4U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{next-D5STGWI2.js → next-ODJUM4ZM.js} +24 -20
- package/dist/cli-bundle/chunks/{next-D5STGWI2.js.map → next-ODJUM4ZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-6KNOSLIT.js → notes-72YXN5JX.js} +10 -8
- package/dist/cli-bundle/chunks/{notes-6KNOSLIT.js.map → notes-72YXN5JX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-W4UEICGF.js → notes-NJ7IQJX4.js} +12 -10
- package/dist/cli-bundle/chunks/{notes-W4UEICGF.js.map → notes-NJ7IQJX4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-MJQW5XK3.js → plan-R4NDQ27E.js} +18 -15
- package/dist/cli-bundle/chunks/{plan-MJQW5XK3.js.map → plan-R4NDQ27E.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-JO6V7BXO.js → plan-XWY5T67S.js} +20 -17
- package/dist/cli-bundle/chunks/{plan-JO6V7BXO.js.map → plan-XWY5T67S.js.map} +1 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +397 -0
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +400 -0
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-ELBHCCFI.js → register-list-query-5H66WFYF.js} +24 -21
- package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-GAPQ6DM3.js → register-list-query-FB3FNDLZ.js} +25 -22
- package/dist/cli-bundle/chunks/{register-list-query-ELBHCCFI.js.map → register-list-query-FB3FNDLZ.js.map} +1 -7
- package/dist/cli-bundle/chunks/{register-mutation-SJWMVIJ2.js → register-mutation-UJO23C7R.js} +42 -39
- package/dist/cli-bundle/chunks/{register-mutation-SJWMVIJ2.js.map → register-mutation-UJO23C7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-ROFE2YPC.js → register-mutation-Z2ETYHKS.js} +40 -37
- package/dist/cli-bundle/chunks/{register-mutation-ROFE2YPC.js.map → register-mutation-Z2ETYHKS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-MEKU3AKC.js → register-operations-A3XAM5J7.js} +39 -36
- package/dist/cli-bundle/chunks/{register-operations-MEKU3AKC.js.map → register-operations-A3XAM5J7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-IADFVH53.js → register-operations-SG7HBSUP.js} +37 -34
- package/dist/cli-bundle/chunks/{register-operations-IADFVH53.js.map → register-operations-SG7HBSUP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-AJWUSSQX.js → register-setup-I45OGJUV.js} +25 -19
- package/dist/cli-bundle/chunks/{register-setup-AJWUSSQX.js.map → register-setup-I45OGJUV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-3QJY43CY.js → register-setup-K6U3NVY5.js} +23 -17
- package/dist/cli-bundle/chunks/{register-setup-3QJY43CY.js.map → register-setup-K6U3NVY5.js.map} +1 -1
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +19 -0
- package/dist/cli-bundle/chunks/{restore-44IHMMZZ.js → restore-YJ2ET6AT.js} +11 -9
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-TSBK4AY5.js → scheduling-shortcuts-SSC4MYWQ.js} +14 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-TSBK4AY5.js.map → scheduling-shortcuts-SSC4MYWQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-OLHNLAZY.js → scheduling-shortcuts-ULRG7MNP.js} +16 -14
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-OLHNLAZY.js.map → scheduling-shortcuts-ULRG7MNP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{schema-VBCELP5G.js → schema-2PUXCZ25.js} +10 -7
- package/dist/cli-bundle/chunks/{schema-IB2NZZWD.js → schema-Y6DXXK2F.js} +10 -7
- package/dist/cli-bundle/chunks/{search-7UBETML4.js → search-3S72CTD6.js} +13 -10
- package/dist/cli-bundle/chunks/{search-R227JOL6.js → search-WNUNBQXO.js} +13 -10
- package/dist/cli-bundle/chunks/{stats-FAG7COEH.js → stats-IJYTRQGV.js} +13 -10
- package/dist/cli-bundle/chunks/{stats-FAG7COEH.js.map → stats-IJYTRQGV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{stats-MCK7PLYS.js → stats-L2D5Y2O5.js} +15 -12
- package/dist/cli-bundle/chunks/{stats-MCK7PLYS.js.map → stats-L2D5Y2O5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{telemetry-DRPDZMAO.js → telemetry-L2CVOKVN.js} +11 -8
- package/dist/cli-bundle/chunks/{telemetry-DRPDZMAO.js.map → telemetry-L2CVOKVN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{telemetry-GVVUQSJQ.js → telemetry-QBYWQA76.js} +13 -10
- package/dist/cli-bundle/chunks/{telemetry-GVVUQSJQ.js.map → telemetry-QBYWQA76.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-QY44WAMR.js → test-DQ2QFJ7W.js} +21 -15
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +41 -0
- package/dist/cli-bundle/chunks/{test-all-USPJHXFR.js → test-all-636NTRTT.js} +26 -19
- package/dist/cli-bundle/chunks/{test-all-USPJHXFR.js.map → test-all-636NTRTT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-QD6QAEG7.js → test-all-DWYK3RG6.js} +24 -17
- package/dist/cli-bundle/chunks/{test-all-QD6QAEG7.js.map → test-all-DWYK3RG6.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +28 -0
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +24 -0
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js.map +7 -0
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +30 -0
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js.map +1 -0
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +26 -0
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-RATAARHU.js → update-many-DC7X3EWM.js} +32 -29
- package/dist/cli-bundle/chunks/{update-many-RATAARHU.js.map → update-many-DC7X3EWM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-BEMTDA2X.js → update-many-SLLAMHT7.js} +34 -31
- package/dist/cli-bundle/chunks/{update-many-BEMTDA2X.js.map → update-many-SLLAMHT7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-VU46BLJZ.js → upgrade-HFFXLZJA.js} +19 -12
- package/dist/cli-bundle/chunks/{upgrade-VU46BLJZ.js.map → upgrade-HFFXLZJA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-NWMR3VQL.js → upgrade-UYQKM7RF.js} +21 -14
- package/dist/cli-bundle/chunks/{upgrade-NWMR3VQL.js.map → upgrade-UYQKM7RF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-NRY6MFXN.js → validate-PA4FDTOV.js} +35 -28
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-GAJ6FUSI.js → validate-Z7L75YEJ.js} +35 -28
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +1 -0
- package/dist/cli-bundle/main.js +173 -57
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +247 -0
- package/dist/cli-bundle/sdk-runtime.js.map +7 -0
- package/dist/cli-bundle/sdk-testing.js +101 -0
- package/dist/cli-bundle/sdk-testing.js.map +7 -0
- package/dist/cli-bundle/sdk.js +787 -0
- package/dist/cli-bundle/sdk.js.map +7 -0
- package/dist/core/config/nested-settings.d.ts +4 -3
- package/dist/core/config/nested-settings.js +17 -6
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/extensions/activation-summary.d.ts +6 -0
- package/dist/core/extensions/activation-summary.js +10 -4
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +6 -0
- package/dist/core/extensions/capability-usage.js +10 -4
- package/dist/core/extensions/capability-usage.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +6 -2
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +3 -0
- package/dist/core/extensions/loader.js +11 -19
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/history-rewrite.d.ts +10 -0
- package/dist/core/history/history-rewrite.js +28 -4
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/item/parent-reference-policy.d.ts +9 -1
- package/dist/core/item/parent-reference-policy.js +28 -4
- package/dist/core/item/parent-reference-policy.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +153 -177
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock.d.ts +28 -1
- package/dist/core/lock/lock.js +254 -20
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/search/background-refresh.js +7 -19
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/http-client.d.ts +0 -1
- package/dist/core/search/http-client.js +3 -3
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/shared/constants.js +3 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +1 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +12 -0
- package/dist/core/shared/primitives.js +29 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/store/item-store.js +3 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +6 -3
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +3 -3
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/validate/fix-planning.d.ts +0 -2
- package/dist/core/validate/fix-planning.js +3 -3
- package/dist/core/validate/fix-planning.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +55 -94
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/errors.d.ts +21 -2
- package/dist/sdk/errors.js +8 -2
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +90 -2
- package/dist/sdk/package-import-adapters.js +275 -3
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +3 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/testing.js +41 -19
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +27 -0
- package/docs/CONFIGURATION.md +3 -0
- package/docs/README.md +1 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +55 -0
- package/docs/TESTING.md +5 -1
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +5 -5
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +1 -1
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +1 -1
- package/package.json +14 -26
- package/packages/pm-beads/extensions/beads/package.json +3 -0
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +50 -41
- package/packages/pm-beads/extensions/beads/runtime.ts +106 -223
- package/packages/pm-calendar/extensions/calendar/package.json +3 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +21 -18
- package/packages/pm-command-kit/extensions/command-kit/package.json +3 -0
- package/packages/pm-governance-audit/extensions/governance-audit/package.json +3 -0
- package/packages/pm-guide-shell/extensions/guide-shell/package.json +3 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +9 -11
- package/packages/pm-kanban/extensions/kanban/package.json +3 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/package.json +3 -0
- package/packages/pm-search-advanced/extensions/search-advanced/package.json +3 -0
- package/packages/pm-templates/extensions/templates/package.json +3 -0
- package/packages/pm-todos/extensions/todos/package.json +3 -0
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +62 -72
- package/packages/pm-todos/extensions/todos/runtime.ts +61 -257
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +73 -31
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +80 -34
- package/scripts/bundle-cli.mjs +12 -2
- package/scripts/install.ps1 +7 -7
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +0 -16
- package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6CDCWKSX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B4O5S7I3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ERG65A2L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FUFFPIYA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NZ7QIUP5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGLGI22K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TQ6AX5SQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XRYSCRZR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YF746GTH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YSDFIY7N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z4DGFQDH.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-2BGBGSVI.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-5GU7OE67.js.map +0 -1
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +0 -14
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +0 -28
- package/dist/cli-bundle/chunks/files-6SGKHS6O.js.map +0 -1
- package/dist/cli-bundle/chunks/files-FUYPSOFJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +0 -7
- package/dist/cli-bundle/chunks/init-4GESW7RM.js +0 -26
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +0 -22
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js +0 -1243
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js +0 -1205
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +0 -17
- package/dist/cli-bundle/chunks/test-SY76DZTO.js +0 -35
- package/dist/cli-bundle/chunks/update-A7EICML6.js +0 -24
- package/dist/cli-bundle/chunks/update-IKJZWLQC.js +0 -28
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-BIML7K2D.js.map → activity-4XQIDNM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-5YWLSPGE.js.map → activity-YKAKZTZ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCDTQCMW.js.map → chunk-5JE6SMYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JIWFWOZ.js.map → chunk-N6DNM2FA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GVJE5T7Q.js.map → chunk-NER3KUUS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MEZZZBYX.js.map → chunk-PDXT6Q55.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YVKZ3ANP.js.map → chunk-RX3HQSYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LOWVNZBZ.js.map → chunk-S4APD35C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6NYJGMTY.js.map → chunk-T35XLYZF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BE2SR6QL.js.map → chunk-TT42JUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SU3TB4NS.js.map → chunk-YOF5VPKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5E7N4T2Z.js.map → chunk-ZMD35NYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-AFVKPR57.js.map → close-3YRR3XY6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-6YODBUIV.js.map → close-OB2Y4QP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-PKCEHQY3.js.map → context-4OQGIPSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-OYXRGY7S.js.map → context-WLA6IAWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-Z7YCH3BE.js.map → contracts-HXJLKCRI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-PM45M6PE.js.map → contracts-OJEXMKVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-BNINIMT7.js.map → create-WKOZKPQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-QWE4YYK5.js.map → create-XWWQFQ6S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-CGNQJXFE.js.map → extension-NBAH62ML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SGRRS72R.js.map → extension-ZF6ZZPOU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-N3JK7VBW.js.map → history-RYKLC72X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IRL7WJ3E.js.map → history-SGPYRAFT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-XIDPABA4.js.map → history-redact-4H3FCKF3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-4GESW7RM.js.map → history-redact-54ICFKXM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-D7BF5CL2.js.map → init-RPIPQUNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-472TIOVK.js.map → init-SKQAESQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-EXHU34EU.js.map → list-64LHZ3HM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-44IHMMZZ.js.map → list-7LXBTEKI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-VBCELP5G.js.map → restore-PXOFL6AM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-IB2NZZWD.js.map → restore-YJ2ET6AT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-R227JOL6.js.map → schema-2PUXCZ25.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-7UBETML4.js.map → schema-Y6DXXK2F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-QY44WAMR.js.map → search-3S72CTD6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-SY76DZTO.js.map → search-WNUNBQXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-IKJZWLQC.js.map → test-DQ2QFJ7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-A7EICML6.js.map → test-W7QBLVJS.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/schema/runtime-field-values.ts","../../../../../../../../core/item/item-format-version.ts","../../../../../../../../core/item/status.ts","../../../../../../../../core/shared/conflict-markers.ts","../../../../../../../../core/item/item-format.ts","../../../../../../../../core/item/toon-decode.ts"],"sourcesContent":["/**\n * @module core/schema/runtime-field-values\n *\n * Resolves configurable schema, fields, statuses, and workflows for Runtime Field Values.\n */\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { runtimeFieldOptionTarget, type RuntimeFieldDefinitionResolved, type RuntimeFieldRegistry } from \"./runtime-schema.js\";\n\nfunction toCamelToken(value: string): string {\n const segments = value\n .trim()\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return value;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction resolveCandidateOptionKeys(definition: RuntimeFieldDefinitionResolved): string[] {\n return [...new Set([\n runtimeFieldOptionTarget(definition),\n toCamelToken(definition.key),\n toCamelToken(definition.cli_flag),\n ...definition.cli_aliases.map((alias) => toCamelToken(alias)),\n ])];\n}\n\n/**\n * Implements read runtime field option value for the public runtime surface of this module.\n */\nexport function readRuntimeFieldOptionValue(\n options: Record<string, unknown>,\n definition: RuntimeFieldDefinitionResolved,\n): unknown {\n for (const candidateKey of resolveCandidateOptionKeys(definition)) {\n if (!Object.hasOwn(options, candidateKey)) {\n continue;\n }\n const value = options[candidateKey];\n if (value !== undefined) {\n return value;\n }\n }\n return undefined;\n}\n\nfunction normalizeStringArrayValue(value: unknown): string[] {\n if (Array.isArray(value)) {\n return value\n .flatMap((entry) => normalizeStringArrayValue(entry))\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (typeof value === \"string\") {\n return value\n .split(/[,\\n|]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n }\n if (value === undefined || value === null) {\n return [];\n }\n return [String(value).trim()].filter((entry) => entry.length > 0);\n}\n\nfunction parseBooleanValue(raw: unknown, label: string): boolean {\n if (typeof raw === \"boolean\") {\n return raw;\n }\n if (typeof raw === \"number\") {\n if (raw === 1) {\n return true;\n }\n if (raw === 0) {\n return false;\n }\n }\n if (typeof raw === \"string\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n }\n throw new PmCliError(`${label} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\nfunction parseNumberValue(raw: unknown, label: string): number {\n if (typeof raw === \"number\" && Number.isFinite(raw)) {\n return raw;\n }\n const candidate = typeof raw === \"string\" ? raw.trim() : String(raw);\n const parsed = Number(candidate);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`${label} must be a number`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements coerce runtime field value for the public runtime surface of this module.\n */\nexport function coerceRuntimeFieldValue(\n definition: RuntimeFieldDefinitionResolved,\n rawValue: unknown,\n labelOverride?: string,\n): unknown {\n const label = labelOverride ?? `--${definition.cli_flag}`;\n if (definition.repeatable || definition.type === \"string_array\") {\n const values = normalizeStringArrayValue(rawValue);\n if (definition.type === \"number\") {\n return values.map((value) => parseNumberValue(value, label));\n }\n if (definition.type === \"boolean\") {\n return values.map((value) => parseBooleanValue(value, label));\n }\n return values;\n }\n\n const scalarRaw = Array.isArray(rawValue) ? rawValue[rawValue.length - 1] : rawValue;\n if (scalarRaw === undefined) {\n return undefined;\n }\n if (definition.type === \"number\") {\n return parseNumberValue(scalarRaw, label);\n }\n if (definition.type === \"boolean\") {\n return parseBooleanValue(scalarRaw, label);\n }\n return typeof scalarRaw === \"string\" ? scalarRaw : String(scalarRaw);\n}\n\nfunction shouldRequireFieldOnCreate(definition: RuntimeFieldDefinitionResolved, itemTypeName: string | undefined): boolean {\n if (!definition.required && !definition.required_on_create) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n if (!itemTypeName) {\n return false;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(itemTypeName.trim().toLowerCase());\n}\n\n/**\n * Implements collect runtime create field values for the public runtime surface of this module.\n */\nexport function collectRuntimeCreateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n itemTypeName: string | undefined,\n): { values: Record<string, unknown>; missing_required_flags: string[] } {\n const values: Record<string, unknown> = {};\n const missingRequiredFlags: string[] = [];\n for (const definition of fieldRegistry.command_to_fields.get(\"create\") ?? []) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n if (shouldRequireFieldOnCreate(definition, itemTypeName)) {\n missingRequiredFlags.push(`--${definition.cli_flag}`);\n }\n continue;\n }\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return {\n values,\n missing_required_flags: [...new Set(missingRequiredFlags)].sort((left, right) => left.localeCompare(right)),\n };\n}\n\n/**\n * Implements collect runtime update field values for the public runtime surface of this module.\n */\nexport function collectRuntimeUpdateFieldValues(\n options: Record<string, unknown>,\n fieldRegistry: RuntimeFieldRegistry,\n commands: Array<\"update\" | \"update_many\"> | null | undefined = [\"update\"],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n const definitions = (commands ?? [\"update\"]).flatMap((command) => fieldRegistry.command_to_fields.get(command) ?? []);\n const seen = new Set<string>();\n for (const definition of definitions) {\n const rawValue = readRuntimeFieldOptionValue(options, definition);\n if (rawValue === undefined) {\n continue;\n }\n if (seen.has(definition.metadata_key)) {\n continue;\n }\n seen.add(definition.metadata_key);\n values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);\n }\n return values;\n}\n","/**\n * @module core/item/item-format-version\n *\n * Tracks the on-disk item front-matter format version so a future breaking\n * storage change can tell already-current items apart from items that a staged\n * migration must rewrite, without re-parsing and structurally guessing every\n * file. The version is an explicit, monotonically increasing integer stamped in\n * front-matter as `pm_format_version`.\n *\n * Token economy is a first-class constraint here: the baseline version (1) is\n * the implicit default and is never serialized, so today's corpus gains zero\n * bytes and zero churn. The field only materializes once an item reaches\n * version 2 or higher. Absence of the field is therefore always interpreted as\n * the baseline version, both now and after future bumps. The classification\n * helpers below power the advisory `pm health` integrity surface and the\n * `pm validate` format-version check.\n */\nimport type { ItemMetadata } from \"../../types/index.js\";\n\n/**\n * The original (and implicit) item front-matter format version. Items missing a\n * `pm_format_version` field are always treated as this version, so the baseline\n * is never written to disk and adds no per-item token cost.\n */\nexport const BASELINE_ITEM_FORMAT_VERSION = 1;\n\n/**\n * The format version this runtime writes and considers current. When a breaking\n * front-matter change ships, bump this constant and add a migration that\n * rewrites items whose {@link effectiveItemFormatVersion} is lower; items at or\n * above it need no migration. It stays equal to\n * {@link BASELINE_ITEM_FORMAT_VERSION} until the first such change.\n */\nexport const CURRENT_ITEM_FORMAT_VERSION = 1;\n\n/**\n * Resolve the format version an item is effectively stored at. A present,\n * positive-integer `pm_format_version` is taken verbatim (including versions\n * ahead of this runtime, so they can be flagged rather than silently clamped);\n * an absent, malformed, or sub-baseline value resolves to\n * {@link BASELINE_ITEM_FORMAT_VERSION}.\n */\nexport function effectiveItemFormatVersion(metadata: Pick<ItemMetadata, \"pm_format_version\">): number {\n const raw = metadata.pm_format_version;\n if (typeof raw === \"number\" && Number.isInteger(raw) && raw >= BASELINE_ITEM_FORMAT_VERSION) {\n return raw;\n }\n return BASELINE_ITEM_FORMAT_VERSION;\n}\n\n/**\n * Reduce an item's `pm_format_version` to its persisted form: the baseline\n * version (and any malformed or sub-baseline value) is dropped so it is never\n * serialized, while versions at or above {@link BASELINE_ITEM_FORMAT_VERSION}\n * plus one are preserved verbatim. This keeps the field absent for the entire\n * current corpus and only writes it once an item genuinely advances past the\n * implicit baseline.\n */\nexport function normalizeItemFormatVersion(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isInteger(value) || value <= BASELINE_ITEM_FORMAT_VERSION) {\n return undefined;\n }\n return value;\n}\n\n/**\n * Relationship between an item's stored format version and the runtime's\n * current version: `outdated` (below current, a migration would rewrite it),\n * `ahead` (above current, written by a newer pm than this one), or `current`.\n */\nexport type ItemFormatVersionStatus = \"current\" | \"outdated\" | \"ahead\";\n\n/**\n * Classify a single stored format version against the runtime's current\n * version. Defaults to {@link CURRENT_ITEM_FORMAT_VERSION}; the `current`\n * parameter exists so callers (and tests) can evaluate against a hypothetical\n * future version without mutating the module constant.\n */\nexport function classifyItemFormatVersion(\n version: number,\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionStatus {\n if (version < current) {\n return \"outdated\";\n }\n if (version > current) {\n return \"ahead\";\n }\n return \"current\";\n}\n\n/**\n * One item's reference (id or relative path) paired with the format version it\n * is stored at, used as input to {@link scanItemFormatVersions}.\n */\nexport interface ItemFormatVersionScanEntry {\n ref: string;\n version: number;\n}\n\n/**\n * Sorted references partitioned by how their stored format version compares to\n * the runtime's current version. References at the current version are omitted\n * from both lists.\n */\nexport interface ItemFormatVersionScanResult {\n outdated: string[];\n ahead: string[];\n}\n\n/**\n * Partition a set of items by format version into `outdated` (need migration)\n * and `ahead` (written by a newer pm) reference lists, each sorted for stable\n * diagnostics. Pushing all comparison branches into this pure, exhaustively\n * tested helper lets `pm health` and `pm validate` emit findings by iterating\n * the result lists, with no version-comparison branching of their own.\n */\nexport function scanItemFormatVersions(\n entries: readonly ItemFormatVersionScanEntry[],\n current: number = CURRENT_ITEM_FORMAT_VERSION,\n): ItemFormatVersionScanResult {\n const outdated: string[] = [];\n const ahead: string[] = [];\n for (const entry of entries) {\n const status = classifyItemFormatVersion(entry.version, current);\n if (status === \"outdated\") {\n outdated.push(entry.ref);\n } else if (status === \"ahead\") {\n ahead.push(entry.ref);\n }\n }\n return {\n outdated: outdated.sort((left, right) => left.localeCompare(right)),\n ahead: ahead.sort((left, right) => left.localeCompare(right)),\n };\n}\n","/**\n * @module core/item/status\n *\n * Defines item parsing, formatting, and lifecycle helpers for Status.\n */\nimport { STATUS_VALUES } from \"../../types/index.js\";\nimport type { ItemStatus } from \"../../types/index.js\";\nimport { normalizeStatusInputWithRegistry, type RuntimeStatusRegistry } from \"../schema/runtime-schema.js\";\n\nconst STATUS_ALIAS_MAP: Readonly<Record<string, ItemStatus>> = {\n \"in-progress\": \"in_progress\",\n cancelled: \"canceled\",\n};\n\n/**\n * Implements normalize status input for the public runtime surface of this module.\n */\nexport function normalizeStatusInput(value: unknown, registry?: RuntimeStatusRegistry): ItemStatus | undefined {\n if (registry) {\n const normalizedFromRegistry = normalizeStatusInputWithRegistry(value, registry);\n if (normalizedFromRegistry) {\n return normalizedFromRegistry;\n }\n }\n if (typeof value !== \"string\") {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (!normalized) {\n return undefined;\n }\n const canonical = STATUS_ALIAS_MAP[normalized] ?? normalized;\n if (!(STATUS_VALUES as readonly string[]).includes(canonical)) {\n return undefined;\n }\n return canonical as ItemStatus;\n}\n\n/**\n * Normalize a status against the runtime registry, falling back to the original\n * value when normalization does not resolve to a known status. This preserves\n * the long-standing `normalizeStatusInput(status, registry) ?? status` pattern\n * used by query commands so that unknown/custom statuses still compare against\n * registry sets by their raw value.\n */\nexport function normalizeStatusForRegistry(status: ItemStatus, registry: RuntimeStatusRegistry): ItemStatus {\n return normalizeStatusInput(status, registry) ?? status;\n}\n\n/**\n * Determine whether a status is terminal according to the runtime status\n * registry, applying registry-aware normalization first (with raw fallback).\n */\nexport function isTerminalStatus(status: ItemStatus, registry: RuntimeStatusRegistry): boolean {\n return registry.terminal_statuses.has(normalizeStatusForRegistry(status, registry));\n}\n","/**\n * @module core/shared/conflict-markers\n *\n * Provides shared primitives and utilities for Conflict Markers.\n */\n/**\n * Describes a detected unresolved merge-conflict marker and its source location.\n */\nexport interface ConflictMarkerMatch {\n line: number;\n marker: \"<<<<<<<\" | \"=======\" | \">>>>>>>\";\n text: string;\n}\n\nconst CONFLICT_MARKER_PATTERN = /^\\s*(<<<<<<<|=======|>>>>>>>)(?:\\s.*)?$/;\n\n/**\n * Implements find merge conflict markers for the public runtime surface of this module.\n */\nexport function findMergeConflictMarkers(content: string): ConflictMarkerMatch[] {\n if (content.length === 0) {\n return [];\n }\n const lines = content.split(/\\r?\\n/);\n const matches: ConflictMarkerMatch[] = [];\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index] ?? \"\";\n const markerMatch = line.match(CONFLICT_MARKER_PATTERN);\n if (!markerMatch) {\n continue;\n }\n const marker = markerMatch[1] as ConflictMarkerMatch[\"marker\"];\n matches.push({\n line: index + 1,\n marker,\n text: line,\n });\n }\n return matches;\n}\n\n/**\n * Implements find first merge conflict marker for the public runtime surface of this module.\n */\nexport function findFirstMergeConflictMarker(content: string): ConflictMarkerMatch | undefined {\n const matches = findMergeConflictMarkers(content);\n return matches[0];\n}\n","/**\n * @module core/item/item-format\n *\n * Defines item parsing, formatting, and lifecycle helpers for Item Format.\n */\nimport { encode as encodeToon } from \"@toon-format/toon\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n RuntimeSchemaSettings,\n ItemTestRunSummary,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PlanDecision,\n PlanDiscovery,\n PlanStep,\n PlanStepDoc,\n PlanStepFile,\n PlanStepLink,\n PlanStepStatus,\n PlanValidationCheck,\n RecurrenceRule,\n Reminder,\n} from \"../../types/index.js\";\nimport type { ItemFormat } from \"../../types/index.js\";\nimport {\n CONFIDENCE_TEXT_VALUES,\n ISSUE_SEVERITY_VALUES,\n PLAN_STEP_STATUS_VALUES,\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n STATUS_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport { coerceRuntimeFieldValue } from \"../schema/runtime-field-values.js\";\nimport {\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../schema/runtime-schema.js\";\nimport { BASELINE_ITEM_FORMAT_VERSION, normalizeItemFormatVersion } from \"./item-format-version.js\";\nimport { normalizeStatusInput } from \"./status.js\";\nimport { decodeToonItemContent } from \"./toon-decode.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../shared/conflict-markers.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { orderObject } from \"../shared/serialization.js\";\nimport { compareTimestampStrings, isTimestampLiteral } from \"../shared/time.js\";\n\nconst LINKED_TEST_PM_CONTEXT_MODE_VALUES = new Set([\"schema\", \"tracker\", \"auto\"]);\nconst ITEM_TEST_RUN_STATUS_VALUES = new Set([\"passed\", \"failed\", \"stopped\", \"canceled\"]);\nconst PLAN_STEP_STATUS_SET = new Set<string>(PLAN_STEP_STATUS_VALUES);\n\nfunction normalizePathValue(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction firstNonZeroComparison(comparisons: readonly number[]): number {\n for (const comparison of comparisons) {\n if (comparison !== 0) {\n return comparison;\n }\n }\n return 0;\n}\n\nfunction deleteUndefinedFields(record: Record<string, unknown>): void {\n for (const [key, value] of Object.entries(record)) {\n if (value === undefined) {\n delete record[key];\n }\n }\n}\n\nconst REQUIRED_STRING_FIELDS = [\n \"id\",\n \"title\",\n \"description\",\n \"created_at\",\n \"updated_at\",\n] as const;\n\nconst STATIC_FRONT_MATTER_FIELD_SET = new Set(FRONT_MATTER_KEY_ORDER);\n\ninterface RuntimeSchemaValidationContext {\n statusRegistry?: RuntimeStatusRegistry;\n fieldRegistry?: RuntimeFieldRegistry;\n unknownFieldPolicy: \"allow\" | \"warn\" | \"reject\";\n extensionFieldNames: ReadonlySet<string>;\n onWarning?: (warning: string) => void;\n}\n\n/**\n * Documents the item document format options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ItemDocumentFormatOptions {\n format?: ItemFormat;\n schema?: RuntimeSchemaSettings;\n extensionFieldNames?: readonly string[];\n onWarning?: (warning: string) => void;\n}\n\nfunction resolveRuntimeSchemaValidationContext(\n options: ItemDocumentFormatOptions | undefined,\n): RuntimeSchemaValidationContext | undefined {\n if (!options?.schema) {\n return undefined;\n }\n return {\n statusRegistry: resolveRuntimeStatusRegistry(options.schema),\n fieldRegistry: resolveRuntimeFieldRegistry(options.schema),\n unknownFieldPolicy: options.schema.unknown_field_policy ?? \"allow\",\n extensionFieldNames: new Set(options.extensionFieldNames ?? []),\n onWarning: options.onWarning,\n };\n}\n\nfunction runtimeFieldRequiredForType(definition: RuntimeFieldRegistry[\"definitions\"][number], typeName: string): boolean {\n if (!definition.required) {\n return false;\n }\n if (definition.required_types.length === 0) {\n return true;\n }\n return definition.required_types.map((value) => value.toLowerCase()).includes(typeName.trim().toLowerCase());\n}\n\nfunction validationError(message: string): never {\n throw new PmCliError(`Invalid item front matter: ${message}`, EXIT_CODE.GENERIC_FAILURE);\n}\n\nfunction buildKnownFrontMatterKeys(runtimeContext: RuntimeSchemaValidationContext): Set<string> {\n const knownKeys = new Set(STATIC_FRONT_MATTER_FIELD_SET);\n for (const definition of runtimeContext.fieldRegistry?.definitions ?? []) {\n knownKeys.add(definition.metadata_key);\n }\n for (const fieldName of runtimeContext.extensionFieldNames) {\n knownKeys.add(fieldName);\n }\n return knownKeys;\n}\n\nfunction assertFrontMatterCondition(condition: boolean, message: string): void {\n if (!condition) {\n validationError(message);\n }\n}\n\nfunction assertTimestampField(record: Record<string, unknown>, fieldName: \"created_at\" | \"updated_at\" | \"deadline\"): void {\n const rawValue = record[fieldName];\n assertFrontMatterCondition(typeof rawValue === \"string\", `${fieldName} must be a string`);\n const timestamp = rawValue as string;\n assertFrontMatterCondition(isTimestampLiteral(timestamp), `${fieldName} must be a valid ISO timestamp`);\n}\n\nfunction assertPositiveIntegerField(\n record: Record<string, unknown>,\n fieldName: string,\n messagePrefix: string,\n): void {\n const value = record[fieldName];\n if (value === undefined) {\n return;\n }\n assertFrontMatterCondition(\n typeof value === \"number\" && Number.isInteger(value) && value >= 1,\n `${messagePrefix} must be an integer >= 1`,\n );\n}\n\nfunction assertOptionalTimestampString(record: Record<string, unknown>, fieldName: string, messagePrefix: string): void {\n const value = record[fieldName];\n if (value === undefined) {\n return;\n }\n assertFrontMatterCondition(typeof value === \"string\", `${messagePrefix} must be a string`);\n assertFrontMatterCondition(isTimestampLiteral(value as string), `${messagePrefix} must be a valid ISO timestamp`);\n}\n\nfunction assertRecurrenceWeekdays(value: unknown): void {\n if (value === undefined) {\n return;\n }\n assertFrontMatterCondition(Array.isArray(value), \"event.recurrence.by_weekday must be an array\");\n for (const weekday of value as unknown[]) {\n assertFrontMatterCondition(typeof weekday === \"string\", \"event.recurrence.by_weekday entries must be strings\");\n const normalizedWeekday = (weekday as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_WEEKDAY_VALUES.includes(normalizedWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n `event.recurrence.by_weekday entries must be one of: ${RECURRENCE_WEEKDAY_VALUES.join(\", \")}`,\n );\n }\n}\n\nfunction assertRecurrenceMonthDays(value: unknown): void {\n if (value === undefined) {\n return;\n }\n assertFrontMatterCondition(Array.isArray(value), \"event.recurrence.by_month_day must be an array\");\n for (const day of value as unknown[]) {\n assertFrontMatterCondition(\n typeof day === \"number\" && Number.isInteger(day) && day >= 1 && day <= 31,\n \"event.recurrence.by_month_day entries must be integers 1..31\",\n );\n }\n}\n\nfunction assertRecurrenceExdates(value: unknown): void {\n if (value === undefined) {\n return;\n }\n assertFrontMatterCondition(Array.isArray(value), \"event.recurrence.exdates must be an array\");\n for (const exdate of value as unknown[]) {\n assertFrontMatterCondition(typeof exdate === \"string\", \"event.recurrence.exdates entries must be strings\");\n assertFrontMatterCondition(isTimestampLiteral(exdate as string), \"event.recurrence.exdates entries must be valid ISO timestamps\");\n }\n}\n\nfunction assertValidRecurrenceRule(recurrence: unknown): void {\n assertFrontMatterCondition(\n typeof recurrence === \"object\" && recurrence !== null && !Array.isArray(recurrence),\n \"event.recurrence must be an object\",\n );\n const recurrenceRecord = recurrence as Record<string, unknown>;\n assertFrontMatterCondition(typeof recurrenceRecord.freq === \"string\", \"event.recurrence.freq must be a string\");\n const frequency = (recurrenceRecord.freq as string).trim().toLowerCase();\n assertFrontMatterCondition(\n RECURRENCE_FREQUENCY_VALUES.includes(frequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number]),\n `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(\", \")}`,\n );\n\n assertPositiveIntegerField(recurrenceRecord, \"interval\", \"event.recurrence.interval\");\n assertPositiveIntegerField(recurrenceRecord, \"count\", \"event.recurrence.count\");\n assertOptionalTimestampString(recurrenceRecord, \"until\", \"event.recurrence.until\");\n assertRecurrenceWeekdays(recurrenceRecord.by_weekday);\n assertRecurrenceMonthDays(recurrenceRecord.by_month_day);\n assertRecurrenceExdates(recurrenceRecord.exdates);\n}\n\nfunction assertRequiredFrontMatterFields(record: Record<string, unknown>): string {\n for (const fieldName of REQUIRED_STRING_FIELDS) {\n assertFrontMatterCondition(typeof record[fieldName] === \"string\", `${fieldName} is required and must be a string`);\n }\n\n const itemType = record.type;\n assertFrontMatterCondition(typeof itemType === \"string\" && itemType.trim().length > 0, \"type must be a non-empty string\");\n\n const formatVersion = record.pm_format_version;\n if (formatVersion !== undefined) {\n assertFrontMatterCondition(\n typeof formatVersion === \"number\" && Number.isInteger(formatVersion) && formatVersion >= BASELINE_ITEM_FORMAT_VERSION,\n `pm_format_version must be an integer >= ${BASELINE_ITEM_FORMAT_VERSION}`,\n );\n }\n return itemType as string;\n}\n\nfunction assertStatusFrontMatterField(record: Record<string, unknown>, runtimeContext?: RuntimeSchemaValidationContext): void {\n const status = record.status;\n assertFrontMatterCondition(\n typeof status === \"string\" && status.trim().length > 0,\n \"status must be a non-empty string\",\n );\n const statusRegistry = runtimeContext?.statusRegistry;\n const normalizedStatus = normalizeStatusInput(status as string, statusRegistry);\n const statusDomain = statusRegistry\n ? statusRegistry.definitions.map((definition) => definition.id)\n : [...STATUS_VALUES];\n assertFrontMatterCondition(normalizedStatus !== undefined, `status must be one of: ${statusDomain.join(\", \")}`);\n}\n\nfunction assertPriorityAndTags(record: Record<string, unknown>): void {\n const priority = record.priority;\n assertFrontMatterCondition(\n typeof priority === \"number\" && Number.isInteger(priority) && [0, 1, 2, 3, 4].includes(priority),\n \"priority must be an integer 0..4\",\n );\n\n const tags = record.tags;\n assertFrontMatterCondition(Array.isArray(tags), \"tags must be an array\");\n for (const tag of tags as unknown[]) {\n assertFrontMatterCondition(typeof tag === \"string\", \"tags entries must be strings\");\n }\n}\n\nfunction assertConfidenceFrontMatterField(record: Record<string, unknown>): void {\n const confidence = record.confidence;\n if (confidence === undefined) {\n return;\n }\n if (typeof confidence === \"number\") {\n assertFrontMatterCondition(\n Number.isInteger(confidence) && confidence >= 0 && confidence <= 100,\n \"confidence number value must be an integer 0..100\",\n );\n return;\n }\n if (typeof confidence === \"string\") {\n const normalizedConfidence = confidence.trim().toLowerCase();\n const isKnownTextConfidence =\n normalizedConfidence === \"med\" || CONFIDENCE_TEXT_VALUES.includes(normalizedConfidence as (typeof CONFIDENCE_TEXT_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownTextConfidence,\n `confidence string value must be one of: ${[...CONFIDENCE_TEXT_VALUES, \"med\"].join(\", \")}`,\n );\n return;\n }\n assertFrontMatterCondition(false, \"confidence must be a number or string\");\n}\n\nfunction assertSeverityFrontMatterField(record: Record<string, unknown>): void {\n const severity = record.severity;\n if (severity === undefined) {\n return;\n }\n if (typeof severity !== \"string\") {\n validationError(\"severity must be a string\");\n }\n const normalizedSeverity = severity.trim().toLowerCase();\n const isKnownSeverity =\n normalizedSeverity === \"med\" || ISSUE_SEVERITY_VALUES.includes(normalizedSeverity as (typeof ISSUE_SEVERITY_VALUES)[number]);\n assertFrontMatterCondition(\n isKnownSeverity,\n `severity value must be one of: ${[...ISSUE_SEVERITY_VALUES, \"med\"].join(\", \")}`,\n );\n}\n\nfunction assertRegressionFrontMatterField(record: Record<string, unknown>): void {\n if (record.regression !== undefined && typeof record.regression !== \"boolean\") {\n validationError(\"regression must be a boolean\");\n }\n}\n\nfunction assertReminderEntries(record: Record<string, unknown>): void {\n const reminders = record.reminders;\n if (reminders === undefined) {\n return;\n }\n assertFrontMatterCondition(Array.isArray(reminders), \"reminders must be an array\");\n for (const reminder of reminders as unknown[]) {\n assertFrontMatterCondition(typeof reminder === \"object\" && reminder !== null && !Array.isArray(reminder), \"reminders entries must be objects\");\n const reminderRecord = reminder as Record<string, unknown>;\n assertFrontMatterCondition(typeof reminderRecord.at === \"string\", \"reminder.at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(reminderRecord.at as string), \"reminder.at must be a valid ISO timestamp\");\n assertFrontMatterCondition(typeof reminderRecord.text === \"string\", \"reminder.text must be a string\");\n assertFrontMatterCondition((reminderRecord.text as string).trim().length > 0, \"reminder.text must not be empty\");\n }\n}\n\nfunction assertEventStringFields(eventRecord: Record<string, unknown>): void {\n for (const stringField of [\"title\", \"description\", \"location\", \"timezone\"] as const) {\n if (eventRecord[stringField] !== undefined) {\n assertFrontMatterCondition(typeof eventRecord[stringField] === \"string\", `event.${stringField} must be a string`);\n assertFrontMatterCondition(\n (eventRecord[stringField] as string).trim().length > 0,\n `event.${stringField} must not be empty`,\n );\n }\n }\n}\n\nfunction assertEventRecurrence(eventRecord: Record<string, unknown>): void {\n if (eventRecord.recurrence === undefined) {\n return;\n }\n assertValidRecurrenceRule(eventRecord.recurrence);\n if ((eventRecord.recurrence as Record<string, unknown>).until !== undefined) {\n assertFrontMatterCondition(\n compareTimestampStrings(\n (eventRecord.recurrence as Record<string, unknown>).until as string,\n eventRecord.start_at as string,\n ) >= 0,\n \"event.recurrence.until must be at or after event.start_at\",\n );\n }\n}\n\nfunction assertCalendarEventEntry(event: unknown): void {\n assertFrontMatterCondition(typeof event === \"object\" && event !== null && !Array.isArray(event), \"events entries must be objects\");\n const eventRecord = event as Record<string, unknown>;\n assertFrontMatterCondition(typeof eventRecord.start_at === \"string\", \"event.start_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.start_at as string), \"event.start_at must be a valid ISO timestamp\");\n\n if (eventRecord.end_at !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.end_at === \"string\", \"event.end_at must be a string\");\n assertFrontMatterCondition(isTimestampLiteral(eventRecord.end_at as string), \"event.end_at must be a valid ISO timestamp\");\n assertFrontMatterCondition(\n compareTimestampStrings(eventRecord.end_at as string, eventRecord.start_at as string) > 0,\n \"event.end_at must be after event.start_at\",\n );\n }\n\n assertEventStringFields(eventRecord);\n if (eventRecord.all_day !== undefined) {\n assertFrontMatterCondition(typeof eventRecord.all_day === \"boolean\", \"event.all_day must be a boolean\");\n }\n assertEventRecurrence(eventRecord);\n}\n\nfunction assertCalendarEvents(record: Record<string, unknown>): void {\n const events = record.events;\n if (events === undefined) {\n return;\n }\n assertFrontMatterCondition(Array.isArray(events), \"events must be an array\");\n for (const event of events as unknown[]) {\n assertCalendarEventEntry(event);\n }\n}\n\nfunction assertOptionalStringFields(record: Record<string, unknown>): void {\n for (const fieldName of [\"source_type\", \"source_owner\", \"design\", \"external_ref\"] as const) {\n const value = record[fieldName];\n if (value !== undefined) {\n assertFrontMatterCondition(typeof value === \"string\", `${fieldName} must be a string`);\n }\n }\n}\n\nfunction assertTypeOptionsField(record: Record<string, unknown>): void {\n const typeOptions = record.type_options;\n if (typeOptions === undefined) {\n return;\n }\n assertFrontMatterCondition(\n typeof typeOptions === \"object\" && typeOptions !== null && !Array.isArray(typeOptions),\n \"type_options must be an object\",\n );\n for (const [optionKey, optionValue] of Object.entries(typeOptions as Record<string, unknown>)) {\n assertFrontMatterCondition(optionKey.trim().length > 0, \"type_options keys must be non-empty\");\n assertFrontMatterCondition(typeof optionValue === \"string\", \"type_options values must be strings\");\n const optionText = optionValue as string;\n assertFrontMatterCondition(optionText.trim().length > 0, \"type_options values must be non-empty strings\");\n }\n}\n\nfunction coerceRuntimeFrontMatterFields(\n record: Record<string, unknown>,\n itemType: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n): void {\n if (!runtimeContext?.fieldRegistry) {\n return;\n }\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const fieldValue = record[definition.metadata_key];\n if (fieldValue === undefined) {\n if (runtimeFieldRequiredForType(definition, itemType)) {\n validationError(`missing required schema field: ${definition.metadata_key}`);\n }\n continue;\n }\n try {\n record[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n fieldValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n } catch (error: unknown) {\n validationError(String((error as { message?: unknown })?.message).replace(/^Invalid\\s+/u, \"\"));\n }\n }\n}\n\nfunction assertRuntimeUnknownFrontMatterFields(\n record: Record<string, unknown>,\n runtimeContext?: RuntimeSchemaValidationContext,\n): void {\n if (!runtimeContext || runtimeContext.unknownFieldPolicy === \"allow\") {\n return;\n }\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length === 0) {\n return;\n }\n if (runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n } else {\n runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(\",\")}`);\n }\n}\n\nfunction assertValidFrontMatter(\n frontMatter: unknown,\n runtimeContext?: RuntimeSchemaValidationContext,\n): asserts frontMatter is ItemMetadata {\n assertFrontMatterCondition(\n typeof frontMatter === \"object\" && frontMatter !== null && !Array.isArray(frontMatter),\n \"front matter must be an object\",\n );\n\n const record = frontMatter as Record<string, unknown>;\n const itemType = assertRequiredFrontMatterFields(record);\n assertStatusFrontMatterField(record, runtimeContext);\n assertPriorityAndTags(record);\n assertConfidenceFrontMatterField(record);\n assertSeverityFrontMatterField(record);\n assertRegressionFrontMatterField(record);\n assertTimestampField(record, \"created_at\");\n assertTimestampField(record, \"updated_at\");\n if (record.deadline !== undefined) {\n assertTimestampField(record, \"deadline\");\n }\n assertReminderEntries(record);\n assertCalendarEvents(record);\n assertOptionalTimestampString(record, \"closed_at\", \"closed_at\");\n assertOptionalStringFields(record);\n assertTypeOptionsField(record);\n coerceRuntimeFrontMatterFields(record, itemType, runtimeContext);\n assertRuntimeUnknownFrontMatterFields(record, runtimeContext);\n}\n\nfunction sortDependencies(values: Dependency[] | undefined): Dependency[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n id: value.id.trim().toLowerCase(),\n kind: value.kind,\n created_at: value.created_at,\n author: value.author?.trim() || undefined,\n source_kind: value.source_kind?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byId = a.id.localeCompare(b.id);\n if (byId !== 0) return byId;\n const byKind = a.kind.localeCompare(b.kind);\n if (byKind !== 0) return byKind;\n return (a.source_kind ?? \"\").localeCompare(b.source_kind ?? \"\");\n });\n}\n\nfunction sortLogValues<T extends Comment | LogNote>(values: T[] | undefined): T[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values].sort((a, b) => {\n const byCreated = compareTimestampStrings(a.created_at, b.created_at);\n if (byCreated !== 0) return byCreated;\n const byText = a.text.localeCompare(b.text);\n if (byText !== 0) return byText;\n return a.author.localeCompare(b.author);\n });\n}\n\nfunction sortReminders(values: Reminder[] | undefined): Reminder[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = [...values]\n .map((value) => ({\n at: value.at,\n text: value.text.trim(),\n }))\n .filter((value) => value.text.length > 0)\n .sort((a, b) => {\n const byAt = compareTimestampStrings(a.at, b.at);\n if (byAt !== 0) return byAt;\n return a.text.localeCompare(b.text);\n });\n return normalized.length === 0 ? undefined : normalized;\n}\n\nfunction normalizeRecurrenceRule(value: RecurrenceRule | undefined): RecurrenceRule | undefined {\n if (!value) {\n return undefined;\n }\n const normalizedFrequency = value.freq.trim().toLowerCase();\n if (!RECURRENCE_FREQUENCY_VALUES.includes(normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number])) {\n return undefined;\n }\n\n const byWeekday = Array.from(\n new Set(\n (value.by_weekday ?? [])\n .map((weekday) => weekday.trim().toLowerCase())\n .filter((weekday) => RECURRENCE_WEEKDAY_VALUES.includes(weekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number])),\n ),\n ).sort(\n (a, b) =>\n weekdayOrderIndex(a as (typeof RECURRENCE_WEEKDAY_VALUES)[number]) -\n weekdayOrderIndex(b as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n );\n\n const byMonthDay = Array.from(\n new Set(\n (value.by_month_day ?? [])\n .filter((day) => Number.isInteger(day) && day >= 1 && day <= 31)\n .map((day) => day as number),\n ),\n ).sort((a, b) => a - b);\n\n const exdates = Array.from(\n new Set(\n (value.exdates ?? [])\n .map((timestamp) => timestamp.trim())\n .filter((timestamp) => isTimestampLiteral(timestamp)),\n ),\n ).sort((a, b) => compareTimestampStrings(a, b));\n\n const normalized: RecurrenceRule = {\n freq: normalizedFrequency as (typeof RECURRENCE_FREQUENCY_VALUES)[number],\n interval: value.interval !== undefined && value.interval > 1 ? value.interval : undefined,\n count: value.count,\n until: value.until?.trim() || undefined,\n by_weekday: byWeekday.length > 0 ? (byWeekday as (typeof RECURRENCE_WEEKDAY_VALUES)[number][]) : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n for (const [key, fieldValue] of Object.entries(normalized)) {\n if (fieldValue === undefined) {\n delete (normalized as unknown as Record<string, unknown>)[key];\n }\n }\n return normalized;\n}\n\nfunction sortEvents(values: CalendarEvent[] | undefined): CalendarEvent[] | undefined {\n if (!Array.isArray(values) || values.length === 0) {\n return undefined;\n }\n const normalized = [...values].map(normalizeCalendarEvent).sort(compareCalendarEvents);\n return normalized;\n}\n\nfunction normalizeCalendarEvent(value: CalendarEvent): CalendarEvent {\n const event: CalendarEvent = {\n start_at: value.start_at,\n end_at: value.end_at || undefined,\n title: value.title?.trim() || undefined,\n description: value.description?.trim() || undefined,\n location: value.location?.trim() || undefined,\n all_day: value.all_day,\n timezone: value.timezone?.trim() || undefined,\n recurrence: normalizeRecurrenceRule(value.recurrence),\n };\n deleteUndefinedFields(event as unknown as Record<string, unknown>);\n return event;\n}\n\nfunction compareCalendarEvents(a: CalendarEvent, b: CalendarEvent): number {\n return firstNonZeroComparison([\n compareTimestampStrings(a.start_at, b.start_at),\n (a.end_at ?? \"\").localeCompare(b.end_at ?? \"\"),\n (a.title ?? \"\").localeCompare(b.title ?? \"\"),\n Number(Boolean(a.all_day)) - Number(Boolean(b.all_day)),\n (a.timezone ?? \"\").localeCompare(b.timezone ?? \"\"),\n (a.location ?? \"\").localeCompare(b.location ?? \"\"),\n (a.description ?? \"\").localeCompare(b.description ?? \"\"),\n JSON.stringify(a.recurrence ?? {}).localeCompare(JSON.stringify(b.recurrence ?? {})),\n ]);\n}\n\nfunction normalizeFiles(values: LinkedFile[] | undefined): LinkedFile[] | undefined {\n if (!values || values.length === 0) return undefined;\n return values\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }));\n}\n\nfunction normalizeTestRunSummaries(values: ItemTestRunSummary[] | undefined): ItemTestRunSummary[] | undefined {\n if (!values || values.length === 0) return undefined;\n const normalized = values\n .map(normalizeTestRunSummary)\n .filter((value) => value.run_id.length > 0 && value.started_at.length > 0 && value.finished_at.length > 0 && value.recorded_at.length > 0)\n .sort((a, b) =>\n firstNonZeroComparison([\n compareTimestampStrings(a.recorded_at, b.recorded_at),\n a.run_id.localeCompare(b.run_id),\n a.kind.localeCompare(b.kind),\n ]),\n );\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeNonNegativeInteger(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : undefined;\n}\n\nfunction normalizePositiveInteger(value: unknown): number | undefined {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 1 ? Math.floor(value) : undefined;\n}\n\nfunction stringOrEmpty(value: unknown): string {\n return typeof value === \"string\" ? value : \"\";\n}\n\nfunction normalizeTestRunSummary(value: ItemTestRunSummary): ItemTestRunSummary {\n const runId = typeof value.run_id === \"string\" ? value.run_id.trim() : \"\";\n const kind = value.kind === \"test\" || value.kind === \"test-all\" ? value.kind : \"test\";\n const status = ITEM_TEST_RUN_STATUS_VALUES.has(value.status) ? value.status : \"failed\";\n const summary: ItemTestRunSummary = {\n run_id: runId,\n kind,\n status,\n started_at: stringOrEmpty(value.started_at),\n finished_at: stringOrEmpty(value.finished_at),\n recorded_at: stringOrEmpty(value.recorded_at),\n attempt: normalizePositiveInteger(value.attempt),\n resumed_from: value.resumed_from?.trim() || undefined,\n passed: normalizeNonNegativeInteger(value.passed) ?? 0,\n failed: normalizeNonNegativeInteger(value.failed) ?? 0,\n skipped: normalizeNonNegativeInteger(value.skipped) ?? 0,\n items: normalizeNonNegativeInteger(value.items),\n linked_tests: normalizeNonNegativeInteger(value.linked_tests),\n fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : undefined,\n };\n deleteUndefinedFields(summary as unknown as Record<string, unknown>);\n return summary;\n}\n\nfunction sortTests(values: LinkedTest[] | undefined): LinkedTest[] | undefined {\n if (!Array.isArray(values) || values.length === 0) return undefined;\n return [...values].map(normalizeLinkedTest).sort(compareLinkedTests);\n}\n\nfunction normalizeTrimmedStringList(value: readonly string[] | undefined): string[] | undefined {\n if (!Array.isArray(value)) {\n return undefined;\n }\n const normalized = [\n ...new Set(\n value\n .filter((entry) => typeof entry === \"string\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0),\n ),\n ].sort((a, b) => a.localeCompare(b));\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction isPlainObjectRecord(value: unknown): value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction isUnsafeObjectKey(key: string): boolean {\n return key === \"__proto__\" || key === \"constructor\" || key === \"prototype\";\n}\n\nfunction normalizeStringRecord(value: Record<string, string> | undefined): Record<string, string> | undefined {\n if (!isPlainObjectRecord(value)) {\n return undefined;\n }\n const entries = Object.entries(value)\n .map(([key, recordValue]) => [key.trim(), String(recordValue).trim()] as const)\n .filter(([key, recordValue]) => key.length > 0 && !isUnsafeObjectKey(key) && recordValue.length > 0)\n .sort(([left], [right]) => left.localeCompare(right));\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\nfunction normalizeNumericRecord(value: Record<string, number> | undefined): Record<string, number> | undefined {\n if (!isPlainObjectRecord(value)) {\n return undefined;\n }\n const entries = Object.entries(value)\n .map(([key, recordValue]) => [key.trim(), Number(recordValue)] as const)\n .filter(([key, recordValue]) => key.length > 0 && !isUnsafeObjectKey(key) && Number.isFinite(recordValue))\n .sort(([left], [right]) => left.localeCompare(right));\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\nfunction normalizeLinkedTestContextMode(value: string | undefined): LinkedTest[\"pm_context_mode\"] | undefined {\n const normalized = value?.trim().toLowerCase();\n if (!normalized || !LINKED_TEST_PM_CONTEXT_MODE_VALUES.has(normalized)) {\n return undefined;\n }\n return normalized as LinkedTest[\"pm_context_mode\"];\n}\n\nfunction normalizeLinkedTest(value: LinkedTest): LinkedTest {\n const test: LinkedTest = {\n command: value.command?.trim() || undefined,\n path: value.path ? normalizePathValue(value.path) : undefined,\n scope: value.scope,\n timeout_seconds:\n typeof value.timeout_seconds === \"number\" && Number.isFinite(value.timeout_seconds) && value.timeout_seconds > 0\n ? value.timeout_seconds\n : undefined,\n pm_context_mode: normalizeLinkedTestContextMode(value.pm_context_mode),\n env_set: normalizeStringRecord(value.env_set),\n env_clear: normalizeTrimmedStringList(value.env_clear),\n shared_host_safe: value.shared_host_safe === true ? true : undefined,\n assert_stdout_contains: normalizeTrimmedStringList(value.assert_stdout_contains),\n assert_stdout_regex: normalizeTrimmedStringList(value.assert_stdout_regex),\n assert_stderr_contains: normalizeTrimmedStringList(value.assert_stderr_contains),\n assert_stderr_regex: normalizeTrimmedStringList(value.assert_stderr_regex),\n assert_stdout_min_lines: normalizeNonNegativeInteger(value.assert_stdout_min_lines),\n assert_json_field_equals: normalizeStringRecord(value.assert_json_field_equals),\n assert_json_field_gte: normalizeNumericRecord(value.assert_json_field_gte),\n note: value.note?.trim() || undefined,\n };\n deleteUndefinedFields(test as unknown as Record<string, unknown>);\n return test;\n}\n\nfunction compareLinkedTests(a: LinkedTest, b: LinkedTest): number {\n return firstNonZeroComparison([\n a.scope.localeCompare(b.scope),\n compareOptionalStrings(a.path, b.path),\n compareOptionalStrings(a.command, b.command),\n compareOptionalNumbers(a.timeout_seconds, b.timeout_seconds),\n compareOptionalStrings(a.pm_context_mode, b.pm_context_mode),\n Number(Boolean(a.shared_host_safe)) - Number(Boolean(b.shared_host_safe)),\n compareJsonValues(a.env_clear, b.env_clear, []),\n compareJsonValues(a.env_set, b.env_set, {}),\n compareJsonValues(a.assert_stdout_contains, b.assert_stdout_contains, []),\n compareJsonValues(a.assert_stdout_regex, b.assert_stdout_regex, []),\n compareJsonValues(a.assert_stderr_contains, b.assert_stderr_contains, []),\n compareJsonValues(a.assert_stderr_regex, b.assert_stderr_regex, []),\n compareOptionalNumbers(a.assert_stdout_min_lines, b.assert_stdout_min_lines),\n compareJsonValues(a.assert_json_field_equals, b.assert_json_field_equals, {}),\n compareJsonValues(a.assert_json_field_gte, b.assert_json_field_gte, {}),\n compareOptionalStrings(a.note, b.note),\n ]);\n}\n\nfunction compareOptionalStrings(left: string | undefined, right: string | undefined): number {\n return (left ?? \"\").localeCompare(right ?? \"\");\n}\n\nfunction compareOptionalNumbers(left: number | undefined, right: number | undefined): number {\n return (left ?? 0) - (right ?? 0);\n}\n\nfunction compareJsonValues(left: unknown, right: unknown, fallback: unknown): number {\n return JSON.stringify(left ?? fallback).localeCompare(JSON.stringify(right ?? fallback));\n}\n\nfunction sortDocs(values: LinkedDoc[] | undefined): LinkedDoc[] | undefined {\n if (!values || values.length === 0) return undefined;\n return [...values]\n .map((value) => ({\n path: normalizePathValue(value.path),\n scope: value.scope,\n note: value.note?.trim() || undefined,\n }))\n .sort((a, b) => {\n const byScope = a.scope.localeCompare(b.scope);\n if (byScope !== 0) return byScope;\n const byPath = a.path.localeCompare(b.path);\n if (byPath !== 0) return byPath;\n return (a.note ?? \"\").localeCompare(b.note ?? \"\");\n });\n}\n\nfunction trimStringOrUndefined(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction normalizePlanStepLinks(value: unknown): PlanStepLink[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepLink[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const kind = trimStringOrUndefined(record.kind);\n if (!id || !kind) continue;\n const link: PlanStepLink = { id, kind: kind as PlanStepLink[\"kind\"] };\n const note = trimStringOrUndefined(record.note);\n if (note) link.note = note;\n if (record.required_before_step === true) link.required_before_step = true;\n out.push(link);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepFiles(value: unknown): PlanStepFile[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepFile[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const file: PlanStepFile = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") file.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) file.note = note;\n out.push(file);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepTests(value: unknown): { command?: string; path?: string; note?: string }[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: { command?: string; path?: string; note?: string }[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const command = trimStringOrUndefined(record.command);\n const path = trimStringOrUndefined(record.path);\n if (!command && !path) continue;\n const test: { command?: string; path?: string; note?: string } = {};\n if (command) test.command = command;\n if (path) test.path = normalizePathValue(path);\n const note = trimStringOrUndefined(record.note);\n if (note) test.note = note;\n out.push(test);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepDocs(value: unknown): PlanStepDoc[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanStepDoc[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const path = trimStringOrUndefined(record.path);\n if (!path) continue;\n const doc: PlanStepDoc = { path: normalizePathValue(path) };\n if (record.scope === \"project\" || record.scope === \"global\") doc.scope = record.scope;\n const note = trimStringOrUndefined(record.note);\n if (note) doc.note = note;\n out.push(doc);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanStepEntry(entry: unknown): PlanStep | undefined {\n if (entry === null || typeof entry !== \"object\") {\n return undefined;\n }\n const record = entry as Record<string, unknown>;\n const id = trimStringOrUndefined(record.id);\n const title = trimStringOrUndefined(record.title);\n const statusRaw = trimStringOrUndefined(record.status);\n const status = statusRaw && PLAN_STEP_STATUS_SET.has(statusRaw) ? (statusRaw as PlanStepStatus) : undefined;\n const orderRaw = record.order;\n const order =\n typeof orderRaw === \"number\" && Number.isFinite(orderRaw)\n ? orderRaw\n : typeof orderRaw === \"string\" && orderRaw.trim().length > 0\n ? Number(orderRaw)\n : Number.NaN;\n const created_at = typeof record.created_at === \"string\" ? record.created_at : \"\";\n const updated_at = typeof record.updated_at === \"string\" ? record.updated_at : \"\";\n if (!id || !title || !status || !Number.isFinite(order) || !created_at || !updated_at) {\n return undefined;\n }\n const step: PlanStep = {\n id,\n order,\n title,\n status,\n created_at,\n updated_at,\n };\n applyPlanStepOptionalFields(step, record);\n return step;\n}\n\nfunction applyPlanStepOptionalFields(step: PlanStep, record: Record<string, unknown>): void {\n const stringFields = [\n [\"body\", \"body\"],\n [\"owner\", \"owner\"],\n [\"evidence\", \"evidence\"],\n [\"blocked_reason\", \"blocked_reason\"],\n [\"superseded_by\", \"superseded_by\"],\n ] as const satisfies readonly (readonly [keyof PlanStep, string])[];\n for (const [target, source] of stringFields) {\n const value = trimStringOrUndefined(record[source]);\n if (value) {\n step[target] = value as never;\n }\n }\n const completedAt = typeof record.completed_at === \"string\" ? record.completed_at : undefined;\n if (completedAt && completedAt.length > 0) {\n step.completed_at = completedAt;\n }\n const collectionFields = [\n [\"linked_items\", \"linked_items\", normalizePlanStepLinks],\n [\"files\", \"files\", normalizePlanStepFiles],\n [\"tests\", \"tests\", normalizePlanStepTests],\n [\"docs\", \"docs\", normalizePlanStepDocs],\n ] as const;\n for (const [target, source, normalize] of collectionFields) {\n const value = normalize(record[source]);\n if (value) {\n step[target] = value as never;\n }\n }\n}\n\nfunction normalizePlanSteps(value: unknown): PlanStep[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out = value.flatMap((entry) => {\n const step = normalizePlanStepEntry(entry);\n return step ? [step] : [];\n });\n out.sort((left, right) => left.order - right.order);\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDecisions(value: unknown): PlanDecision[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDecision[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const decision = trimStringOrUndefined(record.decision);\n if (!ts || !author || !decision) continue;\n const item: PlanDecision = { ts, author, decision };\n const rationale = trimStringOrUndefined(record.rationale);\n if (rationale) item.rationale = rationale;\n const evidence = trimStringOrUndefined(record.evidence);\n if (evidence) item.evidence = evidence;\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanDiscoveries(value: unknown): PlanDiscovery[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanDiscovery[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const ts = typeof record.ts === \"string\" ? record.ts : \"\";\n const author = typeof record.author === \"string\" ? record.author : \"\";\n const text = trimStringOrUndefined(record.text);\n if (!ts || !author || !text) continue;\n const item: PlanDiscovery = { ts, author, text };\n const stepId = trimStringOrUndefined(record.step_id);\n if (stepId) item.step_id = stepId;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizePlanValidation(value: unknown): PlanValidationCheck[] | undefined {\n if (!Array.isArray(value)) return undefined;\n const out: PlanValidationCheck[] = [];\n for (const entry of value) {\n if (entry === null || typeof entry !== \"object\") continue;\n const record = entry as Record<string, unknown>;\n const text = trimStringOrUndefined(record.text);\n if (!text) continue;\n const item: PlanValidationCheck = { text };\n const command = trimStringOrUndefined(record.command);\n if (command) item.command = command;\n const expected = trimStringOrUndefined(record.expected);\n if (expected) item.expected = expected;\n out.push(item);\n }\n return out.length > 0 ? out : undefined;\n}\n\nfunction normalizeTypeOptions(values: Record<string, string> | undefined): Record<string, string> | undefined {\n if (!values) {\n return undefined;\n }\n const normalizedEntries = Object.entries(values)\n .map(([key, value]) => [key.trim(), value.trim()] as const)\n .filter(([key, value]) => key.length > 0 && value.length > 0)\n .sort((left, right) => left[0].localeCompare(right[0]));\n if (normalizedEntries.length === 0) {\n return undefined;\n }\n return Object.fromEntries(normalizedEntries);\n}\n\nfunction normalizeBody(body: string): string {\n let start = 0;\n while (start < body.length && body[start] === \"\\n\") {\n start += 1;\n }\n return body.slice(start).trimEnd();\n}\n\nfunction normalizeConfidenceValue(value: ItemMetadata[\"confidence\"] | undefined): ItemMetadata[\"confidence\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === \"number\") {\n return value;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(normalized as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return normalized as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n return undefined;\n}\n\nfunction normalizeSeverityValue(value: ItemMetadata[\"severity\"] | undefined): ItemMetadata[\"severity\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"med\") {\n return \"medium\";\n }\n if (ISSUE_SEVERITY_VALUES.includes(normalized as (typeof ISSUE_SEVERITY_VALUES)[number])) {\n return normalized as (typeof ISSUE_SEVERITY_VALUES)[number];\n }\n return undefined;\n}\n\nfunction emptyStringToUndefined(value: string | undefined): string | undefined {\n return value || undefined;\n}\n\nfunction copyExtensionFrontMatterFields(normalized: ItemMetadata, source: ItemMetadata): void {\n const targetRecord = normalized as unknown as Record<string, unknown>;\n const sourceRecord = source as unknown as Record<string, unknown>;\n for (const [key, value] of Object.entries(sourceRecord)) {\n if (isUnsafeObjectKey(key) || Object.prototype.hasOwnProperty.call(targetRecord, key) || value === undefined) {\n continue;\n }\n targetRecord[key] = value;\n }\n}\n\nfunction coerceNormalizedRuntimeFields(\n normalized: ItemMetadata,\n runtimeContext: RuntimeSchemaValidationContext | undefined,\n): void {\n if (!runtimeContext?.fieldRegistry) {\n return;\n }\n const record = normalized as unknown as Record<string, unknown>;\n for (const definition of runtimeContext.fieldRegistry.definitions) {\n const currentValue = record[definition.metadata_key];\n if (currentValue === undefined) {\n continue;\n }\n record[definition.metadata_key] = coerceRuntimeFieldValue(\n definition,\n currentValue,\n `metadata field \"${definition.metadata_key}\"`,\n );\n }\n}\n\nfunction assertNormalizedUnknownFields(\n normalized: ItemMetadata,\n runtimeContext: RuntimeSchemaValidationContext | undefined,\n): void {\n if (!runtimeContext || runtimeContext.unknownFieldPolicy === \"allow\") {\n return;\n }\n const knownKeys = buildKnownFrontMatterKeys(runtimeContext);\n const record = normalized as unknown as Record<string, unknown>;\n const unknownKeys = Object.keys(record)\n .filter((key) => !knownKeys.has(key))\n .sort((left, right) => left.localeCompare(right));\n if (unknownKeys.length > 0 && runtimeContext.unknownFieldPolicy === \"reject\") {\n validationError(`unknown schema fields are not allowed: ${unknownKeys.join(\", \")}`);\n }\n if (unknownKeys.length > 0) {\n runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(\",\")}`);\n }\n}\n\n/**\n * Implements normalize front matter for the public runtime surface of this module.\n */\nexport function normalizeFrontMatter(\n frontMatter: ItemMetadata,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemMetadata {\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n const normalizedStatus = normalizeStatusInput(frontMatter.status, runtimeContext?.statusRegistry) ?? frontMatter.status;\n const tags = Array.from(new Set(frontMatter.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean))).sort((a, b) =>\n a.localeCompare(b),\n );\n const normalized: ItemMetadata = {\n id: frontMatter.id,\n title: frontMatter.title,\n description: frontMatter.description,\n type: frontMatter.type,\n pm_format_version: normalizeItemFormatVersion(frontMatter.pm_format_version),\n source_type: trimStringOrUndefined(frontMatter.source_type),\n type_options: normalizeTypeOptions(frontMatter.type_options),\n status: normalizedStatus,\n priority: frontMatter.priority,\n tags,\n created_at: frontMatter.created_at,\n updated_at: frontMatter.updated_at,\n dependencies: sortDependencies(frontMatter.dependencies),\n comments: sortLogValues(frontMatter.comments),\n notes: sortLogValues(frontMatter.notes),\n learnings: sortLogValues(frontMatter.learnings),\n files: normalizeFiles(frontMatter.files),\n tests: sortTests(frontMatter.tests),\n test_runs: normalizeTestRunSummaries(frontMatter.test_runs),\n docs: sortDocs(frontMatter.docs),\n deadline: emptyStringToUndefined(frontMatter.deadline),\n reminders: sortReminders(frontMatter.reminders),\n events: sortEvents(frontMatter.events),\n closed_at: emptyStringToUndefined(frontMatter.closed_at),\n assignee: trimStringOrUndefined(frontMatter.assignee),\n source_owner: trimStringOrUndefined(frontMatter.source_owner),\n author: emptyStringToUndefined(frontMatter.author),\n estimated_minutes: frontMatter.estimated_minutes,\n acceptance_criteria: frontMatter.acceptance_criteria ?? undefined,\n design: frontMatter.design ?? undefined,\n external_ref: frontMatter.external_ref ?? undefined,\n definition_of_ready: trimStringOrUndefined(frontMatter.definition_of_ready),\n order: frontMatter.order,\n goal: trimStringOrUndefined(frontMatter.goal),\n objective: trimStringOrUndefined(frontMatter.objective),\n value: trimStringOrUndefined(frontMatter.value),\n impact: trimStringOrUndefined(frontMatter.impact),\n outcome: trimStringOrUndefined(frontMatter.outcome),\n why_now: trimStringOrUndefined(frontMatter.why_now),\n parent: trimStringOrUndefined(frontMatter.parent),\n reviewer: trimStringOrUndefined(frontMatter.reviewer),\n risk: frontMatter.risk ?? undefined,\n confidence: normalizeConfidenceValue(frontMatter.confidence),\n sprint: trimStringOrUndefined(frontMatter.sprint),\n release: trimStringOrUndefined(frontMatter.release),\n blocked_by: trimStringOrUndefined(frontMatter.blocked_by),\n blocked_reason: trimStringOrUndefined(frontMatter.blocked_reason),\n unblock_note: trimStringOrUndefined(frontMatter.unblock_note),\n reporter: trimStringOrUndefined(frontMatter.reporter),\n severity: normalizeSeverityValue(frontMatter.severity),\n environment: trimStringOrUndefined(frontMatter.environment),\n repro_steps: trimStringOrUndefined(frontMatter.repro_steps),\n resolution: trimStringOrUndefined(frontMatter.resolution),\n expected_result: trimStringOrUndefined(frontMatter.expected_result),\n actual_result: trimStringOrUndefined(frontMatter.actual_result),\n affected_version: trimStringOrUndefined(frontMatter.affected_version),\n fixed_version: trimStringOrUndefined(frontMatter.fixed_version),\n component: trimStringOrUndefined(frontMatter.component),\n regression: frontMatter.regression,\n customer_impact: trimStringOrUndefined(frontMatter.customer_impact),\n close_reason: emptyStringToUndefined(frontMatter.close_reason),\n plan_mode: trimStringOrUndefined(frontMatter.plan_mode) as ItemMetadata[\"plan_mode\"],\n plan_scope: trimStringOrUndefined(frontMatter.plan_scope),\n plan_harness: trimStringOrUndefined(frontMatter.plan_harness) as ItemMetadata[\"plan_harness\"],\n plan_resume_context: trimStringOrUndefined(frontMatter.plan_resume_context),\n plan_steps: normalizePlanSteps(frontMatter.plan_steps),\n plan_decisions: normalizePlanDecisions(frontMatter.plan_decisions),\n plan_discoveries: normalizePlanDiscoveries(frontMatter.plan_discoveries),\n plan_validation: normalizePlanValidation(frontMatter.plan_validation),\n };\n copyExtensionFrontMatterFields(normalized, frontMatter);\n coerceNormalizedRuntimeFields(normalized, runtimeContext);\n assertNormalizedUnknownFields(normalized, runtimeContext);\n deleteUndefinedFields(normalized as unknown as Record<string, unknown>);\n return normalized;\n}\n\nfunction orderFrontMatter(frontMatter: ItemMetadata): Record<string, unknown> {\n return orderObject(frontMatter as unknown as Record<string, unknown>, FRONT_MATTER_KEY_ORDER);\n}\n\nfunction findJsonObjectEnd(content: string): number {\n let depth = 0;\n let inString = false;\n let escaped = false;\n\n for (let i = 0; i < content.length; i += 1) {\n const char = content[i];\n if (inString) {\n if (escaped) {\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n escaped = true;\n continue;\n }\n if (char === \"\\\"\") {\n inString = false;\n }\n continue;\n }\n if (char === \"\\\"\") {\n inString = true;\n continue;\n }\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) {\n return i;\n }\n }\n }\n\n return -1;\n}\n\n/**\n * Implements split front matter for the public runtime surface of this module.\n */\nexport function splitFrontMatter(content: string): { frontMatter: string; body: string } {\n if (!content.startsWith(\"{\")) {\n return { frontMatter: \"\", body: content };\n }\n const end = findJsonObjectEnd(content);\n if (end < 0) {\n return { frontMatter: \"\", body: content };\n }\n const frontMatter = content.slice(0, end + 1);\n const body = content.slice(end + 1).replace(/^\\r?\\n+/, \"\");\n return { frontMatter, body };\n}\n\nfunction stripLeadingYamlDocument(content: string): { content: string; stripped: boolean } {\n const normalizedContent = content.charCodeAt(0) === 0xfeff ? content.slice(1) : content;\n const opener = normalizedContent.match(/^[ \\t]*---[ \\t]*(?:\\r?\\n|$)/);\n if (!opener) {\n return { content: normalizedContent, stripped: false };\n }\n\n let cursor = opener[0].length;\n while (cursor < normalizedContent.length) {\n const nextNewline = normalizedContent.indexOf(\"\\n\", cursor);\n const lineEnd = nextNewline === -1 ? normalizedContent.length : nextNewline;\n const line = normalizedContent.slice(cursor, lineEnd).replace(/\\r$/, \"\");\n const afterLine = nextNewline === -1 ? lineEnd : lineEnd + 1;\n if (line.trim() === \"---\") {\n return { content: normalizedContent.slice(afterLine).replace(/^\\s+/, \"\"), stripped: true };\n }\n cursor = afterLine;\n }\n\n return { content: normalizedContent, stripped: false };\n}\n\nfunction normalizeParsedFrontMatter(\n frontMatter: ItemMetadata,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\">,\n): ItemMetadata {\n return normalizeFrontMatter(frontMatter, { ...options, onWarning: undefined });\n}\n\nfunction parseJsonMarkdownItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n const normalized = stripLeadingYamlDocument(content);\n if (normalized.stripped) {\n options.onWarning?.(\"json_markdown_leading_yaml_frontmatter_ignored\");\n }\n const { frontMatter, body } = splitFrontMatter(normalized.content);\n if (!frontMatter) {\n const trimmed = content.trimStart();\n if (trimmed.startsWith(\"{\")) {\n validationError(\"JSON front matter is not valid JSON\");\n }\n validationError(\"missing JSON front matter\");\n }\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(frontMatter);\n } catch {\n validationError(\"JSON front matter is not valid JSON\");\n }\n assertValidFrontMatter(parsed, runtimeContext);\n\n return {\n metadata: normalizeParsedFrontMatter(parsed, options),\n body: normalizeBody(body),\n };\n}\n\nfunction parseToonItemDocument(\n content: string,\n runtimeContext?: RuntimeSchemaValidationContext,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): ItemDocument {\n let parsed: unknown;\n try {\n // decodeToonItemContent transparently recovers documents that the upstream\n // strict decoder rejects (bracketed-token-then-colon inside a quoted value;\n // see toon-decode.ts). The recovery is lossless, so it stays silent rather\n // than emitting a per-read warning that would perpetually flip pm health\n // red for legacy files. The behavior is pinned by toon-decode.spec.ts.\n parsed = decodeToonItemContent(content).value;\n } catch {\n validationError(\"TOON item document is not valid TOON\");\n }\n assertFrontMatterCondition(\n typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed),\n \"TOON item document must be an object\",\n );\n const record = parsed as Record<string, unknown>;\n\n if (Object.prototype.hasOwnProperty.call(record, \"front_matter\")) {\n assertValidFrontMatter(record.front_matter, runtimeContext);\n assertFrontMatterCondition(\n record.body === undefined || typeof record.body === \"string\",\n \"TOON item document body must be a string\",\n );\n return {\n metadata: normalizeParsedFrontMatter(record.front_matter, options),\n body: normalizeBody(typeof record.body === \"string\" ? record.body : \"\"),\n };\n }\n\n const { body, ...frontMatterRecord } = record;\n assertFrontMatterCondition(\n body === undefined || typeof body === \"string\",\n \"TOON item document body must be a string\",\n );\n assertValidFrontMatter(frontMatterRecord, runtimeContext);\n return {\n metadata: normalizeParsedFrontMatter(frontMatterRecord, options),\n body: normalizeBody(typeof body === \"string\" ? body : \"\"),\n };\n}\n\nfunction serializeJsonMarkdownItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const serializedFrontMatter = JSON.stringify(orderedFrontMatter, null, 2);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n if (!normalizedBody) {\n return `${serializedFrontMatter}\\n`;\n }\n return `${serializedFrontMatter}\\n\\n${normalizedBody}\\n`;\n}\n\nfunction serializeToonItemDocument(\n document: ItemDocument,\n options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {},\n): string {\n const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);\n const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);\n const normalizedBody = normalizeBody(document.body ?? \"\");\n return `${encodeToon({ ...orderedFrontMatter, body: normalizedBody })}\\n`;\n}\n\n/**\n * Implements parse item document for the public runtime surface of this module.\n */\nexport function parseItemDocument(content: string, options: ItemDocumentFormatOptions = {}): ItemDocument {\n const conflictMarker = findFirstMergeConflictMarker(content);\n if (conflictMarker) {\n throw new PmCliError(\n `Merge conflict markers detected in item document at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"merge_conflict_markers_detected\",\n required: \"Resolve merge-conflict markers in the item file before parsing or mutation commands.\",\n why: \"Partially merged documents can corrupt item metadata and history integrity.\",\n examples: [\"git status\", \"git add <resolved-file> && git commit\"],\n nextSteps: [\"Resolve conflicts, save the file, then rerun the pm command.\"],\n },\n );\n }\n const format = options.format ?? \"toon\";\n const runtimeContext = resolveRuntimeSchemaValidationContext(options);\n return format === \"toon\"\n ? parseToonItemDocument(content, runtimeContext, options)\n : parseJsonMarkdownItemDocument(content, runtimeContext, options);\n}\n\n/**\n * Implements serialize item document for the public runtime surface of this module.\n */\nexport function serializeItemDocument(document: ItemDocument, options: ItemDocumentFormatOptions = {}): string {\n const format = options.format ?? \"toon\";\n return format === \"toon\" ? serializeToonItemDocument(document, options) : serializeJsonMarkdownItemDocument(document, options);\n}\n\n/**\n * Implements canonical document for the public runtime surface of this module.\n */\nexport function canonicalDocument(document: ItemDocument, options: Pick<ItemDocumentFormatOptions, \"schema\" | \"extensionFieldNames\" | \"onWarning\"> = {}): ItemDocument {\n return {\n metadata: normalizeFrontMatter(document.metadata, options),\n body: normalizeBody(document.body ?? \"\"),\n };\n}\n\nexport const _testOnlyItemFormat = {\n buildKnownFrontMatterKeys,\n firstNonZeroComparison,\n normalizeBody,\n normalizePlanDecisions,\n normalizePlanDiscoveries,\n normalizePlanStepDocs,\n normalizePlanStepFiles,\n normalizePlanStepLinks,\n normalizePlanSteps,\n normalizePlanStepTests,\n normalizePlanValidation,\n normalizeTestRunSummaries,\n normalizeTypeOptions,\n runtimeFieldRequiredForType,\n sortTests,\n};\n","/**\n * @module core/item/toon-decode\n *\n * Defines item parsing, formatting, and lifecycle helpers for Toon Decode.\n */\nimport { decode as decodeToon } from \"@toon-format/toon\";\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR = \"https://github.com/toon-format/toon/pull/314\" as const;\n\nexport const TOON_SCALAR_BRACKET_ESCAPE_TRACKING = {\n dependency: \"@toon-format/toon\",\n affected_versions: \"<=2.3.0\",\n upstream_pr: TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR,\n removal_condition:\n \"Remove escapeBracketsInQuotedScalars retry once the upstream strict decoder fix ships in a released @toon-format/toon version and this repository upgrades to it.\",\n} as const;\n\n/**\n * Documents the toon decode result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ToonDecodeResult {\n /** The decoded TOON document. */\n value: unknown;\n /** True when the strict decode required the scalar-bracket escape workaround. */\n usedScalarBracketEscape: boolean;\n}\n\n/**\n * Escape `[` as `\\u005b` inside quoted scalar values so the upstream\n * `@toon-format/toon` strict decoder cannot mis-read them.\n *\n * The upstream bug: the strict decoder's array-header detection scans the whole\n * line for an opening bracket when the key is unquoted, so a quoted scalar value\n * that contains a bracketed token followed (anywhere later on the line) by a\n * colon, e.g. `body: \"POST [redacted]: ok\"` or `desc: \"sntr[ysu]_ ... :\"`, is\n * mis-detected as a `key`+bracket+colon array header and throws. The library's\n * own `encode()` emits exactly this otherwise-correctly-quoted form, so strict\n * decode cannot read the encoder's own output for such values.\n *\n * A line is treated as a scalar `key: value` (not an array header) only when its\n * `\": \"` key/value separator occurs before the first `[`; array-header lines\n * (`tags[3]:`, `comments[6]{...}:`) have the bracket first and are left\n * untouched, as are non-string (unquoted) values. Within a matched quoted value\n * every `[` becomes `\\u005b`, which the decoder unescapes back to `[`, so the\n * decoded value is byte-for-byte identical. Crucially, this neutralises only the\n * bracket trigger and nothing else, so the retry stays in strict mode and every\n * other strict invariant (duplicate sibling keys, array-count mismatches, tabs\n * in indentation, ...) is still enforced.\n *\n * Upstream tracking metadata lives in {@link TOON_SCALAR_BRACKET_ESCAPE_TRACKING}.\n */\nfunction escapeBracketsInQuotedScalars(content: string): string {\n return content\n .split(\"\\n\")\n .map((line) => {\n const separatorIndex = line.indexOf(\": \");\n const bracketIndex = line.indexOf(\"[\");\n if (separatorIndex === -1 || bracketIndex === -1 || bracketIndex < separatorIndex) {\n return line;\n }\n const key = line.slice(0, separatorIndex + 2);\n const value = line.slice(separatorIndex + 2);\n if (!value.startsWith('\"')) {\n return line;\n }\n return key + value.replaceAll(\"[\", \"\\\\u005b\");\n })\n .join(\"\\n\");\n}\n\n/**\n * Decode a TOON item document, working around the upstream bracket mis-parse\n * bug described in {@link escapeBracketsInQuotedScalars}.\n *\n * Strict decode is attempted first (the fast path for all well-formed\n * documents). Only if it fails is the scalar-bracket escape applied and strict\n * decode retried, so the workaround never relaxes strict validation; it only\n * removes the specific trigger. If the escaped content is identical to the\n * original (no quoted-scalar bracket to neutralise) the original strict error is\n * surfaced unchanged; if the retry itself fails the document has a genuine\n * problem beyond the bracket bug and that error propagates.\n */\nexport function decodeToonItemContent(content: string): ToonDecodeResult {\n try {\n return { value: decodeToon(content), usedScalarBracketEscape: false };\n } catch (strictError) {\n const escaped = escapeBracketsInQuotedScalars(content);\n if (escaped === content) {\n throw strictError;\n }\n return { value: decodeToon(escaped), usedScalarBracketEscape: true };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,aAAa,OAAa;AACjC,QAAM,WAAW,MACd,KAAI,EACJ,WAAW,kBAAkB,GAAG,EAChC,MAAM,KAAK,EACX,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC,EACtC,IAAI,CAAC,YAAY,QAAQ,YAAW,CAAE;AACzC,MAAI,SAAS,WAAW,GAAG;AACzB,WAAO;EACT;AACA,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AACzB,SAAO,GAAG,KAAK,GAAG,KAAK,IAAI,CAAC,YAAY,GAAG,QAAQ,MAAM,GAAG,CAAC,EAAE,YAAW,CAAE,GAAG,QAAQ,MAAM,CAAC,CAAC,EAAE,EAAE,KAA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../../core/config/nested-settings.ts"],"sourcesContent":["/**\n * Nested leaf settings exposed via `pm config <scope> set/get <key> <value>`.\n *\n * These are simple string/number leaves of {@link PmSettings} (provider URLs,\n * vector-store adapter, search tuning) that previously required hand-editing\n * `.agents/pm/settings.json`. They live here so the same dotted path is\n * documented in one place and surfaced both to the config dispatcher and to\n * `pm config list` (so `pm config list --json` is discoverable).\n *\n * Shape conventions:\n * - `path` is the dotted JSON path in {@link PmSettings} (e.g. `search.provider`).\n * - `kind` is the value shape: \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\"\n * - \"ratio\" must be a finite number in [0, 1].\n * - \"integer\" must be a finite non-negative integer. Set `min: 1` for keys\n * where the runtime silently falls back when 0 is supplied (e.g. batch\n * size, timeout, max-results limits).\n * - \"number\" must be a finite number — negatives ARE allowed (e.g. score\n * thresholds may legitimately be negative when a provider normalizes\n * scores into a signed range).\n *\n * Adding a key here makes it acceptable to `pm config <scope> set <key> <value>`\n * with no other code changes — the dispatcher walks the dotted path on the\n * already-validated PmSettings shape.\n */\n\n/** Supported coercion shapes for nested settings exposed through `pm config`. */\nexport type NestedSettingKind = \"string\" | \"boolean\" | \"integer\" | \"number\" | \"ratio\";\n\n/**\n * Documents the nested setting descriptor payload exchanged by command, SDK, and package integrations.\n */\nexport interface NestedSettingDescriptor {\n /** CLI key (snake_case). Kebab-case form is accepted by normalizing `-` → `_`. */\n key: string;\n /** Dotted JSON path in PmSettings. */\n path: string;\n /** Value shape. */\n kind: NestedSettingKind;\n /** Short human-facing summary for `pm config list`. */\n summary: string;\n /** Optional accepted values for string settings. */\n choices?: readonly string[];\n /** Require a non-empty trimmed string value for string settings. */\n non_empty?: boolean;\n /**\n * Optional minimum value for `integer` / `number` kinds. When set,\n * `parseNestedSettingValue` rejects values strictly below `min`. Useful for\n * settings where 0 would be silently ignored by the runtime (batch sizes,\n * timeouts, max-results limits).\n */\n min?: number;\n}\n\n/**\n * Search/provider/vector-store leaves. Order is the display order in\n * `pm config list` and in error hints.\n */\nexport const NESTED_SETTING_DESCRIPTORS: readonly NestedSettingDescriptor[] = [\n {\n key: \"search_provider\",\n path: \"search.provider\",\n kind: \"string\",\n summary: \"Search embedding provider name (e.g. openai, ollama, or an extension provider).\",\n },\n {\n key: \"search_mutation_refresh_policy\",\n path: \"search.mutation_refresh_policy\",\n kind: \"string\",\n choices: [\"cache_only\", \"semantic_configured\", \"semantic_auto\"],\n summary: \"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto.\",\n },\n {\n key: \"search_query_expansion_enabled\",\n path: \"search.query_expansion.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable query expansion for semantic/hybrid search.\",\n },\n {\n key: \"search_query_expansion_provider\",\n path: \"search.query_expansion.provider\",\n kind: \"string\",\n summary: \"Query expansion provider name (built-in openai/ollama or extension provider).\",\n },\n {\n key: \"search_rerank_enabled\",\n path: \"search.rerank.enabled\",\n kind: \"boolean\",\n summary: \"Enable or disable post-retrieval reranking for hybrid search.\",\n },\n {\n key: \"search_rerank_model\",\n path: \"search.rerank.model\",\n kind: \"string\",\n summary: \"Rerank model name override used by built-in providers.\",\n },\n {\n key: \"search_rerank_top_k\",\n path: \"search.rerank.top_k\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of top hybrid candidates to rerank when rerank is enabled.\",\n },\n {\n key: \"search_embedding_model\",\n path: \"search.embedding_model\",\n kind: \"string\",\n summary: \"Default embedding model name (overrides provider-specific model when set).\",\n },\n {\n key: \"search_embedding_corpus_max_characters\",\n path: \"search.embedding_corpus_max_characters\",\n kind: \"integer\",\n min: 1,\n summary: \"Maximum semantic corpus characters per item before truncation.\",\n },\n {\n key: \"search_embedding_batch_size\",\n path: \"search.embedding_batch_size\",\n kind: \"integer\",\n min: 1,\n summary: \"Number of items embedded per request batch.\",\n },\n {\n key: \"search_embedding_timeout_ms\",\n path: \"search.embedding_timeout_ms\",\n kind: \"integer\",\n min: 1,\n summary: \"Per-request embedding timeout in milliseconds.\",\n },\n {\n key: \"search_score_threshold\",\n path: \"search.score_threshold\",\n kind: \"number\",\n summary: \"Minimum score for a hit to be returned (0 keeps all matches).\",\n },\n {\n key: \"search_hybrid_semantic_weight\",\n path: \"search.hybrid_semantic_weight\",\n kind: \"ratio\",\n summary: \"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword).\",\n },\n {\n key: \"search_max_results\",\n path: \"search.max_results\",\n kind: \"integer\",\n min: 1,\n summary: \"Default upper bound on search hits when --limit is not supplied.\",\n },\n {\n key: \"search_bm25_k1\",\n path: \"search.bm25.k1\",\n kind: \"number\",\n min: 0,\n summary: \"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2).\",\n },\n {\n key: \"search_bm25_b\",\n path: \"search.bm25.b\",\n kind: \"ratio\",\n summary: \"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75).\",\n },\n {\n key: \"openai_base_url\",\n path: \"providers.openai.base_url\",\n kind: \"string\",\n summary: \"OpenAI-compatible API base URL (LM Studio/vLLM also use this).\",\n },\n {\n key: \"openai_api_key\",\n path: \"providers.openai.api_key\",\n kind: \"string\",\n summary: \"OpenAI-compatible API key.\",\n },\n {\n key: \"openai_model\",\n path: \"providers.openai.model\",\n kind: \"string\",\n summary: \"OpenAI-compatible embedding model name.\",\n },\n {\n key: \"ollama_base_url\",\n path: \"providers.ollama.base_url\",\n kind: \"string\",\n summary: \"Ollama API base URL (typically http://localhost:11434).\",\n },\n {\n key: \"ollama_model\",\n path: \"providers.ollama.model\",\n kind: \"string\",\n summary: \"Ollama embedding model name (e.g. nomic-embed-text).\",\n },\n {\n key: \"vector_store_adapter\",\n path: \"vector_store.adapter\",\n kind: \"string\",\n summary: \"Vector store adapter name (lancedb, qdrant, or an extension adapter).\",\n },\n {\n key: \"vector_store_collection_name\",\n path: \"vector_store.collection_name\",\n kind: \"string\",\n non_empty: true,\n summary: \"Vector collection/table name shared by Qdrant and LanceDB adapters.\",\n },\n {\n key: \"qdrant_url\",\n path: \"vector_store.qdrant.url\",\n kind: \"string\",\n summary: \"Qdrant HTTP API URL.\",\n },\n {\n key: \"qdrant_api_key\",\n path: \"vector_store.qdrant.api_key\",\n kind: \"string\",\n summary: \"Qdrant API key (empty if running unauthenticated).\",\n },\n {\n key: \"lancedb_path\",\n path: \"vector_store.lancedb.path\",\n kind: \"string\",\n summary: \"LanceDB storage path (relative to pm root or absolute).\",\n },\n // General workspace leaves (id/author/output/locks/schema governance). These\n // are documented user-facing settings in CONFIGURATION.md that previously\n // required hand-editing settings.json.\n {\n key: \"id_prefix\",\n path: \"id_prefix\",\n kind: \"string\",\n non_empty: true,\n summary: \"Prefix for generated item IDs (e.g. \\\"pm\\\" produces pm-xxxx).\",\n },\n {\n key: \"author_default\",\n path: \"author_default\",\n kind: \"string\",\n non_empty: true,\n summary: \"Default author recorded on mutations when --author is not supplied.\",\n },\n {\n key: \"output_default_format\",\n path: \"output.default_format\",\n kind: \"string\",\n choices: [\"toon\", \"json\"],\n summary: \"Default output format for commands that support it: toon or json.\",\n },\n {\n key: \"locks_ttl_seconds\",\n path: \"locks.ttl_seconds\",\n kind: \"integer\",\n min: 1,\n summary: \"Claim/lock time-to-live in seconds before a stale lock can be reclaimed.\",\n },\n {\n key: \"checkpoints_retention_days\",\n path: \"checkpoints.retention_days\",\n kind: \"integer\",\n min: 1,\n summary: \"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints.\",\n },\n {\n key: \"schema_unknown_field_policy\",\n path: \"schema.unknown_field_policy\",\n kind: \"string\",\n choices: [\"allow\", \"warn\", \"reject\"],\n summary: \"How item I/O handles metadata keys not in the field registry: allow, warn, or reject.\",\n },\n // History compaction policy leaves (pm health advisory + pm history-compact\n // bulk-sweep default threshold). Disabled by default; enabling makes large\n // streams discoverable without a manual stats pass.\n {\n key: \"history_compact_policy_enabled\",\n path: \"history.compact_policy.enabled\",\n kind: \"boolean\",\n summary: \"Enable the history-compaction advisory: pm health warns on over-threshold streams.\",\n },\n {\n key: \"history_compact_policy_max_entries\",\n path: \"history.compact_policy.max_entries\",\n kind: \"integer\",\n min: 1,\n summary: \"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold).\",\n },\n {\n key: \"history_compact_policy_trigger\",\n path: \"history.compact_policy.trigger\",\n kind: \"string\",\n choices: [\"health_warn\", \"auto\"],\n summary: \"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected).\",\n },\n];\n\nconst DESCRIPTOR_BY_KEY: ReadonlyMap<string, NestedSettingDescriptor> = new Map(\n NESTED_SETTING_DESCRIPTORS.map((descriptor) => [descriptor.key, descriptor]),\n);\n\n/**\n * Map a raw user-supplied key (kebab or snake case, any casing) onto a known\n * nested-leaf descriptor. Returns `undefined` when the key is not a nested\n * leaf (callers can then fall back to the regular ConfigKey path).\n */\nexport function resolveNestedSettingDescriptor(raw: string | undefined): NestedSettingDescriptor | undefined {\n if (typeof raw !== \"string\") {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n return undefined;\n }\n return DESCRIPTOR_BY_KEY.get(normalized);\n}\n\n/** Recoverable parsed value with the descriptor it satisfied. */\nexport interface NestedSettingParsedValue {\n descriptor: NestedSettingDescriptor;\n value: string | number | boolean;\n}\n\n/** Throwable validation error returned as a structured result. */\nexport interface NestedSettingParseError {\n message: string;\n}\n\n/**\n * Restricts nested setting parse result values accepted by command, SDK, and storage contracts.\n */\nexport type NestedSettingParseResult =\n | { ok: true; parsed: NestedSettingParsedValue }\n | { ok: false; error: NestedSettingParseError };\n\nfunction parseNestedBooleanValue(descriptor: NestedSettingDescriptor, rawValue: string): NestedSettingParseResult {\n const normalized = rawValue.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\" || normalized === \"on\") {\n return { ok: true, parsed: { descriptor, value: true } };\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\" || normalized === \"off\") {\n return { ok: true, parsed: { descriptor, value: false } };\n }\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires a boolean value (true|false), got \"${rawValue}\"`,\n },\n };\n}\n\nfunction parseNestedStringValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n trimmed: string,\n): NestedSettingParseResult {\n if (descriptor.non_empty === true && trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n if (descriptor.choices && !descriptor.choices.includes(trimmed)) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} must be one of ${descriptor.choices.join(\"|\")}, got \"${rawValue}\"`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value: trimmed } };\n}\n\nfunction parseFiniteNestedNumber(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n trimmed: string,\n): { ok: true; value: number } | { ok: false; error: NestedSettingParseError } {\n if (trimmed.length === 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-empty value` },\n };\n }\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a finite number, got \"${rawValue}\"` },\n };\n }\n return { ok: true, value: parsed };\n}\n\nfunction parseNestedIntegerValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n value: number,\n): NestedSettingParseResult {\n if (!Number.isInteger(value) || value < 0) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a non-negative integer, got \"${rawValue}\"` },\n };\n }\n if (descriptor.min !== undefined && value < descriptor.min) {\n return {\n ok: false,\n error: {\n message: `Config set ${descriptor.key} requires an integer >= ${descriptor.min}, got \"${rawValue}\" (the runtime silently ignores 0 here and falls back to the default)`,\n },\n };\n }\n return { ok: true, parsed: { descriptor, value } };\n}\n\nfunction parseNestedRatioValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n value: number,\n): NestedSettingParseResult {\n if (value < 0 || value > 1) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number in [0, 1], got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value } };\n}\n\nfunction parseNestedNumberValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n value: number,\n): NestedSettingParseResult {\n if (descriptor.min !== undefined && value < descriptor.min) {\n return {\n ok: false,\n error: { message: `Config set ${descriptor.key} requires a number >= ${descriptor.min}, got \"${rawValue}\"` },\n };\n }\n return { ok: true, parsed: { descriptor, value } };\n}\n\n/**\n * Validate and coerce a raw string value for a nested-leaf setting. The\n * returned value is the typed leaf that should be written into PmSettings.\n *\n * Empty strings are allowed for \"string\" leaves unless `non_empty` is set.\n */\nexport function parseNestedSettingValue(\n descriptor: NestedSettingDescriptor,\n rawValue: string,\n): NestedSettingParseResult {\n if (typeof rawValue !== \"string\") {\n return { ok: false, error: { message: `Config set ${descriptor.key} requires a string value` } };\n }\n const trimmed = rawValue.trim();\n if (descriptor.kind === \"boolean\") {\n return parseNestedBooleanValue(descriptor, rawValue);\n }\n if (descriptor.kind === \"string\") {\n return parseNestedStringValue(descriptor, rawValue, trimmed);\n }\n\n // Number(\"\") === 0, which would silently accept empty / whitespace-only input\n // as a valid zero. Reject explicitly so misconfigurations don't slip through.\n const parsed = parseFiniteNestedNumber(descriptor, rawValue, trimmed);\n if (!parsed.ok) {\n return { ok: false, error: parsed.error };\n }\n if (descriptor.kind === \"integer\") {\n return parseNestedIntegerValue(descriptor, rawValue, parsed.value);\n }\n if (descriptor.kind === \"ratio\") {\n return parseNestedRatioValue(descriptor, rawValue, parsed.value);\n }\n // kind === \"number\" — negatives are allowed; only apply an explicit `min`.\n return parseNestedNumberValue(descriptor, rawValue, parsed.value);\n}\n\n/** Walk a dotted path on an arbitrary record (best-effort, returns null on miss). */\nexport function readNestedSettingValue(\n settings: unknown,\n descriptor: NestedSettingDescriptor,\n): string | number | boolean | null {\n const segments = descriptor.path.split(\".\");\n let cursor: unknown = settings;\n for (const segment of segments) {\n if (typeof cursor !== \"object\" || cursor === null) {\n return null;\n }\n cursor = (cursor as Record<string, unknown>)[segment];\n }\n if (typeof cursor === \"string\" || typeof cursor === \"number\" || typeof cursor === \"boolean\") {\n return cursor;\n }\n return null;\n}\n\n/**\n * Set a leaf value on a settings object by walking the descriptor's dotted\n * path. Missing intermediate objects are created. Returns `true` when the\n * value actually changed.\n */\nexport function writeNestedSettingValue(\n settings: Record<string, unknown>,\n descriptor: NestedSettingDescriptor,\n value: string | number | boolean,\n): boolean {\n const segments = descriptor.path.split(\".\");\n let cursor: Record<string, unknown> = settings;\n for (let index = 0; index < segments.length - 1; index += 1) {\n const segment = segments[index];\n const existing = cursor[segment];\n if (typeof existing !== \"object\" || existing === null || Array.isArray(existing)) {\n const next: Record<string, unknown> = {};\n cursor[segment] = next;\n cursor = next;\n } else {\n cursor = existing as Record<string, unknown>;\n }\n }\n const leafKey = segments[segments.length - 1];\n const previous = cursor[leafKey];\n if (previous === value) {\n return false;\n }\n cursor[leafKey] = value;\n return true;\n}\n"],"names":[],"mappings":";;;AAyDO,IAAM,6BAAiE;EAC5E;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS,CAAC,cAAc,uBAAuB,eAAe;IAC9D,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,SAAS;;EAEX;IACE,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,SAAS;;EAEX;IACE,KAAK;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WAAW,WAAW,KAAK,MAAM,GAAG;AAC1C,MAAI,SAAkC;AACtC,WAAS,QAAQ,GAAG,QAAQ,SAAS,SAAS,GAAG,SAAS,GAAG;AAC3D,UAAM,UAAU,SAAS,KAAK;AAC9B,UAAM,WAAW,OAAO,OAAO;AAC/B,QAAI,OAAO,aAAa,YAAY,aAAa,QAAQ,MAAM,QAAQ,QAAQ,GAAG;AAChF,YAAM,OAAgC,CAAA;AACtC,aAAO,OAAO,IAAI;AAClB,eAAS;IACX,OAAO;AACL,eAAS;IACX;EACF;AACA,QAAM,UAAU,SAAS,SAAS,SAAS,CAAC;AAC5C,QAAM,WAAW,OAAO,OAAO;AAC/B,MAAI,aAAa,OAAO;AACtB,WAAO;EACT;AACA,SAAO,OAAO,IAAI;AAClB,SAAO;AACT","debugId":"59d8165f-bfcc-561b-a219-0a695dc2d878"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/claim.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/claim\n *\n * Implements the pm claim command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { resolveRuntimeStatusRegistry, statusIsTerminal } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { wrapOwnershipConflict } from \"./annotation-command.js\";\n\n/**\n * Documents the claim result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ClaimResult {\n item: Record<string, unknown>;\n claimed_by: string;\n previous_assignee: string | null;\n forced: boolean;\n skipped?: boolean;\n warnings?: string[];\n}\n\n/**\n * Documents the release result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReleaseResult {\n item: Record<string, unknown>;\n released_by: string;\n previous_assignee: string | null;\n audit_release: boolean;\n forced: boolean;\n}\n\n/**\n * Documents the claim mutation options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ClaimMutationOptions {\n author?: string;\n message?: string;\n ifAvailable?: boolean;\n}\n\n/**\n * Documents the release mutation options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReleaseMutationOptions extends ClaimMutationOptions {\n allowAuditRelease?: boolean;\n}\n\n/**\n * Implements run claim for the public runtime surface of this module.\n */\nexport async function runClaim(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n): Promise<ClaimResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n let skipped = false;\n const mutationWarnings: string[] = [];\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"claim\",\n author,\n message: options.message,\n force,\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (statusIsTerminal(document.metadata.status, statusRegistry) && !force) {\n throw new PmCliError(`Cannot claim terminal item ${document.metadata.id} without --force`, EXIT_CODE.CONFLICT);\n }\n const heldByOther = previousAssignee !== null && previousAssignee !== author;\n if (heldByOther && options.ifAvailable === true) {\n skipped = true;\n mutationWarnings.push(`claim_skipped_held_by:${previousAssignee}`);\n return { changedFields: [] };\n }\n if (heldByOther) {\n mutationWarnings.push(`claim_takeover:${previousAssignee}->${author}`);\n }\n document.metadata.assignee = author;\n return { changedFields: [\"assignee\"], warnings: mutationWarnings };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n claimed_by: skipped && previousAssignee !== null ? previousAssignee : author,\n previous_assignee: previousAssignee,\n forced: force,\n ...(skipped ? { skipped: true } : {}),\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\n/**\n * Implements run release for the public runtime surface of this module.\n */\nexport async function runRelease(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ReleaseMutationOptions = {},\n): Promise<ReleaseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"release\",\n author,\n message: options.message,\n force,\n bypassAssigneeConflict: Boolean(options.allowAuditRelease),\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (!previousAssignee) {\n return { changedFields: [] };\n }\n delete document.metadata.assignee;\n return { changedFields: [\"assignee\"] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, {\n required: \"For audited non-owner handoffs, prefer --allow-audit-release before considering --force.\",\n examples: ['pm release pm-a1b2 --author \"reviewer\" --allow-audit-release'],\n nextSteps: [\n \"Use --allow-audit-release for append-only release handoffs that only clear assignee metadata.\",\n \"Use --force only when an explicit override is approved for broader ownership conflicts.\",\n ],\n });\n }\n\n return {\n item: toItemRecord(result.item),\n released_by: author,\n previous_assignee: previousAssignee,\n audit_release: options.allowAuditRelease === true,\n forced: force,\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,eAAsB,SACpB,IACA,OACAA,SACA,UAAgC,CAAA,GAAE;AA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,eAAsB,WACpB,IACA,OACAA,SACA,UAAkC,CAAA,GAAE;AAEpC,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAIA,QAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AACpE,MAAI,mBAAkC;AAEtC,MAAI;AACJ,MAAI;AACF,aAAS,MAAM,WAAW;MACxB;MACA;MACA;MACA,IAAI;MACJ;MACA,SAAS,QAAQ;MACjB;MACA,wBAAwB,QAAQ,QAAQ,iBAAiB;MACzD,OAAO,UAAQ;AACb,2BAAmB,SAAS,SAAS,YAAY;AACjD,YAAI,CAAC,kBAAkB;AACrB,iBAAO,EAAE,eAAe,CAAA,EAAE;QAC5B;AACA,eAAO,SAAS,SAAS;AACzB,eAAO,EAAE,eAAe,CAAC,UAAU,EAAC;MACtC;KACD;EACH,SAAS,OAAgB;AACvB,0BAAsB,OAAO;MAC3B,UAAU;MACV,UAAU,CAAC,8DAA8D;MACzE,WAAW;QACT;QACA;;KAEH;EACH;AAEA,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,aAAa;IACb,mBAAmB;IACnB,eAAe,QAAQ,sBAAsB;IAC7C,QAAQ;;AAEZ;",
|
|
6
|
-
"names": ["global"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/claim.ts"],"sourcesContent":["/**\n * @module cli/commands/claim\n *\n * Implements the pm claim command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { resolveRuntimeStatusRegistry, statusIsTerminal } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { wrapOwnershipConflict } from \"./annotation-command.js\";\n\n/**\n * Documents the claim result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ClaimResult {\n item: Record<string, unknown>;\n claimed_by: string;\n previous_assignee: string | null;\n forced: boolean;\n skipped?: boolean;\n warnings?: string[];\n}\n\n/**\n * Documents the release result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReleaseResult {\n item: Record<string, unknown>;\n released_by: string;\n previous_assignee: string | null;\n audit_release: boolean;\n forced: boolean;\n}\n\n/**\n * Documents the claim mutation options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ClaimMutationOptions {\n author?: string;\n message?: string;\n ifAvailable?: boolean;\n}\n\n/**\n * Documents the release mutation options payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReleaseMutationOptions extends ClaimMutationOptions {\n allowAuditRelease?: boolean;\n}\n\n/**\n * Implements run claim for the public runtime surface of this module.\n */\nexport async function runClaim(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ClaimMutationOptions = {},\n): Promise<ClaimResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n let skipped = false;\n const mutationWarnings: string[] = [];\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"claim\",\n author,\n message: options.message,\n force,\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (statusIsTerminal(document.metadata.status, statusRegistry) && !force) {\n throw new PmCliError(`Cannot claim terminal item ${document.metadata.id} without --force`, EXIT_CODE.CONFLICT);\n }\n const heldByOther = previousAssignee !== null && previousAssignee !== author;\n if (heldByOther && options.ifAvailable === true) {\n skipped = true;\n mutationWarnings.push(`claim_skipped_held_by:${previousAssignee}`);\n return { changedFields: [] };\n }\n if (heldByOther) {\n mutationWarnings.push(`claim_takeover:${previousAssignee}->${author}`);\n }\n document.metadata.assignee = author;\n return { changedFields: [\"assignee\"], warnings: mutationWarnings };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n claimed_by: skipped && previousAssignee !== null ? previousAssignee : author,\n previous_assignee: previousAssignee,\n forced: force,\n ...(skipped ? { skipped: true } : {}),\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\n/**\n * Implements run release for the public runtime surface of this module.\n */\nexport async function runRelease(\n id: string,\n force: boolean,\n global: GlobalOptions,\n options: ReleaseMutationOptions = {},\n): Promise<ReleaseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n let previousAssignee: string | null = null;\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"release\",\n author,\n message: options.message,\n force,\n bypassAssigneeConflict: Boolean(options.allowAuditRelease),\n mutate(document) {\n previousAssignee = document.metadata.assignee ?? null;\n if (!previousAssignee) {\n return { changedFields: [] };\n }\n delete document.metadata.assignee;\n return { changedFields: [\"assignee\"] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, {\n required: \"For audited non-owner handoffs, prefer --allow-audit-release before considering --force.\",\n examples: ['pm release pm-a1b2 --author \"reviewer\" --allow-audit-release'],\n nextSteps: [\n \"Use --allow-audit-release for append-only release handoffs that only clear assignee metadata.\",\n \"Use --force only when an explicit override is approved for broader ownership conflicts.\",\n ],\n });\n }\n\n return {\n item: toItemRecord(result.item),\n released_by: author,\n previous_assignee: previousAssignee,\n audit_release: options.allowAuditRelease === true,\n forced: force,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,eAAsB,SACpB,IACA,OACA,QACA,UAAgC,CAAA,GAAE;AAElC,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,iBAAiB,6BAA6B,SAAS,MAAM;AACnE,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AACpE,MAAI,mBAAkC;AACtC,MAAI,UAAU;AACd,QAAM,mBAA6B,CAAA;AAEnC,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB;IACA,OAAO,UAAQ;AACb,yBAAmB,SAAS,SAAS,YAAY;AACjD,UAAI,iBAAiB,SAAS,SAAS,QAAQ,cAAc,KAAK,CAAC,OAAO;AACxE,cAAM,IAAI,WAAW,8BAA8B,SAAS,SAAS,EAAE,oBAAoB,UAAU,QAAQ;MAC/G;AACA,YAAM,cAAc,qBAAqB,QAAQ,qBAAqB;AACtE,UAAI,eAAe,QAAQ,gBAAgB,MAAM;AAC/C,kBAAU;AACV,yBAAiB,KAAK,yBAAyB,gBAAgB,EAAE;AACjE,eAAO,EAAE,eAAe,CAAA,EAAE;MAC5B;AACA,UAAI,aAAa;AACf,yBAAiB,KAAK,kBAAkB,gBAAgB,KAA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AAQ;;AAEZ","debugId":"230791bf-0057-5639-aad3-2bb852119f5e"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
_testOnlyCloseCommand,
|
|
3
|
-
runClose
|
|
4
|
-
} from "./chunk-WRYERRZX.js";
|
|
5
|
-
import "./chunk-SU3TB4NS.js";
|
|
6
|
-
import "./chunk-6KRFL33E.js";
|
|
7
|
-
import "./chunk-3W2HJKJX.js";
|
|
8
|
-
import "./chunk-AJHYQCBJ.js";
|
|
9
|
-
import "./chunk-KHVGM5CS.js";
|
|
10
|
-
export {
|
|
11
|
-
_testOnlyCloseCommand,
|
|
12
|
-
runClose
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=close-6YODBUIV.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
_testOnlyCreateCommand,
|
|
3
|
-
parseDocs,
|
|
4
|
-
parseFiles,
|
|
5
|
-
parseLogSeed,
|
|
6
|
-
parseTests,
|
|
7
|
-
runCreate
|
|
8
|
-
} from "./chunk-4EXFFP7T.js";
|
|
9
|
-
import "./chunk-MDHWWBNZ.js";
|
|
10
|
-
import "./chunk-5E7N4T2Z.js";
|
|
11
|
-
import "./chunk-P5L7Z2O6.js";
|
|
12
|
-
import "./chunk-FUFFPIYA.js";
|
|
13
|
-
import "./chunk-5HIZDR5A.js";
|
|
14
|
-
import "./chunk-6NYJGMTY.js";
|
|
15
|
-
import "./chunk-EQURFOMH.js";
|
|
16
|
-
import "./chunk-6KRFL33E.js";
|
|
17
|
-
import "./chunk-3W2HJKJX.js";
|
|
18
|
-
import "./chunk-AJHYQCBJ.js";
|
|
19
|
-
import "./chunk-KHVGM5CS.js";
|
|
20
|
-
export {
|
|
21
|
-
_testOnlyCreateCommand,
|
|
22
|
-
parseDocs,
|
|
23
|
-
parseFiles,
|
|
24
|
-
parseLogSeed,
|
|
25
|
-
parseTests,
|
|
26
|
-
runCreate
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=create-Z7YCH3BE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/files.ts"],"sourcesContent":["/**\n * @module cli/commands/files\n *\n * Implements the pm files command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport type { ItemDocument, LinkedFile, LinkScope } from \"../../types/index.js\";\nimport {\n dedupeLinkedArtifacts,\n normalizeLinkedPath,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/**\n * Documents the files command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the files discover options payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoverOptions {\n apply?: boolean;\n appendStable?: boolean;\n note?: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the files discovery candidate payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoveryCandidate {\n path: string;\n scope: LinkScope;\n status: \"addable\" | \"already_linked\";\n source_count: number;\n source_fields: string[];\n original_paths: string[];\n}\n\n/**\n * Documents the files result payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\n/**\n * Documents the files discover result payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoverResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n apply: boolean;\n count: number;\n candidate_count: number;\n addable_count: number;\n added_count: number;\n skipped_existing_count: number;\n candidates: FilesDiscoveryCandidate[];\n added: LinkedFile[];\n skipped_existing: FilesDiscoveryCandidate[];\n}\n\ninterface TextReference {\n field: string;\n value: string;\n}\n\ninterface RawPathReference {\n field: string;\n value: string;\n}\n\nfunction normalizeCandidatePathForOutput(value: string): string {\n return normalizeLinkedPath(path.normalize(value));\n}\n\nasync function realpathForContainment(inputPath: string): Promise<string> {\n try {\n return await fs.realpath(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nfunction linkedFileResolvedKey(linkedFile: Pick<LinkedFile, \"path\" | \"scope\">, projectRoot: string): string {\n const resolvedPath = path.isAbsolute(linkedFile.path)\n ? path.resolve(linkedFile.path)\n : path.resolve(projectRoot, linkedFile.path);\n return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;\n}\n\nfunction collectTextReferences(value: unknown, fieldPath: string, references: TextReference[]): void {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n references.push({ field: fieldPath, value: trimmed });\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry, index) => collectTextReferences(entry, `${fieldPath}[${index}]`, references));\n return;\n }\n if (typeof value === \"object\" && value !== null) {\n for (const [key, nested] of Object.entries(value)) {\n /* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */\n collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);\n }\n }\n}\n\nfunction collectItemTextReferences(document: ItemDocument): TextReference[] {\n const references: TextReference[] = [];\n collectTextReferences(document.metadata, \"metadata\", references);\n collectTextReferences(document.body, \"body\", references);\n return references;\n}\n\nfunction cleanupPathToken(value: string): string {\n let next = value.trim();\n next = next.replace(/^[`\"'<([{]+/u, \"\");\n next = next.replace(/[`\"'>)\\]},;!?]+$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n next = next.replace(/:(?:\\d+)(?::\\d+)?$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n return next;\n}\n\nfunction extractRawPathReferences(references: TextReference[]): RawPathReference[] {\n const rawReferences: RawPathReference[] = [];\n const absolutePattern = /(?:[A-Za-z]:[\\\\/]|\\/)[^\\s\"'`<>()\\[\\]{},;]+/gu;\n const relativePattern =\n /(?:\\.{1,2}[\\\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;\n for (const reference of references) {\n const seenInField = new Set<string>();\n for (const pattern of [absolutePattern, relativePattern]) {\n pattern.lastIndex = 0;\n for (const match of reference.value.matchAll(pattern)) {\n /* c8 ignore next -- RegExp match arrays always expose capture [0]. */\n const token = cleanupPathToken(match[0] ?? \"\");\n if (!token || seenInField.has(token)) {\n continue;\n }\n seenInField.add(token);\n rawReferences.push({ field: reference.field, value: token });\n }\n }\n }\n return rawReferences;\n}\n\nasync function resolveDiscoveredFile(\n rawPath: string,\n projectRoot: string,\n): Promise<Pick<LinkedFile, \"path\" | \"scope\"> | undefined> {\n const absolutePath = path.isAbsolute(rawPath) ? path.resolve(rawPath) : path.resolve(projectRoot, rawPath);\n let stats;\n try {\n stats = await fs.stat(absolutePath);\n } catch {\n return undefined;\n }\n if (!stats.isFile()) {\n return undefined;\n }\n const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([\n realpathForContainment(projectRoot),\n realpathForContainment(absolutePath),\n ]);\n if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {\n const relativePath = path.relative(canonicalProjectRoot, canonicalAbsolutePath);\n if (!relativePath || relativePath.startsWith(\"..\") || path.isAbsolute(relativePath)) {\n return undefined;\n }\n return {\n path: normalizeCandidatePathForOutput(relativePath),\n scope: \"project\",\n };\n }\n return {\n path: normalizeCandidatePathForOutput(absolutePath),\n scope: \"global\",\n };\n}\n\nasync function discoverReferencedFiles(document: ItemDocument, projectRoot: string): Promise<FilesDiscoveryCandidate[]> {\n const existingResolvedKeys = new Set((document.metadata.files ?? []).map((entry) => linkedFileResolvedKey(entry, projectRoot)));\n const grouped = new Map<\n string,\n {\n path: string;\n scope: LinkScope;\n sourceFields: Set<string>;\n originalPaths: Set<string>;\n sourceCount: number;\n }\n >();\n const rawReferences = extractRawPathReferences(collectItemTextReferences(document));\n for (const reference of rawReferences) {\n const resolved = await resolveDiscoveredFile(reference.value, projectRoot);\n if (!resolved) {\n continue;\n }\n const key = linkedFileResolvedKey(resolved, projectRoot);\n const existing = grouped.get(key) ?? {\n path: resolved.path,\n scope: resolved.scope,\n sourceFields: new Set<string>(),\n originalPaths: new Set<string>(),\n sourceCount: 0,\n };\n existing.sourceFields.add(reference.field);\n existing.originalPaths.add(reference.value);\n existing.sourceCount += 1;\n grouped.set(key, existing);\n }\n return [...grouped.entries()]\n .map(([key, entry]) => ({\n path: entry.path,\n scope: entry.scope,\n status: existingResolvedKeys.has(key) ? (\"already_linked\" as const) : (\"addable\" as const),\n source_count: entry.sourceCount,\n source_fields: [...entry.sourceFields].sort((left, right) => left.localeCompare(right)),\n original_paths: [...entry.originalPaths].sort((left, right) => left.localeCompare(right)),\n }))\n .sort((left, right) => {\n const byStatus = left.status.localeCompare(right.status);\n if (byStatus !== 0) return byStatus;\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n /* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */\n return left.scope.localeCompare(right.scope);\n });\n}\n\nexport const _testOnly = {\n normalizeCandidatePathForOutput,\n realpathForContainment,\n linkedFileResolvedKey,\n collectTextReferences,\n collectItemTextReferences,\n cleanupPathToken,\n extractRawPathReferences,\n resolveDiscoveredFile,\n discoverReferencedFiles,\n};\n\n/**\n * Implements run files for the public runtime surface of this module.\n */\nexport async function runFiles(id: string, options: FilesCommandOptions, global: GlobalOptions): Promise<FilesResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"files\",\n op: \"files_add\",\n bareNoun: \"file\",\n supportsAppendStable: true,\n });\n return renameArtifactsResultKey(result, \"files\") as unknown as FilesResult;\n}\n\n/**\n * Implements run files discover for the public runtime surface of this module.\n */\nexport async function runFilesDiscover(\n id: string,\n options: FilesDiscoverOptions,\n global: GlobalOptions,\n): Promise<FilesDiscoverResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n /* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const candidates = await discoverReferencedFiles(loaded.document, process.cwd());\n const addableCandidates = candidates.filter((candidate) => candidate.status === \"addable\");\n const skippedExisting = candidates.filter((candidate) => candidate.status === \"already_linked\");\n const requestedApply = options.apply === true;\n const note = options.note?.trim() || \"discovered from item text\";\n\n if (!requestedApply || addableCandidates.length === 0) {\n const files = loaded.document.metadata.files ?? [];\n return {\n id: located.id,\n files,\n changed: false,\n apply: requestedApply,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: 0,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added: [],\n skipped_existing: skippedExisting,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const discoveredAdds: LinkedFile[] = addableCandidates.map((candidate) => ({\n path: candidate.path,\n scope: candidate.scope,\n note,\n }));\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"files_discover\",\n author,\n message: options.message ?? \"Discover referenced file links\",\n force: options.force,\n mutate(document) {\n const next = [...(document.metadata.files ?? [])];\n const existingResolvedKeys = new Set(next.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const appliedAdds: LinkedFile[] = [];\n for (const add of discoveredAdds) {\n const resolvedKey = linkedFileResolvedKey(add, process.cwd());\n /* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */\n if (existingResolvedKeys.has(resolvedKey)) {\n continue;\n }\n next.push(add);\n existingResolvedKeys.add(resolvedKey);\n appliedAdds.push(add);\n }\n const deduped = dedupeLinkedArtifacts(next);\n /* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */\n const normalized = options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n document.metadata.files = normalized;\n } else {\n delete document.metadata.files;\n }\n return {\n /* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */\n changedFields: appliedAdds.length > 0 ? [\"files\"] : [],\n /* c8 ignore next -- warning emission is exercised by race-aware integration tests. */\n warnings: appliedAdds.length !== discoveredAdds.length ? [`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`] : [],\n };\n },\n });\n\n const files = result.item.files ?? [];\n const addedResolvedKeys = new Set(discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const added = files.filter((entry) => addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())));\n return {\n id: result.item.id,\n files,\n changed: added.length > 0,\n apply: true,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: added.length,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added,\n skipped_existing: skippedExisting,\n };\n}\n"],"names":["files"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;AA4GjB,SAAS,gCAAgC,OAAa;AACpD,SAAO,oBAAoB,KAAK,UAAU,KAAK,CAAC;AAClD;AAEA,eAAe,uBAAuB,WAAiB;AACrD,MAAI;AACF,WAAO,MAAM,GAAG,SAAS,SAAS;EACpC,QAAQ;AACN,WAAO,KAAK,QAAQ,SAAS;EAC/B;AACF;AAEA,SAAS,sBAAsB,YAAgD,aAAmB;AAChG,QAAM,eAAe,KAAK,WAAW,WAAW,IAAI,IAChD,KAAK,QAAQ,WAAW,IAAI,IAC5B,KAAK,QAAQ,aAAa,WAAW,IAAI;AAC7C,SAAO,GAAG,gCAAgC,YAAY,CAAC,KAAK,WAAW,KAAK;AAC9E;AAEA,SAAS,sBAAsB,OAAgB,WAAmB,YAA2B;AAC3F,MAAI,OAAO,UAAU,UAAU;AAC7B,UAAM,UAAU,MAAM,KAAI;AAC1B,QAAI,QAAQ,SAAS,GAAG;AACtB,iBAAW,KAAK,EAAE,OAAO,WAAW,OAAO,QAAO,CAAE;IACtD;AACA;EACF;AACA,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,UAAM,QAAQ,CAAC,OAAO,UAAU,sBAAsB,OAAO,GAAG,SAAS,IAAI,KAAK,KAAK,UAAU,CAAC;AAClG;EACF;AACA,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,eAAW,CAAC,KAAK,MAAM,KAAK,OAAO,QAAQ,KAAK,GAAG;AAEjD,4BAAsB,QAAQ,YAAY,GAAG,SAAS,IAAI,GAAG,KAAK,KAAK,UAAU;IACnF;EACF;AACF;AAEA,SAAS,0B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,OAAO;AAC/E,UAAI,WAAW,SAAS,GAAG;AACzB,iBAAS,SAAS,QAAQ;MAC5B,OAAO;AACL,eAAO,SAAS,SAAS;MAC3B;AACA,aAAO;;QAEL,eAAe,YAAY,SAAS,IAAI,CAAC,OAAO,IAAI,CAAA;;QAEpD,UAAU,YAAY,WAAW,eAAe,SAAS,CAAC,mCAAmC,eAAe,SAAS,YAAY,MAAM,EAAE,IAAI,CAAA;;IAEjJ;GACD;AAED,QAAM,QAAQ,OAAO,KAAK,SAAS,CAAA;AACnC,QAAM,oBAAoB,IAAI,IAAI,eAAe,IAAI,CAAC,UAAU,sBAAsB,OAAO,QAAQ,IAAG,CAAE,CAAC,CAAC;AAC5G,QAAM,QAAQ,MAAM,OAAO,CAAC,UAAU,kBAAkB,IAAI,sBAAsB,OAAO,QAAQ,IAAG,CAAE,CAAC,CAAC;AACxG,SAAO;IACL,IAAI,OAAO,KAAK;IAChB;IACA,SAAS,MAAM,SAAS;IACxB,OAAO;IACP,OAAO,MAAM;IACb,iBAAiB,WAAW;IAC5B,eAAe,kBAAkB;IACjC,aAAa,MAAM;IACnB,wBAAwB,gBAAgB;IACxC;IACA;IACA,kBAAkB;;AAEtB","debugId":"a215aed4-e268-5b17-892e-2d0cb9be7285"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/files.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/files\n *\n * Implements the pm files command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport type { ItemDocument, LinkedFile, LinkScope } from \"../../types/index.js\";\nimport {\n dedupeLinkedArtifacts,\n normalizeLinkedPath,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n type LinkedArtifactResult,\n type LinkedPathAuditEntry,\n type LinkedPathValidation,\n} from \"./linked-artifacts.js\";\n\n/**\n * Documents the files command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /** GH-170 (pm-pfnx): standalone note applied to every --add/--add-glob link in this invocation. */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the files discover options payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoverOptions {\n apply?: boolean;\n appendStable?: boolean;\n note?: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the files discovery candidate payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoveryCandidate {\n path: string;\n scope: LinkScope;\n status: \"addable\" | \"already_linked\";\n source_count: number;\n source_fields: string[];\n original_paths: string[];\n}\n\n/**\n * Documents the files result payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n}\n\n/**\n * Documents the files discover result payload exchanged by command, SDK, and package integrations.\n */\nexport interface FilesDiscoverResult {\n id: string;\n files: LinkedFile[];\n changed: boolean;\n apply: boolean;\n count: number;\n candidate_count: number;\n addable_count: number;\n added_count: number;\n skipped_existing_count: number;\n candidates: FilesDiscoveryCandidate[];\n added: LinkedFile[];\n skipped_existing: FilesDiscoveryCandidate[];\n}\n\ninterface TextReference {\n field: string;\n value: string;\n}\n\ninterface RawPathReference {\n field: string;\n value: string;\n}\n\nfunction normalizeCandidatePathForOutput(value: string): string {\n return normalizeLinkedPath(path.normalize(value));\n}\n\nasync function realpathForContainment(inputPath: string): Promise<string> {\n try {\n return await fs.realpath(inputPath);\n } catch {\n return path.resolve(inputPath);\n }\n}\n\nfunction linkedFileResolvedKey(linkedFile: Pick<LinkedFile, \"path\" | \"scope\">, projectRoot: string): string {\n const resolvedPath = path.isAbsolute(linkedFile.path)\n ? path.resolve(linkedFile.path)\n : path.resolve(projectRoot, linkedFile.path);\n return `${normalizeCandidatePathForOutput(resolvedPath)}::${linkedFile.scope}`;\n}\n\nfunction collectTextReferences(value: unknown, fieldPath: string, references: TextReference[]): void {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n references.push({ field: fieldPath, value: trimmed });\n }\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry, index) => collectTextReferences(entry, `${fieldPath}[${index}]`, references));\n return;\n }\n if (typeof value === \"object\" && value !== null) {\n for (const [key, nested] of Object.entries(value)) {\n /* c8 ignore next -- root-level object traversal always carries a non-empty field path in current callers. */\n collectTextReferences(nested, fieldPath ? `${fieldPath}.${key}` : key, references);\n }\n }\n}\n\nfunction collectItemTextReferences(document: ItemDocument): TextReference[] {\n const references: TextReference[] = [];\n collectTextReferences(document.metadata, \"metadata\", references);\n collectTextReferences(document.body, \"body\", references);\n return references;\n}\n\nfunction cleanupPathToken(value: string): string {\n let next = value.trim();\n next = next.replace(/^[`\"'<([{]+/u, \"\");\n next = next.replace(/[`\"'>)\\]},;!?]+$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n next = next.replace(/:(?:\\d+)(?::\\d+)?$/u, \"\");\n next = next.replace(/[.]+$/u, \"\");\n return next;\n}\n\nfunction extractRawPathReferences(references: TextReference[]): RawPathReference[] {\n const rawReferences: RawPathReference[] = [];\n const absolutePattern = /(?:[A-Za-z]:[\\\\/]|\\/)[^\\s\"'`<>()\\[\\]{},;]+/gu;\n const relativePattern =\n /(?:\\.{1,2}[\\\\/])?(?:(?:[A-Za-z0-9_.@-]+[\\\\/])+[A-Za-z0-9_.@-]+|[A-Za-z0-9_.@-]+\\.[A-Za-z0-9][A-Za-z0-9._-]*)/gu;\n for (const reference of references) {\n const seenInField = new Set<string>();\n for (const pattern of [absolutePattern, relativePattern]) {\n pattern.lastIndex = 0;\n for (const match of reference.value.matchAll(pattern)) {\n /* c8 ignore next -- RegExp match arrays always expose capture [0]. */\n const token = cleanupPathToken(match[0] ?? \"\");\n if (!token || seenInField.has(token)) {\n continue;\n }\n seenInField.add(token);\n rawReferences.push({ field: reference.field, value: token });\n }\n }\n }\n return rawReferences;\n}\n\nasync function resolveDiscoveredFile(\n rawPath: string,\n projectRoot: string,\n): Promise<Pick<LinkedFile, \"path\" | \"scope\"> | undefined> {\n const absolutePath = path.isAbsolute(rawPath) ? path.resolve(rawPath) : path.resolve(projectRoot, rawPath);\n let stats;\n try {\n stats = await fs.stat(absolutePath);\n } catch {\n return undefined;\n }\n if (!stats.isFile()) {\n return undefined;\n }\n const [canonicalProjectRoot, canonicalAbsolutePath] = await Promise.all([\n realpathForContainment(projectRoot),\n realpathForContainment(absolutePath),\n ]);\n if (isPathWithinDirectory(canonicalProjectRoot, canonicalAbsolutePath)) {\n const relativePath = path.relative(canonicalProjectRoot, canonicalAbsolutePath);\n if (!relativePath || relativePath.startsWith(\"..\") || path.isAbsolute(relativePath)) {\n return undefined;\n }\n return {\n path: normalizeCandidatePathForOutput(relativePath),\n scope: \"project\",\n };\n }\n return {\n path: normalizeCandidatePathForOutput(absolutePath),\n scope: \"global\",\n };\n}\n\nasync function discoverReferencedFiles(document: ItemDocument, projectRoot: string): Promise<FilesDiscoveryCandidate[]> {\n const existingResolvedKeys = new Set((document.metadata.files ?? []).map((entry) => linkedFileResolvedKey(entry, projectRoot)));\n const grouped = new Map<\n string,\n {\n path: string;\n scope: LinkScope;\n sourceFields: Set<string>;\n originalPaths: Set<string>;\n sourceCount: number;\n }\n >();\n const rawReferences = extractRawPathReferences(collectItemTextReferences(document));\n for (const reference of rawReferences) {\n const resolved = await resolveDiscoveredFile(reference.value, projectRoot);\n if (!resolved) {\n continue;\n }\n const key = linkedFileResolvedKey(resolved, projectRoot);\n const existing = grouped.get(key) ?? {\n path: resolved.path,\n scope: resolved.scope,\n sourceFields: new Set<string>(),\n originalPaths: new Set<string>(),\n sourceCount: 0,\n };\n existing.sourceFields.add(reference.field);\n existing.originalPaths.add(reference.value);\n existing.sourceCount += 1;\n grouped.set(key, existing);\n }\n return [...grouped.entries()]\n .map(([key, entry]) => ({\n path: entry.path,\n scope: entry.scope,\n status: existingResolvedKeys.has(key) ? (\"already_linked\" as const) : (\"addable\" as const),\n source_count: entry.sourceCount,\n source_fields: [...entry.sourceFields].sort((left, right) => left.localeCompare(right)),\n original_paths: [...entry.originalPaths].sort((left, right) => left.localeCompare(right)),\n }))\n .sort((left, right) => {\n const byStatus = left.status.localeCompare(right.status);\n if (byStatus !== 0) return byStatus;\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n /* c8 ignore next -- path+status collisions are uncommon in deterministic fixtures. */\n return left.scope.localeCompare(right.scope);\n });\n}\n\nexport const _testOnly = {\n normalizeCandidatePathForOutput,\n realpathForContainment,\n linkedFileResolvedKey,\n collectTextReferences,\n collectItemTextReferences,\n cleanupPathToken,\n extractRawPathReferences,\n resolveDiscoveredFile,\n discoverReferencedFiles,\n};\n\n/**\n * Implements run files for the public runtime surface of this module.\n */\nexport async function runFiles(id: string, options: FilesCommandOptions, global: GlobalOptions): Promise<FilesResult> {\n const result: LinkedArtifactResult = await runLinkedArtifacts(id, options, global, {\n metadataKey: \"files\",\n op: \"files_add\",\n bareNoun: \"file\",\n supportsAppendStable: true,\n });\n return renameArtifactsResultKey(result, \"files\") as unknown as FilesResult;\n}\n\n/**\n * Implements run files discover for the public runtime surface of this module.\n */\nexport async function runFilesDiscover(\n id: string,\n options: FilesDiscoverOptions,\n global: GlobalOptions,\n): Promise<FilesDiscoverResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n /* c8 ignore next -- not-found behavior is validated by CLI integration coverage. */\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const candidates = await discoverReferencedFiles(loaded.document, process.cwd());\n const addableCandidates = candidates.filter((candidate) => candidate.status === \"addable\");\n const skippedExisting = candidates.filter((candidate) => candidate.status === \"already_linked\");\n const requestedApply = options.apply === true;\n const note = options.note?.trim() || \"discovered from item text\";\n\n if (!requestedApply || addableCandidates.length === 0) {\n const files = loaded.document.metadata.files ?? [];\n return {\n id: located.id,\n files,\n changed: false,\n apply: requestedApply,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: 0,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added: [],\n skipped_existing: skippedExisting,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const discoveredAdds: LinkedFile[] = addableCandidates.map((candidate) => ({\n path: candidate.path,\n scope: candidate.scope,\n note,\n }));\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"files_discover\",\n author,\n message: options.message ?? \"Discover referenced file links\",\n force: options.force,\n mutate(document) {\n const next = [...(document.metadata.files ?? [])];\n const existingResolvedKeys = new Set(next.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const appliedAdds: LinkedFile[] = [];\n for (const add of discoveredAdds) {\n const resolvedKey = linkedFileResolvedKey(add, process.cwd());\n /* c8 ignore next -- duplicate-key race paths are exercised in broader CLI race tests. */\n if (existingResolvedKeys.has(resolvedKey)) {\n continue;\n }\n next.push(add);\n existingResolvedKeys.add(resolvedKey);\n appliedAdds.push(add);\n }\n const deduped = dedupeLinkedArtifacts(next);\n /* c8 ignore next -- appendStable branch is covered through runFiles command contract tests. */\n const normalized = options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n document.metadata.files = normalized;\n } else {\n delete document.metadata.files;\n }\n return {\n /* c8 ignore next -- no-op mutation responses may emit empty changedFields for skipped discover batches. */\n changedFields: appliedAdds.length > 0 ? [\"files\"] : [],\n /* c8 ignore next -- warning emission is exercised by race-aware integration tests. */\n warnings: appliedAdds.length !== discoveredAdds.length ? [`files_discover_skipped_existing:${discoveredAdds.length - appliedAdds.length}`] : [],\n };\n },\n });\n\n const files = result.item.files ?? [];\n const addedResolvedKeys = new Set(discoveredAdds.map((entry) => linkedFileResolvedKey(entry, process.cwd())));\n const added = files.filter((entry) => addedResolvedKeys.has(linkedFileResolvedKey(entry, process.cwd())));\n return {\n id: result.item.id,\n files,\n changed: added.length > 0,\n apply: true,\n count: files.length,\n candidate_count: candidates.length,\n addable_count: addableCandidates.length,\n added_count: added.length,\n skipped_existing_count: skippedExisting.length,\n candidates,\n added,\n skipped_existing: skippedExisting,\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;;;;;;;;AA4GjB,SAAS,gCAAgC,OAAa;AACpD,SAAO,oBAAoB,KAAK,UAAU,KAAK,CAAC;AAClD;AAEA,eAAe,uBAAuB,WAAiB;AACrD,MAAI;AACF,WAAO,MAAM,GAAG,SAAS,SAAS;EACpC,QAAQ;AACN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AC;AAC5G,QAAM,QAAQ,MAAM,OAAO,CAAC,UAAU,kBAAkB,IAAI,sBAAsB,OAAO,QAAQ,IAAG,CAAE,CAAC,CAAC;AACxG,SAAO;IACL,IAAI,OAAO,KAAK;IAChB;IACA,SAAS,MAAM,SAAS;IACxB,OAAO;IACP,OAAO,MAAM;IACb,iBAAiB,WAAW;IAC5B,eAAe,kBAAkB;IACjC,aAAa,MAAM;IACnB,wBAAwB,gBAAgB;IACxC;IACA;IACA,kBAAkB;;AAEtB;",
|
|
6
|
-
"names": ["global", "files"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readHistoryEntries,
|
|
3
|
-
runHistory
|
|
4
|
-
} from "./chunk-Z5F6XZXE.js";
|
|
5
|
-
import {
|
|
6
|
-
verifyHistoryChain
|
|
7
|
-
} from "./chunk-T4XBKJ3F.js";
|
|
8
|
-
import "./chunk-4PFVUUYV.js";
|
|
9
|
-
import "./chunk-6KRFL33E.js";
|
|
10
|
-
import "./chunk-3W2HJKJX.js";
|
|
11
|
-
import "./chunk-AJHYQCBJ.js";
|
|
12
|
-
import "./chunk-KHVGM5CS.js";
|
|
13
|
-
export {
|
|
14
|
-
readHistoryEntries,
|
|
15
|
-
runHistory,
|
|
16
|
-
verifyHistoryChain
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=history-CGNQJXFE.js.map
|