@unbrained/pm-cli 2026.5.31 → 2026.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/dist/cli/argv-utils.js +7 -3
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +1 -0
- package/dist/cli/bootstrap-args.js +23 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/calendar.js +17 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +63 -0
- package/dist/cli/commands/close-many.js +302 -0
- package/dist/cli/commands/close-many.js.map +1 -0
- package/dist/cli/commands/completion.d.ts +1 -0
- package/dist/cli/commands/completion.js +241 -27
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/config.js +115 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +191 -162
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +77 -114
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.d.ts +12 -0
- package/dist/cli/commands/extension/doctor.js +97 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +49 -48
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.js +51 -23
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/get.js +7 -7
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +38 -3
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.js +4 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.js +107 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.js +58 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/reindex.js +163 -47
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +25 -4
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +122 -1
- package/dist/cli/commands/schema.js +536 -6
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +1 -0
- package/dist/cli/commands/search.js +18 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +4 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +69 -140
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -0
- package/dist/cli/commands/update.js +138 -119
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +1 -0
- package/dist/cli/commands/validate.js +63 -33
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -3
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/help-content.js +82 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +377 -23
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +9 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +200 -28
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +4 -2
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +31 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
- package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
- package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
- package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-OOAGKWRG.js} +11 -11
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-5JE3YGXU.js} +8 -9
- package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-5JE3YGXU.js.map} +1 -1
- package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
- package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
- package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3OH4DAEB.js} +119 -6
- package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
- package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-4PJQSECJ.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
- package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-5IRA6IYD.js} +175 -54
- package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
- package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
- package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
- package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
- package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
- package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-ATBVS6WW.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
- package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-B3N4TKNL.js} +12 -11
- package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-BNL6S7QH.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
- package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-CJDQB2ED.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
- package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-D3WUNETC.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-D5X7N6FI.js} +210 -132
- package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-DFIZGAI5.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-DFIZGAI5.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
- package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
- package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
- package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
- package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-GCAVRLGE.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
- package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
- package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
- package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-HPH6X4ZZ.js} +26 -15
- package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-HZOS2UG5.js} +18 -6
- package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
- package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
- package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-JB4RGL4V.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
- package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-K47WAYQV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-KA24HME7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
- package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
- package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-KK6YPGH3.js} +22 -3
- package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-LDJK7SHN.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
- package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
- package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-N5YF3VFN.js} +54 -32
- package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
- package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
- package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-OIQIXTNB.js} +164 -53
- package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
- package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-OUF3ARDX.js} +251 -251
- package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-RANZIID5.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
- package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-S3CV7JGJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-SRVKTWPR.js} +748 -196
- package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
- package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
- package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
- package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
- package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-TK633IVD.js} +35 -8
- package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
- package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
- package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
- package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
- package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
- package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-WIKR7KFL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XG7RJYHV.js} +484 -49
- package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
- package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-XX5LRINW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-Y2AKE2HS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-ZQ4F6EC4.js} +301 -24
- package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
- package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-AZLP7YFO.js} +10 -11
- package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-AZLP7YFO.js.map} +1 -1
- package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
- package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
- package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
- package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
- package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
- package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
- package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-AGBNSJJH.js} +10 -11
- package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-AGBNSJJH.js.map} +1 -1
- package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
- package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-5ON3ADRH.js} +121 -10
- package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
- package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-E6U3DWVM.js} +32 -19
- package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-E6U3DWVM.js.map} +2 -2
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
- package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-CXSFM45B.js} +194 -162
- package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
- package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
- package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
- package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
- package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-RONNH4F4.js} +7 -8
- package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-RONNH4F4.js.map} +1 -1
- package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
- package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
- package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
- package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-WII3O4HB.js} +7 -8
- package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-WII3O4HB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-JMVCFNHH.js} +9 -10
- package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-JMVCFNHH.js.map} +1 -1
- package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
- package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
- package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
- package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
- package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-G6UXSM5S.js} +4 -5
- package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
- package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-MXYS5W4M.js} +9 -10
- package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-MXYS5W4M.js.map} +1 -1
- package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
- package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-JWNF66EC.js → gc-QNBRJG6H.js} +3 -3
- package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-CINFEUIY.js} +16 -17
- package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
- package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
- package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-IT5DBPRJ.js} +43 -15
- package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
- package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
- package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
- package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
- package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-KC5ZOJRZ.js} +12 -14
- package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-KC5ZOJRZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
- package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
- package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
- package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
- package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-A3CLB5CO.js} +10 -11
- package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-A3CLB5CO.js.map} +1 -1
- package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
- package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
- package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
- package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
- package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-42LIC3UE.js} +10 -11
- package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-42LIC3UE.js.map} +1 -1
- package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
- package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-HDQXEUKD.js} +13 -14
- package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-HDQXEUKD.js.map} +1 -1
- package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
- package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-AG3XKXWL.js} +22 -24
- package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
- package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
- package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-RSMT6DPK.js} +154 -43
- package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
- package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-Q54JQZUN.js} +33 -34
- package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
- package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
- package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-YJKIQRKA.js} +18 -19
- package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-YJKIQRKA.js.map} +2 -2
- package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
- package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
- package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
- package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
- package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
- package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-HENBL456.js → search-5A3BMFA7.js} +25 -16
- package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
- package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
- package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js → stats-Y2CBTZSL.js} +7 -8
- package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js.map → stats-Y2CBTZSL.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
- package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
- package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-EEMKNTGU.js} +13 -14
- package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-EEMKNTGU.js.map} +1 -1
- package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
- package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
- package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
- package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-L2M7WKH7.js} +5 -5
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
- package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
- package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
- package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-322CCH2L.js} +78 -146
- package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
- package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-2U727SAM.js} +5 -7
- package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-2U727SAM.js.map} +1 -1
- package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
- package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
- package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
- package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-ZFVWPEEN.js} +61 -48
- package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
- package/dist/cli-bundle/main.js +490 -52
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
- package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
- package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.d.ts +73 -0
- package/dist/core/diagnostics/remediation.js +328 -0
- package/dist/core/diagnostics/remediation.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.js +9 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +60 -4
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +5 -1
- package/dist/core/extensions/index.js +61 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.d.ts +5 -1
- package/dist/core/extensions/item-fields.js +126 -4
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +283 -8
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/item/item-format.d.ts +3 -2
- package/dist/core/item/item-format.js +15 -10
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/status-filter.d.ts +29 -0
- package/dist/core/item/status-filter.js +97 -0
- package/dist/core/item/status-filter.js.map +1 -0
- package/dist/core/item/type-registry.js +4 -2
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/output.js +17 -5
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +15 -0
- package/dist/core/schema/item-types-file.js +27 -2
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +4 -3
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.d.ts +1 -1
- package/dist/core/schema/runtime-field-values.js +10 -4
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +75 -2
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.d.ts +113 -0
- package/dist/core/schema/status-defs-file.js +260 -0
- package/dist/core/schema/status-defs-file.js.map +1 -0
- package/dist/core/schema/type-workflows.d.ts +64 -0
- package/dist/core/schema/type-workflows.js +98 -0
- package/dist/core/schema/type-workflows.js.map +1 -0
- package/dist/core/search/cache.d.ts +3 -1
- package/dist/core/search/cache.js +104 -28
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/http-client.d.ts +2 -2
- package/dist/core/search/http-client.js +2 -2
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -0
- package/dist/core/search/vector-stores.js +64 -14
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/search/vectorization-metadata.d.ts +13 -0
- package/dist/core/search/vectorization-metadata.js +65 -0
- package/dist/core/search/vectorization-metadata.js.map +1 -0
- package/dist/core/shared/serialization.d.ts +1 -0
- package/dist/core/shared/serialization.js +86 -2
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +14 -5
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +61 -6
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.js +18 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +40 -5
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.js +4 -3
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/mcp/server.js +221 -12
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +7 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -6
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +19 -1
- package/dist/sdk/cli-contracts.js +187 -15
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/errors.d.ts +22 -0
- package/dist/sdk/errors.js +46 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/package-import-adapters.js +14 -3
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -0
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/testing.d.ts +77 -0
- package/dist/sdk/testing.js +239 -0
- package/dist/sdk/testing.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +3 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +21 -2
- package/docs/COMMANDS.md +85 -5
- package/docs/CONFIGURATION.md +49 -2
- package/docs/EXTENSIONS.md +118 -6
- package/docs/QUICKSTART.md +2 -0
- package/docs/RELEASING.md +2 -2
- package/docs/SDK.md +273 -1
- package/docs/TESTING.md +17 -0
- package/docs/examples/policy-restricted-extension/manifest.json +1 -0
- package/docs/examples/starter-extension/index.js +9 -1
- package/docs/examples/starter-extension/manifest.json +1 -0
- package/package.json +12 -6
- package/packages/pm-beads/extensions/beads/index.js +2 -4
- package/packages/pm-beads/extensions/beads/index.ts +43 -33
- package/packages/pm-beads/extensions/beads/manifest.json +12 -1
- package/packages/pm-calendar/README.md +6 -0
- package/packages/pm-calendar/extensions/calendar/index.js +6 -1
- package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
- package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
- package/packages/pm-guide-shell/README.md +4 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
- package/packages/pm-lifecycle-hooks/README.md +29 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
- package/packages/pm-lifecycle-hooks/package.json +52 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
- package/packages/pm-templates/extensions/templates/manifest.json +6 -1
- package/packages/pm-todos/extensions/todos/index.js +3 -7
- package/packages/pm-todos/extensions/todos/index.ts +55 -42
- package/packages/pm-todos/extensions/todos/manifest.json +13 -1
- package/scripts/bundle-cli.mjs +121 -17
- package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
- package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
- package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
- package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
- package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
- package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
- package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
- package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
- package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
- package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
- package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
- package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
- package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
- package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
- package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
- package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
- package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
- package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-P5BUMWP3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-OOAGKWRG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-ATBVS6WW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-BNL6S7QH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-CJDQB2ED.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-D3WUNETC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-JB4RGL4V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-K47WAYQV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-KA24HME7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-LDJK7SHN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-RANZIID5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-S3CV7JGJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js.map → chunk-WIKR7KFL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-XX5LRINW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-Y2AKE2HS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-RMHQ3KWH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-ATONSAZW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-G6UXSM5S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-JWNF66EC.js.map → gc-QNBRJG6H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-6FC4H6HI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-XKYEZDBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-KHX3FEEM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-53LZ2AEO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-JL5QIH7H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-RJ4ZF35X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-L2M7WKH7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-PYLVHMRD.js.map} +0 -0
|
@@ -0,0 +1,1325 @@
|
|
|
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]="b9b7439e-7986-5a85-9356-8d54578b038a")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
compareTimestampStrings,
|
|
5
|
+
isTimestampLiteral
|
|
6
|
+
} from "./chunk-NQP3ECKF.js";
|
|
7
|
+
import {
|
|
8
|
+
CONFIDENCE_TEXT_VALUES,
|
|
9
|
+
EXIT_CODE,
|
|
10
|
+
FRONT_MATTER_KEY_ORDER,
|
|
11
|
+
ISSUE_SEVERITY_VALUES,
|
|
12
|
+
PmCliError,
|
|
13
|
+
RECURRENCE_FREQUENCY_VALUES,
|
|
14
|
+
RECURRENCE_WEEKDAY_VALUES,
|
|
15
|
+
STATUS_VALUES,
|
|
16
|
+
normalizeStatusInputWithRegistry,
|
|
17
|
+
orderObject,
|
|
18
|
+
resolveRuntimeFieldRegistry,
|
|
19
|
+
resolveRuntimeStatusRegistry,
|
|
20
|
+
runtimeFieldOptionTarget,
|
|
21
|
+
weekdayOrderIndex
|
|
22
|
+
} from "./chunk-4LTBNUYT.js";
|
|
23
|
+
|
|
24
|
+
// dist/core/schema/runtime-field-values.js
|
|
25
|
+
function toCamelToken(value) {
|
|
26
|
+
const segments = value.trim().replaceAll(/[^A-Za-z0-9]+/g, " ").split(/\s+/).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase());
|
|
27
|
+
if (segments.length === 0) {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
const [first, ...rest] = segments;
|
|
31
|
+
return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join("")}`;
|
|
32
|
+
}
|
|
33
|
+
function resolveCandidateOptionKeys(definition) {
|
|
34
|
+
return [.../* @__PURE__ */ new Set([
|
|
35
|
+
runtimeFieldOptionTarget(definition),
|
|
36
|
+
toCamelToken(definition.key),
|
|
37
|
+
toCamelToken(definition.cli_flag),
|
|
38
|
+
...definition.cli_aliases.map((alias) => toCamelToken(alias))
|
|
39
|
+
])];
|
|
40
|
+
}
|
|
41
|
+
function readRuntimeFieldOptionValue(options, definition) {
|
|
42
|
+
for (const candidateKey of resolveCandidateOptionKeys(definition)) {
|
|
43
|
+
if (!Object.hasOwn(options, candidateKey)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const value = options[candidateKey];
|
|
47
|
+
if (value !== void 0) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return void 0;
|
|
52
|
+
}
|
|
53
|
+
function normalizeStringArrayValue(value) {
|
|
54
|
+
if (Array.isArray(value)) {
|
|
55
|
+
return value.flatMap((entry) => normalizeStringArrayValue(entry)).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
56
|
+
}
|
|
57
|
+
if (typeof value === "string") {
|
|
58
|
+
return value.split(/[,\n|]/).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
59
|
+
}
|
|
60
|
+
if (value === void 0 || value === null) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
return [String(value).trim()].filter((entry) => entry.length > 0);
|
|
64
|
+
}
|
|
65
|
+
function parseBooleanValue(raw, label) {
|
|
66
|
+
if (typeof raw === "boolean") {
|
|
67
|
+
return raw;
|
|
68
|
+
}
|
|
69
|
+
if (typeof raw === "number") {
|
|
70
|
+
if (raw === 1) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if (raw === 0) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (typeof raw === "string") {
|
|
78
|
+
const normalized = raw.trim().toLowerCase();
|
|
79
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes") {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (normalized === "false" || normalized === "0" || normalized === "no") {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
throw new PmCliError(`${label} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);
|
|
87
|
+
}
|
|
88
|
+
function parseNumberValue(raw, label) {
|
|
89
|
+
if (typeof raw === "number" && Number.isFinite(raw)) {
|
|
90
|
+
return raw;
|
|
91
|
+
}
|
|
92
|
+
const candidate = typeof raw === "string" ? raw.trim() : String(raw);
|
|
93
|
+
const parsed = Number(candidate);
|
|
94
|
+
if (!Number.isFinite(parsed)) {
|
|
95
|
+
throw new PmCliError(`${label} must be a number`, EXIT_CODE.USAGE);
|
|
96
|
+
}
|
|
97
|
+
return parsed;
|
|
98
|
+
}
|
|
99
|
+
function coerceRuntimeFieldValue(definition, rawValue, labelOverride) {
|
|
100
|
+
const label = labelOverride ?? `--${definition.cli_flag}`;
|
|
101
|
+
if (definition.repeatable || definition.type === "string_array") {
|
|
102
|
+
const values = normalizeStringArrayValue(rawValue);
|
|
103
|
+
if (definition.type === "number") {
|
|
104
|
+
return values.map((value) => parseNumberValue(value, label));
|
|
105
|
+
}
|
|
106
|
+
if (definition.type === "boolean") {
|
|
107
|
+
return values.map((value) => parseBooleanValue(value, label));
|
|
108
|
+
}
|
|
109
|
+
return values;
|
|
110
|
+
}
|
|
111
|
+
const scalarRaw = Array.isArray(rawValue) ? rawValue[rawValue.length - 1] : rawValue;
|
|
112
|
+
if (scalarRaw === void 0) {
|
|
113
|
+
return void 0;
|
|
114
|
+
}
|
|
115
|
+
if (definition.type === "number") {
|
|
116
|
+
return parseNumberValue(scalarRaw, label);
|
|
117
|
+
}
|
|
118
|
+
if (definition.type === "boolean") {
|
|
119
|
+
return parseBooleanValue(scalarRaw, label);
|
|
120
|
+
}
|
|
121
|
+
return typeof scalarRaw === "string" ? scalarRaw : String(scalarRaw);
|
|
122
|
+
}
|
|
123
|
+
function shouldRequireFieldOnCreate(definition, itemTypeName) {
|
|
124
|
+
if (!definition.required && !definition.required_on_create) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (definition.required_types.length === 0) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
if (!itemTypeName) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return definition.required_types.map((value) => value.toLowerCase()).includes(itemTypeName.trim().toLowerCase());
|
|
134
|
+
}
|
|
135
|
+
function collectRuntimeCreateFieldValues(options, fieldRegistry, itemTypeName) {
|
|
136
|
+
const values = {};
|
|
137
|
+
const missingRequiredFlags = [];
|
|
138
|
+
for (const definition of fieldRegistry.command_to_fields.get("create") ?? []) {
|
|
139
|
+
const rawValue = readRuntimeFieldOptionValue(options, definition);
|
|
140
|
+
if (rawValue === void 0) {
|
|
141
|
+
if (shouldRequireFieldOnCreate(definition, itemTypeName)) {
|
|
142
|
+
missingRequiredFlags.push(`--${definition.cli_flag}`);
|
|
143
|
+
}
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
values,
|
|
150
|
+
missing_required_flags: [...new Set(missingRequiredFlags)].sort((left, right) => left.localeCompare(right))
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function collectRuntimeUpdateFieldValues(options, fieldRegistry, commands = ["update"]) {
|
|
154
|
+
const values = {};
|
|
155
|
+
const definitions = (commands ?? ["update"]).flatMap((command) => fieldRegistry.command_to_fields.get(command) ?? []);
|
|
156
|
+
const seen = /* @__PURE__ */ new Set();
|
|
157
|
+
for (const definition of definitions) {
|
|
158
|
+
const rawValue = readRuntimeFieldOptionValue(options, definition);
|
|
159
|
+
if (rawValue === void 0) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (seen.has(definition.metadata_key)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
seen.add(definition.metadata_key);
|
|
166
|
+
values[definition.metadata_key] = coerceRuntimeFieldValue(definition, rawValue);
|
|
167
|
+
}
|
|
168
|
+
return values;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// dist/core/item/status.js
|
|
172
|
+
var STATUS_ALIAS_MAP = {
|
|
173
|
+
"in-progress": "in_progress",
|
|
174
|
+
cancelled: "canceled"
|
|
175
|
+
};
|
|
176
|
+
function normalizeStatusInput(value, registry) {
|
|
177
|
+
if (registry) {
|
|
178
|
+
const normalizedFromRegistry = normalizeStatusInputWithRegistry(value, registry);
|
|
179
|
+
if (normalizedFromRegistry) {
|
|
180
|
+
return normalizedFromRegistry;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (typeof value !== "string") {
|
|
184
|
+
return void 0;
|
|
185
|
+
}
|
|
186
|
+
const normalized = value.trim().toLowerCase();
|
|
187
|
+
if (!normalized) {
|
|
188
|
+
return void 0;
|
|
189
|
+
}
|
|
190
|
+
const canonical = STATUS_ALIAS_MAP[normalized] ?? normalized;
|
|
191
|
+
if (!STATUS_VALUES.includes(canonical)) {
|
|
192
|
+
return void 0;
|
|
193
|
+
}
|
|
194
|
+
return canonical;
|
|
195
|
+
}
|
|
196
|
+
function normalizeStatusForRegistry(status, registry) {
|
|
197
|
+
return normalizeStatusInput(status, registry) ?? status;
|
|
198
|
+
}
|
|
199
|
+
function isTerminalStatus(status, registry) {
|
|
200
|
+
return registry.terminal_statuses.has(normalizeStatusForRegistry(status, registry));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// dist/core/shared/conflict-markers.js
|
|
204
|
+
var CONFLICT_MARKER_PATTERN = /^\s*(<<<<<<<|=======|>>>>>>>)(?:\s.*)?$/;
|
|
205
|
+
function findMergeConflictMarkers(content) {
|
|
206
|
+
if (content.length === 0) {
|
|
207
|
+
return [];
|
|
208
|
+
}
|
|
209
|
+
const lines = content.split(/\r?\n/);
|
|
210
|
+
const matches = [];
|
|
211
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
212
|
+
const line = lines[index] ?? "";
|
|
213
|
+
const markerMatch = line.match(CONFLICT_MARKER_PATTERN);
|
|
214
|
+
if (!markerMatch) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const marker = markerMatch[1];
|
|
218
|
+
matches.push({
|
|
219
|
+
line: index + 1,
|
|
220
|
+
marker,
|
|
221
|
+
text: line
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
return matches;
|
|
225
|
+
}
|
|
226
|
+
function findFirstMergeConflictMarker(content) {
|
|
227
|
+
const matches = findMergeConflictMarkers(content);
|
|
228
|
+
return matches[0];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// dist/core/item/item-format.js
|
|
232
|
+
import { encode as encodeToon } from "@toon-format/toon";
|
|
233
|
+
|
|
234
|
+
// dist/core/item/toon-decode.js
|
|
235
|
+
import { decode as decodeToon } from "@toon-format/toon";
|
|
236
|
+
function escapeBracketsInQuotedScalars(content) {
|
|
237
|
+
return content.split("\n").map((line) => {
|
|
238
|
+
const separatorIndex = line.indexOf(": ");
|
|
239
|
+
const bracketIndex = line.indexOf("[");
|
|
240
|
+
if (separatorIndex === -1 || bracketIndex === -1 || bracketIndex < separatorIndex) {
|
|
241
|
+
return line;
|
|
242
|
+
}
|
|
243
|
+
const key = line.slice(0, separatorIndex + 2);
|
|
244
|
+
const value = line.slice(separatorIndex + 2);
|
|
245
|
+
if (!value.startsWith('"')) {
|
|
246
|
+
return line;
|
|
247
|
+
}
|
|
248
|
+
return key + value.replaceAll("[", "\\u005b");
|
|
249
|
+
}).join("\n");
|
|
250
|
+
}
|
|
251
|
+
function decodeToonItemContent(content) {
|
|
252
|
+
try {
|
|
253
|
+
return { value: decodeToon(content), usedScalarBracketEscape: false };
|
|
254
|
+
} catch (strictError) {
|
|
255
|
+
const escaped = escapeBracketsInQuotedScalars(content);
|
|
256
|
+
if (escaped === content) {
|
|
257
|
+
throw strictError;
|
|
258
|
+
}
|
|
259
|
+
return { value: decodeToon(escaped), usedScalarBracketEscape: true };
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// dist/core/item/item-format.js
|
|
264
|
+
var LINKED_TEST_PM_CONTEXT_MODE_VALUES = /* @__PURE__ */ new Set(["schema", "tracker", "auto"]);
|
|
265
|
+
function normalizePathValue(value) {
|
|
266
|
+
return value.replaceAll("\\", "/");
|
|
267
|
+
}
|
|
268
|
+
var REQUIRED_STRING_FIELDS = [
|
|
269
|
+
"id",
|
|
270
|
+
"title",
|
|
271
|
+
"description",
|
|
272
|
+
"created_at",
|
|
273
|
+
"updated_at"
|
|
274
|
+
];
|
|
275
|
+
var STATIC_FRONT_MATTER_FIELD_SET = new Set(FRONT_MATTER_KEY_ORDER);
|
|
276
|
+
function resolveRuntimeSchemaValidationContext(options) {
|
|
277
|
+
if (!options?.schema) {
|
|
278
|
+
return void 0;
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
statusRegistry: resolveRuntimeStatusRegistry(options.schema),
|
|
282
|
+
fieldRegistry: resolveRuntimeFieldRegistry(options.schema),
|
|
283
|
+
unknownFieldPolicy: options.schema.unknown_field_policy ?? "allow",
|
|
284
|
+
extensionFieldNames: new Set(options.extensionFieldNames ?? []),
|
|
285
|
+
onWarning: options.onWarning
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function runtimeFieldRequiredForType(definition, typeName) {
|
|
289
|
+
if (!definition.required) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
if (definition.required_types.length === 0) {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
return definition.required_types.map((value) => value.toLowerCase()).includes(typeName.trim().toLowerCase());
|
|
296
|
+
}
|
|
297
|
+
function validationError(message) {
|
|
298
|
+
throw new PmCliError(`Invalid item front matter: ${message}`, EXIT_CODE.GENERIC_FAILURE);
|
|
299
|
+
}
|
|
300
|
+
function buildKnownFrontMatterKeys(runtimeContext) {
|
|
301
|
+
const knownKeys = new Set(STATIC_FRONT_MATTER_FIELD_SET);
|
|
302
|
+
for (const definition of runtimeContext.fieldRegistry?.definitions ?? []) {
|
|
303
|
+
knownKeys.add(definition.metadata_key);
|
|
304
|
+
}
|
|
305
|
+
for (const fieldName of runtimeContext.extensionFieldNames) {
|
|
306
|
+
knownKeys.add(fieldName);
|
|
307
|
+
}
|
|
308
|
+
return knownKeys;
|
|
309
|
+
}
|
|
310
|
+
function assertFrontMatterCondition(condition, message) {
|
|
311
|
+
if (!condition) {
|
|
312
|
+
validationError(message);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function assertTimestampField(record, fieldName) {
|
|
316
|
+
const rawValue = record[fieldName];
|
|
317
|
+
assertFrontMatterCondition(typeof rawValue === "string", `${fieldName} must be a string`);
|
|
318
|
+
const timestamp = rawValue;
|
|
319
|
+
assertFrontMatterCondition(isTimestampLiteral(timestamp), `${fieldName} must be a valid ISO timestamp`);
|
|
320
|
+
}
|
|
321
|
+
function assertValidRecurrenceRule(recurrence) {
|
|
322
|
+
assertFrontMatterCondition(typeof recurrence === "object" && recurrence !== null && !Array.isArray(recurrence), "event.recurrence must be an object");
|
|
323
|
+
const recurrenceRecord = recurrence;
|
|
324
|
+
assertFrontMatterCondition(typeof recurrenceRecord.freq === "string", "event.recurrence.freq must be a string");
|
|
325
|
+
const frequency = recurrenceRecord.freq.trim().toLowerCase();
|
|
326
|
+
assertFrontMatterCondition(RECURRENCE_FREQUENCY_VALUES.includes(frequency), `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(", ")}`);
|
|
327
|
+
if (recurrenceRecord.interval !== void 0) {
|
|
328
|
+
assertFrontMatterCondition(typeof recurrenceRecord.interval === "number" && Number.isInteger(recurrenceRecord.interval) && recurrenceRecord.interval >= 1, "event.recurrence.interval must be an integer >= 1");
|
|
329
|
+
}
|
|
330
|
+
if (recurrenceRecord.count !== void 0) {
|
|
331
|
+
assertFrontMatterCondition(typeof recurrenceRecord.count === "number" && Number.isInteger(recurrenceRecord.count) && recurrenceRecord.count >= 1, "event.recurrence.count must be an integer >= 1");
|
|
332
|
+
}
|
|
333
|
+
if (recurrenceRecord.until !== void 0) {
|
|
334
|
+
assertFrontMatterCondition(typeof recurrenceRecord.until === "string", "event.recurrence.until must be a string");
|
|
335
|
+
assertFrontMatterCondition(isTimestampLiteral(recurrenceRecord.until), "event.recurrence.until must be a valid ISO timestamp");
|
|
336
|
+
}
|
|
337
|
+
if (recurrenceRecord.by_weekday !== void 0) {
|
|
338
|
+
assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_weekday), "event.recurrence.by_weekday must be an array");
|
|
339
|
+
for (const weekday of recurrenceRecord.by_weekday) {
|
|
340
|
+
assertFrontMatterCondition(typeof weekday === "string", "event.recurrence.by_weekday entries must be strings");
|
|
341
|
+
const normalizedWeekday = weekday.trim().toLowerCase();
|
|
342
|
+
assertFrontMatterCondition(RECURRENCE_WEEKDAY_VALUES.includes(normalizedWeekday), `event.recurrence.by_weekday entries must be one of: ${RECURRENCE_WEEKDAY_VALUES.join(", ")}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (recurrenceRecord.by_month_day !== void 0) {
|
|
346
|
+
assertFrontMatterCondition(Array.isArray(recurrenceRecord.by_month_day), "event.recurrence.by_month_day must be an array");
|
|
347
|
+
for (const day of recurrenceRecord.by_month_day) {
|
|
348
|
+
assertFrontMatterCondition(typeof day === "number" && Number.isInteger(day) && day >= 1 && day <= 31, "event.recurrence.by_month_day entries must be integers 1..31");
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (recurrenceRecord.exdates !== void 0) {
|
|
352
|
+
assertFrontMatterCondition(Array.isArray(recurrenceRecord.exdates), "event.recurrence.exdates must be an array");
|
|
353
|
+
for (const exdate of recurrenceRecord.exdates) {
|
|
354
|
+
assertFrontMatterCondition(typeof exdate === "string", "event.recurrence.exdates entries must be strings");
|
|
355
|
+
assertFrontMatterCondition(isTimestampLiteral(exdate), "event.recurrence.exdates entries must be valid ISO timestamps");
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function assertValidFrontMatter(frontMatter, runtimeContext) {
|
|
360
|
+
assertFrontMatterCondition(typeof frontMatter === "object" && frontMatter !== null && !Array.isArray(frontMatter), "front matter must be an object");
|
|
361
|
+
const record = frontMatter;
|
|
362
|
+
for (const fieldName of REQUIRED_STRING_FIELDS) {
|
|
363
|
+
assertFrontMatterCondition(typeof record[fieldName] === "string", `${fieldName} is required and must be a string`);
|
|
364
|
+
}
|
|
365
|
+
const itemType = record.type;
|
|
366
|
+
assertFrontMatterCondition(typeof itemType === "string" && itemType.trim().length > 0, "type must be a non-empty string");
|
|
367
|
+
const status = record.status;
|
|
368
|
+
assertFrontMatterCondition(typeof status === "string" && status.trim().length > 0, "status must be a non-empty string");
|
|
369
|
+
const statusRegistry = runtimeContext?.statusRegistry;
|
|
370
|
+
const normalizedStatus = normalizeStatusInput(status, statusRegistry);
|
|
371
|
+
const statusDomain = statusRegistry ? statusRegistry.definitions.map((definition) => definition.id) : [...STATUS_VALUES];
|
|
372
|
+
assertFrontMatterCondition(normalizedStatus !== void 0, `status must be one of: ${statusDomain.join(", ")}`);
|
|
373
|
+
const priority = record.priority;
|
|
374
|
+
assertFrontMatterCondition(typeof priority === "number" && Number.isInteger(priority) && [0, 1, 2, 3, 4].includes(priority), "priority must be an integer 0..4");
|
|
375
|
+
const tags = record.tags;
|
|
376
|
+
assertFrontMatterCondition(Array.isArray(tags), "tags must be an array");
|
|
377
|
+
for (const tag of tags) {
|
|
378
|
+
assertFrontMatterCondition(typeof tag === "string", "tags entries must be strings");
|
|
379
|
+
}
|
|
380
|
+
const confidence = record.confidence;
|
|
381
|
+
if (confidence !== void 0) {
|
|
382
|
+
if (typeof confidence === "number") {
|
|
383
|
+
assertFrontMatterCondition(Number.isInteger(confidence) && confidence >= 0 && confidence <= 100, "confidence number value must be an integer 0..100");
|
|
384
|
+
} else if (typeof confidence === "string") {
|
|
385
|
+
const normalizedConfidence = confidence.trim().toLowerCase();
|
|
386
|
+
const isKnownTextConfidence = normalizedConfidence === "med" || CONFIDENCE_TEXT_VALUES.includes(normalizedConfidence);
|
|
387
|
+
assertFrontMatterCondition(isKnownTextConfidence, `confidence string value must be one of: ${[...CONFIDENCE_TEXT_VALUES, "med"].join(", ")}`);
|
|
388
|
+
} else {
|
|
389
|
+
assertFrontMatterCondition(false, "confidence must be a number or string");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const severity = record.severity;
|
|
393
|
+
if (severity !== void 0) {
|
|
394
|
+
if (typeof severity !== "string") {
|
|
395
|
+
validationError("severity must be a string");
|
|
396
|
+
}
|
|
397
|
+
const normalizedSeverity = severity.trim().toLowerCase();
|
|
398
|
+
const isKnownSeverity = normalizedSeverity === "med" || ISSUE_SEVERITY_VALUES.includes(normalizedSeverity);
|
|
399
|
+
assertFrontMatterCondition(isKnownSeverity, `severity value must be one of: ${[...ISSUE_SEVERITY_VALUES, "med"].join(", ")}`);
|
|
400
|
+
}
|
|
401
|
+
const regression = record.regression;
|
|
402
|
+
if (regression !== void 0) {
|
|
403
|
+
if (typeof regression !== "boolean") {
|
|
404
|
+
validationError("regression must be a boolean");
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
assertTimestampField(record, "created_at");
|
|
408
|
+
assertTimestampField(record, "updated_at");
|
|
409
|
+
if (record.deadline !== void 0) {
|
|
410
|
+
assertTimestampField(record, "deadline");
|
|
411
|
+
}
|
|
412
|
+
if (record.reminders !== void 0) {
|
|
413
|
+
const reminders = record.reminders;
|
|
414
|
+
assertFrontMatterCondition(Array.isArray(reminders), "reminders must be an array");
|
|
415
|
+
for (const reminder of reminders) {
|
|
416
|
+
assertFrontMatterCondition(typeof reminder === "object" && reminder !== null && !Array.isArray(reminder), "reminders entries must be objects");
|
|
417
|
+
const reminderRecord = reminder;
|
|
418
|
+
assertFrontMatterCondition(typeof reminderRecord.at === "string", "reminder.at must be a string");
|
|
419
|
+
assertFrontMatterCondition(isTimestampLiteral(reminderRecord.at), "reminder.at must be a valid ISO timestamp");
|
|
420
|
+
assertFrontMatterCondition(typeof reminderRecord.text === "string", "reminder.text must be a string");
|
|
421
|
+
assertFrontMatterCondition(reminderRecord.text.trim().length > 0, "reminder.text must not be empty");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (record.events !== void 0) {
|
|
425
|
+
const events = record.events;
|
|
426
|
+
assertFrontMatterCondition(Array.isArray(events), "events must be an array");
|
|
427
|
+
for (const event of events) {
|
|
428
|
+
assertFrontMatterCondition(typeof event === "object" && event !== null && !Array.isArray(event), "events entries must be objects");
|
|
429
|
+
const eventRecord = event;
|
|
430
|
+
assertFrontMatterCondition(typeof eventRecord.start_at === "string", "event.start_at must be a string");
|
|
431
|
+
assertFrontMatterCondition(isTimestampLiteral(eventRecord.start_at), "event.start_at must be a valid ISO timestamp");
|
|
432
|
+
if (eventRecord.end_at !== void 0) {
|
|
433
|
+
assertFrontMatterCondition(typeof eventRecord.end_at === "string", "event.end_at must be a string");
|
|
434
|
+
assertFrontMatterCondition(isTimestampLiteral(eventRecord.end_at), "event.end_at must be a valid ISO timestamp");
|
|
435
|
+
assertFrontMatterCondition(compareTimestampStrings(eventRecord.end_at, eventRecord.start_at) > 0, "event.end_at must be after event.start_at");
|
|
436
|
+
}
|
|
437
|
+
for (const stringField of ["title", "description", "location", "timezone"]) {
|
|
438
|
+
if (eventRecord[stringField] !== void 0) {
|
|
439
|
+
assertFrontMatterCondition(typeof eventRecord[stringField] === "string", `event.${stringField} must be a string`);
|
|
440
|
+
assertFrontMatterCondition(eventRecord[stringField].trim().length > 0, `event.${stringField} must not be empty`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (eventRecord.all_day !== void 0) {
|
|
444
|
+
assertFrontMatterCondition(typeof eventRecord.all_day === "boolean", "event.all_day must be a boolean");
|
|
445
|
+
}
|
|
446
|
+
if (eventRecord.recurrence !== void 0) {
|
|
447
|
+
assertValidRecurrenceRule(eventRecord.recurrence);
|
|
448
|
+
if (eventRecord.recurrence.until !== void 0) {
|
|
449
|
+
assertFrontMatterCondition(compareTimestampStrings(eventRecord.recurrence.until, eventRecord.start_at) >= 0, "event.recurrence.until must be at or after event.start_at");
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (record.closed_at !== void 0) {
|
|
455
|
+
const closedAt = record.closed_at;
|
|
456
|
+
assertFrontMatterCondition(typeof closedAt === "string", "closed_at must be a string");
|
|
457
|
+
assertFrontMatterCondition(isTimestampLiteral(closedAt), "closed_at must be a valid ISO timestamp");
|
|
458
|
+
}
|
|
459
|
+
for (const fieldName of ["source_type", "source_owner", "design", "external_ref"]) {
|
|
460
|
+
const value = record[fieldName];
|
|
461
|
+
if (value !== void 0) {
|
|
462
|
+
assertFrontMatterCondition(typeof value === "string", `${fieldName} must be a string`);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const typeOptions = record.type_options;
|
|
466
|
+
if (typeOptions !== void 0) {
|
|
467
|
+
assertFrontMatterCondition(typeof typeOptions === "object" && typeOptions !== null && !Array.isArray(typeOptions), "type_options must be an object");
|
|
468
|
+
for (const [optionKey, optionValue] of Object.entries(typeOptions)) {
|
|
469
|
+
assertFrontMatterCondition(optionKey.trim().length > 0, "type_options keys must be non-empty");
|
|
470
|
+
assertFrontMatterCondition(typeof optionValue === "string", "type_options values must be strings");
|
|
471
|
+
const optionText = optionValue;
|
|
472
|
+
assertFrontMatterCondition(optionText.trim().length > 0, "type_options values must be non-empty strings");
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (runtimeContext?.fieldRegistry) {
|
|
476
|
+
for (const definition of runtimeContext.fieldRegistry.definitions) {
|
|
477
|
+
const fieldValue = record[definition.metadata_key];
|
|
478
|
+
if (fieldValue === void 0) {
|
|
479
|
+
if (runtimeFieldRequiredForType(definition, itemType)) {
|
|
480
|
+
validationError(`missing required schema field: ${definition.metadata_key}`);
|
|
481
|
+
}
|
|
482
|
+
continue;
|
|
483
|
+
}
|
|
484
|
+
try {
|
|
485
|
+
record[definition.metadata_key] = coerceRuntimeFieldValue(definition, fieldValue, `metadata field "${definition.metadata_key}"`);
|
|
486
|
+
} catch (error) {
|
|
487
|
+
validationError(error instanceof Error ? error.message.replace(/^Invalid\s+/u, "") : `invalid ${definition.metadata_key} value`);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (runtimeContext && runtimeContext.unknownFieldPolicy !== "allow") {
|
|
492
|
+
const knownKeys = buildKnownFrontMatterKeys(runtimeContext);
|
|
493
|
+
const unknownKeys = Object.keys(record).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));
|
|
494
|
+
if (unknownKeys.length > 0) {
|
|
495
|
+
if (runtimeContext.unknownFieldPolicy === "reject") {
|
|
496
|
+
validationError(`unknown schema fields are not allowed: ${unknownKeys.join(", ")}`);
|
|
497
|
+
} else {
|
|
498
|
+
runtimeContext.onWarning?.(`item_unknown_schema_fields:${unknownKeys.join(",")}`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function sortDependencies(values) {
|
|
504
|
+
if (!values || values.length === 0)
|
|
505
|
+
return void 0;
|
|
506
|
+
return [...values].map((value) => ({
|
|
507
|
+
id: value.id.trim().toLowerCase(),
|
|
508
|
+
kind: value.kind,
|
|
509
|
+
created_at: value.created_at,
|
|
510
|
+
author: value.author?.trim() || void 0,
|
|
511
|
+
source_kind: value.source_kind?.trim() || void 0
|
|
512
|
+
})).sort((a, b) => {
|
|
513
|
+
const byCreated = compareTimestampStrings(a.created_at, b.created_at);
|
|
514
|
+
if (byCreated !== 0)
|
|
515
|
+
return byCreated;
|
|
516
|
+
const byId = a.id.localeCompare(b.id);
|
|
517
|
+
if (byId !== 0)
|
|
518
|
+
return byId;
|
|
519
|
+
const byKind = a.kind.localeCompare(b.kind);
|
|
520
|
+
if (byKind !== 0)
|
|
521
|
+
return byKind;
|
|
522
|
+
return (a.source_kind ?? "").localeCompare(b.source_kind ?? "");
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
function sortLogValues(values) {
|
|
526
|
+
if (!values || values.length === 0)
|
|
527
|
+
return void 0;
|
|
528
|
+
return [...values].sort((a, b) => {
|
|
529
|
+
const byCreated = compareTimestampStrings(a.created_at, b.created_at);
|
|
530
|
+
if (byCreated !== 0)
|
|
531
|
+
return byCreated;
|
|
532
|
+
const byText = a.text.localeCompare(b.text);
|
|
533
|
+
if (byText !== 0)
|
|
534
|
+
return byText;
|
|
535
|
+
return a.author.localeCompare(b.author);
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function sortReminders(values) {
|
|
539
|
+
if (!values || values.length === 0)
|
|
540
|
+
return void 0;
|
|
541
|
+
const normalized = [...values].map((value) => ({
|
|
542
|
+
at: value.at,
|
|
543
|
+
text: value.text.trim()
|
|
544
|
+
})).filter((value) => value.text.length > 0).sort((a, b) => {
|
|
545
|
+
const byAt = compareTimestampStrings(a.at, b.at);
|
|
546
|
+
if (byAt !== 0)
|
|
547
|
+
return byAt;
|
|
548
|
+
return a.text.localeCompare(b.text);
|
|
549
|
+
});
|
|
550
|
+
return normalized.length === 0 ? void 0 : normalized;
|
|
551
|
+
}
|
|
552
|
+
function normalizeRecurrenceRule(value) {
|
|
553
|
+
if (!value) {
|
|
554
|
+
return void 0;
|
|
555
|
+
}
|
|
556
|
+
const normalizedFrequency = value.freq.trim().toLowerCase();
|
|
557
|
+
if (!RECURRENCE_FREQUENCY_VALUES.includes(normalizedFrequency)) {
|
|
558
|
+
return void 0;
|
|
559
|
+
}
|
|
560
|
+
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));
|
|
561
|
+
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);
|
|
562
|
+
const exdates = Array.from(new Set((value.exdates ?? []).map((timestamp) => timestamp.trim()).filter((timestamp) => isTimestampLiteral(timestamp)))).sort((a, b) => compareTimestampStrings(a, b));
|
|
563
|
+
const normalized = {
|
|
564
|
+
freq: normalizedFrequency,
|
|
565
|
+
interval: value.interval !== void 0 && value.interval > 1 ? value.interval : void 0,
|
|
566
|
+
count: value.count,
|
|
567
|
+
until: value.until?.trim() || void 0,
|
|
568
|
+
by_weekday: byWeekday.length > 0 ? byWeekday : void 0,
|
|
569
|
+
by_month_day: byMonthDay.length > 0 ? byMonthDay : void 0,
|
|
570
|
+
exdates: exdates.length > 0 ? exdates : void 0
|
|
571
|
+
};
|
|
572
|
+
for (const [key, fieldValue] of Object.entries(normalized)) {
|
|
573
|
+
if (fieldValue === void 0) {
|
|
574
|
+
delete normalized[key];
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return normalized;
|
|
578
|
+
}
|
|
579
|
+
function sortEvents(values) {
|
|
580
|
+
if (!values || values.length === 0) {
|
|
581
|
+
return void 0;
|
|
582
|
+
}
|
|
583
|
+
const normalized = [...values].map((value) => {
|
|
584
|
+
const event = {
|
|
585
|
+
start_at: value.start_at,
|
|
586
|
+
end_at: value.end_at || void 0,
|
|
587
|
+
title: value.title?.trim() || void 0,
|
|
588
|
+
description: value.description?.trim() || void 0,
|
|
589
|
+
location: value.location?.trim() || void 0,
|
|
590
|
+
all_day: value.all_day,
|
|
591
|
+
timezone: value.timezone?.trim() || void 0,
|
|
592
|
+
recurrence: normalizeRecurrenceRule(value.recurrence)
|
|
593
|
+
};
|
|
594
|
+
for (const [key, fieldValue] of Object.entries(event)) {
|
|
595
|
+
if (fieldValue === void 0) {
|
|
596
|
+
delete event[key];
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return event;
|
|
600
|
+
}).sort((a, b) => {
|
|
601
|
+
const byStart = compareTimestampStrings(a.start_at, b.start_at);
|
|
602
|
+
if (byStart !== 0)
|
|
603
|
+
return byStart;
|
|
604
|
+
const byEnd = (a.end_at ?? "").localeCompare(b.end_at ?? "");
|
|
605
|
+
if (byEnd !== 0)
|
|
606
|
+
return byEnd;
|
|
607
|
+
const byTitle = (a.title ?? "").localeCompare(b.title ?? "");
|
|
608
|
+
if (byTitle !== 0)
|
|
609
|
+
return byTitle;
|
|
610
|
+
const byAllDay = Number(Boolean(a.all_day)) - Number(Boolean(b.all_day));
|
|
611
|
+
if (byAllDay !== 0)
|
|
612
|
+
return byAllDay;
|
|
613
|
+
const byTimezone = (a.timezone ?? "").localeCompare(b.timezone ?? "");
|
|
614
|
+
if (byTimezone !== 0)
|
|
615
|
+
return byTimezone;
|
|
616
|
+
const byLocation = (a.location ?? "").localeCompare(b.location ?? "");
|
|
617
|
+
if (byLocation !== 0)
|
|
618
|
+
return byLocation;
|
|
619
|
+
const byDescription = (a.description ?? "").localeCompare(b.description ?? "");
|
|
620
|
+
if (byDescription !== 0)
|
|
621
|
+
return byDescription;
|
|
622
|
+
return JSON.stringify(a.recurrence ?? {}).localeCompare(JSON.stringify(b.recurrence ?? {}));
|
|
623
|
+
});
|
|
624
|
+
return normalized;
|
|
625
|
+
}
|
|
626
|
+
function normalizeFiles(values) {
|
|
627
|
+
if (!values || values.length === 0)
|
|
628
|
+
return void 0;
|
|
629
|
+
return values.map((value) => ({
|
|
630
|
+
path: normalizePathValue(value.path),
|
|
631
|
+
scope: value.scope,
|
|
632
|
+
note: value.note?.trim() || void 0
|
|
633
|
+
}));
|
|
634
|
+
}
|
|
635
|
+
function normalizeTestRunSummaries(values) {
|
|
636
|
+
if (!values || values.length === 0)
|
|
637
|
+
return void 0;
|
|
638
|
+
const normalized = values.map((value) => {
|
|
639
|
+
const runId = typeof value.run_id === "string" ? value.run_id.trim() : "";
|
|
640
|
+
const kind = value.kind === "test" || value.kind === "test-all" ? value.kind : "test";
|
|
641
|
+
const status = value.status === "passed" || value.status === "failed" || value.status === "stopped" || value.status === "canceled" ? value.status : "failed";
|
|
642
|
+
const startedAt = typeof value.started_at === "string" ? value.started_at : "";
|
|
643
|
+
const finishedAt = typeof value.finished_at === "string" ? value.finished_at : "";
|
|
644
|
+
const recordedAt = typeof value.recorded_at === "string" ? value.recorded_at : "";
|
|
645
|
+
const passed = typeof value.passed === "number" && Number.isFinite(value.passed) ? Math.max(0, Math.floor(value.passed)) : 0;
|
|
646
|
+
const failed = typeof value.failed === "number" && Number.isFinite(value.failed) ? Math.max(0, Math.floor(value.failed)) : 0;
|
|
647
|
+
const skipped = typeof value.skipped === "number" && Number.isFinite(value.skipped) ? Math.max(0, Math.floor(value.skipped)) : 0;
|
|
648
|
+
return {
|
|
649
|
+
run_id: runId,
|
|
650
|
+
kind,
|
|
651
|
+
status,
|
|
652
|
+
started_at: startedAt,
|
|
653
|
+
finished_at: finishedAt,
|
|
654
|
+
recorded_at: recordedAt,
|
|
655
|
+
attempt: typeof value.attempt === "number" && Number.isFinite(value.attempt) && value.attempt >= 1 ? Math.floor(value.attempt) : void 0,
|
|
656
|
+
resumed_from: value.resumed_from?.trim() || void 0,
|
|
657
|
+
passed,
|
|
658
|
+
failed,
|
|
659
|
+
skipped,
|
|
660
|
+
items: typeof value.items === "number" && Number.isFinite(value.items) && value.items >= 0 ? Math.floor(value.items) : void 0,
|
|
661
|
+
linked_tests: typeof value.linked_tests === "number" && Number.isFinite(value.linked_tests) && value.linked_tests >= 0 ? Math.floor(value.linked_tests) : void 0,
|
|
662
|
+
fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : void 0
|
|
663
|
+
};
|
|
664
|
+
}).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) => {
|
|
665
|
+
const byRecorded = compareTimestampStrings(a.recorded_at, b.recorded_at);
|
|
666
|
+
if (byRecorded !== 0)
|
|
667
|
+
return byRecorded;
|
|
668
|
+
const byRunId = a.run_id.localeCompare(b.run_id);
|
|
669
|
+
if (byRunId !== 0)
|
|
670
|
+
return byRunId;
|
|
671
|
+
return a.kind.localeCompare(b.kind);
|
|
672
|
+
});
|
|
673
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
674
|
+
}
|
|
675
|
+
function sortTests(values) {
|
|
676
|
+
if (!values || values.length === 0)
|
|
677
|
+
return void 0;
|
|
678
|
+
return [...values].map((value) => ({
|
|
679
|
+
command: value.command?.trim() || void 0,
|
|
680
|
+
path: value.path ? normalizePathValue(value.path) : void 0,
|
|
681
|
+
scope: value.scope,
|
|
682
|
+
timeout_seconds: typeof value.timeout_seconds === "number" && Number.isFinite(value.timeout_seconds) && value.timeout_seconds > 0 ? value.timeout_seconds : void 0,
|
|
683
|
+
pm_context_mode: (() => {
|
|
684
|
+
const normalized = value.pm_context_mode?.trim().toLowerCase();
|
|
685
|
+
if (!normalized || !LINKED_TEST_PM_CONTEXT_MODE_VALUES.has(normalized)) {
|
|
686
|
+
return void 0;
|
|
687
|
+
}
|
|
688
|
+
return normalized;
|
|
689
|
+
})(),
|
|
690
|
+
env_set: value.env_set ? Object.fromEntries(Object.entries(value.env_set).map(([key, envValue]) => [key.trim(), String(envValue).trim()]).filter(([key, envValue]) => key.length > 0 && envValue.length > 0).sort(([left], [right]) => left.localeCompare(right))) : void 0,
|
|
691
|
+
env_clear: value.env_clear ? [...new Set(value.env_clear.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
692
|
+
shared_host_safe: value.shared_host_safe === true ? true : void 0,
|
|
693
|
+
assert_stdout_contains: value.assert_stdout_contains ? [...new Set(value.assert_stdout_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
694
|
+
assert_stdout_regex: value.assert_stdout_regex ? [...new Set(value.assert_stdout_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
695
|
+
assert_stderr_contains: value.assert_stderr_contains ? [...new Set(value.assert_stderr_contains.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
696
|
+
assert_stderr_regex: value.assert_stderr_regex ? [...new Set(value.assert_stderr_regex.map((entry) => entry.trim()).filter((entry) => entry.length > 0))].sort((a, b) => a.localeCompare(b)) : void 0,
|
|
697
|
+
assert_stdout_min_lines: typeof value.assert_stdout_min_lines === "number" && Number.isFinite(value.assert_stdout_min_lines) && value.assert_stdout_min_lines >= 0 ? Math.floor(value.assert_stdout_min_lines) : void 0,
|
|
698
|
+
assert_json_field_equals: value.assert_json_field_equals ? Object.fromEntries(Object.entries(value.assert_json_field_equals).map(([key, expectedValue]) => [key.trim(), String(expectedValue).trim()]).filter(([key, expectedValue]) => key.length > 0 && expectedValue.length > 0).sort(([left], [right]) => left.localeCompare(right))) : void 0,
|
|
699
|
+
assert_json_field_gte: value.assert_json_field_gte ? Object.fromEntries(Object.entries(value.assert_json_field_gte).map(([key, expectedValue]) => [key.trim(), Number(expectedValue)]).filter(([key, expectedValue]) => key.length > 0 && Number.isFinite(expectedValue)).sort(([left], [right]) => left.localeCompare(right))) : void 0,
|
|
700
|
+
note: value.note?.trim() || void 0
|
|
701
|
+
})).sort((a, b) => {
|
|
702
|
+
const byScope = a.scope.localeCompare(b.scope);
|
|
703
|
+
if (byScope !== 0)
|
|
704
|
+
return byScope;
|
|
705
|
+
const byPath = (a.path ?? "").localeCompare(b.path ?? "");
|
|
706
|
+
if (byPath !== 0)
|
|
707
|
+
return byPath;
|
|
708
|
+
const byCommand = (a.command ?? "").localeCompare(b.command ?? "");
|
|
709
|
+
if (byCommand !== 0)
|
|
710
|
+
return byCommand;
|
|
711
|
+
const byTimeout = (a.timeout_seconds ?? 0) - (b.timeout_seconds ?? 0);
|
|
712
|
+
if (byTimeout !== 0)
|
|
713
|
+
return byTimeout;
|
|
714
|
+
const byPmContext = (a.pm_context_mode ?? "").localeCompare(b.pm_context_mode ?? "");
|
|
715
|
+
if (byPmContext !== 0)
|
|
716
|
+
return byPmContext;
|
|
717
|
+
const bySharedHostSafe = Number(Boolean(a.shared_host_safe)) - Number(Boolean(b.shared_host_safe));
|
|
718
|
+
if (bySharedHostSafe !== 0)
|
|
719
|
+
return bySharedHostSafe;
|
|
720
|
+
const byEnvClear = JSON.stringify(a.env_clear ?? []).localeCompare(JSON.stringify(b.env_clear ?? []));
|
|
721
|
+
if (byEnvClear !== 0)
|
|
722
|
+
return byEnvClear;
|
|
723
|
+
const byEnvSet = JSON.stringify(a.env_set ?? {}).localeCompare(JSON.stringify(b.env_set ?? {}));
|
|
724
|
+
if (byEnvSet !== 0)
|
|
725
|
+
return byEnvSet;
|
|
726
|
+
const byStdoutContains = JSON.stringify(a.assert_stdout_contains ?? []).localeCompare(JSON.stringify(b.assert_stdout_contains ?? []));
|
|
727
|
+
if (byStdoutContains !== 0)
|
|
728
|
+
return byStdoutContains;
|
|
729
|
+
const byStdoutRegex = JSON.stringify(a.assert_stdout_regex ?? []).localeCompare(JSON.stringify(b.assert_stdout_regex ?? []));
|
|
730
|
+
if (byStdoutRegex !== 0)
|
|
731
|
+
return byStdoutRegex;
|
|
732
|
+
const byStderrContains = JSON.stringify(a.assert_stderr_contains ?? []).localeCompare(JSON.stringify(b.assert_stderr_contains ?? []));
|
|
733
|
+
if (byStderrContains !== 0)
|
|
734
|
+
return byStderrContains;
|
|
735
|
+
const byStderrRegex = JSON.stringify(a.assert_stderr_regex ?? []).localeCompare(JSON.stringify(b.assert_stderr_regex ?? []));
|
|
736
|
+
if (byStderrRegex !== 0)
|
|
737
|
+
return byStderrRegex;
|
|
738
|
+
const byStdoutMinLines = (a.assert_stdout_min_lines ?? 0) - (b.assert_stdout_min_lines ?? 0);
|
|
739
|
+
if (byStdoutMinLines !== 0)
|
|
740
|
+
return byStdoutMinLines;
|
|
741
|
+
const byJsonFieldEquals = JSON.stringify(a.assert_json_field_equals ?? {}).localeCompare(JSON.stringify(b.assert_json_field_equals ?? {}));
|
|
742
|
+
if (byJsonFieldEquals !== 0)
|
|
743
|
+
return byJsonFieldEquals;
|
|
744
|
+
const byJsonFieldGte = JSON.stringify(a.assert_json_field_gte ?? {}).localeCompare(JSON.stringify(b.assert_json_field_gte ?? {}));
|
|
745
|
+
if (byJsonFieldGte !== 0)
|
|
746
|
+
return byJsonFieldGte;
|
|
747
|
+
return (a.note ?? "").localeCompare(b.note ?? "");
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
function sortDocs(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
|
+
})).sort((a, b) => {
|
|
758
|
+
const byScope = a.scope.localeCompare(b.scope);
|
|
759
|
+
if (byScope !== 0)
|
|
760
|
+
return byScope;
|
|
761
|
+
const byPath = a.path.localeCompare(b.path);
|
|
762
|
+
if (byPath !== 0)
|
|
763
|
+
return byPath;
|
|
764
|
+
return (a.note ?? "").localeCompare(b.note ?? "");
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
function trimStringOrUndefined(value) {
|
|
768
|
+
if (typeof value !== "string")
|
|
769
|
+
return void 0;
|
|
770
|
+
const trimmed = value.trim();
|
|
771
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
772
|
+
}
|
|
773
|
+
function normalizePlanStepLinks(value) {
|
|
774
|
+
if (!Array.isArray(value))
|
|
775
|
+
return void 0;
|
|
776
|
+
const out = [];
|
|
777
|
+
for (const entry of value) {
|
|
778
|
+
if (entry === null || typeof entry !== "object")
|
|
779
|
+
continue;
|
|
780
|
+
const record = entry;
|
|
781
|
+
const id = trimStringOrUndefined(record.id);
|
|
782
|
+
const kind = trimStringOrUndefined(record.kind);
|
|
783
|
+
if (!id || !kind)
|
|
784
|
+
continue;
|
|
785
|
+
const link = { id, kind };
|
|
786
|
+
const note = trimStringOrUndefined(record.note);
|
|
787
|
+
if (note)
|
|
788
|
+
link.note = note;
|
|
789
|
+
if (record.required_before_step === true)
|
|
790
|
+
link.required_before_step = true;
|
|
791
|
+
out.push(link);
|
|
792
|
+
}
|
|
793
|
+
return out.length > 0 ? out : void 0;
|
|
794
|
+
}
|
|
795
|
+
function normalizePlanStepFiles(value) {
|
|
796
|
+
if (!Array.isArray(value))
|
|
797
|
+
return void 0;
|
|
798
|
+
const out = [];
|
|
799
|
+
for (const entry of value) {
|
|
800
|
+
if (entry === null || typeof entry !== "object")
|
|
801
|
+
continue;
|
|
802
|
+
const record = entry;
|
|
803
|
+
const path = trimStringOrUndefined(record.path);
|
|
804
|
+
if (!path)
|
|
805
|
+
continue;
|
|
806
|
+
const file = { path: normalizePathValue(path) };
|
|
807
|
+
if (record.scope === "project" || record.scope === "global")
|
|
808
|
+
file.scope = record.scope;
|
|
809
|
+
const note = trimStringOrUndefined(record.note);
|
|
810
|
+
if (note)
|
|
811
|
+
file.note = note;
|
|
812
|
+
out.push(file);
|
|
813
|
+
}
|
|
814
|
+
return out.length > 0 ? out : void 0;
|
|
815
|
+
}
|
|
816
|
+
function normalizePlanStepTests(value) {
|
|
817
|
+
if (!Array.isArray(value))
|
|
818
|
+
return void 0;
|
|
819
|
+
const out = [];
|
|
820
|
+
for (const entry of value) {
|
|
821
|
+
if (entry === null || typeof entry !== "object")
|
|
822
|
+
continue;
|
|
823
|
+
const record = entry;
|
|
824
|
+
const command = trimStringOrUndefined(record.command);
|
|
825
|
+
const path = trimStringOrUndefined(record.path);
|
|
826
|
+
if (!command && !path)
|
|
827
|
+
continue;
|
|
828
|
+
const test = {};
|
|
829
|
+
if (command)
|
|
830
|
+
test.command = command;
|
|
831
|
+
if (path)
|
|
832
|
+
test.path = normalizePathValue(path);
|
|
833
|
+
const note = trimStringOrUndefined(record.note);
|
|
834
|
+
if (note)
|
|
835
|
+
test.note = note;
|
|
836
|
+
out.push(test);
|
|
837
|
+
}
|
|
838
|
+
return out.length > 0 ? out : void 0;
|
|
839
|
+
}
|
|
840
|
+
function normalizePlanStepDocs(value) {
|
|
841
|
+
if (!Array.isArray(value))
|
|
842
|
+
return void 0;
|
|
843
|
+
const out = [];
|
|
844
|
+
for (const entry of value) {
|
|
845
|
+
if (entry === null || typeof entry !== "object")
|
|
846
|
+
continue;
|
|
847
|
+
const record = entry;
|
|
848
|
+
const path = trimStringOrUndefined(record.path);
|
|
849
|
+
if (!path)
|
|
850
|
+
continue;
|
|
851
|
+
const doc = { path: normalizePathValue(path) };
|
|
852
|
+
if (record.scope === "project" || record.scope === "global")
|
|
853
|
+
doc.scope = record.scope;
|
|
854
|
+
const note = trimStringOrUndefined(record.note);
|
|
855
|
+
if (note)
|
|
856
|
+
doc.note = note;
|
|
857
|
+
out.push(doc);
|
|
858
|
+
}
|
|
859
|
+
return out.length > 0 ? out : void 0;
|
|
860
|
+
}
|
|
861
|
+
function normalizePlanSteps(value) {
|
|
862
|
+
if (!Array.isArray(value))
|
|
863
|
+
return void 0;
|
|
864
|
+
const out = [];
|
|
865
|
+
for (const entry of value) {
|
|
866
|
+
if (entry === null || typeof entry !== "object")
|
|
867
|
+
continue;
|
|
868
|
+
const record = entry;
|
|
869
|
+
const id = trimStringOrUndefined(record.id);
|
|
870
|
+
const title = trimStringOrUndefined(record.title);
|
|
871
|
+
const status = trimStringOrUndefined(record.status);
|
|
872
|
+
const orderRaw = record.order;
|
|
873
|
+
const order = typeof orderRaw === "number" && Number.isFinite(orderRaw) ? orderRaw : Number(orderRaw);
|
|
874
|
+
if (!id || !title || !status || !Number.isFinite(order))
|
|
875
|
+
continue;
|
|
876
|
+
const created_at = typeof record.created_at === "string" ? record.created_at : "";
|
|
877
|
+
const updated_at = typeof record.updated_at === "string" ? record.updated_at : "";
|
|
878
|
+
if (!created_at || !updated_at)
|
|
879
|
+
continue;
|
|
880
|
+
const step = {
|
|
881
|
+
id,
|
|
882
|
+
order,
|
|
883
|
+
title,
|
|
884
|
+
status,
|
|
885
|
+
created_at,
|
|
886
|
+
updated_at
|
|
887
|
+
};
|
|
888
|
+
const body = trimStringOrUndefined(record.body);
|
|
889
|
+
if (body)
|
|
890
|
+
step.body = body;
|
|
891
|
+
const owner = trimStringOrUndefined(record.owner);
|
|
892
|
+
if (owner)
|
|
893
|
+
step.owner = owner;
|
|
894
|
+
const evidence = trimStringOrUndefined(record.evidence);
|
|
895
|
+
if (evidence)
|
|
896
|
+
step.evidence = evidence;
|
|
897
|
+
const blockedReason = trimStringOrUndefined(record.blocked_reason);
|
|
898
|
+
if (blockedReason)
|
|
899
|
+
step.blocked_reason = blockedReason;
|
|
900
|
+
const supersededBy = trimStringOrUndefined(record.superseded_by);
|
|
901
|
+
if (supersededBy)
|
|
902
|
+
step.superseded_by = supersededBy;
|
|
903
|
+
const completedAt = typeof record.completed_at === "string" ? record.completed_at : void 0;
|
|
904
|
+
if (completedAt && completedAt.length > 0)
|
|
905
|
+
step.completed_at = completedAt;
|
|
906
|
+
const links = normalizePlanStepLinks(record.linked_items);
|
|
907
|
+
if (links)
|
|
908
|
+
step.linked_items = links;
|
|
909
|
+
const files = normalizePlanStepFiles(record.files);
|
|
910
|
+
if (files)
|
|
911
|
+
step.files = files;
|
|
912
|
+
const tests = normalizePlanStepTests(record.tests);
|
|
913
|
+
if (tests)
|
|
914
|
+
step.tests = tests;
|
|
915
|
+
const docs = normalizePlanStepDocs(record.docs);
|
|
916
|
+
if (docs)
|
|
917
|
+
step.docs = docs;
|
|
918
|
+
out.push(step);
|
|
919
|
+
}
|
|
920
|
+
out.sort((left, right) => left.order - right.order);
|
|
921
|
+
return out.length > 0 ? out : void 0;
|
|
922
|
+
}
|
|
923
|
+
function normalizePlanDecisions(value) {
|
|
924
|
+
if (!Array.isArray(value))
|
|
925
|
+
return void 0;
|
|
926
|
+
const out = [];
|
|
927
|
+
for (const entry of value) {
|
|
928
|
+
if (entry === null || typeof entry !== "object")
|
|
929
|
+
continue;
|
|
930
|
+
const record = entry;
|
|
931
|
+
const ts = typeof record.ts === "string" ? record.ts : "";
|
|
932
|
+
const author = typeof record.author === "string" ? record.author : "";
|
|
933
|
+
const decision = trimStringOrUndefined(record.decision);
|
|
934
|
+
if (!ts || !author || !decision)
|
|
935
|
+
continue;
|
|
936
|
+
const item = { ts, author, decision };
|
|
937
|
+
const rationale = trimStringOrUndefined(record.rationale);
|
|
938
|
+
if (rationale)
|
|
939
|
+
item.rationale = rationale;
|
|
940
|
+
const evidence = trimStringOrUndefined(record.evidence);
|
|
941
|
+
if (evidence)
|
|
942
|
+
item.evidence = evidence;
|
|
943
|
+
const stepId = trimStringOrUndefined(record.step_id);
|
|
944
|
+
if (stepId)
|
|
945
|
+
item.step_id = stepId;
|
|
946
|
+
out.push(item);
|
|
947
|
+
}
|
|
948
|
+
return out.length > 0 ? out : void 0;
|
|
949
|
+
}
|
|
950
|
+
function normalizePlanDiscoveries(value) {
|
|
951
|
+
if (!Array.isArray(value))
|
|
952
|
+
return void 0;
|
|
953
|
+
const out = [];
|
|
954
|
+
for (const entry of value) {
|
|
955
|
+
if (entry === null || typeof entry !== "object")
|
|
956
|
+
continue;
|
|
957
|
+
const record = entry;
|
|
958
|
+
const ts = typeof record.ts === "string" ? record.ts : "";
|
|
959
|
+
const author = typeof record.author === "string" ? record.author : "";
|
|
960
|
+
const text = trimStringOrUndefined(record.text);
|
|
961
|
+
if (!ts || !author || !text)
|
|
962
|
+
continue;
|
|
963
|
+
const item = { ts, author, text };
|
|
964
|
+
const stepId = trimStringOrUndefined(record.step_id);
|
|
965
|
+
if (stepId)
|
|
966
|
+
item.step_id = stepId;
|
|
967
|
+
out.push(item);
|
|
968
|
+
}
|
|
969
|
+
return out.length > 0 ? out : void 0;
|
|
970
|
+
}
|
|
971
|
+
function normalizePlanValidation(value) {
|
|
972
|
+
if (!Array.isArray(value))
|
|
973
|
+
return void 0;
|
|
974
|
+
const out = [];
|
|
975
|
+
for (const entry of value) {
|
|
976
|
+
if (entry === null || typeof entry !== "object")
|
|
977
|
+
continue;
|
|
978
|
+
const record = entry;
|
|
979
|
+
const text = trimStringOrUndefined(record.text);
|
|
980
|
+
if (!text)
|
|
981
|
+
continue;
|
|
982
|
+
const item = { text };
|
|
983
|
+
const command = trimStringOrUndefined(record.command);
|
|
984
|
+
if (command)
|
|
985
|
+
item.command = command;
|
|
986
|
+
const expected = trimStringOrUndefined(record.expected);
|
|
987
|
+
if (expected)
|
|
988
|
+
item.expected = expected;
|
|
989
|
+
out.push(item);
|
|
990
|
+
}
|
|
991
|
+
return out.length > 0 ? out : void 0;
|
|
992
|
+
}
|
|
993
|
+
function normalizeTypeOptions(values) {
|
|
994
|
+
if (!values) {
|
|
995
|
+
return void 0;
|
|
996
|
+
}
|
|
997
|
+
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]));
|
|
998
|
+
if (normalizedEntries.length === 0) {
|
|
999
|
+
return void 0;
|
|
1000
|
+
}
|
|
1001
|
+
return Object.fromEntries(normalizedEntries);
|
|
1002
|
+
}
|
|
1003
|
+
function normalizeBody(body) {
|
|
1004
|
+
return body.replace(/^\n+/, "").replace(/\s+$/, "");
|
|
1005
|
+
}
|
|
1006
|
+
function normalizeConfidenceValue(value) {
|
|
1007
|
+
if (value === void 0) {
|
|
1008
|
+
return void 0;
|
|
1009
|
+
}
|
|
1010
|
+
if (typeof value === "number") {
|
|
1011
|
+
return value;
|
|
1012
|
+
}
|
|
1013
|
+
const normalized = value.trim().toLowerCase();
|
|
1014
|
+
if (normalized === "med") {
|
|
1015
|
+
return "medium";
|
|
1016
|
+
}
|
|
1017
|
+
if (CONFIDENCE_TEXT_VALUES.includes(normalized)) {
|
|
1018
|
+
return normalized;
|
|
1019
|
+
}
|
|
1020
|
+
return void 0;
|
|
1021
|
+
}
|
|
1022
|
+
function normalizeSeverityValue(value) {
|
|
1023
|
+
if (value === void 0) {
|
|
1024
|
+
return void 0;
|
|
1025
|
+
}
|
|
1026
|
+
const normalized = value.trim().toLowerCase();
|
|
1027
|
+
if (normalized === "med") {
|
|
1028
|
+
return "medium";
|
|
1029
|
+
}
|
|
1030
|
+
if (ISSUE_SEVERITY_VALUES.includes(normalized)) {
|
|
1031
|
+
return normalized;
|
|
1032
|
+
}
|
|
1033
|
+
return void 0;
|
|
1034
|
+
}
|
|
1035
|
+
function normalizeFrontMatter(frontMatter, options = {}) {
|
|
1036
|
+
const runtimeContext = resolveRuntimeSchemaValidationContext(options);
|
|
1037
|
+
const normalizedStatus = normalizeStatusInput(frontMatter.status, runtimeContext?.statusRegistry) ?? frontMatter.status;
|
|
1038
|
+
const tags = Array.from(new Set(frontMatter.tags.map((tag) => tag.trim().toLowerCase()).filter(Boolean))).sort((a, b) => a.localeCompare(b));
|
|
1039
|
+
const normalized = {
|
|
1040
|
+
id: frontMatter.id,
|
|
1041
|
+
title: frontMatter.title,
|
|
1042
|
+
description: frontMatter.description,
|
|
1043
|
+
type: frontMatter.type,
|
|
1044
|
+
source_type: frontMatter.source_type?.trim() || void 0,
|
|
1045
|
+
type_options: normalizeTypeOptions(frontMatter.type_options),
|
|
1046
|
+
status: normalizedStatus,
|
|
1047
|
+
priority: frontMatter.priority,
|
|
1048
|
+
tags,
|
|
1049
|
+
created_at: frontMatter.created_at,
|
|
1050
|
+
updated_at: frontMatter.updated_at,
|
|
1051
|
+
dependencies: sortDependencies(frontMatter.dependencies),
|
|
1052
|
+
comments: sortLogValues(frontMatter.comments),
|
|
1053
|
+
notes: sortLogValues(frontMatter.notes),
|
|
1054
|
+
learnings: sortLogValues(frontMatter.learnings),
|
|
1055
|
+
files: normalizeFiles(frontMatter.files),
|
|
1056
|
+
tests: sortTests(frontMatter.tests),
|
|
1057
|
+
test_runs: normalizeTestRunSummaries(frontMatter.test_runs),
|
|
1058
|
+
docs: sortDocs(frontMatter.docs),
|
|
1059
|
+
deadline: frontMatter.deadline || void 0,
|
|
1060
|
+
reminders: sortReminders(frontMatter.reminders),
|
|
1061
|
+
events: sortEvents(frontMatter.events),
|
|
1062
|
+
closed_at: frontMatter.closed_at || void 0,
|
|
1063
|
+
assignee: frontMatter.assignee?.trim() || void 0,
|
|
1064
|
+
source_owner: frontMatter.source_owner?.trim() || void 0,
|
|
1065
|
+
author: frontMatter.author || void 0,
|
|
1066
|
+
estimated_minutes: frontMatter.estimated_minutes,
|
|
1067
|
+
acceptance_criteria: frontMatter.acceptance_criteria ?? void 0,
|
|
1068
|
+
design: frontMatter.design ?? void 0,
|
|
1069
|
+
external_ref: frontMatter.external_ref ?? void 0,
|
|
1070
|
+
definition_of_ready: frontMatter.definition_of_ready?.trim() || void 0,
|
|
1071
|
+
order: frontMatter.order,
|
|
1072
|
+
goal: frontMatter.goal?.trim() || void 0,
|
|
1073
|
+
objective: frontMatter.objective?.trim() || void 0,
|
|
1074
|
+
value: frontMatter.value?.trim() || void 0,
|
|
1075
|
+
impact: frontMatter.impact?.trim() || void 0,
|
|
1076
|
+
outcome: frontMatter.outcome?.trim() || void 0,
|
|
1077
|
+
why_now: frontMatter.why_now?.trim() || void 0,
|
|
1078
|
+
parent: frontMatter.parent?.trim() || void 0,
|
|
1079
|
+
reviewer: frontMatter.reviewer?.trim() || void 0,
|
|
1080
|
+
risk: frontMatter.risk ?? void 0,
|
|
1081
|
+
confidence: normalizeConfidenceValue(frontMatter.confidence),
|
|
1082
|
+
sprint: frontMatter.sprint?.trim() || void 0,
|
|
1083
|
+
release: frontMatter.release?.trim() || void 0,
|
|
1084
|
+
blocked_by: frontMatter.blocked_by?.trim() || void 0,
|
|
1085
|
+
blocked_reason: frontMatter.blocked_reason?.trim() || void 0,
|
|
1086
|
+
unblock_note: frontMatter.unblock_note?.trim() || void 0,
|
|
1087
|
+
reporter: frontMatter.reporter?.trim() || void 0,
|
|
1088
|
+
severity: normalizeSeverityValue(frontMatter.severity),
|
|
1089
|
+
environment: frontMatter.environment?.trim() || void 0,
|
|
1090
|
+
repro_steps: frontMatter.repro_steps?.trim() || void 0,
|
|
1091
|
+
resolution: frontMatter.resolution?.trim() || void 0,
|
|
1092
|
+
expected_result: frontMatter.expected_result?.trim() || void 0,
|
|
1093
|
+
actual_result: frontMatter.actual_result?.trim() || void 0,
|
|
1094
|
+
affected_version: frontMatter.affected_version?.trim() || void 0,
|
|
1095
|
+
fixed_version: frontMatter.fixed_version?.trim() || void 0,
|
|
1096
|
+
component: frontMatter.component?.trim() || void 0,
|
|
1097
|
+
regression: frontMatter.regression,
|
|
1098
|
+
customer_impact: frontMatter.customer_impact?.trim() || void 0,
|
|
1099
|
+
close_reason: frontMatter.close_reason || void 0,
|
|
1100
|
+
plan_mode: trimStringOrUndefined(frontMatter.plan_mode),
|
|
1101
|
+
plan_scope: trimStringOrUndefined(frontMatter.plan_scope),
|
|
1102
|
+
plan_harness: trimStringOrUndefined(frontMatter.plan_harness),
|
|
1103
|
+
plan_resume_context: trimStringOrUndefined(frontMatter.plan_resume_context),
|
|
1104
|
+
plan_steps: normalizePlanSteps(frontMatter.plan_steps),
|
|
1105
|
+
plan_decisions: normalizePlanDecisions(frontMatter.plan_decisions),
|
|
1106
|
+
plan_discoveries: normalizePlanDiscoveries(frontMatter.plan_discoveries),
|
|
1107
|
+
plan_validation: normalizePlanValidation(frontMatter.plan_validation)
|
|
1108
|
+
};
|
|
1109
|
+
const sourceRecord = frontMatter;
|
|
1110
|
+
for (const [key, value] of Object.entries(sourceRecord)) {
|
|
1111
|
+
if (Object.prototype.hasOwnProperty.call(normalized, key) || value === void 0) {
|
|
1112
|
+
continue;
|
|
1113
|
+
}
|
|
1114
|
+
normalized[key] = value;
|
|
1115
|
+
}
|
|
1116
|
+
if (runtimeContext?.fieldRegistry) {
|
|
1117
|
+
for (const definition of runtimeContext.fieldRegistry.definitions) {
|
|
1118
|
+
const currentValue = normalized[definition.metadata_key];
|
|
1119
|
+
if (currentValue === void 0) {
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
normalized[definition.metadata_key] = coerceRuntimeFieldValue(definition, currentValue, `metadata field "${definition.metadata_key}"`);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
if (runtimeContext && runtimeContext.unknownFieldPolicy !== "allow") {
|
|
1126
|
+
const knownKeys = buildKnownFrontMatterKeys(runtimeContext);
|
|
1127
|
+
const unknownKeys = Object.keys(normalized).filter((key) => !knownKeys.has(key)).sort((left, right) => left.localeCompare(right));
|
|
1128
|
+
if (unknownKeys.length > 0) {
|
|
1129
|
+
if (runtimeContext.unknownFieldPolicy === "reject") {
|
|
1130
|
+
validationError(`unknown schema fields are not allowed: ${unknownKeys.join(", ")}`);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
for (const [key, value] of Object.entries(normalized)) {
|
|
1135
|
+
if (value === void 0) {
|
|
1136
|
+
delete normalized[key];
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
return normalized;
|
|
1140
|
+
}
|
|
1141
|
+
function orderFrontMatter(frontMatter) {
|
|
1142
|
+
return orderObject(frontMatter, FRONT_MATTER_KEY_ORDER);
|
|
1143
|
+
}
|
|
1144
|
+
function findJsonObjectEnd(content) {
|
|
1145
|
+
let depth = 0;
|
|
1146
|
+
let inString = false;
|
|
1147
|
+
let escaped = false;
|
|
1148
|
+
for (let i = 0; i < content.length; i += 1) {
|
|
1149
|
+
const char = content[i];
|
|
1150
|
+
if (inString) {
|
|
1151
|
+
if (escaped) {
|
|
1152
|
+
escaped = false;
|
|
1153
|
+
continue;
|
|
1154
|
+
}
|
|
1155
|
+
if (char === "\\") {
|
|
1156
|
+
escaped = true;
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
if (char === '"') {
|
|
1160
|
+
inString = false;
|
|
1161
|
+
}
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1164
|
+
if (char === '"') {
|
|
1165
|
+
inString = true;
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
if (char === "{") {
|
|
1169
|
+
depth += 1;
|
|
1170
|
+
continue;
|
|
1171
|
+
}
|
|
1172
|
+
if (char === "}") {
|
|
1173
|
+
depth -= 1;
|
|
1174
|
+
if (depth === 0) {
|
|
1175
|
+
return i;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return -1;
|
|
1180
|
+
}
|
|
1181
|
+
function splitFrontMatter(content) {
|
|
1182
|
+
if (!content.startsWith("{")) {
|
|
1183
|
+
return { frontMatter: "", body: content };
|
|
1184
|
+
}
|
|
1185
|
+
const end = findJsonObjectEnd(content);
|
|
1186
|
+
if (end < 0) {
|
|
1187
|
+
return { frontMatter: "", body: content };
|
|
1188
|
+
}
|
|
1189
|
+
const frontMatter = content.slice(0, end + 1);
|
|
1190
|
+
const body = content.slice(end + 1).replace(/^\r?\n+/, "");
|
|
1191
|
+
return { frontMatter, body };
|
|
1192
|
+
}
|
|
1193
|
+
function stripLeadingYamlDocument(content) {
|
|
1194
|
+
const normalizedContent = content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
1195
|
+
const opener = normalizedContent.match(/^[ \t]*---[ \t]*(?:\r?\n|$)/);
|
|
1196
|
+
if (!opener) {
|
|
1197
|
+
return { content: normalizedContent, stripped: false };
|
|
1198
|
+
}
|
|
1199
|
+
let cursor = opener[0].length;
|
|
1200
|
+
while (cursor < normalizedContent.length) {
|
|
1201
|
+
const nextNewline = normalizedContent.indexOf("\n", cursor);
|
|
1202
|
+
const lineEnd = nextNewline === -1 ? normalizedContent.length : nextNewline;
|
|
1203
|
+
const line = normalizedContent.slice(cursor, lineEnd).replace(/\r$/, "");
|
|
1204
|
+
const afterLine = nextNewline === -1 ? lineEnd : lineEnd + 1;
|
|
1205
|
+
if (line.trim() === "---") {
|
|
1206
|
+
return { content: normalizedContent.slice(afterLine).replace(/^\s+/, ""), stripped: true };
|
|
1207
|
+
}
|
|
1208
|
+
cursor = afterLine;
|
|
1209
|
+
}
|
|
1210
|
+
return { content: normalizedContent, stripped: false };
|
|
1211
|
+
}
|
|
1212
|
+
function parseJsonMarkdownItemDocument(content, runtimeContext, options = {}) {
|
|
1213
|
+
const normalized = stripLeadingYamlDocument(content);
|
|
1214
|
+
if (normalized.stripped) {
|
|
1215
|
+
options.onWarning?.("json_markdown_leading_yaml_frontmatter_ignored");
|
|
1216
|
+
}
|
|
1217
|
+
const { frontMatter, body } = splitFrontMatter(normalized.content);
|
|
1218
|
+
if (!frontMatter) {
|
|
1219
|
+
const trimmed = content.trimStart();
|
|
1220
|
+
if (trimmed.startsWith("{")) {
|
|
1221
|
+
validationError("JSON front matter is not valid JSON");
|
|
1222
|
+
}
|
|
1223
|
+
validationError("missing JSON front matter");
|
|
1224
|
+
}
|
|
1225
|
+
let parsed;
|
|
1226
|
+
try {
|
|
1227
|
+
parsed = JSON.parse(frontMatter);
|
|
1228
|
+
} catch {
|
|
1229
|
+
validationError("JSON front matter is not valid JSON");
|
|
1230
|
+
}
|
|
1231
|
+
assertValidFrontMatter(parsed, runtimeContext);
|
|
1232
|
+
return {
|
|
1233
|
+
metadata: normalizeFrontMatter(parsed, options),
|
|
1234
|
+
body: normalizeBody(body)
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
function parseToonItemDocument(content, runtimeContext, options = {}) {
|
|
1238
|
+
let parsed;
|
|
1239
|
+
try {
|
|
1240
|
+
parsed = decodeToonItemContent(content).value;
|
|
1241
|
+
} catch {
|
|
1242
|
+
validationError("TOON item document is not valid TOON");
|
|
1243
|
+
}
|
|
1244
|
+
assertFrontMatterCondition(typeof parsed === "object" && parsed !== null && !Array.isArray(parsed), "TOON item document must be an object");
|
|
1245
|
+
const record = parsed;
|
|
1246
|
+
if (Object.prototype.hasOwnProperty.call(record, "front_matter")) {
|
|
1247
|
+
assertValidFrontMatter(record.front_matter, runtimeContext);
|
|
1248
|
+
assertFrontMatterCondition(record.body === void 0 || typeof record.body === "string", "TOON item document body must be a string");
|
|
1249
|
+
return {
|
|
1250
|
+
metadata: normalizeFrontMatter(record.front_matter, options),
|
|
1251
|
+
body: normalizeBody(typeof record.body === "string" ? record.body : "")
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
const { body, ...frontMatterRecord } = record;
|
|
1255
|
+
assertFrontMatterCondition(body === void 0 || typeof body === "string", "TOON item document body must be a string");
|
|
1256
|
+
assertValidFrontMatter(frontMatterRecord, runtimeContext);
|
|
1257
|
+
return {
|
|
1258
|
+
metadata: normalizeFrontMatter(frontMatterRecord, options),
|
|
1259
|
+
body: normalizeBody(typeof body === "string" ? body : "")
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
function serializeJsonMarkdownItemDocument(document, options = {}) {
|
|
1263
|
+
const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);
|
|
1264
|
+
const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);
|
|
1265
|
+
const serializedFrontMatter = JSON.stringify(orderedFrontMatter, null, 2);
|
|
1266
|
+
const normalizedBody = normalizeBody(document.body ?? "");
|
|
1267
|
+
if (!normalizedBody) {
|
|
1268
|
+
return `${serializedFrontMatter}
|
|
1269
|
+
`;
|
|
1270
|
+
}
|
|
1271
|
+
return `${serializedFrontMatter}
|
|
1272
|
+
|
|
1273
|
+
${normalizedBody}
|
|
1274
|
+
`;
|
|
1275
|
+
}
|
|
1276
|
+
function serializeToonItemDocument(document, options = {}) {
|
|
1277
|
+
const normalizedFrontMatter = normalizeFrontMatter(document.metadata, options);
|
|
1278
|
+
const orderedFrontMatter = orderFrontMatter(normalizedFrontMatter);
|
|
1279
|
+
const normalizedBody = normalizeBody(document.body ?? "");
|
|
1280
|
+
return `${encodeToon({ ...orderedFrontMatter, body: normalizedBody })}
|
|
1281
|
+
`;
|
|
1282
|
+
}
|
|
1283
|
+
function parseItemDocument(content, options = {}) {
|
|
1284
|
+
const conflictMarker = findFirstMergeConflictMarker(content);
|
|
1285
|
+
if (conflictMarker) {
|
|
1286
|
+
throw new PmCliError(`Merge conflict markers detected in item document at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`, EXIT_CODE.GENERIC_FAILURE, {
|
|
1287
|
+
code: "merge_conflict_markers_detected",
|
|
1288
|
+
required: "Resolve merge-conflict markers in the item file before parsing or mutation commands.",
|
|
1289
|
+
why: "Partially merged documents can corrupt item metadata and history integrity.",
|
|
1290
|
+
examples: ["git status", "git add <resolved-file> && git commit"],
|
|
1291
|
+
nextSteps: ["Resolve conflicts, save the file, then rerun the pm command."]
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
const format = options.format ?? "toon";
|
|
1295
|
+
const runtimeContext = resolveRuntimeSchemaValidationContext(options);
|
|
1296
|
+
return format === "toon" ? parseToonItemDocument(content, runtimeContext, options) : parseJsonMarkdownItemDocument(content, runtimeContext, options);
|
|
1297
|
+
}
|
|
1298
|
+
function serializeItemDocument(document, options = {}) {
|
|
1299
|
+
const format = options.format ?? "toon";
|
|
1300
|
+
return format === "toon" ? serializeToonItemDocument(document, options) : serializeJsonMarkdownItemDocument(document, options);
|
|
1301
|
+
}
|
|
1302
|
+
function canonicalDocument(document, options = {}) {
|
|
1303
|
+
return {
|
|
1304
|
+
metadata: normalizeFrontMatter(document.metadata, options),
|
|
1305
|
+
body: normalizeBody(document.body ?? "")
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export {
|
|
1310
|
+
readRuntimeFieldOptionValue,
|
|
1311
|
+
coerceRuntimeFieldValue,
|
|
1312
|
+
collectRuntimeCreateFieldValues,
|
|
1313
|
+
collectRuntimeUpdateFieldValues,
|
|
1314
|
+
normalizeStatusInput,
|
|
1315
|
+
normalizeStatusForRegistry,
|
|
1316
|
+
isTerminalStatus,
|
|
1317
|
+
findFirstMergeConflictMarker,
|
|
1318
|
+
normalizeFrontMatter,
|
|
1319
|
+
parseItemDocument,
|
|
1320
|
+
serializeItemDocument,
|
|
1321
|
+
canonicalDocument
|
|
1322
|
+
};
|
|
1323
|
+
//# sourceMappingURL=chunk-KBG47ZOY.js.map
|
|
1324
|
+
|
|
1325
|
+
//# debugId=b9b7439e-7986-5a85-9356-8d54578b038a
|