@unbrained/pm-cli 2026.7.6 → 2026.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +3 -3
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +18 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +113 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
- package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-PVCTBVJG.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-2APXX4TZ.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-2LEJGRQ7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-2TILG6F2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-3G6UMXT3.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-3G6UMXT3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-3TYOW6RR.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-3X542TEY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-42LXP4VO.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-42LXP4VO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-43SIHQND.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-43UQN754.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-43UQN754.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-43YSKY75.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-43YSKY75.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-4BKDAEDF.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-4BKDAEDF.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-4IQKDKGE.js} +15 -23
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-4IQKDKGE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-4MZOKTI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-4MZOKTI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-52NS7JDP.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-52NS7JDP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-565WYS5W.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-565WYS5W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-5FIQ4EX3.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-5FIQ4EX3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-6G6O3OPQ.js} +256 -36
- package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-6LCJRGPD.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-6LCJRGPD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-6UQCNWFV.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-6UQCNWFV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-6XTSYPPO.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-7PNQA24K.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-7PNQA24K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-7VQ3JJN5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-7Y5N34HX.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-7Y5N34HX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-AGAVEDIE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-AJUON7E6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-ARKHKYYS.js} +13 -21
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-ARKHKYYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-C5ACVMOI.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-CJQM7O7R.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-CJQM7O7R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-D2DCTFTL.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-D2DCTFTL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-DDDWVPID.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-DDDWVPID.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-DG6BSXZ7.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-DG6BSXZ7.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-DR2V5OIV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-E3LWJUGF.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-E3LWJUGF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-E3YQFSFE.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-E3YQFSFE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EDO7VXSO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-EIUBK2LT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-EIUBK2LT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-EMXPI36L.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-EMXPI36L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-EOUVR7JN.js} +12 -8
- package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-EVEPHNXJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-F6MT7KKE.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-F6MT7KKE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-F6YC2A6X.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-F6YC2A6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-FN6SB4HU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-GLS6VMWI.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-GPIDUMMN.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-GPIDUMMN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-GTM5HQL4.js} +11 -15
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-GTM5HQL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-H2SMKL2N.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-HHEWQXPD.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-HX6QXV5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-I74FMIWA.js} +10 -16
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-I74FMIWA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-IDIBF4E2.js} +20 -24
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-IDIBF4E2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-II7R6KD4.js} +8 -7
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-II7R6KD4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-J7BOLHAV.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-J7BOLHAV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-KTGJ2CBU.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-KTGJ2CBU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-LCFJ7XAM.js} +22 -2
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js.map → chunk-LCFJ7XAM.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-LZQU6XJG.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-LZQU6XJG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-M62RO3XK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-M62RO3XK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-MCEUKJKW.js} +12 -14
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-MCEUKJKW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-MHNMCDWR.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-MRFWUSVA.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-N6ZHDLUY.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-N6ZHDLUY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-NWWL22C7.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-NWWL22C7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-P3MJJW7P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-PDXJXEZJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-Q64AYQYW.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-Q64AYQYW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-QDABF2RB.js} +26 -34
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-QDABF2RB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-QFBSP3NI.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-RB3KLPAH.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-RB3KLPAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-RY7PTTUB.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-S547WBYG.js} +343 -195
- package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-S5BNGFN5.js} +24 -32
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-S5BNGFN5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-S6VC2A2K.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-S6VC2A2K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-SIM5JDON.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-SIM5JDON.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-SY75LYXR.js} +11 -7
- package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-TEISGNSH.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-TEKZOS7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-TGUK6XN6.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-TGUK6XN6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-TNC6MZUD.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-TNC6MZUD.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-UO7XAZK6.js} +17 -4
- package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-V5ZWKJNY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-VGO73OCK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-VGO73OCK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-VLEA2UTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-W5HXHC7C.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-W5HXHC7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-WCWVEXGA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
- package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-XBX5CBRQ.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-XBX5CBRQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XC3X7BQR.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-XHCVAZGM.js} +13 -17
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-XHCVAZGM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-XPMXPR7K.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-XPMXPR7K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-XS2TMNXR.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-XS2TMNXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-XXIYUTLK.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-XXIYUTLK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-XZWL7VNE.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
- package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-Y7KYVCZM.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-Y7KYVCZM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-YCVWWIKY.js} +16 -14
- package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-YH5NBDFA.js} +22 -26
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-YH5NBDFA.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-YPD7SQ5P.js} +7 -6
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-YPD7SQ5P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-YPMZMKN7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-YTD5GICJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-ZNEG2UDO.js} +261 -34
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-ZNEG2UDO.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-ZO7CLOY2.js} +3 -3
- package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-3YYQ5OG2.js} +5 -9
- package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
- package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
- package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
- package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
- package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
- package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-44RT5GDW.js} +4 -8
- package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
- package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-4GWJWPXG.js} +9 -14
- package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
- package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
- package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-YQ2VPXNF.js} +4 -8
- package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-BU5EBJDU.js} +4 -8
- package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
- package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-OQBSJNIA.js} +6 -10
- package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
- package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
- package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-HTSB2KJG.js} +6 -10
- package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-FOG4ALC2.js} +7 -9
- package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-M6IFAMBP.js} +9 -13
- package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
- package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-NQX3OGZP.js} +7 -11
- package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
- package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-NHOJG7WO.js} +9 -13
- package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
- package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-T63JGKKN.js} +9 -11
- package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
- package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
- package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
- package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-TN537L24.js} +10 -15
- package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-MHAMXMHQ.js} +9 -13
- package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-TIGLAKJ7.js} +9 -13
- package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-OHXD7G5N.js} +41 -33
- package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-ZCRABAPN.js} +42 -34
- package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-P3G4XP6Q.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-XX4H56PE.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-XX4H56PE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-V6PIYEDU.js} +79 -46
- package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-V6VKTG54.js} +78 -45
- package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-6RVAWT6W.js} +129 -29
- package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-6YVUSQYD.js} +130 -30
- package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-HC3YSWF7.js} +7 -11
- package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
- package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DAGSYO6E.js} +6 -10
- package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-UBXJCQAC.js} +6 -10
- package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
- package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
- package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
- package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
- package/dist/cli-bundle/main.js +29 -31
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +129 -107
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +122 -117
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +9 -7
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +151 -8
- package/dist/sdk/runtime.js +255 -14
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/SDK.md +35 -0
- package/docs/TESTING.md +3 -0
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
- package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-F7WPGIQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-PVCTBVJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-2LEJGRQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-2TILG6F2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-3TYOW6RR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-3X542TEY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-7VQ3JJN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-AGAVEDIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-AJUON7E6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-DR2V5OIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EDO7VXSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-EVEPHNXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-FN6SB4HU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-H2SMKL2N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-HX6QXV5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-P3MJJW7P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-PDXJXEZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-TEKZOS7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-V5ZWKJNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-VLEA2UTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-WCWVEXGA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-YPMZMKN7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-YTD5GICJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-ZO7CLOY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-3YYQ5OG2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-Z3Q4U7TS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-3L2RXH3M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-D366FTIG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-54XDJNFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-HGHC2PN6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-44RT5GDW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-UGMUGHZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-4GWJWPXG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AZXCUYKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-Y6SXIQ4X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-YQ2VPXNF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-BU5EBJDU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-FMANWFRP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-OQBSJNIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-VNPBZXEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-72HZEBOE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-HTSB2KJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-FOG4ALC2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-SUTMKXGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-M6IFAMBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-NEXRPP2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-NQX3OGZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-CBHMHAJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-NHOJG7WO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-M64NTSOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-T63JGKKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-73WE2UV2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-U7L6HQQ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-OSCNYFGC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-TN537L24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-MHAMXMHQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-TIGLAKJ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-HC3YSWF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-LFAMMRYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DAGSYO6E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-UBXJCQAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-CJGG5WMV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-LKD64AFP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-G4SM7BHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-VLIV3D7R.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
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]="
|
|
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]="b93dbd54-fe76-54fa-b38d-68b476e0af6d")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
resolveAuthor
|
|
5
5
|
} from "./chunk-T5RRNDA7.js";
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
lintProjectProfile,
|
|
8
8
|
resolveProfileCatalog,
|
|
9
9
|
resolveProfileEntry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3TYOW6RR.js";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
parseNestedSettingValue,
|
|
13
|
+
readNestedSettingValue,
|
|
14
|
+
resolveNestedSettingDescriptor,
|
|
15
|
+
writeNestedSettingValue
|
|
16
|
+
} from "./chunk-7LQKVMPA.js";
|
|
14
17
|
import {
|
|
15
18
|
ensureTypeFolderScaffold
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
acquireLock
|
|
19
|
-
} from "./chunk-ENGQOEUY.js";
|
|
19
|
+
} from "./chunk-CJQM7O7R.js";
|
|
20
20
|
import {
|
|
21
21
|
normalizeAddFieldInput,
|
|
22
22
|
normalizeAddStatusInput,
|
|
@@ -26,30 +26,26 @@ import {
|
|
|
26
26
|
serializeStatusDefsFile,
|
|
27
27
|
upsertField,
|
|
28
28
|
upsertStatusDef
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XPMXPR7K.js";
|
|
30
30
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
resolveNestedSettingDescriptor,
|
|
34
|
-
writeNestedSettingValue
|
|
35
|
-
} from "./chunk-7LQKVMPA.js";
|
|
31
|
+
CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS
|
|
32
|
+
} from "./chunk-2APXX4TZ.js";
|
|
36
33
|
import {
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
normalizeAddTypeInput,
|
|
35
|
+
parseItemTypesFile,
|
|
36
|
+
serializeItemTypesFile,
|
|
37
|
+
upsertItemType
|
|
38
|
+
} from "./chunk-VLEA2UTQ.js";
|
|
39
39
|
import {
|
|
40
40
|
PmCliError,
|
|
41
|
+
acquireLock,
|
|
41
42
|
getActiveExtensionRegistrations,
|
|
43
|
+
nowIso,
|
|
42
44
|
readSettings,
|
|
43
45
|
resolveGovernanceKnobs,
|
|
44
46
|
runActiveOnWriteHooks,
|
|
45
47
|
writeSettings
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import {
|
|
48
|
-
normalizeAddTypeInput,
|
|
49
|
-
parseItemTypesFile,
|
|
50
|
-
serializeItemTypesFile,
|
|
51
|
-
upsertItemType
|
|
52
|
-
} from "./chunk-KUOOJR35.js";
|
|
48
|
+
} from "./chunk-GH73UOSJ.js";
|
|
53
49
|
import {
|
|
54
50
|
DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
|
|
55
51
|
EXIT_CODE,
|
|
@@ -60,7 +56,7 @@ import {
|
|
|
60
56
|
readFileIfExists,
|
|
61
57
|
resolvePmRoot,
|
|
62
58
|
writeFileAtomic
|
|
63
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-UO7XAZK6.js";
|
|
64
60
|
|
|
65
61
|
// dist/cli/commands/profile.js
|
|
66
62
|
import path2 from "node:path";
|
|
@@ -779,6 +775,6 @@ export {
|
|
|
779
775
|
formatProfileLintHuman,
|
|
780
776
|
formatProfileApplyHuman
|
|
781
777
|
};
|
|
782
|
-
//# sourceMappingURL=chunk-
|
|
778
|
+
//# sourceMappingURL=chunk-YH5NBDFA.js.map
|
|
783
779
|
|
|
784
|
-
//# debugId=
|
|
780
|
+
//# debugId=b93dbd54-fe76-54fa-b38d-68b476e0af6d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/profile.ts","../../../../../../../../core/profile/profile-describe.ts","../../../../../../../../core/profile/profile-plan.ts","../../../../../../../../cli/commands/templates.ts"],"sourcesContent":["/**\n * @module cli/commands/profile\n *\n * Implements the `pm profile` command surface: listing the built-in project\n * archetypes, showing a profile's full composition, and applying a profile to an\n * initialized tracker. Apply stages item types, custom statuses, custom fields,\n * per-type workflows, config knobs, and create templates idempotently, and\n * surfaces advisory package recommendations. The pure diff lives in\n * {@link module:core/profile/profile-plan}; this module is the I/O orchestration\n * and human formatting around it.\n */\nimport path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, resolveGovernanceKnobs, writeSettings } from \"../../core/store/settings.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport { normalizeAddTypeInput, serializeItemTypesFile } from \"../../core/schema/item-types-file.js\";\nimport { serializeStatusDefsFile } from \"../../core/schema/status-defs-file.js\";\nimport { serializeFieldsFile } from \"../../core/schema/fields-file.js\";\nimport {\n resolveNestedSettingDescriptor,\n writeNestedSettingValue,\n} from \"../../core/config/nested-settings.js\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport {\n resolveProfileCatalog,\n resolveProfileEntry,\n type ExtensionProfileContribution,\n type ProfileSourceKind,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ResolveProfileEntryResult,\n} from \"../../core/profile/profile-presets.js\";\nimport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n} from \"../../core/profile/profile-describe.js\";\nimport {\n lintProjectProfile,\n type ProjectProfileLintFinding,\n} from \"../../core/profile/profile-lint.js\";\nimport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileCurrentState,\n} from \"../../core/profile/profile-plan.js\";\nimport { ensureTypeFolderScaffold } from \"./schema.js\";\nimport { runTemplatesSave } from \"./templates.js\";\n\n/** Ordered `pm profile` subcommands. */\nexport const PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"apply\", \"lint\"] as const;\n/**\n * Restricts profile subcommand values accepted by command, SDK, and storage contracts.\n */\nexport type ProfileSubcommand = (typeof PROFILE_SUBCOMMANDS)[number];\n\nconst PROFILE_TYPES_LOCK_ID = \"schema-types\";\nconst PROFILE_STATUSES_LOCK_ID = \"schema-statuses\";\nconst PROFILE_FIELDS_LOCK_ID = \"schema-fields\";\n\n/**\n * Per-dimension counts summarizing how much a profile stages. Aliases the shared\n * {@link ProjectProfileComposition} so the CLI result shape and the core describe\n * primitive never drift.\n */\nexport type ProfileComposition = ProjectProfileComposition;\n\n/** A single profile entry in the `pm profile list` payload. */\nexport interface ProfileListEntry {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n}\n\n/** Result of `pm profile list`. */\nexport interface ProfileListResult {\n /** Discriminant for the profile result union. */\n action: \"list\";\n /** Built-in profiles in canonical order followed by active extension profiles. */\n profiles: ProfileListEntry[];\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile show <name>`. */\nexport interface ProfileShowResult {\n /** Discriminant for the profile result union. */\n action: \"show\";\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n /** Item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: Array<{ spec: string; reason: string }>;\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Per-dimension change summary in an apply result. */\nexport interface ProfileApplyDimension {\n /** Entry keys that were newly created. */\n added: string[];\n /** Entry keys whose stored value was overwritten. */\n updated: string[];\n /** Entry keys already current (no write). */\n unchanged: string[];\n}\n\n/** Result of `pm profile apply <name>`. */\nexport interface ProfileApplyResult {\n /** Discriminant for the profile result union. */\n action: \"apply\";\n /** Applied profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** True when changes were persisted; false for `--dry-run` or a no-op. */\n applied: boolean;\n /** True when `--dry-run` previewed without writing. */\n dry_run: boolean;\n /** True when at least one dimension stages an add/update. */\n changed: boolean;\n /** Item-type change summary. */\n types: ProfileApplyDimension;\n /** Status change summary. */\n statuses: ProfileApplyDimension;\n /** Field change summary. */\n fields: ProfileApplyDimension;\n /** Workflow change summary. */\n workflows: ProfileApplyDimension;\n /** Config-knob change summary. */\n config: ProfileApplyDimension;\n /** Template change summary. */\n templates: ProfileApplyDimension;\n /** Advisory package recommendations with install status. */\n packages: Array<{ spec: string; reason: string; status: \"installed\" | \"recommended\" }>;\n /** Deduped on-write hook + advisory warnings. */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile lint [name]`. */\nexport interface ProfileLintResult {\n /** Discriminant for the profile result union. */\n action: \"lint\";\n /** Linted profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** True when the profile produced no error-severity findings. */\n ok: boolean;\n /** Count of error-severity findings. */\n error_count: number;\n /** Count of warning-severity findings. */\n warning_count: number;\n /** Every graded consistency finding in dimension order. */\n findings: ProjectProfileLintFinding[];\n /** Non-fatal catalog merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Discriminated union of every `pm profile` result shape. */\nexport type ProfileResult = ProfileListResult | ProfileShowResult | ProfileApplyResult | ProfileLintResult;\n\n/* c8 ignore start -- profile command I/O orchestration and formatting is covered by profile integration workflows; the idempotent diff is unit-tested in core/profile/profile-plan. */\n\n/**\n * Collects the profiles contributed by active extensions, mapping the live\n * registration registry onto the resolver's contribution shape. Returns an empty\n * list when extensions are disabled or none registered a profile.\n */\nfunction collectExtensionProfileContributions(): ExtensionProfileContribution[] {\n const registrations = getActiveExtensionRegistrations();\n if (registrations === null) {\n return [];\n }\n return registrations.profiles.map((entry) => ({ name: entry.name, profile: entry.profile }));\n}\n\n/**\n * Lists every available profile — the built-in archetypes followed by profiles\n * contributed by active extensions — with per-dimension composition counts and\n * the source each came from. Surfaces any non-fatal merge collisions as warnings.\n */\nexport function runProfileList(): ProfileListResult {\n const { profiles, warnings } = resolveProfileCatalog(collectExtensionProfileContributions());\n return {\n action: \"list\",\n profiles: profiles.map((resolved) => ({\n name: resolved.definition.name,\n title: resolved.definition.title,\n summary: resolved.definition.summary,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n composition: describeProfileComposition(resolved.definition),\n })),\n warnings,\n generated_at: nowIso(),\n };\n}\n\n/**\n * Shows the full composition of a single profile, resolved across built-in and\n * extension-contributed archetypes. Throws a USAGE error for a missing or unknown\n * profile name.\n */\nexport function runProfileShow(name: string | undefined): ProfileShowResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n const { resolved } = entry;\n return {\n action: \"show\",\n ...describeProjectProfile(resolved.definition),\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/**\n * Lints a single profile, resolved across built-in and extension-contributed\n * archetypes, returning every graded consistency finding plus any catalog merge\n * warnings. Throws a USAGE error for a missing or unknown profile name. This is\n * the read-only author-time validation surface; it never writes to the tracker.\n */\nexport function runProfileLint(name: string | undefined): ProfileLintResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n const { resolved } = entry;\n const report = lintProjectProfile(resolved.definition);\n return {\n action: \"lint\",\n name: resolved.definition.name,\n title: resolved.definition.title,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n ok: report.ok,\n error_count: report.errorCount,\n warning_count: report.warningCount,\n findings: report.findings,\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Options accepted by {@link runProfileApply}. */\nexport interface ProfileApplyCommandOptions {\n /** Preview the diff without writing any files. */\n dryRun?: boolean;\n /** Mutation author override. */\n author?: string;\n /** Force ownership/lock override. */\n force?: boolean;\n}\n\nfunction templateFilePath(pmRoot: string, name: string): string {\n return path.join(pmRoot, \"templates\", `${name}.json`);\n}\n\nasync function readStoredTemplateOptions(pmRoot: string, name: string): Promise<ProfileTemplateOptions | undefined> {\n const raw = await readFileIfExists(templateFilePath(pmRoot, name));\n if (raw === null) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n const options = (parsed as { options?: unknown }).options;\n if (options !== null && typeof options === \"object\" && !Array.isArray(options)) {\n return options as ProfileTemplateOptions;\n }\n }\n } catch {\n // A malformed template file is treated as absent so apply re-stages it.\n }\n return undefined;\n}\n\nasync function loadProfileCurrentState(\n pmRoot: string,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n profile: ProjectProfileDefinition,\n): Promise<ProfileCurrentState> {\n const templates = new Map<string, ProfileTemplateOptions>();\n for (const template of profile.templates) {\n const stored = await readStoredTemplateOptions(pmRoot, template.name);\n if (stored !== undefined) {\n templates.set(template.name, stored);\n }\n }\n return {\n typesRaw: await readFileIfExists(filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types)),\n statusesRaw: await readFileIfExists(\n filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n ),\n fieldsRaw: await readFileIfExists(\n filePathForSchemaSection(pmRoot, schema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n ),\n workflows: settings.schema.type_workflows ?? [],\n settings,\n templates,\n // Package recommendations are advisory: apply never installs and never\n // inspects install state, so every recommendation surfaces as \"recommended\".\n // The planner still supports an install-state set for SDK consumers that want\n // richer reporting.\n installedPackages: new Set<string>(),\n };\n}\n\nfunction dimensionFrom(changes: ReadonlyArray<{ key: string; status: ProfileChangeStatus }>): ProfileApplyDimension {\n const added: string[] = [];\n const updated: string[] = [];\n const unchanged: string[] = [];\n for (const change of changes) {\n (change.status === \"add\" ? added : change.status === \"update\" ? updated : unchanged).push(change.key);\n }\n return { added, updated, unchanged };\n}\n\nfunction buildApplyResult(\n profile: ProjectProfileDefinition,\n plan: ProfileApplicationPlan,\n applied: boolean,\n dryRun: boolean,\n warnings: string[],\n): ProfileApplyResult {\n return {\n action: \"apply\",\n name: profile.name,\n title: profile.title,\n applied,\n dry_run: dryRun,\n changed: plan.changed,\n types: dimensionFrom(plan.types.changes),\n statuses: dimensionFrom(plan.statuses.changes),\n fields: dimensionFrom(plan.fields.changes),\n workflows: dimensionFrom(plan.workflows.changes.map((change) => ({ key: change.type, status: change.status }))),\n config: dimensionFrom(plan.config.changes),\n templates: dimensionFrom(plan.templates.changes.map((change) => ({ key: change.name, status: change.status }))),\n packages: plan.packages,\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nasync function assertProfileTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nfunction resolveProfileForCommand(name: string | undefined): { profile: ProjectProfileDefinition; warnings: string[] } {\n try {\n const entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n return {\n profile: entry.resolved.definition,\n warnings: entry.warnings,\n };\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Applies a profile to the initialized tracker, or previews the idempotent diff\n * when `dryRun` is set. Schema files are written under their respective locks;\n * config and workflows are persisted to settings; templates are staged via the\n * shared template writer. Re-applying an already-applied profile performs zero\n * writes. Throws a USAGE error for an unknown profile or an invalid config knob,\n * and a NOT_FOUND error when the tracker is not initialized.\n */\nexport async function runProfileApply(\n name: string | undefined,\n options: ProfileApplyCommandOptions,\n global: GlobalOptions,\n): Promise<ProfileApplyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await assertProfileTrackerInitialized(pmRoot);\n\n // Catalog-level merge warnings (e.g. an extension profile shadowed by a\n // built-in) seed the result so `apply` surfaces them the same way `list`\n // does, rather than silently swallowing them.\n const resolvedProfile = resolveProfileForCommand(name);\n const profile = resolvedProfile.profile;\n const mergeWarnings = resolvedProfile.warnings;\n\n const dryRun = options.dryRun === true;\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n\n if (dryRun) {\n const state = await loadProfileCurrentState(pmRoot, schema, settings, profile);\n const plan = planProfile(profile, state);\n return buildApplyResult(profile, plan, false, true, [...mergeWarnings]);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n const force = Boolean(options.force);\n const warnings: string[] = [...mergeWarnings];\n\n // Acquire all three schema locks inside the try so a later acquisition that\n // throws (held/stale lock without --force) still releases the earlier ones in\n // finally rather than stranding them until TTL expiry.\n const releasers: Array<() => Promise<void>> = [];\n const acquire = async (lockId: string): Promise<void> => {\n releasers.push(\n await acquireLock(\n pmRoot,\n lockId,\n settings.locks.ttl_seconds,\n author,\n force,\n governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n ),\n );\n };\n let plan: ProfileApplicationPlan;\n try {\n await acquire(PROFILE_TYPES_LOCK_ID);\n await acquire(PROFILE_STATUSES_LOCK_ID);\n await acquire(PROFILE_FIELDS_LOCK_ID);\n const state = await loadProfileCurrentState(pmRoot, schema, settings, profile);\n plan = planProfile(profile, state);\n\n if (plan.types.changed) {\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n await writeFileAtomic(typesPath, serializeItemTypesFile(plan.types.file));\n const stagedNames = new Set(profile.types.map((type) => normalizeAddTypeInput(type).name));\n const stagedDefinitions = plan.types.file.definitions.filter((definition) => stagedNames.has(definition.name));\n await ensureTypeFolderScaffold(pmRoot, stagedDefinitions, warnings, \"profile:apply-type-folder\");\n warnings.push(...(await runActiveOnWriteHooks({ path: typesPath, scope: \"project\", op: \"profile:apply-types\" })));\n }\n if (plan.statuses.changed) {\n const statusesPath = filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(plan.statuses.file));\n warnings.push(...(await runActiveOnWriteHooks({ path: statusesPath, scope: \"project\", op: \"profile:apply-statuses\" })));\n }\n if (plan.fields.changed) {\n const fieldsPath = filePathForSchemaSection(pmRoot, schema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n await writeFileAtomic(fieldsPath, serializeFieldsFile(plan.fields.file));\n warnings.push(...(await runActiveOnWriteHooks({ path: fieldsPath, scope: \"project\", op: \"profile:apply-fields\" })));\n }\n if (plan.config.changed || plan.workflows.changed) {\n for (const change of plan.config.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n const descriptor = resolveNestedSettingDescriptor(change.key);\n if (descriptor !== undefined) {\n writeNestedSettingValue(settings as unknown as Record<string, unknown>, descriptor, change.value);\n }\n }\n settings.schema.type_workflows = plan.workflows.result;\n await writeSettings(pmRoot, settings, \"profile:apply-config\");\n }\n for (const change of plan.templates.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n await runTemplatesSave(change.name, { ...change.options }, global);\n }\n } finally {\n // Release in reverse acquisition order; only locks actually acquired are\n // present. Each release is best-effort so one rejecting release never strands\n // the remaining locks (a failed release falls back to TTL expiry).\n for (const release of releasers.reverse()) {\n try {\n await release();\n } catch {\n // Ignore: a failed lock release is non-fatal and self-heals at TTL.\n }\n }\n }\n\n return buildApplyResult(profile, plan, plan.changed, false, warnings);\n}\n\n// planProfileApplication can throw a plain Error for an invalid config knob; map\n// it to a USAGE exit code consistently across the dry-run and apply paths.\nfunction planProfile(profile: ProjectProfileDefinition, state: ProfileCurrentState): ProfileApplicationPlan {\n try {\n return planProfileApplication(profile, state);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n}\n\nfunction formatDimensionLine(label: string, dimension: ProfileApplyDimension): string | undefined {\n const segments: string[] = [];\n if (dimension.added.length > 0) {\n segments.push(`+${dimension.added.join(\", \")}`);\n }\n if (dimension.updated.length > 0) {\n segments.push(`~${dimension.updated.join(\", \")}`);\n }\n if (segments.length === 0) {\n return undefined;\n }\n return ` ${label}: ${segments.join(\" \")}`;\n}\n\n/**\n * Renders the `pm profile list` result as human-readable text.\n */\nexport function formatProfileListHuman(result: ProfileListResult): string {\n const lines = [\"Project profiles:\"];\n for (const profile of result.profiles) {\n const origin = profile.source === \"extension\" ? ` [${profile.package ?? \"extension\"}]` : \"\";\n lines.push(` ${profile.name} — ${profile.title}: ${profile.summary}${origin}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile show` result as human-readable text.\n */\nexport function formatProfileShowHuman(result: ProfileShowResult): string {\n const origin = result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n const lines = [`${result.name} — ${result.title}${origin}`, result.summary, \"\"];\n lines.push(`types: ${result.types.join(\", \") || \"(none)\"}`);\n lines.push(`statuses: ${result.statuses.join(\", \") || \"(none)\"}`);\n lines.push(`fields: ${result.fields.join(\", \") || \"(none)\"}`);\n lines.push(`workflows: ${result.workflows.join(\", \") || \"(none)\"}`);\n lines.push(`config: ${result.config.join(\", \") || \"(none)\"}`);\n lines.push(`templates: ${result.templates.join(\", \") || \"(none)\"}`);\n lines.push(`packages: ${result.packages.map((pkg) => pkg.spec).join(\", \") || \"(none)\"}`);\n for (const warning of result.warnings) {\n lines.push(`warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile lint` result as human-readable text: a one-line verdict\n * followed by each finding prefixed with its severity, code, and dimension.\n */\nexport function formatProfileLintHuman(result: ProfileLintResult): string {\n const origin = result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n // Catalog merge warnings are rendered below alongside lint-finding warnings, so\n // fold them into the headline count to avoid an \"ok (0 warnings)\" verdict that\n // is immediately followed by `warning:` lines.\n const totalWarningCount = result.warning_count + result.warnings.length;\n const verdict = result.ok\n ? `Profile ${result.name}${origin}: ok (${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"})`\n : `Profile ${result.name}${origin}: ${result.error_count} error${result.error_count === 1 ? \"\" : \"s\"}, ${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"}`;\n const lines = [verdict];\n for (const finding of result.findings) {\n const target = finding.target !== undefined ? ` (${finding.target})` : \"\";\n lines.push(` ${finding.severity} [${finding.code}] ${finding.dimension}${target}: ${finding.message}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile apply` result as human-readable text, including the\n * staged diff and any package recommendations.\n */\nexport function formatProfileApplyHuman(result: ProfileApplyResult): string {\n const mode = result.dry_run ? \"dry-run\" : result.applied ? \"applied\" : \"no changes\";\n const lines = [`Profile ${result.name} (${mode})`];\n if (!result.changed) {\n lines.push(\" already up to date\");\n } else {\n for (const [label, dimension] of [\n [\"types\", result.types],\n [\"statuses\", result.statuses],\n [\"fields\", result.fields],\n [\"workflows\", result.workflows],\n [\"config\", result.config],\n [\"templates\", result.templates],\n ] as const) {\n const line = formatDimensionLine(label, dimension);\n if (line !== undefined) {\n lines.push(line);\n }\n }\n }\n const recommended = result.packages.filter((pkg) => pkg.status === \"recommended\");\n if (recommended.length > 0) {\n lines.push(` recommended packages: ${recommended.map((pkg) => pkg.spec).join(\", \")}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n","/**\n * @module core/profile/profile-describe\n *\n * Author-time *describe* primitive for a {@link ProjectProfileDefinition}: the\n * project-profile analogue of the extension surface's `describeExtensionBlueprint`.\n * It distills a profile into a deterministic, side-effect-free summary — the\n * per-dimension counts plus the resolved entry identifiers — so the CLI\n * `pm profile show`/`list` formatters and SDK consumers share one source of truth\n * for \"what does this profile stage?\" rather than each recomputing it inline.\n *\n * Identifier derivation deliberately mirrors what {@link module:core/profile/profile-plan}\n * upserts: item type names, status ids, and field keys all flow through the same\n * `normalizeAddTypeInput` / `normalizeAddStatusInput` / `normalizeAddFieldInput`\n * canonicalization the planner uses, so describe reports the exact ids/keys\n * `pm profile apply` stages (not the author's raw casing/spelling). Workflows,\n * config, templates, and packages surface their authored identity verbatim.\n *\n * Describe is intentionally lenient: it feeds read-only `pm profile show`/`list`,\n * so a semantically-invalid entry from an untrusted extension-contributed profile\n * (a built-in-named or empty type/status/field the normalizer rejects) falls back\n * to its raw identifier rather than throwing — surfacing the actual defect is the\n * job of {@link module:core/profile/profile-lint lintProjectProfile}, not describe.\n */\nimport { normalizeAddFieldInput } from \"../schema/fields-file.js\";\nimport { normalizeAddStatusInput } from \"../schema/status-defs-file.js\";\nimport { normalizeAddTypeInput } from \"../schema/item-types-file.js\";\nimport type { ProjectProfileDefinition } from \"./profile-presets.js\";\n\n/** Per-dimension counts summarizing how much a profile stages. */\nexport interface ProjectProfileComposition {\n /** Number of item types the profile registers. */\n types: number;\n /** Number of custom statuses. */\n statuses: number;\n /** Number of custom fields. */\n fields: number;\n /** Number of per-type workflows. */\n workflows: number;\n /** Number of config knobs. */\n config: number;\n /** Number of create templates. */\n templates: number;\n /** Number of recommended packages. */\n packages: number;\n}\n\n/** A package recommendation distilled to its spec and rationale. */\nexport interface ProjectProfilePackageSummary {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n}\n\n/** Deterministic summary of a profile's composition produced by {@link describeProjectProfile}. */\nexport interface ProjectProfileDescription {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Per-dimension counts. */\n composition: ProjectProfileComposition;\n /** Canonical item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: ProjectProfilePackageSummary[];\n}\n\n/**\n * Computes the per-dimension counts for a profile.\n */\nexport function describeProfileComposition(profile: ProjectProfileDefinition): ProjectProfileComposition {\n return {\n types: profile.types.length,\n statuses: profile.statuses.length,\n fields: profile.fields.length,\n workflows: profile.workflows.length,\n config: profile.config.length,\n templates: profile.templates.length,\n packages: profile.packages.length,\n };\n}\n\n/**\n * Distills a profile definition into a deterministic composition summary. Pure\n * and tracker-independent; the resolved identifiers match exactly what\n * `pm profile apply` stages for each dimension.\n *\n * @param profile The profile definition to describe.\n * @returns The profile's metadata, per-dimension counts, and resolved entry\n * identifiers.\n */\nexport function describeProjectProfile(profile: ProjectProfileDefinition): ProjectProfileDescription {\n return {\n name: profile.name,\n title: profile.title,\n summary: profile.summary,\n composition: describeProfileComposition(profile),\n types: profile.types.map((type) =>\n lenientIdentifier(() => normalizeAddTypeInput(type).name, () => String(type.name ?? \"\")),\n ),\n statuses: profile.statuses.map((status) =>\n lenientIdentifier(() => normalizeAddStatusInput(status).id, () => String(status.id ?? \"\")),\n ),\n fields: profile.fields.map((field) =>\n lenientIdentifier(() => normalizeAddFieldInput(field).key, () => String(field.key ?? \"\")),\n ),\n workflows: profile.workflows.map((workflow) => workflow.type),\n config: profile.config.map((entry) => `${entry.key}=${entry.value}`),\n templates: profile.templates.map((template) => template.name),\n packages: profile.packages.map((recommendation) => ({ spec: recommendation.spec, reason: recommendation.reason })),\n };\n}\n\n/**\n * Resolves a dimension entry's identifier through the planner's canonicalizing\n * normalizer so describe reports exactly what `pm profile apply` stages, falling\n * back to the entry's raw identifier when the normalizer rejects a semantically\n * invalid value (a built-in-named or empty type/status/field) — surfacing the\n * defect is the job of {@link module:core/profile/profile-lint}, not describe.\n */\nfunction lenientIdentifier(normalize: () => string, raw: () => string): string {\n try {\n return normalize();\n } catch {\n return raw();\n }\n}\n","/**\n * @module core/profile/profile-plan\n *\n * Pure planning for `pm profile apply`. Given a {@link ProjectProfileDefinition}\n * and a snapshot of the current tracker state, computes an idempotent diff across\n * every profile dimension (item types, statuses, fields, per-type workflows,\n * config knobs, templates, and package recommendations) without touching disk.\n *\n * Idempotency is structural: each schema component is upserted onto a clone and\n * the canonical serialization is compared before/after, so re-running `apply`\n * against an already-applied profile reports every entry as `unchanged` and the\n * command performs zero writes. The resulting files/settings the planner returns\n * are exactly what the apply step persists, guaranteeing the dry-run preview and\n * the real mutation never diverge.\n */\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n type ItemTypesFile,\n} from \"../schema/item-types-file.js\";\nimport {\n normalizeAddStatusInput,\n parseStatusDefsFile,\n serializeStatusDefsFile,\n upsertStatusDef,\n type StatusDefsFile,\n} from \"../schema/status-defs-file.js\";\nimport {\n normalizeAddFieldInput,\n parseFieldsFile,\n serializeFieldsFile,\n upsertField,\n type FieldsFile,\n} from \"../schema/fields-file.js\";\nimport {\n parseNestedSettingValue,\n readNestedSettingValue,\n resolveNestedSettingDescriptor,\n} from \"../config/nested-settings.js\";\nimport type { TypeWorkflowDefinition } from \"../../types.js\";\nimport type {\n ProfileTemplateOptions,\n ProjectProfileDefinition,\n} from \"./profile-presets.js\";\n\n/** Per-entry change classification used across every profile dimension. */\nexport type ProfileChangeStatus = \"add\" | \"update\" | \"unchanged\";\n\n/** A single staged change keyed by its component identifier. */\nexport interface ProfileComponentChange {\n /** Component identity (type name, status id, field key, etc.). */\n key: string;\n /** Whether the entry is new, an overwrite, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for a file-backed schema component (types/statuses/fields). */\nexport interface ProfileSchemaPlan<TFile> {\n /** Serialized file content to persist when `changed`. */\n file: TFile;\n /** Per-entry classifications in profile order. */\n changes: ProfileComponentChange[];\n /** True when at least one entry is add/update. */\n changed: boolean;\n}\n\n/** A staged per-type workflow change plus the merged result list. */\nexport interface ProfileWorkflowChange {\n /** Item type the workflow governs. */\n type: string;\n /** Whether the workflow is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the `schema.type_workflows` settings subtree. */\nexport interface ProfileWorkflowPlan {\n /** Per-workflow classifications in profile order. */\n changes: ProfileWorkflowChange[];\n /** Full merged workflow list to persist when `changed`. */\n result: TypeWorkflowDefinition[];\n /** True when at least one workflow is add/update. */\n changed: boolean;\n}\n\n/** A staged config knob plus the resolved settings path and typed value. */\nexport interface ProfileConfigChange {\n /** Descriptor key (snake_case). */\n key: string;\n /** Dotted PmSettings path the value writes to. */\n path: string;\n /** Typed leaf value to persist. */\n value: string | number | boolean;\n /** Whether the leaf is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the nested-settings knobs a profile stages. */\nexport interface ProfileConfigPlan {\n /** Per-knob classifications in profile order. */\n changes: ProfileConfigChange[];\n /** True when at least one knob is add/update. */\n changed: boolean;\n}\n\n/** A staged create-template change. */\nexport interface ProfileTemplateChange {\n /** Template name. */\n name: string;\n /** Option payload to persist for the template. */\n options: ProfileTemplateOptions;\n /** Whether the template is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the create templates a profile stages. */\nexport interface ProfileTemplatePlan {\n /** Per-template classifications in profile order. */\n changes: ProfileTemplateChange[];\n /** True when at least one template is add/update. */\n changed: boolean;\n}\n\n/** Advisory package recommendation with install status. */\nexport interface ProfilePackagePlan {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n /** `installed` when already present, otherwise `recommended`. */\n status: \"installed\" | \"recommended\";\n}\n\n/** Current tracker state the planner diffs the profile against. */\nexport interface ProfileCurrentState {\n /** Raw `schema/types.json` content (or null when absent). */\n typesRaw: string | null;\n /** Raw status-defs file content (or null when absent). */\n statusesRaw: string | null;\n /** Raw fields file content (or null when absent). */\n fieldsRaw: string | null;\n /** Current `schema.type_workflows` entries. */\n workflows: readonly TypeWorkflowDefinition[];\n /** Settings object used to read current config leaf values. */\n settings: unknown;\n /** Existing stored template options keyed by template name. */\n templates: ReadonlyMap<string, ProfileTemplateOptions>;\n /** Install specs/aliases already present in the project. */\n installedPackages: ReadonlySet<string>;\n}\n\n/** Complete idempotent plan for applying a profile. */\nexport interface ProfileApplicationPlan {\n /** Identifying metadata for the planned profile. */\n profile: { name: string; title: string; summary: string };\n /** Item-type plan. */\n types: ProfileSchemaPlan<ItemTypesFile>;\n /** Status plan. */\n statuses: ProfileSchemaPlan<StatusDefsFile>;\n /** Field plan. */\n fields: ProfileSchemaPlan<FieldsFile>;\n /** Per-type workflow plan. */\n workflows: ProfileWorkflowPlan;\n /** Config-knob plan. */\n config: ProfileConfigPlan;\n /** Template plan. */\n templates: ProfileTemplatePlan;\n /** Advisory package recommendations. */\n packages: ProfilePackagePlan[];\n /** True when any dimension stages an add/update. */\n changed: boolean;\n}\n\n/**\n * Plans a file-backed schema component by upserting each normalized input onto a\n * working clone and comparing canonical serializations to classify add/update/\n * unchanged. Shared by the type, status, and field planners.\n */\nfunction planSchemaComponent<TInput, TFile>(\n initialFile: TFile,\n inputs: readonly TInput[],\n keyOf: (input: TInput) => string,\n serialize: (file: TFile) => string,\n upsert: (file: TFile, input: TInput) => { file: TFile; replaced: boolean },\n): ProfileSchemaPlan<TFile> {\n let file = initialFile;\n const changes: ProfileComponentChange[] = [];\n for (const input of inputs) {\n const before = serialize(file);\n const result = upsert(file, input);\n const after = serialize(result.file);\n file = result.file;\n const status: ProfileChangeStatus = before === after ? \"unchanged\" : result.replaced ? \"update\" : \"add\";\n changes.push({ key: keyOf(input), status });\n }\n return { file, changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Canonicalizes an allowed-transition list to an order-independent string. The\n * transitions are a set of `[from, to]` pairs, so a stored list that merely\n * reorders the same pairs must not register as a spurious `update`.\n */\nfunction canonicalTransitions(transitions: readonly [string, string][]): string {\n return JSON.stringify(transitions.map((pair) => pair.join(\"\u0000\")).sort());\n}\n\n/**\n * Plans the per-type workflow merge. A workflow whose transition set matches the\n * current entry (order-independent) is `unchanged`; a new type is `add`; a\n * changed transition set is `update`. The merged result preserves untouched\n * entries.\n */\nfunction planWorkflows(\n current: readonly TypeWorkflowDefinition[],\n desired: readonly TypeWorkflowDefinition[],\n): ProfileWorkflowPlan {\n const result = current.map((entry) => ({ ...entry }));\n const changes: ProfileWorkflowChange[] = [];\n for (const workflow of desired) {\n const index = result.findIndex((entry) => entry.type === workflow.type);\n const next: TypeWorkflowDefinition = { type: workflow.type, allowed_transitions: workflow.allowed_transitions };\n if (index < 0) {\n result.push(next);\n changes.push({ type: workflow.type, status: \"add\" });\n } else if (canonicalTransitions(result[index].allowed_transitions) === canonicalTransitions(workflow.allowed_transitions)) {\n changes.push({ type: workflow.type, status: \"unchanged\" });\n } else {\n result[index] = next;\n changes.push({ type: workflow.type, status: \"update\" });\n }\n }\n return { changes, result, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Plans config knobs by resolving each descriptor, coercing the value, and\n * comparing it against the current settings leaf. Throws a plain Error for an\n * unknown key or invalid value so the CLI can map it to a USAGE exit code.\n */\nfunction planConfig(profile: ProjectProfileDefinition, settings: unknown): ProfileConfigPlan {\n const changes: ProfileConfigChange[] = [];\n for (const entry of profile.config) {\n const descriptor = resolveNestedSettingDescriptor(entry.key);\n if (descriptor === undefined) {\n throw new Error(`Profile \"${profile.name}\" references unknown config key \"${entry.key}\".`);\n }\n const parsed = parseNestedSettingValue(descriptor, entry.value);\n if (!parsed.ok) {\n throw new Error(`Profile \"${profile.name}\" config ${entry.key}: ${parsed.error.message}`);\n }\n // readNestedSettingValue returns `null` (never `undefined`) when the leaf is\n // absent, so a null current is an unambiguous \"add\".\n const current = readNestedSettingValue(settings, descriptor);\n const status: ProfileChangeStatus =\n current === null ? \"add\" : current === parsed.parsed.value ? \"unchanged\" : \"update\";\n changes.push({ key: descriptor.key, path: descriptor.path, value: parsed.parsed.value, status });\n }\n return { changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Canonicalizes a template option payload to a key-order-independent string so a\n * profile's authored option order never produces a spurious `update` against the\n * key-sorted form `pm templates save` persists.\n */\nfunction canonicalTemplateOptions(options: ProfileTemplateOptions): string {\n const sorted = Object.entries(options).sort(([left], [right]) => left.localeCompare(right));\n return JSON.stringify(sorted);\n}\n\n/**\n * Plans create templates by comparing each profile template's option payload\n * against the stored template (if any). Equality is canonical so option key\n * ordering never produces a spurious `update`.\n */\nfunction planTemplates(\n profile: ProjectProfileDefinition,\n existing: ReadonlyMap<string, ProfileTemplateOptions>,\n): ProfileTemplatePlan {\n const changes: ProfileTemplateChange[] = [];\n for (const template of profile.templates) {\n const current = existing.get(template.name);\n let status: ProfileChangeStatus;\n if (current === undefined) {\n status = \"add\";\n } else if (canonicalTemplateOptions(current) === canonicalTemplateOptions(template.options)) {\n status = \"unchanged\";\n } else {\n status = \"update\";\n }\n changes.push({ name: template.name, options: template.options, status });\n }\n return { changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Computes the complete idempotent application plan for a profile against the\n * supplied tracker snapshot. The returned files/settings are exactly what the\n * apply step persists; nothing here touches disk.\n */\nexport function planProfileApplication(\n profile: ProjectProfileDefinition,\n current: ProfileCurrentState,\n): ProfileApplicationPlan {\n const types = planSchemaComponent(\n parseItemTypesFile(current.typesRaw),\n profile.types,\n (input) => normalizeAddTypeInput(input).name,\n serializeItemTypesFile,\n (file, input) => upsertItemType(file, normalizeAddTypeInput(input)),\n );\n const statuses = planSchemaComponent(\n parseStatusDefsFile(current.statusesRaw),\n profile.statuses,\n (input) => normalizeAddStatusInput(input).id,\n serializeStatusDefsFile,\n (file, input) => upsertStatusDef(file, normalizeAddStatusInput(input)),\n );\n const fields = planSchemaComponent(\n parseFieldsFile(current.fieldsRaw),\n profile.fields,\n (input) => normalizeAddFieldInput(input).key,\n serializeFieldsFile,\n (file, input) => upsertField(file, normalizeAddFieldInput(input)),\n );\n const workflows = planWorkflows(current.workflows, profile.workflows);\n const config = planConfig(profile, current.settings);\n const templates = planTemplates(profile, current.templates);\n const packages = profile.packages.map((recommendation) => ({\n spec: recommendation.spec,\n reason: recommendation.reason,\n status: current.installedPackages.has(recommendation.spec) ? (\"installed\" as const) : (\"recommended\" as const),\n }));\n const changed = types.changed || statuses.changed || fields.changed || workflows.changed || config.changed || templates.changed;\n return {\n profile: { name: profile.name, title: profile.title, summary: profile.summary },\n types,\n statuses,\n fields,\n workflows,\n config,\n templates,\n packages,\n changed,\n };\n}\n","/**\n * @module cli/commands/templates\n *\n * Implements the pm templates command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport {\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n} from \"../../sdk/cli-contracts.js\";\n\nconst TEMPLATE_DIRECTORY_NAME = \"templates\";\nconst TEMPLATE_FILE_EXTENSION = \".json\";\nconst TEMPLATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\n\nconst TEMPLATE_OPTION_REPEATABLE_KEYS = CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.map((entry) => entry.target);\nconst TEMPLATE_OPTION_REPEATABLE_KEY_SET = new Set<string>(TEMPLATE_OPTION_REPEATABLE_KEYS);\n\ntype TemplateOptionValue = string | string[];\n/**\n * Restricts create template options values accepted by command, SDK, and storage contracts.\n */\nexport type CreateTemplateOptions = Record<string, TemplateOptionValue>;\n/**\n * Restricts template source values accepted by command, SDK, and storage contracts.\n */\nexport type TemplateSource = \"builtin\" | \"user\";\n\nconst BUILTIN_TEMPLATE_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst BUILTIN_TEMPLATES: Readonly<Record<string, CreateTemplateOptions>> = {\n bug: {\n type: \"Issue\",\n priority: \"1\",\n tags: \"bug\",\n acceptanceCriteria: \"Bug no longer reproduces with the steps below and a regression test guards it.\",\n expectedResult: \"Describe the correct behavior.\",\n actualResult: \"Describe the observed (buggy) behavior.\",\n body: \"## Repro steps\\n1. \\n2. \\n3. \\n\\n## Expected\\n\\n## Actual\\n\",\n },\n feature: {\n type: \"Feature\",\n priority: \"2\",\n tags: \"feature\",\n acceptanceCriteria: \"Feature is shipped behind agreed scope with tests and docs updated.\",\n whyNow: \"Explain why this is worth doing now (impact / urgency).\",\n body: \"## Goal\\n\\n## Why now\\n\\n## Out of scope\\n\",\n },\n spike: {\n type: \"Task\",\n priority: \"2\",\n tags: \"spike\",\n estimatedMinutes: \"120\",\n acceptanceCriteria: \"Timeboxed investigation complete; findings and a recommendation are recorded.\",\n body: \"## Question to answer\\n\\n## Timebox\\n2h\\n\\n## Findings\\n\\n## Recommendation\\n\",\n },\n chore: {\n type: \"Chore\",\n priority: \"3\",\n tags: \"chore\",\n acceptanceCriteria: \"Maintenance task done with no behavior change and green checks.\",\n body: \"## What\\n\\n## Why\\n\",\n },\n};\n\ninterface StoredCreateTemplateDocument {\n name: string;\n created_at: string;\n updated_at: string;\n options: CreateTemplateOptions;\n}\n\nexport const _testOnly = {\n normalizeTemplateName,\n extractTemplateOptions,\n parseStoredTemplateDocument,\n builtinTemplateDocument,\n readStoredTemplateDocument,\n};\n\n/**\n * Documents the templates save result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesSaveResult {\n name: string;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\n/**\n * Documents the templates list result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesListResult {\n templates: string[];\n count: number;\n builtin_templates: string[];\n user_templates: string[];\n}\n\n/**\n * Documents the templates show result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesShowResult {\n name: string;\n source: TemplateSource;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\nfunction normalizeTemplateName(rawName: string): string {\n const name = rawName.trim();\n if (!TEMPLATE_NAME_PATTERN.test(name)) {\n throw new PmCliError(\n `Invalid template name \"${rawName}\". Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._-]*.`,\n EXIT_CODE.USAGE,\n );\n }\n return name;\n}\n\nfunction templatesDirectory(pmRoot: string): string {\n return path.join(pmRoot, TEMPLATE_DIRECTORY_NAME);\n}\n\nfunction templatePath(pmRoot: string, normalizedName: string): string {\n return path.join(templatesDirectory(pmRoot), `${normalizedName}${TEMPLATE_FILE_EXTENSION}`);\n}\n\nasync function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nfunction sortTemplateOptions(options: CreateTemplateOptions): CreateTemplateOptions {\n return Object.fromEntries(\n Object.entries(options).sort(([left], [right]) => left.localeCompare(right)),\n ) as CreateTemplateOptions;\n}\n\nfunction extractTemplateOptions(rawOptions: Record<string, unknown>): CreateTemplateOptions {\n const next: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(rawOptions)) {\n if (value === undefined) {\n continue;\n }\n if (TEMPLATE_OPTION_REPEATABLE_KEY_SET.has(key)) {\n if (typeof value === \"string\") {\n next[key] = [value];\n continue;\n }\n if (!Array.isArray(value)) {\n continue;\n }\n const values = value.filter((entry): entry is string => typeof entry === \"string\");\n if (values.length > 0) {\n next[key] = values;\n }\n continue;\n }\n if (typeof value === \"string\") {\n next[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n next[key] = [...value];\n }\n }\n return sortTemplateOptions(next);\n}\n\nfunction parseStoredTemplateOptions(rawOptions: unknown, templateName: string): CreateTemplateOptions {\n if (typeof rawOptions !== \"object\" || rawOptions === null || Array.isArray(rawOptions)) {\n throw new PmCliError(`Template \"${templateName}\" has invalid options payload.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const optionsRecord = rawOptions as Record<string, unknown>;\n const normalized: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(optionsRecord)) {\n const normalizedKey = key.trim();\n if (normalizedKey.length === 0) {\n throw new PmCliError(\n `Template \"${templateName}\" contains an empty option key.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (typeof value === \"string\") {\n normalized[normalizedKey] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[normalizedKey] = [...value];\n continue;\n }\n throw new PmCliError(\n `Template \"${templateName}\" contains invalid value for option \"${normalizedKey}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return sortTemplateOptions(normalized);\n}\n\nfunction parseStoredTemplateDocument(raw: string, normalizedName: string): StoredCreateTemplateDocument {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new PmCliError(`Template \"${normalizedName}\" contains invalid JSON.`, EXIT_CODE.GENERIC_FAILURE);\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw new PmCliError(`Template \"${normalizedName}\" has invalid document shape.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const record = parsed as Record<string, unknown>;\n const options = parseStoredTemplateOptions(record.options, normalizedName);\n const now = nowIso();\n return {\n name: typeof record.name === \"string\" && record.name.trim().length > 0 ? record.name.trim() : normalizedName,\n created_at: typeof record.created_at === \"string\" ? record.created_at : now,\n updated_at: typeof record.updated_at === \"string\" ? record.updated_at : now,\n options,\n };\n}\n\nfunction builtinTemplateDocument(normalizedName: string): StoredCreateTemplateDocument | null {\n const options = BUILTIN_TEMPLATES[normalizedName];\n if (!options) {\n return null;\n }\n return {\n name: normalizedName,\n created_at: BUILTIN_TEMPLATE_TIMESTAMP,\n updated_at: BUILTIN_TEMPLATE_TIMESTAMP,\n options: sortTemplateOptions({ ...options }),\n };\n}\n\ninterface ResolvedTemplateDocument {\n document: StoredCreateTemplateDocument;\n source: TemplateSource;\n}\n\nasync function resolveTemplateDocument(pmRoot: string, normalizedName: string): Promise<ResolvedTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw !== null) {\n return { document: parseStoredTemplateDocument(raw, normalizedName), source: \"user\" };\n }\n const builtin = builtinTemplateDocument(normalizedName);\n if (builtin) {\n return { document: builtin, source: \"builtin\" };\n }\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n}\n\nasync function readStoredTemplateDocument(pmRoot: string, normalizedName: string): Promise<StoredCreateTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw === null) {\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n }\n return parseStoredTemplateDocument(raw, normalizedName);\n}\n\n/**\n * Implements load create template options for the public runtime surface of this module.\n */\nexport async function loadCreateTemplateOptions(pmRoot: string, rawTemplateName: string): Promise<CreateTemplateOptions> {\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document } = await resolveTemplateDocument(pmRoot, normalizedName);\n return document.options;\n}\n\n/**\n * Implements run templates save for the public runtime surface of this module.\n */\nexport async function runTemplatesSave(\n rawTemplateName: string,\n options: Record<string, unknown>,\n global: GlobalOptions,\n): Promise<TemplatesSaveResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const nextOptions = extractTemplateOptions(options);\n if (Object.keys(nextOptions).length === 0) {\n throw new PmCliError(\"templates save requires at least one create option flag\", EXIT_CODE.USAGE);\n }\n\n const now = nowIso();\n const storedPath = templatePath(pmRoot, normalizedName);\n let createdAt = now;\n if (await pathExists(storedPath)) {\n const existing = await readStoredTemplateDocument(pmRoot, normalizedName);\n createdAt = existing.created_at;\n }\n\n const document: StoredCreateTemplateDocument = {\n name: normalizedName,\n created_at: createdAt,\n updated_at: now,\n options: nextOptions,\n };\n await fs.mkdir(templatesDirectory(pmRoot), { recursive: true });\n await writeFileAtomic(storedPath, `${JSON.stringify(document, null, 2)}\\n`);\n return {\n name: document.name,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: storedPath,\n options: document.options,\n };\n}\n\nasync function readUserTemplateNames(pmRoot: string): Promise<string[]> {\n const dirPath = templatesDirectory(pmRoot);\n if (!(await pathExists(dirPath))) {\n return [];\n }\n const entries = await fs.readdir(dirPath);\n return entries\n .filter((entry) => entry.toLowerCase().endsWith(TEMPLATE_FILE_EXTENSION))\n .map((entry) => entry.slice(0, -TEMPLATE_FILE_EXTENSION.length))\n .filter((entry) => TEMPLATE_NAME_PATTERN.test(entry));\n}\n\n/**\n * Implements run templates list for the public runtime surface of this module.\n */\nexport async function runTemplatesList(global: GlobalOptions): Promise<TemplatesListResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const userTemplates = await readUserTemplateNames(pmRoot);\n const userTemplateSet = new Set<string>(userTemplates);\n const builtinTemplates = Object.keys(BUILTIN_TEMPLATES).filter((name) => !userTemplateSet.has(name));\n const sortedUser = [...userTemplates].sort((left, right) => left.localeCompare(right));\n const sortedBuiltin = [...builtinTemplates].sort((left, right) => left.localeCompare(right));\n const templates = [...new Set([...sortedUser, ...sortedBuiltin])].sort((left, right) => left.localeCompare(right));\n return {\n templates,\n count: templates.length,\n builtin_templates: sortedBuiltin,\n user_templates: sortedUser,\n };\n}\n\n/**\n * Implements run templates show for the public runtime surface of this module.\n */\nexport async function runTemplatesShow(rawTemplateName: string, global: GlobalOptions): Promise<TemplatesShowResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document, source } = await resolveTemplateDocument(pmRoot, normalizedName);\n return {\n name: document.name,\n source,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: source === \"builtin\" ? `builtin:${normalizedName}` : templatePath(pmRoot, normalizedName),\n options: document.options,\n };\n}\n"],"names":["path","path","plan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,OAAOA,WAAU;;;ACwEX,SAAU,2BAA2B,SAAiC;AAC1E,SAAO;IACL,OAAO,QAAQ,MAAM;IACrB,UAAU,QAAQ,SAAS;IAC3B,QAAQ,QAAQ,OAAO;IACvB,WAAW,QAAQ,UAAU;IAC7B,QAAQ,QAAQ,OAAO;IACvB,WAAW,QAAQ,UAAU;IAC7B,UAAU,QAAQ,SAAS;;AAE/B;AAWM,SAAU,uBAAuB,SAAiC;AACtE,SAAO;IACL,MAAM,QAAQ;IACd,OAAO,QAAQ;IACf,SAAS,QAAQ;IACjB,aAAa,2BAA2B,OAAO;IAC/C,OAAO,QAAQ,MAAM,IAAI,CAAC,SACxB,kBAAkB,MAAM,sBAAsB,IAAI,EAAE,MAAM,MAAM,OAAO,KAAK,QAAQ,EAAE,CAAC,CAAC;IAE1F,UAAU,QAAQ,SAAS,IAAI,CAAC,WAC9B,kBAAkB,MAAM,wBAAwB,MAAM,EAAE,IAAI,MAAM,OAAO,OAAO,MAAM,EAAE,CAAC,CAAC;IAE5F,QAAQ,QAAQ,OAAO,IAAI,CAAC,UAC1B,kBAAkB,MAAM,uB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UAAM,KAAK,cAAc,OAAO,EAAE;EACpC;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;AAMM,SAAU,wBAAwB,QAA0B;AAChE,QAAM,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,YAAY;AACvE,QAAM,QAAQ,CAAC,WAAW,OAAO,IAAI,KAAK,IAAI,GAAG;AACjD,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,KAAK,sBAAsB;EACnC,OAAO;AACL,eAAW,CAAC,OAAO,SAAS,KAAK;MAC/B,CAAC,SAAS,OAAO,KAAK;MACtB,CAAC,YAAY,OAAO,QAAQ;MAC5B,CAAC,UAAU,OAAO,MAAM;MACxB,CAAC,aAAa,OAAO,SAAS;MAC9B,CAAC,UAAU,OAAO,MAAM;MACxB,CAAC,aAAa,OAAO,SAAS;OACpB;AACV,YAAM,OAAO,oBAAoB,OAAO,SAAS;AACjD,UAAI,SAAS,QAAW;AACtB,cAAM,KAAK,IAAI;MACjB;IACF;EACF;AACA,QAAM,cAAc,OAAO,SAAS,OAAO,CAAC,QAAQ,IAAI,WAAW,aAAa;AAChF,MAAI,YAAY,SAAS,GAAG;AAC1B,UAAM,KAAK,2BAA2B,YAAY,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE;EACvF;AACA,aAAW,WAAW,OAAO,UAAU;AACrC,UAAM,KAAK,cAAc,OAAO,EAAE;EACpC;AACA,SAAO,MAAM,KAAK,IAAI;AACxB","debugId":"0631e6e9-60b6-5d96-9c1a-9ceed0a85d7f"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/profile.ts","../../../../../../../../core/profile/profile-describe.ts","../../../../../../../../core/profile/profile-plan.ts","../../../../../../../../cli/commands/templates.ts"],"sourcesContent":["/**\n * @module cli/commands/profile\n *\n * Implements the `pm profile` command surface: listing the built-in project\n * archetypes, showing a profile's full composition, and applying a profile to an\n * initialized tracker. Apply stages item types, custom statuses, custom fields,\n * per-type workflows, config knobs, and create templates idempotently, and\n * surfaces advisory package recommendations. The pure diff lives in\n * {@link module:core/profile/profile-plan}; this module is the I/O orchestration\n * and human formatting around it.\n */\nimport path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, resolveGovernanceKnobs, writeSettings } from \"../../core/store/settings.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport { normalizeAddTypeInput, serializeItemTypesFile } from \"../../core/schema/item-types-file.js\";\nimport { serializeStatusDefsFile } from \"../../core/schema/status-defs-file.js\";\nimport { serializeFieldsFile } from \"../../core/schema/fields-file.js\";\nimport {\n resolveNestedSettingDescriptor,\n writeNestedSettingValue,\n} from \"../../core/config/nested-settings.js\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport {\n resolveProfileCatalog,\n resolveProfileEntry,\n type ExtensionProfileContribution,\n type ProfileSourceKind,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ResolveProfileEntryResult,\n} from \"../../core/profile/profile-presets.js\";\nimport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n} from \"../../core/profile/profile-describe.js\";\nimport {\n lintProjectProfile,\n type ProjectProfileLintFinding,\n} from \"../../core/profile/profile-lint.js\";\nimport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileCurrentState,\n} from \"../../core/profile/profile-plan.js\";\nimport { ensureTypeFolderScaffold } from \"./schema.js\";\nimport { runTemplatesSave } from \"./templates.js\";\n\n/** Ordered `pm profile` subcommands. */\nexport const PROFILE_SUBCOMMANDS = [\"list\", \"show\", \"apply\", \"lint\"] as const;\n/**\n * Restricts profile subcommand values accepted by command, SDK, and storage contracts.\n */\nexport type ProfileSubcommand = (typeof PROFILE_SUBCOMMANDS)[number];\n\nconst PROFILE_TYPES_LOCK_ID = \"schema-types\";\nconst PROFILE_STATUSES_LOCK_ID = \"schema-statuses\";\nconst PROFILE_FIELDS_LOCK_ID = \"schema-fields\";\n\n/**\n * Per-dimension counts summarizing how much a profile stages. Aliases the shared\n * {@link ProjectProfileComposition} so the CLI result shape and the core describe\n * primitive never drift.\n */\nexport type ProfileComposition = ProjectProfileComposition;\n\n/** A single profile entry in the `pm profile list` payload. */\nexport interface ProfileListEntry {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n}\n\n/** Result of `pm profile list`. */\nexport interface ProfileListResult {\n /** Discriminant for the profile result union. */\n action: \"list\";\n /** Built-in profiles in canonical order followed by active extension profiles. */\n profiles: ProfileListEntry[];\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile show <name>`. */\nexport interface ProfileShowResult {\n /** Discriminant for the profile result union. */\n action: \"show\";\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** Per-dimension counts. */\n composition: ProfileComposition;\n /** Item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: Array<{ spec: string; reason: string }>;\n /** Non-fatal merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Per-dimension change summary in an apply result. */\nexport interface ProfileApplyDimension {\n /** Entry keys that were newly created. */\n added: string[];\n /** Entry keys whose stored value was overwritten. */\n updated: string[];\n /** Entry keys already current (no write). */\n unchanged: string[];\n}\n\n/** Result of `pm profile apply <name>`. */\nexport interface ProfileApplyResult {\n /** Discriminant for the profile result union. */\n action: \"apply\";\n /** Applied profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** True when changes were persisted; false for `--dry-run` or a no-op. */\n applied: boolean;\n /** True when `--dry-run` previewed without writing. */\n dry_run: boolean;\n /** True when at least one dimension stages an add/update. */\n changed: boolean;\n /** Item-type change summary. */\n types: ProfileApplyDimension;\n /** Status change summary. */\n statuses: ProfileApplyDimension;\n /** Field change summary. */\n fields: ProfileApplyDimension;\n /** Workflow change summary. */\n workflows: ProfileApplyDimension;\n /** Config-knob change summary. */\n config: ProfileApplyDimension;\n /** Template change summary. */\n templates: ProfileApplyDimension;\n /** Advisory package recommendations with install status. */\n packages: Array<{ spec: string; reason: string; status: \"installed\" | \"recommended\" }>;\n /** Deduped on-write hook + advisory warnings. */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Result of `pm profile lint [name]`. */\nexport interface ProfileLintResult {\n /** Discriminant for the profile result union. */\n action: \"lint\";\n /** Linted profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** Whether the profile is core-baked or contributed by an active extension. */\n source: ProfileSourceKind;\n /** Owning package/extension name for an extension profile; omitted for builtins. */\n package?: string;\n /** True when the profile produced no error-severity findings. */\n ok: boolean;\n /** Count of error-severity findings. */\n error_count: number;\n /** Count of warning-severity findings. */\n warning_count: number;\n /** Every graded consistency finding in dimension order. */\n findings: ProjectProfileLintFinding[];\n /** Non-fatal catalog merge warnings (built-in shadowing attempts, duplicate names). */\n warnings: string[];\n /** ISO timestamp the result was produced. */\n generated_at: string;\n}\n\n/** Discriminated union of every `pm profile` result shape. */\nexport type ProfileResult = ProfileListResult | ProfileShowResult | ProfileApplyResult | ProfileLintResult;\n\n/* c8 ignore start -- profile command I/O orchestration and formatting is covered by profile integration workflows; the idempotent diff is unit-tested in core/profile/profile-plan. */\n\n/**\n * Collects the profiles contributed by active extensions, mapping the live\n * registration registry onto the resolver's contribution shape. Returns an empty\n * list when extensions are disabled or none registered a profile.\n */\nfunction collectExtensionProfileContributions(): ExtensionProfileContribution[] {\n const registrations = getActiveExtensionRegistrations();\n if (registrations === null) {\n return [];\n }\n return registrations.profiles.map((entry) => ({ name: entry.name, profile: entry.profile }));\n}\n\n/**\n * Lists every available profile — the built-in archetypes followed by profiles\n * contributed by active extensions — with per-dimension composition counts and\n * the source each came from. Surfaces any non-fatal merge collisions as warnings.\n */\nexport function runProfileList(): ProfileListResult {\n const { profiles, warnings } = resolveProfileCatalog(collectExtensionProfileContributions());\n return {\n action: \"list\",\n profiles: profiles.map((resolved) => ({\n name: resolved.definition.name,\n title: resolved.definition.title,\n summary: resolved.definition.summary,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n composition: describeProfileComposition(resolved.definition),\n })),\n warnings,\n generated_at: nowIso(),\n };\n}\n\n/**\n * Shows the full composition of a single profile, resolved across built-in and\n * extension-contributed archetypes. Throws a USAGE error for a missing or unknown\n * profile name.\n */\nexport function runProfileShow(name: string | undefined): ProfileShowResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n const { resolved } = entry;\n return {\n action: \"show\",\n ...describeProjectProfile(resolved.definition),\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/**\n * Lints a single profile, resolved across built-in and extension-contributed\n * archetypes, returning every graded consistency finding plus any catalog merge\n * warnings. Throws a USAGE error for a missing or unknown profile name. This is\n * the read-only author-time validation surface; it never writes to the tracker.\n */\nexport function runProfileLint(name: string | undefined): ProfileLintResult {\n let entry: ResolveProfileEntryResult;\n try {\n entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n const { resolved } = entry;\n const report = lintProjectProfile(resolved.definition);\n return {\n action: \"lint\",\n name: resolved.definition.name,\n title: resolved.definition.title,\n source: resolved.source,\n ...(resolved.package !== undefined ? { package: resolved.package } : {}),\n ok: report.ok,\n error_count: report.errorCount,\n warning_count: report.warningCount,\n findings: report.findings,\n warnings: entry.warnings,\n generated_at: nowIso(),\n };\n}\n\n/** Options accepted by {@link runProfileApply}. */\nexport interface ProfileApplyCommandOptions {\n /** Preview the diff without writing any files. */\n dryRun?: boolean;\n /** Mutation author override. */\n author?: string;\n /** Force ownership/lock override. */\n force?: boolean;\n}\n\nfunction templateFilePath(pmRoot: string, name: string): string {\n return path.join(pmRoot, \"templates\", `${name}.json`);\n}\n\nasync function readStoredTemplateOptions(pmRoot: string, name: string): Promise<ProfileTemplateOptions | undefined> {\n const raw = await readFileIfExists(templateFilePath(pmRoot, name));\n if (raw === null) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n const options = (parsed as { options?: unknown }).options;\n if (options !== null && typeof options === \"object\" && !Array.isArray(options)) {\n return options as ProfileTemplateOptions;\n }\n }\n } catch {\n // A malformed template file is treated as absent so apply re-stages it.\n }\n return undefined;\n}\n\nasync function loadProfileCurrentState(\n pmRoot: string,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n settings: Awaited<ReturnType<typeof readSettings>>,\n profile: ProjectProfileDefinition,\n): Promise<ProfileCurrentState> {\n const templates = new Map<string, ProfileTemplateOptions>();\n for (const template of profile.templates) {\n const stored = await readStoredTemplateOptions(pmRoot, template.name);\n if (stored !== undefined) {\n templates.set(template.name, stored);\n }\n }\n return {\n typesRaw: await readFileIfExists(filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types)),\n statusesRaw: await readFileIfExists(\n filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n ),\n fieldsRaw: await readFileIfExists(\n filePathForSchemaSection(pmRoot, schema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n ),\n workflows: settings.schema.type_workflows ?? [],\n settings,\n templates,\n // Package recommendations are advisory: apply never installs and never\n // inspects install state, so every recommendation surfaces as \"recommended\".\n // The planner still supports an install-state set for SDK consumers that want\n // richer reporting.\n installedPackages: new Set<string>(),\n };\n}\n\nfunction dimensionFrom(changes: ReadonlyArray<{ key: string; status: ProfileChangeStatus }>): ProfileApplyDimension {\n const added: string[] = [];\n const updated: string[] = [];\n const unchanged: string[] = [];\n for (const change of changes) {\n (change.status === \"add\" ? added : change.status === \"update\" ? updated : unchanged).push(change.key);\n }\n return { added, updated, unchanged };\n}\n\nfunction buildApplyResult(\n profile: ProjectProfileDefinition,\n plan: ProfileApplicationPlan,\n applied: boolean,\n dryRun: boolean,\n warnings: string[],\n): ProfileApplyResult {\n return {\n action: \"apply\",\n name: profile.name,\n title: profile.title,\n applied,\n dry_run: dryRun,\n changed: plan.changed,\n types: dimensionFrom(plan.types.changes),\n statuses: dimensionFrom(plan.statuses.changes),\n fields: dimensionFrom(plan.fields.changes),\n workflows: dimensionFrom(plan.workflows.changes.map((change) => ({ key: change.type, status: change.status }))),\n config: dimensionFrom(plan.config.changes),\n templates: dimensionFrom(plan.templates.changes.map((change) => ({ key: change.name, status: change.status }))),\n packages: plan.packages,\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nasync function assertProfileTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nfunction resolveProfileForCommand(name: string | undefined): { profile: ProjectProfileDefinition; warnings: string[] } {\n try {\n const entry = resolveProfileEntry(name, collectExtensionProfileContributions());\n return {\n profile: entry.resolved.definition,\n warnings: entry.warnings,\n };\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Applies a profile to the initialized tracker, or previews the idempotent diff\n * when `dryRun` is set. Schema files are written under their respective locks;\n * config and workflows are persisted to settings; templates are staged via the\n * shared template writer. Re-applying an already-applied profile performs zero\n * writes. Throws a USAGE error for an unknown profile or an invalid config knob,\n * and a NOT_FOUND error when the tracker is not initialized.\n */\nexport async function runProfileApply(\n name: string | undefined,\n options: ProfileApplyCommandOptions,\n global: GlobalOptions,\n): Promise<ProfileApplyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await assertProfileTrackerInitialized(pmRoot);\n\n // Catalog-level merge warnings (e.g. an extension profile shadowed by a\n // built-in) seed the result so `apply` surfaces them the same way `list`\n // does, rather than silently swallowing them.\n const resolvedProfile = resolveProfileForCommand(name);\n const profile = resolvedProfile.profile;\n const mergeWarnings = resolvedProfile.warnings;\n\n const dryRun = options.dryRun === true;\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n\n if (dryRun) {\n const state = await loadProfileCurrentState(pmRoot, schema, settings, profile);\n const plan = planProfile(profile, state);\n return buildApplyResult(profile, plan, false, true, [...mergeWarnings]);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n const force = Boolean(options.force);\n const warnings: string[] = [...mergeWarnings];\n\n // Acquire all three schema locks inside the try so a later acquisition that\n // throws (held/stale lock without --force) still releases the earlier ones in\n // finally rather than stranding them until TTL expiry.\n const releasers: Array<() => Promise<void>> = [];\n const acquire = async (lockId: string): Promise<void> => {\n releasers.push(\n await acquireLock(\n pmRoot,\n lockId,\n settings.locks.ttl_seconds,\n author,\n force,\n governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n ),\n );\n };\n let plan: ProfileApplicationPlan;\n try {\n await acquire(PROFILE_TYPES_LOCK_ID);\n await acquire(PROFILE_STATUSES_LOCK_ID);\n await acquire(PROFILE_FIELDS_LOCK_ID);\n const state = await loadProfileCurrentState(pmRoot, schema, settings, profile);\n plan = planProfile(profile, state);\n\n if (plan.types.changed) {\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n await writeFileAtomic(typesPath, serializeItemTypesFile(plan.types.file));\n const stagedNames = new Set(profile.types.map((type) => normalizeAddTypeInput(type).name));\n const stagedDefinitions = plan.types.file.definitions.filter((definition) => stagedNames.has(definition.name));\n await ensureTypeFolderScaffold(pmRoot, stagedDefinitions, warnings, \"profile:apply-type-folder\");\n warnings.push(...(await runActiveOnWriteHooks({ path: typesPath, scope: \"project\", op: \"profile:apply-types\" })));\n }\n if (plan.statuses.changed) {\n const statusesPath = filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(plan.statuses.file));\n warnings.push(...(await runActiveOnWriteHooks({ path: statusesPath, scope: \"project\", op: \"profile:apply-statuses\" })));\n }\n if (plan.fields.changed) {\n const fieldsPath = filePathForSchemaSection(pmRoot, schema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n await writeFileAtomic(fieldsPath, serializeFieldsFile(plan.fields.file));\n warnings.push(...(await runActiveOnWriteHooks({ path: fieldsPath, scope: \"project\", op: \"profile:apply-fields\" })));\n }\n if (plan.config.changed || plan.workflows.changed) {\n for (const change of plan.config.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n const descriptor = resolveNestedSettingDescriptor(change.key);\n if (descriptor !== undefined) {\n writeNestedSettingValue(settings as unknown as Record<string, unknown>, descriptor, change.value);\n }\n }\n settings.schema.type_workflows = plan.workflows.result;\n await writeSettings(pmRoot, settings, \"profile:apply-config\");\n }\n for (const change of plan.templates.changes) {\n if (change.status === \"unchanged\") {\n continue;\n }\n await runTemplatesSave(change.name, { ...change.options }, global);\n }\n } finally {\n // Release in reverse acquisition order; only locks actually acquired are\n // present. Each release is best-effort so one rejecting release never strands\n // the remaining locks (a failed release falls back to TTL expiry).\n for (const release of releasers.reverse()) {\n try {\n await release();\n } catch {\n // Ignore: a failed lock release is non-fatal and self-heals at TTL.\n }\n }\n }\n\n return buildApplyResult(profile, plan, plan.changed, false, warnings);\n}\n\n// planProfileApplication can throw a plain Error for an invalid config knob; map\n// it to a USAGE exit code consistently across the dry-run and apply paths.\nfunction planProfile(profile: ProjectProfileDefinition, state: ProfileCurrentState): ProfileApplicationPlan {\n try {\n return planProfileApplication(profile, state);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n}\n\nfunction formatDimensionLine(label: string, dimension: ProfileApplyDimension): string | undefined {\n const segments: string[] = [];\n if (dimension.added.length > 0) {\n segments.push(`+${dimension.added.join(\", \")}`);\n }\n if (dimension.updated.length > 0) {\n segments.push(`~${dimension.updated.join(\", \")}`);\n }\n if (segments.length === 0) {\n return undefined;\n }\n return ` ${label}: ${segments.join(\" \")}`;\n}\n\n/**\n * Renders the `pm profile list` result as human-readable text.\n */\nexport function formatProfileListHuman(result: ProfileListResult): string {\n const lines = [\"Project profiles:\"];\n for (const profile of result.profiles) {\n const origin = profile.source === \"extension\" ? ` [${profile.package ?? \"extension\"}]` : \"\";\n lines.push(` ${profile.name} — ${profile.title}: ${profile.summary}${origin}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile show` result as human-readable text.\n */\nexport function formatProfileShowHuman(result: ProfileShowResult): string {\n const origin = result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n const lines = [`${result.name} — ${result.title}${origin}`, result.summary, \"\"];\n lines.push(`types: ${result.types.join(\", \") || \"(none)\"}`);\n lines.push(`statuses: ${result.statuses.join(\", \") || \"(none)\"}`);\n lines.push(`fields: ${result.fields.join(\", \") || \"(none)\"}`);\n lines.push(`workflows: ${result.workflows.join(\", \") || \"(none)\"}`);\n lines.push(`config: ${result.config.join(\", \") || \"(none)\"}`);\n lines.push(`templates: ${result.templates.join(\", \") || \"(none)\"}`);\n lines.push(`packages: ${result.packages.map((pkg) => pkg.spec).join(\", \") || \"(none)\"}`);\n for (const warning of result.warnings) {\n lines.push(`warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile lint` result as human-readable text: a one-line verdict\n * followed by each finding prefixed with its severity, code, and dimension.\n */\nexport function formatProfileLintHuman(result: ProfileLintResult): string {\n const origin = result.source === \"extension\" ? ` [${result.package ?? \"extension\"}]` : \"\";\n // Catalog merge warnings are rendered below alongside lint-finding warnings, so\n // fold them into the headline count to avoid an \"ok (0 warnings)\" verdict that\n // is immediately followed by `warning:` lines.\n const totalWarningCount = result.warning_count + result.warnings.length;\n const verdict = result.ok\n ? `Profile ${result.name}${origin}: ok (${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"})`\n : `Profile ${result.name}${origin}: ${result.error_count} error${result.error_count === 1 ? \"\" : \"s\"}, ${totalWarningCount} warning${totalWarningCount === 1 ? \"\" : \"s\"}`;\n const lines = [verdict];\n for (const finding of result.findings) {\n const target = finding.target !== undefined ? ` (${finding.target})` : \"\";\n lines.push(` ${finding.severity} [${finding.code}] ${finding.dimension}${target}: ${finding.message}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Renders the `pm profile apply` result as human-readable text, including the\n * staged diff and any package recommendations.\n */\nexport function formatProfileApplyHuman(result: ProfileApplyResult): string {\n const mode = result.dry_run ? \"dry-run\" : result.applied ? \"applied\" : \"no changes\";\n const lines = [`Profile ${result.name} (${mode})`];\n if (!result.changed) {\n lines.push(\" already up to date\");\n } else {\n for (const [label, dimension] of [\n [\"types\", result.types],\n [\"statuses\", result.statuses],\n [\"fields\", result.fields],\n [\"workflows\", result.workflows],\n [\"config\", result.config],\n [\"templates\", result.templates],\n ] as const) {\n const line = formatDimensionLine(label, dimension);\n if (line !== undefined) {\n lines.push(line);\n }\n }\n }\n const recommended = result.packages.filter((pkg) => pkg.status === \"recommended\");\n if (recommended.length > 0) {\n lines.push(` recommended packages: ${recommended.map((pkg) => pkg.spec).join(\", \")}`);\n }\n for (const warning of result.warnings) {\n lines.push(` warning: ${warning}`);\n }\n return lines.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n","/**\n * @module core/profile/profile-describe\n *\n * Author-time *describe* primitive for a {@link ProjectProfileDefinition}: the\n * project-profile analogue of the extension surface's `describeExtensionBlueprint`.\n * It distills a profile into a deterministic, side-effect-free summary — the\n * per-dimension counts plus the resolved entry identifiers — so the CLI\n * `pm profile show`/`list` formatters and SDK consumers share one source of truth\n * for \"what does this profile stage?\" rather than each recomputing it inline.\n *\n * Identifier derivation deliberately mirrors what {@link module:core/profile/profile-plan}\n * upserts: item type names, status ids, and field keys all flow through the same\n * `normalizeAddTypeInput` / `normalizeAddStatusInput` / `normalizeAddFieldInput`\n * canonicalization the planner uses, so describe reports the exact ids/keys\n * `pm profile apply` stages (not the author's raw casing/spelling). Workflows,\n * config, templates, and packages surface their authored identity verbatim.\n *\n * Describe is intentionally lenient: it feeds read-only `pm profile show`/`list`,\n * so a semantically-invalid entry from an untrusted extension-contributed profile\n * (a built-in-named or empty type/status/field the normalizer rejects) falls back\n * to its raw identifier rather than throwing — surfacing the actual defect is the\n * job of {@link module:core/profile/profile-lint lintProjectProfile}, not describe.\n */\nimport { normalizeAddFieldInput } from \"../schema/fields-file.js\";\nimport { normalizeAddStatusInput } from \"../schema/status-defs-file.js\";\nimport { normalizeAddTypeInput } from \"../schema/item-types-file.js\";\nimport type { ProjectProfileDefinition } from \"./profile-presets.js\";\n\n/** Per-dimension counts summarizing how much a profile stages. */\nexport interface ProjectProfileComposition {\n /** Number of item types the profile registers. */\n types: number;\n /** Number of custom statuses. */\n statuses: number;\n /** Number of custom fields. */\n fields: number;\n /** Number of per-type workflows. */\n workflows: number;\n /** Number of config knobs. */\n config: number;\n /** Number of create templates. */\n templates: number;\n /** Number of recommended packages. */\n packages: number;\n}\n\n/** A package recommendation distilled to its spec and rationale. */\nexport interface ProjectProfilePackageSummary {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n}\n\n/** Deterministic summary of a profile's composition produced by {@link describeProjectProfile}. */\nexport interface ProjectProfileDescription {\n /** Profile name. */\n name: string;\n /** Display title. */\n title: string;\n /** One-line archetype summary. */\n summary: string;\n /** Per-dimension counts. */\n composition: ProjectProfileComposition;\n /** Canonical item type names the profile registers. */\n types: string[];\n /** Custom status ids. */\n statuses: string[];\n /** Custom field keys. */\n fields: string[];\n /** Item types governed by a staged workflow. */\n workflows: string[];\n /** Config knobs as `key=value` pairs. */\n config: string[];\n /** Template names the profile stages. */\n templates: string[];\n /** Recommended package specs with rationale. */\n packages: ProjectProfilePackageSummary[];\n}\n\n/**\n * Computes the per-dimension counts for a profile.\n */\nexport function describeProfileComposition(profile: ProjectProfileDefinition): ProjectProfileComposition {\n return {\n types: profile.types.length,\n statuses: profile.statuses.length,\n fields: profile.fields.length,\n workflows: profile.workflows.length,\n config: profile.config.length,\n templates: profile.templates.length,\n packages: profile.packages.length,\n };\n}\n\n/**\n * Distills a profile definition into a deterministic composition summary. Pure\n * and tracker-independent; the resolved identifiers match exactly what\n * `pm profile apply` stages for each dimension.\n *\n * @param profile The profile definition to describe.\n * @returns The profile's metadata, per-dimension counts, and resolved entry\n * identifiers.\n */\nexport function describeProjectProfile(profile: ProjectProfileDefinition): ProjectProfileDescription {\n return {\n name: profile.name,\n title: profile.title,\n summary: profile.summary,\n composition: describeProfileComposition(profile),\n types: profile.types.map((type) =>\n lenientIdentifier(() => normalizeAddTypeInput(type).name, () => String(type.name ?? \"\")),\n ),\n statuses: profile.statuses.map((status) =>\n lenientIdentifier(() => normalizeAddStatusInput(status).id, () => String(status.id ?? \"\")),\n ),\n fields: profile.fields.map((field) =>\n lenientIdentifier(() => normalizeAddFieldInput(field).key, () => String(field.key ?? \"\")),\n ),\n workflows: profile.workflows.map((workflow) => workflow.type),\n config: profile.config.map((entry) => `${entry.key}=${entry.value}`),\n templates: profile.templates.map((template) => template.name),\n packages: profile.packages.map((recommendation) => ({ spec: recommendation.spec, reason: recommendation.reason })),\n };\n}\n\n/**\n * Resolves a dimension entry's identifier through the planner's canonicalizing\n * normalizer so describe reports exactly what `pm profile apply` stages, falling\n * back to the entry's raw identifier when the normalizer rejects a semantically\n * invalid value (a built-in-named or empty type/status/field) — surfacing the\n * defect is the job of {@link module:core/profile/profile-lint}, not describe.\n */\nfunction lenientIdentifier(normalize: () => string, raw: () => string): string {\n try {\n return normalize();\n } catch {\n return raw();\n }\n}\n","/**\n * @module core/profile/profile-plan\n *\n * Pure planning for `pm profile apply`. Given a {@link ProjectProfileDefinition}\n * and a snapshot of the current tracker state, computes an idempotent diff across\n * every profile dimension (item types, statuses, fields, per-type workflows,\n * config knobs, templates, and package recommendations) without touching disk.\n *\n * Idempotency is structural: each schema component is upserted onto a clone and\n * the canonical serialization is compared before/after, so re-running `apply`\n * against an already-applied profile reports every entry as `unchanged` and the\n * command performs zero writes. The resulting files/settings the planner returns\n * are exactly what the apply step persists, guaranteeing the dry-run preview and\n * the real mutation never diverge.\n */\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n type ItemTypesFile,\n} from \"../schema/item-types-file.js\";\nimport {\n normalizeAddStatusInput,\n parseStatusDefsFile,\n serializeStatusDefsFile,\n upsertStatusDef,\n type StatusDefsFile,\n} from \"../schema/status-defs-file.js\";\nimport {\n normalizeAddFieldInput,\n parseFieldsFile,\n serializeFieldsFile,\n upsertField,\n type FieldsFile,\n} from \"../schema/fields-file.js\";\nimport {\n parseNestedSettingValue,\n readNestedSettingValue,\n resolveNestedSettingDescriptor,\n} from \"../config/nested-settings.js\";\nimport type { TypeWorkflowDefinition } from \"../../types.js\";\nimport type {\n ProfileTemplateOptions,\n ProjectProfileDefinition,\n} from \"./profile-presets.js\";\n\n/** Per-entry change classification used across every profile dimension. */\nexport type ProfileChangeStatus = \"add\" | \"update\" | \"unchanged\";\n\n/** A single staged change keyed by its component identifier. */\nexport interface ProfileComponentChange {\n /** Component identity (type name, status id, field key, etc.). */\n key: string;\n /** Whether the entry is new, an overwrite, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for a file-backed schema component (types/statuses/fields). */\nexport interface ProfileSchemaPlan<TFile> {\n /** Serialized file content to persist when `changed`. */\n file: TFile;\n /** Per-entry classifications in profile order. */\n changes: ProfileComponentChange[];\n /** True when at least one entry is add/update. */\n changed: boolean;\n}\n\n/** A staged per-type workflow change plus the merged result list. */\nexport interface ProfileWorkflowChange {\n /** Item type the workflow governs. */\n type: string;\n /** Whether the workflow is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the `schema.type_workflows` settings subtree. */\nexport interface ProfileWorkflowPlan {\n /** Per-workflow classifications in profile order. */\n changes: ProfileWorkflowChange[];\n /** Full merged workflow list to persist when `changed`. */\n result: TypeWorkflowDefinition[];\n /** True when at least one workflow is add/update. */\n changed: boolean;\n}\n\n/** A staged config knob plus the resolved settings path and typed value. */\nexport interface ProfileConfigChange {\n /** Descriptor key (snake_case). */\n key: string;\n /** Dotted PmSettings path the value writes to. */\n path: string;\n /** Typed leaf value to persist. */\n value: string | number | boolean;\n /** Whether the leaf is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the nested-settings knobs a profile stages. */\nexport interface ProfileConfigPlan {\n /** Per-knob classifications in profile order. */\n changes: ProfileConfigChange[];\n /** True when at least one knob is add/update. */\n changed: boolean;\n}\n\n/** A staged create-template change. */\nexport interface ProfileTemplateChange {\n /** Template name. */\n name: string;\n /** Option payload to persist for the template. */\n options: ProfileTemplateOptions;\n /** Whether the template is new, changed, or already current. */\n status: ProfileChangeStatus;\n}\n\n/** Plan for the create templates a profile stages. */\nexport interface ProfileTemplatePlan {\n /** Per-template classifications in profile order. */\n changes: ProfileTemplateChange[];\n /** True when at least one template is add/update. */\n changed: boolean;\n}\n\n/** Advisory package recommendation with install status. */\nexport interface ProfilePackagePlan {\n /** Catalog alias or install spec. */\n spec: string;\n /** Why the archetype benefits from the package. */\n reason: string;\n /** `installed` when already present, otherwise `recommended`. */\n status: \"installed\" | \"recommended\";\n}\n\n/** Current tracker state the planner diffs the profile against. */\nexport interface ProfileCurrentState {\n /** Raw `schema/types.json` content (or null when absent). */\n typesRaw: string | null;\n /** Raw status-defs file content (or null when absent). */\n statusesRaw: string | null;\n /** Raw fields file content (or null when absent). */\n fieldsRaw: string | null;\n /** Current `schema.type_workflows` entries. */\n workflows: readonly TypeWorkflowDefinition[];\n /** Settings object used to read current config leaf values. */\n settings: unknown;\n /** Existing stored template options keyed by template name. */\n templates: ReadonlyMap<string, ProfileTemplateOptions>;\n /** Install specs/aliases already present in the project. */\n installedPackages: ReadonlySet<string>;\n}\n\n/** Complete idempotent plan for applying a profile. */\nexport interface ProfileApplicationPlan {\n /** Identifying metadata for the planned profile. */\n profile: { name: string; title: string; summary: string };\n /** Item-type plan. */\n types: ProfileSchemaPlan<ItemTypesFile>;\n /** Status plan. */\n statuses: ProfileSchemaPlan<StatusDefsFile>;\n /** Field plan. */\n fields: ProfileSchemaPlan<FieldsFile>;\n /** Per-type workflow plan. */\n workflows: ProfileWorkflowPlan;\n /** Config-knob plan. */\n config: ProfileConfigPlan;\n /** Template plan. */\n templates: ProfileTemplatePlan;\n /** Advisory package recommendations. */\n packages: ProfilePackagePlan[];\n /** True when any dimension stages an add/update. */\n changed: boolean;\n}\n\n/**\n * Plans a file-backed schema component by upserting each normalized input onto a\n * working clone and comparing canonical serializations to classify add/update/\n * unchanged. Shared by the type, status, and field planners.\n */\nfunction planSchemaComponent<TInput, TFile>(\n initialFile: TFile,\n inputs: readonly TInput[],\n keyOf: (input: TInput) => string,\n serialize: (file: TFile) => string,\n upsert: (file: TFile, input: TInput) => { file: TFile; replaced: boolean },\n): ProfileSchemaPlan<TFile> {\n let file = initialFile;\n const changes: ProfileComponentChange[] = [];\n for (const input of inputs) {\n const before = serialize(file);\n const result = upsert(file, input);\n const after = serialize(result.file);\n file = result.file;\n const status: ProfileChangeStatus = before === after ? \"unchanged\" : result.replaced ? \"update\" : \"add\";\n changes.push({ key: keyOf(input), status });\n }\n return { file, changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Canonicalizes an allowed-transition list to an order-independent string. The\n * transitions are a set of `[from, to]` pairs, so a stored list that merely\n * reorders the same pairs must not register as a spurious `update`.\n */\nfunction canonicalTransitions(transitions: readonly [string, string][]): string {\n return JSON.stringify(transitions.map((pair) => pair.join(\"\u0000\")).sort());\n}\n\n/**\n * Plans the per-type workflow merge. A workflow whose transition set matches the\n * current entry (order-independent) is `unchanged`; a new type is `add`; a\n * changed transition set is `update`. The merged result preserves untouched\n * entries.\n */\nfunction planWorkflows(\n current: readonly TypeWorkflowDefinition[],\n desired: readonly TypeWorkflowDefinition[],\n): ProfileWorkflowPlan {\n const result = current.map((entry) => ({ ...entry }));\n const changes: ProfileWorkflowChange[] = [];\n for (const workflow of desired) {\n const index = result.findIndex((entry) => entry.type === workflow.type);\n const next: TypeWorkflowDefinition = { type: workflow.type, allowed_transitions: workflow.allowed_transitions };\n if (index < 0) {\n result.push(next);\n changes.push({ type: workflow.type, status: \"add\" });\n } else if (canonicalTransitions(result[index].allowed_transitions) === canonicalTransitions(workflow.allowed_transitions)) {\n changes.push({ type: workflow.type, status: \"unchanged\" });\n } else {\n result[index] = next;\n changes.push({ type: workflow.type, status: \"update\" });\n }\n }\n return { changes, result, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Plans config knobs by resolving each descriptor, coercing the value, and\n * comparing it against the current settings leaf. Throws a plain Error for an\n * unknown key or invalid value so the CLI can map it to a USAGE exit code.\n */\nfunction planConfig(profile: ProjectProfileDefinition, settings: unknown): ProfileConfigPlan {\n const changes: ProfileConfigChange[] = [];\n for (const entry of profile.config) {\n const descriptor = resolveNestedSettingDescriptor(entry.key);\n if (descriptor === undefined) {\n throw new Error(`Profile \"${profile.name}\" references unknown config key \"${entry.key}\".`);\n }\n const parsed = parseNestedSettingValue(descriptor, entry.value);\n if (!parsed.ok) {\n throw new Error(`Profile \"${profile.name}\" config ${entry.key}: ${parsed.error.message}`);\n }\n // readNestedSettingValue returns `null` (never `undefined`) when the leaf is\n // absent, so a null current is an unambiguous \"add\".\n const current = readNestedSettingValue(settings, descriptor);\n const status: ProfileChangeStatus =\n current === null ? \"add\" : current === parsed.parsed.value ? \"unchanged\" : \"update\";\n changes.push({ key: descriptor.key, path: descriptor.path, value: parsed.parsed.value, status });\n }\n return { changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Canonicalizes a template option payload to a key-order-independent string so a\n * profile's authored option order never produces a spurious `update` against the\n * key-sorted form `pm templates save` persists.\n */\nfunction canonicalTemplateOptions(options: ProfileTemplateOptions): string {\n const sorted = Object.entries(options).sort(([left], [right]) => left.localeCompare(right));\n return JSON.stringify(sorted);\n}\n\n/**\n * Plans create templates by comparing each profile template's option payload\n * against the stored template (if any). Equality is canonical so option key\n * ordering never produces a spurious `update`.\n */\nfunction planTemplates(\n profile: ProjectProfileDefinition,\n existing: ReadonlyMap<string, ProfileTemplateOptions>,\n): ProfileTemplatePlan {\n const changes: ProfileTemplateChange[] = [];\n for (const template of profile.templates) {\n const current = existing.get(template.name);\n let status: ProfileChangeStatus;\n if (current === undefined) {\n status = \"add\";\n } else if (canonicalTemplateOptions(current) === canonicalTemplateOptions(template.options)) {\n status = \"unchanged\";\n } else {\n status = \"update\";\n }\n changes.push({ name: template.name, options: template.options, status });\n }\n return { changes, changed: changes.some((change) => change.status !== \"unchanged\") };\n}\n\n/**\n * Computes the complete idempotent application plan for a profile against the\n * supplied tracker snapshot. The returned files/settings are exactly what the\n * apply step persists; nothing here touches disk.\n */\nexport function planProfileApplication(\n profile: ProjectProfileDefinition,\n current: ProfileCurrentState,\n): ProfileApplicationPlan {\n const types = planSchemaComponent(\n parseItemTypesFile(current.typesRaw),\n profile.types,\n (input) => normalizeAddTypeInput(input).name,\n serializeItemTypesFile,\n (file, input) => upsertItemType(file, normalizeAddTypeInput(input)),\n );\n const statuses = planSchemaComponent(\n parseStatusDefsFile(current.statusesRaw),\n profile.statuses,\n (input) => normalizeAddStatusInput(input).id,\n serializeStatusDefsFile,\n (file, input) => upsertStatusDef(file, normalizeAddStatusInput(input)),\n );\n const fields = planSchemaComponent(\n parseFieldsFile(current.fieldsRaw),\n profile.fields,\n (input) => normalizeAddFieldInput(input).key,\n serializeFieldsFile,\n (file, input) => upsertField(file, normalizeAddFieldInput(input)),\n );\n const workflows = planWorkflows(current.workflows, profile.workflows);\n const config = planConfig(profile, current.settings);\n const templates = planTemplates(profile, current.templates);\n const packages = profile.packages.map((recommendation) => ({\n spec: recommendation.spec,\n reason: recommendation.reason,\n status: current.installedPackages.has(recommendation.spec) ? (\"installed\" as const) : (\"recommended\" as const),\n }));\n const changed = types.changed || statuses.changed || fields.changed || workflows.changed || config.changed || templates.changed;\n return {\n profile: { name: profile.name, title: profile.title, summary: profile.summary },\n types,\n statuses,\n fields,\n workflows,\n config,\n templates,\n packages,\n changed,\n };\n}\n","/**\n * @module cli/commands/templates\n *\n * Implements the pm templates command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport {\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n} from \"../../sdk/cli-contracts.js\";\n\nconst TEMPLATE_DIRECTORY_NAME = \"templates\";\nconst TEMPLATE_FILE_EXTENSION = \".json\";\nconst TEMPLATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\n\nconst TEMPLATE_OPTION_REPEATABLE_KEYS = CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS.map((entry) => entry.target);\nconst TEMPLATE_OPTION_REPEATABLE_KEY_SET = new Set<string>(TEMPLATE_OPTION_REPEATABLE_KEYS);\n\ntype TemplateOptionValue = string | string[];\n/**\n * Restricts create template options values accepted by command, SDK, and storage contracts.\n */\nexport type CreateTemplateOptions = Record<string, TemplateOptionValue>;\n/**\n * Restricts template source values accepted by command, SDK, and storage contracts.\n */\nexport type TemplateSource = \"builtin\" | \"user\";\n\nconst BUILTIN_TEMPLATE_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst BUILTIN_TEMPLATES: Readonly<Record<string, CreateTemplateOptions>> = {\n bug: {\n type: \"Issue\",\n priority: \"1\",\n tags: \"bug\",\n acceptanceCriteria: \"Bug no longer reproduces with the steps below and a regression test guards it.\",\n expectedResult: \"Describe the correct behavior.\",\n actualResult: \"Describe the observed (buggy) behavior.\",\n body: \"## Repro steps\\n1. \\n2. \\n3. \\n\\n## Expected\\n\\n## Actual\\n\",\n },\n feature: {\n type: \"Feature\",\n priority: \"2\",\n tags: \"feature\",\n acceptanceCriteria: \"Feature is shipped behind agreed scope with tests and docs updated.\",\n whyNow: \"Explain why this is worth doing now (impact / urgency).\",\n body: \"## Goal\\n\\n## Why now\\n\\n## Out of scope\\n\",\n },\n spike: {\n type: \"Task\",\n priority: \"2\",\n tags: \"spike\",\n estimatedMinutes: \"120\",\n acceptanceCriteria: \"Timeboxed investigation complete; findings and a recommendation are recorded.\",\n body: \"## Question to answer\\n\\n## Timebox\\n2h\\n\\n## Findings\\n\\n## Recommendation\\n\",\n },\n chore: {\n type: \"Chore\",\n priority: \"3\",\n tags: \"chore\",\n acceptanceCriteria: \"Maintenance task done with no behavior change and green checks.\",\n body: \"## What\\n\\n## Why\\n\",\n },\n};\n\ninterface StoredCreateTemplateDocument {\n name: string;\n created_at: string;\n updated_at: string;\n options: CreateTemplateOptions;\n}\n\nexport const _testOnly = {\n normalizeTemplateName,\n extractTemplateOptions,\n parseStoredTemplateDocument,\n builtinTemplateDocument,\n readStoredTemplateDocument,\n};\n\n/**\n * Documents the templates save result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesSaveResult {\n name: string;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\n/**\n * Documents the templates list result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesListResult {\n templates: string[];\n count: number;\n builtin_templates: string[];\n user_templates: string[];\n}\n\n/**\n * Documents the templates show result payload exchanged by command, SDK, and package integrations.\n */\nexport interface TemplatesShowResult {\n name: string;\n source: TemplateSource;\n created_at: string;\n updated_at: string;\n path: string;\n options: CreateTemplateOptions;\n}\n\nfunction normalizeTemplateName(rawName: string): string {\n const name = rawName.trim();\n if (!TEMPLATE_NAME_PATTERN.test(name)) {\n throw new PmCliError(\n `Invalid template name \"${rawName}\". Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._-]*.`,\n EXIT_CODE.USAGE,\n );\n }\n return name;\n}\n\nfunction templatesDirectory(pmRoot: string): string {\n return path.join(pmRoot, TEMPLATE_DIRECTORY_NAME);\n}\n\nfunction templatePath(pmRoot: string, normalizedName: string): string {\n return path.join(templatesDirectory(pmRoot), `${normalizedName}${TEMPLATE_FILE_EXTENSION}`);\n}\n\nasync function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\nfunction sortTemplateOptions(options: CreateTemplateOptions): CreateTemplateOptions {\n return Object.fromEntries(\n Object.entries(options).sort(([left], [right]) => left.localeCompare(right)),\n ) as CreateTemplateOptions;\n}\n\nfunction extractTemplateOptions(rawOptions: Record<string, unknown>): CreateTemplateOptions {\n const next: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(rawOptions)) {\n if (value === undefined) {\n continue;\n }\n if (TEMPLATE_OPTION_REPEATABLE_KEY_SET.has(key)) {\n if (typeof value === \"string\") {\n next[key] = [value];\n continue;\n }\n if (!Array.isArray(value)) {\n continue;\n }\n const values = value.filter((entry): entry is string => typeof entry === \"string\");\n if (values.length > 0) {\n next[key] = values;\n }\n continue;\n }\n if (typeof value === \"string\") {\n next[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n next[key] = [...value];\n }\n }\n return sortTemplateOptions(next);\n}\n\nfunction parseStoredTemplateOptions(rawOptions: unknown, templateName: string): CreateTemplateOptions {\n if (typeof rawOptions !== \"object\" || rawOptions === null || Array.isArray(rawOptions)) {\n throw new PmCliError(`Template \"${templateName}\" has invalid options payload.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const optionsRecord = rawOptions as Record<string, unknown>;\n const normalized: CreateTemplateOptions = {};\n for (const [key, value] of Object.entries(optionsRecord)) {\n const normalizedKey = key.trim();\n if (normalizedKey.length === 0) {\n throw new PmCliError(\n `Template \"${templateName}\" contains an empty option key.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (typeof value === \"string\") {\n normalized[normalizedKey] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[normalizedKey] = [...value];\n continue;\n }\n throw new PmCliError(\n `Template \"${templateName}\" contains invalid value for option \"${normalizedKey}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return sortTemplateOptions(normalized);\n}\n\nfunction parseStoredTemplateDocument(raw: string, normalizedName: string): StoredCreateTemplateDocument {\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new PmCliError(`Template \"${normalizedName}\" contains invalid JSON.`, EXIT_CODE.GENERIC_FAILURE);\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw new PmCliError(`Template \"${normalizedName}\" has invalid document shape.`, EXIT_CODE.GENERIC_FAILURE);\n }\n const record = parsed as Record<string, unknown>;\n const options = parseStoredTemplateOptions(record.options, normalizedName);\n const now = nowIso();\n return {\n name: typeof record.name === \"string\" && record.name.trim().length > 0 ? record.name.trim() : normalizedName,\n created_at: typeof record.created_at === \"string\" ? record.created_at : now,\n updated_at: typeof record.updated_at === \"string\" ? record.updated_at : now,\n options,\n };\n}\n\nfunction builtinTemplateDocument(normalizedName: string): StoredCreateTemplateDocument | null {\n const options = BUILTIN_TEMPLATES[normalizedName];\n if (!options) {\n return null;\n }\n return {\n name: normalizedName,\n created_at: BUILTIN_TEMPLATE_TIMESTAMP,\n updated_at: BUILTIN_TEMPLATE_TIMESTAMP,\n options: sortTemplateOptions({ ...options }),\n };\n}\n\ninterface ResolvedTemplateDocument {\n document: StoredCreateTemplateDocument;\n source: TemplateSource;\n}\n\nasync function resolveTemplateDocument(pmRoot: string, normalizedName: string): Promise<ResolvedTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw !== null) {\n return { document: parseStoredTemplateDocument(raw, normalizedName), source: \"user\" };\n }\n const builtin = builtinTemplateDocument(normalizedName);\n if (builtin) {\n return { document: builtin, source: \"builtin\" };\n }\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n}\n\nasync function readStoredTemplateDocument(pmRoot: string, normalizedName: string): Promise<StoredCreateTemplateDocument> {\n const raw = await readFileIfExists(templatePath(pmRoot, normalizedName));\n if (raw === null) {\n throw new PmCliError(`Template \"${normalizedName}\" not found`, EXIT_CODE.NOT_FOUND);\n }\n return parseStoredTemplateDocument(raw, normalizedName);\n}\n\n/**\n * Implements load create template options for the public runtime surface of this module.\n */\nexport async function loadCreateTemplateOptions(pmRoot: string, rawTemplateName: string): Promise<CreateTemplateOptions> {\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document } = await resolveTemplateDocument(pmRoot, normalizedName);\n return document.options;\n}\n\n/**\n * Implements run templates save for the public runtime surface of this module.\n */\nexport async function runTemplatesSave(\n rawTemplateName: string,\n options: Record<string, unknown>,\n global: GlobalOptions,\n): Promise<TemplatesSaveResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const nextOptions = extractTemplateOptions(options);\n if (Object.keys(nextOptions).length === 0) {\n throw new PmCliError(\"templates save requires at least one create option flag\", EXIT_CODE.USAGE);\n }\n\n const now = nowIso();\n const storedPath = templatePath(pmRoot, normalizedName);\n let createdAt = now;\n if (await pathExists(storedPath)) {\n const existing = await readStoredTemplateDocument(pmRoot, normalizedName);\n createdAt = existing.created_at;\n }\n\n const document: StoredCreateTemplateDocument = {\n name: normalizedName,\n created_at: createdAt,\n updated_at: now,\n options: nextOptions,\n };\n await fs.mkdir(templatesDirectory(pmRoot), { recursive: true });\n await writeFileAtomic(storedPath, `${JSON.stringify(document, null, 2)}\\n`);\n return {\n name: document.name,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: storedPath,\n options: document.options,\n };\n}\n\nasync function readUserTemplateNames(pmRoot: string): Promise<string[]> {\n const dirPath = templatesDirectory(pmRoot);\n if (!(await pathExists(dirPath))) {\n return [];\n }\n const entries = await fs.readdir(dirPath);\n return entries\n .filter((entry) => entry.toLowerCase().endsWith(TEMPLATE_FILE_EXTENSION))\n .map((entry) => entry.slice(0, -TEMPLATE_FILE_EXTENSION.length))\n .filter((entry) => TEMPLATE_NAME_PATTERN.test(entry));\n}\n\n/**\n * Implements run templates list for the public runtime surface of this module.\n */\nexport async function runTemplatesList(global: GlobalOptions): Promise<TemplatesListResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const userTemplates = await readUserTemplateNames(pmRoot);\n const userTemplateSet = new Set<string>(userTemplates);\n const builtinTemplates = Object.keys(BUILTIN_TEMPLATES).filter((name) => !userTemplateSet.has(name));\n const sortedUser = [...userTemplates].sort((left, right) => left.localeCompare(right));\n const sortedBuiltin = [...builtinTemplates].sort((left, right) => left.localeCompare(right));\n const templates = [...new Set([...sortedUser, ...sortedBuiltin])].sort((left, right) => left.localeCompare(right));\n return {\n templates,\n count: templates.length,\n builtin_templates: sortedBuiltin,\n user_templates: sortedUser,\n };\n}\n\n/**\n * Implements run templates show for the public runtime surface of this module.\n */\nexport async function runTemplatesShow(rawTemplateName: string, global: GlobalOptions): Promise<TemplatesShowResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureTrackerInitialized(pmRoot);\n const normalizedName = normalizeTemplateName(rawTemplateName);\n const { document, source } = await resolveTemplateDocument(pmRoot, normalizedName);\n return {\n name: document.name,\n source,\n created_at: document.created_at,\n updated_at: document.updated_at,\n path: source === \"builtin\" ? `builtin:${normalizedName}` : templatePath(pmRoot, normalizedName),\n options: document.options,\n };\n}\n"],"names":["path","path","plan"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,OAAOA,WAAU;;;ACwEX,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