@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
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/extension/install-runtime
|
|
3
|
+
*
|
|
4
|
+
* Provides cross-platform extension copy safety and owner-bound install locks.
|
|
5
|
+
*/
|
|
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]="ef5442ae-3385-544e-889f-d4d78ee473c1")}catch(e){}}();
|
|
8
|
+
import { randomUUID } from "node:crypto";
|
|
9
|
+
import fs from "node:fs/promises";
|
|
10
|
+
import os from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
13
|
+
import { isPathWithinDirectory } from "../../core/fs/path-utils.js";
|
|
14
|
+
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
15
|
+
import { PmCliError } from "../../core/shared/errors.js";
|
|
16
|
+
import { nowIso } from "../../core/shared/time.js";
|
|
17
|
+
const EXTENSION_INSTALL_COPY_ATTEMPTS = 3;
|
|
18
|
+
const EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;
|
|
19
|
+
const EXTENSION_INSTALL_LOCK_DELAY_MS = 250;
|
|
20
|
+
const EXTENSION_INSTALL_LOCK_STALE_MS = 120_000;
|
|
21
|
+
const RETRIABLE_EXTENSION_INSTALL_COPY_CODES = new Set([
|
|
22
|
+
"EEXIST",
|
|
23
|
+
"ENOTEMPTY",
|
|
24
|
+
"ENOENT",
|
|
25
|
+
]);
|
|
26
|
+
/** Return an errno-style code from an unknown failure when one is present. */
|
|
27
|
+
const errnoCode = (error) => typeof error === "object" && error !== null && "code" in error
|
|
28
|
+
? error.code
|
|
29
|
+
: undefined;
|
|
30
|
+
/** Identify transient copy races that are safe to retry during extension installation. */
|
|
31
|
+
export const isRetriableExtensionInstallCopyError = (error) => RETRIABLE_EXTENSION_INSTALL_COPY_CODES.has(String(errnoCode(error)));
|
|
32
|
+
/** Test an unknown failure against one expected errno-style code. */
|
|
33
|
+
export const isErrnoCode = (error, code) => errnoCode(error) === code;
|
|
34
|
+
/** Delay an extension filesystem retry without blocking the event loop. */
|
|
35
|
+
const sleep = (ms) => new Promise((resolve) => {
|
|
36
|
+
setTimeout(resolve, ms);
|
|
37
|
+
});
|
|
38
|
+
/** Ensure an installed extension carries an ESM package boundary marker. */
|
|
39
|
+
export const ensureExtensionModuleTypeMarker = async (destinationDirectory) => {
|
|
40
|
+
const markerPath = path.join(destinationDirectory, "package.json");
|
|
41
|
+
if (await pathExists(markerPath)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await fs.writeFile(markerPath, `${JSON.stringify({ type: "module" }, null, 2)}\n`, "utf8");
|
|
45
|
+
};
|
|
46
|
+
/** Resolve a possibly partial extension destination through every existing symlink segment. */
|
|
47
|
+
export const resolveCanonicalExtensionInstallDestination = async (destinationDirectory) => {
|
|
48
|
+
const resolvedDestination = path.resolve(destinationDirectory);
|
|
49
|
+
const destinationParent = path.dirname(resolvedDestination);
|
|
50
|
+
const destinationRoot = path.parse(destinationParent).root;
|
|
51
|
+
let canonicalDestinationParent = await fs
|
|
52
|
+
.realpath(destinationRoot)
|
|
53
|
+
.catch(() => destinationRoot);
|
|
54
|
+
const relativeDestinationParent = path.relative(destinationRoot, destinationParent);
|
|
55
|
+
const destinationSegments = relativeDestinationParent === ""
|
|
56
|
+
? []
|
|
57
|
+
: relativeDestinationParent.split(path.sep);
|
|
58
|
+
for (const [index, segment] of destinationSegments.entries()) {
|
|
59
|
+
const candidate = path.join(canonicalDestinationParent, segment);
|
|
60
|
+
try {
|
|
61
|
+
canonicalDestinationParent = await fs.realpath(candidate);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
canonicalDestinationParent = path.join(canonicalDestinationParent, ...destinationSegments.slice(index));
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return path.join(canonicalDestinationParent, path.basename(resolvedDestination));
|
|
69
|
+
};
|
|
70
|
+
/** Copy an extension without recursively copying a destination nested below its source. */
|
|
71
|
+
export const copyExtensionDirectoryWithoutSelfNesting = async (sourceDirectory, destinationDirectory, copyDirectory, temporaryDirectory = os.tmpdir()) => {
|
|
72
|
+
const resolvedSource = path.resolve(sourceDirectory);
|
|
73
|
+
const canonicalSource = await fs
|
|
74
|
+
.realpath(resolvedSource)
|
|
75
|
+
.catch(() => resolvedSource);
|
|
76
|
+
const canonicalDestination = await resolveCanonicalExtensionInstallDestination(destinationDirectory);
|
|
77
|
+
if (canonicalSource === canonicalDestination) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!isPathWithinDirectory(canonicalSource, canonicalDestination)) {
|
|
81
|
+
await copyDirectory(sourceDirectory, destinationDirectory, {
|
|
82
|
+
recursive: true,
|
|
83
|
+
force: true,
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const systemTempDirectory = path.resolve(temporaryDirectory);
|
|
88
|
+
const stagingBase = isPathWithinDirectory(canonicalSource, systemTempDirectory)
|
|
89
|
+
? path.dirname(canonicalSource)
|
|
90
|
+
: systemTempDirectory;
|
|
91
|
+
if (isPathWithinDirectory(canonicalSource, stagingBase)) {
|
|
92
|
+
throw new PmCliError(`Extension source "${sourceDirectory}" contains its install destination and no external staging directory is available. Install a narrower package directory instead.`, EXIT_CODE.USAGE, { code: "extension_install_source_contains_destination" });
|
|
93
|
+
}
|
|
94
|
+
const stagingRoot = await fs.mkdtemp(path.join(stagingBase, "pm-extension-copy-"));
|
|
95
|
+
const stagedDirectory = path.join(stagingRoot, "extension");
|
|
96
|
+
try {
|
|
97
|
+
await copyDirectory(sourceDirectory, stagedDirectory, {
|
|
98
|
+
recursive: true,
|
|
99
|
+
force: true,
|
|
100
|
+
});
|
|
101
|
+
await copyDirectory(stagedDirectory, destinationDirectory, {
|
|
102
|
+
recursive: true,
|
|
103
|
+
force: true,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
await fs.rm(stagingRoot, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
/** Copy one extension directory with bounded transient-race retries. */
|
|
111
|
+
export const copyExtensionDirectoryForInstall = async (sourceDirectory, destinationDirectory, copyDirectory = fs.cp) => {
|
|
112
|
+
for (let attempt = 1; attempt <= EXTENSION_INSTALL_COPY_ATTEMPTS; attempt += 1) {
|
|
113
|
+
try {
|
|
114
|
+
await fs.rm(destinationDirectory, { recursive: true, force: true });
|
|
115
|
+
await copyExtensionDirectoryWithoutSelfNesting(sourceDirectory, destinationDirectory, copyDirectory);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (!isRetriableExtensionInstallCopyError(error) ||
|
|
120
|
+
attempt === EXTENSION_INSTALL_COPY_ATTEMPTS) {
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
await sleep(EXTENSION_INSTALL_LOCK_DELAY_MS);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
/** Read the unique owner token recorded for one extension scope lock. */
|
|
128
|
+
const readExtensionInstallLockOwnerToken = async (lockPath) => {
|
|
129
|
+
let ownerContents;
|
|
130
|
+
try {
|
|
131
|
+
ownerContents = await fs.readFile(path.join(lockPath, "owner.json"), "utf8");
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (!isErrnoCode(error, "ENOENT"))
|
|
135
|
+
throw error;
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
let parsed;
|
|
139
|
+
try {
|
|
140
|
+
parsed = JSON.parse(ownerContents);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
if (typeof parsed !== "object" || parsed === null || !("token" in parsed)) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
const token = parsed.token;
|
|
149
|
+
return typeof token === "string" && token.length > 0 ? token : null;
|
|
150
|
+
};
|
|
151
|
+
/** Remove an extension scope lock only while its persisted owner token still matches. */
|
|
152
|
+
const removeExtensionInstallLockIfOwned = async (lockPath, ownerToken) => {
|
|
153
|
+
const currentOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);
|
|
154
|
+
if (currentOwnerToken !== ownerToken) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
await fs.rm(lockPath, { recursive: true, force: true });
|
|
158
|
+
return true;
|
|
159
|
+
};
|
|
160
|
+
/** Reclaim an expired extension scope lock when its persisted owner remains unchanged. */
|
|
161
|
+
const reclaimStaleExtensionInstallLock = async (lockPath, staleMs) => {
|
|
162
|
+
let stat;
|
|
163
|
+
try {
|
|
164
|
+
stat = await fs.stat(lockPath);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (Date.now() - stat.mtimeMs <= staleMs) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
const staleOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);
|
|
173
|
+
if (staleOwnerToken === null) {
|
|
174
|
+
await fs.rm(lockPath, { recursive: true, force: true });
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return removeExtensionInstallLockIfOwned(lockPath, staleOwnerToken);
|
|
178
|
+
};
|
|
179
|
+
/** Start an owner-bound lease heartbeat and return an async stop barrier. */
|
|
180
|
+
const startExtensionInstallLockHeartbeat = (lockPath, ownerToken, intervalMs) => {
|
|
181
|
+
let heartbeat = Promise.resolve();
|
|
182
|
+
const timer = setInterval(() => {
|
|
183
|
+
heartbeat = heartbeat
|
|
184
|
+
.then(async () => {
|
|
185
|
+
if ((await readExtensionInstallLockOwnerToken(lockPath)) !== ownerToken) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const heartbeatAt = new Date();
|
|
189
|
+
await fs.utimes(lockPath, heartbeatAt, heartbeatAt);
|
|
190
|
+
})
|
|
191
|
+
.catch(() => undefined);
|
|
192
|
+
}, intervalMs);
|
|
193
|
+
timer.unref();
|
|
194
|
+
return async () => {
|
|
195
|
+
clearInterval(timer);
|
|
196
|
+
await heartbeat;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
/** Create one owner-bound extension install lock, removing partial state on failure. */
|
|
200
|
+
const createExtensionInstallLock = async (lockPath, owner) => {
|
|
201
|
+
await fs.mkdir(lockPath);
|
|
202
|
+
try {
|
|
203
|
+
await fs.writeFile(path.join(lockPath, "owner.json"), `${JSON.stringify(owner, null, 2)}\n`, "utf8");
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
await fs.rm(lockPath, { recursive: true, force: true }).catch(() => { });
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
/** Retry owner-bound extension lock acquisition while reclaiming stale owners. */
|
|
211
|
+
const acquireExtensionInstallLock = async (lockPath, owner, attempts, delayMs, staleMs) => {
|
|
212
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
213
|
+
try {
|
|
214
|
+
await createExtensionInstallLock(lockPath, owner);
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (!isErrnoCode(error, "EEXIST")) {
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
if (await reclaimStaleExtensionInstallLock(lockPath, staleMs)) {
|
|
222
|
+
attempt -= 1;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
await sleep(delayMs);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return false;
|
|
230
|
+
};
|
|
231
|
+
/** Run one operation under an owner-bound extension install lock and heartbeat lease. */
|
|
232
|
+
export const withExtensionInstallLock = async (settingsRoot, destinationDirectoryName, run, options) => {
|
|
233
|
+
const lockRoot = path.join(settingsRoot, "runtime", "extension-install-locks");
|
|
234
|
+
const lockPath = path.join(lockRoot, "scope.lock");
|
|
235
|
+
await fs.mkdir(lockRoot, { recursive: true });
|
|
236
|
+
const { attempts: rawAttempts = EXTENSION_INSTALL_LOCK_ATTEMPTS, delay_ms: rawDelayMs = EXTENSION_INSTALL_LOCK_DELAY_MS, stale_ms: rawStaleMs = EXTENSION_INSTALL_LOCK_STALE_MS, heartbeat_ms: rawHeartbeatMs, } = options ?? {};
|
|
237
|
+
if (![rawAttempts, rawDelayMs, rawStaleMs, rawHeartbeatMs]
|
|
238
|
+
.filter((value) => value !== undefined)
|
|
239
|
+
.every(Number.isFinite)) {
|
|
240
|
+
throw new PmCliError("Extension install lock timings must be finite numbers.", EXIT_CODE.USAGE);
|
|
241
|
+
}
|
|
242
|
+
const attempts = Math.max(1, Math.floor(rawAttempts));
|
|
243
|
+
const delayMs = Math.max(0, Math.floor(rawDelayMs));
|
|
244
|
+
const staleMs = Math.floor(rawStaleMs);
|
|
245
|
+
const heartbeatMs = Math.floor(rawHeartbeatMs ?? staleMs / 3);
|
|
246
|
+
if (staleMs <= 0 || heartbeatMs <= 0 || heartbeatMs >= staleMs) {
|
|
247
|
+
throw new PmCliError("Extension install lock timings require stale_ms > 0 and 0 < heartbeat_ms < stale_ms.", EXIT_CODE.USAGE);
|
|
248
|
+
}
|
|
249
|
+
const owner = {
|
|
250
|
+
pid: process.pid,
|
|
251
|
+
token: randomUUID(),
|
|
252
|
+
created_at: nowIso(),
|
|
253
|
+
destination: destinationDirectoryName,
|
|
254
|
+
};
|
|
255
|
+
const acquired = await acquireExtensionInstallLock(lockPath, owner, attempts, delayMs, staleMs);
|
|
256
|
+
if (!acquired) {
|
|
257
|
+
throw new PmCliError(`Timed out waiting for extension install lock for "${destinationDirectoryName}".`, EXIT_CODE.CONFLICT);
|
|
258
|
+
}
|
|
259
|
+
const stopHeartbeat = startExtensionInstallLockHeartbeat(lockPath, owner.token, heartbeatMs);
|
|
260
|
+
try {
|
|
261
|
+
return await run();
|
|
262
|
+
}
|
|
263
|
+
finally {
|
|
264
|
+
await stopHeartbeat();
|
|
265
|
+
await removeExtensionInstallLockIfOwned(lockPath, owner.token).catch(() => false);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
//# sourceMappingURL=install-runtime.js.map
|
|
269
|
+
//# debugId=ef5442ae-3385-544e-889f-d4d78ee473c1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-runtime.js","sources":["sdk/extension/install-runtime.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/install-runtime\n *\n * Provides cross-platform extension copy safety and owner-bound install locks.\n */\nimport { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\n\nconst EXTENSION_INSTALL_COPY_ATTEMPTS = 3;\nconst EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;\nconst EXTENSION_INSTALL_LOCK_DELAY_MS = 250;\nconst EXTENSION_INSTALL_LOCK_STALE_MS = 120_000;\nconst RETRIABLE_EXTENSION_INSTALL_COPY_CODES = new Set([\n \"EEXIST\",\n \"ENOTEMPTY\",\n \"ENOENT\",\n]);\n\ninterface ExtensionInstallLockOwner {\n pid: number;\n token: string;\n created_at: string;\n destination: string;\n}\n\n/** Retry and lease timing overrides for one extension install lock. */\nexport interface ExtensionInstallLockOptions {\n /** Maximum lock-acquisition attempts. */\n attempts?: number;\n /** Delay between contended acquisition attempts. */\n delay_ms?: number;\n /** Age after which an unchanged owner lease can be reclaimed. */\n stale_ms?: number;\n /** Lease heartbeat interval while the operation runs. */\n heartbeat_ms?: number;\n}\n\n/** Return an errno-style code from an unknown failure when one is present. */\nconst errnoCode = (error: unknown): unknown =>\n typeof error === \"object\" && error !== null && \"code\" in error\n ? (error as { code?: unknown }).code\n : undefined;\n\n/** Identify transient copy races that are safe to retry during extension installation. */\nexport const isRetriableExtensionInstallCopyError = (error: unknown): boolean =>\n RETRIABLE_EXTENSION_INSTALL_COPY_CODES.has(String(errnoCode(error)));\n\n/** Test an unknown failure against one expected errno-style code. */\nexport const isErrnoCode = (error: unknown, code: string): boolean =>\n errnoCode(error) === code;\n\n/** Delay an extension filesystem retry without blocking the event loop. */\nconst sleep = (ms: number): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n\n/** Ensure an installed extension carries an ESM package boundary marker. */\nexport const ensureExtensionModuleTypeMarker = async (\n destinationDirectory: string,\n): Promise<void> => {\n const markerPath = path.join(destinationDirectory, \"package.json\");\n if (await pathExists(markerPath)) {\n return;\n }\n await fs.writeFile(\n markerPath,\n `${JSON.stringify({ type: \"module\" }, null, 2)}\\n`,\n \"utf8\",\n );\n};\n\n/** Resolve a possibly partial extension destination through every existing symlink segment. */\nexport const resolveCanonicalExtensionInstallDestination = async (\n destinationDirectory: string,\n): Promise<string> => {\n const resolvedDestination = path.resolve(destinationDirectory);\n const destinationParent = path.dirname(resolvedDestination);\n const destinationRoot = path.parse(destinationParent).root;\n let canonicalDestinationParent = await fs\n .realpath(destinationRoot)\n .catch(() => destinationRoot);\n const relativeDestinationParent = path.relative(\n destinationRoot,\n destinationParent,\n );\n const destinationSegments =\n relativeDestinationParent === \"\"\n ? []\n : relativeDestinationParent.split(path.sep);\n for (const [index, segment] of destinationSegments.entries()) {\n const candidate = path.join(canonicalDestinationParent, segment);\n try {\n canonicalDestinationParent = await fs.realpath(candidate);\n } catch {\n canonicalDestinationParent = path.join(\n canonicalDestinationParent,\n ...destinationSegments.slice(index),\n );\n break;\n }\n }\n return path.join(\n canonicalDestinationParent,\n path.basename(resolvedDestination),\n );\n};\n\n/** Copy an extension without recursively copying a destination nested below its source. */\nexport const copyExtensionDirectoryWithoutSelfNesting = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp,\n temporaryDirectory = os.tmpdir(),\n): Promise<void> => {\n const resolvedSource = path.resolve(sourceDirectory);\n const canonicalSource = await fs\n .realpath(resolvedSource)\n .catch(() => resolvedSource);\n const canonicalDestination =\n await resolveCanonicalExtensionInstallDestination(destinationDirectory);\n if (canonicalSource === canonicalDestination) {\n return;\n }\n if (!isPathWithinDirectory(canonicalSource, canonicalDestination)) {\n await copyDirectory(sourceDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n return;\n }\n\n const systemTempDirectory = path.resolve(temporaryDirectory);\n const stagingBase = isPathWithinDirectory(\n canonicalSource,\n systemTempDirectory,\n )\n ? path.dirname(canonicalSource)\n : systemTempDirectory;\n if (isPathWithinDirectory(canonicalSource, stagingBase)) {\n throw new PmCliError(\n `Extension source \"${sourceDirectory}\" contains its install destination and no external staging directory is available. Install a narrower package directory instead.`,\n EXIT_CODE.USAGE,\n { code: \"extension_install_source_contains_destination\" },\n );\n }\n const stagingRoot = await fs.mkdtemp(\n path.join(stagingBase, \"pm-extension-copy-\"),\n );\n const stagedDirectory = path.join(stagingRoot, \"extension\");\n try {\n await copyDirectory(sourceDirectory, stagedDirectory, {\n recursive: true,\n force: true,\n });\n await copyDirectory(stagedDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n } finally {\n await fs.rm(stagingRoot, { recursive: true, force: true });\n }\n};\n\n/** Copy one extension directory with bounded transient-race retries. */\nexport const copyExtensionDirectoryForInstall = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp = fs.cp,\n): Promise<void> => {\n for (\n let attempt = 1;\n attempt <= EXTENSION_INSTALL_COPY_ATTEMPTS;\n attempt += 1\n ) {\n try {\n await fs.rm(destinationDirectory, { recursive: true, force: true });\n await copyExtensionDirectoryWithoutSelfNesting(\n sourceDirectory,\n destinationDirectory,\n copyDirectory,\n );\n return;\n } catch (error: unknown) {\n if (\n !isRetriableExtensionInstallCopyError(error) ||\n attempt === EXTENSION_INSTALL_COPY_ATTEMPTS\n ) {\n throw error;\n }\n await sleep(EXTENSION_INSTALL_LOCK_DELAY_MS);\n }\n }\n};\n\n/** Read the unique owner token recorded for one extension scope lock. */\nconst readExtensionInstallLockOwnerToken = async (\n lockPath: string,\n): Promise<string | null> => {\n let ownerContents: string;\n try {\n ownerContents = await fs.readFile(\n path.join(lockPath, \"owner.json\"),\n \"utf8\",\n );\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"ENOENT\")) throw error;\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(ownerContents);\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null || !(\"token\" in parsed)) {\n return null;\n }\n const token = (parsed as { token?: unknown }).token;\n return typeof token === \"string\" && token.length > 0 ? token : null;\n};\n\n/** Remove an extension scope lock only while its persisted owner token still matches. */\nconst removeExtensionInstallLockIfOwned = async (\n lockPath: string,\n ownerToken: string,\n): Promise<boolean> => {\n const currentOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (currentOwnerToken !== ownerToken) {\n return false;\n }\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n};\n\n/** Reclaim an expired extension scope lock when its persisted owner remains unchanged. */\nconst reclaimStaleExtensionInstallLock = async (\n lockPath: string,\n staleMs: number,\n): Promise<boolean> => {\n let stat: Awaited<ReturnType<typeof fs.stat>>;\n try {\n stat = await fs.stat(lockPath);\n } catch {\n return false;\n }\n if (Date.now() - stat.mtimeMs <= staleMs) {\n return false;\n }\n const staleOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (staleOwnerToken === null) {\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n }\n return removeExtensionInstallLockIfOwned(lockPath, staleOwnerToken);\n};\n\n/** Start an owner-bound lease heartbeat and return an async stop barrier. */\nconst startExtensionInstallLockHeartbeat = (\n lockPath: string,\n ownerToken: string,\n intervalMs: number,\n): (() => Promise<void>) => {\n let heartbeat = Promise.resolve();\n const timer = setInterval(() => {\n heartbeat = heartbeat\n .then(async () => {\n if (\n (await readExtensionInstallLockOwnerToken(lockPath)) !== ownerToken\n ) {\n return;\n }\n const heartbeatAt = new Date();\n await fs.utimes(lockPath, heartbeatAt, heartbeatAt);\n })\n .catch(() => undefined);\n }, intervalMs);\n timer.unref();\n return async () => {\n clearInterval(timer);\n await heartbeat;\n };\n};\n\n/** Create one owner-bound extension install lock, removing partial state on failure. */\nconst createExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n): Promise<void> => {\n await fs.mkdir(lockPath);\n try {\n await fs.writeFile(\n path.join(lockPath, \"owner.json\"),\n `${JSON.stringify(owner, null, 2)}\\n`,\n \"utf8\",\n );\n } catch (error: unknown) {\n await fs.rm(lockPath, { recursive: true, force: true }).catch(() => {});\n throw error;\n }\n};\n\n/** Retry owner-bound extension lock acquisition while reclaiming stale owners. */\nconst acquireExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n attempts: number,\n delayMs: number,\n staleMs: number,\n): Promise<boolean> => {\n for (let attempt = 1; attempt <= attempts; attempt += 1) {\n try {\n await createExtensionInstallLock(lockPath, owner);\n return true;\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"EEXIST\")) {\n throw error;\n }\n if (await reclaimStaleExtensionInstallLock(lockPath, staleMs)) {\n attempt -= 1;\n } else {\n await sleep(delayMs);\n }\n }\n }\n return false;\n};\n\n/** Run one operation under an owner-bound extension install lock and heartbeat lease. */\nexport const withExtensionInstallLock = async <T>(\n settingsRoot: string,\n destinationDirectoryName: string,\n run: () => Promise<T>,\n options?: ExtensionInstallLockOptions,\n): Promise<T> => {\n const lockRoot = path.join(\n settingsRoot,\n \"runtime\",\n \"extension-install-locks\",\n );\n const lockPath = path.join(lockRoot, \"scope.lock\");\n await fs.mkdir(lockRoot, { recursive: true });\n const {\n attempts: rawAttempts = EXTENSION_INSTALL_LOCK_ATTEMPTS,\n delay_ms: rawDelayMs = EXTENSION_INSTALL_LOCK_DELAY_MS,\n stale_ms: rawStaleMs = EXTENSION_INSTALL_LOCK_STALE_MS,\n heartbeat_ms: rawHeartbeatMs,\n } = options ?? {};\n if (\n ![rawAttempts, rawDelayMs, rawStaleMs, rawHeartbeatMs]\n .filter((value): value is number => value !== undefined)\n .every(Number.isFinite)\n ) {\n throw new PmCliError(\n \"Extension install lock timings must be finite numbers.\",\n EXIT_CODE.USAGE,\n );\n }\n const attempts = Math.max(1, Math.floor(rawAttempts));\n const delayMs = Math.max(0, Math.floor(rawDelayMs));\n const staleMs = Math.floor(rawStaleMs);\n const heartbeatMs = Math.floor(rawHeartbeatMs ?? staleMs / 3);\n if (staleMs <= 0 || heartbeatMs <= 0 || heartbeatMs >= staleMs) {\n throw new PmCliError(\n \"Extension install lock timings require stale_ms > 0 and 0 < heartbeat_ms < stale_ms.\",\n EXIT_CODE.USAGE,\n );\n }\n const owner: ExtensionInstallLockOwner = {\n pid: process.pid,\n token: randomUUID(),\n created_at: nowIso(),\n destination: destinationDirectoryName,\n };\n const acquired = await acquireExtensionInstallLock(\n lockPath,\n owner,\n attempts,\n delayMs,\n staleMs,\n );\n if (!acquired) {\n throw new PmCliError(\n `Timed out waiting for extension install lock for \"${destinationDirectoryName}\".`,\n EXIT_CODE.CONFLICT,\n );\n }\n\n const stopHeartbeat = startExtensionInstallLockHeartbeat(\n lockPath,\n owner.token,\n heartbeatMs,\n );\n try {\n return await run();\n } finally {\n await stopHeartbeat();\n await removeExtensionInstallLockIfOwned(lockPath, owner.token).catch(\n () => false,\n );\n }\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6B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AAO,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;YAAS,CAAC;QACT,MAAM,aAAa,EAAE,CAAC;QACtB,MAAM,iCAAiC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAClE,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","debugId":"ef5442ae-3385-544e-889f-d4d78ee473c1"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Exact filesystem and metadata state captured before an extension install. */
|
|
2
|
+
export interface ExtensionInstallSnapshot {
|
|
3
|
+
/** Temporary copy of the prior destination directory. */
|
|
4
|
+
backupDirectory: string;
|
|
5
|
+
/** Extension destination being installed. */
|
|
6
|
+
destinationDirectory: string;
|
|
7
|
+
/** Whether the destination existed before installation. */
|
|
8
|
+
destinationExists: boolean;
|
|
9
|
+
/** Managed-extension state file path. */
|
|
10
|
+
managedStatePath: string;
|
|
11
|
+
/** Exact prior managed-extension state contents. */
|
|
12
|
+
managedStateContents: Buffer | null;
|
|
13
|
+
/** Project settings file path. */
|
|
14
|
+
settingsPath: string;
|
|
15
|
+
/** Exact prior project settings contents. */
|
|
16
|
+
settingsContents: Buffer | null;
|
|
17
|
+
}
|
|
18
|
+
/** Capture one optional metadata file without weakening non-ENOENT failures. */
|
|
19
|
+
export declare const readOptionalMetadataFile: (filePath: string) => Promise<Buffer | null>;
|
|
20
|
+
/** Capture extension files and metadata before applying an install mutation. */
|
|
21
|
+
export declare const captureExtensionInstallSnapshot: (selectedRoot: string, settingsRoot: string, destinationDirectory: string, destinationExists: boolean, backupDirectory: string) => Promise<ExtensionInstallSnapshot>;
|
|
22
|
+
/** Restore directory and metadata snapshots after a partially persisted install. */
|
|
23
|
+
export declare const restoreExtensionInstallSnapshot: (snapshot: ExtensionInstallSnapshot) => Promise<void>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/extension/install-snapshot
|
|
3
|
+
*
|
|
4
|
+
* Captures and restores extension files and metadata around install persistence.
|
|
5
|
+
*/
|
|
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]="b131d360-d3d1-54b1-800b-54d0ab0ad282")}catch(e){}}();
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { getSettingsPath } from "../../core/store/paths.js";
|
|
11
|
+
import { isErrnoCode } from "./install-runtime.js";
|
|
12
|
+
import { resolveManagedExtensionStatePath } from "./managed-state.js";
|
|
13
|
+
/** Capture one optional metadata file without weakening non-ENOENT failures. */
|
|
14
|
+
export const readOptionalMetadataFile = async (filePath) => fs.readFile(filePath).catch((error) => {
|
|
15
|
+
if (isErrnoCode(error, "ENOENT"))
|
|
16
|
+
return null;
|
|
17
|
+
throw error;
|
|
18
|
+
});
|
|
19
|
+
/** Capture extension files and metadata before applying an install mutation. */
|
|
20
|
+
export const captureExtensionInstallSnapshot = async (selectedRoot, settingsRoot, destinationDirectory, destinationExists, backupDirectory) => {
|
|
21
|
+
const managedStatePath = resolveManagedExtensionStatePath(selectedRoot);
|
|
22
|
+
const settingsPath = getSettingsPath(settingsRoot);
|
|
23
|
+
const [managedStateContents, settingsContents] = await Promise.all([
|
|
24
|
+
readOptionalMetadataFile(managedStatePath),
|
|
25
|
+
readOptionalMetadataFile(settingsPath),
|
|
26
|
+
]);
|
|
27
|
+
if (destinationExists) {
|
|
28
|
+
await fs.cp(destinationDirectory, backupDirectory, {
|
|
29
|
+
recursive: true,
|
|
30
|
+
force: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
backupDirectory,
|
|
35
|
+
destinationDirectory,
|
|
36
|
+
destinationExists,
|
|
37
|
+
managedStatePath,
|
|
38
|
+
managedStateContents,
|
|
39
|
+
settingsPath,
|
|
40
|
+
settingsContents,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** Restore directory and metadata snapshots after a partially persisted install. */
|
|
44
|
+
export const restoreExtensionInstallSnapshot = async (snapshot) => {
|
|
45
|
+
await fs.rm(snapshot.destinationDirectory, { recursive: true, force: true });
|
|
46
|
+
if (snapshot.destinationExists) {
|
|
47
|
+
await fs.cp(snapshot.backupDirectory, snapshot.destinationDirectory, {
|
|
48
|
+
recursive: true,
|
|
49
|
+
force: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
for (const [filePath, contents] of [
|
|
53
|
+
[snapshot.managedStatePath, snapshot.managedStateContents],
|
|
54
|
+
[snapshot.settingsPath, snapshot.settingsContents],
|
|
55
|
+
]) {
|
|
56
|
+
if (contents === null) {
|
|
57
|
+
await fs.rm(filePath, { force: true });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
61
|
+
await fs.writeFile(filePath, contents);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=install-snapshot.js.map
|
|
66
|
+
//# debugId=b131d360-d3d1-54b1-800b-54d0ab0ad282
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-snapshot.js","sources":["sdk/extension/install-snapshot.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/install-snapshot\n *\n * Captures and restores extension files and metadata around install persistence.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getSettingsPath } from \"../../core/store/paths.js\";\nimport { isErrnoCode } from \"./install-runtime.js\";\nimport { resolveManagedExtensionStatePath } from \"./managed-state.js\";\n\n/** Exact filesystem and metadata state captured before an extension install. */\nexport interface ExtensionInstallSnapshot {\n /** Temporary copy of the prior destination directory. */\n backupDirectory: string;\n /** Extension destination being installed. */\n destinationDirectory: string;\n /** Whether the destination existed before installation. */\n destinationExists: boolean;\n /** Managed-extension state file path. */\n managedStatePath: string;\n /** Exact prior managed-extension state contents. */\n managedStateContents: Buffer | null;\n /** Project settings file path. */\n settingsPath: string;\n /** Exact prior project settings contents. */\n settingsContents: Buffer | null;\n}\n\n/** Capture one optional metadata file without weakening non-ENOENT failures. */\nexport const readOptionalMetadataFile = async (\n filePath: string,\n): Promise<Buffer | null> =>\n fs.readFile(filePath).catch((error: unknown) => {\n if (isErrnoCode(error, \"ENOENT\")) return null;\n throw error;\n });\n\n/** Capture extension files and metadata before applying an install mutation. */\nexport const captureExtensionInstallSnapshot = async (\n selectedRoot: string,\n settingsRoot: string,\n destinationDirectory: string,\n destinationExists: boolean,\n backupDirectory: string,\n): Promise<ExtensionInstallSnapshot> => {\n const managedStatePath = resolveManagedExtensionStatePath(selectedRoot);\n const settingsPath = getSettingsPath(settingsRoot);\n const [managedStateContents, settingsContents] = await Promise.all([\n readOptionalMetadataFile(managedStatePath),\n readOptionalMetadataFile(settingsPath),\n ]);\n if (destinationExists) {\n await fs.cp(destinationDirectory, backupDirectory, {\n recursive: true,\n force: true,\n });\n }\n return {\n backupDirectory,\n destinationDirectory,\n destinationExists,\n managedStatePath,\n managedStateContents,\n settingsPath,\n settingsContents,\n };\n};\n\n/** Restore directory and metadata snapshots after a partially persisted install. */\nexport const restoreExtensionInstallSnapshot = async (\n snapshot: ExtensionInstallSnapshot,\n): Promise<void> => {\n await fs.rm(snapshot.destinationDirectory, { recursive: true, force: true });\n if (snapshot.destinationExists) {\n await fs.cp(snapshot.backupDirectory, snapshot.destinationDirectory, {\n recursive: true,\n force: true,\n });\n }\n for (const [filePath, contents] of [\n [snapshot.managedStatePath, snapshot.managedStateContents],\n [snapshot.settingsPath, snapshot.settingsContents],\n ] as const) {\n if (contents === null) {\n await fs.rm(filePath, { force: true });\n } else {\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, contents);\n }\n }\n};\n"],"names":[],"mappings":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management support for Install Sources.
|
|
5
5
|
*/
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
|
-
import { PmCliError, type PmCliErrorContext } from "
|
|
7
|
+
import { PmCliError, type PmCliErrorContext } from "../../core/shared/errors.js";
|
|
8
8
|
declare const execFileAsync: typeof execFile.__promisify__;
|
|
9
9
|
interface LocalInstallSource {
|
|
10
10
|
kind: "local";
|
|
@@ -41,7 +41,7 @@ export declare function parseExtensionInstallSource(input: string, options?: {
|
|
|
41
41
|
ref?: string;
|
|
42
42
|
}): InstallSource;
|
|
43
43
|
/** Implements run git command for the public runtime surface of this module. */
|
|
44
|
-
export declare function runGitCommand(args: string[], execRunner?: typeof execFileAsync): Promise<string>;
|
|
44
|
+
export declare function runGitCommand(args: string[], execRunner?: typeof execFileAsync, timeoutMs?: number): Promise<string>;
|
|
45
45
|
/** Implements resolve npm command name for the public runtime surface of this module. */
|
|
46
46
|
export declare function resolveNpmCommandName(platform?: NodeJS.Platform): "npm" | "npm.cmd";
|
|
47
47
|
/** Implements should run npm command in shell for the public runtime surface of this module. */
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module sdk/extension/install-sources
|
|
3
3
|
*
|
|
4
4
|
* Implements extension package-management support for Install Sources.
|
|
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]="
|
|
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]="38193531-eca3-557b-ab40-d4af159b9192")}catch(e){}}();
|
|
8
8
|
import { execFile } from "node:child_process";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { promisify } from "node:util";
|
|
14
|
-
import { collectPackageExtensionDirectories } from "
|
|
15
|
-
import { resolvePmPackageRootFromModule } from "
|
|
16
|
-
import { pathExists } from "
|
|
17
|
-
import { isPathWithinDirectory } from "
|
|
18
|
-
import { EXIT_CODE } from "
|
|
19
|
-
import { PmCliError, } from "
|
|
14
|
+
import { collectPackageExtensionDirectories } from "../../core/packages/manifest.js";
|
|
15
|
+
import { resolvePmPackageRootFromModule } from "../../core/packages/root.js";
|
|
16
|
+
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
17
|
+
import { isPathWithinDirectory } from "../../core/fs/path-utils.js";
|
|
18
|
+
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
19
|
+
import { PmCliError, } from "../../core/shared/errors.js";
|
|
20
20
|
import { listBundledPackageAliases } from "./bundled-catalog.js";
|
|
21
21
|
const execFileAsync = promisify(execFile);
|
|
22
22
|
const PM_CLI_PACKAGE_NAME = "@unbrained/pm-cli";
|
|
@@ -129,9 +129,12 @@ export function parseExtensionInstallSource(input, options = {}) {
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
/** Implements run git command for the public runtime surface of this module. */
|
|
132
|
-
export async function runGitCommand(args, execRunner = execFileAsync) {
|
|
132
|
+
export async function runGitCommand(args, execRunner = execFileAsync, timeoutMs) {
|
|
133
133
|
try {
|
|
134
|
-
const result = await execRunner("git", args, {
|
|
134
|
+
const result = await execRunner("git", args, {
|
|
135
|
+
encoding: "utf8",
|
|
136
|
+
timeout: timeoutMs,
|
|
137
|
+
});
|
|
135
138
|
return (result.stdout ?? "").trim();
|
|
136
139
|
}
|
|
137
140
|
catch (error) {
|
|
@@ -522,7 +525,7 @@ function removeHostedPmCliDependency(manifest) {
|
|
|
522
525
|
}
|
|
523
526
|
async function linkHostedPmCliDependency(packageRoot) {
|
|
524
527
|
const hostPackageRoot = resolvePmPackageRootFromModule(import.meta.url, [
|
|
525
|
-
"
|
|
528
|
+
"../../..",
|
|
526
529
|
]);
|
|
527
530
|
const [scope, packageName] = PM_CLI_PACKAGE_NAME.split("/");
|
|
528
531
|
const scopedDirectory = path.join(packageRoot, "node_modules", scope);
|
|
@@ -747,4 +750,4 @@ export const _testOnlyInstallSources = {
|
|
|
747
750
|
runNpmCommand,
|
|
748
751
|
};
|
|
749
752
|
//# sourceMappingURL=install-sources.js.map
|
|
750
|
-
//# debugId=
|
|
753
|
+
//# debugId=38193531-eca3-557b-ab40-d4af159b9192
|