@unbrained/pm-cli 2026.7.14 → 2026.7.15
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 +2 -2
- package/CHANGELOG.md +48 -0
- package/README.md +14 -11
- package/dist/cli/argv-utils.d.ts +1 -4
- package/dist/cli/argv-utils.js +3 -13
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +6 -4
- package/dist/cli/bootstrap-args.js +51 -16
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/bundle-integrity.d.ts +49 -0
- package/dist/cli/bundle-integrity.js +111 -0
- package/dist/cli/bundle-integrity.js.map +1 -0
- package/dist/cli/commands/completion.js +7 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +6 -163
- package/dist/cli/commands/config.js +4 -1133
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +2 -4
- package/dist/cli/commands/context.js +10 -85
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +3 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +2 -91
- package/dist/cli/commands/extension/describe.js +4 -142
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +2 -36
- package/dist/cli/commands/extension/scaffold.js +4 -2435
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +2 -28
- package/dist/cli/commands/extension/shared.js +4 -130
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +3 -400
- package/dist/cli/commands/extension.js +4 -2183
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +6 -56
- package/dist/cli/commands/gc.js +4 -270
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +18 -5
- package/dist/cli/commands/get.js +117 -58
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +6 -184
- package/dist/cli/commands/health.js +4 -1747
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +4 -139
- package/dist/cli/commands/history-compact.js +5 -510
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -120
- package/dist/cli/commands/history-redact.js +6 -581
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +7 -89
- package/dist/cli/commands/history-repair.js +5 -257
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.d.ts +1 -2
- package/dist/cli/commands/history.js +6 -48
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
- package/dist/cli/commands/init-agent-guidance.js +4 -431
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +6 -181
- package/dist/cli/commands/init.js +4 -690
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/next.js +3 -3
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.d.ts +4 -174
- package/dist/cli/commands/profile.js +4 -425
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +4 -19
- package/dist/cli/commands/restore.js +9 -158
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +7 -507
- package/dist/cli/commands/schema.js +5 -1254
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/test.d.ts +2 -4
- package/dist/cli/commands/test.js +7 -97
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +9 -249
- package/dist/cli/commands/validate.js +9 -2150
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/extension-command-help.js +18 -4
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.js +3 -3
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +7 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +20 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +4 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +11 -3
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +3 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +782 -0
- package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
- package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
- package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
- package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
- package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
- package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
- package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
- package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
- package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
- package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
- package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
- package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
- package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
- package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
- package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
- package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
- package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
- package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
- package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
- package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
- package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
- package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
- package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
- package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
- package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
- package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
- package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
- package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
- package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
- package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
- package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
- package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
- package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
- package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
- package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
- package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
- package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
- package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
- package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
- package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
- package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
- package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
- package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
- package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
- package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
- package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
- package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
- package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
- package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
- package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
- package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
- package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
- package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
- package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
- package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
- package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
- package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
- package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
- package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
- package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
- package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
- package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
- package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
- package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
- package/dist/cli-bundle/main.js +826 -43
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/cli-bundle/sdk-runtime.js +70 -57
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +876 -74
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/history/projection.d.ts +39 -0
- package/dist/core/history/projection.js +164 -0
- package/dist/core/history/projection.js.map +1 -0
- package/dist/core/history/read.d.ts +3 -0
- package/dist/core/history/read.js +55 -0
- package/dist/core/history/read.js.map +1 -0
- package/dist/core/output/output-control.d.ts +18 -0
- package/dist/core/output/output-control.js +26 -0
- package/dist/core/output/output-control.js.map +1 -0
- package/dist/core/output/output.js +20 -8
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/sentry/helpers.js +10 -2
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/errors.d.ts +11 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/tool-definitions.js +5 -5
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/author-attribution.d.ts +35 -0
- package/dist/sdk/author-attribution.js +118 -0
- package/dist/sdk/author-attribution.js.map +1 -0
- package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
- package/dist/sdk/cli-contracts/command-aliases.js +17 -0
- package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +3 -3
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts.js +3 -2
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.d.ts +8 -0
- package/dist/sdk/cli-program.js +39 -0
- package/dist/sdk/cli-program.js.map +1 -0
- package/dist/sdk/command-line.d.ts +11 -0
- package/dist/sdk/command-line.js +40 -0
- package/dist/sdk/command-line.js.map +1 -0
- package/dist/sdk/config.d.ts +163 -0
- package/dist/sdk/config.js +1087 -0
- package/dist/sdk/config.js.map +1 -0
- package/dist/sdk/context-relevance.d.ts +21 -0
- package/dist/sdk/context-relevance.js +70 -2
- package/dist/sdk/context-relevance.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +15 -2
- package/dist/sdk/dependencies.js +97 -8
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
- package/dist/sdk/extension/bundled-catalog.js.map +1 -0
- package/dist/sdk/extension/concurrency.d.ts +7 -0
- package/dist/sdk/extension/concurrency.js +26 -0
- package/dist/sdk/extension/concurrency.js.map +1 -0
- package/dist/sdk/extension/describe.d.ts +91 -0
- package/dist/sdk/extension/describe.js +144 -0
- package/dist/sdk/extension/describe.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
- package/dist/sdk/extension/doctor.js.map +1 -0
- package/dist/sdk/extension/install-runtime.d.ts +26 -0
- package/dist/sdk/extension/install-runtime.js +269 -0
- package/dist/sdk/extension/install-runtime.js.map +1 -0
- package/dist/sdk/extension/install-snapshot.d.ts +23 -0
- package/dist/sdk/extension/install-snapshot.js +66 -0
- package/dist/sdk/extension/install-snapshot.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
- package/dist/sdk/extension/install-sources.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
- package/dist/sdk/extension/managed-state.js.map +1 -0
- package/dist/sdk/extension/scaffold.d.ts +36 -0
- package/dist/sdk/extension/scaffold.js +2436 -0
- package/dist/sdk/extension/scaffold.js.map +1 -0
- package/dist/sdk/extension/shared.d.ts +28 -0
- package/dist/sdk/extension/shared.js +140 -0
- package/dist/sdk/extension/shared.js.map +1 -0
- package/dist/sdk/extension/update-check.d.ts +15 -0
- package/dist/sdk/extension/update-check.js +68 -0
- package/dist/sdk/extension/update-check.js.map +1 -0
- package/dist/sdk/extension.d.ts +367 -0
- package/dist/sdk/extension.js +2174 -0
- package/dist/sdk/extension.js.map +1 -0
- package/dist/sdk/governance/gc.d.ts +56 -0
- package/dist/sdk/governance/gc.js +276 -0
- package/dist/sdk/governance/gc.js.map +1 -0
- package/dist/sdk/governance/health.d.ts +187 -0
- package/dist/sdk/governance/health.js +1796 -0
- package/dist/sdk/governance/health.js.map +1 -0
- package/dist/sdk/governance/validate.d.ts +255 -0
- package/dist/sdk/governance/validate.js +2175 -0
- package/dist/sdk/governance/validate.js.map +1 -0
- package/dist/sdk/history-compact.d.ts +142 -0
- package/dist/sdk/history-compact.js +508 -0
- package/dist/sdk/history-compact.js.map +1 -0
- package/dist/sdk/history-mcp.d.ts +17 -0
- package/dist/sdk/history-mcp.js +68 -0
- package/dist/sdk/history-mcp.js.map +1 -0
- package/dist/sdk/history-read.d.ts +31 -0
- package/dist/sdk/history-read.js +58 -0
- package/dist/sdk/history-read.js.map +1 -0
- package/dist/sdk/history-redact.d.ts +120 -0
- package/dist/sdk/history-redact.js +577 -0
- package/dist/sdk/history-redact.js.map +1 -0
- package/dist/sdk/history-repair.d.ts +89 -0
- package/dist/sdk/history-repair.js +263 -0
- package/dist/sdk/history-repair.js.map +1 -0
- package/dist/sdk/index.d.ts +25 -1
- package/dist/sdk/index.js +27 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +113 -0
- package/dist/sdk/init-agent-guidance.js +437 -0
- package/dist/sdk/init-agent-guidance.js.map +1 -0
- package/dist/sdk/init.d.ts +186 -0
- package/dist/sdk/init.js +733 -0
- package/dist/sdk/init.js.map +1 -0
- package/dist/sdk/invocation-author.d.ts +2 -0
- package/dist/sdk/invocation-author.js +39 -0
- package/dist/sdk/invocation-author.js.map +1 -0
- package/dist/sdk/item-children.d.ts +45 -0
- package/dist/sdk/item-children.js +75 -0
- package/dist/sdk/item-children.js.map +1 -0
- package/dist/sdk/item-schedule.d.ts +26 -0
- package/dist/sdk/item-schedule.js +28 -0
- package/dist/sdk/item-schedule.js.map +1 -0
- package/dist/sdk/output.d.ts +7 -0
- package/dist/sdk/output.js +11 -0
- package/dist/sdk/output.js.map +1 -0
- package/dist/sdk/pagination.d.ts +4 -1
- package/dist/sdk/pagination.js +13 -5
- package/dist/sdk/pagination.js.map +1 -1
- package/dist/sdk/profile.d.ts +176 -0
- package/dist/sdk/profile.js +431 -0
- package/dist/sdk/profile.js.map +1 -0
- package/dist/sdk/relationship-analytics.d.ts +108 -0
- package/dist/sdk/relationship-analytics.js +292 -0
- package/dist/sdk/relationship-analytics.js.map +1 -0
- package/dist/sdk/relationship-context.d.ts +67 -0
- package/dist/sdk/relationship-context.js +207 -0
- package/dist/sdk/relationship-context.js.map +1 -0
- package/dist/sdk/relationship-history.d.ts +109 -0
- package/dist/sdk/relationship-history.js +401 -0
- package/dist/sdk/relationship-history.js.map +1 -0
- package/dist/sdk/relationships.d.ts +145 -0
- package/dist/sdk/relationships.js +551 -0
- package/dist/sdk/relationships.js.map +1 -0
- package/dist/sdk/runtime-input.d.ts +10 -0
- package/dist/sdk/runtime-input.js +60 -0
- package/dist/sdk/runtime-input.js.map +1 -0
- package/dist/sdk/runtime.d.ts +31 -8
- package/dist/sdk/runtime.js +61 -57
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/schema.d.ts +507 -0
- package/dist/sdk/schema.js +1269 -0
- package/dist/sdk/schema.js.map +1 -0
- package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
- package/dist/{cli/commands → sdk}/templates.js +9 -9
- package/dist/sdk/templates.js.map +1 -0
- package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
- package/dist/sdk/test/linked-command-detection.js +525 -0
- package/dist/sdk/test/linked-command-detection.js.map +1 -0
- package/docs/COMMANDS.md +58 -40
- package/docs/EXTENSIONS.md +10 -1
- package/docs/RELATIONSHIP_GRAPH.md +113 -0
- package/docs/RELEASING.md +2 -0
- package/docs/SDK.md +156 -9
- package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
- package/marketplace.json +2 -2
- package/package.json +3 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/bundle-cli.mjs +66 -23
- package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
- package/dist/cli/commands/extension/doctor.js.map +0 -1
- package/dist/cli/commands/extension/install-sources.js.map +0 -1
- package/dist/cli/commands/extension/managed-state.js.map +0 -1
- package/dist/cli/commands/templates.js.map +0 -1
- package/dist/cli/commands/test/linked-command-detection.js +0 -248
- package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
- package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
- package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
- package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
- package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
- package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
- package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
- package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
- package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
- package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
- package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
- package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
- package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
- package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
- package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
- /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
- /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
|
@@ -1,696 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module cli/commands/init
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Preserves the CLI compatibility import path for SDK-owned initialization primitives.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
import readline from "node:readline/promises";
|
|
11
|
-
import { stdin as input, stdout as output } from "node:process";
|
|
12
|
-
import { getActiveExtensionRegistrations, runActiveOnWriteHooks, } from "../../core/extensions/index.js";
|
|
13
|
-
import { pathExists, readFileIfExists, writeFileAtomic, } from "../../core/fs/fs-utils.js";
|
|
14
|
-
import { normalizePrefix } from "../../core/item/id.js";
|
|
15
|
-
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
16
|
-
import { DEFAULT_RUNTIME_SCHEMA_FILE_PATHS, ensureRuntimeSchemaFileScaffold, filePathForSchemaSection, normalizeRuntimeSchemaSettings, } from "../../core/schema/runtime-schema.js";
|
|
17
|
-
import { parseItemTypesFile, serializeItemTypesFile, upsertItemType, } from "../../core/schema/item-types-file.js";
|
|
18
|
-
import { normalizeTypePresetName, resolveTypePresetDefinitions, TYPE_PRESET_NAMES, } from "../../core/schema/type-presets.js";
|
|
19
|
-
import { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS, } from "../../core/shared/constants.js";
|
|
20
|
-
import { PmCliError } from "../../core/shared/errors.js";
|
|
21
|
-
import { resolvePmRoot } from "../../core/store/paths.js";
|
|
22
|
-
import { readSettings, writeSettings } from "../../core/store/settings.js";
|
|
23
|
-
import { ensurePmGitignore } from "../../sdk/workspace.js";
|
|
24
|
-
import { renderPmCommand } from "../argv-utils.js";
|
|
25
|
-
import { runExtension } from "./extension.js";
|
|
26
|
-
import { INIT_AGENT_GUIDANCE_MODE_VALUES, runInitAgentGuidance, } from "./init-agent-guidance.js";
|
|
27
|
-
/** Implements summarize init result for the public runtime surface of this module. */
|
|
28
|
-
export function summarizeInitResult(result) {
|
|
29
|
-
return {
|
|
30
|
-
ok: result.ok,
|
|
31
|
-
path: result.path,
|
|
32
|
-
target: result.target,
|
|
33
|
-
id_prefix: result.settings.id_prefix,
|
|
34
|
-
governance_preset: result.governance_preset,
|
|
35
|
-
telemetry: {
|
|
36
|
-
enabled: result.settings.telemetry.enabled,
|
|
37
|
-
capture_level: result.settings.telemetry.capture_level,
|
|
38
|
-
},
|
|
39
|
-
output_format: result.settings.output.default_format,
|
|
40
|
-
created_dirs_count: result.created_dirs.length,
|
|
41
|
-
created_dirs: result.created_dirs,
|
|
42
|
-
warnings: result.warnings,
|
|
43
|
-
wizard_used: result.wizard_used,
|
|
44
|
-
...(result.registered_type_preset
|
|
45
|
-
? { registered_type_preset: result.registered_type_preset }
|
|
46
|
-
: {}),
|
|
47
|
-
...(result.installed_packages
|
|
48
|
-
? { installed_packages: result.installed_packages }
|
|
49
|
-
: {}),
|
|
50
|
-
next_steps: result.next_steps,
|
|
51
|
-
agent_guidance: result.agent_guidance,
|
|
52
|
-
hint: "Re-run with --verbose for the full settings tree.",
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
56
|
-
export const _testOnly = {
|
|
57
|
-
normalizeInitGovernancePreset,
|
|
58
|
-
normalizeInitTypePreset,
|
|
59
|
-
normalizeOptionalInitAuthor,
|
|
60
|
-
normalizeInitAgentGuidanceMode,
|
|
61
|
-
isPathLikeInitTarget,
|
|
62
|
-
resolveInitInvocation,
|
|
63
|
-
parseYesNoChoice,
|
|
64
|
-
applyGovernancePreset,
|
|
65
|
-
runInitWizard,
|
|
66
|
-
setInitReadlineFactoryForTests,
|
|
67
|
-
summarizeInstalledPackages,
|
|
68
|
-
buildInitNextSteps,
|
|
69
|
-
registerInitTypePreset,
|
|
70
|
-
assertExplicitTrackerPathIsNotWorkspaceRoot,
|
|
71
|
-
isLikelyWorkspaceRoot,
|
|
72
|
-
};
|
|
73
|
-
let createInitReadlineInterface = () => readline.createInterface({ input, output });
|
|
74
|
-
function setInitReadlineFactoryForTests(factory) {
|
|
75
|
-
createInitReadlineInterface =
|
|
76
|
-
factory ?? (() => readline.createInterface({ input, output }));
|
|
77
|
-
}
|
|
78
|
-
function cloneDefaults() {
|
|
79
|
-
return structuredClone(SETTINGS_DEFAULTS);
|
|
80
|
-
}
|
|
81
|
-
const BUILTIN_GOVERNANCE_PRESETS = [
|
|
82
|
-
"minimal",
|
|
83
|
-
"default",
|
|
84
|
-
"strict",
|
|
85
|
-
];
|
|
86
|
-
function normalizeInitGovernancePreset(rawValue) {
|
|
87
|
-
if (rawValue === undefined) {
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
const normalized = rawValue.trim().toLowerCase().replaceAll("-", "_");
|
|
91
|
-
if (normalized.length === 0) {
|
|
92
|
-
throw new PmCliError("--preset must not be empty", EXIT_CODE.USAGE);
|
|
93
|
-
}
|
|
94
|
-
if (normalized === "minimal" ||
|
|
95
|
-
normalized === "default" ||
|
|
96
|
-
normalized === "strict") {
|
|
97
|
-
return normalized;
|
|
98
|
-
}
|
|
99
|
-
if (normalized === "lite" || normalized === "minimum") {
|
|
100
|
-
return "minimal";
|
|
101
|
-
}
|
|
102
|
-
throw new PmCliError(`Invalid --preset value "${rawValue}". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(", ")}`, EXIT_CODE.USAGE);
|
|
103
|
-
}
|
|
104
|
-
function normalizeInitTypePreset(rawValue) {
|
|
105
|
-
if (rawValue === undefined) {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
if (rawValue.trim().length === 0) {
|
|
109
|
-
throw new PmCliError("--type-preset must not be empty", EXIT_CODE.USAGE);
|
|
110
|
-
}
|
|
111
|
-
try {
|
|
112
|
-
// Non-undefined input never returns undefined; the shared normalizer throws
|
|
113
|
-
// a plain Error for empty/unknown values, which we re-map to init's --type-preset
|
|
114
|
-
// PmCliError wording for a consistent CLI surface.
|
|
115
|
-
return normalizeTypePresetName(rawValue);
|
|
116
|
-
}
|
|
117
|
-
catch {
|
|
118
|
-
throw new PmCliError(`Invalid --type-preset value "${rawValue}". Allowed: ${TYPE_PRESET_NAMES.join(", ")}`, EXIT_CODE.USAGE);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function normalizeOptionalInitAuthor(rawValue) {
|
|
122
|
-
if (rawValue === undefined) {
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
|
-
const normalized = rawValue.trim();
|
|
126
|
-
if (normalized.length === 0) {
|
|
127
|
-
throw new PmCliError("--author must not be empty", EXIT_CODE.USAGE);
|
|
128
|
-
}
|
|
129
|
-
return normalized;
|
|
130
|
-
}
|
|
131
|
-
function isPathLikeInitTarget(rawValue) {
|
|
132
|
-
if (rawValue === undefined) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
const trimmed = rawValue.trim();
|
|
136
|
-
if (trimmed.length === 0) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
return (path.isAbsolute(trimmed) ||
|
|
140
|
-
trimmed.startsWith(".") ||
|
|
141
|
-
trimmed.includes("/") ||
|
|
142
|
-
trimmed.includes("\\"));
|
|
143
|
-
}
|
|
144
|
-
function resolveInitInvocation(cwd, global, prefixArg, workspaceArg) {
|
|
145
|
-
const normalizedWorkspace = workspaceArg?.trim();
|
|
146
|
-
if (workspaceArg !== undefined && normalizedWorkspace?.length === 0) {
|
|
147
|
-
throw new PmCliError("--workspace must not be empty", EXIT_CODE.USAGE);
|
|
148
|
-
}
|
|
149
|
-
if (normalizedWorkspace !== undefined) {
|
|
150
|
-
if (global.path !== undefined || isPathLikeInitTarget(prefixArg)) {
|
|
151
|
-
throw new PmCliError("--workspace cannot be combined with --pm-path/--path or a path-like positional target.", EXIT_CODE.USAGE);
|
|
152
|
-
}
|
|
153
|
-
const workspaceRoot = path.resolve(cwd, normalizedWorkspace);
|
|
154
|
-
const pmRoot = path.join(workspaceRoot, ".agents", "pm");
|
|
155
|
-
return {
|
|
156
|
-
pmRoot,
|
|
157
|
-
prefixArg,
|
|
158
|
-
target: {
|
|
159
|
-
mode: "workspace-path",
|
|
160
|
-
tracker_root: pmRoot,
|
|
161
|
-
workspace_root: workspaceRoot,
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
if (global.path === undefined && isPathLikeInitTarget(prefixArg)) {
|
|
166
|
-
const positionalTarget = path.resolve(cwd, prefixArg.trim());
|
|
167
|
-
return {
|
|
168
|
-
pmRoot: positionalTarget,
|
|
169
|
-
prefixArg: undefined,
|
|
170
|
-
target: { mode: "tracker-path", tracker_root: positionalTarget },
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
const pmRoot = resolvePmRoot(cwd, global.path);
|
|
174
|
-
return {
|
|
175
|
-
pmRoot,
|
|
176
|
-
prefixArg,
|
|
177
|
-
target: global.path === undefined
|
|
178
|
-
? {
|
|
179
|
-
mode: "workspace-discovery",
|
|
180
|
-
tracker_root: pmRoot,
|
|
181
|
-
workspace_root: cwd,
|
|
182
|
-
}
|
|
183
|
-
: { mode: "tracker-path", tracker_root: pmRoot },
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function normalizeInitAgentGuidanceMode(rawValue) {
|
|
187
|
-
if (rawValue === undefined) {
|
|
188
|
-
return "ask";
|
|
189
|
-
}
|
|
190
|
-
const normalized = rawValue.trim().toLowerCase().replaceAll("-", "_");
|
|
191
|
-
if (normalized.length === 0) {
|
|
192
|
-
throw new PmCliError("--agent-guidance must not be empty", EXIT_CODE.USAGE);
|
|
193
|
-
}
|
|
194
|
-
if (normalized === "ask" ||
|
|
195
|
-
normalized === "add" ||
|
|
196
|
-
normalized === "skip" ||
|
|
197
|
-
normalized === "status") {
|
|
198
|
-
return normalized;
|
|
199
|
-
}
|
|
200
|
-
throw new PmCliError(`Invalid --agent-guidance value "${rawValue}". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
|
|
201
|
-
}
|
|
202
|
-
function parseYesNoChoice(answer, currentDefault) {
|
|
203
|
-
const normalized = answer.trim().toLowerCase();
|
|
204
|
-
if (normalized.length === 0) {
|
|
205
|
-
return currentDefault;
|
|
206
|
-
}
|
|
207
|
-
if (normalized === "y" || normalized === "yes") {
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
|
-
if (normalized === "n" || normalized === "no") {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
return currentDefault;
|
|
214
|
-
}
|
|
215
|
-
function applyGovernancePreset(settings, preset) {
|
|
216
|
-
const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];
|
|
217
|
-
settings.governance = {
|
|
218
|
-
preset,
|
|
219
|
-
...knobs,
|
|
220
|
-
};
|
|
221
|
-
settings.validation.parent_reference = knobs.parent_reference;
|
|
222
|
-
settings.validation.metadata_profile = knobs.metadata_profile;
|
|
223
|
-
}
|
|
224
|
-
function isInstalledPackageEntry(value) {
|
|
225
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
226
|
-
}
|
|
227
|
-
function summarizeInstalledPackages(result) {
|
|
228
|
-
const details = result.details;
|
|
229
|
-
return {
|
|
230
|
-
installed_all: details.installed_all === true,
|
|
231
|
-
installed_count: typeof details.installed_count === "number" ? details.installed_count : 0,
|
|
232
|
-
packages: Array.isArray(details.packages)
|
|
233
|
-
? details.packages.filter(isInstalledPackageEntry).map((entry) => ({
|
|
234
|
-
alias: typeof entry.alias === "string" ? entry.alias : "",
|
|
235
|
-
ok: entry.ok === true,
|
|
236
|
-
}))
|
|
237
|
-
: [],
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
async function registerInitTypePreset(pmRoot, settings, preset) {
|
|
241
|
-
const schema = normalizeRuntimeSchemaSettings(settings.schema);
|
|
242
|
-
const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
|
|
243
|
-
const parsed = parseItemTypesFile(await readFileIfExists(typesPath));
|
|
244
|
-
let nextFile = parsed;
|
|
245
|
-
const registered = [];
|
|
246
|
-
const updated = [];
|
|
247
|
-
for (const normalized of resolveTypePresetDefinitions(preset)) {
|
|
248
|
-
const upsert = upsertItemType(nextFile, normalized);
|
|
249
|
-
nextFile = upsert.file;
|
|
250
|
-
(upsert.replaced ? updated : registered).push(upsert.definition.name);
|
|
251
|
-
}
|
|
252
|
-
await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));
|
|
253
|
-
return {
|
|
254
|
-
name: preset,
|
|
255
|
-
registered,
|
|
256
|
-
updated,
|
|
257
|
-
file: typesPath,
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
async function isLikelyWorkspaceRoot(candidate) {
|
|
261
|
-
const indicators = [
|
|
262
|
-
".git",
|
|
263
|
-
"package.json",
|
|
264
|
-
"pnpm-workspace.yaml",
|
|
265
|
-
"AGENTS.md",
|
|
266
|
-
path.join(".agents", "pm"),
|
|
267
|
-
];
|
|
268
|
-
for (const indicator of indicators) {
|
|
269
|
-
if (await pathExists(path.join(candidate, indicator))) {
|
|
270
|
-
return true;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return false;
|
|
274
|
-
}
|
|
275
|
-
async function assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot, explicitTrackerTarget, force) {
|
|
276
|
-
if (!explicitTrackerTarget || force) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (await pathExists(path.join(pmRoot, "settings.json"))) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (!(await isLikelyWorkspaceRoot(pmRoot))) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
const nestedTracker = path.join(pmRoot, ".agents", "pm");
|
|
286
|
-
throw new PmCliError(`Refusing to initialize tracker files directly in workspace root "${pmRoot}".`, EXIT_CODE.USAGE, {
|
|
287
|
-
code: "workspace_root_pm_path",
|
|
288
|
-
type: "urn:pm-cli:error:workspace_root_pm_path",
|
|
289
|
-
why: "Path-like init targets and --pm-path/--path point at the tracker storage directory itself, not the repository workspace. Point at .agents/pm, use --workspace, or pass --force if you intentionally want root-level tracker files.",
|
|
290
|
-
examples: [
|
|
291
|
-
`pm --pm-path ${nestedTracker} init --yes`,
|
|
292
|
-
"pm init --yes",
|
|
293
|
-
`pm --pm-path ${pmRoot} init --yes --force`,
|
|
294
|
-
],
|
|
295
|
-
nextSteps: [
|
|
296
|
-
"Use --pm-path <repo>/.agents/pm for repository-local tracker storage.",
|
|
297
|
-
"Use PM_PATH only for sandboxed tests or explicit tracker roots.",
|
|
298
|
-
"Pass --force only when root-level tracker files are intentional.",
|
|
299
|
-
],
|
|
300
|
-
recovery: {
|
|
301
|
-
next_best_command: `pm --pm-path ${nestedTracker} init --yes`,
|
|
302
|
-
},
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
async function ensureInitDirectories(pmRoot, subdirs) {
|
|
306
|
-
const createdDirs = [];
|
|
307
|
-
const warnings = [];
|
|
308
|
-
for (const subdir of subdirs) {
|
|
309
|
-
const target = subdir ? path.join(pmRoot, subdir) : pmRoot;
|
|
310
|
-
const existed = await pathExists(target);
|
|
311
|
-
await fs.mkdir(target, { recursive: true });
|
|
312
|
-
if (existed) {
|
|
313
|
-
warnings.push(`already_exists:${target}`);
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
createdDirs.push(target);
|
|
317
|
-
}
|
|
318
|
-
warnings.push(...(await runActiveOnWriteHooks({
|
|
319
|
-
path: target,
|
|
320
|
-
scope: "project",
|
|
321
|
-
op: "init:ensure_dir",
|
|
322
|
-
})));
|
|
323
|
-
}
|
|
324
|
-
return { createdDirs, warnings };
|
|
325
|
-
}
|
|
326
|
-
async function runInitWizard(initialPrefix, telemetryDefault) {
|
|
327
|
-
const rl = createInitReadlineInterface();
|
|
328
|
-
try {
|
|
329
|
-
output.write("pm init setup wizard (agent-optimized)\n");
|
|
330
|
-
output.write("This walkthrough is non-destructive and each choice can be changed later with pm config.\n\n");
|
|
331
|
-
output.write("1/3 Item ID prefix\n");
|
|
332
|
-
output.write("Prefix is prepended to generated IDs (for example pm-a1b2).\n");
|
|
333
|
-
const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);
|
|
334
|
-
const resolvedPrefix = prefixAnswer.trim().length > 0
|
|
335
|
-
? normalizePrefix(prefixAnswer)
|
|
336
|
-
: initialPrefix;
|
|
337
|
-
output.write("\n2/3 Governance preset\n");
|
|
338
|
-
output.write("minimal: no ownership blocking, progressive create defaults, close validation off.\n");
|
|
339
|
-
output.write("default: ownership conflict warnings, progressive create defaults, close validation warn.\n");
|
|
340
|
-
output.write("strict: ownership blocking, strict create defaults, close validation strict.\n");
|
|
341
|
-
const presetAnswer = await rl.question("Governance preset [minimal/default/strict] (default: minimal): ");
|
|
342
|
-
const presetChoice = presetAnswer.trim().length > 0 ? presetAnswer.trim() : "minimal";
|
|
343
|
-
// The wizard is forgiving: a typo'd/unknown preset defaults to minimal with a
|
|
344
|
-
// notice instead of throwing and aborting an in-progress interactive setup.
|
|
345
|
-
// normalizeInitGovernancePreset returns a concrete preset for valid input and
|
|
346
|
-
// throws (never returns undefined) for invalid non-empty input, so the result is
|
|
347
|
-
// always a BuiltinGovernancePreset on the success path.
|
|
348
|
-
let resolvedPreset = "minimal";
|
|
349
|
-
try {
|
|
350
|
-
resolvedPreset = normalizeInitGovernancePreset(presetChoice);
|
|
351
|
-
}
|
|
352
|
-
catch {
|
|
353
|
-
output.write(`Unrecognized governance preset "${presetChoice}"; using minimal.\n`);
|
|
354
|
-
}
|
|
355
|
-
output.write("\n3/3 Project telemetry\n");
|
|
356
|
-
output.write("Telemetry helps improve reliability and can be disabled anytime via pm config.\n");
|
|
357
|
-
const telemetryLabel = telemetryDefault ? "Y/n" : "y/N";
|
|
358
|
-
const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);
|
|
359
|
-
const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);
|
|
360
|
-
output.write("\n");
|
|
361
|
-
return {
|
|
362
|
-
prefix: resolvedPrefix,
|
|
363
|
-
preset: resolvedPreset,
|
|
364
|
-
telemetry_enabled: telemetryEnabled,
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
finally {
|
|
368
|
-
rl.close();
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
function normalizeInitCommandOptions(options) {
|
|
372
|
-
return {
|
|
373
|
-
presetFromOption: normalizeInitGovernancePreset(options.preset),
|
|
374
|
-
useDefaults: options.defaults === true,
|
|
375
|
-
authorFromOption: normalizeOptionalInitAuthor(options.author),
|
|
376
|
-
installBundledPackages: options.withPackages === true,
|
|
377
|
-
agentGuidanceMode: normalizeInitAgentGuidanceMode(options.agentGuidance),
|
|
378
|
-
typePreset: normalizeInitTypePreset(options.typePreset),
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
function collectExistingSettingsPendingChanges(params) {
|
|
382
|
-
const pendingChanges = [];
|
|
383
|
-
if (params.prefixArg !== undefined &&
|
|
384
|
-
params.settings.id_prefix !== params.normalizedPrefix) {
|
|
385
|
-
pendingChanges.push("id_prefix");
|
|
386
|
-
}
|
|
387
|
-
if (params.presetFromOption !== undefined &&
|
|
388
|
-
params.settings.governance.preset !== params.presetFromOption) {
|
|
389
|
-
pendingChanges.push("governance_preset");
|
|
390
|
-
}
|
|
391
|
-
if (params.authorFromOption !== undefined &&
|
|
392
|
-
params.settings.author_default !== params.authorFromOption) {
|
|
393
|
-
pendingChanges.push("author_default");
|
|
394
|
-
}
|
|
395
|
-
return pendingChanges;
|
|
396
|
-
}
|
|
397
|
-
function assertExistingSettingsUpdateAllowed(settingsPath, pendingChanges, force) {
|
|
398
|
-
if (pendingChanges.length === 0 || force) {
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
throw new PmCliError(`Refusing to update existing tracker settings at ${settingsPath} without --force.`, EXIT_CODE.USAGE, {
|
|
402
|
-
code: "init_existing_settings_requires_force",
|
|
403
|
-
type: "urn:pm-cli:error:init_existing_settings_requires_force",
|
|
404
|
-
required: `--force for ${pendingChanges.join(", ")}`,
|
|
405
|
-
why: "pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.",
|
|
406
|
-
examples: [
|
|
407
|
-
"pm init --yes",
|
|
408
|
-
"pm init ./sandbox-pm --yes",
|
|
409
|
-
"pm init acme --yes --force",
|
|
410
|
-
],
|
|
411
|
-
nextSteps: [
|
|
412
|
-
"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.",
|
|
413
|
-
"If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force.",
|
|
414
|
-
],
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
function applyExistingSettingsUpdates(params) {
|
|
418
|
-
let changed = false;
|
|
419
|
-
if (params.prefixArg !== undefined &&
|
|
420
|
-
params.settings.id_prefix !== params.normalizedPrefix) {
|
|
421
|
-
params.settings.id_prefix = params.normalizedPrefix;
|
|
422
|
-
params.warnings.push(`updated:id_prefix:${params.normalizedPrefix}`);
|
|
423
|
-
changed = true;
|
|
424
|
-
}
|
|
425
|
-
if (params.presetFromOption !== undefined &&
|
|
426
|
-
params.settings.governance.preset !== params.presetFromOption) {
|
|
427
|
-
applyGovernancePreset(params.settings, params.presetFromOption);
|
|
428
|
-
params.warnings.push(`updated:governance_preset:${params.presetFromOption}`);
|
|
429
|
-
changed = true;
|
|
430
|
-
}
|
|
431
|
-
if (params.authorFromOption !== undefined &&
|
|
432
|
-
params.settings.author_default !== params.authorFromOption) {
|
|
433
|
-
params.settings.author_default = params.authorFromOption;
|
|
434
|
-
params.warnings.push(`updated:author_default:${params.authorFromOption}`);
|
|
435
|
-
changed = true;
|
|
436
|
-
}
|
|
437
|
-
return changed;
|
|
438
|
-
}
|
|
439
|
-
async function loadExistingInitSettings(params) {
|
|
440
|
-
const settings = await readSettings(params.pmRoot);
|
|
441
|
-
params.warnings.push(`already_exists:${params.settingsPath}`);
|
|
442
|
-
const pendingChanges = collectExistingSettingsPendingChanges({
|
|
443
|
-
settings,
|
|
444
|
-
normalizedPrefix: params.normalizedPrefix,
|
|
445
|
-
prefixArg: params.prefixArg,
|
|
446
|
-
presetFromOption: params.normalizedOptions.presetFromOption,
|
|
447
|
-
authorFromOption: params.normalizedOptions.authorFromOption,
|
|
448
|
-
});
|
|
449
|
-
assertExistingSettingsUpdateAllowed(params.settingsPath, pendingChanges, params.options.force === true);
|
|
450
|
-
if (applyExistingSettingsUpdates({
|
|
451
|
-
settings,
|
|
452
|
-
normalizedPrefix: params.normalizedPrefix,
|
|
453
|
-
prefixArg: params.prefixArg,
|
|
454
|
-
presetFromOption: params.normalizedOptions.presetFromOption,
|
|
455
|
-
authorFromOption: params.normalizedOptions.authorFromOption,
|
|
456
|
-
warnings: params.warnings,
|
|
457
|
-
})) {
|
|
458
|
-
await writeSettings(params.pmRoot, settings);
|
|
459
|
-
}
|
|
460
|
-
return {
|
|
461
|
-
settings,
|
|
462
|
-
normalizedPrefix: params.normalizedPrefix,
|
|
463
|
-
chosenPreset: params.normalizedOptions.presetFromOption,
|
|
464
|
-
wizardUsed: false,
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
async function createNewInitSettings(params) {
|
|
468
|
-
let normalizedPrefix = params.normalizedPrefix;
|
|
469
|
-
let chosenPreset = params.normalizedOptions.presetFromOption;
|
|
470
|
-
let chosenTelemetryEnabled;
|
|
471
|
-
let wizardUsed = false;
|
|
472
|
-
if (params.normalizedOptions.presetFromOption === undefined &&
|
|
473
|
-
!params.normalizedOptions.useDefaults &&
|
|
474
|
-
process.stdin.isTTY === true &&
|
|
475
|
-
process.stdout.isTTY === true) {
|
|
476
|
-
const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);
|
|
477
|
-
normalizedPrefix = wizardChoices.prefix;
|
|
478
|
-
chosenPreset = wizardChoices.preset;
|
|
479
|
-
chosenTelemetryEnabled = wizardChoices.telemetry_enabled;
|
|
480
|
-
wizardUsed = true;
|
|
481
|
-
}
|
|
482
|
-
const effectivePreset = chosenPreset ?? "minimal";
|
|
483
|
-
const settings = cloneDefaults();
|
|
484
|
-
settings.id_prefix = normalizedPrefix;
|
|
485
|
-
applyGovernancePreset(settings, effectivePreset);
|
|
486
|
-
if (params.normalizedOptions.authorFromOption !== undefined) {
|
|
487
|
-
settings.author_default = params.normalizedOptions.authorFromOption;
|
|
488
|
-
}
|
|
489
|
-
if (chosenTelemetryEnabled !== undefined) {
|
|
490
|
-
settings.telemetry.enabled = chosenTelemetryEnabled;
|
|
491
|
-
settings.telemetry.first_run_prompt_completed = true;
|
|
492
|
-
}
|
|
493
|
-
await writeSettings(params.pmRoot, settings);
|
|
494
|
-
return {
|
|
495
|
-
settings,
|
|
496
|
-
normalizedPrefix,
|
|
497
|
-
chosenPreset,
|
|
498
|
-
wizardUsed,
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
async function resolveInitSettings(params) {
|
|
502
|
-
if (params.settingsExists) {
|
|
503
|
-
return await loadExistingInitSettings(params);
|
|
504
|
-
}
|
|
505
|
-
return await createNewInitSettings({
|
|
506
|
-
pmRoot: params.pmRoot,
|
|
507
|
-
normalizedPrefix: params.normalizedPrefix,
|
|
508
|
-
normalizedOptions: params.normalizedOptions,
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
async function applyInitAgentGuidance(params) {
|
|
512
|
-
const agentGuidanceResult = await runInitAgentGuidance({
|
|
513
|
-
pm_root: params.pmRoot,
|
|
514
|
-
cwd: params.cwd,
|
|
515
|
-
mode: params.agentGuidanceMode,
|
|
516
|
-
interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
517
|
-
settings: params.settings,
|
|
518
|
-
});
|
|
519
|
-
params.warnings.push(...agentGuidanceResult.warnings);
|
|
520
|
-
if (agentGuidanceResult.settings_changed) {
|
|
521
|
-
await writeSettings(params.pmRoot, params.settings);
|
|
522
|
-
}
|
|
523
|
-
return {
|
|
524
|
-
...agentGuidanceResult.summary,
|
|
525
|
-
next_steps: agentGuidanceResult.next_steps,
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
async function ensureInitRuntimeSchemaFiles(pmRoot, settings) {
|
|
529
|
-
const createdDirs = [];
|
|
530
|
-
const warnings = [];
|
|
531
|
-
const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);
|
|
532
|
-
for (const createdPath of runtimeSchemaScaffold.created_paths) {
|
|
533
|
-
createdDirs.push(createdPath);
|
|
534
|
-
warnings.push(...(await runActiveOnWriteHooks({
|
|
535
|
-
path: createdPath,
|
|
536
|
-
scope: "project",
|
|
537
|
-
op: "init:runtime_schema_file",
|
|
538
|
-
})));
|
|
539
|
-
}
|
|
540
|
-
return { createdDirs, warnings };
|
|
541
|
-
}
|
|
542
|
-
async function maybeRegisterInitTypePreset(params) {
|
|
543
|
-
if (params.typePreset === undefined) {
|
|
544
|
-
return undefined;
|
|
545
|
-
}
|
|
546
|
-
const registeredTypePreset = await registerInitTypePreset(params.pmRoot, params.settings, params.typePreset);
|
|
547
|
-
params.warnings.push(`registered_type_preset:${params.typePreset}`);
|
|
548
|
-
params.warnings.push(...(await runActiveOnWriteHooks({
|
|
549
|
-
path: registeredTypePreset.file,
|
|
550
|
-
scope: "project",
|
|
551
|
-
op: "init:type_preset",
|
|
552
|
-
})));
|
|
553
|
-
return registeredTypePreset;
|
|
554
|
-
}
|
|
555
|
-
async function ensureInitTypeDirectories(params) {
|
|
556
|
-
const typeRegistry = resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations());
|
|
557
|
-
const customTypeFolders = typeRegistry.folders.filter((folder) => !PM_REQUIRED_SUBDIRS.includes(folder));
|
|
558
|
-
const scaffold = await ensureInitDirectories(params.pmRoot, customTypeFolders);
|
|
559
|
-
params.createdDirs.push(...scaffold.createdDirs);
|
|
560
|
-
params.warnings.push(...scaffold.warnings);
|
|
561
|
-
}
|
|
562
|
-
function resolveInitWorkspaceRoot(target) {
|
|
563
|
-
const trackerRoot = path.resolve(target.tracker_root);
|
|
564
|
-
const agentsRoot = path.dirname(trackerRoot);
|
|
565
|
-
if (path.basename(trackerRoot) === "pm" && path.basename(agentsRoot) === ".agents") {
|
|
566
|
-
return path.dirname(agentsRoot);
|
|
567
|
-
}
|
|
568
|
-
return target.workspace_root;
|
|
569
|
-
}
|
|
570
|
-
async function maybeInstallInitBundledPackages(installBundledPackages, global, pmRoot, warnings) {
|
|
571
|
-
if (!installBundledPackages) {
|
|
572
|
-
return undefined;
|
|
573
|
-
}
|
|
574
|
-
const packageInstallResult = await runExtension("all", { install: true, project: true }, { ...global, path: pmRoot });
|
|
575
|
-
warnings.push(...packageInstallResult.warnings);
|
|
576
|
-
const installedPackages = summarizeInstalledPackages(packageInstallResult);
|
|
577
|
-
const failedAliases = installedPackages.packages
|
|
578
|
-
.filter((entry) => !entry.ok)
|
|
579
|
-
.map((entry) => entry.alias);
|
|
580
|
-
if (!installedPackages.installed_all || failedAliases.length > 0) {
|
|
581
|
-
throw new PmCliError(`pm init --with-packages did not install all bundled packages successfully${failedAliases.length > 0 ? `: ${failedAliases.join(", ")}` : "."}`, EXIT_CODE.GENERIC_FAILURE);
|
|
582
|
-
}
|
|
583
|
-
return installedPackages;
|
|
584
|
-
}
|
|
585
|
-
function buildInitNextSteps(params) {
|
|
586
|
-
const pmCommand = (args) => renderPmCommand([
|
|
587
|
-
...(params.target.mode === "workspace-discovery"
|
|
588
|
-
? []
|
|
589
|
-
: ["--pm-path", params.target.tracker_root]),
|
|
590
|
-
...args,
|
|
591
|
-
]);
|
|
592
|
-
const nextSteps = [
|
|
593
|
-
`Create your first item: ${pmCommand(["create", "--type", "Task", "--title", "<title>"])}`,
|
|
594
|
-
`List active items: ${pmCommand(["list"])}`,
|
|
595
|
-
`Get agent-friendly project context: ${pmCommand(["context"])}`,
|
|
596
|
-
];
|
|
597
|
-
if (!params.installBundledPackages) {
|
|
598
|
-
nextSteps.push(`Add optional packages for richer workflows: ${pmCommand(["install", "calendar", "--project"])}, ${pmCommand(["install", "templates", "--project"])}, ${pmCommand(["install", "guide-shell", "--project"])}`);
|
|
599
|
-
nextSteps.push(`Or install everything bundled: ${pmCommand(["init", "--with-packages"])} (idempotent on re-run)`);
|
|
600
|
-
}
|
|
601
|
-
else {
|
|
602
|
-
nextSteps.push(`Explore newly-available commands: ${pmCommand(["cal"])}, ${pmCommand(["templates"])}, ${pmCommand(["guide"])}`);
|
|
603
|
-
}
|
|
604
|
-
if (params.registeredTypePreset) {
|
|
605
|
-
nextSteps.push(`Inspect registered preset types: ${pmCommand(["schema", "list"])}, ${pmCommand(["schema", "show", params.registeredTypePreset.registered[0] ?? params.registeredTypePreset.updated[0]])}`);
|
|
606
|
-
}
|
|
607
|
-
nextSteps.push("Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.");
|
|
608
|
-
for (const guidanceNextStep of params.agentGuidanceNextSteps) {
|
|
609
|
-
const scopedGuidance = params.target.mode === "workspace-discovery"
|
|
610
|
-
? guidanceNextStep
|
|
611
|
-
: guidanceNextStep.replace(/\bpm (?=[a-z])/g, () => `${pmCommand([])} `);
|
|
612
|
-
if (!nextSteps.includes(scopedGuidance)) {
|
|
613
|
-
nextSteps.push(scopedGuidance);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
return nextSteps;
|
|
617
|
-
}
|
|
618
|
-
/** Implements run init for the public runtime surface of this module. */
|
|
619
|
-
export async function runInit(prefixArg, global, options = {}) {
|
|
620
|
-
const cwd = process.cwd();
|
|
621
|
-
const invocation = resolveInitInvocation(cwd, global, prefixArg, options.workspace);
|
|
622
|
-
const pmRoot = invocation.pmRoot;
|
|
623
|
-
prefixArg = invocation.prefixArg;
|
|
624
|
-
await assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot, invocation.target.mode === "tracker-path", options.force === true);
|
|
625
|
-
const createdDirs = [];
|
|
626
|
-
const warnings = [];
|
|
627
|
-
const baseDirs = await ensureInitDirectories(pmRoot, PM_REQUIRED_SUBDIRS);
|
|
628
|
-
createdDirs.push(...baseDirs.createdDirs);
|
|
629
|
-
warnings.push(...baseDirs.warnings);
|
|
630
|
-
const settingsPath = path.join(pmRoot, "settings.json");
|
|
631
|
-
const settingsExists = await pathExists(settingsPath);
|
|
632
|
-
const normalizedOptions = normalizeInitCommandOptions(options);
|
|
633
|
-
const settingsResolution = await resolveInitSettings({
|
|
634
|
-
pmRoot,
|
|
635
|
-
settingsPath,
|
|
636
|
-
settingsExists,
|
|
637
|
-
normalizedPrefix: normalizePrefix(prefixArg),
|
|
638
|
-
prefixArg,
|
|
639
|
-
options,
|
|
640
|
-
normalizedOptions,
|
|
641
|
-
warnings,
|
|
642
|
-
});
|
|
643
|
-
let { settings } = settingsResolution;
|
|
644
|
-
const agentGuidance = await applyInitAgentGuidance({
|
|
645
|
-
pmRoot,
|
|
646
|
-
cwd,
|
|
647
|
-
agentGuidanceMode: normalizedOptions.agentGuidanceMode,
|
|
648
|
-
settings,
|
|
649
|
-
warnings,
|
|
650
|
-
});
|
|
651
|
-
const schemaFiles = await ensureInitRuntimeSchemaFiles(pmRoot, settings);
|
|
652
|
-
createdDirs.push(...schemaFiles.createdDirs);
|
|
653
|
-
warnings.push(...schemaFiles.warnings);
|
|
654
|
-
const registeredTypePreset = await maybeRegisterInitTypePreset({
|
|
655
|
-
pmRoot,
|
|
656
|
-
settings,
|
|
657
|
-
typePreset: normalizedOptions.typePreset,
|
|
658
|
-
warnings,
|
|
659
|
-
});
|
|
660
|
-
if (registeredTypePreset) {
|
|
661
|
-
settings = await readSettings(pmRoot);
|
|
662
|
-
}
|
|
663
|
-
await ensureInitTypeDirectories({ pmRoot, settings, createdDirs, warnings });
|
|
664
|
-
const workspaceRoot = resolveInitWorkspaceRoot(invocation.target);
|
|
665
|
-
if (workspaceRoot) {
|
|
666
|
-
const gitignore = await ensurePmGitignore(workspaceRoot);
|
|
667
|
-
if (gitignore.changed) {
|
|
668
|
-
warnings.push(`updated:gitignore:${gitignore.path}`);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
const installedPackages = await maybeInstallInitBundledPackages(normalizedOptions.installBundledPackages, global, pmRoot, warnings);
|
|
672
|
-
const nextSteps = buildInitNextSteps({
|
|
673
|
-
installBundledPackages: normalizedOptions.installBundledPackages,
|
|
674
|
-
registeredTypePreset,
|
|
675
|
-
agentGuidanceNextSteps: agentGuidance.next_steps,
|
|
676
|
-
target: invocation.target,
|
|
677
|
-
});
|
|
678
|
-
return {
|
|
679
|
-
ok: true,
|
|
680
|
-
path: pmRoot,
|
|
681
|
-
target: invocation.target,
|
|
682
|
-
settings,
|
|
683
|
-
created_dirs: createdDirs,
|
|
684
|
-
warnings,
|
|
685
|
-
governance_preset: settings.governance.preset,
|
|
686
|
-
wizard_used: settingsResolution.wizardUsed,
|
|
687
|
-
...(registeredTypePreset
|
|
688
|
-
? { registered_type_preset: registeredTypePreset }
|
|
689
|
-
: {}),
|
|
690
|
-
...(installedPackages ? { installed_packages: installedPackages } : {}),
|
|
691
|
-
next_steps: nextSteps,
|
|
692
|
-
agent_guidance: agentGuidance,
|
|
693
|
-
};
|
|
694
|
-
}
|
|
7
|
+
!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]="0d10e7b8-b8f0-5958-87b9-c0f6d73c08c9")}catch(e){}}();
|
|
8
|
+
export * from "../../sdk/init.js";
|
|
695
9
|
//# sourceMappingURL=init.js.map
|
|
696
|
-
//# debugId=
|
|
10
|
+
//# debugId=0d10e7b8-b8f0-5958-87b9-c0f6d73c08c9
|