@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["core/sentry/helpers.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/sentry/helpers\n *\n * Integrates Sentry instrumentation and release diagnostics for Helpers.\n */\nimport { getSentry } from \"./instrument.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE, type TelemetryErrorCategory } from \"../shared/constants.js\";\nimport {\n deriveTelemetryCommandResolution,\n deriveTelemetryCommandTaxonomy,\n type TelemetryCommandResolution,\n type TelemetryResolutionStage,\n} from \"../telemetry/observability.js\";\nimport type { Span } from \"@sentry/node\";\n\nlet activeCommandSpan: Span | undefined;\n\nfunction setSpanAttribute(\n span: Span,\n key: string,\n value: string | number | boolean | undefined,\n): void {\n if (value === undefined) {\n return;\n }\n const attributeTarget = span as unknown as {\n setAttribute?: (\n attrKey: string,\n attrValue: string | number | boolean,\n ) => void;\n };\n if (typeof attributeTarget.setAttribute === \"function\") {\n attributeTarget.setAttribute(key, value);\n }\n}\n\nfunction setSentryTagIfPresent(\n Sentry: NonNullable<ReturnType<typeof getSentry>>,\n key: string,\n value: string | undefined,\n): void {\n if (typeof value === \"string\" && value.trim().length > 0) {\n Sentry.setTag(key, value);\n }\n}\n\nfunction setSentryCommandFinishTags(\n Sentry: NonNullable<ReturnType<typeof getSentry>>,\n normalizedOk: string,\n metadata: Parameters<typeof sentryFinishCommandSpan>[2],\n): void {\n Sentry.setTag(\"pm.ok\", normalizedOk);\n Sentry.setTag(\"pm.command_ok\", normalizedOk);\n if (typeof metadata?.exit_code === \"number\") {\n Sentry.setTag(\"pm.exit_code\", String(metadata.exit_code));\n Sentry.setTag(\"pm.command_exit_code\", String(metadata.exit_code));\n }\n setSentryTagIfPresent(Sentry, \"pm.error_code\", metadata?.error_code);\n setSentryTagIfPresent(Sentry, \"pm.error_category\", metadata?.error_category);\n setSentryTagIfPresent(\n Sentry,\n \"pm.command_resolution\",\n metadata?.command_resolution,\n );\n setSentryTagIfPresent(\n Sentry,\n \"pm.resolution_stage\",\n metadata?.resolution_stage,\n );\n}\n\nfunction setCommandSpanFinishAttributes(\n span: Span,\n normalizedOk: string,\n normalizedExitCode: string | undefined,\n metadata: Parameters<typeof sentryFinishCommandSpan>[2],\n): void {\n setSpanAttribute(span, \"pm.ok\", normalizedOk);\n setSpanAttribute(span, \"pm.command_ok\", normalizedOk);\n setSpanAttribute(span, \"pm.exit_code\", normalizedExitCode);\n setSpanAttribute(span, \"pm.command_exit_code\", normalizedExitCode);\n setSpanAttribute(span, \"pm.error_code\", metadata?.error_code);\n setSpanAttribute(span, \"pm.error_category\", metadata?.error_category);\n setSpanAttribute(span, \"pm.command_resolution\", metadata?.command_resolution);\n setSpanAttribute(span, \"pm.resolution_stage\", metadata?.resolution_stage);\n}\n\n/** Implements sentry set command context for the public runtime surface of this module. */\nexport function sentrySetCommandContext(\n command: string,\n args: string[],\n options: Record<string, unknown>,\n metadata?: {\n source_context?: string;\n source_context_source?: string;\n },\n): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n const taxonomy = deriveTelemetryCommandTaxonomy(command);\n\n Sentry.setTag(\"pm.command\", command);\n Sentry.setTag(\"pm.command_root\", taxonomy.command_root);\n Sentry.setTag(\"pm.command_family\", taxonomy.command_family);\n if (\n typeof metadata?.source_context === \"string\" &&\n metadata.source_context.trim().length > 0\n ) {\n Sentry.setTag(\"pm.source_context\", metadata.source_context);\n }\n\n const safeArgs = args.map((arg) =>\n arg.startsWith(\"--\") ? arg.split(\"=\")[0] : arg,\n );\n\n Sentry.setContext(\"pm.command\", {\n name: command,\n root: taxonomy.command_root,\n leaf: taxonomy.command_leaf,\n family: taxonomy.command_family,\n args: safeArgs,\n option_keys: Object.keys(options).sort(),\n source_context: metadata?.source_context,\n source_context_source: metadata?.source_context_source,\n });\n\n Sentry.addBreadcrumb({\n category: \"pm.command\",\n message: `pm ${command}`,\n level: \"info\",\n data: {\n args: safeArgs,\n command_root: taxonomy.command_root,\n command_family: taxonomy.command_family,\n source_context: metadata?.source_context,\n },\n });\n}\n\n/** Implements sentry start command span for the public runtime surface of this module. */\nexport function sentryStartCommandSpan(command: string): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n\n activeCommandSpan = Sentry.startInactiveSpan({\n op: \"pm.command\",\n name: `pm ${command}`,\n forceTransaction: true,\n });\n}\n\n/** Implements sentry finish command span for the public runtime surface of this module. */\nexport function sentryFinishCommandSpan(\n ok: boolean,\n error?: string,\n metadata?: {\n error_code?: string;\n error_category?: TelemetryErrorCategory;\n exit_code?: number;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n },\n): void {\n if (!activeCommandSpan) return;\n const normalizedOk = ok ? \"true\" : \"false\";\n const normalizedExitCode =\n typeof metadata?.exit_code === \"number\"\n ? String(metadata.exit_code)\n : undefined;\n const Sentry = getSentry();\n if (Sentry) {\n setSentryCommandFinishTags(Sentry, normalizedOk, metadata);\n }\n setCommandSpanFinishAttributes(\n activeCommandSpan,\n normalizedOk,\n normalizedExitCode,\n metadata,\n );\n activeCommandSpan.setStatus(\n ok ? { code: 1 } : { code: 2, message: error ?? \"command_failed\" },\n );\n activeCommandSpan.end();\n activeCommandSpan = undefined;\n}\n\n/** Implements sentry capture cli error for the public runtime surface of this module. */\nexport function sentryCaptureCliError(error: unknown): void {\n if (!shouldCaptureCliError(error)) return;\n\n const Sentry = getSentry();\n if (!Sentry) return;\n\n if (error instanceof Error) {\n const extras: Record<string, unknown> = {};\n if (\n \"exitCode\" in error &&\n typeof (error as { exitCode: unknown }).exitCode === \"number\"\n ) {\n extras.exit_code = (error as { exitCode: number }).exitCode;\n }\n if (\n \"context\" in error &&\n typeof (error as { context: unknown }).context === \"object\"\n ) {\n extras.error_context = (error as { context: unknown }).context;\n }\n Sentry.captureException(error, { extra: extras });\n } else {\n Sentry.captureException(new Error(String(error)));\n }\n}\n\n/** Implements sentry log cli usage error for the public runtime surface of this module. */\nexport function sentryLogCliUsageError(params: {\n command: string;\n error_code: string;\n error_category: TelemetryErrorCategory;\n exit_code: number;\n error_message: string;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n source_context?: string;\n}): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n const resolvedCommandResolution =\n params.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: false,\n errorCode: params.error_code,\n errorCategory: params.error_category,\n });\n const resolvedResolutionStage = params.resolution_stage ?? \"unknown\";\n\n const payload = {\n \"pm.command\": params.command,\n \"pm.error_code\": params.error_code,\n \"pm.error_category\": params.error_category,\n \"pm.exit_code\": params.exit_code,\n \"pm.error_message\": params.error_message,\n \"pm.command_resolution\": resolvedCommandResolution,\n \"pm.resolution_stage\": resolvedResolutionStage,\n \"pm.source_context\": params.source_context ?? \"\",\n };\n const loggerCandidate = (\n Sentry as unknown as {\n logger?: {\n warn?: (message: string, attributes?: Record<string, unknown>) => void;\n };\n }\n ).logger;\n if (loggerCandidate && typeof loggerCandidate.warn === \"function\") {\n loggerCandidate.warn(\"pm_cli_usage_error\", payload);\n return;\n }\n\n Sentry.captureMessage(`pm_cli_usage_error:${params.error_code}`, {\n level: \"warning\",\n tags: {\n \"pm.command\": params.command,\n \"pm.error_code\": params.error_code,\n \"pm.error_category\": params.error_category,\n \"pm.exit_code\": String(params.exit_code),\n \"pm.command_resolution\": resolvedCommandResolution,\n \"pm.resolution_stage\": resolvedResolutionStage,\n \"pm.source_context\": params.source_context ?? \"unknown\",\n },\n extra: payload,\n });\n}\n\n/** Implements should capture cli error for the public runtime surface of this module. */\nexport function shouldCaptureCliError(error: unknown): boolean {\n if (error instanceof PmCliError) {\n return false;\n }\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"exitCode\" in error &&\n typeof (error as { exitCode?: unknown }).exitCode === \"number\"\n ) {\n const exitCode = Math.trunc((error as { exitCode: number }).exitCode);\n const expectedExitCodes: ReadonlySet<number> = new Set([\n EXIT_CODE.SUCCESS,\n EXIT_CODE.USAGE,\n EXIT_CODE.NOT_FOUND,\n EXIT_CODE.CONFLICT,\n ]);\n return !expectedExitCodes.has(exitCode);\n }\n return true;\n}\n\n/** Implements sentry flush for the public runtime surface of this module. */\nexport async function sentryFlush(timeoutMs = 3000): Promise<void> {\n const Sentry = getSentry();\n if (!Sentry) return;\n\n try {\n await S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nB,OAAQ,KAAgC,CAAC,QAAQ,KAAK,QAAQ,EAC9D,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAE,KAA8B,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;YACrD,SAAS,CAAC,OAAO;YACjB,SAAS,CAAC,KAAK;YACf,SAAS,CAAC,SAAS;YACnB,SAAS,CAAC,QAAQ;SACnB,CAAC,CAAC;QACH,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAS,GAAG,IAAI;IAChD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,0CAA0C;IAC5C,CAAC;AACH,CAAC","debugId":"b9353ece-0a99-5a54-85c7-573fc71856ec"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["core/sentry/helpers.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/sentry/helpers\n *\n * Integrates Sentry instrumentation and release diagnostics for Helpers.\n */\nimport { getSentry } from \"./instrument.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE, type TelemetryErrorCategory } from \"../shared/constants.js\";\nimport {\n deriveTelemetryCommandResolution,\n deriveTelemetryCommandTaxonomy,\n type TelemetryCommandResolution,\n type TelemetryResolutionStage,\n} from \"../telemetry/observability.js\";\nimport type { Span } from \"@sentry/node\";\n\nlet activeCommandSpan: Span | undefined;\n\nfunction setSpanAttribute(\n span: Span,\n key: string,\n value: string | number | boolean | undefined,\n): void {\n if (value === undefined) {\n return;\n }\n const attributeTarget = span as unknown as {\n setAttribute?: (\n attrKey: string,\n attrValue: string | number | boolean,\n ) => void;\n };\n if (typeof attributeTarget.setAttribute === \"function\") {\n attributeTarget.setAttribute(key, value);\n }\n}\n\nfunction setSentryTagIfPresent(\n Sentry: NonNullable<ReturnType<typeof getSentry>>,\n key: string,\n value: string | undefined,\n): void {\n if (typeof value === \"string\" && value.trim().length > 0) {\n Sentry.setTag(key, value);\n }\n}\n\nfunction setSentryCommandFinishTags(\n Sentry: NonNullable<ReturnType<typeof getSentry>>,\n normalizedOk: string,\n metadata: Parameters<typeof sentryFinishCommandSpan>[2],\n): void {\n Sentry.setTag(\"pm.ok\", normalizedOk);\n Sentry.setTag(\"pm.command_ok\", normalizedOk);\n if (typeof metadata?.exit_code === \"number\") {\n Sentry.setTag(\"pm.exit_code\", String(metadata.exit_code));\n Sentry.setTag(\"pm.command_exit_code\", String(metadata.exit_code));\n }\n setSentryTagIfPresent(Sentry, \"pm.error_code\", metadata?.error_code);\n setSentryTagIfPresent(Sentry, \"pm.error_category\", metadata?.error_category);\n setSentryTagIfPresent(\n Sentry,\n \"pm.command_resolution\",\n metadata?.command_resolution,\n );\n setSentryTagIfPresent(\n Sentry,\n \"pm.resolution_stage\",\n metadata?.resolution_stage,\n );\n}\n\nfunction setCommandSpanFinishAttributes(\n span: Span,\n normalizedOk: string,\n normalizedExitCode: string | undefined,\n metadata: Parameters<typeof sentryFinishCommandSpan>[2],\n): void {\n setSpanAttribute(span, \"pm.ok\", normalizedOk);\n setSpanAttribute(span, \"pm.command_ok\", normalizedOk);\n setSpanAttribute(span, \"pm.exit_code\", normalizedExitCode);\n setSpanAttribute(span, \"pm.command_exit_code\", normalizedExitCode);\n setSpanAttribute(span, \"pm.error_code\", metadata?.error_code);\n setSpanAttribute(span, \"pm.error_category\", metadata?.error_category);\n setSpanAttribute(span, \"pm.command_resolution\", metadata?.command_resolution);\n setSpanAttribute(span, \"pm.resolution_stage\", metadata?.resolution_stage);\n}\n\n/** Implements sentry set command context for the public runtime surface of this module. */\nexport function sentrySetCommandContext(\n command: string,\n args: string[],\n options: Record<string, unknown>,\n metadata?: {\n source_context?: string;\n source_context_source?: string;\n },\n): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n const taxonomy = deriveTelemetryCommandTaxonomy(command);\n\n Sentry.setTag(\"pm.command\", command);\n Sentry.setTag(\"pm.command_root\", taxonomy.command_root);\n Sentry.setTag(\"pm.command_family\", taxonomy.command_family);\n if (\n typeof metadata?.source_context === \"string\" &&\n metadata.source_context.trim().length > 0\n ) {\n Sentry.setTag(\"pm.source_context\", metadata.source_context);\n }\n\n const safeArgs = args.map((arg) =>\n arg.startsWith(\"--\") ? arg.split(\"=\")[0] : arg,\n );\n\n Sentry.setContext(\"pm.command\", {\n name: command,\n root: taxonomy.command_root,\n leaf: taxonomy.command_leaf,\n family: taxonomy.command_family,\n args: safeArgs,\n option_keys: Object.keys(options).sort(),\n source_context: metadata?.source_context,\n source_context_source: metadata?.source_context_source,\n });\n\n Sentry.addBreadcrumb({\n category: \"pm.command\",\n message: `pm ${command}`,\n level: \"info\",\n data: {\n args: safeArgs,\n command_root: taxonomy.command_root,\n command_family: taxonomy.command_family,\n source_context: metadata?.source_context,\n },\n });\n}\n\n/** Implements sentry start command span for the public runtime surface of this module. */\nexport function sentryStartCommandSpan(command: string): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n\n activeCommandSpan = Sentry.startInactiveSpan({\n op: \"pm.command\",\n name: `pm ${command}`,\n forceTransaction: true,\n });\n}\n\n/** Implements sentry finish command span for the public runtime surface of this module. */\nexport function sentryFinishCommandSpan(\n ok: boolean,\n error?: string,\n metadata?: {\n error_code?: string;\n error_category?: TelemetryErrorCategory;\n exit_code?: number;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n },\n): void {\n if (!activeCommandSpan) return;\n const normalizedOk = ok ? \"true\" : \"false\";\n const normalizedExitCode =\n typeof metadata?.exit_code === \"number\"\n ? String(metadata.exit_code)\n : undefined;\n const Sentry = getSentry();\n if (Sentry) {\n setSentryCommandFinishTags(Sentry, normalizedOk, metadata);\n }\n setCommandSpanFinishAttributes(\n activeCommandSpan,\n normalizedOk,\n normalizedExitCode,\n metadata,\n );\n activeCommandSpan.setStatus(\n ok ? { code: 1 } : { code: 2, message: error ?? \"command_failed\" },\n );\n activeCommandSpan.end();\n activeCommandSpan = undefined;\n}\n\n/** Implements sentry capture cli error for the public runtime surface of this module. */\nexport function sentryCaptureCliError(error: unknown): void {\n if (!shouldCaptureCliError(error)) return;\n\n const Sentry = getSentry();\n if (!Sentry) return;\n\n if (error instanceof Error) {\n const extras: Record<string, unknown> = {};\n if (\n \"exitCode\" in error &&\n typeof (error as { exitCode: unknown }).exitCode === \"number\"\n ) {\n extras.exit_code = (error as { exitCode: number }).exitCode;\n }\n if (\n \"context\" in error &&\n typeof (error as { context: unknown }).context === \"object\"\n ) {\n extras.error_context = (error as { context: unknown }).context;\n }\n Sentry.captureException(error, { extra: extras });\n } else {\n Sentry.captureException(new Error(String(error)));\n }\n}\n\n/** Implements sentry log cli usage error for the public runtime surface of this module. */\nexport function sentryLogCliUsageError(params: {\n command: string;\n error_code: string;\n error_category: TelemetryErrorCategory;\n exit_code: number;\n error_message: string;\n command_resolution?: TelemetryCommandResolution;\n resolution_stage?: TelemetryResolutionStage;\n source_context?: string;\n}): void {\n const Sentry = getSentry();\n if (!Sentry) return;\n const resolvedCommandResolution =\n params.command_resolution ??\n deriveTelemetryCommandResolution({\n ok: false,\n errorCode: params.error_code,\n errorCategory: params.error_category,\n });\n const resolvedResolutionStage = params.resolution_stage ?? \"unknown\";\n\n const payload = {\n \"pm.command\": params.command,\n \"pm.error_code\": params.error_code,\n \"pm.error_category\": params.error_category,\n \"pm.exit_code\": params.exit_code,\n \"pm.error_message\": params.error_message,\n \"pm.command_resolution\": resolvedCommandResolution,\n \"pm.resolution_stage\": resolvedResolutionStage,\n \"pm.source_context\": params.source_context ?? \"\",\n };\n const loggerCandidate = (\n Sentry as unknown as {\n logger?: {\n warn?: (message: string, attributes?: Record<string, unknown>) => void;\n };\n }\n ).logger;\n if (loggerCandidate && typeof loggerCandidate.warn === \"function\") {\n loggerCandidate.warn(\"pm_cli_usage_error\", payload);\n return;\n }\n\n Sentry.captureMessage(`pm_cli_usage_error:${params.error_code}`, {\n level: \"warning\",\n tags: {\n \"pm.command\": params.command,\n \"pm.error_code\": params.error_code,\n \"pm.error_category\": params.error_category,\n \"pm.exit_code\": String(params.exit_code),\n \"pm.command_resolution\": resolvedCommandResolution,\n \"pm.resolution_stage\": resolvedResolutionStage,\n \"pm.source_context\": params.source_context ?? \"unknown\",\n },\n extra: payload,\n });\n}\n\n/** Implements should capture cli error for the public runtime surface of this module. */\nexport function shouldCaptureCliError(error: unknown): boolean {\n if (error instanceof PmCliError) {\n return false;\n }\n if (\n error instanceof Error &&\n error.name === \"AbortError\" &&\n /(?:ctrl\\+c|sigint|user[- ]initiated)/i.test(error.message)\n ) {\n return false;\n }\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"exitCode\" in error &&\n typeof (error as { exitCode?: unknown }).exitCode === \"number\"\n ) {\n if (error instanceof Error && error.name === \"CommandError\") {\n return false;\n }\n const exitCode = Math.trunc((error as { exitCode: number }).exitCode);\n const expectedExitCodes: ReadonlySet<number> = new Set([\n EXIT_CODE.SUCCESS,\n EXIT_CODE.USAGE,\n EXIT_CODE.NOT_FOUND,\n EXIT_CODE.CONFLICT,\n ]);\n return !expectedExitCodes.has(exitCode);\n }\n return true;\n}\n\n/** Implements sentry flush for the public runtime surface of this module. */\nexport async function sentryFlush(timeoutMs = 3000): Promise<void> {\n const Sentry = getSentry();\n if (!Sentry) return;\n\n try {\n await Sentry.flush(timeoutMs);\n } catch {\n // Sentry flush must never block CLI exit.\n }\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAq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AAgC,CAAC,QAAQ,KAAK,QAAQ,EAC9D,CAAC;QACD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YAC5D,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAE,KAA8B,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;YACrD,SAAS,CAAC,OAAO;YACjB,SAAS,CAAC,KAAK;YACf,SAAS,CAAC,SAAS;YACnB,SAAS,CAAC,QAAQ;SACnB,CAAC,CAAC;QACH,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAS,GAAG,IAAI;IAChD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,0CAA0C;IAC5C,CAAC;AACH,CAAC","debugId":"d955a7f2-a85b-5200-8108-58c6684cb23a"}
|
|
@@ -21,6 +21,8 @@ export interface GlobalOptions {
|
|
|
21
21
|
noPager?: boolean;
|
|
22
22
|
/** Value that configures or reports profile for this contract. */
|
|
23
23
|
profile?: boolean;
|
|
24
|
+
/** Invocation-wide mutation author override. */
|
|
25
|
+
author?: string;
|
|
24
26
|
/** Fallback output format used when callers do not provide an override. */
|
|
25
27
|
defaultOutputFormat?: "toon" | "json";
|
|
26
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="72935348-56f4-54f4-85c9-4b88cd66bca9")}catch(e){}}();
|
|
3
3
|
export {};
|
|
4
4
|
//# sourceMappingURL=command-types.js.map
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=72935348-56f4-54f4-85c9-4b88cd66bca9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-types.js","sources":["core/shared/command-types.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/shared/command-types\n *\n * Provides shared primitives and utilities for Command Types.\n */\n/** Carries process-wide CLI options shared by command handlers and runtime adapters. */\nexport interface GlobalOptions {\n /** Value that configures or reports json for this contract. */\n json?: boolean;\n /** Value that configures or reports quiet for this contract. */\n quiet?: boolean;\n /** Value that configures or reports no changed fields for this contract. */\n noChangedFields?: boolean;\n /** Value that configures or reports id only for this contract. */\n idOnly?: boolean;\n /** Filesystem path used for path resolution. */\n path?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n /** Value that configures or reports no pager for this contract. */\n noPager?: boolean;\n /** Value that configures or reports profile for this contract. */\n profile?: boolean;\n /** Fallback output format used when callers do not provide an override. */\n defaultOutputFormat?: \"toon\" | \"json\";\n}\n"],"names":[],"mappings":"","debugId":"
|
|
1
|
+
{"version":3,"file":"command-types.js","sources":["core/shared/command-types.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/shared/command-types\n *\n * Provides shared primitives and utilities for Command Types.\n */\n/** Carries process-wide CLI options shared by command handlers and runtime adapters. */\nexport interface GlobalOptions {\n /** Value that configures or reports json for this contract. */\n json?: boolean;\n /** Value that configures or reports quiet for this contract. */\n quiet?: boolean;\n /** Value that configures or reports no changed fields for this contract. */\n noChangedFields?: boolean;\n /** Value that configures or reports id only for this contract. */\n idOnly?: boolean;\n /** Filesystem path used for path resolution. */\n path?: string;\n /** Value that configures or reports no extensions for this contract. */\n noExtensions?: boolean;\n /** Value that configures or reports no pager for this contract. */\n noPager?: boolean;\n /** Value that configures or reports profile for this contract. */\n profile?: boolean;\n /** Invocation-wide mutation author override. */\n author?: string;\n /** Fallback output format used when callers do not provide an override. */\n defaultOutputFormat?: \"toon\" | \"json\";\n}\n"],"names":[],"mappings":"","debugId":"72935348-56f4-54f4-85c9-4b88cd66bca9"}
|
|
@@ -46,6 +46,17 @@ export interface PmCliErrorContext {
|
|
|
46
46
|
examples?: string[];
|
|
47
47
|
/** Value that configures or reports next steps for this contract. */
|
|
48
48
|
nextSteps?: string[];
|
|
49
|
+
/** Available history bounds for a failed point-in-time read or restore target. */
|
|
50
|
+
valid_range?: {
|
|
51
|
+
/** Earliest available one-based version, or null for an empty stream. */
|
|
52
|
+
first_version: number | null;
|
|
53
|
+
/** Latest available one-based version, or null for an empty stream. */
|
|
54
|
+
last_version: number | null;
|
|
55
|
+
/** Earliest available history timestamp, or null for an empty stream. */
|
|
56
|
+
first_timestamp: string | null;
|
|
57
|
+
/** Latest available history timestamp, or null for an empty stream. */
|
|
58
|
+
last_timestamp: string | null;
|
|
59
|
+
};
|
|
49
60
|
/** Value that configures or reports recovery for this contract. */
|
|
50
61
|
recovery?: PmCliErrorRecoveryPayload;
|
|
51
62
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Implements the exported pm cli error runtime abstraction for core/shared/errors.ts. */
|
|
2
2
|
|
|
3
|
-
!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]="
|
|
3
|
+
!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]="c6a1b360-921c-5a84-b085-4c4e772c3b82")}catch(e){}}();
|
|
4
4
|
export class PmCliError extends Error {
|
|
5
5
|
/** Value that configures or reports exit code for this contract. */
|
|
6
6
|
exitCode;
|
|
@@ -15,4 +15,4 @@ export class PmCliError extends Error {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=errors.js.map
|
|
18
|
-
//# debugId=
|
|
18
|
+
//# debugId=c6a1b360-921c-5a84-b085-4c4e772c3b82
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["core/shared/errors.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/shared/errors\n *\n * Provides shared primitives and utilities for Errors.\n */\n/** Carries structured recovery guidance attached to expected pm CLI errors. */\nexport interface PmCliErrorRecoveryPayload {\n /** Strategy used to control recovery behavior. */\n recovery_mode?: \"compact\";\n /** Value that configures or reports attempted command for this contract. */\n attempted_command?: string;\n /** Value that configures or reports normalized args for this contract. */\n normalized_args?: string[];\n /** Value that configures or reports provided fields for this contract. */\n provided_fields?: string[];\n /** Value that configures or reports missing for this contract. */\n missing?: string[];\n /** Value that configures or reports missing required fields for this contract. */\n missing_required_fields?: string[];\n /** Value that configures or reports suggested flags for this contract. */\n suggested_flags?: string[];\n /** Value that configures or reports suggested retry for this contract. */\n suggested_retry?: string;\n /** Elapsed time in milliseconds for retry after. */\n retry_after_ms?: number;\n /** Value that configures or reports fallback candidates for this contract. */\n fallback_candidates?: Array<{\n source: string;\n command: string;\n reason: string;\n }>;\n /** Value that configures or reports next best command for this contract. */\n next_best_command?: string;\n}\n\n/** Documents the pm cli error context payload exchanged by command, SDK, and package integrations. */\nexport interface PmCliErrorContext {\n /** Value that configures or reports code for this contract. */\n code?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports required for this contract. */\n required?: string;\n /** Value that configures or reports why for this contract. */\n why?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports next steps for this contract. */\n nextSteps?: string[];\n /** Value that configures or reports recovery for this contract. */\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/** Implements the exported pm cli error runtime abstraction for core/shared/errors.ts. */\nexport class PmCliError extends Error {\n /** Value that configures or reports exit code for this contract. */\n public readonly exitCode: number;\n /** Value that configures or reports context for this contract. */\n public readonly context: PmCliErrorContext;\n\n /** Value that configures or reports constructor for this contract. */\n constructor(\n message: string,\n exitCode: number,\n context: PmCliErrorContext = {},\n ) {\n super(message);\n this.name = \"PmCliError\";\n this.exitCode = exitCode;\n this.context = context;\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["core/shared/errors.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/shared/errors\n *\n * Provides shared primitives and utilities for Errors.\n */\n/** Carries structured recovery guidance attached to expected pm CLI errors. */\nexport interface PmCliErrorRecoveryPayload {\n /** Strategy used to control recovery behavior. */\n recovery_mode?: \"compact\";\n /** Value that configures or reports attempted command for this contract. */\n attempted_command?: string;\n /** Value that configures or reports normalized args for this contract. */\n normalized_args?: string[];\n /** Value that configures or reports provided fields for this contract. */\n provided_fields?: string[];\n /** Value that configures or reports missing for this contract. */\n missing?: string[];\n /** Value that configures or reports missing required fields for this contract. */\n missing_required_fields?: string[];\n /** Value that configures or reports suggested flags for this contract. */\n suggested_flags?: string[];\n /** Value that configures or reports suggested retry for this contract. */\n suggested_retry?: string;\n /** Elapsed time in milliseconds for retry after. */\n retry_after_ms?: number;\n /** Value that configures or reports fallback candidates for this contract. */\n fallback_candidates?: Array<{\n source: string;\n command: string;\n reason: string;\n }>;\n /** Value that configures or reports next best command for this contract. */\n next_best_command?: string;\n}\n\n/** Documents the pm cli error context payload exchanged by command, SDK, and package integrations. */\nexport interface PmCliErrorContext {\n /** Value that configures or reports code for this contract. */\n code?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports required for this contract. */\n required?: string;\n /** Value that configures or reports why for this contract. */\n why?: string;\n /** Value that configures or reports examples for this contract. */\n examples?: string[];\n /** Value that configures or reports next steps for this contract. */\n nextSteps?: string[];\n /** Available history bounds for a failed point-in-time read or restore target. */\n valid_range?: {\n /** Earliest available one-based version, or null for an empty stream. */\n first_version: number | null;\n /** Latest available one-based version, or null for an empty stream. */\n last_version: number | null;\n /** Earliest available history timestamp, or null for an empty stream. */\n first_timestamp: string | null;\n /** Latest available history timestamp, or null for an empty stream. */\n last_timestamp: string | null;\n };\n /** Value that configures or reports recovery for this contract. */\n recovery?: PmCliErrorRecoveryPayload;\n}\n\n/** Implements the exported pm cli error runtime abstraction for core/shared/errors.ts. */\nexport class PmCliError extends Error {\n /** Value that configures or reports exit code for this contract. */\n public readonly exitCode: number;\n /** Value that configures or reports context for this contract. */\n public readonly context: PmCliErrorContext;\n\n /** Value that configures or reports constructor for this contract. */\n constructor(\n message: string,\n exitCode: number,\n context: PmCliErrorContext = {},\n ) {\n super(message);\n this.name = \"PmCliError\";\n this.exitCode = exitCode;\n this.context = context;\n }\n}\n"],"names":[],"mappings":"AAgEA,0FAA0F;;;AAC1F,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,oEAAoE;IACpD,QAAQ,CAAS;IACjC,kEAAkE;IAClD,OAAO,CAAoB;IAE3C,sEAAsE;IACtE,YACE,OAAe,EACf,QAAgB,EAChB,UAA6B,EAAE;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF","debugId":"c6a1b360-921c-5a84-b085-4c4e772c3b82"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ export declare const _testOnly: {
|
|
|
33
33
|
readonly normalizeMcpUpdateOptions: (options: Record<string, unknown>) => Record<string, unknown>;
|
|
34
34
|
readonly optionsWithAuthor: (args: Record<string, unknown>, action?: string) => Record<string, unknown>;
|
|
35
35
|
readonly readRequiredString: typeof readRequiredString;
|
|
36
|
-
readonly readScalarString: (
|
|
37
|
-
readonly readScalarStringAllowBlank: (
|
|
36
|
+
readonly readScalarString: typeof import("../sdk/runtime-input.js").readRuntimeScalarString;
|
|
37
|
+
readonly readScalarStringAllowBlank: typeof import("../sdk/runtime-input.js").readRuntimeScalarStringAllowBlank;
|
|
38
38
|
readonly readStringArray: (value: unknown) => string[];
|
|
39
39
|
runAction: typeof runAction;
|
|
40
40
|
readonly updateManyOptionsFromFlat: (options: Record<string, unknown>) => import("../cli/commands/update-many.js").UpdateManyCommandOptions;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines the Tool Definitions module for pm CLI source.
|
|
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]="478bf194-a9d0-5c6a-b70e-d15164927fda")}catch(e){}}();
|
|
8
8
|
import { PM_TOOL_ACTIONS } from "../sdk/cli-contracts/enum-contracts.js";
|
|
9
9
|
import { COPY_FLAG_CONTRACTS } from "../sdk/cli-contracts/flag-contracts.js";
|
|
10
10
|
import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
|
|
@@ -167,12 +167,12 @@ export const TOOLS = [
|
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
name: "pm_get",
|
|
170
|
-
description: "Read one pm item. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection.",
|
|
170
|
+
description: "Read one pm item with shared SDK projections. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection, options.fields='id,schedule.start_at' for schedule context, or options.at='7' / an ISO timestamp for a verified mutation-free historical read. Parent results include bounded child counts, samples, and continuation metadata.",
|
|
171
171
|
inputSchema: objectSchema({
|
|
172
172
|
id: idSchema,
|
|
173
173
|
options: {
|
|
174
174
|
type: "object",
|
|
175
|
-
description: "Get options such as depth=brief|standard|deep|full
|
|
175
|
+
description: "Get options such as depth=brief|standard|deep|full, fields=id,title,status, or at=<version|ISO timestamp>.",
|
|
176
176
|
},
|
|
177
177
|
}, ["id"]),
|
|
178
178
|
},
|
|
@@ -336,7 +336,7 @@ export const TOOLS = [
|
|
|
336
336
|
},
|
|
337
337
|
{
|
|
338
338
|
name: "pm_deps",
|
|
339
|
-
description: "
|
|
339
|
+
description: "Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with depth, node, edge, token, and cursor bounds.",
|
|
340
340
|
inputSchema: objectSchema({ id: idSchema, options: { type: "object" } }, [
|
|
341
341
|
"id",
|
|
342
342
|
]),
|
|
@@ -571,4 +571,4 @@ export function buildMcpToolContracts() {
|
|
|
571
571
|
}).sort((left, right) => left.name.localeCompare(right.name));
|
|
572
572
|
}
|
|
573
573
|
//# sourceMappingURL=tool-definitions.js.map
|
|
574
|
-
//# debugId=
|
|
574
|
+
//# debugId=478bf194-a9d0-5c6a-b70e-d15164927fda
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-definitions.js","sources":["mcp/tool-definitions.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module mcp/tool-definitions\n *\n * Defines the Tool Definitions module for pm CLI source.\n */\nimport { PM_TOOL_ACTIONS } from \"../sdk/cli-contracts/enum-contracts.js\";\nimport { COPY_FLAG_CONTRACTS } from \"../sdk/cli-contracts/flag-contracts.js\";\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../types.js\";\n\n/**\n * Static MCP tool surface for the pm MCP server.\n *\n * Kept as a dependency-light data module (only the enum contract import) so the\n * `pm contracts` command can snapshot the tool surface into the contract\n * golden file (pm-4os2) without importing the full MCP server runtime, and so\n * the server itself stays the single consumer of the dispatch handlers.\n */\nexport interface ToolDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports input schema for this contract. */\n inputSchema: Record<string, unknown>;\n}\n\nconst TOOL_SCHEMA_BASE = {\n type: \"object\",\n properties: {\n cwd: {\n type: \"string\",\n description:\n \"Workspace directory to run the native pm operation in. Defaults to the MCP server process cwd.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional pm data root, equivalent to PM_PATH/global --path. Leave unset for real repository tracking.\",\n },\n author: {\n type: \"string\",\n description:\n \"Mutation author. Defaults to PM_AUTHOR or pm settings when supported by the underlying operation.\",\n },\n },\n additionalProperties: true,\n} as const;\n\nconst idSchema = {\n type: \"string\",\n description: \"pm item id, for example pm-abc1.\",\n};\n\n// pm-fd8n: derive the pm_run action enumeration from the canonical\n// PM_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the\n// MCP-facing description can never drift from the actual supported actions.\nconst PM_RUN_ACTION_DESCRIPTION =\n `Operation name (one of): ${PM_TOOL_ACTIONS.join(\", \")}. ` +\n \"Package-owned actions are available dynamically when their provider package is installed.\";\n\nconst LIST_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n offset: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.offset.\",\n },\n};\n\nconst SEARCH_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n mode: { type: \"string\", description: \"Alias for options.mode.\" },\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n};\n\nconst COPY_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = Object.fromEntries(\n COPY_FLAG_CONTRACTS.filter(({ flag }) => flag !== \"--author\").map(({ flag }) => [\n flag.slice(2),\n { type: \"string\", description: `Alias for options.${flag.slice(2).replaceAll(\"-\", \"_\")}.` },\n ]),\n);\n\nfunction objectSchema(\n properties: Record<string, unknown>,\n required: string[] = [],\n): Record<string, unknown> {\n return {\n ...TOOL_SCHEMA_BASE,\n properties: {\n ...TOOL_SCHEMA_BASE.properties,\n ...properties,\n },\n required,\n };\n}\n\n/** Public contract for tools, shared by SDK and presentation-layer consumers. */\nexport const TOOLS: ToolDefinition[] = [\n {\n name: \"pm_run\",\n description:\n \"Run any supported pm operation natively through the pm library. Use this for commands not covered by narrower pm_* tools.\",\n inputSchema: objectSchema(\n {\n action: {\n type: \"string\",\n description: PM_RUN_ACTION_DESCRIPTION,\n },\n id: idSchema,\n query: {\n type: \"string\",\n description: \"Search query for action=search.\",\n },\n reason: {\n type: \"string\",\n description: \"Close reason for action=close.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Force ownership/terminal-state override when supported.\",\n },\n // pm-v68d: the schema-specific subcommand enum and add-type/add-status\n // properties migrated to the dedicated pm_schema tool. action=schema\n // still accepts them as passthrough, but agents should prefer pm_schema.\n subcommand: {\n type: \"string\",\n description:\n \"Subcommand selector for actions that take one (for example telemetry, or schema — prefer the dedicated pm_schema tool for schema operations).\",\n },\n options: {\n type: \"object\",\n description: \"Underlying pm command options using camelCase keys.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"For mutation actions, return the full changed_fields array instead of the default changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description:\n \"For single-item mutation actions, return only id and status.\",\n },\n },\n [\"action\"],\n ),\n },\n {\n name: \"pm_context\",\n description:\n \"Return the agent-oriented project context snapshot. \" +\n \"Pass options.depth=brief|standard|deep|full (full = every section with no per-section row cap), \" +\n \"options.parent='<id>' to scope the snapshot to one item's subtree (the item plus all descendants), \" +\n \"options.fields='id,title,priority' to project focus rows to a field subset for low-token reads, \" +\n \"or options.section=['hierarchy','progress',...] to pick sections.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_next\",\n description:\n \"Recommend the next actionable work item: the single highest-priority READY item \" +\n \"(active status, no open blockers, no open children; completed containers surface only when no concrete leaf work is ready) plus the ranked ready and blocked queues. \" +\n \"The recommended item carries a rationale and each blocked item lists the open blockers gating it. \" +\n \"Pass options.parent='<id>' to scope to one subtree, options.limit=N to cap ready rows, \" +\n \"options.readyOnly=true to omit the blocked list, or filters (options.type/tag/priority/assignee/sprint/release). \" +\n \"The most token-efficient 'what should I do now?' read for agents.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_search\",\n description:\n \"Search pm items with keyword, semantic, or hybrid search. \" +\n \"Defaults to a compact projection for token efficiency. \" +\n \"Pass options.mode=keyword|semantic|hybrid, options.limit=N to cap hits, \" +\n \"options.status='all' for no lifecycle restriction, \" +\n \"options.fields='id,title,score' for a custom projection, or options.full=true for full item bodies (can be large). \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema(\n {\n query: { type: \"string\" },\n options: { type: \"object\" },\n ...SEARCH_TOP_LEVEL_OPTION_PROPERTIES,\n },\n [\"query\"],\n ),\n },\n {\n name: \"pm_list\",\n description:\n \"List pm items with status/type/tag/priority filters. Defaults to compact projection for token efficiency. \" +\n \"options.status accepts CSV (all,open,in_progress). \" +\n \"Pass options.compact=false or options.includeBody=true for full bodies/comments. \" +\n \"Pass options.brief=true for ultra-terse (id/status/type/title only). \" +\n \"Pass options.fields='id,title,priority' for custom projection. \" +\n \"Pass options.limit=N to cap row count. \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema({\n options: { type: \"object\" },\n ...LIST_TOP_LEVEL_OPTION_PROPERTIES,\n }),\n },\n {\n name: \"pm_get\",\n description:\n \"Read one pm item. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full or fields=id,title,status.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_create\",\n description:\n \"Create a pm item natively and write pm history. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count for token efficiency); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n allowMissingParent: {\n type: \"boolean\",\n description:\n \"Allow unresolved parent references and emit a validation warning.\",\n },\n options: {\n type: \"object\",\n description: \"Create options. title and description are required.\",\n },\n },\n [\"options\"],\n ),\n },\n {\n name: \"pm_copy\",\n description:\n \"Copy an existing pm item into a new id while resetting lifecycle fields. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n ...COPY_TOP_LEVEL_OPTION_PROPERTIES,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description: \"Return only id and status.\",\n },\n options: {\n type: \"object\",\n description:\n \"Copy options such as title override, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_focus\",\n description:\n \"Set, clear, or show the session focused item. When focused, pm_create defaults its parent to the focused item \" +\n \"(an explicit parent still overrides). Pass id to focus an item, options.clear=true to clear, or neither to show current focus.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n clear: {\n type: \"boolean\",\n description: \"Clear the focused item (cannot be combined with id).\",\n },\n options: {\n type: \"object\",\n description: \"Focus options such as clear (boolean).\",\n },\n },\n [],\n ),\n },\n {\n name: \"pm_update\",\n description:\n \"Update pm item metadata/body/dependencies/log seeds natively. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields delta.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: { type: \"object\" },\n },\n [\"id\", \"options\"],\n ),\n },\n {\n name: \"pm_append\",\n description:\n \"Append markdown text to a pm item body and write pm history. Useful for seeding evidence/log entries before close. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n body: {\n type: \"string\",\n description:\n \"Markdown text to append to the item body. Required here or as options.body.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: {\n type: \"object\",\n description: \"Append options such as body, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_claim\",\n description: \"Claim a pm item.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_release\",\n description: \"Release a pm item claim.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_close\",\n description:\n \"Close a pm item with optional close reason and optional close validation (reason requirement follows governance settings). \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n reason: {\n type: \"string\",\n description:\n \"Close reason text when provided or required by governance settings.\",\n },\n duplicateOf: {\n type: \"string\",\n description:\n \"Canonical item id when closing this item as a duplicate.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: { type: \"boolean\", description: \"Return only id and status.\" },\n options: { type: \"object\" },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_comments\",\n description:\n \"List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. \" +\n \"List calls default to the most recent 20 comments with total_count/has_more metadata for token efficiency. \" +\n \"Pass options.limit=N to choose a page size, options.limit=0 for summary-only metadata, or options.full=true for full history.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_files\",\n description:\n \"List, add, remove, or validate linked files for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_docs\",\n description: \"List, add, or remove linked docs for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_notes\",\n description:\n \"List or add structured notes on a pm item. Use options.add to append a note; omit it to list existing notes.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_learnings\",\n description:\n \"List or add learnings on a pm item. Use options.add to capture a learning/insight; omit it to list existing learnings.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_deps\",\n description:\n \"List, add, or remove dependencies for a pm item. Use options.add to declare a dependency and options.remove to drop one; omit both to list current dependencies.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_test\",\n description: \"List, add, remove, or run linked tests for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_validate\",\n description: \"Run pm validation checks.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_health\",\n description:\n \"Run pm health diagnostics. Pass options.brief=true for compact low-token details, options.skipIntegrity=true, options.skipDrift=true, options.skipVectors=true for a fast status-only check, or options.full=true for the complete deep check.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_contracts\",\n description:\n \"Inspect pm command, flag, schema, and availability contracts.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_schema\",\n description:\n \"Inspect or modify the workspace item-type/status/field schema (pm schema). \" +\n \"subcommand selects the operation; name carries the item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or field key (show-field/add-field/remove-field). \" +\n \"apply-preset adopts a domain type preset; add-type with infer=true derives types from title-prefix conventions. \" +\n \"Schema mutations write workspace config files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\n \"list\",\n \"show\",\n \"show-status\",\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"add-field\",\n \"remove-field\",\n \"list-fields\",\n \"show-field\",\n \"apply-preset\",\n ],\n description: \"Schema subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or custom field key (show-field/add-field/remove-field). Required for those subcommands.\",\n },\n description: {\n type: \"string\",\n description:\n \"Custom item type, status, or field description for add-type/add-status/add-field.\",\n },\n defaultStatus: {\n type: \"string\",\n description: \"Default status for add-type.\",\n },\n folder: { type: \"string\", description: \"Storage folder for add-type.\" },\n alias: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Aliases for add-type/add-status, or extra CLI flag aliases for add-field.\",\n },\n role: {\n type: \"array\",\n items: { type: \"string\", enum: [...RUNTIME_STATUS_ROLE_VALUES] },\n description: `Lifecycle roles for add-status: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n },\n order: {\n type: \"number\",\n description: \"Display/sort order for add-status.\",\n },\n fieldType: {\n type: \"string\",\n enum: [\"string\", \"number\", \"boolean\", \"string_array\"],\n description: \"Value type for a custom field (add-field).\",\n },\n commands: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Commands a custom field is wired onto (add-field): create, update, update_many, list, search, calendar, context.\",\n },\n cliFlag: {\n type: \"string\",\n description:\n \"Override the auto-derived CLI flag for a custom field (add-field).\",\n },\n required: {\n type: \"boolean\",\n description: \"Mark a custom field as always required (add-field).\",\n },\n requiredOnCreate: {\n type: \"boolean\",\n description:\n \"Mark a custom field as required at create time (add-field).\",\n },\n allowUnset: {\n type: \"boolean\",\n description:\n \"Whether a custom field may be cleared via --unset (add-field); defaults to true.\",\n },\n requiredTypes: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Restrict a custom field's requirement to specific item types (add-field).\",\n },\n typePreset: {\n type: \"string\",\n enum: [\"agile\", \"ops\", \"research\"],\n description: \"Domain type preset to adopt (apply-preset).\",\n },\n infer: {\n type: \"boolean\",\n description:\n \"Infer item types from title-prefix conventions (add-type); previews unless apply is true.\",\n },\n minCount: {\n type: \"number\",\n description:\n \"Minimum items sharing a prefix for add-type inference (default 10).\",\n },\n apply: {\n type: \"boolean\",\n description:\n \"Register inferred types (add-type infer); without it the call previews only.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Override removal guardrails for destructive schema changes when supported.\",\n },\n options: {\n type: \"object\",\n description: \"Additional schema options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_profile\",\n description:\n \"List, show, apply, or lint project profiles (pm profile) — archetype bundles that stage item types, statuses, fields, per-type workflows, config knobs, create templates, and recommended packages. \" +\n \"subcommand selects the operation; name carries the profile name (agile, ops, research) for show/apply/lint. \" +\n \"apply stages every dimension idempotently; dryRun previews the diff without writing; lint reports author-time consistency findings (graded error/warning) without touching the tracker. Profile staging writes workspace config/schema files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\"list\", \"show\", \"apply\", \"lint\"],\n description: \"Profile subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Profile name for show/apply/lint. Required for those subcommands. Built-ins are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.\",\n },\n dryRun: {\n type: \"boolean\",\n description:\n \"Preview the apply diff without writing any files (apply).\",\n },\n author: { type: \"string\", description: \"Mutation author for apply.\" },\n force: {\n type: \"boolean\",\n description: \"Force ownership/lock override for apply.\",\n },\n options: {\n type: \"object\",\n description: \"Additional profile options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_config\",\n description:\n \"Read or write pm workspace configuration (pm config). \" +\n \"configAction selects get/set/list/export; key/value address a single setting for get/set. \" +\n \"scope chooses the project (default) or global settings file.\",\n inputSchema: objectSchema(\n {\n configAction: {\n type: \"string\",\n enum: [\"get\", \"set\", \"list\", \"export\"],\n description:\n \"Config operation to perform. get/set require key; list/export dump the resolved settings surface.\",\n },\n key: {\n type: \"string\",\n description:\n \"Settings key for get/set, for example governance-require-close-reason, telemetry-tracking, or a nested leaf such as search_provider (dash and underscore variants accepted; configAction=get without a key lists supported keys in the error).\",\n },\n value: {\n type: \"string\",\n description: \"New value for configAction=set.\",\n },\n scope: {\n type: \"string\",\n enum: [\"project\", \"global\"],\n description: \"Settings scope to read or write. Defaults to project.\",\n },\n options: {\n type: \"object\",\n description:\n \"Additional config options such as criterion, clearCriteria, format, or policy.\",\n },\n },\n [\"configAction\"],\n ),\n },\n {\n name: \"pm_plan\",\n description:\n \"Run agent-optimized Plan workflows. options.subcommand selects: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize. Provide id for all non-create subcommands; provide stepRef for step lifecycle subcommands. Plans store agent-readable steps with dependencies, decisions, discoveries, validation, and resume context.\",\n inputSchema: objectSchema({\n id: {\n type: \"string\",\n description: \"Plan id (required for all subcommands except create).\",\n },\n stepRef: {\n type: \"string\",\n description: \"Step id or order for step lifecycle subcommands.\",\n },\n reorderTo: { type: \"number\", description: \"New order for reorder-step.\" },\n options: {\n type: \"object\",\n description:\n \"Plan options including subcommand, stepRef, stepStatus, link, depth, etc.\",\n },\n }),\n },\n];\n\n/** Stable projection of one MCP tool definition for the contract golden file (pm-4os2): tool name, description, required top-level fields, and the full inputSchema shape. Any drift (typo'd property, dropped required field, changed TOOL_SCHEMA_BASE) shows up in `pnpm contracts:check`. */\nexport interface McpToolContract {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports required for this contract. */\n required: string[];\n /** Value that configures or reports input schema for this contract. */\n input_schema: Record<string, unknown>;\n}\n\n/** Implements build mcp tool contracts for the public runtime surface of this module. */\nexport function buildMcpToolContracts(): McpToolContract[] {\n return TOOLS.map((tool) => {\n const schemaRequired = tool.inputSchema[\"required\"];\n const required = Array.isArray(schemaRequired)\n ? schemaRequired\n .map((entry) => String(entry))\n .sort((left, right) => left.localeCompare(right))\n : [];\n return {\n name: tool.name,\n description: tool.description,\n required,\n input_schema: tool.inputSchema,\n };\n }).sort((left, right) => left.name.localeCompare(right.name));\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAmBzD,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,gGAAgG;SACnG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uGAAuG;SAC1G;QACD,MAAM,EAAE;YACN,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8c3-535e-ac57-f580b9d0e159"}
|
|
1
|
+
{"version":3,"file":"tool-definitions.js","sources":["mcp/tool-definitions.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module mcp/tool-definitions\n *\n * Defines the Tool Definitions module for pm CLI source.\n */\nimport { PM_TOOL_ACTIONS } from \"../sdk/cli-contracts/enum-contracts.js\";\nimport { COPY_FLAG_CONTRACTS } from \"../sdk/cli-contracts/flag-contracts.js\";\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../types.js\";\n\n/**\n * Static MCP tool surface for the pm MCP server.\n *\n * Kept as a dependency-light data module (only the enum contract import) so the\n * `pm contracts` command can snapshot the tool surface into the contract\n * golden file (pm-4os2) without importing the full MCP server runtime, and so\n * the server itself stays the single consumer of the dispatch handlers.\n */\nexport interface ToolDefinition {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports input schema for this contract. */\n inputSchema: Record<string, unknown>;\n}\n\nconst TOOL_SCHEMA_BASE = {\n type: \"object\",\n properties: {\n cwd: {\n type: \"string\",\n description:\n \"Workspace directory to run the native pm operation in. Defaults to the MCP server process cwd.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional pm data root, equivalent to PM_PATH/global --path. Leave unset for real repository tracking.\",\n },\n author: {\n type: \"string\",\n description:\n \"Mutation author. Defaults to PM_AUTHOR or pm settings when supported by the underlying operation.\",\n },\n },\n additionalProperties: true,\n} as const;\n\nconst idSchema = {\n type: \"string\",\n description: \"pm item id, for example pm-abc1.\",\n};\n\n// pm-fd8n: derive the pm_run action enumeration from the canonical\n// PM_TOOL_ACTIONS contract instead of a hand-maintained prose list, so the\n// MCP-facing description can never drift from the actual supported actions.\nconst PM_RUN_ACTION_DESCRIPTION =\n `Operation name (one of): ${PM_TOOL_ACTIONS.join(\", \")}. ` +\n \"Package-owned actions are available dynamically when their provider package is installed.\";\n\nconst LIST_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n offset: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.offset.\",\n },\n};\n\nconst SEARCH_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = {\n mode: { type: \"string\", description: \"Alias for options.mode.\" },\n status: { type: \"string\", description: \"Alias for options.status.\" },\n type: { type: \"string\", description: \"Alias for options.type.\" },\n tag: { type: \"string\", description: \"Alias for options.tag.\" },\n priority: { type: \"string\", description: \"Alias for options.priority.\" },\n limit: {\n type: [\"string\", \"number\"],\n description: \"Alias for options.limit.\",\n },\n};\n\nconst COPY_TOP_LEVEL_OPTION_PROPERTIES: Record<string, unknown> = Object.fromEntries(\n COPY_FLAG_CONTRACTS.filter(({ flag }) => flag !== \"--author\").map(({ flag }) => [\n flag.slice(2),\n { type: \"string\", description: `Alias for options.${flag.slice(2).replaceAll(\"-\", \"_\")}.` },\n ]),\n);\n\nfunction objectSchema(\n properties: Record<string, unknown>,\n required: string[] = [],\n): Record<string, unknown> {\n return {\n ...TOOL_SCHEMA_BASE,\n properties: {\n ...TOOL_SCHEMA_BASE.properties,\n ...properties,\n },\n required,\n };\n}\n\n/** Public contract for tools, shared by SDK and presentation-layer consumers. */\nexport const TOOLS: ToolDefinition[] = [\n {\n name: \"pm_run\",\n description:\n \"Run any supported pm operation natively through the pm library. Use this for commands not covered by narrower pm_* tools.\",\n inputSchema: objectSchema(\n {\n action: {\n type: \"string\",\n description: PM_RUN_ACTION_DESCRIPTION,\n },\n id: idSchema,\n query: {\n type: \"string\",\n description: \"Search query for action=search.\",\n },\n reason: {\n type: \"string\",\n description: \"Close reason for action=close.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Force ownership/terminal-state override when supported.\",\n },\n // pm-v68d: the schema-specific subcommand enum and add-type/add-status\n // properties migrated to the dedicated pm_schema tool. action=schema\n // still accepts them as passthrough, but agents should prefer pm_schema.\n subcommand: {\n type: \"string\",\n description:\n \"Subcommand selector for actions that take one (for example telemetry, or schema — prefer the dedicated pm_schema tool for schema operations).\",\n },\n options: {\n type: \"object\",\n description: \"Underlying pm command options using camelCase keys.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"For mutation actions, return the full changed_fields array instead of the default changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description:\n \"For single-item mutation actions, return only id and status.\",\n },\n },\n [\"action\"],\n ),\n },\n {\n name: \"pm_context\",\n description:\n \"Return the agent-oriented project context snapshot. \" +\n \"Pass options.depth=brief|standard|deep|full (full = every section with no per-section row cap), \" +\n \"options.parent='<id>' to scope the snapshot to one item's subtree (the item plus all descendants), \" +\n \"options.fields='id,title,priority' to project focus rows to a field subset for low-token reads, \" +\n \"or options.section=['hierarchy','progress',...] to pick sections.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_next\",\n description:\n \"Recommend the next actionable work item: the single highest-priority READY item \" +\n \"(active status, no open blockers, no open children; completed containers surface only when no concrete leaf work is ready) plus the ranked ready and blocked queues. \" +\n \"The recommended item carries a rationale and each blocked item lists the open blockers gating it. \" +\n \"Pass options.parent='<id>' to scope to one subtree, options.limit=N to cap ready rows, \" +\n \"options.readyOnly=true to omit the blocked list, or filters (options.type/tag/priority/assignee/sprint/release). \" +\n \"The most token-efficient 'what should I do now?' read for agents.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_search\",\n description:\n \"Search pm items with keyword, semantic, or hybrid search. \" +\n \"Defaults to a compact projection for token efficiency. \" +\n \"Pass options.mode=keyword|semantic|hybrid, options.limit=N to cap hits, \" +\n \"options.status='all' for no lifecycle restriction, \" +\n \"options.fields='id,title,score' for a custom projection, or options.full=true for full item bodies (can be large). \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema(\n {\n query: { type: \"string\" },\n options: { type: \"object\" },\n ...SEARCH_TOP_LEVEL_OPTION_PROPERTIES,\n },\n [\"query\"],\n ),\n },\n {\n name: \"pm_list\",\n description:\n \"List pm items with status/type/tag/priority filters. Defaults to compact projection for token efficiency. \" +\n \"options.status accepts CSV (all,open,in_progress). \" +\n \"Pass options.compact=false or options.includeBody=true for full bodies/comments. \" +\n \"Pass options.brief=true for ultra-terse (id/status/type/title only). \" +\n \"Pass options.fields='id,title,priority' for custom projection. \" +\n \"Pass options.limit=N to cap row count. \" +\n \"The result echoes the applied filters and projection mode in query_summary.\",\n inputSchema: objectSchema({\n options: { type: \"object\" },\n ...LIST_TOP_LEVEL_OPTION_PROPERTIES,\n }),\n },\n {\n name: \"pm_get\",\n description:\n \"Read one pm item with shared SDK projections. Pass options.depth='brief' or options.fields='id,title,status' for low-token inspection, options.fields='id,schedule.start_at' for schedule context, or options.at='7' / an ISO timestamp for a verified mutation-free historical read. Parent results include bounded child counts, samples, and continuation metadata.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n options: {\n type: \"object\",\n description:\n \"Get options such as depth=brief|standard|deep|full, fields=id,title,status, or at=<version|ISO timestamp>.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_create\",\n description:\n \"Create a pm item natively and write pm history. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count for token efficiency); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n allowMissingParent: {\n type: \"boolean\",\n description:\n \"Allow unresolved parent references and emit a validation warning.\",\n },\n options: {\n type: \"object\",\n description: \"Create options. title and description are required.\",\n },\n },\n [\"options\"],\n ),\n },\n {\n name: \"pm_copy\",\n description:\n \"Copy an existing pm item into a new id while resetting lifecycle fields. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n ...COPY_TOP_LEVEL_OPTION_PROPERTIES,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: {\n type: \"boolean\",\n description: \"Return only id and status.\",\n },\n options: {\n type: \"object\",\n description:\n \"Copy options such as title override, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_focus\",\n description:\n \"Set, clear, or show the session focused item. When focused, pm_create defaults its parent to the focused item \" +\n \"(an explicit parent still overrides). Pass id to focus an item, options.clear=true to clear, or neither to show current focus.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n clear: {\n type: \"boolean\",\n description: \"Clear the focused item (cannot be combined with id).\",\n },\n options: {\n type: \"object\",\n description: \"Focus options such as clear (boolean).\",\n },\n },\n [],\n ),\n },\n {\n name: \"pm_update\",\n description:\n \"Update pm item metadata/body/dependencies/log seeds natively. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields delta.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: { type: \"object\" },\n },\n [\"id\", \"options\"],\n ),\n },\n {\n name: \"pm_append\",\n description:\n \"Append markdown text to a pm item body and write pm history. Useful for seeding evidence/log entries before close. \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n body: {\n type: \"string\",\n description:\n \"Markdown text to append to the item body. Required here or as options.body.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n options: {\n type: \"object\",\n description: \"Append options such as body, author, and message.\",\n },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_claim\",\n description: \"Claim a pm item.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_release\",\n description: \"Release a pm item claim.\",\n inputSchema: objectSchema(\n { id: idSchema, force: { type: \"boolean\" }, options: { type: \"object\" } },\n [\"id\"],\n ),\n },\n {\n name: \"pm_close\",\n description:\n \"Close a pm item with optional close reason and optional close validation (reason requirement follows governance settings). \" +\n \"Output is compact by default (changed_fields replaced with changed_field_count); pass fullChangedFields=true for the full changed_fields array.\",\n inputSchema: objectSchema(\n {\n id: idSchema,\n reason: {\n type: \"string\",\n description:\n \"Close reason text when provided or required by governance settings.\",\n },\n duplicateOf: {\n type: \"string\",\n description:\n \"Canonical item id when closing this item as a duplicate.\",\n },\n fullChangedFields: {\n type: \"boolean\",\n description:\n \"Return full changed_fields instead of changed_field_count.\",\n },\n idOnly: { type: \"boolean\", description: \"Return only id and status.\" },\n options: { type: \"object\" },\n },\n [\"id\"],\n ),\n },\n {\n name: \"pm_comments\",\n description:\n \"List, add, edit, or delete comments on a pm item. Use options.add to append, options.edit=<1-based index> with replacement text to fix a comment, or options.delete=<1-based index> to remove one. \" +\n \"List calls default to the most recent 20 comments with total_count/has_more metadata for token efficiency. \" +\n \"Pass options.limit=N to choose a page size, options.limit=0 for summary-only metadata, or options.full=true for full history.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_files\",\n description:\n \"List, add, remove, or validate linked files for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_docs\",\n description: \"List, add, or remove linked docs for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_notes\",\n description:\n \"List or add structured notes on a pm item. Use options.add to append a note; omit it to list existing notes.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_learnings\",\n description:\n \"List or add learnings on a pm item. Use options.add to capture a learning/insight; omit it to list existing learnings.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_deps\",\n description:\n \"Read dependency trees/graphs or one bounded explainable relationship context packet. Use options.format=context with depth, node, edge, token, and cursor bounds.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_test\",\n description: \"List, add, remove, or run linked tests for a pm item.\",\n inputSchema: objectSchema({ id: idSchema, options: { type: \"object\" } }, [\n \"id\",\n ]),\n },\n {\n name: \"pm_validate\",\n description: \"Run pm validation checks.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_health\",\n description:\n \"Run pm health diagnostics. Pass options.brief=true for compact low-token details, options.skipIntegrity=true, options.skipDrift=true, options.skipVectors=true for a fast status-only check, or options.full=true for the complete deep check.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_contracts\",\n description:\n \"Inspect pm command, flag, schema, and availability contracts.\",\n inputSchema: objectSchema({ options: { type: \"object\" } }),\n },\n {\n name: \"pm_schema\",\n description:\n \"Inspect or modify the workspace item-type/status/field schema (pm schema). \" +\n \"subcommand selects the operation; name carries the item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or field key (show-field/add-field/remove-field). \" +\n \"apply-preset adopts a domain type preset; add-type with infer=true derives types from title-prefix conventions. \" +\n \"Schema mutations write workspace config files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\n \"list\",\n \"show\",\n \"show-status\",\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"add-field\",\n \"remove-field\",\n \"list-fields\",\n \"show-field\",\n \"apply-preset\",\n ],\n description: \"Schema subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Item type name (show/add-type/remove-type), status id (show-status/add-status/remove-status), or custom field key (show-field/add-field/remove-field). Required for those subcommands.\",\n },\n description: {\n type: \"string\",\n description:\n \"Custom item type, status, or field description for add-type/add-status/add-field.\",\n },\n defaultStatus: {\n type: \"string\",\n description: \"Default status for add-type.\",\n },\n folder: { type: \"string\", description: \"Storage folder for add-type.\" },\n alias: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Aliases for add-type/add-status, or extra CLI flag aliases for add-field.\",\n },\n role: {\n type: \"array\",\n items: { type: \"string\", enum: [...RUNTIME_STATUS_ROLE_VALUES] },\n description: `Lifecycle roles for add-status: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n },\n order: {\n type: \"number\",\n description: \"Display/sort order for add-status.\",\n },\n fieldType: {\n type: \"string\",\n enum: [\"string\", \"number\", \"boolean\", \"string_array\"],\n description: \"Value type for a custom field (add-field).\",\n },\n commands: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Commands a custom field is wired onto (add-field): create, update, update_many, list, search, calendar, context.\",\n },\n cliFlag: {\n type: \"string\",\n description:\n \"Override the auto-derived CLI flag for a custom field (add-field).\",\n },\n required: {\n type: \"boolean\",\n description: \"Mark a custom field as always required (add-field).\",\n },\n requiredOnCreate: {\n type: \"boolean\",\n description:\n \"Mark a custom field as required at create time (add-field).\",\n },\n allowUnset: {\n type: \"boolean\",\n description:\n \"Whether a custom field may be cleared via --unset (add-field); defaults to true.\",\n },\n requiredTypes: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Restrict a custom field's requirement to specific item types (add-field).\",\n },\n typePreset: {\n type: \"string\",\n enum: [\"agile\", \"ops\", \"research\"],\n description: \"Domain type preset to adopt (apply-preset).\",\n },\n infer: {\n type: \"boolean\",\n description:\n \"Infer item types from title-prefix conventions (add-type); previews unless apply is true.\",\n },\n minCount: {\n type: \"number\",\n description:\n \"Minimum items sharing a prefix for add-type inference (default 10).\",\n },\n apply: {\n type: \"boolean\",\n description:\n \"Register inferred types (add-type infer); without it the call previews only.\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Override removal guardrails for destructive schema changes when supported.\",\n },\n options: {\n type: \"object\",\n description: \"Additional schema options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_profile\",\n description:\n \"List, show, apply, or lint project profiles (pm profile) — archetype bundles that stage item types, statuses, fields, per-type workflows, config knobs, create templates, and recommended packages. \" +\n \"subcommand selects the operation; name carries the profile name (agile, ops, research) for show/apply/lint. \" +\n \"apply stages every dimension idempotently; dryRun previews the diff without writing; lint reports author-time consistency findings (graded error/warning) without touching the tracker. Profile staging writes workspace config/schema files, not item history.\",\n inputSchema: objectSchema(\n {\n subcommand: {\n type: \"string\",\n enum: [\"list\", \"show\", \"apply\", \"lint\"],\n description: \"Profile subcommand to run.\",\n },\n name: {\n type: \"string\",\n description:\n \"Profile name for show/apply/lint. Required for those subcommands. Built-ins are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.\",\n },\n dryRun: {\n type: \"boolean\",\n description:\n \"Preview the apply diff without writing any files (apply).\",\n },\n author: { type: \"string\", description: \"Mutation author for apply.\" },\n force: {\n type: \"boolean\",\n description: \"Force ownership/lock override for apply.\",\n },\n options: {\n type: \"object\",\n description: \"Additional profile options using camelCase keys.\",\n },\n },\n [\"subcommand\"],\n ),\n },\n {\n name: \"pm_config\",\n description:\n \"Read or write pm workspace configuration (pm config). \" +\n \"configAction selects get/set/list/export; key/value address a single setting for get/set. \" +\n \"scope chooses the project (default) or global settings file.\",\n inputSchema: objectSchema(\n {\n configAction: {\n type: \"string\",\n enum: [\"get\", \"set\", \"list\", \"export\"],\n description:\n \"Config operation to perform. get/set require key; list/export dump the resolved settings surface.\",\n },\n key: {\n type: \"string\",\n description:\n \"Settings key for get/set, for example governance-require-close-reason, telemetry-tracking, or a nested leaf such as search_provider (dash and underscore variants accepted; configAction=get without a key lists supported keys in the error).\",\n },\n value: {\n type: \"string\",\n description: \"New value for configAction=set.\",\n },\n scope: {\n type: \"string\",\n enum: [\"project\", \"global\"],\n description: \"Settings scope to read or write. Defaults to project.\",\n },\n options: {\n type: \"object\",\n description:\n \"Additional config options such as criterion, clearCriteria, format, or policy.\",\n },\n },\n [\"configAction\"],\n ),\n },\n {\n name: \"pm_plan\",\n description:\n \"Run agent-optimized Plan workflows. options.subcommand selects: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize. Provide id for all non-create subcommands; provide stepRef for step lifecycle subcommands. Plans store agent-readable steps with dependencies, decisions, discoveries, validation, and resume context.\",\n inputSchema: objectSchema({\n id: {\n type: \"string\",\n description: \"Plan id (required for all subcommands except create).\",\n },\n stepRef: {\n type: \"string\",\n description: \"Step id or order for step lifecycle subcommands.\",\n },\n reorderTo: { type: \"number\", description: \"New order for reorder-step.\" },\n options: {\n type: \"object\",\n description:\n \"Plan options including subcommand, stepRef, stepStatus, link, depth, etc.\",\n },\n }),\n },\n];\n\n/** Stable projection of one MCP tool definition for the contract golden file (pm-4os2): tool name, description, required top-level fields, and the full inputSchema shape. Any drift (typo'd property, dropped required field, changed TOOL_SCHEMA_BASE) shows up in `pnpm contracts:check`. */\nexport interface McpToolContract {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports description for this contract. */\n description: string;\n /** Value that configures or reports required for this contract. */\n required: string[];\n /** Value that configures or reports input schema for this contract. */\n input_schema: Record<string, unknown>;\n}\n\n/** Implements build mcp tool contracts for the public runtime surface of this module. */\nexport function buildMcpToolContracts(): McpToolContract[] {\n return TOOLS.map((tool) => {\n const schemaRequired = tool.inputSchema[\"required\"];\n const required = Array.isArray(schemaRequired)\n ? schemaRequired\n .map((entry) => String(entry))\n .sort((left, right) => left.localeCompare(right))\n : [];\n return {\n name: tool.name,\n description: tool.description,\n required,\n input_schema: tool.inputSchema,\n };\n }).sort((left, right) => left.name.localeCompare(right.name));\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;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AC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ;YACR,YAAY,EAAE,IAAI,CAAC,WAAW;SAC/B,CAAC;IACJ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","debugId":"478bf194-a9d0-5c6a-b70e-d15164927fda"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** First release-governance anchor after which unknown authors require remediation. */
|
|
2
|
+
export declare const HISTORY_AUTHOR_ATTRIBUTION_BASELINE = "2026-07-15T06:22:12.276Z";
|
|
3
|
+
/** Identifies one history event whose mutation author is absent or explicitly unknown. */
|
|
4
|
+
export interface UnknownAuthorHistoryEvent {
|
|
5
|
+
/** Item whose history stream contains the event. */
|
|
6
|
+
item_id: string;
|
|
7
|
+
/** One-based JSONL line number. */
|
|
8
|
+
line: number;
|
|
9
|
+
}
|
|
10
|
+
/** Summarizes mutation-author provenance across all readable tracker history streams. */
|
|
11
|
+
export interface HistoryAuthorAttributionScan {
|
|
12
|
+
/** Number of readable history streams inspected. */
|
|
13
|
+
checked_streams: number;
|
|
14
|
+
/** Number of non-empty history events inspected. */
|
|
15
|
+
checked_events: number;
|
|
16
|
+
/** Number of events without attributable authorship. */
|
|
17
|
+
unknown_event_count: number;
|
|
18
|
+
/** Immutable pre-baseline events retained as historical information. */
|
|
19
|
+
legacy_unknown_event_count: number;
|
|
20
|
+
/** Timestamped post-baseline events that require author-attribution fixes. */
|
|
21
|
+
actionable_unknown_event_count: number;
|
|
22
|
+
/** Stable, sorted item ids containing unknown-author events. */
|
|
23
|
+
affected_item_ids: string[];
|
|
24
|
+
/** Bounded examples suitable for diagnostic output. */
|
|
25
|
+
samples: UnknownAuthorHistoryEvent[];
|
|
26
|
+
}
|
|
27
|
+
/** Classifies one parsed history event by author provenance and baseline age. */
|
|
28
|
+
export declare const classifyHistoryAuthorEvent: (parsed: unknown) => "attributed" | "legacy_unknown" | "actionable_unknown";
|
|
29
|
+
/** Inspect one readable JSONL stream without performing filesystem I/O. */
|
|
30
|
+
export declare const inspectHistoryAuthorStream: (itemId: string, raw: string, sampleLimit?: number) => Pick<HistoryAuthorAttributionScan, "checked_events" | "unknown_event_count" | "legacy_unknown_event_count" | "actionable_unknown_event_count" | "samples">;
|
|
31
|
+
/**
|
|
32
|
+
* Scan append-only tracker history for missing or `unknown` author values.
|
|
33
|
+
* Malformed and unreadable streams are deliberately left to integrity diagnostics.
|
|
34
|
+
*/
|
|
35
|
+
export declare const scanHistoryAuthorAttribution: (pmRoot: string, sampleLimit?: number) => Promise<HistoryAuthorAttributionScan>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/author-attribution
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable diagnostics for mutation-author provenance in tracker history.
|
|
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]="d34bc045-ebaa-5085-ab4e-7866236c2d52")}catch(e){}}();
|
|
8
|
+
import fs from "node:fs/promises";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
/** First release-governance anchor after which unknown authors require remediation. */
|
|
11
|
+
export const HISTORY_AUTHOR_ATTRIBUTION_BASELINE = "2026-07-15T06:22:12.276Z";
|
|
12
|
+
/** Parsed epoch for the immutable attribution baseline used by every stream scan. */
|
|
13
|
+
const HISTORY_AUTHOR_ATTRIBUTION_BASELINE_MS = Date.parse(HISTORY_AUTHOR_ATTRIBUTION_BASELINE);
|
|
14
|
+
/** Attribution policy indexed by unknown-author and post-baseline flags. */
|
|
15
|
+
const HISTORY_AUTHOR_EVENT_CLASSIFICATIONS = [
|
|
16
|
+
["attributed", "attributed"],
|
|
17
|
+
["legacy_unknown", "actionable_unknown"],
|
|
18
|
+
];
|
|
19
|
+
/** Return history string fields unchanged while normalizing other values to empty text. */
|
|
20
|
+
const historyStringValue = (value) => typeof value === "string" ? value : "";
|
|
21
|
+
/** Classifies one parsed history event by author provenance and baseline age. */
|
|
22
|
+
export const classifyHistoryAuthorEvent = (parsed) => {
|
|
23
|
+
const record = (parsed ?? {});
|
|
24
|
+
const author = historyStringValue(record.author).trim().toLowerCase();
|
|
25
|
+
const authorClass = Number(["", "unknown"].includes(author));
|
|
26
|
+
const timestampClass = Number(Date.parse(historyStringValue(record.ts)) >=
|
|
27
|
+
HISTORY_AUTHOR_ATTRIBUTION_BASELINE_MS);
|
|
28
|
+
return HISTORY_AUTHOR_EVENT_CLASSIFICATIONS[authorClass][timestampClass];
|
|
29
|
+
};
|
|
30
|
+
/** Inspect one readable JSONL stream without performing filesystem I/O. */
|
|
31
|
+
export const inspectHistoryAuthorStream = (itemId, raw, sampleLimit = 20) => {
|
|
32
|
+
const samples = [];
|
|
33
|
+
const unknownCounts = {
|
|
34
|
+
legacy_unknown: 0,
|
|
35
|
+
actionable_unknown: 0,
|
|
36
|
+
};
|
|
37
|
+
const boundedSampleLimit = Math.max(0, sampleLimit);
|
|
38
|
+
let checkedEvents = 0;
|
|
39
|
+
for (const [index, line] of raw.split(/\r?\n/).entries()) {
|
|
40
|
+
let parsed;
|
|
41
|
+
try {
|
|
42
|
+
parsed = JSON.parse(line);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
checkedEvents += 1;
|
|
48
|
+
const classification = classifyHistoryAuthorEvent(parsed);
|
|
49
|
+
if (classification === "attributed") {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
unknownCounts[classification] += 1;
|
|
53
|
+
if (samples.length < boundedSampleLimit) {
|
|
54
|
+
samples.push({ item_id: itemId, line: index + 1 });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
checked_events: checkedEvents,
|
|
59
|
+
unknown_event_count: unknownCounts.legacy_unknown + unknownCounts.actionable_unknown,
|
|
60
|
+
legacy_unknown_event_count: unknownCounts.legacy_unknown,
|
|
61
|
+
actionable_unknown_event_count: unknownCounts.actionable_unknown,
|
|
62
|
+
samples,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Scan append-only tracker history for missing or `unknown` author values.
|
|
67
|
+
* Malformed and unreadable streams are deliberately left to integrity diagnostics.
|
|
68
|
+
*/
|
|
69
|
+
export const scanHistoryAuthorAttribution = async (pmRoot, sampleLimit = 20) => {
|
|
70
|
+
const historyDirectory = path.join(pmRoot, "history");
|
|
71
|
+
let fileNames;
|
|
72
|
+
try {
|
|
73
|
+
fileNames = (await fs.readdir(historyDirectory))
|
|
74
|
+
.filter((fileName) => fileName.endsWith(".jsonl"))
|
|
75
|
+
.sort((left, right) => left.localeCompare(right));
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
fileNames = [];
|
|
79
|
+
}
|
|
80
|
+
const affectedItemIds = new Set();
|
|
81
|
+
const samples = [];
|
|
82
|
+
let checkedStreams = 0;
|
|
83
|
+
let checkedEvents = 0;
|
|
84
|
+
let unknownEventCount = 0;
|
|
85
|
+
let legacyUnknownEventCount = 0;
|
|
86
|
+
let actionableUnknownEventCount = 0;
|
|
87
|
+
for (const fileName of fileNames) {
|
|
88
|
+
let raw;
|
|
89
|
+
try {
|
|
90
|
+
raw = await fs.readFile(path.join(historyDirectory, fileName), "utf8");
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const itemId = fileName.slice(0, -".jsonl".length);
|
|
96
|
+
const inspected = inspectHistoryAuthorStream(itemId, raw, sampleLimit - samples.length);
|
|
97
|
+
checkedStreams += 1;
|
|
98
|
+
checkedEvents += inspected.checked_events;
|
|
99
|
+
unknownEventCount += inspected.unknown_event_count;
|
|
100
|
+
legacyUnknownEventCount += inspected.legacy_unknown_event_count;
|
|
101
|
+
actionableUnknownEventCount += inspected.actionable_unknown_event_count;
|
|
102
|
+
if (inspected.unknown_event_count > 0) {
|
|
103
|
+
affectedItemIds.add(itemId);
|
|
104
|
+
}
|
|
105
|
+
samples.push(...inspected.samples);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
checked_streams: checkedStreams,
|
|
109
|
+
checked_events: checkedEvents,
|
|
110
|
+
unknown_event_count: unknownEventCount,
|
|
111
|
+
legacy_unknown_event_count: legacyUnknownEventCount,
|
|
112
|
+
actionable_unknown_event_count: actionableUnknownEventCount,
|
|
113
|
+
affected_item_ids: [...affectedItemIds].sort((left, right) => left.localeCompare(right)),
|
|
114
|
+
samples,
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=author-attribution.js.map
|
|
118
|
+
//# debugId=d34bc045-ebaa-5085-ab4e-7866236c2d52
|