@unbrained/pm-cli 2026.6.6 → 2026.6.8
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/.claude-plugin/marketplace.json +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +79 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -2
- package/dist/cli/bootstrap-args.js +30 -13
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +74 -4
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +8 -0
- package/dist/cli/commands/aggregate.js +84 -7
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +10 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +20 -11
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.d.ts +1 -1
- package/dist/cli/commands/close.js +32 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +4 -3
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/completion.js +105 -43
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +5 -4
- package/dist/cli/commands/config.js +50 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/copy.d.ts +14 -0
- package/dist/cli/commands/copy.js +153 -0
- package/dist/cli/commands/copy.js.map +1 -0
- package/dist/cli/commands/extension/doctor.js +62 -2
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +8 -0
- package/dist/cli/commands/extension/install-sources.js +82 -2
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +6 -14
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +29 -0
- package/dist/cli/commands/extension.js +61 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.js +10 -2
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +9 -0
- package/dist/cli/commands/get.js +23 -2
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +10 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +39 -0
- package/dist/cli/commands/history-compact.js +262 -0
- package/dist/cli/commands/history-compact.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.js +48 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/list.d.ts +13 -2
- package/dist/cli/commands/list.js +189 -9
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +6 -4
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/reindex.js +8 -4
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +13 -2
- package/dist/cli/commands/schema.js +66 -12
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +11 -2
- package/dist/cli/commands/search.js +321 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/upgrade.js +4 -12
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/error-guidance.js +26 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +1 -0
- package/dist/cli/extension-command-help.js +3 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-content.js +10 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +18 -37
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +22 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +83 -39
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +31 -7
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +7 -5
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +26 -4
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-A3QKFSSF.js +16 -0
- package/dist/cli-bundle/chunks/{activity-JM6DTDND.js → activity-Q7XMIZIH.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-VNAHUNNF.js → aggregate-GBSHSXOB.js} +87 -17
- package/dist/cli-bundle/chunks/aggregate-GBSHSXOB.js.map +7 -0
- package/dist/cli-bundle/chunks/{aggregate-GI7WSZPH.js → aggregate-HKQJZUBG.js} +88 -18
- package/dist/cli-bundle/chunks/aggregate-HKQJZUBG.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-WMKRXKCE.js → append-3RFOU7P5.js} +8 -8
- package/dist/cli-bundle/chunks/{append-7H5N64R2.js → append-OM74OJVT.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KJE2FOS4.js → chunk-2BYKYPWY.js} +26 -4
- package/dist/cli-bundle/chunks/chunk-2BYKYPWY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js → chunk-2HMD3JM2.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js → chunk-2YPVCD7T.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3FI4SEFT.js → chunk-3E3MDBTB.js} +62 -38
- package/dist/cli-bundle/chunks/chunk-3E3MDBTB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-U5SXYXSY.js → chunk-3TXWDGPU.js} +287 -45
- package/dist/cli-bundle/chunks/chunk-3TXWDGPU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HZGUAH22.js → chunk-4TI3532H.js} +6 -7
- package/dist/cli-bundle/chunks/chunk-4TI3532H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js → chunk-4WYBLB6J.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js → chunk-5NVJA7IW.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-Q7SPNHLW.js → chunk-5WO2VKFA.js} +190 -16
- package/dist/cli-bundle/chunks/chunk-5WO2VKFA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IOR7LGF4.js → chunk-7NQIY7Z6.js} +89 -7
- package/dist/cli-bundle/chunks/chunk-7NQIY7Z6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ECCMVXGM.js → chunk-7WXGR44E.js} +305 -216
- package/dist/cli-bundle/chunks/chunk-7WXGR44E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js → chunk-AEMKH5WQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WOPXVEZP.js → chunk-ALSRBNYB.js} +28 -9
- package/dist/cli-bundle/chunks/chunk-ALSRBNYB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js → chunk-AXBUHLW7.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js → chunk-BFJPMUF5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js → chunk-BKQMJXWY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js → chunk-CBJXWXI5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FRAUKRU2.js → chunk-D7WK2PKB.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-D7WK2PKB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PROOHX4K.js → chunk-DV27WDA7.js} +104 -21
- package/dist/cli-bundle/chunks/chunk-DV27WDA7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js → chunk-EPWT7BEA.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js +112 -0
- package/dist/cli-bundle/chunks/chunk-ETZZU5QF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TPH5XEVD.js → chunk-F33AQIB4.js} +303 -207
- package/dist/cli-bundle/chunks/chunk-F33AQIB4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js → chunk-F33VC5EX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js → chunk-FGRJZVXD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js → chunk-FO2TYSQZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js → chunk-HOA3GMB6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js → chunk-HP35AVFS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js → chunk-J4DKAGTM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js → chunk-JS47EKLP.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-T3LC5LKB.js → chunk-K62SNVVE.js} +5 -6
- package/dist/cli-bundle/chunks/chunk-K62SNVVE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GU2ZJ2VV.js → chunk-KBKJVXUS.js} +35 -14
- package/dist/cli-bundle/chunks/chunk-KBKJVXUS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KWU6HG75.js → chunk-KCGMABHM.js} +101 -18
- package/dist/cli-bundle/chunks/chunk-KCGMABHM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js → chunk-KN4WSESY.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js → chunk-KP4KIUQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5FDATVEZ.js → chunk-KS2U7BZ3.js} +71 -17
- package/dist/cli-bundle/chunks/chunk-KS2U7BZ3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MITFDD35.js → chunk-KVXIQDJG.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js → chunk-L3LYL3ID.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-AO442XLN.js → chunk-M7UBTVFT.js} +10 -6
- package/dist/cli-bundle/chunks/{chunk-AO442XLN.js.map → chunk-M7UBTVFT.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js → chunk-MSH23UWO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js → chunk-N4SQZ7L3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js → chunk-NDSMKB2I.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js → chunk-NGEEXR2R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js → chunk-NLVCMVC7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js → chunk-NUKHZZNM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js → chunk-ODN53S6H.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js → chunk-OTY2YEH5.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js → chunk-OVSSE2JP.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-4LL6TK5B.js → chunk-PQDH3S54.js} +59 -35
- package/dist/cli-bundle/chunks/chunk-PQDH3S54.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js → chunk-QF4OPBAG.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-QO7EBBOM.js → chunk-QFVASU44.js} +38 -7
- package/dist/cli-bundle/chunks/chunk-QFVASU44.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js → chunk-QQPZYP73.js} +14 -14
- package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js → chunk-QWNUDGFQ.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-AY43SBIN.js → chunk-R4XIE7NQ.js} +54 -8
- package/dist/cli-bundle/chunks/chunk-R4XIE7NQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-52MAOQ6J.js → chunk-RISLL7XH.js} +71 -17
- package/dist/cli-bundle/chunks/chunk-RISLL7XH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GCOQW437.js → chunk-SDLEYY6A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W7XABV4H.js → chunk-SM3RMWGO.js} +191 -17
- package/dist/cli-bundle/chunks/chunk-SM3RMWGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js → chunk-TBLBEOEX.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-SKJWX3QB.js → chunk-TXKENAQP.js} +88 -6
- package/dist/cli-bundle/chunks/chunk-TXKENAQP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js → chunk-UEXNNF3K.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js → chunk-UMMJAJB2.js} +9 -9
- package/dist/cli-bundle/chunks/chunk-URJEZOLB.js +115 -0
- package/dist/cli-bundle/chunks/chunk-URJEZOLB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PDDFYW4X.js → chunk-VXBUXLVD.js} +27 -8
- package/dist/cli-bundle/chunks/chunk-VXBUXLVD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB3RUL2N.js → chunk-XEKZCBCS.js} +10 -6
- package/dist/cli-bundle/chunks/chunk-XEKZCBCS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js → chunk-XLSQ3QLT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js → chunk-XNGMIVQY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TCD3R2PF.js → chunk-XZS4MV37.js} +39 -8
- package/dist/cli-bundle/chunks/chunk-XZS4MV37.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js → chunk-YEFOCDIK.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5SFCOO6B.js → chunk-YJAKN2N2.js} +277 -35
- package/dist/cli-bundle/chunks/chunk-YJAKN2N2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2VBQ6ZXS.js → chunk-Z2HXAFFH.js} +27 -5
- package/dist/cli-bundle/chunks/chunk-Z2HXAFFH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3LB74A67.js → chunk-Z55JACL2.js} +53 -7
- package/dist/cli-bundle/chunks/chunk-Z55JACL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js → claim-NHBIIBOW.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js → claim-RNEBQCOO.js} +10 -10
- package/dist/cli-bundle/chunks/close-UNTFXVM3.js +13 -0
- package/dist/cli-bundle/chunks/{close-PTYFA45H.js → close-ZMXL2WDS.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-ERFO6LHR.js → close-many-CDPQGQUB.js} +37 -28
- package/dist/cli-bundle/chunks/close-many-CDPQGQUB.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-7CGIDPTJ.js → close-many-IQV5C2SI.js} +36 -27
- package/dist/cli-bundle/chunks/close-many-IQV5C2SI.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js → comments-EFVBHWPT.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-OONGABK5.js → comments-J5Q4IJPH.js} +10 -10
- package/dist/cli-bundle/chunks/{config-6FXCQKIF.js → config-72253M2O.js} +127 -12
- package/dist/cli-bundle/chunks/config-72253M2O.js.map +1 -0
- package/dist/cli-bundle/chunks/{config-U4RZ4CQB.js → config-VFYA6BMI.js} +128 -13
- package/dist/cli-bundle/chunks/config-VFYA6BMI.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-FYYJGFWS.js → context-AVLO4IFH.js} +14 -14
- package/dist/cli-bundle/chunks/{context-FYYJGFWS.js.map → context-AVLO4IFH.js.map} +2 -2
- package/dist/cli-bundle/chunks/{context-YMJ3Z2HQ.js → context-WMSI2D65.js} +15 -15
- package/dist/cli-bundle/chunks/context-WMSI2D65.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-RFSPGVVJ.js → contracts-D4BN3VSQ.js} +7 -5
- package/dist/cli-bundle/chunks/contracts-D4BN3VSQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-QDB6OMLQ.js → contracts-RGPOBLPL.js} +8 -6
- package/dist/cli-bundle/chunks/contracts-RGPOBLPL.js.map +1 -0
- package/dist/cli-bundle/chunks/copy-H6TXHK7S.js +185 -0
- package/dist/cli-bundle/chunks/copy-H6TXHK7S.js.map +7 -0
- package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js +182 -0
- package/dist/cli-bundle/chunks/copy-WXE3OOLZ.js.map +1 -0
- package/dist/cli-bundle/chunks/create-EZWAMUKR.js +27 -0
- package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js → create-PUAIJEZ7.js} +13 -13
- package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js → delete-PKR2JHLH.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js → delete-WBME6WG5.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js → deps-4BQEDV4L.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js → deps-KWHQRO75.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js → docs-364GT3ZR.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js → docs-SCNBUGSV.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-VDY2U33M.js → extension-CRE7JM47.js} +8 -6
- package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js → extension-KK2UPXJD.js} +8 -6
- package/dist/cli-bundle/chunks/{files-ISZJGILQ.js → files-3GESQAWL.js} +9 -9
- package/dist/cli-bundle/chunks/{files-WKOD326U.js → files-66EHM5ZR.js} +9 -9
- package/dist/cli-bundle/chunks/{gc-JDVJ6OQ2.js → gc-D5IWOKQH.js} +13 -5
- package/dist/cli-bundle/chunks/gc-D5IWOKQH.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-ULPVWMTN.js → gc-MOQDND5J.js} +12 -4
- package/dist/cli-bundle/chunks/gc-MOQDND5J.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-RV37HT3G.js → get-7J2ZCBV5.js} +34 -12
- package/dist/cli-bundle/chunks/get-7J2ZCBV5.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-WXU6WI5P.js → get-WXSLXV3K.js} +33 -11
- package/dist/cli-bundle/chunks/get-WXSLXV3K.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-LOI2HHKB.js → health-B6AEM7BV.js} +21 -13
- package/dist/cli-bundle/chunks/health-B6AEM7BV.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-6L6EH4WR.js → health-YMZGOMVX.js} +20 -12
- package/dist/cli-bundle/chunks/health-YMZGOMVX.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-PKN67D5O.js → history-TJTO5GCR.js} +10 -10
- package/dist/cli-bundle/chunks/history-ZERISU2L.js +20 -0
- package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js +290 -0
- package/dist/cli-bundle/chunks/history-compact-CKNN6UKW.js.map +7 -0
- package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js +287 -0
- package/dist/cli-bundle/chunks/history-compact-N2Q7IR3T.js.map +1 -0
- package/dist/cli-bundle/chunks/history-redact-GODBYT5A.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js → history-redact-JUXUOH54.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js → history-repair-CCCPBNTF.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js → history-repair-TDBBSRVK.js} +11 -11
- package/dist/cli-bundle/chunks/{init-P56QYWJF.js → init-6ZPKD3YN.js} +9 -8
- package/dist/cli-bundle/chunks/init-CBZHXBR3.js +17 -0
- package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js → learnings-U7U2FNIO.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js → learnings-WYNTYQ5T.js} +10 -10
- package/dist/cli-bundle/chunks/list-7MTPPZHC.js +20 -0
- package/dist/cli-bundle/chunks/{list-FGOWQMSM.js → list-JGP7ODML.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js → notes-P25YVTEG.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js → notes-QIF6A7XS.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js → plan-RACB5PI6.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-SLMODHWX.js → plan-SSBJFWXA.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-POCFZ5JW.js → register-list-query-5IXDPUZ6.js} +31 -25
- package/dist/cli-bundle/chunks/register-list-query-5IXDPUZ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-WST76HSQ.js → register-list-query-GQAEIG4K.js} +30 -24
- package/dist/cli-bundle/chunks/register-list-query-GQAEIG4K.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-N5GSUZJV.js → register-mutation-FAS4YG63.js} +72 -50
- package/dist/cli-bundle/chunks/register-mutation-FAS4YG63.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-OA675SOU.js → register-mutation-YZCUILGO.js} +71 -49
- package/dist/cli-bundle/chunks/register-mutation-YZCUILGO.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-N3PMHXH5.js → register-operations-IBYWNJN5.js} +57 -34
- package/dist/cli-bundle/chunks/register-operations-IBYWNJN5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-GNHBE5I3.js → register-operations-S2BOLUPF.js} +58 -35
- package/dist/cli-bundle/chunks/register-operations-S2BOLUPF.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js → register-setup-ABA2JPWO.js} +20 -19
- package/dist/cli-bundle/chunks/{register-setup-ZHJI2DI3.js.map → register-setup-ABA2JPWO.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-JIMPKJKV.js → register-setup-JRZ4UMWZ.js} +21 -20
- package/dist/cli-bundle/chunks/register-setup-JRZ4UMWZ.js.map +1 -0
- package/dist/cli-bundle/chunks/restore-3JRX27QW.js +17 -0
- package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js → restore-K72ZNPEP.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-2NOO6NGB.js → schema-3VKRDBLC.js} +76 -20
- package/dist/cli-bundle/chunks/schema-3VKRDBLC.js.map +7 -0
- package/dist/cli-bundle/chunks/{schema-EBI4NLUO.js → schema-UL4B2JX5.js} +77 -21
- package/dist/cli-bundle/chunks/schema-UL4B2JX5.js.map +1 -0
- package/dist/cli-bundle/chunks/{search-OA6JX27A.js → search-632WJ7GO.js} +516 -41
- package/dist/cli-bundle/chunks/search-632WJ7GO.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-JPUQTVCY.js → search-EQDHSE4G.js} +510 -42
- package/dist/cli-bundle/chunks/search-EQDHSE4G.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js → stats-O4UTMJMC.js} +7 -7
- package/dist/cli-bundle/chunks/{stats-CV54BAWY.js → stats-WLJ3XBF5.js} +7 -7
- package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js → telemetry-EUVHFSQU.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js → telemetry-NRVWX25E.js} +4 -4
- package/dist/cli-bundle/chunks/{test-WBROAJIE.js → test-GXUBQNUC.js} +14 -13
- package/dist/cli-bundle/chunks/test-XN7RJL5Z.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js → test-all-UTFXC7S2.js} +16 -15
- package/dist/cli-bundle/chunks/{test-all-N6NSRDTV.js.map → test-all-UTFXC7S2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js → test-all-XM6OKI3L.js} +14 -13
- package/dist/cli-bundle/chunks/{test-all-NTOZ7C3M.js.map → test-all-XM6OKI3L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js → test-runs-7FHCPEA3.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js → test-runs-IK6E2HNX.js} +5 -5
- package/dist/cli-bundle/chunks/update-LFBSEW3N.js +21 -0
- package/dist/cli-bundle/chunks/update-U4B4OMHZ.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js → update-many-5KD33MKY.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js → update-many-N3YTM7K4.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-BLI7XBAJ.js → upgrade-5SRFLUNW.js} +8 -14
- package/dist/cli-bundle/chunks/upgrade-5SRFLUNW.js.map +7 -0
- package/dist/cli-bundle/chunks/{upgrade-LXPOQKFV.js → upgrade-FFXGO43H.js} +9 -15
- package/dist/cli-bundle/chunks/upgrade-FFXGO43H.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js → validate-CRWXZILW.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-L5J6A7YO.js.map → validate-CRWXZILW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js → validate-T3LPWSZG.js} +18 -17
- package/dist/cli-bundle/chunks/{validate-AGOAUOVW.js.map → validate-T3LPWSZG.js.map} +1 -1
- package/dist/cli-bundle/main.js +160 -87
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.d.ts +8 -8
- package/dist/core/config/nested-settings.js +71 -7
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/config/positional-value.js +4 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +36 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +46 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/fs-utils.js +29 -4
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/history/drift-scan.d.ts +3 -4
- package/dist/core/history/drift-scan.js +71 -18
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/id.js +4 -5
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/item-format.js +7 -3
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +7 -0
- package/dist/core/item/toon-decode.js +11 -2
- package/dist/core/item/toon-decode.js.map +1 -1
- package/dist/core/item/type-registry.js +25 -7
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/packages/root.d.ts +10 -0
- package/dist/core/packages/root.js +24 -2
- package/dist/core/packages/root.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +3 -6
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/background-refresh.d.ts +0 -8
- package/dist/core/search/background-refresh.js +2 -9
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/cache.js +5 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +6 -0
- package/dist/core/search/corpus.js +22 -9
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/embedding-batches.js +10 -7
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/relevance.d.ts +29 -0
- package/dist/core/search/relevance.js +226 -0
- package/dist/core/search/relevance.js.map +1 -0
- package/dist/core/search/vector-stores.d.ts +3 -0
- package/dist/core/search/vector-stores.js +27 -16
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/instrument.js +4 -17
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.js +15 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +6 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +8 -0
- package/dist/core/shared/primitives.js +29 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/time.js +42 -6
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/paths.js +40 -8
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +11 -0
- package/dist/core/store/settings-validator.js +14 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +109 -12
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +86 -5
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +109 -19
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
- package/dist/sdk/cli-contracts/commander-types.js +15 -4
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +7 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +32 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts.js +44 -12
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +51 -1
- package/dist/sdk/testing.js +93 -2
- package/dist/sdk/testing.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +3 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +4 -4
- package/docs/CODEX_PLUGIN.md +1 -1
- package/docs/COMMANDS.md +14 -5
- package/docs/CONFIGURATION.md +28 -1
- package/docs/EXTENSIONS.md +17 -9
- package/docs/QUICKSTART.md +1 -1
- package/docs/RELEASING.md +17 -0
- package/docs/SDK.md +66 -0
- package/docs/TESTING.md +14 -0
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-governance-audit/README.md +14 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +39 -1
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +40 -2
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +1 -1
- package/packages/pm-governance-audit/package.json +4 -2
- package/packages/pm-lifecycle-hooks/README.md +21 -0
- package/packages/pm-search-advanced/README.md +38 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +17 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +216 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +271 -2
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -7
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-VNAHUNNF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GU2ZJ2VV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QO7EBBOM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T3LC5LKB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +0 -1
- package/dist/cli-bundle/chunks/close-3HDWDA3L.js +0 -13
- package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +0 -1
- package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +0 -1
- package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +0 -7
- package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +0 -7
- package/dist/cli-bundle/chunks/create-JTZNCTQC.js +0 -27
- package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +0 -7
- package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +0 -1
- package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +0 -7
- package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +0 -7
- package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +0 -1
- package/dist/cli-bundle/chunks/history-2BA3T5AE.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +0 -19
- package/dist/cli-bundle/chunks/init-HIVSNX3O.js +0 -16
- package/dist/cli-bundle/chunks/list-MUSQNMTD.js +0 -20
- package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-D4RGNX33.js +0 -17
- package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +0 -1
- package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +0 -1
- package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +0 -7
- package/dist/cli-bundle/chunks/test-MXX3E5JL.js +0 -31
- package/dist/cli-bundle/chunks/update-OSV3NAQB.js +0 -25
- package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +0 -21
- package/dist/cli-bundle/chunks/upgrade-BLI7XBAJ.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-CVXTCHYY.js.map → activity-A3QKFSSF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-JM6DTDND.js.map → activity-Q7XMIZIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-WMKRXKCE.js.map → append-3RFOU7P5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-7H5N64R2.js.map → append-OM74OJVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTGLRY2Y.js.map → chunk-2HMD3JM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PRJCELV4.js.map → chunk-2YPVCD7T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2HVRUSQA.js.map → chunk-4WYBLB6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R6UFP2GE.js.map → chunk-5NVJA7IW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJCLN2R.js.map → chunk-AEMKH5WQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ER6DXH5.js.map → chunk-AXBUHLW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BQHUILZS.js.map → chunk-BFJPMUF5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I6BNFU5X.js.map → chunk-BKQMJXWY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XLTD2HN3.js.map → chunk-CBJXWXI5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3BWOVLTH.js.map → chunk-EPWT7BEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NUZ5HKR4.js.map → chunk-F33VC5EX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WKY2IBOQ.js.map → chunk-FGRJZVXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-77GFDHGF.js.map → chunk-FO2TYSQZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GXSUPCBV.js.map → chunk-HOA3GMB6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OVQCEJPG.js.map → chunk-HP35AVFS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KJ33AOCY.js.map → chunk-J4DKAGTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ME2YH6FN.js.map → chunk-JS47EKLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I2HSTRJF.js.map → chunk-KN4WSESY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RZN6VURO.js.map → chunk-KP4KIUQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MITFDD35.js.map → chunk-KVXIQDJG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJGCZSIQ.js.map → chunk-L3LYL3ID.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UM2GBHS4.js.map → chunk-MSH23UWO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LCM63IXU.js.map → chunk-N4SQZ7L3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3VAM3NNM.js.map → chunk-NDSMKB2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6P6GGMOG.js.map → chunk-NGEEXR2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PO3GSVFV.js.map → chunk-NLVCMVC7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N7ACFE26.js.map → chunk-NUKHZZNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GGYWB3Y2.js.map → chunk-ODN53S6H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-23YFZ3IG.js.map → chunk-OTY2YEH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2RSPZI5H.js.map → chunk-OVSSE2JP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2VVCGBNV.js.map → chunk-QF4OPBAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WSMOSYRD.js.map → chunk-QQPZYP73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OZ7NSQHL.js.map → chunk-QWNUDGFQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GCOQW437.js.map → chunk-SDLEYY6A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PIU6RSL3.js.map → chunk-TBLBEOEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YL2DJGYS.js.map → chunk-UEXNNF3K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UBOPJT3S.js.map → chunk-UMMJAJB2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KAG77BY3.js.map → chunk-XLSQ3QLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E5FJNAZA.js.map → chunk-XNGMIVQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RWPSOIEE.js.map → chunk-YEFOCDIK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-4DBF6RVG.js.map → claim-NHBIIBOW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-X2P4IB7J.js.map → claim-RNEBQCOO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3HDWDA3L.js.map → close-UNTFXVM3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-PTYFA45H.js.map → close-ZMXL2WDS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QKBYCWKD.js.map → comments-EFVBHWPT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-OONGABK5.js.map → comments-J5Q4IJPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JTZNCTQC.js.map → create-EZWAMUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-I5L4EYYZ.js.map → create-PUAIJEZ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-7HPGI4GZ.js.map → delete-PKR2JHLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-VXUPH5RS.js.map → delete-WBME6WG5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-JSRRWC3Z.js.map → deps-4BQEDV4L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-SCZIFK2Z.js.map → deps-KWHQRO75.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GJK6K4VP.js.map → docs-364GT3ZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WW4N3MBM.js.map → docs-SCNBUGSV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-VDY2U33M.js.map → extension-CRE7JM47.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-J7IBMFTD.js.map → extension-KK2UPXJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-ISZJGILQ.js.map → files-3GESQAWL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-WKOD326U.js.map → files-66EHM5ZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-PKN67D5O.js.map → history-TJTO5GCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-2BA3T5AE.js.map → history-ZERISU2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-JBZNXHGR.js.map → history-redact-GODBYT5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-V4FOJGS7.js.map → history-redact-JUXUOH54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-HIBCBIKK.js.map → history-repair-CCCPBNTF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-SDMHR7JT.js.map → history-repair-TDBBSRVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-P56QYWJF.js.map → init-6ZPKD3YN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HIVSNX3O.js.map → init-CBZHXBR3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-MIXSESLK.js.map → learnings-U7U2FNIO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-GDFRG5J7.js.map → learnings-WYNTYQ5T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-MUSQNMTD.js.map → list-7MTPPZHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-FGOWQMSM.js.map → list-JGP7ODML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-5UK3GEH2.js.map → notes-P25YVTEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-4XVSH2AZ.js.map → notes-QIF6A7XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-DUMBV3QB.js.map → plan-RACB5PI6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-SLMODHWX.js.map → plan-SSBJFWXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-D4RGNX33.js.map → restore-3JRX27QW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-PBL6T5TW.js.map → restore-K72ZNPEP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-XYB6KTFG.js.map → stats-O4UTMJMC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-CV54BAWY.js.map → stats-WLJ3XBF5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-LMJ7PFUO.js.map → telemetry-EUVHFSQU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-NCMEPJNR.js.map → telemetry-NRVWX25E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-WBROAJIE.js.map → test-GXUBQNUC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-MXX3E5JL.js.map → test-XN7RJL5Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-V6A7LPWZ.js.map → test-runs-7FHCPEA3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-WMVTQU3Y.js.map → test-runs-IK6E2HNX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-YRXSUGYQ.js.map → update-LFBSEW3N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-OSV3NAQB.js.map → update-U4B4OMHZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-KGGEYABR.js.map → update-many-5KD33MKY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-EM6OXYGO.js.map → update-many-N3YTM7K4.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sources":["cli/commands/init.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ensureRuntimeSchemaFileScaffold,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n} from \"../../core/schema/item-types-file.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\nexport type InitTypePresetName = \"agile\" | \"ops\" | \"research\";\n\nexport interface InitRegisteredTypePresetSummary {\n name: InitTypePresetName;\n registered: string[];\n updated: string[];\n file: string;\n}\n\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n}\n\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n typePreset?: string;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n hint: string;\n}\n\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\nconst INIT_TYPE_PRESET_NAMES: InitTypePresetName[] = [\"agile\", \"ops\", \"research\"];\n\nconst INIT_TYPE_PRESET_DEFINITIONS: Record<InitTypePresetName, Array<Parameters<typeof normalizeAddTypeInput>[0]>> = {\n agile: [\n {\n name: \"Story\",\n description: \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description: \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description: \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description: \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description: \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description: \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeInitTypePreset(rawValue: string | undefined): InitTypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--type-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --type-preset value \"${rawValue}\". Allowed: ${INIT_TYPE_PRESET_NAMES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function registerInitTypePreset(\n pmRoot: string,\n settings: PmSettings,\n preset: InitTypePresetName,\n): Promise<InitRegisteredTypePresetSummary> {\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n let nextFile = parsed;\n const registered: string[] = [];\n const updated: string[] = [];\n for (const rawDefinition of INIT_TYPE_PRESET_DEFINITIONS[preset]) {\n const normalized = normalizeAddTypeInput(rawDefinition);\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? updated : registered).push(upsert.definition.name);\n }\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n return {\n name: preset,\n registered,\n updated,\n file: typesPath,\n };\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = readline.createInterface({ input, output });\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const resolvedPreset = normalizeInitGovernancePreset(presetAnswer.trim().length > 0 ? presetAnswer : \"minimal\") ?? \"minimal\";\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const pmRoot = resolvePmRoot(cwd, global.path);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n let wizardUsed = false;\n\n for (const subdir of PM_REQUIRED_SUBDIRS) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n let normalizedPrefix = normalizePrefix(prefixArg);\n const presetFromOption = normalizeInitGovernancePreset(options.preset);\n const useDefaults = options.defaults === true;\n const authorFromOption = normalizeOptionalInitAuthor(options.author);\n const installBundledPackages = options.withPackages === true;\n const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);\n const typePreset = normalizeInitTypePreset(options.typePreset);\n let chosenPreset = presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n\n let settings: PmSettings;\n if (settingsExists) {\n settings = await readSettings(pmRoot);\n warnings.push(`already_exists:${settingsPath}`);\n let changed = false;\n if (prefixArg !== undefined && settings.id_prefix !== normalizedPrefix) {\n settings.id_prefix = normalizedPrefix;\n warnings.push(`updated:id_prefix:${normalizedPrefix}`);\n changed = true;\n }\n if (presetFromOption !== undefined && settings.governance.preset !== presetFromOption) {\n applyGovernancePreset(settings, presetFromOption);\n warnings.push(`updated:governance_preset:${presetFromOption}`);\n changed = true;\n }\n if (authorFromOption !== undefined && settings.author_default !== authorFromOption) {\n settings.author_default = authorFromOption;\n warnings.push(`updated:author_default:${authorFromOption}`);\n changed = true;\n }\n if (changed) {\n await writeSettings(pmRoot, settings);\n }\n } else {\n if (presetFromOption === undefined && !useDefaults && process.stdin.isTTY === true && process.stdout.isTTY === true) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (authorFromOption !== undefined) {\n settings.author_default = authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(pmRoot, settings);\n }\n\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: pmRoot,\n cwd,\n mode: agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings,\n });\n warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(pmRoot, settings);\n }\n\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n\n let registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n if (typePreset !== undefined) {\n registeredTypePreset = await registerInitTypePreset(pmRoot, settings, typePreset);\n warnings.push(`registered_type_preset:${typePreset}`);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n settings = await readSettings(pmRoot);\n }\n\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const typeFolder of typeRegistry.folders) {\n if ((PM_REQUIRED_SUBDIRS as readonly string[]).includes(typeFolder)) {\n continue;\n }\n const target = path.join(pmRoot, typeFolder);\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n let installedPackages: InitInstalledPackagesSummary | undefined;\n if (installBundledPackages) {\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n }\n\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n if (registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${registeredTypePreset.registered[0] ?? registeredTypePreset.updated[0]}`);\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of agentGuidanceResult.next_steps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidanceResult.summary,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAE/H,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE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QAAQ,CAAC,UAAU,CAAC,MAAM;QAC7C,WAAW,EAAE,UAAU;QACvB,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,mBAAmB,CAAC,OAAO;KAC5C,CAAC;AACJ,CAAC","debugId":"9395c248-0605-5d4c-bc9a-ce5b433a4fb0"}
|
|
1
|
+
{"version":3,"file":"init.js","sources":["cli/commands/init.ts"],"sourceRoot":"/","sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ensureRuntimeSchemaFileScaffold,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n normalizeAddTypeInput,\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n} from \"../../core/schema/item-types-file.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\nexport type InitTypePresetName = \"agile\" | \"ops\" | \"research\";\n\nexport interface InitRegisteredTypePresetSummary {\n name: InitTypePresetName;\n registered: string[];\n updated: string[];\n file: string;\n}\n\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n}\n\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n typePreset?: string;\n force?: boolean;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceSummary;\n hint: string;\n}\n\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\nconst INIT_TYPE_PRESET_NAMES: InitTypePresetName[] = [\"agile\", \"ops\", \"research\"];\n\nconst INIT_TYPE_PRESET_DEFINITIONS: Record<InitTypePresetName, Array<Parameters<typeof normalizeAddTypeInput>[0]>> = {\n agile: [\n {\n name: \"Story\",\n description: \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description: \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description: \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description: \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description: \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description: \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeInitTypePreset(rawValue: string | undefined): InitTypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--type-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --type-preset value \"${rawValue}\". Allowed: ${INIT_TYPE_PRESET_NAMES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function registerInitTypePreset(\n pmRoot: string,\n settings: PmSettings,\n preset: InitTypePresetName,\n): Promise<InitRegisteredTypePresetSummary> {\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n let nextFile = parsed;\n const registered: string[] = [];\n const updated: string[] = [];\n for (const rawDefinition of INIT_TYPE_PRESET_DEFINITIONS[preset]) {\n const normalized = normalizeAddTypeInput(rawDefinition);\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? updated : registered).push(upsert.definition.name);\n }\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n return {\n name: preset,\n registered,\n updated,\n file: typesPath,\n };\n}\n\nasync function isLikelyWorkspaceRoot(candidate: string): Promise<boolean> {\n const indicators = [\n \".git\",\n \"package.json\",\n \"pnpm-workspace.yaml\",\n \"AGENTS.md\",\n path.join(\".agents\", \"pm\"),\n ];\n for (const indicator of indicators) {\n if (await pathExists(path.join(candidate, indicator))) {\n return true;\n }\n }\n return false;\n}\n\nasync function assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot: string, global: GlobalOptions, force: boolean): Promise<void> {\n if (global.path === undefined || force) {\n return;\n }\n if (await pathExists(path.join(pmRoot, \"settings.json\"))) {\n return;\n }\n if (!(await isLikelyWorkspaceRoot(pmRoot))) {\n return;\n }\n const nestedTracker = path.join(pmRoot, \".agents\", \"pm\");\n throw new PmCliError(\n `Refusing to initialize tracker files directly in workspace root \"${pmRoot}\".`,\n EXIT_CODE.USAGE,\n {\n code: \"workspace_root_pm_path\",\n type: \"urn:pm-cli:error:workspace_root_pm_path\",\n why: \"--pm-path/--path points at the tracker storage directory itself, not the repository workspace. Point it at .agents/pm or pass --force if you intentionally want root-level tracker files.\",\n examples: [\n `pm --pm-path ${nestedTracker} init --yes`,\n \"pm init --yes\",\n `pm --pm-path ${pmRoot} init --yes --force`,\n ],\n nextSteps: [\n \"Use --pm-path <repo>/.agents/pm for repository-local tracker storage.\",\n \"Use PM_PATH only for sandboxed tests or explicit tracker roots.\",\n \"Pass --force only when root-level tracker files are intentional.\",\n ],\n recovery: {\n next_best_command: `pm --pm-path ${nestedTracker} init --yes`,\n },\n },\n );\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = readline.createInterface({ input, output });\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const resolvedPreset = normalizeInitGovernancePreset(presetAnswer.trim().length > 0 ? presetAnswer : \"minimal\") ?? \"minimal\";\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const pmRoot = resolvePmRoot(cwd, global.path);\n await assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot, global, options.force === true);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n let wizardUsed = false;\n\n for (const subdir of PM_REQUIRED_SUBDIRS) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n let normalizedPrefix = normalizePrefix(prefixArg);\n const presetFromOption = normalizeInitGovernancePreset(options.preset);\n const useDefaults = options.defaults === true;\n const authorFromOption = normalizeOptionalInitAuthor(options.author);\n const installBundledPackages = options.withPackages === true;\n const agentGuidanceMode = normalizeInitAgentGuidanceMode(options.agentGuidance);\n const typePreset = normalizeInitTypePreset(options.typePreset);\n let chosenPreset = presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n\n let settings: PmSettings;\n if (settingsExists) {\n settings = await readSettings(pmRoot);\n warnings.push(`already_exists:${settingsPath}`);\n let changed = false;\n if (prefixArg !== undefined && settings.id_prefix !== normalizedPrefix) {\n settings.id_prefix = normalizedPrefix;\n warnings.push(`updated:id_prefix:${normalizedPrefix}`);\n changed = true;\n }\n if (presetFromOption !== undefined && settings.governance.preset !== presetFromOption) {\n applyGovernancePreset(settings, presetFromOption);\n warnings.push(`updated:governance_preset:${presetFromOption}`);\n changed = true;\n }\n if (authorFromOption !== undefined && settings.author_default !== authorFromOption) {\n settings.author_default = authorFromOption;\n warnings.push(`updated:author_default:${authorFromOption}`);\n changed = true;\n }\n if (changed) {\n await writeSettings(pmRoot, settings);\n }\n } else {\n if (presetFromOption === undefined && !useDefaults && process.stdin.isTTY === true && process.stdout.isTTY === true) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (authorFromOption !== undefined) {\n settings.author_default = authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(pmRoot, settings);\n }\n\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: pmRoot,\n cwd,\n mode: agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings,\n });\n warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(pmRoot, settings);\n }\n\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n\n let registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n if (typePreset !== undefined) {\n registeredTypePreset = await registerInitTypePreset(pmRoot, settings, typePreset);\n warnings.push(`registered_type_preset:${typePreset}`);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n settings = await readSettings(pmRoot);\n }\n\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const typeFolder of typeRegistry.folders) {\n if ((PM_REQUIRED_SUBDIRS as readonly string[]).includes(typeFolder)) {\n continue;\n }\n const target = path.join(pmRoot, typeFolder);\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n\n let installedPackages: InitInstalledPackagesSummary | undefined;\n if (installBundledPackages) {\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n }\n\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n if (registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${registeredTypePreset.registered[0] ?? registeredTypePreset.updated[0]}`);\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of agentGuidanceResult.next_steps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidanceResult.summary,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAA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mB,CAAC,OAAO;KAC5C,CAAC;AACJ,CAAC","debugId":"58fd8bd3-ecc5-5bc5-9330-9d5af3a2c650"}
|
|
@@ -26,6 +26,8 @@ export interface ListOptions {
|
|
|
26
26
|
fields?: string;
|
|
27
27
|
sort?: string;
|
|
28
28
|
order?: string;
|
|
29
|
+
tree?: boolean;
|
|
30
|
+
treeDepth?: string;
|
|
29
31
|
excludeTerminal?: boolean;
|
|
30
32
|
[key: string]: unknown;
|
|
31
33
|
}
|
|
@@ -37,9 +39,18 @@ export declare const LIST_SORT_FIELDS: readonly ["priority", "deadline", "update
|
|
|
37
39
|
export type ListSortField = (typeof LIST_SORT_FIELDS)[number];
|
|
38
40
|
export declare const LIST_SORT_ORDER_VALUES: readonly ["asc", "desc"];
|
|
39
41
|
export type ListSortOrder = (typeof LIST_SORT_ORDER_VALUES)[number];
|
|
40
|
-
|
|
42
|
+
interface ListResultBase {
|
|
41
43
|
items: ListedItem[];
|
|
42
44
|
count: number;
|
|
45
|
+
warnings?: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface ListCompactResult extends ListResultBase {
|
|
48
|
+
filters: Record<string, unknown>;
|
|
49
|
+
projection?: undefined;
|
|
50
|
+
sorting?: undefined;
|
|
51
|
+
now?: undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface ListVerboseResult extends ListResultBase {
|
|
43
54
|
filters: Record<string, unknown>;
|
|
44
55
|
projection: {
|
|
45
56
|
mode: ListProjectionMode;
|
|
@@ -50,7 +61,7 @@ export interface ListResult {
|
|
|
50
61
|
order: ListSortOrder;
|
|
51
62
|
};
|
|
52
63
|
now: string;
|
|
53
|
-
warnings?: string[];
|
|
54
64
|
}
|
|
65
|
+
export type ListResult = ListCompactResult | ListVerboseResult;
|
|
55
66
|
export declare function runList(status: ItemStatus | undefined, options: ListOptions, global: GlobalOptions): Promise<ListResult>;
|
|
56
67
|
export {};
|
|
@@ -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]="380accc4-3226-5273-bad1-679bc6595543")}catch(e){}}();
|
|
3
3
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
4
4
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
5
5
|
import { toItemRecord } from "../../core/item/item-record.js";
|
|
@@ -20,11 +20,93 @@ export const LIST_SORT_FIELDS = ["priority", "deadline", "updated_at", "created_
|
|
|
20
20
|
export const LIST_SORT_ORDER_VALUES = ["asc", "desc"];
|
|
21
21
|
const DEFAULT_COMPACT_LIST_FIELDS = ["id", "title", "status", "type", "priority", "parent", "updated_at"];
|
|
22
22
|
const BRIEF_LIST_FIELDS = ["id", "status", "type", "title"];
|
|
23
|
+
const TREE_METADATA_FIELDS = ["tree_depth", "tree_parent", "tree_children", "tree_title"];
|
|
23
24
|
// A projection that selects any heavy collection field (or `--full`, which returns
|
|
24
25
|
// items verbatim) must load the full metadata; everything else takes the light path.
|
|
25
26
|
// Sourced from the single HEAVY_METADATA_KEYS definition in the cache layer so the
|
|
26
27
|
// light/heavy split can never drift between the cache and the projection routing.
|
|
27
28
|
const HEAVY_PROJECTION_FIELDS = new Set(HEAVY_METADATA_KEYS);
|
|
29
|
+
function isNonEmptyRecord(value) {
|
|
30
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length > 0;
|
|
31
|
+
}
|
|
32
|
+
function buildCompactListFilterSummary(params) {
|
|
33
|
+
const { filtersStatus, options, treeEnabled, treeDepth, sortField, sortOrder, runtimeFieldFilters, } = params;
|
|
34
|
+
const filters = {};
|
|
35
|
+
if (filtersStatus !== null) {
|
|
36
|
+
filters.status = filtersStatus;
|
|
37
|
+
}
|
|
38
|
+
if (options.type !== undefined) {
|
|
39
|
+
filters.type = options.type;
|
|
40
|
+
}
|
|
41
|
+
if (options.tag !== undefined) {
|
|
42
|
+
filters.tag = options.tag;
|
|
43
|
+
}
|
|
44
|
+
if (options.priority !== undefined) {
|
|
45
|
+
filters.priority = options.priority;
|
|
46
|
+
}
|
|
47
|
+
if (options.deadlineBefore !== undefined) {
|
|
48
|
+
filters.deadline_before = options.deadlineBefore;
|
|
49
|
+
}
|
|
50
|
+
if (options.deadlineAfter !== undefined) {
|
|
51
|
+
filters.deadline_after = options.deadlineAfter;
|
|
52
|
+
}
|
|
53
|
+
if (options.updatedAfter !== undefined) {
|
|
54
|
+
filters.updated_after = options.updatedAfter;
|
|
55
|
+
}
|
|
56
|
+
if (options.updatedBefore !== undefined) {
|
|
57
|
+
filters.updated_before = options.updatedBefore;
|
|
58
|
+
}
|
|
59
|
+
if (options.createdAfter !== undefined) {
|
|
60
|
+
filters.created_after = options.createdAfter;
|
|
61
|
+
}
|
|
62
|
+
if (options.createdBefore !== undefined) {
|
|
63
|
+
filters.created_before = options.createdBefore;
|
|
64
|
+
}
|
|
65
|
+
if (options.ids !== undefined) {
|
|
66
|
+
filters.ids = options.ids;
|
|
67
|
+
}
|
|
68
|
+
if (options.assignee !== undefined) {
|
|
69
|
+
filters.assignee = options.assignee;
|
|
70
|
+
}
|
|
71
|
+
if (options.assigneeFilter !== undefined) {
|
|
72
|
+
filters.assignee_filter = options.assigneeFilter;
|
|
73
|
+
}
|
|
74
|
+
if (options.parent !== undefined) {
|
|
75
|
+
filters.parent = options.parent;
|
|
76
|
+
}
|
|
77
|
+
if (options.sprint !== undefined) {
|
|
78
|
+
filters.sprint = options.sprint;
|
|
79
|
+
}
|
|
80
|
+
if (options.release !== undefined) {
|
|
81
|
+
filters.release = options.release;
|
|
82
|
+
}
|
|
83
|
+
if (options.limit !== undefined) {
|
|
84
|
+
filters.limit = options.limit;
|
|
85
|
+
}
|
|
86
|
+
if (options.offset !== undefined) {
|
|
87
|
+
filters.offset = options.offset;
|
|
88
|
+
}
|
|
89
|
+
if (options.includeBody === true) {
|
|
90
|
+
filters.include_body = true;
|
|
91
|
+
}
|
|
92
|
+
if (options.fields !== undefined) {
|
|
93
|
+
filters.fields = options.fields;
|
|
94
|
+
}
|
|
95
|
+
if (treeEnabled) {
|
|
96
|
+
filters.tree = true;
|
|
97
|
+
if (treeDepth !== undefined) {
|
|
98
|
+
filters.tree_depth = treeDepth;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (sortField !== undefined) {
|
|
102
|
+
filters.sort = sortField;
|
|
103
|
+
filters.order = sortOrder;
|
|
104
|
+
}
|
|
105
|
+
if (isNonEmptyRecord(runtimeFieldFilters)) {
|
|
106
|
+
filters.runtime_filters = runtimeFieldFilters;
|
|
107
|
+
}
|
|
108
|
+
return filters;
|
|
109
|
+
}
|
|
28
110
|
function compareDefaultSort(left, right, statusRegistry) {
|
|
29
111
|
const leftTerminal = isTerminalStatus(left.status, statusRegistry);
|
|
30
112
|
const rightTerminal = isTerminalStatus(right.status, statusRegistry);
|
|
@@ -146,7 +228,7 @@ function validateListProjectionFields(projection, runtimeMetadataKeys) {
|
|
|
146
228
|
if (projection.mode !== "fields") {
|
|
147
229
|
return;
|
|
148
230
|
}
|
|
149
|
-
const allowed = new Set([...FRONT_MATTER_KEY_ORDER, "body", ...runtimeMetadataKeys]);
|
|
231
|
+
const allowed = new Set([...FRONT_MATTER_KEY_ORDER, "body", ...TREE_METADATA_FIELDS, ...runtimeMetadataKeys]);
|
|
150
232
|
const unknown = projection.fields.filter((field) => !allowed.has(normalizeProjectionField(field)));
|
|
151
233
|
if (unknown.length > 0) {
|
|
152
234
|
throw new PmCliError(`Unknown list --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
|
|
@@ -193,6 +275,9 @@ function parseSortOrder(raw) {
|
|
|
193
275
|
}
|
|
194
276
|
return normalized;
|
|
195
277
|
}
|
|
278
|
+
function parseTreeDepth(raw) {
|
|
279
|
+
return parseIntegerLimit(raw, "--tree-depth");
|
|
280
|
+
}
|
|
196
281
|
function parseAssigneeFilter(raw) {
|
|
197
282
|
if (raw === undefined) {
|
|
198
283
|
return undefined;
|
|
@@ -267,7 +352,7 @@ function applyFilters(items, status, options, typeRegistry, statusRegistry, runt
|
|
|
267
352
|
if (assigneeFilter !== undefined && item.assignee !== assigneeFilter) {
|
|
268
353
|
return false;
|
|
269
354
|
}
|
|
270
|
-
if (parentFilter !== undefined && item.parent !== parentFilter)
|
|
355
|
+
if (parentFilter !== undefined && options.tree !== true && item.parent !== parentFilter)
|
|
271
356
|
return false;
|
|
272
357
|
if (sprintFilter !== undefined && item.sprint !== sprintFilter)
|
|
273
358
|
return false;
|
|
@@ -279,6 +364,69 @@ function applyFilters(items, status, options, typeRegistry, statusRegistry, runt
|
|
|
279
364
|
return true;
|
|
280
365
|
});
|
|
281
366
|
}
|
|
367
|
+
function trimNonEmpty(value) {
|
|
368
|
+
if (typeof value !== "string") {
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
const trimmed = value.trim();
|
|
372
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
373
|
+
}
|
|
374
|
+
function withTreeMetadata(item, depth, childCount) {
|
|
375
|
+
const itemRecord = toItemRecord(item);
|
|
376
|
+
const title = typeof itemRecord.title === "string" ? itemRecord.title : "";
|
|
377
|
+
const parent = trimNonEmpty(typeof itemRecord.parent === "string" ? itemRecord.parent : undefined) ?? null;
|
|
378
|
+
return {
|
|
379
|
+
...item,
|
|
380
|
+
tree_depth: depth,
|
|
381
|
+
tree_parent: parent,
|
|
382
|
+
tree_children: childCount,
|
|
383
|
+
tree_title: `${" ".repeat(depth)}${title}`,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function orderItemsAsTree(sortedItems, parentRoot, maxDepth) {
|
|
387
|
+
const byId = new Map();
|
|
388
|
+
const childrenByParent = new Map();
|
|
389
|
+
for (const item of sortedItems) {
|
|
390
|
+
byId.set(item.id, item);
|
|
391
|
+
const parentId = trimNonEmpty(item.parent);
|
|
392
|
+
if (!parentId) {
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
const bucket = childrenByParent.get(parentId);
|
|
396
|
+
if (bucket) {
|
|
397
|
+
bucket.push(item);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
childrenByParent.set(parentId, [item]);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const roots = parentRoot
|
|
404
|
+
? [...(childrenByParent.get(parentRoot) ?? [])]
|
|
405
|
+
: sortedItems.filter((item) => {
|
|
406
|
+
const parentId = trimNonEmpty(item.parent);
|
|
407
|
+
return !parentId || !byId.has(parentId);
|
|
408
|
+
});
|
|
409
|
+
const ordered = [];
|
|
410
|
+
const visited = new Set();
|
|
411
|
+
const pushNode = (node, depth) => {
|
|
412
|
+
if (visited.has(node.id)) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
visited.add(node.id);
|
|
416
|
+
const children = childrenByParent.get(node.id) ?? [];
|
|
417
|
+
ordered.push(withTreeMetadata(node, depth, children.length));
|
|
418
|
+
if (maxDepth !== undefined && depth >= maxDepth) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
for (const child of children) {
|
|
422
|
+
pushNode(child, depth + 1);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
for (const root of roots) {
|
|
426
|
+
pushNode(root, 0);
|
|
427
|
+
}
|
|
428
|
+
return ordered;
|
|
429
|
+
}
|
|
282
430
|
function compareNullableString(left, right) {
|
|
283
431
|
if (left === right) {
|
|
284
432
|
return 0;
|
|
@@ -334,25 +482,28 @@ function sortItems(items, sortField, sortOrder, statusRegistry) {
|
|
|
334
482
|
return sortOrder === "desc" ? -fallback : fallback;
|
|
335
483
|
});
|
|
336
484
|
}
|
|
337
|
-
function readListFieldValue(item, field) {
|
|
485
|
+
function readListFieldValue(item, field, treeMode = false) {
|
|
338
486
|
const normalized = normalizeProjectionField(field.trim());
|
|
339
487
|
if (normalized.length === 0) {
|
|
340
488
|
return null;
|
|
341
489
|
}
|
|
342
490
|
const itemRecord = toItemRecord(item);
|
|
491
|
+
if (treeMode && normalized === "title" && typeof itemRecord.tree_title === "string") {
|
|
492
|
+
return itemRecord.tree_title;
|
|
493
|
+
}
|
|
343
494
|
if (Object.prototype.hasOwnProperty.call(itemRecord, normalized)) {
|
|
344
495
|
return itemRecord[normalized] ?? null;
|
|
345
496
|
}
|
|
346
497
|
return null;
|
|
347
498
|
}
|
|
348
|
-
function projectListItems(items, projection) {
|
|
499
|
+
function projectListItems(items, projection, treeMode = false) {
|
|
349
500
|
if (projection.mode === "full") {
|
|
350
501
|
return items;
|
|
351
502
|
}
|
|
352
503
|
return items.map((item) => {
|
|
353
504
|
const projected = {};
|
|
354
505
|
for (const field of projection.fields) {
|
|
355
|
-
projected[field] = readListFieldValue(item, field);
|
|
506
|
+
projected[field] = readListFieldValue(item, field, treeMode);
|
|
356
507
|
}
|
|
357
508
|
return projected;
|
|
358
509
|
});
|
|
@@ -389,6 +540,12 @@ export async function runList(status, options, global) {
|
|
|
389
540
|
}
|
|
390
541
|
const sortField = parseSortField(options.sort);
|
|
391
542
|
const sortOrder = parseSortOrder(options.order) ?? "asc";
|
|
543
|
+
const treeEnabled = options.tree === true;
|
|
544
|
+
if (!treeEnabled && options.treeDepth !== undefined) {
|
|
545
|
+
throw new PmCliError("List --tree-depth requires --tree", EXIT_CODE.USAGE);
|
|
546
|
+
}
|
|
547
|
+
const treeDepth = treeEnabled ? parseTreeDepth(options.treeDepth) : undefined;
|
|
548
|
+
const parentRoot = treeEnabled ? trimNonEmpty(options.parent) : undefined;
|
|
392
549
|
if (!sortField && options.order !== undefined) {
|
|
393
550
|
throw new PmCliError("List --order requires --sort", EXIT_CODE.USAGE);
|
|
394
551
|
}
|
|
@@ -402,13 +559,35 @@ export async function runList(status, options, global) {
|
|
|
402
559
|
? resolvedStatus[0]
|
|
403
560
|
: resolvedStatus;
|
|
404
561
|
const sorted = sortItems(filtered, sortField, sortOrder, statusRegistry);
|
|
562
|
+
const ordered = treeEnabled ? orderItemsAsTree(sorted, parentRoot, treeDepth) : sorted;
|
|
405
563
|
const limit = parseIntegerLimit(options.limit);
|
|
406
564
|
const offset = parseOffset(options.offset) ?? 0;
|
|
407
|
-
const limited = limit === undefined ?
|
|
408
|
-
const projected = projectListItems(limited, projection);
|
|
565
|
+
const limited = limit === undefined ? ordered.slice(offset) : ordered.slice(offset, offset + limit);
|
|
566
|
+
const projected = projectListItems(limited, projection, treeEnabled);
|
|
409
567
|
const now = nowIso();
|
|
410
568
|
const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
|
|
411
569
|
const projectionFields = projection.mode === "full" ? null : [...projection.fields];
|
|
570
|
+
// pm-vhx6: compact-mode list output is primarily consumed by agents. Keep the
|
|
571
|
+
// metadata trailer token-light by returning only active/user-supplied filters
|
|
572
|
+
// and omitting projection/sorting/now boilerplate in this path.
|
|
573
|
+
const compactSummaryMode = projection.mode === "compact" && options.compact === true;
|
|
574
|
+
if (compactSummaryMode) {
|
|
575
|
+
const compactFilters = buildCompactListFilterSummary({
|
|
576
|
+
filtersStatus,
|
|
577
|
+
options,
|
|
578
|
+
treeEnabled,
|
|
579
|
+
treeDepth,
|
|
580
|
+
sortField,
|
|
581
|
+
sortOrder,
|
|
582
|
+
runtimeFieldFilters,
|
|
583
|
+
});
|
|
584
|
+
return {
|
|
585
|
+
items: projected,
|
|
586
|
+
count: projected.length,
|
|
587
|
+
filters: compactFilters,
|
|
588
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
589
|
+
};
|
|
590
|
+
}
|
|
412
591
|
return {
|
|
413
592
|
items: projected,
|
|
414
593
|
count: projected.length,
|
|
@@ -434,6 +613,7 @@ export async function runList(status, options, global) {
|
|
|
434
613
|
include_body: options.includeBody ?? null,
|
|
435
614
|
compact: options.compact ?? null,
|
|
436
615
|
fields: options.fields ?? null,
|
|
616
|
+
...(treeEnabled ? { tree: true, tree_depth: treeDepth ?? null } : {}),
|
|
437
617
|
sort: sortField ?? null,
|
|
438
618
|
order: sortField ? sortOrder : null,
|
|
439
619
|
runtime_filters: runtimeFieldFilters,
|
|
@@ -451,4 +631,4 @@ export async function runList(status, options, global) {
|
|
|
451
631
|
};
|
|
452
632
|
}
|
|
453
633
|
//# sourceMappingURL=list.js.map
|
|
454
|
-
//# debugId=
|
|
634
|
+
//# debugId=380accc4-3226-5273-bad1-679bc6595543
|