@unbrained/pm-cli 2026.7.5 → 2026.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
- package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
- package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
- package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
- package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
- package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
- package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
- package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
- package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
- package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
- package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
- package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
- package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
- package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
- package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
- package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
- package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
- package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
- package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
- package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
- package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
- package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
- package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
- package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
- package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
- package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
- package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
- package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
- package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
- package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
- package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
- package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
- package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
- package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
- package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
- package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
- package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
- package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
- package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
- package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +136 -54
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +132 -84
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +22 -50
- package/dist/mcp/server.js +62 -916
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +312 -5
- package/dist/sdk/runtime.js +1391 -26
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
- package/dist/sdk/workspace-contracts-cache.js +36 -0
- package/dist/sdk/workspace-contracts-cache.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/RELEASING.md +3 -1
- package/docs/SDK.md +81 -0
- package/docs/TESTING.md +3 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
- package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
- package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
- package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
- package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
- package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
- package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
- package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
- package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
- package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
- package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
- package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
- package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
- package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
- package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
- package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
- package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
- package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
- package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
- package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
- package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
- package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
- package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
- package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
- package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
- package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
- package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
- package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
- package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
- package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
- package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
- package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
- package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
- package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
- package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
- package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
- package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
- package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
- package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
- package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
- package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
- package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
- package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
- package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
- package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
- package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
- package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
- package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
- package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
- package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
- package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
- package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
- package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
- package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
- package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
- package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
- package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
- package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
- package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
- package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
- package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
- package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
- package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
- package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
- package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
- package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
- package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
- package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
- package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
- package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
- package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
- package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
- package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
- package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
|
@@ -1,1570 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4b8306b7-d6d7-5615-af29-66de3136cea2")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
compareTimestampStrings,
|
|
5
|
-
isTimestampLiteral
|
|
6
|
-
} from "./chunk-FJRKQREY.js";
|
|
7
|
-
import {
|
|
8
|
-
PmCliError,
|
|
9
|
-
orderObject
|
|
10
|
-
} from "./chunk-US3T3W5J.js";
|
|
11
|
-
import {
|
|
12
|
-
CONFIDENCE_TEXT_VALUES,
|
|
13
|
-
EXIT_CODE,
|
|
14
|
-
FRONT_MATTER_KEY_ORDER,
|
|
15
|
-
ISSUE_SEVERITY_VALUES,
|
|
16
|
-
PLAN_STEP_STATUS_VALUES,
|
|
17
|
-
RECURRENCE_FREQUENCY_VALUES,
|
|
18
|
-
RECURRENCE_WEEKDAY_VALUES,
|
|
19
|
-
STATUS_VALUES,
|
|
20
|
-
TYPE_TO_FOLDER,
|
|
21
|
-
normalizeStatusInputWithRegistry,
|
|
22
|
-
pathExists,
|
|
23
|
-
resolveRuntimeFieldRegistry,
|
|
24
|
-
resolveRuntimeStatusRegistry,
|
|
25
|
-
runtimeFieldOptionTarget,
|
|
26
|
-
weekdayOrderIndex
|
|
27
|
-
} from "./chunk-YD5FML7K.js";
|
|
28
|
-
|
|
29
|
-
// dist/core/schema/runtime-field-values.js
|
|
30
|
-
function toCamelToken(value) {
|
|
31
|
-
const segments = value.trim().replaceAll(/[^A-Za-z0-9]+/g, " ").split(/\s+/).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase());
|
|
32
|
-
if (segments.length === 0) {
|
|
33
|
-
return value;
|
|
34
|
-
}
|
|
35
|
-
const [first, ...rest] = segments;
|
|
36
|
-
return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join("")}`;
|
|
37
|
-
}
|
|
38
|
-
function resolveCandidateOptionKeys(definition) {
|
|
39
|
-
return [.../* @__PURE__ */ new Set([
|
|
40
|
-
runtimeFieldOptionTarget(definition),
|
|
41
|
-
toCamelToken(definition.key),
|
|
42
|
-
toCamelToken(definition.cli_flag),
|
|
43
|
-
...definition.cli_aliases.map((alias) => toCamelToken(alias))
|
|
44
|
-
])];
|
|
45
|
-
}
|
|
46
|
-
function readRuntimeFieldOptionValue(options, definition) {
|
|
47
|
-
for (const candidateKey of resolveCandidateOptionKeys(definition)) {
|
|
48
|
-
if (!Object.hasOwn(options, candidateKey)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
const value = options[candidateKey];
|
|
52
|
-
if (value !== void 0) {
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return void 0;
|
|
57
|
-
}
|
|
58
|
-
function normalizeStringArrayValue(value) {
|
|
59
|
-
if (Array.isArray(value)) {
|
|
60
|
-
return value.flatMap((entry) => normalizeStringArrayValue(entry)).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
61
|
-
}
|
|
62
|
-
if (typeof value === "string") {
|
|
63
|
-
return value.split(/[,\n|]/).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
64
|
-
}
|
|
65
|
-
if (value === void 0 || value === null) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
return [String(value).trim()].filter((entry) => entry.length > 0);
|
|
69
|
-
}
|
|
70
|
-
function parseBooleanValue(raw, label) {
|
|
71
|
-
if (typeof raw === "boolean") {
|
|
72
|
-
return raw;
|
|
73
|
-
}
|
|
74
|
-
if (typeof raw === "number") {
|
|
75
|
-
if (raw === 1) {
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
if (raw === 0) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (typeof raw === "string") {
|
|
83
|
-
const normalized = raw.trim().toLowerCase();
|
|
84
|
-
if (normalized === "true" || normalized === "1" || normalized === "yes") {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
if (normalized === "false" || normalized === "0" || normalized === "no") {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
throw new PmCliError(`${label} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);
|
|
92
|
-
}
|
|
93
|
-
function parseNumberValue(raw, label) {
|
|
94
|
-
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
95
|
-
return raw;
|
|
96
|
-
}
|
|
97
|
-
const candidate = typeof raw === "string" ? raw.trim() : String(raw);
|
|
98
|
-
const parsed = Number(candidate);
|
|
99
|
-
if (!Number.isFinite(parsed)) {
|
|
100
|
-
throw new PmCliError(`${label} must be a number`, EXIT_CODE.USAGE);
|
|
101
|
-
}
|
|
102
|
-
return parsed;
|
|
103
|
-
}
|
|
104
|
-
function coerceRuntimeFieldValue(definition, rawValue, labelOverride) {
|
|
105
|
-
const label = labelOverride ?? `--${definition.cli_flag}`;
|
|
106
|
-
if (definition.repeatable || definition.type === "string_array") {
|
|
107
|
-
const values = normalizeStringArrayValue(rawValue);
|
|
108
|
-
if (definition.type === "number") {
|
|
109
|
-
return values.map((value) => parseNumberValue(value, label));
|
|
110
|
-
}
|
|
111
|
-
if (definition.type === "boolean") {
|
|
112
|
-
return values.map((value) => parseBooleanValue(value, label));
|
|
113
|
-
}
|
|
114
|
-
return values;
|
|
115
|
-
}
|
|
116
|
-
const scalarRaw = Array.isArray(rawValue) ? rawValue[rawValue.length - 1] : rawValue;
|
|
117
|
-
if (scalarRaw === void 0) {
|
|
118
|
-
return void 0;
|
|
119
|
-
}
|
|
120
|
-
if (definition.type === "number") {
|
|
121
|
-
return parseNumberValue(scalarRaw, label);
|
|
122
|
-
}
|
|
123
|
-
if (definition.type === "boolean") {
|
|
124
|
-
return parseBooleanValue(scalarRaw, label);
|
|
125
|
-
}
|
|
126
|
-
return typeof scalarRaw === "string" ? scalarRaw : String(scalarRaw);
|
|
127
|
-
}
|
|
128
|
-
function shouldRequireFieldOnCreate(definition, itemTypeName) {
|
|
129
|
-
if (!definition.required && !definition.required_on_create) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
if (definition.required_types.length === 0) {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
if (!itemTypeName) {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
return definition.required_types.map((value) => value.toLowerCase()).includes(itemTypeName.trim().toLowerCase());
|
|
139
|
-
}
|
|
140
|
-
function collectRuntimeCreateFieldValues(options, fieldRegistry, itemTypeName) {
|
|
141
|
-
const values = {};
|
|
142
|
-
const missingRequiredFlags = [];
|
|
143
|
-
for (const definition of fieldRegistry.command_to_fields.get("create") ?? []) {
|
|
144
|
-
const rawValue = readRuntimeFieldOptionValue(options, definition);
|
|
145
|
-
if (rawValue === void 0) {
|
|
146
|
-
if (shouldRequireFieldOnCreate(definition, itemTypeName)) {
|
|
147
|
-
missingRequiredFlags.push(`--${definition.cli_flag}`);
|
|
148
|
-
}
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
values,
|
|
155
|
-
missing_required_flags: [...new Set(missingRequiredFlags)].sort((left, right) => left.localeCompare(right))
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function collectRuntimeUpdateFieldValues(options, fieldRegistry, commands = ["update"]) {
|
|
159
|
-
const values = {};
|
|
160
|
-
const definitions = (commands ?? ["update"]).flatMap((command) => fieldRegistry.command_to_fields.get(command) ?? []);
|
|
161
|
-
const seen = /* @__PURE__ */ new Set();
|
|
162
|
-
for (const definition of definitions) {
|
|
163
|
-
const rawValue = readRuntimeFieldOptionValue(options, definition);
|
|
164
|
-
if (rawValue === void 0) {
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
if (seen.has(definition.metadata_key)) {
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
seen.add(definition.metadata_key);
|
|
171
|
-
values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);
|
|
172
|
-
}
|
|
173
|
-
return values;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// dist/core/item/item-format-version.js
|
|
177
|
-
var BASELINE_ITEM_FORMAT_VERSION = 1;
|
|
178
|
-
var CURRENT_ITEM_FORMAT_VERSION = 1;
|
|
179
|
-
function effectiveItemFormatVersion(metadata) {
|
|
180
|
-
const raw = metadata.pm_format_version;
|
|
181
|
-
if (typeof raw === "number" && Number.isInteger(raw) && raw >= BASELINE_ITEM_FORMAT_VERSION) {
|
|
182
|
-
return raw;
|
|
183
|
-
}
|
|
184
|
-
return BASELINE_ITEM_FORMAT_VERSION;
|
|
185
|
-
}
|
|
186
|
-
function normalizeItemFormatVersion(value) {
|
|
187
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value <= BASELINE_ITEM_FORMAT_VERSION) {
|
|
188
|
-
return void 0;
|
|
189
|
-
}
|
|
190
|
-
return value;
|
|
191
|
-
}
|
|
192
|
-
function classifyItemFormatVersion(version, current = CURRENT_ITEM_FORMAT_VERSION) {
|
|
193
|
-
if (version < current) {
|
|
194
|
-
return "outdated";
|
|
195
|
-
}
|
|
196
|
-
if (version > current) {
|
|
197
|
-
return "ahead";
|
|
198
|
-
}
|
|
199
|
-
return "current";
|
|
200
|
-
}
|
|
201
|
-
function scanItemFormatVersions(entries, current = CURRENT_ITEM_FORMAT_VERSION) {
|
|
202
|
-
const outdated = [];
|
|
203
|
-
const ahead = [];
|
|
204
|
-
for (const entry of entries) {
|
|
205
|
-
const status = classifyItemFormatVersion(entry.version, current);
|
|
206
|
-
if (status === "outdated") {
|
|
207
|
-
outdated.push(entry.ref);
|
|
208
|
-
} else if (status === "ahead") {
|
|
209
|
-
ahead.push(entry.ref);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
outdated: outdated.sort((left, right) => left.localeCompare(right)),
|
|
214
|
-
ahead: ahead.sort((left, right) => left.localeCompare(right))
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// dist/core/item/status.js
|
|
219
|
-
var STATUS_ALIAS_MAP = {
|
|
220
|
-
"in-progress": "in_progress",
|
|
221
|
-
cancelled: "canceled"
|
|
222
|
-
};
|
|
223
|
-
function normalizeStatusInput(value, registry) {
|
|
224
|
-
if (registry) {
|
|
225
|
-
const normalizedFromRegistry = normalizeStatusInputWithRegistry(value, registry);
|
|
226
|
-
if (normalizedFromRegistry) {
|
|
227
|
-
return normalizedFromRegistry;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (typeof value !== "string") {
|
|
231
|
-
return void 0;
|
|
232
|
-
}
|
|
233
|
-
const normalized = value.trim().toLowerCase();
|
|
234
|
-
if (!normalized) {
|
|
235
|
-
return void 0;
|
|
236
|
-
}
|
|
237
|
-
const canonical = STATUS_ALIAS_MAP[normalized] ?? normalized;
|
|
238
|
-
if (!STATUS_VALUES.includes(canonical)) {
|
|
239
|
-
return void 0;
|
|
240
|
-
}
|
|
241
|
-
return canonical;
|
|
242
|
-
}
|
|
243
|
-
function normalizeStatusForRegistry(status, registry) {
|
|
244
|
-
return normalizeStatusInput(status, registry) ?? status;
|
|
245
|
-
}
|
|
246
|
-
function isTerminalStatus(status, registry) {
|
|
247
|
-
return registry.terminal_statuses.has(normalizeStatusForRegistry(status, registry));
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// dist/core/shared/conflict-markers.js
|
|
251
|
-
var CONFLICT_MARKER_PATTERN = /^\s*(<<<<<<<|=======|>>>>>>>)(?:\s.*)?$/;
|
|
252
|
-
function findMergeConflictMarkers(content) {
|
|
253
|
-
if (content.length === 0) {
|
|
254
|
-
return [];
|
|
255
|
-
}
|
|
256
|
-
const lines = content.split(/\r?\n/);
|
|
257
|
-
const matches = [];
|
|
258
|
-
for (let index = 0; index < lines.length; index += 1) {
|
|
259
|
-
const line = lines[index] ?? "";
|
|
260
|
-
const markerMatch = line.match(CONFLICT_MARKER_PATTERN);
|
|
261
|
-
if (!markerMatch) {
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
const marker = markerMatch[1];
|
|
265
|
-
matches.push({
|
|
266
|
-
line: index + 1,
|
|
267
|
-
marker,
|
|
268
|
-
text: line
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
return matches;
|
|
272
|
-
}
|
|
273
|
-
function findFirstMergeConflictMarker(content) {
|
|
274
|
-
const matches = findMergeConflictMarkers(content);
|
|
275
|
-
return matches[0];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// dist/core/item/item-format.js
|
|
279
|
-
import { encode as encodeToon } from "@toon-format/toon";
|
|
280
|
-
|
|
281
|
-
// dist/core/item/toon-decode.js
|
|
282
|
-
import { decode as decodeToon } from "@toon-format/toon";
|
|
283
|
-
function escapeBracketsInQuotedScalars(content) {
|
|
284
|
-
return content.split("\n").map((line) => {
|
|
285
|
-
const separatorIndex = line.indexOf(": ");
|
|
286
|
-
const bracketIndex = line.indexOf("[");
|
|
287
|
-
if (separatorIndex === -1 || bracketIndex === -1 || bracketIndex < separatorIndex) {
|
|
288
|
-
return line;
|
|
289
|
-
}
|
|
290
|
-
const key = line.slice(0, separatorIndex + 2);
|
|
291
|
-
const value = line.slice(separatorIndex + 2);
|
|
292
|
-
if (!value.startsWith('"')) {
|
|
293
|
-
return line;
|
|
294
|
-
}
|
|
295
|
-
return key + value.replaceAll("[", "\\u005b");
|
|
296
|
-
}).join("\n");
|
|
297
|
-
}
|
|
298
|
-
function decodeToonItemContent(content) {
|
|
299
|
-
try {
|
|
300
|
-
return { value: decodeToon(content), usedScalarBracketEscape: false };
|
|
301
|
-
} catch (strictError) {
|
|
302
|
-
const escaped = escapeBracketsInQuotedScalars(content);
|
|
303
|
-
if (escaped === content) {
|
|
304
|
-
throw strictError;
|
|
305
|
-
}
|
|
306
|
-
return { value: decodeToon(escaped), usedScalarBracketEscape: true };
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// dist/core/item/item-format.js
|
|
311
|
-
var LINKED_TEST_PM_CONTEXT_MODE_VALUES = /* @__PURE__ */ new Set(["schema", "tracker", "auto"]);
|
|
312
|
-
var ITEM_TEST_RUN_STATUS_VALUES = /* @__PURE__ */ new Set(["passed", "failed", "stopped", "canceled"]);
|
|
313
|
-
var PLAN_STEP_STATUS_SET = new Set(PLAN_STEP_STATUS_VALUES);
|
|
314
|
-
function normalizePathValue(value) {
|
|
315
|
-
return value.replaceAll("\\", "/");
|
|
316
|
-
}
|
|
317
|
-
function firstNonZeroComparison(comparisons) {
|
|
318
|
-
for (const comparison of comparisons) {
|
|
319
|
-
if (comparison !== 0) {
|
|
320
|
-
return comparison;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
return 0;
|
|
324
|
-
}
|
|
325
|
-
function deleteUndefinedFields(record) {
|
|
326
|
-
for (const [key, value] of Object.entries(record)) {
|
|
327
|
-
if (value === void 0) {
|
|
328
|
-
delete record[key];
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
var REQUIRED_STRING_FIELDS = [
|
|
333
|
-
"id",
|
|
334
|
-
"title",
|
|
335
|
-
"description",
|
|
336
|
-
"created_at",
|
|
337
|
-
"updated_at"
|
|
338
|
-
];
|
|
339
|
-
var STATIC_FRONT_MATTER_FIELD_SET = new Set(FRONT_MATTER_KEY_ORDER);
|
|
340
|
-
function resolveRuntimeSchemaValidationContext(options) {
|
|
341
|
-
if (!options?.schema) {
|
|
342
|
-
return void 0;
|
|
343
|
-
}
|
|
344
|
-
return {
|
|
345
|
-
statusRegistry: resolveRuntimeStatusRegistry(options.schema),
|
|
346
|
-
fieldRegistry: resolveRuntimeFieldRegistry(options.schema),
|
|
347
|
-
unknownFieldPolicy: options.schema.unknown_field_policy ?? "allow",
|
|
348
|
-
extensionFieldNames: new Set(options.extensionFieldNames ?? []),
|
|
349
|
-
onWarning: options.onWarning
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
function runtimeFieldRequiredForType(definition, typeName) {
|
|
353
|
-
if (!definition.required) {
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
|
-
if (definition.required_types.length === 0) {
|
|
357
|
-
return true;
|
|
358
|
-
}
|
|
359
|
-
return definition.required_types.map((value) => value.toLowerCase()).includes(typeName.trim().toLowerCase());
|
|
360
|
-
}
|
|
361
|
-
function validationError(message) {
|
|
362
|
-
throw new PmCliError(`Invalid item front matter: ${message}`, EXIT_CODE.GENERIC_FAILURE);
|
|
363
|
-
}
|
|
364
|
-
function buildKnownFrontMatterKeys(runtimeContext) {
|
|
365
|
-
const knownKeys = new Set(STATIC_FRONT_MATTER_FIELD_SET);
|
|
366
|
-
for (const definition of runtimeContext.fieldRegistry?.definitions ?? []) {
|
|
367
|
-
knownKeys.add(definition.metadata_key);
|
|
368
|
-
}
|
|
369
|
-
for (const fieldName of runtimeContext.extensionFieldNames) {
|
|
370
|
-
knownKeys.add(fieldName);
|
|
371
|
-
}
|
|
372
|
-
return knownKeys;
|
|
373
|
-
}
|
|
374
|
-
function assertFrontMatterCondition(condition, message) {
|
|
375
|
-
if (!condition) {
|
|
376
|
-
validationError(message);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
function assertTimestampField(record, fieldName) {
|
|
380
|
-
const rawValue = record[fieldName];
|
|
381
|
-
assertFrontMatterCondition(typeof rawValue === "string", `${fieldName} must be a string`);
|
|
382
|
-
const timestamp = rawValue;
|
|
383
|
-
assertFrontMatterCondition(isTimestampLiteral(timestamp), `${fieldName} must be a valid ISO timestamp`);
|
|
384
|
-
}
|
|
385
|
-
function assertPositiveIntegerField(record, fieldName, messagePrefix) {
|
|
386
|
-
const value = record[fieldName];
|
|
387
|
-
if (value === void 0) {
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
assertFrontMatterCondition(typeof value === "number" && Number.isInteger(value) && value >= 1, `${messagePrefix} must be an integer >= 1`);
|
|
391
|
-
}
|
|
392
|
-
function assertOptionalTimestampString(record, fieldName, messagePrefix) {
|
|
393
|
-
const value = record[fieldName];
|
|
394
|
-
if (value === void 0) {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
assertFrontMatterCondition(typeof value === "string", `${messagePrefix} must be a string`);
|
|
398
|
-
assertFrontMatterCondition(isTimestampLiteral(value), `${messagePrefix} must be a valid ISO timestamp`);
|
|
399
|
-
}
|
|
400
|
-
function assertRecurrenceWeekdays(value) {
|
|
401
|
-
if (value === void 0) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
assertFrontMatterCondition(Array.isArray(value), "event.recurrence.by_weekday must be an array");
|
|
405
|
-
for (const weekday of value) {
|
|
406
|
-
assertFrontMatterCondition(typeof weekday === "string", "event.recurrence.by_weekday entries must be strings");
|
|
407
|
-
const normalizedWeekday = weekday.trim().toLowerCase();
|
|
408
|
-
assertFrontMatterCondition(RECURRENCE_WEEKDAY_VALUES.includes(normalizedWeekday), `event.recurrence.by_weekday entries must be one of: ${RECURRENCE_WEEKDAY_VALUES.join(", ")}`);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function assertRecurrenceMonthDays(value) {
|
|
412
|
-
if (value === void 0) {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
assertFrontMatterCondition(Array.isArray(value), "event.recurrence.by_month_day must be an array");
|
|
416
|
-
for (const day of value) {
|
|
417
|
-
assertFrontMatterCondition(typeof day === "number" && Number.isInteger(day) && day >= 1 && day <= 31, "event.recurrence.by_month_day entries must be integers 1..31");
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
function assertRecurrenceExdates(value) {
|
|
421
|
-
if (value === void 0) {
|
|
422
|
-
return;
|
|
423
|
-
}
|
|
424
|
-
assertFrontMatterCondition(Array.isArray(value), "event.recurrence.exdates must be an array");
|
|
425
|
-
for (const exdate of value) {
|
|
426
|
-
assertFrontMatterCondition(typeof exdate === "string", "event.recurrence.exdates entries must be strings");
|
|
427
|
-
assertFrontMatterCondition(isTimestampLiteral(exdate), "event.recurrence.exdates entries must be valid ISO timestamps");
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
function assertValidRecurrenceRule(recurrence) {
|
|
431
|
-
assertFrontMatterCondition(typeof recurrence === "object" && recurrence !== null && !Array.isArray(recurrence), "event.recurrence must be an object");
|
|
432
|
-
const recurrenceRecord = recurrence;
|
|
433
|
-
assertFrontMatterCondition(typeof recurrenceRecord.freq === "string", "event.recurrence.freq must be a string");
|
|
434
|
-
const frequency = recurrenceRecord.freq.trim().toLowerCase();
|
|
435
|
-
assertFrontMatterCondition(RECURRENCE_FREQUENCY_VALUES.includes(frequency), `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(", ")}`);
|
|
436
|
-
assertPositiveIntegerField(recurrenceRecord, "interval", "event.recurrence.interval");
|
|
437
|
-
assertPositiveIntegerField(recurrenceRecord, "count", "event.recurrence.count");
|
|
438
|
-
assertOptionalTimestampString(recurrenceRecord, "until", "event.recurrence.until");
|
|
439
|
-
assertRecurrenceWeekdays(recurrenceRecord.by_weekday);
|
|
440
|
-
assertRecurrenceMonthDays(recurrenceRecord.by_month_day);
|
|
441
|
-
assertRecurrenceExdates(recurrenceRecord.exdates);
|
|
442
|
-
}
|
|
443
|
-
function assertRequiredFrontMatterFields(record) {
|
|
444
|
-
for (const fieldName of REQUIRED_STRING_FIELDS) {
|
|
445
|
-
assertFrontMatterCondition(typeof record[fieldName] === "string", `${fieldName} is required and must be a string`);
|
|
446
|
-
}
|
|
447
|
-
const itemType = record.type;
|
|
448
|
-
assertFrontMatterCondition(typeof itemType === "string" && itemType.trim().length > 0, "type must be a non-empty string");
|
|
449
|
-
const formatVersion = record.pm_format_version;
|
|
450
|
-
if (formatVersion !== void 0) {
|
|
451
|
-
assertFrontMatterCondition(typeof formatVersion === "number" && Number.isInteger(formatVersion) && formatVersion >= BASELINE_ITEM_FORMAT_VERSION, `pm_format_version must be an integer >= ${BASELINE_ITEM_FORMAT_VERSION}`);
|
|
452
|
-
}
|
|
453
|
-
return itemType;
|
|
454
|
-
}
|
|
455
|
-
function assertStatusFrontMatterField(record, runtimeContext) {
|
|
456
|
-
const status = record.status;
|
|
457
|
-
assertFrontMatterCondition(typeof status === "string" && status.trim().length > 0, "status must be a non-empty string");
|
|
458
|
-
const statusRegistry = runtimeContext?.statusRegistry;
|
|
459
|
-
const normalizedStatus = normalizeStatusInput(status, statusRegistry);
|
|
460
|
-
const statusDomain = statusRegistry ? statusRegistry.definitions.map((definition) => definition.id) : [...STATUS_VALUES];
|
|
461
|
-
assertFrontMatterCondition(normalizedStatus !== void 0, `status must be one of: ${statusDomain.join(", ")}`);
|
|
462
|
-
}
|
|
463
|
-
function assertPriorityAndTags(record) {
|
|
464
|
-
const priority = record.priority;
|
|
465
|
-
assertFrontMatterCondition(typeof priority === "number" && Number.isInteger(priority) && [0, 1, 2, 3, 4].includes(priority), "priority must be an integer 0..4");
|
|
466
|
-
const tags = record.tags;
|
|
467
|
-
assertFrontMatterCondition(Array.isArray(tags), "tags must be an array");
|
|
468
|
-
for (const tag of tags) {
|
|
469
|
-
assertFrontMatterCondition(typeof tag === "string", "tags entries must be strings");
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
function assertConfidenceFrontMatterField(record) {
|
|
473
|
-
const confidence = record.confidence;
|
|
474
|
-
if (confidence === void 0) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
if (typeof confidence === "number") {
|
|
478
|
-
assertFrontMatterCondition(Number.isInteger(confidence) && confidence >= 0 && confidence <= 100, "confidence number value must be an integer 0..100");
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
if (typeof confidence === "string") {
|
|
482
|
-
const normalizedConfidence = confidence.trim().toLowerCase();
|
|
483
|
-
const isKnownTextConfidence = normalizedConfidence === "med" || CONFIDENCE_TEXT_VALUES.includes(normalizedConfidence);
|
|
484
|
-
assertFrontMatterCondition(isKnownTextConfidence, `confidence string value must be one of: ${[...CONFIDENCE_TEXT_VALUES, "med"].join(", ")}`);
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
assertFrontMatterCondition(false, "confidence must be a number or string");
|
|
488
|
-
}
|
|
489
|
-
function assertSeverityFrontMatterField(record) {
|
|
490
|
-
const severity = record.severity;
|
|
491
|
-
if (severity === void 0) {
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
if (typeof severity !== "string") {
|
|
495
|
-
validationError("severity must be a string");
|
|
496
|
-
}
|
|
497
|
-
const normalizedSeverity = severity.trim().toLowerCase();
|
|
498
|
-
const isKnownSeverity = normalizedSeverity === "med" || ISSUE_SEVERITY_VALUES.includes(normalizedSeverity);
|
|
499
|
-
assertFrontMatterCondition(isKnownSeverity, `severity value must be one of: ${[...ISSUE_SEVERITY_VALUES, "med"].join(", ")}`);
|
|
500
|
-
}
|
|
501
|
-
function assertRegressionFrontMatterField(record) {
|
|
502
|
-
if (record.regression !== void 0 && typeof record.regression !== "boolean") {
|
|
503
|
-
validationError("regression must be a boolean");
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function assertReminderEntries(record) {
|
|
507
|
-
const reminders = record.reminders;
|
|
508
|
-
if (reminders === void 0) {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
assertFrontMatterCondition(Array.isArray(reminders), "reminders must be an array");
|
|
512
|
-
for (const reminder of reminders) {
|
|
513
|
-
assertFrontMatterCondition(typeof reminder === "object" && reminder !== null && !Array.isArray(reminder), "reminders entries must be objects");
|
|
514
|
-
const reminderRecord = reminder;
|
|
515
|
-
assertFrontMatterCondition(typeof reminderRecord.at === "string", "reminder.at must be a string");
|
|
516
|
-
assertFrontMatterCondition(isTimestampLiteral(reminderRecord.at), "reminder.at must be a valid ISO timestamp");
|
|
517
|
-
assertFrontMatterCondition(typeof reminderRecord.text === "string", "reminder.text must be a string");
|
|
518
|
-
assertFrontMatterCondition(reminderRecord.text.trim().length > 0, "reminder.text must not be empty");
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
function assertEventStringFields(eventRecord) {
|
|
522
|
-
for (const stringField of ["title", "description", "location", "timezone"]) {
|
|
523
|
-
if (eventRecord[stringField] !== void 0) {
|
|
524
|
-
assertFrontMatterCondition(typeof eventRecord[stringField] === "string", `event.${stringField} must be a string`);
|
|
525
|
-
assertFrontMatterCondition(eventRecord[stringField].trim().length > 0, `event.${stringField} must not be empty`);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
function assertEventRecurrence(eventRecord) {
|
|
530
|
-
if (eventRecord.recurrence === void 0) {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
assertValidRecurrenceRule(eventRecord.recurrence);
|
|
534
|
-
if (eventRecord.recurrence.until !== void 0) {
|
|
535
|
-
assertFrontMatterCondition(compareTimestampStrings(eventRecord.recurrence.until, eventRecord.start_at) >= 0, "event.recurrence.until must be at or after event.start_at");
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function assertCalendarEventEntry(event) {
|
|
539
|
-
assertFrontMatterCondition(typeof event === "object" && event !== null && !Array.isArray(event), "events entries must be objects");
|
|
540
|
-
const eventRecord = event;
|
|
541
|
-
assertFrontMatterCondition(typeof eventRecord.start_at === "string", "event.start_at must be a string");
|
|
542
|
-
assertFrontMatterCondition(isTimestampLiteral(eventRecord.start_at), "event.start_at must be a valid ISO timestamp");
|
|
543
|
-
if (eventRecord.end_at !== void 0) {
|
|
544
|
-
assertFrontMatterCondition(typeof eventRecord.end_at === "string", "event.end_at must be a string");
|
|
545
|
-
assertFrontMatterCondition(isTimestampLiteral(eventRecord.end_at), "event.end_at must be a valid ISO timestamp");
|
|
546
|
-
assertFrontMatterCondition(compareTimestampStrings(eventRecord.end_at, eventRecord.start_at) > 0, "event.end_at must be after event.start_at");
|
|
547
|
-
}
|
|
548
|
-
assertEventStringFields(eventRecord);
|
|
549
|
-
if (eventRecord.all_day !== void 0) {
|
|
550
|
-
assertFrontMatterCondition(typeof eventRecord.all_day === "boolean", "event.all_day must be a boolean");
|
|
551
|
-
}
|
|
552
|
-
assertEventRecurrence(eventRecord);
|
|
553
|
-
}
|
|
554
|
-
function assertCalendarEvents(record) {
|
|
555
|
-
const events = record.events;
|
|
556
|
-
if (events === void 0) {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
assertFrontMatterCondition(Array.isArray(events), "events must be an array");
|
|
560
|
-
for (const event of events) {
|
|
561
|
-
assertCalendarEventEntry(event);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
function assertOptionalStringFields(record) {
|
|
565
|
-
for (const fieldName of ["source_type", "source_owner", "design", "external_ref"]) {
|
|
566
|
-
const value = record[fieldName];
|
|
567
|
-
if (value !== void 0) {
|
|
568
|
-
assertFrontMatterCondition(typeof value === "string", `${fieldName} must be a string`);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
function assertTypeOptionsField(record) {
|
|
573
|
-
const typeOptions = record.type_options;
|
|
574
|
-
if (typeOptions === void 0) {
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
assertFrontMatterCondition(typeof typeOptions === "object" && typeOptions !== null && !Array.isArray(typeOptions), "type_options must be an object");
|
|
578
|
-
for (const [optionKey, optionValue] of Object.entries(typeOptions)) {
|
|
579
|
-
assertFrontMatterCondition(optionKey.trim().length > 0, "type_options keys must be non-empty");
|
|
580
|
-
assertFrontMatterCondition(typeof optionValue === "string", "type_options values must be strings");
|
|
581
|
-
const optionText = optionValue;
|
|
582
|
-
assertFrontMatterCondition(optionText.trim().length > 0, "type_options values must be non-empty strings");
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
function coerceRuntimeFrontMatterFields(record, itemType, runtimeContext) {
|
|
586
|
-
if (!runtimeContext?.fieldRegistry) {
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
for (const definition of runtimeContext.fieldRegistry.definitions) {
|
|
590
|
-
const fieldValue = record[definition.metadata_key];
|
|
591
|
-
if (fieldValue === void 0) {
|
|
592
|
-
if (runtimeFieldRequiredForType(definition, itemType)) {
|
|
593
|
-
validationError(`missing required schema field: ${definition.metadata_key}`);
|
|
594
|
-
}
|
|
595
|
-
continue;
|
|
596
|
-
}
|
|
597
|
-
try {
|
|
598
|
-
record[definition.metadata_key] = coerceRuntimeFieldValue(definition, fieldValue, `metadata field "${definition.metadata_key}"`);
|
|
599
|
-
} catch (error) {
|
|
600
|
-
validationError(String(error?.message).replace(/^Invalid\s+/u, ""));
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
function assertRuntimeUnknownFrontMatterFields(record, runtimeContext) {
|
|
605
|
-
if (!runtimeContext || runtimeContext.unknownFieldPolicy === "allow") {
|
|
606
|
-
return;
|
|
607
|
-
}
|
|
608
|
-
const knownKeys = buildKnownFrontMatterKeys(runtimeContext);
|
|
609
|
-
const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));
|
|
610
|
-
if (unknownKeys.length === 0) {
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
if (runtimeContext.unknownFieldPolicy === "reject") {
|
|
614
|
-
validationError(`unknown schema fields are not allowed: ${unknownKeys.join(", ")}`);
|
|
615
|
-
} else {
|
|
616
|
-
runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(",")}`);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
function assertValidFrontMatter(frontMatter, runtimeContext) {
|
|
620
|
-
assertFrontMatterCondition(typeof frontMatter === "object" && frontMatter !== null && !Array.isArray(frontMatter), "front matter must be an object");
|
|
621
|
-
const record = frontMatter;
|
|
622
|
-
const itemType = assertRequiredFrontMatterFields(record);
|
|
623
|
-
assertStatusFrontMatterField(record, runtimeContext);
|
|
624
|
-
assertPriorityAndTags(record);
|
|
625
|
-
assertConfidenceFrontMatterField(record);
|
|
626
|
-
assertSeverityFrontMatterField(record);
|
|
627
|
-
assertRegressionFrontMatterField(record);
|
|
628
|
-
assertTimestampField(record, "created_at");
|
|
629
|
-
assertTimestampField(record, "updated_at");
|
|
630
|
-
if (record.deadline !== void 0) {
|
|
631
|
-
assertTimestampField(record, "deadline");
|
|
632
|
-
}
|
|
633
|
-
assertReminderEntries(record);
|
|
634
|
-
assertCalendarEvents(record);
|
|
635
|
-
assertOptionalTimestampString(record, "closed_at", "closed_at");
|
|
636
|
-
assertOptionalStringFields(record);
|
|
637
|
-
assertTypeOptionsField(record);
|
|
638
|
-
coerceRuntimeFrontMatterFields(record, itemType, runtimeContext);
|
|
639
|
-
assertRuntimeUnknownFrontMatterFields(record, runtimeContext);
|
|
640
|
-
}
|
|
641
|
-
function sortDependencies(values) {
|
|
642
|
-
if (!values || values.length === 0)
|
|
643
|
-
return void 0;
|
|
644
|
-
return [...values].map((value) => ({
|
|
645
|
-
id: value.id.trim().toLowerCase(),
|
|
646
|
-
kind: value.kind,
|
|
647
|
-
created_at: value.created_at,
|
|
648
|
-
author: value.author?.trim() || void 0,
|
|
649
|
-
source_kind: value.source_kind?.trim() || void 0
|
|
650
|
-
})).sort((a, b) => {
|
|
651
|
-
const byCreated = compareTimestampStrings(a.created_at, b.created_at);
|
|
652
|
-
if (byCreated !== 0)
|
|
653
|
-
return byCreated;
|
|
654
|
-
const byId = a.id.localeCompare(b.id);
|
|
655
|
-
if (byId !== 0)
|
|
656
|
-
return byId;
|
|
657
|
-
const byKind = a.kind.localeCompare(b.kind);
|
|
658
|
-
if (byKind !== 0)
|
|
659
|
-
return byKind;
|
|
660
|
-
return (a.source_kind ?? "").localeCompare(b.source_kind ?? "");
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
function sortLogValues(values) {
|
|
664
|
-
if (!values || values.length === 0)
|
|
665
|
-
return void 0;
|
|
666
|
-
return [...values].sort((a, b) => {
|
|
667
|
-
const byCreated = compareTimestampStrings(a.created_at, b.created_at);
|
|
668
|
-
if (byCreated !== 0)
|
|
669
|
-
return byCreated;
|
|
670
|
-
const byText = a.text.localeCompare(b.text);
|
|
671
|
-
if (byText !== 0)
|
|
672
|
-
return byText;
|
|
673
|
-
return a.author.localeCompare(b.author);
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
function sortReminders(values) {
|
|
677
|
-
if (!values || values.length === 0)
|
|
678
|
-
return void 0;
|
|
679
|
-
const normalized = [...values].map((value) => ({
|
|
680
|
-
at: value.at,
|
|
681
|
-
text: value.text.trim()
|
|
682
|
-
})).filter((value) => value.text.length > 0).sort((a, b) => {
|
|
683
|
-
const byAt = compareTimestampStrings(a.at, b.at);
|
|
684
|
-
if (byAt !== 0)
|
|
685
|
-
return byAt;
|
|
686
|
-
return a.text.localeCompare(b.text);
|
|
687
|
-
});
|
|
688
|
-
return normalized.length === 0 ? void 0 : normalized;
|
|
689
|
-
}
|
|
690
|
-
function normalizeRecurrenceRule(value) {
|
|
691
|
-
if (!value) {
|
|
692
|
-
return void 0;
|
|
693
|
-
}
|
|
694
|
-
const normalizedFrequency = value.freq.trim().toLowerCase();
|
|
695
|
-
if (!RECURRENCE_FREQUENCY_VALUES.includes(normalizedFrequency)) {
|
|
696
|
-
return void 0;
|
|
697
|
-
}
|
|
698
|
-
const byWeekday = Array.from(new Set((value.by_weekday ?? []).map((weekday) => weekday.trim().toLowerCase()).filter((weekday) => RECURRENCE_WEEKDAY_VALUES.includes(weekday)))).sort((a, b) => weekdayOrderIndex(a) - weekdayOrderIndex(b));
|
|
699
|
-
const byMonthDay = Array.from(new Set((value.by_month_day ?? []).filter((day) => Number.isInteger(day) && day >= 1 && day <= 31).map((day) => day))).sort((a, b) => a - b);
|
|
700
|
-
const exdates = Array.from(new Set((value.exdates ?? []).map((timestamp) => timestamp.trim()).filter((timestamp) => isTimestampLiteral(timestamp)))).sort((a, b) => compareTimestampStrings(a, b));
|
|
701
|
-
const normalized = {
|
|
702
|
-
freq: normalizedFrequency,
|
|
703
|
-
interval: value.interval !== void 0 && value.interval > 1 ? value.interval : void 0,
|
|
704
|
-
count: value.count,
|
|
705
|
-
until: value.until?.trim() || void 0,
|
|
706
|
-
by_weekday: byWeekday.length > 0 ? byWeekday : void 0,
|
|
707
|
-
by_month_day: byMonthDay.length > 0 ? byMonthDay : void 0,
|
|
708
|
-
exdates: exdates.length > 0 ? exdates : void 0
|
|
709
|
-
};
|
|
710
|
-
for (const [key, fieldValue] of Object.entries(normalized)) {
|
|
711
|
-
if (fieldValue === void 0) {
|
|
712
|
-
delete normalized[key];
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
return normalized;
|
|
716
|
-
}
|
|
717
|
-
function sortEvents(values) {
|
|
718
|
-
if (!Array.isArray(values) || values.length === 0) {
|
|
719
|
-
return void 0;
|
|
720
|
-
}
|
|
721
|
-
const normalized = [...values].map(normalizeCalendarEvent).sort(compareCalendarEvents);
|
|
722
|
-
return normalized;
|
|
723
|
-
}
|
|
724
|
-
function normalizeCalendarEvent(value) {
|
|
725
|
-
const event = {
|
|
726
|
-
start_at: value.start_at,
|
|
727
|
-
end_at: value.end_at || void 0,
|
|
728
|
-
title: value.title?.trim() || void 0,
|
|
729
|
-
description: value.description?.trim() || void 0,
|
|
730
|
-
location: value.location?.trim() || void 0,
|
|
731
|
-
all_day: value.all_day,
|
|
732
|
-
timezone: value.timezone?.trim() || void 0,
|
|
733
|
-
recurrence: normalizeRecurrenceRule(value.recurrence)
|
|
734
|
-
};
|
|
735
|
-
deleteUndefinedFields(event);
|
|
736
|
-
return event;
|
|
737
|
-
}
|
|
738
|
-
function compareCalendarEvents(a, b) {
|
|
739
|
-
return firstNonZeroComparison([
|
|
740
|
-
compareTimestampStrings(a.start_at, b.start_at),
|
|
741
|
-
(a.end_at ?? "").localeCompare(b.end_at ?? ""),
|
|
742
|
-
(a.title ?? "").localeCompare(b.title ?? ""),
|
|
743
|
-
Number(Boolean(a.all_day)) - Number(Boolean(b.all_day)),
|
|
744
|
-
(a.timezone ?? "").localeCompare(b.timezone ?? ""),
|
|
745
|
-
(a.location ?? "").localeCompare(b.location ?? ""),
|
|
746
|
-
(a.description ?? "").localeCompare(b.description ?? ""),
|
|
747
|
-
JSON.stringify(a.recurrence ?? {}).localeCompare(JSON.stringify(b.recurrence ?? {}))
|
|
748
|
-
]);
|
|
749
|
-
}
|
|
750
|
-
function normalizeFiles(values) {
|
|
751
|
-
if (!values || values.length === 0)
|
|
752
|
-
return void 0;
|
|
753
|
-
return values.map((value) => ({
|
|
754
|
-
path: normalizePathValue(value.path),
|
|
755
|
-
scope: value.scope,
|
|
756
|
-
note: value.note?.trim() || void 0
|
|
757
|
-
}));
|
|
758
|
-
}
|
|
759
|
-
function normalizeTestRunSummaries(values) {
|
|
760
|
-
if (!values || values.length === 0)
|
|
761
|
-
return void 0;
|
|
762
|
-
const normalized = values.map(normalizeTestRunSummary).filter((value) => value.run_id.length > 0 && value.started_at.length > 0 && value.finished_at.length > 0 && value.recorded_at.length > 0).sort((a, b) => firstNonZeroComparison([
|
|
763
|
-
compareTimestampStrings(a.recorded_at, b.recorded_at),
|
|
764
|
-
a.run_id.localeCompare(b.run_id),
|
|
765
|
-
a.kind.localeCompare(b.kind)
|
|
766
|
-
]));
|
|
767
|
-
return normalized.length > 0 ? normalized : void 0;
|
|
768
|
-
}
|
|
769
|
-
function normalizeNonNegativeInteger(value) {
|
|
770
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : void 0;
|
|
771
|
-
}
|
|
772
|
-
function normalizePositiveInteger(value) {
|
|
773
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 1 ? Math.floor(value) : void 0;
|
|
774
|
-
}
|
|
775
|
-
function stringOrEmpty(value) {
|
|
776
|
-
return typeof value === "string" ? value : "";
|
|
777
|
-
}
|
|
778
|
-
function normalizeTestRunSummary(value) {
|
|
779
|
-
const runId = typeof value.run_id === "string" ? value.run_id.trim() : "";
|
|
780
|
-
const kind = value.kind === "test" || value.kind === "test-all" ? value.kind : "test";
|
|
781
|
-
const status = ITEM_TEST_RUN_STATUS_VALUES.has(value.status) ? value.status : "failed";
|
|
782
|
-
const summary = {
|
|
783
|
-
run_id: runId,
|
|
784
|
-
kind,
|
|
785
|
-
status,
|
|
786
|
-
started_at: stringOrEmpty(value.started_at),
|
|
787
|
-
finished_at: stringOrEmpty(value.finished_at),
|
|
788
|
-
recorded_at: stringOrEmpty(value.recorded_at),
|
|
789
|
-
attempt: normalizePositiveInteger(value.attempt),
|
|
790
|
-
resumed_from: value.resumed_from?.trim() || void 0,
|
|
791
|
-
passed: normalizeNonNegativeInteger(value.passed) ?? 0,
|
|
792
|
-
failed: normalizeNonNegativeInteger(value.failed) ?? 0,
|
|
793
|
-
skipped: normalizeNonNegativeInteger(value.skipped) ?? 0,
|
|
794
|
-
items: normalizeNonNegativeInteger(value.items),
|
|
795
|
-
linked_tests: normalizeNonNegativeInteger(value.linked_tests),
|
|
796
|
-
fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : void 0
|
|
797
|
-
};
|
|
798
|
-
deleteUndefinedFields(summary);
|
|
799
|
-
return summary;
|
|
800
|
-
}
|
|
801
|
-
function sortTests(values) {
|
|
802
|
-
if (!Array.isArray(values) || values.length === 0)
|
|
803
|
-
return void 0;
|
|
804
|
-
return [...values].map(normalizeLinkedTest).sort(compareLinkedTests);
|
|
805
|
-
}
|
|
806
|
-
function normalizeTrimmedStringList(value) {
|
|
807
|
-
if (!Array.isArray(value)) {
|
|
808
|
-
return void 0;
|
|
809
|
-
}
|
|
810
|
-
const normalized = [
|
|
811
|
-
...new Set(value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter((entry) => entry.length > 0))
|
|
812
|
-
].sort((a, b) => a.localeCompare(b));
|
|
813
|
-
return normalized.length > 0 ? normalized : void 0;
|
|
814
|
-
}
|
|
815
|
-
function isPlainObjectRecord(value) {
|
|
816
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
817
|
-
return false;
|
|
818
|
-
}
|
|
819
|
-
const prototype = Object.getPrototypeOf(value);
|
|
820
|
-
return prototype === Object.prototype || prototype === null;
|
|
821
|
-
}
|
|
822
|
-
function isUnsafeObjectKey(key) {
|
|
823
|
-
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
824
|
-
}
|
|
825
|
-
function normalizeStringRecord(value) {
|
|
826
|
-
if (!isPlainObjectRecord(value)) {
|
|
827
|
-
return void 0;
|
|
828
|
-
}
|
|
829
|
-
const entries = Object.entries(value).map(([key, recordValue]) => [key.trim(), String(recordValue).trim()]).filter(([key, recordValue]) => key.length > 0 && !isUnsafeObjectKey(key) && recordValue.length > 0).sort(([left], [right]) => left.localeCompare(right));
|
|
830
|
-
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
831
|
-
}
|
|
832
|
-
function normalizeNumericRecord(value) {
|
|
833
|
-
if (!isPlainObjectRecord(value)) {
|
|
834
|
-
return void 0;
|
|
835
|
-
}
|
|
836
|
-
const entries = Object.entries(value).map(([key, recordValue]) => [key.trim(), Number(recordValue)]).filter(([key, recordValue]) => key.length > 0 && !isUnsafeObjectKey(key) && Number.isFinite(recordValue)).sort(([left], [right]) => left.localeCompare(right));
|
|
837
|
-
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
838
|
-
}
|
|
839
|
-
function normalizeLinkedTestContextMode(value) {
|
|
840
|
-
const normalized = value?.trim().toLowerCase();
|
|
841
|
-
if (!normalized || !LINKED_TEST_PM_CONTEXT_MODE_VALUES.has(normalized)) {
|
|
842
|
-
return void 0;
|
|
843
|
-
}
|
|
844
|
-
return normalized;
|
|
845
|
-
}
|
|
846
|
-
function normalizeLinkedTest(value) {
|
|
847
|
-
const test = {
|
|
848
|
-
command: value.command?.trim() || void 0,
|
|
849
|
-
path: value.path ? normalizePathValue(value.path) : void 0,
|
|
850
|
-
scope: value.scope,
|
|
851
|
-
timeout_seconds: typeof value.timeout_seconds === "number" && Number.isFinite(value.timeout_seconds) && value.timeout_seconds > 0 ? value.timeout_seconds : void 0,
|
|
852
|
-
pm_context_mode: normalizeLinkedTestContextMode(value.pm_context_mode),
|
|
853
|
-
env_set: normalizeStringRecord(value.env_set),
|
|
854
|
-
env_clear: normalizeTrimmedStringList(value.env_clear),
|
|
855
|
-
shared_host_safe: value.shared_host_safe === true ? true : void 0,
|
|
856
|
-
assert_stdout_contains: normalizeTrimmedStringList(value.assert_stdout_contains),
|
|
857
|
-
assert_stdout_regex: normalizeTrimmedStringList(value.assert_stdout_regex),
|
|
858
|
-
assert_stderr_contains: normalizeTrimmedStringList(value.assert_stderr_contains),
|
|
859
|
-
assert_stderr_regex: normalizeTrimmedStringList(value.assert_stderr_regex),
|
|
860
|
-
assert_stdout_min_lines: normalizeNonNegativeInteger(value.assert_stdout_min_lines),
|
|
861
|
-
assert_json_field_equals: normalizeStringRecord(value.assert_json_field_equals),
|
|
862
|
-
assert_json_field_gte: normalizeNumericRecord(value.assert_json_field_gte),
|
|
863
|
-
note: value.note?.trim() || void 0
|
|
864
|
-
};
|
|
865
|
-
deleteUndefinedFields(test);
|
|
866
|
-
return test;
|
|
867
|
-
}
|
|
868
|
-
function compareLinkedTests(a, b) {
|
|
869
|
-
return firstNonZeroComparison([
|
|
870
|
-
a.scope.localeCompare(b.scope),
|
|
871
|
-
compareOptionalStrings(a.path, b.path),
|
|
872
|
-
compareOptionalStrings(a.command, b.command),
|
|
873
|
-
compareOptionalNumbers(a.timeout_seconds, b.timeout_seconds),
|
|
874
|
-
compareOptionalStrings(a.pm_context_mode, b.pm_context_mode),
|
|
875
|
-
Number(Boolean(a.shared_host_safe)) - Number(Boolean(b.shared_host_safe)),
|
|
876
|
-
compareJsonValues(a.env_clear, b.env_clear, []),
|
|
877
|
-
compareJsonValues(a.env_set, b.env_set, {}),
|
|
878
|
-
compareJsonValues(a.assert_stdout_contains, b.assert_stdout_contains, []),
|
|
879
|
-
compareJsonValues(a.assert_stdout_regex, b.assert_stdout_regex, []),
|
|
880
|
-
compareJsonValues(a.assert_stderr_contains, b.assert_stderr_contains, []),
|
|
881
|
-
compareJsonValues(a.assert_stderr_regex, b.assert_stderr_regex, []),
|
|
882
|
-
compareOptionalNumbers(a.assert_stdout_min_lines, b.assert_stdout_min_lines),
|
|
883
|
-
compareJsonValues(a.assert_json_field_equals, b.assert_json_field_equals, {}),
|
|
884
|
-
compareJsonValues(a.assert_json_field_gte, b.assert_json_field_gte, {}),
|
|
885
|
-
compareOptionalStrings(a.note, b.note)
|
|
886
|
-
]);
|
|
887
|
-
}
|
|
888
|
-
function compareOptionalStrings(left, right) {
|
|
889
|
-
return (left ?? "").localeCompare(right ?? "");
|
|
890
|
-
}
|
|
891
|
-
function compareOptionalNumbers(left, right) {
|
|
892
|
-
return (left ?? 0) - (right ?? 0);
|
|
893
|
-
}
|
|
894
|
-
function compareJsonValues(left, right, fallback) {
|
|
895
|
-
return JSON.stringify(left ?? fallback).localeCompare(JSON.stringify(right ?? fallback));
|
|
896
|
-
}
|
|
897
|
-
function sortDocs(values) {
|
|
898
|
-
if (!values || values.length === 0)
|
|
899
|
-
return void 0;
|
|
900
|
-
return [...values].map((value) => ({
|
|
901
|
-
path: normalizePathValue(value.path),
|
|
902
|
-
scope: value.scope,
|
|
903
|
-
note: value.note?.trim() || void 0
|
|
904
|
-
})).sort((a, b) => {
|
|
905
|
-
const byScope = a.scope.localeCompare(b.scope);
|
|
906
|
-
if (byScope !== 0)
|
|
907
|
-
return byScope;
|
|
908
|
-
const byPath = a.path.localeCompare(b.path);
|
|
909
|
-
if (byPath !== 0)
|
|
910
|
-
return byPath;
|
|
911
|
-
return (a.note ?? "").localeCompare(b.note ?? "");
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
function trimStringOrUndefined(value) {
|
|
915
|
-
if (typeof value !== "string")
|
|
916
|
-
return void 0;
|
|
917
|
-
const trimmed = value.trim();
|
|
918
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
919
|
-
}
|
|
920
|
-
function normalizePlanStepLinks(value) {
|
|
921
|
-
if (!Array.isArray(value))
|
|
922
|
-
return void 0;
|
|
923
|
-
const out = [];
|
|
924
|
-
for (const entry of value) {
|
|
925
|
-
if (entry === null || typeof entry !== "object")
|
|
926
|
-
continue;
|
|
927
|
-
const record = entry;
|
|
928
|
-
const id = trimStringOrUndefined(record.id);
|
|
929
|
-
const kind = trimStringOrUndefined(record.kind);
|
|
930
|
-
if (!id || !kind)
|
|
931
|
-
continue;
|
|
932
|
-
const link = { id, kind };
|
|
933
|
-
const note = trimStringOrUndefined(record.note);
|
|
934
|
-
if (note)
|
|
935
|
-
link.note = note;
|
|
936
|
-
if (record.required_before_step === true)
|
|
937
|
-
link.required_before_step = true;
|
|
938
|
-
out.push(link);
|
|
939
|
-
}
|
|
940
|
-
return out.length > 0 ? out : void 0;
|
|
941
|
-
}
|
|
942
|
-
function normalizePlanStepFiles(value) {
|
|
943
|
-
if (!Array.isArray(value))
|
|
944
|
-
return void 0;
|
|
945
|
-
const out = [];
|
|
946
|
-
for (const entry of value) {
|
|
947
|
-
if (entry === null || typeof entry !== "object")
|
|
948
|
-
continue;
|
|
949
|
-
const record = entry;
|
|
950
|
-
const path2 = trimStringOrUndefined(record.path);
|
|
951
|
-
if (!path2)
|
|
952
|
-
continue;
|
|
953
|
-
const file = { path: normalizePathValue(path2) };
|
|
954
|
-
if (record.scope === "project" || record.scope === "global")
|
|
955
|
-
file.scope = record.scope;
|
|
956
|
-
const note = trimStringOrUndefined(record.note);
|
|
957
|
-
if (note)
|
|
958
|
-
file.note = note;
|
|
959
|
-
out.push(file);
|
|
960
|
-
}
|
|
961
|
-
return out.length > 0 ? out : void 0;
|
|
962
|
-
}
|
|
963
|
-
function normalizePlanStepTests(value) {
|
|
964
|
-
if (!Array.isArray(value))
|
|
965
|
-
return void 0;
|
|
966
|
-
const out = [];
|
|
967
|
-
for (const entry of value) {
|
|
968
|
-
if (entry === null || typeof entry !== "object")
|
|
969
|
-
continue;
|
|
970
|
-
const record = entry;
|
|
971
|
-
const command = trimStringOrUndefined(record.command);
|
|
972
|
-
const path2 = trimStringOrUndefined(record.path);
|
|
973
|
-
if (!command && !path2)
|
|
974
|
-
continue;
|
|
975
|
-
const test = {};
|
|
976
|
-
if (command)
|
|
977
|
-
test.command = command;
|
|
978
|
-
if (path2)
|
|
979
|
-
test.path = normalizePathValue(path2);
|
|
980
|
-
const note = trimStringOrUndefined(record.note);
|
|
981
|
-
if (note)
|
|
982
|
-
test.note = note;
|
|
983
|
-
out.push(test);
|
|
984
|
-
}
|
|
985
|
-
return out.length > 0 ? out : void 0;
|
|
986
|
-
}
|
|
987
|
-
function normalizePlanStepDocs(value) {
|
|
988
|
-
if (!Array.isArray(value))
|
|
989
|
-
return void 0;
|
|
990
|
-
const out = [];
|
|
991
|
-
for (const entry of value) {
|
|
992
|
-
if (entry === null || typeof entry !== "object")
|
|
993
|
-
continue;
|
|
994
|
-
const record = entry;
|
|
995
|
-
const path2 = trimStringOrUndefined(record.path);
|
|
996
|
-
if (!path2)
|
|
997
|
-
continue;
|
|
998
|
-
const doc = { path: normalizePathValue(path2) };
|
|
999
|
-
if (record.scope === "project" || record.scope === "global")
|
|
1000
|
-
doc.scope = record.scope;
|
|
1001
|
-
const note = trimStringOrUndefined(record.note);
|
|
1002
|
-
if (note)
|
|
1003
|
-
doc.note = note;
|
|
1004
|
-
out.push(doc);
|
|
1005
|
-
}
|
|
1006
|
-
return out.length > 0 ? out : void 0;
|
|
1007
|
-
}
|
|
1008
|
-
function normalizePlanStepEntry(entry) {
|
|
1009
|
-
if (entry === null || typeof entry !== "object") {
|
|
1010
|
-
return void 0;
|
|
1011
|
-
}
|
|
1012
|
-
const record = entry;
|
|
1013
|
-
const id = trimStringOrUndefined(record.id);
|
|
1014
|
-
const title = trimStringOrUndefined(record.title);
|
|
1015
|
-
const statusRaw = trimStringOrUndefined(record.status);
|
|
1016
|
-
const status = statusRaw && PLAN_STEP_STATUS_SET.has(statusRaw) ? statusRaw : void 0;
|
|
1017
|
-
const orderRaw = record.order;
|
|
1018
|
-
const order = typeof orderRaw === "number" && Number.isFinite(orderRaw) ? orderRaw : typeof orderRaw === "string" && orderRaw.trim().length > 0 ? Number(orderRaw) : Number.NaN;
|
|
1019
|
-
const created_at = typeof record.created_at === "string" ? record.created_at : "";
|
|
1020
|
-
const updated_at = typeof record.updated_at === "string" ? record.updated_at : "";
|
|
1021
|
-
if (!id || !title || !status || !Number.isFinite(order) || !created_at || !updated_at) {
|
|
1022
|
-
return void 0;
|
|
1023
|
-
}
|
|
1024
|
-
const step = {
|
|
1025
|
-
id,
|
|
1026
|
-
order,
|
|
1027
|
-
title,
|
|
1028
|
-
status,
|
|
1029
|
-
created_at,
|
|
1030
|
-
updated_at
|
|
1031
|
-
};
|
|
1032
|
-
applyPlanStepOptionalFields(step, record);
|
|
1033
|
-
return step;
|
|
1034
|
-
}
|
|
1035
|
-
function applyPlanStepOptionalFields(step, record) {
|
|
1036
|
-
const stringFields = [
|
|
1037
|
-
["body", "body"],
|
|
1038
|
-
["owner", "owner"],
|
|
1039
|
-
["evidence", "evidence"],
|
|
1040
|
-
["blocked_reason", "blocked_reason"],
|
|
1041
|
-
["superseded_by", "superseded_by"]
|
|
1042
|
-
];
|
|
1043
|
-
for (const [target, source] of stringFields) {
|
|
1044
|
-
const value = trimStringOrUndefined(record[source]);
|
|
1045
|
-
if (value) {
|
|
1046
|
-
step[target] = value;
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
const completedAt = typeof record.completed_at === "string" ? record.completed_at : void 0;
|
|
1050
|
-
if (completedAt && completedAt.length > 0) {
|
|
1051
|
-
step.completed_at = completedAt;
|
|
1052
|
-
}
|
|
1053
|
-
const collectionFields = [
|
|
1054
|
-
["linked_items", "linked_items", normalizePlanStepLinks],
|
|
1055
|
-
["files", "files", normalizePlanStepFiles],
|
|
1056
|
-
["tests", "tests", normalizePlanStepTests],
|
|
1057
|
-
["docs", "docs", normalizePlanStepDocs]
|
|
1058
|
-
];
|
|
1059
|
-
for (const [target, source, normalize] of collectionFields) {
|
|
1060
|
-
const value = normalize(record[source]);
|
|
1061
|
-
if (value) {
|
|
1062
|
-
step[target] = value;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
function normalizePlanSteps(value) {
|
|
1067
|
-
if (!Array.isArray(value))
|
|
1068
|
-
return void 0;
|
|
1069
|
-
const out = value.flatMap((entry) => {
|
|
1070
|
-
const step = normalizePlanStepEntry(entry);
|
|
1071
|
-
return step ? [step] : [];
|
|
1072
|
-
});
|
|
1073
|
-
out.sort((left, right) => left.order - right.order);
|
|
1074
|
-
return out.length > 0 ? out : void 0;
|
|
1075
|
-
}
|
|
1076
|
-
function normalizePlanDecisions(value) {
|
|
1077
|
-
if (!Array.isArray(value))
|
|
1078
|
-
return void 0;
|
|
1079
|
-
const out = [];
|
|
1080
|
-
for (const entry of value) {
|
|
1081
|
-
if (entry === null || typeof entry !== "object")
|
|
1082
|
-
continue;
|
|
1083
|
-
const record = entry;
|
|
1084
|
-
const ts = typeof record.ts === "string" ? record.ts : "";
|
|
1085
|
-
const author = typeof record.author === "string" ? record.author : "";
|
|
1086
|
-
const decision = trimStringOrUndefined(record.decision);
|
|
1087
|
-
if (!ts || !author || !decision)
|
|
1088
|
-
continue;
|
|
1089
|
-
const item = { ts, author, decision };
|
|
1090
|
-
const rationale = trimStringOrUndefined(record.rationale);
|
|
1091
|
-
if (rationale)
|
|
1092
|
-
item.rationale = rationale;
|
|
1093
|
-
const evidence = trimStringOrUndefined(record.evidence);
|
|
1094
|
-
if (evidence)
|
|
1095
|
-
item.evidence = evidence;
|
|
1096
|
-
const stepId = trimStringOrUndefined(record.step_id);
|
|
1097
|
-
if (stepId)
|
|
1098
|
-
item.step_id = stepId;
|
|
1099
|
-
out.push(item);
|
|
1100
|
-
}
|
|
1101
|
-
return out.length > 0 ? out : void 0;
|
|
1102
|
-
}
|
|
1103
|
-
function normalizePlanDiscoveries(value) {
|
|
1104
|
-
if (!Array.isArray(value))
|
|
1105
|
-
return void 0;
|
|
1106
|
-
const out = [];
|
|
1107
|
-
for (const entry of value) {
|
|
1108
|
-
if (entry === null || typeof entry !== "object")
|
|
1109
|
-
continue;
|
|
1110
|
-
const record = entry;
|
|
1111
|
-
const ts = typeof record.ts === "string" ? record.ts : "";
|
|
1112
|
-
const author = typeof record.author === "string" ? record.author : "";
|
|
1113
|
-
const text = trimStringOrUndefined(record.text);
|
|
1114
|
-
if (!ts || !author || !text)
|
|
1115
|
-
continue;
|
|
1116
|
-
const item = { ts, author, text };
|
|
1117
|
-
const stepId = trimStringOrUndefined(record.step_id);
|
|
1118
|
-
if (stepId)
|
|
1119
|
-
item.step_id = stepId;
|
|
1120
|
-
out.push(item);
|
|
1121
|
-
}
|
|
1122
|
-
return out.length > 0 ? out : void 0;
|
|
1123
|
-
}
|
|
1124
|
-
function normalizePlanValidation(value) {
|
|
1125
|
-
if (!Array.isArray(value))
|
|
1126
|
-
return void 0;
|
|
1127
|
-
const out = [];
|
|
1128
|
-
for (const entry of value) {
|
|
1129
|
-
if (entry === null || typeof entry !== "object")
|
|
1130
|
-
continue;
|
|
1131
|
-
const record = entry;
|
|
1132
|
-
const text = trimStringOrUndefined(record.text);
|
|
1133
|
-
if (!text)
|
|
1134
|
-
continue;
|
|
1135
|
-
const item = { text };
|
|
1136
|
-
const command = trimStringOrUndefined(record.command);
|
|
1137
|
-
if (command)
|
|
1138
|
-
item.command = command;
|
|
1139
|
-
const expected = trimStringOrUndefined(record.expected);
|
|
1140
|
-
if (expected)
|
|
1141
|
-
item.expected = expected;
|
|
1142
|
-
out.push(item);
|
|
1143
|
-
}
|
|
1144
|
-
return out.length > 0 ? out : void 0;
|
|
1145
|
-
}
|
|
1146
|
-
function normalizeTypeOptions(values) {
|
|
1147
|
-
if (!values) {
|
|
1148
|
-
return void 0;
|
|
1149
|
-
}
|
|
1150
|
-
const normalizedEntries = Object.entries(values).map(([key, value]) => [key.trim(), value.trim()]).filter(([key, value]) => key.length > 0 && value.length > 0).sort((left, right) => left[0].localeCompare(right[0]));
|
|
1151
|
-
if (normalizedEntries.length === 0) {
|
|
1152
|
-
return void 0;
|
|
1153
|
-
}
|
|
1154
|
-
return Object.fromEntries(normalizedEntries);
|
|
1155
|
-
}
|
|
1156
|
-
function normalizeBody(body) {
|
|
1157
|
-
let start = 0;
|
|
1158
|
-
while (start < body.length && body[start] === "\n") {
|
|
1159
|
-
start += 1;
|
|
1160
|
-
}
|
|
1161
|
-
return body.slice(start).trimEnd();
|
|
1162
|
-
}
|
|
1163
|
-
function normalizeConfidenceValue(value) {
|
|
1164
|
-
if (value === void 0) {
|
|
1165
|
-
return void 0;
|
|
1166
|
-
}
|
|
1167
|
-
if (typeof value === "number") {
|
|
1168
|
-
return value;
|
|
1169
|
-
}
|
|
1170
|
-
const normalized = value.trim().toLowerCase();
|
|
1171
|
-
if (normalized === "med") {
|
|
1172
|
-
return "medium";
|
|
1173
|
-
}
|
|
1174
|
-
if (CONFIDENCE_TEXT_VALUES.includes(normalized)) {
|
|
1175
|
-
return normalized;
|
|
1176
|
-
}
|
|
1177
|
-
return void 0;
|
|
1178
|
-
}
|
|
1179
|
-
function normalizeSeverityValue(value) {
|
|
1180
|
-
if (value === void 0) {
|
|
1181
|
-
return void 0;
|
|
1182
|
-
}
|
|
1183
|
-
const normalized = value.trim().toLowerCase();
|
|
1184
|
-
if (normalized === "med") {
|
|
1185
|
-
return "medium";
|
|
1186
|
-
}
|
|
1187
|
-
if (ISSUE_SEVERITY_VALUES.includes(normalized)) {
|
|
1188
|
-
return normalized;
|
|
1189
|
-
}
|
|
1190
|
-
return void 0;
|
|
1191
|
-
}
|
|
1192
|
-
function emptyStringToUndefined(value) {
|
|
1193
|
-
return value || void 0;
|
|
1194
|
-
}
|
|
1195
|
-
function copyExtensionFrontMatterFields(normalized, source) {
|
|
1196
|
-
const targetRecord = normalized;
|
|
1197
|
-
const sourceRecord = source;
|
|
1198
|
-
for (const [key, value] of Object.entries(sourceRecord)) {
|
|
1199
|
-
if (isUnsafeObjectKey(key) || Object.prototype.hasOwnProperty.call(targetRecord, key) || value === void 0) {
|
|
1200
|
-
continue;
|
|
1201
|
-
}
|
|
1202
|
-
targetRecord[key] = value;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
function coerceNormalizedRuntimeFields(normalized, runtimeContext) {
|
|
1206
|
-
if (!runtimeContext?.fieldRegistry) {
|
|
1207
|
-
return;
|
|
1208
|
-
}
|
|
1209
|
-
const record = normalized;
|
|
1210
|
-
for (const definition of runtimeContext.fieldRegistry.definitions) {
|
|
1211
|
-
const currentValue = record[definition.metadata_key];
|
|
1212
|
-
if (currentValue === void 0) {
|
|
1213
|
-
continue;
|
|
1214
|
-
}
|
|
1215
|
-
record[definition.metadata_key] = coerceRuntimeFieldValue(definition, currentValue, `metadata field "${definition.metadata_key}"`);
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
function assertNormalizedUnknownFields(normalized, runtimeContext) {
|
|
1219
|
-
if (!runtimeContext || runtimeContext.unknownFieldPolicy === "allow") {
|
|
1220
|
-
return;
|
|
1221
|
-
}
|
|
1222
|
-
const knownKeys = buildKnownFrontMatterKeys(runtimeContext);
|
|
1223
|
-
const record = normalized;
|
|
1224
|
-
const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));
|
|
1225
|
-
if (unknownKeys.length > 0 && runtimeContext.unknownFieldPolicy === "reject") {
|
|
1226
|
-
validationError(`unknown schema fields are not allowed: ${unknownKeys.join(", ")}`);
|
|
1227
|
-
}
|
|
1228
|
-
if (unknownKeys.length > 0) {
|
|
1229
|
-
runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(",")}`);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
function normalizeFrontMatter(frontMatter, options = {}) {
|
|
1233
|
-
const runtimeContext = resolveRuntimeSchemaValidationContext(options);
|
|
1234
|
-
const normalizedStatus = normalizeStatusInput(frontMatter.status, runtimeContext?.statusRegistry) ?? frontMatter.status;
|
|
1235
|
-
const tags = Array.from(new Set(frontMatter.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean))).sort((a, b) => a.localeCompare(b));
|
|
1236
|
-
const normalized = {
|
|
1237
|
-
id: frontMatter.id,
|
|
1238
|
-
title: frontMatter.title,
|
|
1239
|
-
description: frontMatter.description,
|
|
1240
|
-
type: frontMatter.type,
|
|
1241
|
-
pm_format_version: normalizeItemFormatVersion(frontMatter.pm_format_version),
|
|
1242
|
-
source_type: trimStringOrUndefined(frontMatter.source_type),
|
|
1243
|
-
type_options: normalizeTypeOptions(frontMatter.type_options),
|
|
1244
|
-
status: normalizedStatus,
|
|
1245
|
-
priority: frontMatter.priority,
|
|
1246
|
-
tags,
|
|
1247
|
-
created_at: frontMatter.created_at,
|
|
1248
|
-
updated_at: frontMatter.updated_at,
|
|
1249
|
-
dependencies: sortDependencies(frontMatter.dependencies),
|
|
1250
|
-
comments: sortLogValues(frontMatter.comments),
|
|
1251
|
-
notes: sortLogValues(frontMatter.notes),
|
|
1252
|
-
learnings: sortLogValues(frontMatter.learnings),
|
|
1253
|
-
files: normalizeFiles(frontMatter.files),
|
|
1254
|
-
tests: sortTests(frontMatter.tests),
|
|
1255
|
-
test_runs: normalizeTestRunSummaries(frontMatter.test_runs),
|
|
1256
|
-
docs: sortDocs(frontMatter.docs),
|
|
1257
|
-
deadline: emptyStringToUndefined(frontMatter.deadline),
|
|
1258
|
-
reminders: sortReminders(frontMatter.reminders),
|
|
1259
|
-
events: sortEvents(frontMatter.events),
|
|
1260
|
-
closed_at: emptyStringToUndefined(frontMatter.closed_at),
|
|
1261
|
-
assignee: trimStringOrUndefined(frontMatter.assignee),
|
|
1262
|
-
source_owner: trimStringOrUndefined(frontMatter.source_owner),
|
|
1263
|
-
author: emptyStringToUndefined(frontMatter.author),
|
|
1264
|
-
estimated_minutes: frontMatter.estimated_minutes,
|
|
1265
|
-
acceptance_criteria: frontMatter.acceptance_criteria ?? void 0,
|
|
1266
|
-
design: frontMatter.design ?? void 0,
|
|
1267
|
-
external_ref: frontMatter.external_ref ?? void 0,
|
|
1268
|
-
definition_of_ready: trimStringOrUndefined(frontMatter.definition_of_ready),
|
|
1269
|
-
order: frontMatter.order,
|
|
1270
|
-
goal: trimStringOrUndefined(frontMatter.goal),
|
|
1271
|
-
objective: trimStringOrUndefined(frontMatter.objective),
|
|
1272
|
-
value: trimStringOrUndefined(frontMatter.value),
|
|
1273
|
-
impact: trimStringOrUndefined(frontMatter.impact),
|
|
1274
|
-
outcome: trimStringOrUndefined(frontMatter.outcome),
|
|
1275
|
-
why_now: trimStringOrUndefined(frontMatter.why_now),
|
|
1276
|
-
parent: trimStringOrUndefined(frontMatter.parent),
|
|
1277
|
-
reviewer: trimStringOrUndefined(frontMatter.reviewer),
|
|
1278
|
-
risk: frontMatter.risk ?? void 0,
|
|
1279
|
-
confidence: normalizeConfidenceValue(frontMatter.confidence),
|
|
1280
|
-
sprint: trimStringOrUndefined(frontMatter.sprint),
|
|
1281
|
-
release: trimStringOrUndefined(frontMatter.release),
|
|
1282
|
-
blocked_by: trimStringOrUndefined(frontMatter.blocked_by),
|
|
1283
|
-
blocked_reason: trimStringOrUndefined(frontMatter.blocked_reason),
|
|
1284
|
-
unblock_note: trimStringOrUndefined(frontMatter.unblock_note),
|
|
1285
|
-
reporter: trimStringOrUndefined(frontMatter.reporter),
|
|
1286
|
-
severity: normalizeSeverityValue(frontMatter.severity),
|
|
1287
|
-
environment: trimStringOrUndefined(frontMatter.environment),
|
|
1288
|
-
repro_steps: trimStringOrUndefined(frontMatter.repro_steps),
|
|
1289
|
-
resolution: trimStringOrUndefined(frontMatter.resolution),
|
|
1290
|
-
expected_result: trimStringOrUndefined(frontMatter.expected_result),
|
|
1291
|
-
actual_result: trimStringOrUndefined(frontMatter.actual_result),
|
|
1292
|
-
affected_version: trimStringOrUndefined(frontMatter.affected_version),
|
|
1293
|
-
fixed_version: trimStringOrUndefined(frontMatter.fixed_version),
|
|
1294
|
-
component: trimStringOrUndefined(frontMatter.component),
|
|
1295
|
-
regression: frontMatter.regression,
|
|
1296
|
-
customer_impact: trimStringOrUndefined(frontMatter.customer_impact),
|
|
1297
|
-
close_reason: emptyStringToUndefined(frontMatter.close_reason),
|
|
1298
|
-
plan_mode: trimStringOrUndefined(frontMatter.plan_mode),
|
|
1299
|
-
plan_scope: trimStringOrUndefined(frontMatter.plan_scope),
|
|
1300
|
-
plan_harness: trimStringOrUndefined(frontMatter.plan_harness),
|
|
1301
|
-
plan_resume_context: trimStringOrUndefined(frontMatter.plan_resume_context),
|
|
1302
|
-
plan_steps: normalizePlanSteps(frontMatter.plan_steps),
|
|
1303
|
-
plan_decisions: normalizePlanDecisions(frontMatter.plan_decisions),
|
|
1304
|
-
plan_discoveries: normalizePlanDiscoveries(frontMatter.plan_discoveries),
|
|
1305
|
-
plan_validation: normalizePlanValidation(frontMatter.plan_validation)
|
|
1306
|
-
};
|
|
1307
|
-
copyExtensionFrontMatterFields(normalized, frontMatter);
|
|
1308
|
-
coerceNormalizedRuntimeFields(normalized, runtimeContext);
|
|
1309
|
-
assertNormalizedUnknownFields(normalized, runtimeContext);
|
|
1310
|
-
deleteUndefinedFields(normalized);
|
|
1311
|
-
return normalized;
|
|
1312
|
-
}
|
|
1313
|
-
function orderFrontMatter(frontMatter) {
|
|
1314
|
-
return orderObject(frontMatter, FRONT_MATTER_KEY_ORDER);
|
|
1315
|
-
}
|
|
1316
|
-
function findJsonObjectEnd(content) {
|
|
1317
|
-
let depth = 0;
|
|
1318
|
-
let inString = false;
|
|
1319
|
-
let escaped = false;
|
|
1320
|
-
for (let i = 0; i < content.length; i += 1) {
|
|
1321
|
-
const char = content[i];
|
|
1322
|
-
if (inString) {
|
|
1323
|
-
if (escaped) {
|
|
1324
|
-
escaped = false;
|
|
1325
|
-
continue;
|
|
1326
|
-
}
|
|
1327
|
-
if (char === "\\") {
|
|
1328
|
-
escaped = true;
|
|
1329
|
-
continue;
|
|
1330
|
-
}
|
|
1331
|
-
if (char === '"') {
|
|
1332
|
-
inString = false;
|
|
1333
|
-
}
|
|
1334
|
-
continue;
|
|
1335
|
-
}
|
|
1336
|
-
if (char === '"') {
|
|
1337
|
-
inString = true;
|
|
1338
|
-
continue;
|
|
1339
|
-
}
|
|
1340
|
-
if (char === "{") {
|
|
1341
|
-
depth += 1;
|
|
1342
|
-
continue;
|
|
1343
|
-
}
|
|
1344
|
-
if (char === "}") {
|
|
1345
|
-
depth -= 1;
|
|
1346
|
-
if (depth === 0) {
|
|
1347
|
-
return i;
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
return -1;
|
|
1352
|
-
}
|
|
1353
|
-
function splitFrontMatter(content) {
|
|
1354
|
-
if (!content.startsWith("{")) {
|
|
1355
|
-
return { frontMatter: "", body: content };
|
|
1356
|
-
}
|
|
1357
|
-
const end = findJsonObjectEnd(content);
|
|
1358
|
-
if (end < 0) {
|
|
1359
|
-
return { frontMatter: "", body: content };
|
|
1360
|
-
}
|
|
1361
|
-
const frontMatter = content.slice(0, end + 1);
|
|
1362
|
-
const body = content.slice(end + 1).replace(/^\r?\n+/, "");
|
|
1363
|
-
return { frontMatter, body };
|
|
1364
|
-
}
|
|
1365
|
-
function stripLeadingYamlDocument(content) {
|
|
1366
|
-
const normalizedContent = content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
1367
|
-
const opener = normalizedContent.match(/^[ \t]*---[ \t]*(?:\r?\n|$)/);
|
|
1368
|
-
if (!opener) {
|
|
1369
|
-
return { content: normalizedContent, stripped: false };
|
|
1370
|
-
}
|
|
1371
|
-
let cursor = opener[0].length;
|
|
1372
|
-
while (cursor < normalizedContent.length) {
|
|
1373
|
-
const nextNewline = normalizedContent.indexOf("\n", cursor);
|
|
1374
|
-
const lineEnd = nextNewline === -1 ? normalizedContent.length : nextNewline;
|
|
1375
|
-
const line = normalizedContent.slice(cursor, lineEnd).replace(/\r$/, "");
|
|
1376
|
-
const afterLine = nextNewline === -1 ? lineEnd : lineEnd + 1;
|
|
1377
|
-
if (line.trim() === "---") {
|
|
1378
|
-
return { content: normalizedContent.slice(afterLine).replace(/^\s+/, ""), stripped: true };
|
|
1379
|
-
}
|
|
1380
|
-
cursor = afterLine;
|
|
1381
|
-
}
|
|
1382
|
-
return { content: normalizedContent, stripped: false };
|
|
1383
|
-
}
|
|
1384
|
-
function normalizeParsedFrontMatter(frontMatter, options) {
|
|
1385
|
-
return normalizeFrontMatter(frontMatter, { ...options, onWarning: void 0 });
|
|
1386
|
-
}
|
|
1387
|
-
function parseJsonMarkdownItemDocument(content, runtimeContext, options = {}) {
|
|
1388
|
-
const normalized = stripLeadingYamlDocument(content);
|
|
1389
|
-
if (normalized.stripped) {
|
|
1390
|
-
options.onWarning?.("json_markdown_leading_yaml_frontmatter_ignored");
|
|
1391
|
-
}
|
|
1392
|
-
const { frontMatter, body } = splitFrontMatter(normalized.content);
|
|
1393
|
-
if (!frontMatter) {
|
|
1394
|
-
const trimmed = content.trimStart();
|
|
1395
|
-
if (trimmed.startsWith("{")) {
|
|
1396
|
-
validationError("JSON front matter is not valid JSON");
|
|
1397
|
-
}
|
|
1398
|
-
validationError("missing JSON front matter");
|
|
1399
|
-
}
|
|
1400
|
-
let parsed;
|
|
1401
|
-
try {
|
|
1402
|
-
parsed = JSON.parse(frontMatter);
|
|
1403
|
-
} catch {
|
|
1404
|
-
validationError("JSON front matter is not valid JSON");
|
|
1405
|
-
}
|
|
1406
|
-
assertValidFrontMatter(parsed, runtimeContext);
|
|
1407
|
-
return {
|
|
1408
|
-
metadata: normalizeParsedFrontMatter(parsed, options),
|
|
1409
|
-
body: normalizeBody(body)
|
|
1410
|
-
};
|
|
1411
|
-
}
|
|
1412
|
-
function parseToonItemDocument(content, runtimeContext, options = {}) {
|
|
1413
|
-
let parsed;
|
|
1414
|
-
try {
|
|
1415
|
-
parsed = decodeToonItemContent(content).value;
|
|
1416
|
-
} catch {
|
|
1417
|
-
validationError("TOON item document is not valid TOON");
|
|
1418
|
-
}
|
|
1419
|
-
assertFrontMatterCondition(typeof parsed === "object" && parsed !== null && !Array.isArray(parsed), "TOON item document must be an object");
|
|
1420
|
-
const record = parsed;
|
|
1421
|
-
if (Object.prototype.hasOwnProperty.call(record, "front_matter")) {
|
|
1422
|
-
assertValidFrontMatter(record.front_matter, runtimeContext);
|
|
1423
|
-
assertFrontMatterCondition(record.body === void 0 || typeof record.body === "string", "TOON item document body must be a string");
|
|
1424
|
-
return {
|
|
1425
|
-
metadata: normalizeParsedFrontMatter(record.front_matter, options),
|
|
1426
|
-
body: normalizeBody(typeof record.body === "string" ? record.body : "")
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
const { body, ...frontMatterRecord } = record;
|
|
1430
|
-
assertFrontMatterCondition(body === void 0 || typeof body === "string", "TOON item document body must be a string");
|
|
1431
|
-
assertValidFrontMatter(frontMatterRecord, runtimeContext);
|
|
1432
|
-
return {
|
|
1433
|
-
metadata: normalizeParsedFrontMatter(frontMatterRecord, options),
|
|
1434
|
-
body: normalizeBody(typeof body === "string" ? body : "")
|
|
1435
|
-
};
|
|
1436
|
-
}
|
|
1437
|
-
function serializeJsonMarkdownItemDocument(document, options = {}) {
|
|
1438
|
-
const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);
|
|
1439
|
-
const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);
|
|
1440
|
-
const serializedFrontMatter = JSON.stringify(orderedFrontMatter, null, 2);
|
|
1441
|
-
const normalizedBody = normalizeBody(document.body ?? "");
|
|
1442
|
-
if (!normalizedBody) {
|
|
1443
|
-
return `${serializedFrontMatter}
|
|
1444
|
-
`;
|
|
1445
|
-
}
|
|
1446
|
-
return `${serializedFrontMatter}
|
|
1447
|
-
|
|
1448
|
-
${normalizedBody}
|
|
1449
|
-
`;
|
|
1450
|
-
}
|
|
1451
|
-
function serializeToonItemDocument(document, options = {}) {
|
|
1452
|
-
const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);
|
|
1453
|
-
const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);
|
|
1454
|
-
const normalizedBody = normalizeBody(document.body ?? "");
|
|
1455
|
-
return `${encodeToon({ ...orderedFrontMatter, body: normalizedBody })}
|
|
1456
|
-
`;
|
|
1457
|
-
}
|
|
1458
|
-
function parseItemDocument(content, options = {}) {
|
|
1459
|
-
const conflictMarker = findFirstMergeConflictMarker(content);
|
|
1460
|
-
if (conflictMarker) {
|
|
1461
|
-
throw new PmCliError(`Merge conflict markers detected in item document at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`, EXIT_CODE.GENERIC_FAILURE, {
|
|
1462
|
-
code: "merge_conflict_markers_detected",
|
|
1463
|
-
required: "Resolve merge-conflict markers in the item file before parsing or mutation commands.",
|
|
1464
|
-
why: "Partially merged documents can corrupt item metadata and history integrity.",
|
|
1465
|
-
examples: ["git status", "git add <resolved-file> && git commit"],
|
|
1466
|
-
nextSteps: ["Resolve conflicts, save the file, then rerun the pm command."]
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
const format = options.format ?? "toon";
|
|
1470
|
-
const runtimeContext = resolveRuntimeSchemaValidationContext(options);
|
|
1471
|
-
return format === "toon" ? parseToonItemDocument(content, runtimeContext, options) : parseJsonMarkdownItemDocument(content, runtimeContext, options);
|
|
1472
|
-
}
|
|
1473
|
-
function serializeItemDocument(document, options = {}) {
|
|
1474
|
-
const format = options.format ?? "toon";
|
|
1475
|
-
return format === "toon" ? serializeToonItemDocument(document, options) : serializeJsonMarkdownItemDocument(document, options);
|
|
1476
|
-
}
|
|
1477
|
-
function canonicalDocument(document, options = {}) {
|
|
1478
|
-
return {
|
|
1479
|
-
metadata: normalizeFrontMatter(document.metadata, options),
|
|
1480
|
-
body: normalizeBody(document.body ?? "")
|
|
1481
|
-
};
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
// dist/core/item/id.js
|
|
1485
|
-
import crypto from "node:crypto";
|
|
1486
|
-
import path from "node:path";
|
|
1487
|
-
function normalizePrefix(input) {
|
|
1488
|
-
const normalized = (input ?? "").trim().toLowerCase();
|
|
1489
|
-
if (!normalized)
|
|
1490
|
-
return "pm-";
|
|
1491
|
-
return normalized.endsWith("-") ? normalized : `${normalized}-`;
|
|
1492
|
-
}
|
|
1493
|
-
function normalizeRawItemId(input) {
|
|
1494
|
-
let normalized = input.trim().toLowerCase();
|
|
1495
|
-
if (normalized.startsWith("#")) {
|
|
1496
|
-
normalized = normalized.slice(1);
|
|
1497
|
-
}
|
|
1498
|
-
return normalized;
|
|
1499
|
-
}
|
|
1500
|
-
function normalizeItemId(input, prefix) {
|
|
1501
|
-
const canonicalPrefix = normalizePrefix(prefix);
|
|
1502
|
-
const normalized = normalizeRawItemId(input);
|
|
1503
|
-
if (normalized.startsWith(canonicalPrefix)) {
|
|
1504
|
-
return normalized;
|
|
1505
|
-
}
|
|
1506
|
-
return `${canonicalPrefix}${normalized}`;
|
|
1507
|
-
}
|
|
1508
|
-
function randomToken(length) {
|
|
1509
|
-
let token = "";
|
|
1510
|
-
for (let index = 0; index < length; index += 1) {
|
|
1511
|
-
token += crypto.randomInt(0, 36).toString(36);
|
|
1512
|
-
}
|
|
1513
|
-
return token;
|
|
1514
|
-
}
|
|
1515
|
-
async function idExists(pmRoot, id) {
|
|
1516
|
-
const checks = Object.values(TYPE_TO_FOLDER).flatMap((folder) => [
|
|
1517
|
-
path.join(pmRoot, folder, `${id}.md`),
|
|
1518
|
-
path.join(pmRoot, folder, `${id}.toon`)
|
|
1519
|
-
]);
|
|
1520
|
-
for (const target of checks) {
|
|
1521
|
-
if (await pathExists(target)) {
|
|
1522
|
-
return true;
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
return false;
|
|
1526
|
-
}
|
|
1527
|
-
async function generateItemId(pmRoot, prefix) {
|
|
1528
|
-
let tokenLength = 4;
|
|
1529
|
-
let attempts = 0;
|
|
1530
|
-
while (tokenLength <= 10) {
|
|
1531
|
-
for (let i = 0; i < 32; i += 1) {
|
|
1532
|
-
const id = `${normalizePrefix(prefix)}${randomToken(tokenLength)}`;
|
|
1533
|
-
if (!await idExists(pmRoot, id)) {
|
|
1534
|
-
return id;
|
|
1535
|
-
}
|
|
1536
|
-
attempts += 1;
|
|
1537
|
-
}
|
|
1538
|
-
tokenLength += 1;
|
|
1539
|
-
}
|
|
1540
|
-
throw new Error(`Unable to generate unique id after ${attempts} attempts`);
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
export {
|
|
1544
|
-
readRuntimeFieldOptionValue,
|
|
1545
|
-
coerceRuntimeFieldValue,
|
|
1546
|
-
collectRuntimeCreateFieldValues,
|
|
1547
|
-
collectRuntimeUpdateFieldValues,
|
|
1548
|
-
BASELINE_ITEM_FORMAT_VERSION,
|
|
1549
|
-
CURRENT_ITEM_FORMAT_VERSION,
|
|
1550
|
-
effectiveItemFormatVersion,
|
|
1551
|
-
normalizeItemFormatVersion,
|
|
1552
|
-
classifyItemFormatVersion,
|
|
1553
|
-
scanItemFormatVersions,
|
|
1554
|
-
normalizeStatusInput,
|
|
1555
|
-
normalizeStatusForRegistry,
|
|
1556
|
-
isTerminalStatus,
|
|
1557
|
-
findFirstMergeConflictMarker,
|
|
1558
|
-
normalizeFrontMatter,
|
|
1559
|
-
splitFrontMatter,
|
|
1560
|
-
parseItemDocument,
|
|
1561
|
-
serializeItemDocument,
|
|
1562
|
-
canonicalDocument,
|
|
1563
|
-
normalizePrefix,
|
|
1564
|
-
normalizeRawItemId,
|
|
1565
|
-
normalizeItemId,
|
|
1566
|
-
generateItemId
|
|
1567
|
-
};
|
|
1568
|
-
//# sourceMappingURL=chunk-HK72NWAD.js.map
|
|
1569
|
-
|
|
1570
|
-
//# debugId=4b8306b7-d6d7-5615-af29-66de3136cea2
|