@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-schema.js","sources":["core/schema/runtime-schema.ts"],"sourceRoot":"/","sourcesContent":["import path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from \"../shared/constants.js\";\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n RUNTIME_STATUS_ROLE_VALUES,\n RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,\n STATUS_VALUES,\n} from \"../../types/index.js\";\nimport type {\n ItemTypeDefinition,\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n RuntimeSchemaSettings,\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n RuntimeWorkflowDefinition,\n} from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand } from \"../../types/index.js\";\n\nexport const DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({\n types: \"schema/types.json\",\n statuses: \"schema/statuses.json\",\n fields: \"schema/fields.json\",\n workflows: \"schema/workflows.json\",\n});\n\n// Default lifecycle status model and workflow role mapping live in\n// src/core/shared/constants.ts as the single source of truth (also referenced\n// by SETTINGS_DEFAULTS). Re-exported here under the historical names.\nexport const DEFAULT_RUNTIME_WORKFLOW: RuntimeWorkflowDefinition = DEFAULT_WORKFLOW_DEFINITION;\n\nexport const DEFAULT_RUNTIME_STATUS_DEFINITIONS: ReadonlyArray<RuntimeStatusDefinition> = DEFAULT_STATUS_DEFINITIONS;\n\nconst DEFAULT_RUNTIME_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\nexport interface RuntimeStatusDefinitionResolved {\n id: string;\n aliases: string[];\n roles: RuntimeStatusRole[];\n description?: string;\n order: number;\n}\n\nexport interface RuntimeFieldDefinitionResolved {\n key: string;\n metadata_key: string;\n cli_flag: string;\n cli_aliases: string[];\n description?: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n repeatable: boolean;\n required: boolean;\n required_on_create: boolean;\n required_types: string[];\n allow_unset: boolean;\n}\n\nexport interface RuntimeStatusRegistry {\n definitions: RuntimeStatusDefinitionResolved[];\n by_id: Map<string, RuntimeStatusDefinitionResolved>;\n alias_to_id: Map<string, string>;\n terminal_statuses: Set<string>;\n terminal_done_statuses: Set<string>;\n terminal_canceled_statuses: Set<string>;\n active_statuses: Set<string>;\n blocked_statuses: Set<string>;\n draft_statuses: Set<string>;\n open_status: string;\n close_status: string;\n canceled_status: string;\n}\n\nexport interface RuntimeFieldRegistry {\n definitions: RuntimeFieldDefinitionResolved[];\n by_key: Map<string, RuntimeFieldDefinitionResolved>;\n by_cli_token: Map<string, RuntimeFieldDefinitionResolved>;\n command_to_fields: Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>;\n}\n\nexport interface RuntimeSchemaFileBootstrapResult {\n created_paths: string[];\n}\n\nexport interface LoadedRuntimeSchemaSections {\n schema: RuntimeSchemaSettings;\n type_definitions_from_file: ItemTypeDefinition[] | undefined;\n warnings: string[];\n created_paths: string[];\n}\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\nconst RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set<string>(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);\n\nfunction normalizeStringList(values: string[] | undefined): string[] {\n const candidates = Array.isArray(values) ? values : [];\n return [...new Set(candidates.map((value) => (typeof value === \"string\" ? value.trim() : \"\")).filter((value) => value.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction normalizeStatusId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length === 0) {\n return undefined;\n }\n const normalized = normalizeStatusToken(value);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction stripFlagPrefix(value: string): string {\n return value.startsWith(\"--\") ? value.slice(2) : value;\n}\n\nfunction normalizeCliToken(value: unknown): string {\n return typeof value === \"string\" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\")) : \"\";\n}\n\nfunction keyToDefaultCliFlag(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction toCamelCase(input: string): string {\n const segments = input\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return input;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction normalizeRuntimeStatusDefinition(\n definition: RuntimeStatusDefinition,\n fallbackOrder: number,\n): RuntimeStatusDefinitionResolved | null {\n const id = normalizeStatusId(definition.id);\n if (!id) {\n return null;\n }\n const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);\n const roles = normalizeStringList(definition.roles).filter((value): value is RuntimeStatusRole => RUNTIME_STATUS_ROLE_SET.has(value));\n const description = definition.description?.trim();\n const order = typeof definition.order === \"number\" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;\n return {\n id,\n aliases,\n roles,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction normalizeRuntimeWorkflow(workflow: RuntimeWorkflowDefinition | undefined): RuntimeWorkflowDefinition {\n return {\n draft_status: normalizeStatusId(workflow?.draft_status),\n open_status: normalizeStatusId(workflow?.open_status),\n in_progress_status: normalizeStatusId(workflow?.in_progress_status),\n blocked_status: normalizeStatusId(workflow?.blocked_status),\n close_status: normalizeStatusId(workflow?.close_status),\n canceled_status: normalizeStatusId(workflow?.canceled_status),\n };\n}\n\nfunction normalizeRuntimeFieldDefinition(definition: RuntimeFieldDefinition): RuntimeFieldDefinitionResolved | null {\n const key = normalizeStatusToken(definition.key ?? \"\");\n if (!key) {\n return null;\n }\n const metadataKey = normalizeStatusToken(definition.metadata_key ?? definition.front_matter_key ?? key);\n const cliFlag = normalizeCliToken(definition.cli_flag ?? keyToDefaultCliFlag(key));\n if (!cliFlag) {\n return null;\n }\n const cliAliases = normalizeStringList(definition.cli_aliases)\n .map((value) => normalizeCliToken(value))\n .filter((value) => value.length > 0 && value !== cliFlag);\n const typeCandidate = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : \"string\";\n const type = RUNTIME_FIELD_TYPE_SET.has(typeCandidate) ? (typeCandidate as RuntimeFieldType) : \"string\";\n const commands = (() => {\n const normalized = normalizeStringList(definition.commands).filter((value): value is RuntimeFieldCommand =>\n RUNTIME_FIELD_COMMAND_SET.has(value),\n );\n if (normalized.length > 0) {\n return normalized;\n }\n return [...DEFAULT_RUNTIME_FIELD_COMMANDS];\n })();\n const description = definition.description?.trim();\n const requiredTypes = normalizeStringList(definition.required_types);\n return {\n key,\n metadata_key: metadataKey,\n cli_flag: cliFlag,\n cli_aliases: cliAliases,\n description: description && description.length > 0 ? description : undefined,\n type,\n commands,\n repeatable: definition.repeatable === true || type === \"string_array\",\n required: definition.required === true,\n required_on_create: definition.required_on_create === true,\n required_types: requiredTypes,\n allow_unset: definition.allow_unset !== false,\n };\n}\n\nexport function normalizeRuntimeSchemaSettings(schema: Partial<RuntimeSchemaSettings> | undefined): RuntimeSchemaSettings {\n const files = {\n ...DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ...(schema?.files ?? {}),\n };\n const statusesSource = schema?.statuses && schema.statuses.length > 0 ? schema.statuses : DEFAULT_RUNTIME_STATUS_DEFINITIONS;\n const normalizedStatuses = (() => {\n const dedupedById = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const [index, definition] of statusesSource.entries()) {\n const normalized = normalizeRuntimeStatusDefinition(definition, index);\n if (!normalized) {\n continue;\n }\n dedupedById.set(normalized.id, normalized);\n }\n const values = [...dedupedById.values()].sort((left, right) =>\n left.order === right.order ? left.id.localeCompare(right.id) : left.order - right.order,\n );\n if (values.length > 0) {\n return values;\n }\n return DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n })();\n const normalizedFields = (() => {\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of schema?.fields ?? []) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n return [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n })();\n const unknownFieldPolicyCandidate =\n typeof schema?.unknown_field_policy === \"string\" ? schema.unknown_field_policy.trim().toLowerCase() : \"allow\";\n const unknownFieldPolicy = RUNTIME_UNKNOWN_FIELD_POLICY_SET.has(unknownFieldPolicyCandidate)\n ? unknownFieldPolicyCandidate\n : \"allow\";\n return {\n version: typeof schema?.version === \"number\" && Number.isFinite(schema.version) ? Math.floor(schema.version) : 1,\n files,\n statuses: normalizedStatuses.map((definition) => ({\n id: definition.id,\n aliases: definition.aliases.length > 0 ? [...definition.aliases] : undefined,\n roles: definition.roles.length > 0 ? [...definition.roles] : undefined,\n description: definition.description,\n order: definition.order,\n })),\n fields: normalizedFields.map((definition) => ({\n key: definition.key,\n metadata_key: definition.metadata_key !== definition.key ? definition.metadata_key : undefined,\n cli_flag: definition.cli_flag !== keyToDefaultCliFlag(definition.key) ? definition.cli_flag : undefined,\n cli_aliases: definition.cli_aliases.length > 0 ? [...definition.cli_aliases] : undefined,\n description: definition.description,\n type: definition.type,\n commands: [...definition.commands],\n repeatable: definition.repeatable === true ? true : undefined,\n required: definition.required === true ? true : undefined,\n required_on_create: definition.required_on_create === true ? true : undefined,\n required_types: definition.required_types.length > 0 ? [...definition.required_types] : undefined,\n allow_unset: definition.allow_unset === false ? false : undefined,\n })),\n workflow: {\n ...DEFAULT_RUNTIME_WORKFLOW,\n ...normalizeRuntimeWorkflow(schema?.workflow),\n },\n unknown_field_policy: unknownFieldPolicy as RuntimeSchemaSettings[\"unknown_field_policy\"],\n };\n}\n\nfunction serializeJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction buildTypesFileSeed(): unknown {\n return {\n definitions: [],\n };\n}\n\nfunction buildStatusesFileSeed(): unknown {\n return {\n statuses: DEFAULT_RUNTIME_STATUS_DEFINITIONS,\n };\n}\n\nfunction buildFieldsFileSeed(): unknown {\n return {\n fields: [],\n };\n}\n\nfunction buildWorkflowsFileSeed(): unknown {\n return {\n workflow: DEFAULT_RUNTIME_WORKFLOW,\n };\n}\n\nfunction parseOptionalJson(raw: string, warningKey: string, warnings: string[]): unknown | undefined {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n warnings.push(warningKey);\n return undefined;\n }\n}\n\nfunction readTypeDefinitionsFromSchemaFile(parsed: unknown): ItemTypeDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as ItemTypeDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.definitions)) {\n return record.definitions as ItemTypeDefinition[];\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const itemTypesRecord = record.item_types as Record<string, unknown>;\n if (Array.isArray(itemTypesRecord.definitions)) {\n return itemTypesRecord.definitions as ItemTypeDefinition[];\n }\n }\n return undefined;\n}\n\nfunction readStatusesFromSchemaFile(parsed: unknown): RuntimeStatusDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeStatusDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses as RuntimeStatusDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeStatusDefinition[];\n }\n return undefined;\n}\n\nfunction readFieldsFromSchemaFile(parsed: unknown): RuntimeFieldDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeFieldDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields as RuntimeFieldDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeFieldDefinition[];\n }\n return undefined;\n}\n\nfunction readWorkflowFromSchemaFile(parsed: unknown): RuntimeWorkflowDefinition | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (typeof record.workflow === \"object\" && record.workflow !== null && !Array.isArray(record.workflow)) {\n return record.workflow as RuntimeWorkflowDefinition;\n }\n if (typeof record.workflows === \"object\" && record.workflows !== null && !Array.isArray(record.workflows)) {\n return record.workflows as RuntimeWorkflowDefinition;\n }\n return record as RuntimeWorkflowDefinition;\n}\n\nexport function filePathForSchemaSection(pmRoot: string, configuredPath: string | undefined, fallbackPath: string): string {\n const normalized = configuredPath?.trim() || fallbackPath;\n if (path.isAbsolute(normalized)) {\n return normalized;\n }\n return path.join(pmRoot, normalized);\n}\n\nexport async function ensureRuntimeSchemaFileScaffold(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<RuntimeSchemaFileBootstrapResult> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const specs: Array<{ path: string; seed: unknown }> = [\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),\n seed: buildTypesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n seed: buildStatusesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n seed: buildFieldsFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows),\n seed: buildWorkflowsFileSeed(),\n },\n ];\n const createdPaths: string[] = [];\n for (const spec of specs) {\n if (await pathExists(spec.path)) {\n continue;\n }\n await writeFileAtomic(spec.path, serializeJson(spec.seed));\n createdPaths.push(spec.path);\n }\n return {\n created_paths: createdPaths,\n };\n}\n\nexport async function loadRuntimeSchemaFromOptionalFiles(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<LoadedRuntimeSchemaSections> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const warnings: string[] = [];\n const typeFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n const fieldsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n const workflowsFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.workflows,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows,\n );\n\n const typeDefinitionsFromFile = (() => {\n return undefined as ItemTypeDefinition[] | undefined;\n })();\n let loadedTypeDefinitions = typeDefinitionsFromFile;\n let loadedStatuses: RuntimeStatusDefinition[] | undefined;\n let loadedFields: RuntimeFieldDefinition[] | undefined;\n let loadedWorkflow: RuntimeWorkflowDefinition | undefined;\n\n const readAndParse = async (targetPath: string, warningKey: string): Promise<unknown | undefined> => {\n const raw = await readFileIfExists(targetPath);\n if (raw === null) {\n return undefined;\n }\n return parseOptionalJson(raw, warningKey, warnings);\n };\n\n const parsedTypes = await readAndParse(typeFilePath, \"runtime_schema_types_invalid_json\");\n if (parsedTypes !== undefined) {\n loadedTypeDefinitions = readTypeDefinitionsFromSchemaFile(parsedTypes);\n if (loadedTypeDefinitions === undefined) {\n warnings.push(\"runtime_schema_types_invalid_shape\");\n }\n }\n\n const parsedStatuses = await readAndParse(statusFilePath, \"runtime_schema_statuses_invalid_json\");\n if (parsedStatuses !== undefined) {\n loadedStatuses = readStatusesFromSchemaFile(parsedStatuses);\n if (loadedStatuses === undefined) {\n warnings.push(\"runtime_schema_statuses_invalid_shape\");\n }\n }\n\n const parsedFields = await readAndParse(fieldsFilePath, \"runtime_schema_fields_invalid_json\");\n if (parsedFields !== undefined) {\n loadedFields = readFieldsFromSchemaFile(parsedFields);\n if (loadedFields === undefined) {\n warnings.push(\"runtime_schema_fields_invalid_shape\");\n }\n }\n\n const parsedWorkflow = await readAndParse(workflowsFilePath, \"runtime_schema_workflows_invalid_json\");\n if (parsedWorkflow !== undefined) {\n loadedWorkflow = readWorkflowFromSchemaFile(parsedWorkflow);\n if (loadedWorkflow === undefined) {\n warnings.push(\"runtime_schema_workflows_invalid_shape\");\n }\n }\n\n const mergedSchema = normalizeRuntimeSchemaSettings({\n ...normalizedSchema,\n statuses: [...normalizedSchema.statuses, ...(loadedStatuses ?? [])],\n fields: [...normalizedSchema.fields, ...(loadedFields ?? [])],\n workflow: {\n ...normalizedSchema.workflow,\n ...(loadedWorkflow ?? {}),\n },\n });\n\n return {\n schema: mergedSchema,\n type_definitions_from_file: loadedTypeDefinitions,\n warnings,\n created_paths: [],\n };\n}\n\nfunction preferredStatusForRole(\n definitions: RuntimeStatusDefinitionResolved[],\n role: RuntimeStatusRole,\n fallbackValues: string[],\n): string | undefined {\n const withRole = definitions.filter((definition) => definition.roles.includes(role));\n if (withRole.length > 0) {\n return withRole[0].id;\n }\n for (const value of fallbackValues) {\n const normalized = normalizeStatusId(value);\n if (!normalized) {\n continue;\n }\n if (definitions.some((definition) => definition.id === normalized)) {\n return normalized;\n }\n }\n return definitions[0]?.id;\n}\n\nexport function resolveRuntimeStatusRegistry(schema: RuntimeSchemaSettings): RuntimeStatusRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const definitions = normalizedSchema.statuses.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n const aliasToId = new Map<string, string>();\n const byId = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const definition of definitions) {\n byId.set(definition.id, definition);\n aliasToId.set(definition.id, definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \" \"), definition.id);\n for (const alias of definition.aliases) {\n aliasToId.set(alias, definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \" \"), definition.id);\n }\n }\n const terminalStatuses = new Set<string>();\n const terminalDoneStatuses = new Set<string>();\n const terminalCanceledStatuses = new Set<string>();\n const activeStatuses = new Set<string>();\n const blockedStatuses = new Set<string>();\n const draftStatuses = new Set<string>();\n for (const definition of definitions) {\n const roles = new Set(definition.roles);\n if (roles.has(\"terminal\") || roles.has(\"terminal_done\") || roles.has(\"terminal_canceled\")) {\n terminalStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_done\")) {\n terminalDoneStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_canceled\")) {\n terminalCanceledStatuses.add(definition.id);\n }\n if (roles.has(\"active\")) {\n activeStatuses.add(definition.id);\n }\n if (roles.has(\"blocked\")) {\n blockedStatuses.add(definition.id);\n }\n if (roles.has(\"draft\")) {\n draftStatuses.add(definition.id);\n }\n }\n const workflow = normalizedSchema.workflow;\n const openStatus =\n normalizeStatusId(workflow.open_status) ??\n preferredStatusForRole(definitions, \"default_open\", [\"open\", \"in_progress\", STATUS_VALUES[0] ?? \"open\"]);\n const closeStatus =\n normalizeStatusId(workflow.close_status) ??\n preferredStatusForRole(definitions, \"default_close\", [\"closed\", \"done\", \"complete\"]);\n const canceledStatus =\n normalizeStatusId(workflow.canceled_status) ??\n preferredStatusForRole(definitions, \"default_cancel\", [\"canceled\", \"cancelled\"]);\n\n return {\n definitions,\n by_id: byId,\n alias_to_id: aliasToId,\n terminal_statuses: terminalStatuses,\n terminal_done_statuses: terminalDoneStatuses,\n terminal_canceled_statuses: terminalCanceledStatuses,\n active_statuses: activeStatuses,\n blocked_statuses: blockedStatuses,\n draft_statuses: draftStatuses,\n open_status: openStatus ?? definitions[0]?.id ?? \"open\",\n close_status: closeStatus ?? definitions[0]?.id ?? \"closed\",\n canceled_status: canceledStatus ?? definitions[0]?.id ?? \"canceled\",\n };\n}\n\nexport function normalizeStatusInputWithRegistry(value: unknown, registry: RuntimeStatusRegistry): string | undefined {\n const normalized = normalizeStatusToken(value);\n if (!normalized) {\n return undefined;\n }\n return registry.alias_to_id.get(normalized);\n}\n\nexport function resolveRuntimeFieldRegistry(schema: RuntimeSchemaSettings): RuntimeFieldRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of normalizedSchema.fields) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n const definitions = [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n const byKey = new Map<string, RuntimeFieldDefinitionResolved>();\n const byCliToken = new Map<string, RuntimeFieldDefinitionResolved>();\n const commandToFields = new Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>();\n for (const definition of definitions) {\n byKey.set(definition.key, definition);\n byCliToken.set(definition.cli_flag, definition);\n for (const alias of definition.cli_aliases) {\n byCliToken.set(alias, definition);\n }\n for (const command of definition.commands) {\n const existing = commandToFields.get(command) ?? [];\n existing.push(definition);\n commandToFields.set(command, existing);\n }\n }\n for (const [command, fieldDefinitions] of commandToFields.entries()) {\n fieldDefinitions.sort((left, right) => left.key.localeCompare(right.key));\n commandToFields.set(command, fieldDefinitions);\n }\n return {\n definitions,\n by_key: byKey,\n by_cli_token: byCliToken,\n command_to_fields: commandToFields,\n };\n}\n\nexport function runtimeFieldOptionTarget(field: RuntimeFieldDefinitionResolved): string {\n return toCamelCase(field.key);\n}\n\nexport function statusIsTerminal(status: string, registry: RuntimeStatusRegistry): boolean {\n const normalized = normalizeStatusInputWithRegistry(status, registry);\n if (!normalized) {\n return false;\n }\n return registry.terminal_statuses.has(normalized);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,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E,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1E,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO;QACL,WAAW;QACX,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,UAAU;QACxB,iBAAiB,EAAE,eAAe;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAqC;IAC5E,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAA+B;IAC9E,MAAM,UAAU,GAAG,gCAAgC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC","debugId":"f8b9437a-034b-5c44-917c-72eb805b32ac"}
|
|
1
|
+
{"version":3,"file":"runtime-schema.js","sources":["core/schema/runtime-schema.ts"],"sourceRoot":"/","sourcesContent":["import path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from \"../shared/constants.js\";\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n RUNTIME_STATUS_ROLE_VALUES,\n RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,\n STATUS_VALUES,\n} from \"../../types/index.js\";\nimport type {\n ItemTypeDefinition,\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n RuntimeSchemaSettings,\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n RuntimeWorkflowDefinition,\n TypeWorkflowDefinition,\n} from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand } from \"../../types/index.js\";\n\nexport const DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({\n types: \"schema/types.json\",\n statuses: \"schema/statuses.json\",\n fields: \"schema/fields.json\",\n workflows: \"schema/workflows.json\",\n});\n\n// Default lifecycle status model and workflow role mapping live in\n// src/core/shared/constants.ts as the single source of truth (also referenced\n// by SETTINGS_DEFAULTS). Re-exported here under the historical names.\nexport const DEFAULT_RUNTIME_WORKFLOW: RuntimeWorkflowDefinition = DEFAULT_WORKFLOW_DEFINITION;\n\nexport const DEFAULT_RUNTIME_STATUS_DEFINITIONS: ReadonlyArray<RuntimeStatusDefinition> = DEFAULT_STATUS_DEFINITIONS;\n\nconst DEFAULT_RUNTIME_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\nexport interface RuntimeStatusDefinitionResolved {\n id: string;\n aliases: string[];\n roles: RuntimeStatusRole[];\n description?: string;\n order: number;\n}\n\nexport interface RuntimeFieldDefinitionResolved {\n key: string;\n metadata_key: string;\n cli_flag: string;\n cli_aliases: string[];\n description?: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n repeatable: boolean;\n required: boolean;\n required_on_create: boolean;\n required_types: string[];\n allow_unset: boolean;\n}\n\nexport interface RuntimeStatusRegistry {\n definitions: RuntimeStatusDefinitionResolved[];\n by_id: Map<string, RuntimeStatusDefinitionResolved>;\n alias_to_id: Map<string, string>;\n terminal_statuses: Set<string>;\n terminal_done_statuses: Set<string>;\n terminal_canceled_statuses: Set<string>;\n active_statuses: Set<string>;\n blocked_statuses: Set<string>;\n draft_statuses: Set<string>;\n open_status: string;\n close_status: string;\n canceled_status: string;\n}\n\nexport interface RuntimeFieldRegistry {\n definitions: RuntimeFieldDefinitionResolved[];\n by_key: Map<string, RuntimeFieldDefinitionResolved>;\n by_cli_token: Map<string, RuntimeFieldDefinitionResolved>;\n command_to_fields: Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>;\n}\n\nexport interface RuntimeSchemaFileBootstrapResult {\n created_paths: string[];\n}\n\nexport interface LoadedRuntimeSchemaSections {\n schema: RuntimeSchemaSettings;\n type_definitions_from_file: ItemTypeDefinition[] | undefined;\n warnings: string[];\n created_paths: string[];\n}\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\nconst RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set<string>(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);\n\nfunction normalizeStringList(values: string[] | undefined): string[] {\n const candidates = Array.isArray(values) ? values : [];\n return [...new Set(candidates.map((value) => (typeof value === \"string\" ? value.trim() : \"\")).filter((value) => value.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction normalizeStatusId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length === 0) {\n return undefined;\n }\n const normalized = normalizeStatusToken(value);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction stripFlagPrefix(value: string): string {\n return value.startsWith(\"--\") ? value.slice(2) : value;\n}\n\nfunction normalizeCliToken(value: unknown): string {\n return typeof value === \"string\" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\")) : \"\";\n}\n\nfunction keyToDefaultCliFlag(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction toCamelCase(input: string): string {\n const segments = input\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return input;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction normalizeRuntimeStatusDefinition(\n definition: RuntimeStatusDefinition,\n fallbackOrder: number,\n): RuntimeStatusDefinitionResolved | null {\n const id = normalizeStatusId(definition.id);\n if (!id) {\n return null;\n }\n const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);\n const roles = normalizeStringList(definition.roles).filter((value): value is RuntimeStatusRole => RUNTIME_STATUS_ROLE_SET.has(value));\n const description = definition.description?.trim();\n const order = typeof definition.order === \"number\" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;\n return {\n id,\n aliases,\n roles,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction normalizeRuntimeWorkflow(workflow: RuntimeWorkflowDefinition | undefined): RuntimeWorkflowDefinition {\n return {\n draft_status: normalizeStatusId(workflow?.draft_status),\n open_status: normalizeStatusId(workflow?.open_status),\n in_progress_status: normalizeStatusId(workflow?.in_progress_status),\n blocked_status: normalizeStatusId(workflow?.blocked_status),\n close_status: normalizeStatusId(workflow?.close_status),\n canceled_status: normalizeStatusId(workflow?.canceled_status),\n };\n}\n\nfunction normalizeTypeWorkflowDefinitions(\n workflows: TypeWorkflowDefinition[] | undefined,\n): TypeWorkflowDefinition[] | undefined {\n if (!Array.isArray(workflows) || workflows.length === 0) {\n return undefined;\n }\n // Keep the raw (trimmed) type name so it round-trips verbatim; comparison is\n // case-insensitive downstream (resolveTypeWorkflows lower-cases). from/to\n // status tokens use the same normalization rules as runtime statuses.\n //\n // An EXPLICIT empty `allowed_transitions: []` is a deliberate DENY-ALL rule and\n // MUST survive normalization (it must NOT collapse to \"no entry\", which would\n // leave the type unrestricted). But a NON-empty array whose every pair is\n // malformed (e.g. a 3-element tuple typo) must be DROPPED like other malformed\n // schema-file content, NOT silently turned into a deny-all rule — otherwise a\n // typo would start failing every update for that type under strict enforcement.\n const byTypeKey = new Map<string, { type: string; pairs: [string, string][]; denyAll: boolean }>();\n for (const entry of workflows) {\n const rawType = typeof entry?.type === \"string\" ? entry.type.trim() : \"\";\n if (rawType.length === 0) {\n continue;\n }\n if (!Array.isArray(entry?.allowed_transitions)) {\n continue;\n }\n const typeKey = rawType.toLowerCase();\n const pairs = entry.allowed_transitions;\n const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };\n // Only an explicitly empty array signals an intentional deny-all.\n if (pairs.length === 0) {\n record.denyAll = true;\n }\n for (const pair of pairs) {\n if (!Array.isArray(pair) || pair.length !== 2) {\n continue;\n }\n const from = normalizeStatusToken(pair[0]);\n const to = normalizeStatusToken(pair[1]);\n if (from.length === 0 || to.length === 0) {\n continue;\n }\n if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {\n continue;\n }\n record.pairs.push([from, to]);\n }\n byTypeKey.set(typeKey, record);\n }\n const normalized: TypeWorkflowDefinition[] = [];\n for (const record of byTypeKey.values()) {\n // Keep when there is at least one valid transition OR an explicit deny-all was\n // declared; drop nonempty-but-all-malformed entries (treated as typos).\n if (record.pairs.length > 0 || record.denyAll) {\n normalized.push({ type: record.type, allowed_transitions: record.pairs });\n }\n }\n normalized.sort((left, right) => left.type.localeCompare(right.type));\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeRuntimeFieldDefinition(definition: RuntimeFieldDefinition): RuntimeFieldDefinitionResolved | null {\n const key = normalizeStatusToken(definition.key ?? \"\");\n if (!key) {\n return null;\n }\n const metadataKey = normalizeStatusToken(definition.metadata_key ?? definition.front_matter_key ?? key);\n const cliFlag = normalizeCliToken(definition.cli_flag ?? keyToDefaultCliFlag(key));\n if (!cliFlag) {\n return null;\n }\n const cliAliases = normalizeStringList(definition.cli_aliases)\n .map((value) => normalizeCliToken(value))\n .filter((value) => value.length > 0 && value !== cliFlag);\n const typeCandidate = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : \"string\";\n const type = RUNTIME_FIELD_TYPE_SET.has(typeCandidate) ? (typeCandidate as RuntimeFieldType) : \"string\";\n const commands = (() => {\n const normalized = normalizeStringList(definition.commands).filter((value): value is RuntimeFieldCommand =>\n RUNTIME_FIELD_COMMAND_SET.has(value),\n );\n if (normalized.length > 0) {\n return normalized;\n }\n return [...DEFAULT_RUNTIME_FIELD_COMMANDS];\n })();\n const description = definition.description?.trim();\n const requiredTypes = normalizeStringList(definition.required_types);\n return {\n key,\n metadata_key: metadataKey,\n cli_flag: cliFlag,\n cli_aliases: cliAliases,\n description: description && description.length > 0 ? description : undefined,\n type,\n commands,\n repeatable: definition.repeatable === true || type === \"string_array\",\n required: definition.required === true,\n required_on_create: definition.required_on_create === true,\n required_types: requiredTypes,\n allow_unset: definition.allow_unset !== false,\n };\n}\n\nexport function normalizeRuntimeSchemaSettings(schema: Partial<RuntimeSchemaSettings> | undefined): RuntimeSchemaSettings {\n const files = {\n ...DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ...(schema?.files ?? {}),\n };\n const statusesSource = schema?.statuses && schema.statuses.length > 0 ? schema.statuses : DEFAULT_RUNTIME_STATUS_DEFINITIONS;\n const normalizedStatuses = (() => {\n const dedupedById = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const [index, definition] of statusesSource.entries()) {\n const normalized = normalizeRuntimeStatusDefinition(definition, index);\n if (!normalized) {\n continue;\n }\n dedupedById.set(normalized.id, normalized);\n }\n const values = [...dedupedById.values()].sort((left, right) =>\n left.order === right.order ? left.id.localeCompare(right.id) : left.order - right.order,\n );\n if (values.length > 0) {\n return values;\n }\n return DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n })();\n const normalizedFields = (() => {\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of schema?.fields ?? []) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n return [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n })();\n const unknownFieldPolicyCandidate =\n typeof schema?.unknown_field_policy === \"string\" ? schema.unknown_field_policy.trim().toLowerCase() : \"allow\";\n const unknownFieldPolicy = RUNTIME_UNKNOWN_FIELD_POLICY_SET.has(unknownFieldPolicyCandidate)\n ? unknownFieldPolicyCandidate\n : \"allow\";\n return {\n version: typeof schema?.version === \"number\" && Number.isFinite(schema.version) ? Math.floor(schema.version) : 1,\n files,\n statuses: normalizedStatuses.map((definition) => ({\n id: definition.id,\n aliases: definition.aliases.length > 0 ? [...definition.aliases] : undefined,\n roles: definition.roles.length > 0 ? [...definition.roles] : undefined,\n description: definition.description,\n order: definition.order,\n })),\n fields: normalizedFields.map((definition) => ({\n key: definition.key,\n metadata_key: definition.metadata_key !== definition.key ? definition.metadata_key : undefined,\n cli_flag: definition.cli_flag !== keyToDefaultCliFlag(definition.key) ? definition.cli_flag : undefined,\n cli_aliases: definition.cli_aliases.length > 0 ? [...definition.cli_aliases] : undefined,\n description: definition.description,\n type: definition.type,\n commands: [...definition.commands],\n repeatable: definition.repeatable === true ? true : undefined,\n required: definition.required === true ? true : undefined,\n required_on_create: definition.required_on_create === true ? true : undefined,\n required_types: definition.required_types.length > 0 ? [...definition.required_types] : undefined,\n allow_unset: definition.allow_unset === false ? false : undefined,\n })),\n workflow: {\n ...DEFAULT_RUNTIME_WORKFLOW,\n ...normalizeRuntimeWorkflow(schema?.workflow),\n },\n type_workflows: normalizeTypeWorkflowDefinitions(schema?.type_workflows),\n unknown_field_policy: unknownFieldPolicy as RuntimeSchemaSettings[\"unknown_field_policy\"],\n };\n}\n\nfunction serializeJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction buildTypesFileSeed(): unknown {\n return {\n definitions: [],\n };\n}\n\nfunction buildStatusesFileSeed(): unknown {\n return {\n statuses: DEFAULT_RUNTIME_STATUS_DEFINITIONS,\n };\n}\n\nfunction buildFieldsFileSeed(): unknown {\n return {\n fields: [],\n };\n}\n\nfunction buildWorkflowsFileSeed(): unknown {\n return {\n workflow: DEFAULT_RUNTIME_WORKFLOW,\n };\n}\n\nfunction parseOptionalJson(raw: string, warningKey: string, warnings: string[]): unknown | undefined {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n warnings.push(warningKey);\n return undefined;\n }\n}\n\nfunction readTypeDefinitionsFromSchemaFile(parsed: unknown): ItemTypeDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as ItemTypeDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.definitions)) {\n return record.definitions as ItemTypeDefinition[];\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const itemTypesRecord = record.item_types as Record<string, unknown>;\n if (Array.isArray(itemTypesRecord.definitions)) {\n return itemTypesRecord.definitions as ItemTypeDefinition[];\n }\n }\n return undefined;\n}\n\nfunction readStatusesFromSchemaFile(parsed: unknown): RuntimeStatusDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeStatusDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses as RuntimeStatusDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeStatusDefinition[];\n }\n return undefined;\n}\n\nfunction readFieldsFromSchemaFile(parsed: unknown): RuntimeFieldDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeFieldDefinition[];\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields as RuntimeFieldDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeFieldDefinition[];\n }\n return undefined;\n}\n\nfunction readWorkflowFromSchemaFile(parsed: unknown): RuntimeWorkflowDefinition | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (typeof record.workflow === \"object\" && record.workflow !== null && !Array.isArray(record.workflow)) {\n return record.workflow as RuntimeWorkflowDefinition;\n }\n if (typeof record.workflows === \"object\" && record.workflows !== null && !Array.isArray(record.workflows)) {\n return record.workflows as RuntimeWorkflowDefinition;\n }\n return record as RuntimeWorkflowDefinition;\n}\n\nfunction readTypeWorkflowsFromSchemaFile(parsed: unknown): TypeWorkflowDefinition[] | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.type_workflows)) {\n return record.type_workflows as TypeWorkflowDefinition[];\n }\n return undefined;\n}\n\nexport function filePathForSchemaSection(pmRoot: string, configuredPath: string | undefined, fallbackPath: string): string {\n const normalized = configuredPath?.trim() || fallbackPath;\n if (path.isAbsolute(normalized)) {\n return normalized;\n }\n return path.join(pmRoot, normalized);\n}\n\nexport async function ensureRuntimeSchemaFileScaffold(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<RuntimeSchemaFileBootstrapResult> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const specs: Array<{ path: string; seed: unknown }> = [\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),\n seed: buildTypesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n seed: buildStatusesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n seed: buildFieldsFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows),\n seed: buildWorkflowsFileSeed(),\n },\n ];\n const createdPaths: string[] = [];\n for (const spec of specs) {\n if (await pathExists(spec.path)) {\n continue;\n }\n await writeFileAtomic(spec.path, serializeJson(spec.seed));\n createdPaths.push(spec.path);\n }\n return {\n created_paths: createdPaths,\n };\n}\n\nexport async function loadRuntimeSchemaFromOptionalFiles(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<LoadedRuntimeSchemaSections> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const warnings: string[] = [];\n const typeFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n const fieldsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n const workflowsFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.workflows,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows,\n );\n\n const typeDefinitionsFromFile = (() => {\n return undefined as ItemTypeDefinition[] | undefined;\n })();\n let loadedTypeDefinitions = typeDefinitionsFromFile;\n let loadedStatuses: RuntimeStatusDefinition[] | undefined;\n let loadedFields: RuntimeFieldDefinition[] | undefined;\n let loadedWorkflow: RuntimeWorkflowDefinition | undefined;\n let loadedTypeWorkflows: TypeWorkflowDefinition[] | undefined;\n\n const readAndParse = async (targetPath: string, warningKey: string): Promise<unknown | undefined> => {\n const raw = await readFileIfExists(targetPath);\n if (raw === null) {\n return undefined;\n }\n return parseOptionalJson(raw, warningKey, warnings);\n };\n\n const parsedTypes = await readAndParse(typeFilePath, \"runtime_schema_types_invalid_json\");\n if (parsedTypes !== undefined) {\n loadedTypeDefinitions = readTypeDefinitionsFromSchemaFile(parsedTypes);\n if (loadedTypeDefinitions === undefined) {\n warnings.push(\"runtime_schema_types_invalid_shape\");\n }\n }\n\n const parsedStatuses = await readAndParse(statusFilePath, \"runtime_schema_statuses_invalid_json\");\n if (parsedStatuses !== undefined) {\n loadedStatuses = readStatusesFromSchemaFile(parsedStatuses);\n if (loadedStatuses === undefined) {\n warnings.push(\"runtime_schema_statuses_invalid_shape\");\n }\n }\n\n const parsedFields = await readAndParse(fieldsFilePath, \"runtime_schema_fields_invalid_json\");\n if (parsedFields !== undefined) {\n loadedFields = readFieldsFromSchemaFile(parsedFields);\n if (loadedFields === undefined) {\n warnings.push(\"runtime_schema_fields_invalid_shape\");\n }\n }\n\n const parsedWorkflow = await readAndParse(workflowsFilePath, \"runtime_schema_workflows_invalid_json\");\n if (parsedWorkflow !== undefined) {\n loadedWorkflow = readWorkflowFromSchemaFile(parsedWorkflow);\n if (loadedWorkflow === undefined) {\n warnings.push(\"runtime_schema_workflows_invalid_shape\");\n }\n // type_workflows live alongside `workflow` in the same file; their absence\n // is not an error (the file may carry only the lifecycle workflow block).\n loadedTypeWorkflows = readTypeWorkflowsFromSchemaFile(parsedWorkflow);\n }\n\n const mergedSchema = normalizeRuntimeSchemaSettings({\n ...normalizedSchema,\n statuses: [...normalizedSchema.statuses, ...(loadedStatuses ?? [])],\n fields: [...normalizedSchema.fields, ...(loadedFields ?? [])],\n workflow: {\n ...normalizedSchema.workflow,\n ...(loadedWorkflow ?? {}),\n },\n type_workflows: [...(normalizedSchema.type_workflows ?? []), ...(loadedTypeWorkflows ?? [])],\n });\n\n return {\n schema: mergedSchema,\n type_definitions_from_file: loadedTypeDefinitions,\n warnings,\n created_paths: [],\n };\n}\n\nfunction preferredStatusForRole(\n definitions: RuntimeStatusDefinitionResolved[],\n role: RuntimeStatusRole,\n fallbackValues: string[],\n): string | undefined {\n const withRole = definitions.filter((definition) => definition.roles.includes(role));\n if (withRole.length > 0) {\n return withRole[0].id;\n }\n for (const value of fallbackValues) {\n const normalized = normalizeStatusId(value);\n if (!normalized) {\n continue;\n }\n if (definitions.some((definition) => definition.id === normalized)) {\n return normalized;\n }\n }\n return definitions[0]?.id;\n}\n\nexport function resolveRuntimeStatusRegistry(schema: RuntimeSchemaSettings): RuntimeStatusRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const definitions = normalizedSchema.statuses.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n const aliasToId = new Map<string, string>();\n const byId = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const definition of definitions) {\n byId.set(definition.id, definition);\n aliasToId.set(definition.id, definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \" \"), definition.id);\n for (const alias of definition.aliases) {\n aliasToId.set(alias, definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \" \"), definition.id);\n }\n }\n const terminalStatuses = new Set<string>();\n const terminalDoneStatuses = new Set<string>();\n const terminalCanceledStatuses = new Set<string>();\n const activeStatuses = new Set<string>();\n const blockedStatuses = new Set<string>();\n const draftStatuses = new Set<string>();\n for (const definition of definitions) {\n const roles = new Set(definition.roles);\n if (roles.has(\"terminal\") || roles.has(\"terminal_done\") || roles.has(\"terminal_canceled\")) {\n terminalStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_done\")) {\n terminalDoneStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_canceled\")) {\n terminalCanceledStatuses.add(definition.id);\n }\n if (roles.has(\"active\")) {\n activeStatuses.add(definition.id);\n }\n if (roles.has(\"blocked\")) {\n blockedStatuses.add(definition.id);\n }\n if (roles.has(\"draft\")) {\n draftStatuses.add(definition.id);\n }\n }\n const workflow = normalizedSchema.workflow;\n const openStatus =\n normalizeStatusId(workflow.open_status) ??\n preferredStatusForRole(definitions, \"default_open\", [\"open\", \"in_progress\", STATUS_VALUES[0] ?? \"open\"]);\n const closeStatus =\n normalizeStatusId(workflow.close_status) ??\n preferredStatusForRole(definitions, \"default_close\", [\"closed\", \"done\", \"complete\"]);\n const canceledStatus =\n normalizeStatusId(workflow.canceled_status) ??\n preferredStatusForRole(definitions, \"default_cancel\", [\"canceled\", \"cancelled\"]);\n\n return {\n definitions,\n by_id: byId,\n alias_to_id: aliasToId,\n terminal_statuses: terminalStatuses,\n terminal_done_statuses: terminalDoneStatuses,\n terminal_canceled_statuses: terminalCanceledStatuses,\n active_statuses: activeStatuses,\n blocked_statuses: blockedStatuses,\n draft_statuses: draftStatuses,\n open_status: openStatus ?? definitions[0]?.id ?? \"open\",\n close_status: closeStatus ?? definitions[0]?.id ?? \"closed\",\n canceled_status: canceledStatus ?? definitions[0]?.id ?? \"canceled\",\n };\n}\n\nexport function normalizeStatusInputWithRegistry(value: unknown, registry: RuntimeStatusRegistry): string | undefined {\n const normalized = normalizeStatusToken(value);\n if (!normalized) {\n return undefined;\n }\n return registry.alias_to_id.get(normalized);\n}\n\nexport function resolveRuntimeFieldRegistry(schema: RuntimeSchemaSettings): RuntimeFieldRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of normalizedSchema.fields) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n const definitions = [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n const byKey = new Map<string, RuntimeFieldDefinitionResolved>();\n const byCliToken = new Map<string, RuntimeFieldDefinitionResolved>();\n const commandToFields = new Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>();\n for (const definition of definitions) {\n byKey.set(definition.key, definition);\n byCliToken.set(definition.cli_flag, definition);\n for (const alias of definition.cli_aliases) {\n byCliToken.set(alias, definition);\n }\n for (const command of definition.commands) {\n const existing = commandToFields.get(command) ?? [];\n existing.push(definition);\n commandToFields.set(command, existing);\n }\n }\n for (const [command, fieldDefinitions] of commandToFields.entries()) {\n fieldDefinitions.sort((left, right) => left.key.localeCompare(right.key));\n commandToFields.set(command, fieldDefinitions);\n }\n return {\n definitions,\n by_key: byKey,\n by_cli_token: byCliToken,\n command_to_fields: commandToFields,\n };\n}\n\nexport function runtimeFieldOptionTarget(field: RuntimeFieldDefinitionResolved): string {\n return toCamelCase(field.key);\n}\n\nexport function statusIsTerminal(status: string, registry: RuntimeStatusRegistry): boolean {\n const normalized = normalizeStatusInputWithRegistry(status, registry);\n if (!normalized) {\n return false;\n }\n return registry.terminal_statuses.has(normalized);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mCAAmC,EACnC,aAAa,GACd,MAAM,sBAAsB,CAAC;AAe9B,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7D,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,sBAAsB;IAChC,MAAM,EAAE,oBAAoB;IAC5B,SAAS,EAAE,uBAAuB;CACnC,CAAC,CAAC;AAEH,mEAAmE;AACnE,8EAA8E;AAC9E,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAA8B,2BAA2B,CAAC;AAE/F,MAAM,CAAC,MAAM,kCAAkC,GAA2C,0BAA0B,CAAC;AAErH,MAAM,8BAA8B,GAA0B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AA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BAAgB,CAAC,IAAI,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;QACpE,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1E,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO;QACL,WAAW;QACX,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,UAAU;QACxB,iBAAiB,EAAE,eAAe;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAqC;IAC5E,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAA+B;IAC9E,MAAM,UAAU,GAAG,gCAAgC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC","debugId":"11167959-e632-5d72-a6d1-103f6a7d50ef"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { RuntimeStatusDefinition, RuntimeStatusRole } from "../../types/index.js";
|
|
2
|
+
export type { RuntimeStatusDefinition, RuntimeStatusRole } from "../../types/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* The 5 lifecycle status ids that ship as built-in defaults and may never be
|
|
5
|
+
* removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS:
|
|
6
|
+
* open/in_progress/blocked/closed/canceled). `draft` is also a default but the
|
|
7
|
+
* acceptance criteria enumerate the 5 terminal/active ids explicitly, so the
|
|
8
|
+
* guard derives the full set from the canonical defaults to stay in sync.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BUILTIN_STATUS_IDS: ReadonlySet<string>;
|
|
11
|
+
/**
|
|
12
|
+
* The shape persisted at `.agents/pm/schema/statuses.json`.
|
|
13
|
+
*/
|
|
14
|
+
export interface StatusDefsFile {
|
|
15
|
+
statuses: RuntimeStatusDefinition[];
|
|
16
|
+
}
|
|
17
|
+
export interface RawAddStatusInput {
|
|
18
|
+
id: string | undefined;
|
|
19
|
+
roles?: string[];
|
|
20
|
+
aliases?: string[];
|
|
21
|
+
description?: string;
|
|
22
|
+
order?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface NormalizedAddStatusInput {
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Normalized roles, or `undefined` when the raw input did not supply a roles
|
|
28
|
+
* field at all. `undefined` means "leave existing roles untouched" on upsert;
|
|
29
|
+
* an explicit empty array means "clear roles". This distinction is what keeps
|
|
30
|
+
* `add-status review --description x` from wiping a previously-set role.
|
|
31
|
+
*/
|
|
32
|
+
roles?: RuntimeStatusRole[];
|
|
33
|
+
/** Same omitted-vs-explicit-empty semantics as `roles`. */
|
|
34
|
+
aliases?: string[];
|
|
35
|
+
description?: string;
|
|
36
|
+
order?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface UpsertStatusDefResult {
|
|
39
|
+
file: StatusDefsFile;
|
|
40
|
+
/** The definition as stored after the upsert (existing fields preserved). */
|
|
41
|
+
definition: RuntimeStatusDefinition;
|
|
42
|
+
/** True when an existing definition with the same (normalized) id was replaced. */
|
|
43
|
+
replaced: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface RemoveStatusDefResult {
|
|
46
|
+
file: StatusDefsFile;
|
|
47
|
+
/** True when a matching definition existed and was dropped from the file. */
|
|
48
|
+
removed: boolean;
|
|
49
|
+
/** The removed definition, when one matched the requested id. */
|
|
50
|
+
definition?: RuntimeStatusDefinition;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Normalizes a status token using the same rules as runtime-schema.ts: lowercase
|
|
54
|
+
* and collapse any run of whitespace/hyphens into a single underscore.
|
|
55
|
+
*/
|
|
56
|
+
export declare function normalizeStatusToken(value: unknown): string;
|
|
57
|
+
/**
|
|
58
|
+
* Validates and normalizes raw add-status CLI input. Throws a plain Error with a
|
|
59
|
+
* stable message when the id is missing/empty or a role is not one of
|
|
60
|
+
* RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.
|
|
61
|
+
*
|
|
62
|
+
* Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`
|
|
63
|
+
* is `undefined` (flag not supplied) the normalized field is `undefined` so the
|
|
64
|
+
* upsert leaves the existing value untouched; when supplied (even an empty array)
|
|
65
|
+
* the field is normalized to an array so the upsert can apply an explicit clear.
|
|
66
|
+
*/
|
|
67
|
+
export declare function normalizeAddStatusInput(raw: RawAddStatusInput): NormalizedAddStatusInput;
|
|
68
|
+
/**
|
|
69
|
+
* Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile.
|
|
70
|
+
* Accepts the canonical `{ statuses: [...] }` shape, a bare array of
|
|
71
|
+
* definitions, or a `{ definitions: [...] }` form, and tolerates a
|
|
72
|
+
* missing/invalid file by returning an empty statuses list.
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseStatusDefsFile(raw: string | null | undefined): StatusDefsFile;
|
|
75
|
+
/**
|
|
76
|
+
* Serializes the status definitions file with a trailing newline (matches the
|
|
77
|
+
* rest of the schema scaffold files written by pm).
|
|
78
|
+
*/
|
|
79
|
+
export declare function serializeStatusDefsFile(file: StatusDefsFile): string;
|
|
80
|
+
/**
|
|
81
|
+
* Idempotent UPSERT of a status definition into the parsed file. Matching is by
|
|
82
|
+
* normalized id. When a definition already exists, fields supplied in `input`
|
|
83
|
+
* override the previous values (roles/aliases replace when a non-empty array is
|
|
84
|
+
* given, clear when an explicit empty array is given, and are left UNTOUCHED
|
|
85
|
+
* when the field is `undefined` — i.e. the add-status flag was omitted);
|
|
86
|
+
* description/order override when provided. Fields not addressed by add-status
|
|
87
|
+
* flags are preserved untouched, so `add-status <id> --description x` keeps any
|
|
88
|
+
* previously-set roles/aliases.
|
|
89
|
+
*/
|
|
90
|
+
export declare function upsertStatusDef(file: StatusDefsFile, input: NormalizedAddStatusInput, baseDefinition?: RuntimeStatusDefinition): UpsertStatusDefResult;
|
|
91
|
+
/**
|
|
92
|
+
* Removes a status definition from the parsed file by id (normalized). Throws a
|
|
93
|
+
* plain Error when `id` is empty or matches a reserved built-in default status
|
|
94
|
+
* (those are never stored in the file and must never be deletable). Returns
|
|
95
|
+
* `removed: false` when no matching definition exists so the CLI layer can treat
|
|
96
|
+
* the call as an idempotent no-op.
|
|
97
|
+
*/
|
|
98
|
+
export declare function removeStatusDef(file: StatusDefsFile, id: string | undefined): RemoveStatusDefResult;
|
|
99
|
+
/**
|
|
100
|
+
* Throws when the new status id or any explicitly-supplied alias collides with a
|
|
101
|
+
* DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized
|
|
102
|
+
* token to its owning status id (the runtime status registry's alias_to_id map,
|
|
103
|
+
* which stores ids and aliases in one namespace). Re-adding the same status
|
|
104
|
+
* (matching id) is allowed — only cross-status collisions throw. This prevents a
|
|
105
|
+
* custom status from shadowing a built-in lifecycle token (for example
|
|
106
|
+
* `add-status review --alias open`, or a custom id `cancelled` that aliases the
|
|
107
|
+
* built-in `canceled`), which would make `pm update --status open` resolve to the
|
|
108
|
+
* wrong status. The CLI layer maps the thrown Error to a USAGE exit code.
|
|
109
|
+
*/
|
|
110
|
+
export declare function assertStatusTokensAvailable(input: {
|
|
111
|
+
id: string;
|
|
112
|
+
aliases?: string[];
|
|
113
|
+
}, resolvedAliasToId: ReadonlyMap<string, string>): void;
|
|
@@ -0,0 +1,260 @@
|
|
|
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]="d738db07-1d64-5ab0-9ebd-f9c9f6de5706")}catch(e){}}();
|
|
3
|
+
import { RUNTIME_STATUS_ROLE_VALUES } from "../../types/index.js";
|
|
4
|
+
import { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from "./runtime-schema.js";
|
|
5
|
+
/**
|
|
6
|
+
* Pure logic for the `pm schema add-status` / `pm schema remove-status`
|
|
7
|
+
* commands. The CLI command file (schema.ts) owns IO/governance; everything
|
|
8
|
+
* testable and side-effect-free lives here so it can be coverage-gated to 100%.
|
|
9
|
+
*
|
|
10
|
+
* Statuses persist at `.agents/pm/schema/statuses.json` under the shape
|
|
11
|
+
* `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime
|
|
12
|
+
* merge layer (src/core/store/settings.ts) still supplies the built-in defaults
|
|
13
|
+
* from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them
|
|
14
|
+
* into the persisted file.
|
|
15
|
+
*/
|
|
16
|
+
const RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
|
|
17
|
+
/**
|
|
18
|
+
* The 5 lifecycle status ids that ship as built-in defaults and may never be
|
|
19
|
+
* removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS:
|
|
20
|
+
* open/in_progress/blocked/closed/canceled). `draft` is also a default but the
|
|
21
|
+
* acceptance criteria enumerate the 5 terminal/active ids explicitly, so the
|
|
22
|
+
* guard derives the full set from the canonical defaults to stay in sync.
|
|
23
|
+
*/
|
|
24
|
+
export const BUILTIN_STATUS_IDS = new Set(DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter((id) => id.length > 0));
|
|
25
|
+
/**
|
|
26
|
+
* Normalizes a status token using the same rules as runtime-schema.ts: lowercase
|
|
27
|
+
* and collapse any run of whitespace/hyphens into a single underscore.
|
|
28
|
+
*/
|
|
29
|
+
export function normalizeStatusToken(value) {
|
|
30
|
+
return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
|
|
31
|
+
}
|
|
32
|
+
function dedupeTokens(values) {
|
|
33
|
+
const seen = new Set();
|
|
34
|
+
for (const value of values) {
|
|
35
|
+
const token = normalizeStatusToken(value);
|
|
36
|
+
if (token.length > 0) {
|
|
37
|
+
seen.add(token);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return [...seen].sort((left, right) => left.localeCompare(right));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validates and normalizes raw add-status CLI input. Throws a plain Error with a
|
|
44
|
+
* stable message when the id is missing/empty or a role is not one of
|
|
45
|
+
* RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.
|
|
46
|
+
*
|
|
47
|
+
* Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`
|
|
48
|
+
* is `undefined` (flag not supplied) the normalized field is `undefined` so the
|
|
49
|
+
* upsert leaves the existing value untouched; when supplied (even an empty array)
|
|
50
|
+
* the field is normalized to an array so the upsert can apply an explicit clear.
|
|
51
|
+
*/
|
|
52
|
+
export function normalizeAddStatusInput(raw) {
|
|
53
|
+
const id = normalizeStatusToken(raw.id);
|
|
54
|
+
if (id.length === 0) {
|
|
55
|
+
throw new Error("Status id must not be empty.");
|
|
56
|
+
}
|
|
57
|
+
// Built-in lifecycle statuses are reserved and cannot be overridden: an
|
|
58
|
+
// add-status override would change reserved metadata yet remove-status refuses
|
|
59
|
+
// to delete a built-in id, leaving no CLI path to undo it. Reject up front,
|
|
60
|
+
// symmetric with removeStatusDef.
|
|
61
|
+
if (BUILTIN_STATUS_IDS.has(id)) {
|
|
62
|
+
throw new Error(`Cannot add-status the built-in status "${id}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
|
|
63
|
+
}
|
|
64
|
+
let roles;
|
|
65
|
+
if (raw.roles !== undefined) {
|
|
66
|
+
roles = [];
|
|
67
|
+
const seenRoles = new Set();
|
|
68
|
+
for (const rawRole of raw.roles) {
|
|
69
|
+
const role = typeof rawRole === "string" ? rawRole.trim().toLowerCase() : "";
|
|
70
|
+
if (role.length === 0) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (!RUNTIME_STATUS_ROLE_SET.has(role)) {
|
|
74
|
+
throw new Error(`Invalid status role "${rawRole}". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(", ")}.`);
|
|
75
|
+
}
|
|
76
|
+
if (!seenRoles.has(role)) {
|
|
77
|
+
seenRoles.add(role);
|
|
78
|
+
roles.push(role);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const aliases = raw.aliases === undefined ? undefined : dedupeTokens(raw.aliases).filter((alias) => alias !== id);
|
|
83
|
+
const description = raw.description?.trim();
|
|
84
|
+
const order = typeof raw.order === "number" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : undefined;
|
|
85
|
+
return {
|
|
86
|
+
id,
|
|
87
|
+
roles,
|
|
88
|
+
aliases,
|
|
89
|
+
description: description && description.length > 0 ? description : undefined,
|
|
90
|
+
order,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function selectStatusesArray(parsed) {
|
|
94
|
+
if (Array.isArray(parsed)) {
|
|
95
|
+
return parsed;
|
|
96
|
+
}
|
|
97
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const record = parsed;
|
|
101
|
+
if (Array.isArray(record.statuses)) {
|
|
102
|
+
return record.statuses;
|
|
103
|
+
}
|
|
104
|
+
if (Array.isArray(record.definitions)) {
|
|
105
|
+
return record.definitions;
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
function extractStatusDefinitions(parsed) {
|
|
110
|
+
const candidate = selectStatusesArray(parsed);
|
|
111
|
+
if (!candidate) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
const definitions = [];
|
|
115
|
+
for (const entry of candidate) {
|
|
116
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const record = entry;
|
|
120
|
+
if (typeof record.id !== "string" || record.id.trim().length === 0) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
definitions.push(record);
|
|
124
|
+
}
|
|
125
|
+
return definitions;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile.
|
|
129
|
+
* Accepts the canonical `{ statuses: [...] }` shape, a bare array of
|
|
130
|
+
* definitions, or a `{ definitions: [...] }` form, and tolerates a
|
|
131
|
+
* missing/invalid file by returning an empty statuses list.
|
|
132
|
+
*/
|
|
133
|
+
export function parseStatusDefsFile(raw) {
|
|
134
|
+
if (raw === null || raw === undefined || raw.trim().length === 0) {
|
|
135
|
+
return { statuses: [] };
|
|
136
|
+
}
|
|
137
|
+
let parsed;
|
|
138
|
+
try {
|
|
139
|
+
parsed = JSON.parse(raw);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
throw new Error("schema/statuses.json contains invalid JSON.");
|
|
143
|
+
}
|
|
144
|
+
return { statuses: extractStatusDefinitions(parsed) };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Serializes the status definitions file with a trailing newline (matches the
|
|
148
|
+
* rest of the schema scaffold files written by pm).
|
|
149
|
+
*/
|
|
150
|
+
export function serializeStatusDefsFile(file) {
|
|
151
|
+
return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\n`;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Idempotent UPSERT of a status definition into the parsed file. Matching is by
|
|
155
|
+
* normalized id. When a definition already exists, fields supplied in `input`
|
|
156
|
+
* override the previous values (roles/aliases replace when a non-empty array is
|
|
157
|
+
* given, clear when an explicit empty array is given, and are left UNTOUCHED
|
|
158
|
+
* when the field is `undefined` — i.e. the add-status flag was omitted);
|
|
159
|
+
* description/order override when provided. Fields not addressed by add-status
|
|
160
|
+
* flags are preserved untouched, so `add-status <id> --description x` keeps any
|
|
161
|
+
* previously-set roles/aliases.
|
|
162
|
+
*/
|
|
163
|
+
export function upsertStatusDef(file, input, baseDefinition) {
|
|
164
|
+
const statuses = file.statuses.slice();
|
|
165
|
+
const existingIndex = statuses.findIndex((definition) => normalizeStatusToken(definition.id) === input.id);
|
|
166
|
+
// A file-backed definition is the primary seed; when the status is not yet in
|
|
167
|
+
// statuses.json fall back to `baseDefinition` (the resolved settings-backed
|
|
168
|
+
// definition) so omitting --role/--alias preserves metadata that lives in
|
|
169
|
+
// settings.schema.statuses rather than the file.
|
|
170
|
+
const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;
|
|
171
|
+
const next = {
|
|
172
|
+
...(existing ?? {}),
|
|
173
|
+
id: input.id,
|
|
174
|
+
};
|
|
175
|
+
if (input.roles !== undefined) {
|
|
176
|
+
if (input.roles.length > 0) {
|
|
177
|
+
next.roles = [...input.roles];
|
|
178
|
+
}
|
|
179
|
+
else if (next.roles !== undefined) {
|
|
180
|
+
delete next.roles;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (input.aliases !== undefined) {
|
|
184
|
+
if (input.aliases.length > 0) {
|
|
185
|
+
next.aliases = [...input.aliases];
|
|
186
|
+
}
|
|
187
|
+
else if (next.aliases !== undefined) {
|
|
188
|
+
delete next.aliases;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (input.description !== undefined) {
|
|
192
|
+
next.description = input.description;
|
|
193
|
+
}
|
|
194
|
+
if (input.order !== undefined) {
|
|
195
|
+
next.order = input.order;
|
|
196
|
+
}
|
|
197
|
+
if (existingIndex >= 0) {
|
|
198
|
+
statuses[existingIndex] = next;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
statuses.push(next);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
file: { statuses },
|
|
205
|
+
definition: next,
|
|
206
|
+
// "replaced" reflects whether the status already existed effectively (in the
|
|
207
|
+
// file OR in resolved settings), so the CLI reports "Updated" vs "Registered"
|
|
208
|
+
// correctly even when the prior definition lived only in settings.
|
|
209
|
+
replaced: existing !== undefined,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Removes a status definition from the parsed file by id (normalized). Throws a
|
|
214
|
+
* plain Error when `id` is empty or matches a reserved built-in default status
|
|
215
|
+
* (those are never stored in the file and must never be deletable). Returns
|
|
216
|
+
* `removed: false` when no matching definition exists so the CLI layer can treat
|
|
217
|
+
* the call as an idempotent no-op.
|
|
218
|
+
*/
|
|
219
|
+
export function removeStatusDef(file, id) {
|
|
220
|
+
const normalizedId = normalizeStatusToken(id);
|
|
221
|
+
if (normalizedId.length === 0) {
|
|
222
|
+
throw new Error("Status id must not be empty.");
|
|
223
|
+
}
|
|
224
|
+
if (BUILTIN_STATUS_IDS.has(normalizedId)) {
|
|
225
|
+
throw new Error(`Cannot remove built-in status "${normalizedId}". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(", ")}.`);
|
|
226
|
+
}
|
|
227
|
+
const statuses = file.statuses.slice();
|
|
228
|
+
const existingIndex = statuses.findIndex((definition) => normalizeStatusToken(definition.id) === normalizedId);
|
|
229
|
+
if (existingIndex < 0) {
|
|
230
|
+
return { file: { statuses }, removed: false };
|
|
231
|
+
}
|
|
232
|
+
const [definition] = statuses.splice(existingIndex, 1);
|
|
233
|
+
return { file: { statuses }, removed: true, definition };
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Throws when the new status id or any explicitly-supplied alias collides with a
|
|
237
|
+
* DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized
|
|
238
|
+
* token to its owning status id (the runtime status registry's alias_to_id map,
|
|
239
|
+
* which stores ids and aliases in one namespace). Re-adding the same status
|
|
240
|
+
* (matching id) is allowed — only cross-status collisions throw. This prevents a
|
|
241
|
+
* custom status from shadowing a built-in lifecycle token (for example
|
|
242
|
+
* `add-status review --alias open`, or a custom id `cancelled` that aliases the
|
|
243
|
+
* built-in `canceled`), which would make `pm update --status open` resolve to the
|
|
244
|
+
* wrong status. The CLI layer maps the thrown Error to a USAGE exit code.
|
|
245
|
+
*/
|
|
246
|
+
export function assertStatusTokensAvailable(input, resolvedAliasToId) {
|
|
247
|
+
const candidates = [input.id, ...(input.aliases ?? [])];
|
|
248
|
+
for (const candidate of candidates) {
|
|
249
|
+
const token = normalizeStatusToken(candidate);
|
|
250
|
+
if (token.length === 0) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
const owner = resolvedAliasToId.get(token);
|
|
254
|
+
if (owner !== undefined && owner !== input.id) {
|
|
255
|
+
throw new Error(`Status token "${token}" already belongs to status "${owner}". Choose a different id/alias to avoid shadowing it.`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=status-defs-file.js.map
|
|
260
|
+
//# debugId=d738db07-1d64-5ab0-9ebd-f9c9f6de5706
|